D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
aramrprl
/
www
/
wp-content
/
plugins
/
complianz-gdpr
/
settings
/
build
/
Filename :
1137.d41a8b71772cb6b6b503.js
back
Copy
"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[1137,1356,2010,2489,2921,4078,4759,5228,7320,9091,9713,9736,9758],{7320:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var a=s(29243),r=s(86087),l=s(10790);const n=(0,r.memo)(({label:e,id:t,value:s,onChange:r,required:n,defaultValue:i,disabled:c,options:d={}})=>(0,l.jsx)(a.bL,{disabled:c&&!Array.isArray(c),className:"cmplz-input-group cmplz-radio-group",value:s,"aria-label":e,onValueChange:r,required:n,default:i,children:Object.entries(d).map(([e,s])=>(0,l.jsxs)("div",{className:"cmplz-radio-group__item",children:[(0,l.jsx)(a.q7,{disabled:Array.isArray(c)&&c.includes(e),value:e,id:t+"_"+e,children:(0,l.jsx)(a.C1,{className:"cmplz-radio-group__indicator"})}),(0,l.jsx)("label",{className:"cmplz-radio-label",htmlFor:t+"_"+e,children:s})]},e))}))},10800:(e,t,s)=>{s.r(t),s.d(t,{default:()=>C});var a=s(86087),r=s(51609),l=s(9957),n=s(91071),i=s(62133),c=s(81351),d=s(85357),o=s(54150),p=s(12579),u=s(10790),h="Switch",[m,f]=(0,i.A)(h),[b,_]=m(h),g=r.forwardRef((e,t)=>{const{__scopeSwitch:s,name:a,checked:i,defaultChecked:d,required:o,disabled:m,value:f="on",onCheckedChange:_,form:g,...x}=e,[j,k]=r.useState(null),z=(0,n.s)(t,e=>k(e)),w=r.useRef(!1),C=!j||g||!!j.closest("form"),[N,S]=(0,c.i)({prop:i,defaultProp:d??!1,onChange:_,caller:h});return(0,u.jsxs)(b,{scope:s,checked:N,disabled:m,children:[(0,u.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":N,"aria-required":o,"data-state":y(N),"data-disabled":m?"":void 0,disabled:m,value:f,...x,ref:z,onClick:(0,l.m)(e.onClick,e=>{S(e=>!e),C&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())})}),C&&(0,u.jsx)(v,{control:j,bubbles:!w.current,name:a,value:f,checked:N,required:o,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});g.displayName=h;var x="SwitchThumb",j=r.forwardRef((e,t)=>{const{__scopeSwitch:s,...a}=e,r=_(x,s);return(0,u.jsx)(p.sG.span,{"data-state":y(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:t})});j.displayName=x;var v=r.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:a=!0,...l},i)=>{const c=r.useRef(null),p=(0,n.s)(c,i),h=(0,d.Z)(s),m=(0,o.X)(t);return r.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(h!==s&&r){const t=new Event("click",{bubbles:a});r.call(e,s),e.dispatchEvent(t)}},[h,s,a]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...l,tabIndex:-1,ref:p,style:{...l.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput";var k=g,z=j,w=s(4219);const C=(0,a.memo)(({value:e,onChange:t,required:s,disabled:a,className:r,label:l,id:n})=>{const{getField:i}=(0,w.default)();let c=e;return"0"!==e&&"1"!==e||(c="1"===e),(0,u.jsx)("div",{className:"cmplz-input-group cmplz-switch-group",children:(0,u.jsx)(k,{className:"cmplz-switch-root "+r,checked:c,onCheckedChange:e=>{"banner"===i(n).data_target&&(e=e?"1":"0"),t(e)},disabled:a,required:s,children:(0,u.jsx)(z,{className:"cmplz-switch-thumb"})})})})},25228:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(86087),r=s(21366),l=s(45111),n=s(27723),i=s(10790);const c=(0,a.memo)(({value:e=!1,onChange:t,required:s,defaultValue:a,disabled:c,options:d={},canBeEmpty:o=!0,label:p})=>{if(Array.isArray(d)){let e={};d.map(t=>{e[t.value]=t.label}),d=e}return o?(""===e||!1===e||0===e)&&(e="0",d={0:(0,n.__)("Select an option","complianz-gdpr"),...d}):e||(e=Object.keys(d)[0]),(0,i.jsx)("div",{className:"cmplz-input-group cmplz-select-group",children:(0,i.jsxs)(r.bL,{value:e,defaultValue:a,onValueChange:t,required:s,disabled:c&&!Array.isArray(c),children:[(0,i.jsxs)(r.l9,{className:"cmplz-select-group__trigger",children:[(0,i.jsx)(r.WT,{}),(0,i.jsx)(l.default,{name:"chevron-down"})]}),(0,i.jsxs)(r.UC,{className:"cmplz-select-group__content",position:"popper",children:[(0,i.jsx)(r.PP,{className:"cmplz-select-group__scroll-button",children:(0,i.jsx)(l.default,{name:"chevron-up"})}),(0,i.jsx)(r.LM,{className:"cmplz-select-group__viewport",children:(0,i.jsx)(r.YJ,{children:Object.entries(d).map(([e,t])=>(0,i.jsx)(r.q7,{disabled:Array.isArray(c)&&c.includes(e),className:"cmplz-select-group__item",value:e,children:(0,i.jsx)(r.p4,{children:t})},e))})}),(0,i.jsx)(r.wn,{className:"cmplz-select-group__scroll-button",children:(0,i.jsx)(l.default,{name:"chevron-down"})})]})]})},p)})},31356:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});var a=s(7320),r=s(27723),l=s(34759),n=s(10790);const i=e=>{const{setScript:t,fetching:s}=(0,l.default)(),i=e.script,c={statistics:(0,r.__)("Statistics","complianz-gdpr"),marketing:(0,r.__)("Marketing","complianz-gdpr")};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{children:(0,r.__)("Category","complianz-gdpr")}),(0,n.jsx)(a.default,{disabled:s,label:(0,r.__)("Marketing","complianz-gdpr"),id:"category",value:i.category,onChange:s=>(s=>{let a={...i};a.category=s,t(a,e.type)})(s),defaultValue:"marketing",options:c})]})}},32489:(e,t,s)=>{s.r(t),s.d(t,{default:()=>l});var a=s(51609),r=s(10790);const l=(0,a.memo)(({value:e,onChange:t,required:s,disabled:l,id:n,name:i,placeholder:c})=>{const d=n||i,[o,p]=(0,a.useState)("");return(0,a.useEffect)(()=>{p(e||"")},[e]),(0,a.useEffect)(()=>{if(e===o)return;const s=setTimeout(()=>{t(o)},400);return()=>{clearTimeout(s)}},[o]),(0,r.jsx)("div",{className:"cmplz-input-group cmplz-text-input-group",children:(0,r.jsx)("input",{type:"text",id:d,name:i,value:o,onChange:e=>(e=>{p(e)})(e.target.value),required:s,disabled:l,className:"cmplz-text-input-group__input",placeholder:c})})})},32921:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var a=s(27723),r=s(44124),l=s(10790);const n=e=>(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(r.default,{url:e,target:"_blank",rel:"noopener noreferrer",text:(0,a.__)("For more information, please read this %sarticle%s.","complianz-gdpr")})," "]})},34759:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var a=s(81621),r=s(16535),l=s(9588);const n=(0,a.vt)((e,t)=>({integrationsLoaded:!1,fetching:!1,services:[],plugins:[],scripts:[],placeholders:[],blockedScripts:[],setScript:(t,s)=>{e((0,r.Ay)(e=>{if("block_script"===s){let s=e.blockedScripts;if(t.urls){for(const[e,a]of Object.entries(t.urls)){if(!a||0===a.length)continue;let e=!1;for(const[t,r]of Object.entries(s))a===t&&(e=!0);e||(s[a]=a)}e.blockedScripts=s}}const a=e.scripts[s].findIndex(e=>e.id===t.id);-1!==a&&(e.scripts[s][a]=t)}))},fetchIntegrationsData:async()=>{if(t().fetching)return;e({fetching:!0});const{services:s,plugins:a,scripts:r,placeholders:l,blocked_scripts:n}=await i();let c=r;c.block_script&&c.block_script.length>0&&c.block_script.forEach((e,t)=>{e.id=t}),c.add_script&&c.add_script.length>0&&c.add_script.forEach((e,t)=>{e.id=t}),c.whitelist_script&&c.whitelist_script.length>0&&c.whitelist_script.forEach((e,t)=>{e.id=t}),e(()=>({integrationsLoaded:!0,services:s,plugins:a,scripts:c,fetching:!1,placeholders:l,blockedScripts:n}))},addScript:s=>{e({fetching:!0}),t().scripts[s]&&Array.isArray(t().scripts[s])||e((0,r.Ay)(e=>{e.scripts[s]=[]})),e((0,r.Ay)(e=>{e.scripts[s].push({name:"general",id:e.scripts[s].length,enable:!0})}));let a=t().scripts;return l.doAction("update_scripts",{scripts:a}).then(t=>(e({fetching:!1}),t)).catch(e=>{console.error(e)})},saveScript:(s,a)=>{e({fetching:!0}),t().scripts[a]&&Array.isArray(t().scripts[a])||e((0,r.Ay)(e=>{e.scripts[a]=[]})),e((0,r.Ay)(e=>{const t=e.scripts[a].findIndex(e=>e.id===s.id);-1!==t&&(e.scripts[a][t]=s)}));let n=t().scripts;return l.doAction("update_scripts",{scripts:n}).then(t=>(e({fetching:!1}),t)).catch(e=>{console.error(e)})},deleteScript:(s,a)=>{e({fetching:!0}),t().scripts[a]&&Array.isArray(t().scripts[a])||e((0,r.Ay)(e=>{e.scripts[a]=[]})),e((0,r.Ay)(e=>{const t=e.scripts[a].findIndex(e=>e.id===s.id);-1!==t&&e.scripts[a].splice(t,1)}));let n=t().scripts;return l.doAction("update_scripts",{scripts:n}).then(t=>(e({fetching:!1}),t)).catch(e=>{console.error(e)})},updatePluginStatus:async(t,s)=>{e({fetching:!0}),e((0,r.Ay)(e=>{const a=e.plugins.findIndex(e=>e.id===t);-1!==a&&(e.plugins[a].enabled=s)}));const a=await l.doAction("update_plugin_status",{plugin:t,enabled:s}).then(e=>e).catch(e=>{console.error(e)});return e({fetching:!1}),a},updatePlaceholderStatus:async(t,s,a)=>{e({fetching:!0}),a&&e((0,r.Ay)(e=>{const a=e.plugins.findIndex(e=>e.id===t);-1!==a&&(e.plugins[a].placeholder=s?"enabled":"disabled")}));const n=await l.doAction("update_placeholder_status",{id:t,enabled:s}).then(e=>e).catch(e=>{console.error(e)});return e({fetching:!1}),n}})),i=()=>l.doAction("get_integrations_data",{}).then(e=>e).catch(e=>{console.error(e)})},44078:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var a=s(27723),r=s(32921),l=s(32489),n=s(45111),i=s(34759),c=s(51609),d=s(10790);const o=e=>{const{setScript:t,fetching:s}=(0,i.default)(),[o,p]=(0,c.useState)(!1),u=e.script,h=e.type;(0,c.useEffect)(()=>{(u.hasOwnProperty("urls")?Object.values(u.urls):[""]).includes("")?p(!0):p(!1)},[u]);let m=u.hasOwnProperty("urls")?Object.entries(u.urls):[""];return(0,d.jsxs)("div",{className:"cmplz-details-row",children:[(0,d.jsxs)("label",{children:["block_script"===h&&(0,a.__)("URLs that should be blocked before consent.","complianz-gdpr"),"whitelist_script"===h&&(0,d.jsxs)(d.Fragment,{children:[(0,a.__)("URLs that should be whitelisted.","complianz-gdpr"),(0,r.default)("https://complianz.io/whitelisting-inline-script/")]})]}),m.map(([a,r],i)=>(0,d.jsxs)("div",{className:"cmplz-scriptcenter-url",children:[(0,d.jsx)(l.default,{disabled:s,value:r||"",onChange:s=>((s,a)=>{let r={...u},l={...r.urls};l[s]=a,r.urls=l,t(r,e.type)})(a,s),id:i+"_url",name:"url"}),0===i&&!o&&(0,d.jsxs)("button",{className:"button button-default",onClick:()=>(()=>{let s={...u},a=s.hasOwnProperty("urls")?{...s.urls}:[""];a[Object.keys(a).length+1]="",s.urls=a,t(s,e.type)})(),children:[" ",(0,d.jsx)(n.default,{name:"plus",size:14})]}),0!==i&&(0,d.jsxs)("button",{className:"button button-default",onClick:()=>(s=>{let a={...u},r={...a.urls};delete r[s],a.urls=r,t(a,e.type)})(a),children:[" ",(0,d.jsx)(n.default,{name:"minus",size:14})]})]},i))]})}},48033:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(27723),r=(s(10800),s(25228)),l=s(34759),n=s(81366),i=s(10790);const c=e=>{const{setScript:t,blockedScripts:s,fetching:c}=(0,l.default)(),d=s,o=e.script,p=e=>{if(!o.dependency||0===o.dependency.length)return"";let t=Object.entries(o.dependency);for(const[s,a]of t)if(s===e)return a;return""},u=(e,t)=>{let s={...e};for(const[e,a]of Object.entries(s))if(a===t){delete s[e];break}return s};let h=o.hasOwnProperty("urls")?Object.entries(o.urls):[""];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:(0,i.jsx)(n.default,{id:o.id+"dependency",disabled:c,value:o.enable_dependency,onChange:s=>(s=>{let a={...o};a.enable_dependency=s,t(a,e.type)})(s),options:{true:(0,a.__)("Enable dependency","complianz-gdpr")}})}),!!o.enable_dependency&&(0,i.jsxs)("div",{className:"cmplz-details-row cmplz-details-row",children:[h.length>1&&h.map(([s,l],n)=>(0,i.jsxs)("div",{className:"cmplz-scriptcenter-dependencies",children:[(0,i.jsx)(r.default,{disabled:c,value:p(l),options:u(d,l),onChange:s=>((s,a)=>{let r={...o},l={...r.dependency};l[a]=s,r.dependency=l,t(r,e.type)})(s,l)}),(0,i.jsxs)("div",{children:[(0,a.__)("waits for: ","complianz-gdpr"),l||(0,a.__)("Empty URL","complianz-gdpr")]})]},n)),h.length<=1&&(0,i.jsx)(i.Fragment,{children:(0,a.__)("Add a URL to create a dependency between two URLs","complianz-gdpr")})]})]})}},52010:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var a=s(45111),r=s(86087),l=s(10790);const n=e=>{const[t,s]=(0,r.useState)(!1);return(0,l.jsx)("div",{className:"cmplz-panel__list__item",style:e.style?e.style:{},children:(0,l.jsxs)("details",{open:t,children:[(0,l.jsxs)("summary",{onClick:e=>(e=>{e.preventDefault(),s(!t)})(e),children:[e.icon&&(0,l.jsx)(a.default,{name:e.icon}),(0,l.jsx)("h5",{className:"cmplz-panel__list__item__title",children:e.summary}),(0,l.jsx)("div",{className:"cmplz-panel__list__item__comment",children:e.comment}),(0,l.jsx)("div",{className:"cmplz-panel__list__item__icons",children:e.icons}),(0,l.jsx)(a.default,{name:"chevron-down",size:18})]}),(0,l.jsx)("div",{className:"cmplz-panel__list__item__details",children:t&&e.details})]})})}},59736:(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});var a=s(52010),r=s(27723),l=s(34759),n=s(89713),i=s(10800),c=s(86087),d=s(31356),o=s(60847),p=s(48033),u=s(44078),h=s(81366),m=s(10790);const f=(0,c.memo)(e=>{const{setScript:t,fetching:s,saveScript:c,deleteScript:f}=(0,l.default)(),b=e.script,_=(s,a)=>{let r={...b};r[a]=s,t(r,e.type),c(r,e.type)},g=(s,a)=>{let r={...b};r[a]=s,t(r,e.type)},x=()=>{c(b,e.type)},j=()=>{f(b,e.type)};return b?(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(a.default,{summary:b.name,icons:(e=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.default,{className:"cmplz-switch-input-tiny",onChange:e=>_(e,"enable"),value:e.enable})}))(b),details:((e,t)=>{const{fetching:s}=(0,l.default)();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"cmplz-details-row",children:[(0,m.jsx)("label",{children:(0,r.__)("Name","complianz-gdpr")}),(0,m.jsx)("input",{disabled:s,onChange:e=>g(e.target.value,"name"),type:"text",placeholder:(0,r.__)("Name","complianz-gdpr"),value:e.name})]}),"add_script"===t&&(0,m.jsx)("div",{className:"cmplz-details-row",children:(0,m.jsx)(n.default,{disabled:s,onChange:e=>(e=>{g(e,"editor")})(e),placeholder:"Enter your script here",value:e.editor?e.editor:console.log("marketing enabled")})}),("block_script"===t||"whitelist_script"===t)&&(0,m.jsx)(u.default,{script:e,type:t}),"whitelist_script"!==t&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:(0,m.jsx)(h.default,{id:e.id,disabled:s,value:e.async,onChange:e=>g(e,"async"),options:{true:(0,r.__)("This script contains an async attribute.","complianz-gdpr")}})}),(0,m.jsx)("div",{className:"cmplz-details-row",children:(0,m.jsx)(d.default,{script:e,type:t})}),(0,m.jsx)(o.default,{script:e,type:t})]}),"block_script"===t&&(0,m.jsxs)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:[(0,m.jsx)("label",{children:(0,r.__)("Dependency","complianz-gdpr")}),(0,m.jsx)(p.default,{script:e,type:t})]}),(0,m.jsxs)("div",{className:"cmplz-details-row cmplz-details-row__buttons",children:[(0,m.jsx)("button",{disabled:s,onClick:e=>x(),className:"button button-default",children:(0,r.__)("Save","complianz-gdpr")}),(0,m.jsx)("button",{disabled:s,className:"button button-default cmplz-reset-button",onClick:e=>j(),children:(0,r.__)("Delete","complianz-gdpr")})]})]})})(b,e.type)})}):(0,m.jsx)(a.default,{summary:"..."})})},60847:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o}),s(10800);var a=s(32921),r=s(32489),l=s(25228),n=s(27723),i=s(34759),c=s(81366),d=s(10790);const o=e=>{const{setScript:t,fetching:s,placeholders:o}=(0,i.default)(),p=e.script,u=e.type,h=(s,a)=>{let r={...p};r[a]=s,t(r,e.type)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:[(0,d.jsx)("label",{children:(0,n.__)("Placeholder","complianz-gdpr")}),(0,d.jsx)(c.default,{id:p.id+"placeholder",disabled:s,value:p.enable_placeholder,onChange:e=>h(e,"enable_placeholder"),options:{true:(0,n.__)("Enable placeholder","complianz-gdpr")}})]}),!!p.enable_placeholder&&(0,d.jsxs)(d.Fragment,{children:["block_script"===u&&(0,d.jsx)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:(0,d.jsx)(c.default,{id:p.id+"iframe",disabled:s,value:p.iframe||"",onChange:e=>h(e||"","iframe"),options:{true:(0,n.__)("The blocked content is an iframe","complianz-gdpr")}})}),!p.iframe&&(0,d.jsxs)("div",{className:"cmplz-details-row cmplz-details-row",children:[(0,d.jsxs)("p",{children:[(0,n.__)("Enter the div class or ID that should be targeted.","complianz-gdpr"),(0,a.default)("https://complianz.io/integrating-plugins/#placeholder/")]}),(0,d.jsx)(r.default,{disabled:s,value:p.placeholder_class||"",onChange:e=>h(e||"","placeholder_class"),name:"placeholder_class",placeholder:(0,n.__)("Your CSS class","complianz-gdpr")})]}),(0,d.jsx)("div",{className:"cmplz-details-row cmplz-details-row__checkbox",children:(0,d.jsx)(l.default,{disabled:s,value:p.placeholder?p.placeholder:"default",options:o,onChange:e=>h(e||"default","placeholder")})})]})]})}},79758:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var a=s(86087),r=s(9588),l=s(4219),n=s(52043),i=s(56427),c=s(99091),d=s(32828),o=s(10790);const p=(0,a.memo)(({type:e="action",style:t="tertiary",label:s,onClick:p,href:u="",target:h="",disabled:m,action:f,field:b,children:_})=>{if(!s&&!_)return null;const g=(b&&b.button_text?b.button_text:s)||_,{fetchFieldsData:x,showSavedSettingsNotice:j}=(0,l.default)(),{setInitialLoadCompleted:v,setProgress:y}=(0,c.UseCookieScanData)(),{setProgressLoaded:k}=(0,d.default)(),{selectedSubMenuItem:z}=(0,n.default)(),[w,C]=(0,a.useState)(!1),N=`button cmplz-button button--${t} button-${e}`,S=async e=>{await r.doAction(b.action,{}).then(e=>{e.success&&(x(z),"reset_settings"===e.id&&(v(!1),y(0),k(!1)),j(e.message))})},A=b&&b.warn?b.warn:"";return"action"===e?(0,o.jsxs)(o.Fragment,{children:[i.__experimentalConfirmDialog&&(0,o.jsx)(i.__experimentalConfirmDialog,{isOpen:w,onConfirm:async()=>{C(!1),await S()},onCancel:()=>{C(!1)},children:A}),(0,o.jsx)("button",{className:N,onClick:async t=>{if("action"!==e||!p)return"action"===e&&f?i.__experimentalConfirmDialog?void(b&&b.warn?C(!0):await S()):void await S():void(window.location.href=b.url);p(t)},disabled:m,children:g})]}):"link"===e?(0,o.jsx)("a",{className:N,href:u,target:h,children:g}):void 0})},81366:(e,t,s)=>{s.r(t),s.d(t,{default:()=>F});var a=s(51609),r=s(91071),l=s(62133),n=s(9957),i=s(81351),c=s(85357),d=s(54150),o=s(7971),p=s(12579),u=s(10790),h="Checkbox",[m,f]=(0,l.A)(h),[b,_]=m(h);function g(e){const{__scopeCheckbox:t,checked:s,children:r,defaultChecked:l,disabled:n,form:c,name:d,onCheckedChange:o,required:p,value:m="on",internal_do_not_use_render:f}=e,[_,g]=(0,i.i)({prop:s,defaultProp:l??!1,onChange:o,caller:h}),[x,j]=a.useState(null),[v,y]=a.useState(null),k=a.useRef(!1),z=!x||!!c||!!x.closest("form"),w={checked:_,disabled:n,setChecked:g,control:x,setControl:j,name:d,form:c,value:m,hasConsumerStoppedPropagationRef:k,required:p,defaultChecked:!N(l)&&l,isFormControl:z,bubbleInput:v,setBubbleInput:y};return(0,u.jsx)(b,{scope:t,...w,children:C(f)?f(w):r})}var x="CheckboxTrigger",j=a.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:s,...l},i)=>{const{control:c,value:d,disabled:o,checked:h,required:m,setControl:f,setChecked:b,hasConsumerStoppedPropagationRef:g,isFormControl:j,bubbleInput:v}=_(x,e),y=(0,r.s)(i,f),k=a.useRef(h);return a.useEffect(()=>{const e=c?.form;if(e){const t=()=>b(k.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[c,b]),(0,u.jsx)(p.sG.button,{type:"button",role:"checkbox","aria-checked":N(h)?"mixed":h,"aria-required":m,"data-state":S(h),"data-disabled":o?"":void 0,disabled:o,value:d,...l,ref:y,onKeyDown:(0,n.m)(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.m)(s,e=>{b(e=>!!N(e)||!e),v&&j&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})});j.displayName=x;var v=a.forwardRef((e,t)=>{const{__scopeCheckbox:s,name:a,checked:r,defaultChecked:l,required:n,disabled:i,value:c,onCheckedChange:d,form:o,...p}=e;return(0,u.jsx)(g,{__scopeCheckbox:s,checked:r,defaultChecked:l,disabled:i,required:n,onCheckedChange:d,name:a,form:o,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(j,{...p,ref:t,__scopeCheckbox:s}),e&&(0,u.jsx)(w,{__scopeCheckbox:s})]})})});v.displayName=h;var y="CheckboxIndicator",k=a.forwardRef((e,t)=>{const{__scopeCheckbox:s,forceMount:a,...r}=e,l=_(y,s);return(0,u.jsx)(o.C,{present:a||N(l.checked)||!0===l.checked,children:(0,u.jsx)(p.sG.span,{"data-state":S(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});k.displayName=y;var z="CheckboxBubbleInput",w=a.forwardRef(({__scopeCheckbox:e,...t},s)=>{const{control:l,hasConsumerStoppedPropagationRef:n,checked:i,defaultChecked:o,required:h,disabled:m,name:f,value:b,form:g,bubbleInput:x,setBubbleInput:j}=_(z,e),v=(0,r.s)(s,j),y=(0,c.Z)(i),k=(0,d.X)(l);a.useEffect(()=>{const e=x;if(!e)return;const t=window.HTMLInputElement.prototype,s=Object.getOwnPropertyDescriptor(t,"checked").set,a=!n.current;if(y!==i&&s){const t=new Event("click",{bubbles:a});e.indeterminate=N(i),s.call(e,!N(i)&&i),e.dispatchEvent(t)}},[x,y,i,n]);const w=a.useRef(!N(i)&&i);return(0,u.jsx)(p.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??w.current,required:h,disabled:m,name:f,value:b,form:g,...t,tabIndex:-1,ref:v,style:{...t.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function C(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function S(e){return N(e)?"indeterminate":e?"checked":"unchecked"}w.displayName=z;var A=s(27723),L=s(45111),E=s(86087),I=s(79758);const F=(0,E.memo)(({indeterminate:e,label:t,value:s,id:a,onChange:r,required:l,disabled:n,options:i={}})=>{const[c,d]=(0,E.useState)(!1),[o,p]=(0,E.useState)(!1);let h=s;Array.isArray(h)||(h=""===h?[]:[h]),(0,E.useEffect)(()=>{let e=1===Object.keys(i).length&&"true"===Object.keys(i)[0];d(e)},[]),e&&(s=!0);const m=h;let f=!1;Object.keys(i).length>10&&(f=!0);const b=e=>c?s:m.includes(""+e)||m.includes(parseInt(e)),_=()=>{p(!o)};let g=n&&!Array.isArray(n);return 0===Object.keys(i).length?(0,u.jsx)(u.Fragment,{children:(0,A.__)("No options found","complianz-gdpr")}):(0,u.jsxs)("div",{className:"cmplz-checkbox-group",children:[Object.entries(i).map(([i,d],p)=>(0,u.jsxs)("div",{className:"cmplz-checkbox-group__item"+(!o&&p>9?" cmplz-hidden":""),children:[(0,u.jsx)(v,{className:"cmplz-checkbox-group__checkbox",id:a+"_"+i,checked:b(i),"aria-label":t,disabled:g||Array.isArray(n)&&n.includes(i),required:l,onCheckedChange:e=>((e,t)=>{if(c)r(!s);else{const e=m.includes(""+t)||m.includes(parseInt(t))?m.filter(e=>e!==""+t&&e!==parseInt(t)):[...m,t];r(e)}})(0,i),children:(0,u.jsx)(k,{className:"cmplz-checkbox-group__indicator",children:(0,u.jsx)(L.default,{name:e?"indeterminate":"check",size:14,color:"dark-blue"})})}),(0,u.jsx)("label",{className:"cmplz-checkbox-group__label",htmlFor:a+"_"+i,children:d})]},i)),!o&&f&&(0,u.jsx)(I.default,{onClick:()=>_(),children:(0,A.__)("Show more","complianz-gdpr")}),o&&f&&(0,u.jsx)(I.default,{onClick:()=>_(),children:(0,A.__)("Show less","complianz-gdpr")})]})})},89713:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(86087),r=s(70470),l=(s(43158),s(51289),s(20047),s(27723)),n=s(45111),i=s(10790);const c=(0,a.memo)(e=>{let t=e.mode?e.mode:"css",s=e.height?e.height:"200px",c=e.field&&e.field.default?e.field.default:e.placeholder;const[d,o]=(0,a.useState)(e.value),[p,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(d===e.value)return;const t=setTimeout(()=>{e.onChange(d)},500);return()=>{clearTimeout(t)}},[d]);let h=e.disabled?"cmplz-editor-disabled":"";return(0,i.jsxs)("div",{className:h,children:[p&&(0,i.jsxs)("div",{className:"cmplz-error-text",children:[(0,i.jsx)(n.default,{name:"error",size:13,color:"red"}),(0,i.jsx)("p",{children:(0,l.__)("Write your JavaScript without wrapping it in script tags.","complianz-gdpr")})]}),(0,i.jsx)(r.Ay,{readOnly:e.disabled,placeholder:"//"+c,mode:t,theme:"monokai",width:"100%",height:s,onChange:e=>(e=>{(e.includes("<script>")||e.includes("<\/script>"))&&u(!0),e=(e=e.replace(/<script>/gi,"")).replace(/<\/script>/gi,""),o(e)})(e),fontSize:12,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,value:d,setOptions:{enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,enableSnippets:!1,showLineNumbers:!0,tabSize:2,useWorker:!1}})]})})},91137:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var a=s(34759),r=s(4219),l=s(59736),n=s(32921),i=s(86087),c=s(27723),d=s(10790);const o=(0,i.memo)(()=>{const{scripts:e,addScript:t,saveScript:s,integrationsLoaded:o,fetchIntegrationsData:p}=(0,a.default)(),[u,h]=(0,i.useState)(!1),[m,f]=(0,i.useState)(""),{getFieldValue:b}=(0,r.default)();return(0,i.useEffect)(()=>{o||p(),o&&1==b("safe_mode")&&(f((0,c.__)("Safe Mode enabled. To manage integrations, disable Safe Mode under Tools - Support.","complianz-gdpr")),h(!0))},[o]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{children:[(0,c.__)("The script center should be used to add and block third-party scripts and iFrames before consent is given, or when consent is revoked. For example Hotjar and embedded video’s.","complianz-gdpr"),(0,n.default)("https://complianz.io/script-center/")]}),u&&(0,d.jsx)("div",{className:"cmplz-settings-overlay",children:(0,d.jsx)("div",{className:"cmplz-settings-overlay-message",children:m})}),(0,d.jsx)("h5",{children:(0,c.__)("Add a third-party script","complianz-gdpr")}),!o&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsx)(l.default,{type:"add_script"})]}),o&&e.add_script.length>0&&e.add_script.map((e,t)=>(0,d.jsx)(l.default,{type:"add_script",script:e},t)),(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>t("add_script"),className:"button button-default",children:(0,c.__)("Add new","complianz-gdpr")})}),(0,d.jsx)("h5",{children:(0,c.__)("Block a script, iframe or plugin","complianz-gdpr")}),!o&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsx)(l.default,{type:"block_script"})]}),o&&e.block_script.length>0&&e.block_script.map((e,t)=>(0,d.jsx)(l.default,{type:"block_script",script:e},t)),(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>t("block_script"),className:"button button-default",children:(0,c.__)("Add new","complianz-gdpr")})}),(0,d.jsx)("h5",{children:(0,c.__)("Whitelist a script, iframe or plugin\n","complianz-gdpr")}),!o&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsx)(l.default,{type:"whitelist_script"})]}),o&&e.whitelist_script.length>0&&e.whitelist_script.map((e,t)=>(0,d.jsx)(l.default,{type:"whitelist_script",script:e},t)),(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>t("whitelist_script"),className:"button button-default",children:(0,c.__)("Add new","complianz-gdpr")})})]})})},99091:(e,t,s)=>{s.r(t),s.d(t,{UseCookieScanData:()=>l});var a=s(81621),r=s(9588);const l=(0,a.vt)((e,t)=>({initialLoadCompleted:!1,setInitialLoadCompleted:t=>e({initialLoadCompleted:t}),iframeLoaded:!1,loading:!1,nextPage:!1,progress:0,cookies:[],lastLoadedIframe:"",setIframeLoaded:t=>e({iframeLoaded:t}),setLastLoadedIframe:t=>e(e=>({lastLoadedIframe:t})),setProgress:t=>e({progress:t}),fetchProgress:()=>(e({loading:!0}),r.doAction("get_scan_progress",{}).then(t=>(e({initialLoadCompleted:!0,loading:!1,nextPage:t.next_page,progress:t.progress,cookies:t.cookies}),t)))}))}}]);