"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[2868,9091,9758],{79758:(e,a,t)=>{t.r(a),t.d(a,{default:()=>m});var s=t(86087),o=t(9588),i=t(4219),n=t(52043),r=t(56427),l=t(99091),c=t(32828),d=t(10790);const m=(0,s.memo)((({type:e="action",style:a="tertiary",label:t,onClick:m,href:u="",target:p="",disabled:h,action:g,field:b,children:f})=>{if(!t&&!f)return null;const _=(b&&b.button_text?b.button_text:t)||f,{fetchFieldsData:k,showSavedSettingsNotice:x}=(0,i.default)(),{setInitialLoadCompleted:C,setProgress:j}=(0,l.UseCookieScanData)(),{setProgressLoaded:y}=(0,c.default)(),{selectedSubMenuItem:w}=(0,n.default)(),[L,z]=(0,s.useState)(!1),v=`button cmplz-button button--${a} button-${e}`,I=async e=>{await o.doAction(b.action,{}).then((e=>{e.success&&(k(w),"reset_settings"===e.id&&(C(!1),j(0),y(!1)),x(e.message))}))},S=b&&b.warn?b.warn:"";return"action"===e?(0,d.jsxs)(d.Fragment,{children:[r.__experimentalConfirmDialog&&(0,d.jsx)(r.__experimentalConfirmDialog,{isOpen:L,onConfirm:async()=>{z(!1),await I()},onCancel:()=>{z(!1)},children:S}),(0,d.jsx)("button",{className:v,onClick:async a=>{if("action"!==e||!m)return"action"===e&&g?r.__experimentalConfirmDialog?void(b&&b.warn?z(!0):await I()):void await I():void(window.location.href=b.url);m(a)},disabled:h,children:_})]}):"link"===e?(0,d.jsx)("a",{className:v,href:u,target:p,children:_}):void 0}))},82868:(e,a,t)=>{t.r(a),t.d(a,{default:()=>c});var s=t(92731),o=t(27723),i=t(45111),n=t(86087),r=t(79758),l=t(10790);const c=(0,n.memo)((({indeterminate:e,label:a,value:t,id:c,onChange:d,required:m,disabled:u,options:p={}})=>{const[h,g]=(0,n.useState)(!1),[b,f]=(0,n.useState)(!1);let _=t;Array.isArray(_)||(_=""===_?[]:[_]),(0,n.useEffect)((()=>{let e=1===Object.keys(p).length&&"true"===Object.keys(p)[0];g(e)}),[]),e&&(t=!0);const k=_;let x=!1;Object.keys(p).length>10&&(x=!0);const C=e=>h?t:k.includes(""+e)||k.includes(parseInt(e)),j=()=>{f(!b)};let y=u&&!Array.isArray(u);return 0===Object.keys(p).length?(0,l.jsx)(l.Fragment,{children:(0,o.__)("No options found","complianz-gdpr")}):(0,l.jsxs)("div",{className:"cmplz-checkbox-group",children:[Object.entries(p).map((([o,n],r)=>(0,l.jsxs)("div",{className:"cmplz-checkbox-group__item"+(!b&&r>9?" cmplz-hidden":""),children:[(0,l.jsx)(s.bL,{className:"cmplz-checkbox-group__checkbox",id:c+"_"+o,checked:C(o),"aria-label":a,disabled:y||Array.isArray(u)&&u.includes(o),required:m,onCheckedChange:e=>((e,a)=>{if(h)d(!t);else{const e=k.includes(""+a)||k.includes(parseInt(a))?k.filter((e=>e!==""+a&&e!==parseInt(a))):[...k,a];d(e)}})(0,o),children:(0,l.jsx)(s.C1,{className:"cmplz-checkbox-group__indicator",children:(0,l.jsx)(i.default,{name:e?"indeterminate":"check",size:14,color:"dark-blue"})})}),(0,l.jsx)("label",{className:"cmplz-checkbox-group__label",htmlFor:c+"_"+o,children:n})]},o))),!b&&x&&(0,l.jsx)(r.default,{onClick:()=>j(),children:(0,o.__)("Show more","complianz-gdpr")}),b&&x&&(0,l.jsx)(r.default,{onClick:()=>j(),children:(0,o.__)("Show less","complianz-gdpr")})]})}))},99091:(e,a,t)=>{t.r(a),t.d(a,{UseCookieScanData:()=>i});var s=t(81621),o=t(9588);const i=(0,s.vt)(((e,a)=>({initialLoadCompleted:!1,setInitialLoadCompleted:a=>e({initialLoadCompleted:a}),iframeLoaded:!1,loading:!1,nextPage:!1,progress:0,cookies:[],lastLoadedIframe:"",setIframeLoaded:a=>e({iframeLoaded:a}),setLastLoadedIframe:a=>e((e=>({lastLoadedIframe:a}))),setProgress:a=>e({progress:a}),fetchProgress:()=>(e({loading:!0}),o.doAction("get_scan_progress",{}).then((a=>(e({initialLoadCompleted:!0,loading:!1,nextPage:a.next_page,progress:a.progress,cookies:a.cookies}),a))))})))}}]);