"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[1640,4056],{91640:(e,l,t)=>{t.r(l),t.d(l,{default:()=>u});var a=t(51280),o=t(14056),n=t(76300),c=t(25536),r=t(93396),m=t(88496),i=t(24300),s=t.n(i);const u=(0,m.memo)((e=>{const{customizeUrl:l,selectedBanner:t,bannerDataLoaded:m}=(0,n.default)(),{updateField:i,setChangedField:u}=(0,c.default)();let p,d="cmplz-logo-preview";return"complianz"===e.value?d+=" cmplz-complianz-logo":"site"===e.value&&(d+=" cmplz-theme-image"),(0,a.createElement)("div",{className:"cmplz-logo-container"},(0,a.createElement)(o.default,{label:e.label,onChange:l=>{return a=l,i(e.id,a),u(e.id,a),void(document.querySelector(".cmplz-cookiebanner .cmplz-logo").innerHTML=t.logo_options[a]);var a},value:e.value,options:e.options}),"complianz"===e.value&&(0,a.createElement)("div",{className:d},(0,a.createElement)("div",{dangerouslySetInnerHTML:{__html:s().sanitize(t.logo_options[e.value])}})),"site"===e.value&&(0,a.createElement)("div",{className:d},(0,a.createElement)("div",{dangerouslySetInnerHTML:{__html:s().sanitize(t.logo_options[e.value])}}),"site"===e.value&&0===t.logo_options[e.value].length&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,r.__)("No logo found. Please add a logo in the customizer.","complianz-gdpr")))),"custom"===e.value&&(0,a.createElement)("div",{className:"cmplz-logo-preview cmplz-clickable",onClick:()=>(p||(p=wp.media({title:(0,r.__)("Select a logo","complianz-gdpr"),button:{text:(0,r.__)("Set logo","complianz-gdpr")},multiple:!1}),p.on("select",(function(){for(var e=p.state().get("selection").length,l=p.state().get("selection").models,t=0;t<e;t++){var a=l[t].id,o=!1;if((o=l[t].attributes.sizes.cmplz_banner_image)||(o=l[t].attributes.sizes.medium),o||(o=l[t].attributes.sizes.thumbnail),o||(o=l[t].attributes.sizes.full),o){var n=o.url;i("logo_attachment_id",a),u("logo_attachment_id",a);let e=document.createElement("img");document.querySelector(".cmplz-cookiebanner .cmplz-logo").appendChild(e),document.querySelector(".cmplz-cookiebanner .cmplz-logo img").src=n,document.querySelector(".cmplz-custom-image img").src=n}}}))),void p.open())},(0,a.createElement)("div",{dangerouslySetInnerHTML:{__html:s().sanitize(t.logo_options[e.value])},alt:"Banner Logo",className:"cmplz-custom-image"})))}))},14056:(e,l,t)=>{t.r(l),t.d(l,{default:()=>m});var a=t(51280),o=t(88496),n=t(39992),c=t(15832),r=t(93396);const m=(0,o.memo)((({value:e=!1,onChange:l,required:t,defaultValue:o,disabled:m,options:i={},canBeEmpty:s=!0,label:u})=>{if(Array.isArray(i)){let e={};i.map((l=>{e[l.value]=l.label})),i=e}return s?(""===e||!1===e||0===e)&&(e="0",i={0:(0,r.__)("Select an option","complianz-gdpr"),...i}):e||(e=Object.keys(i)[0]),(0,a.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:u},(0,a.createElement)(n.Ss,{value:e,defaultValue:o,onValueChange:l,required:t,disabled:m&&!Array.isArray(m)},(0,a.createElement)(n.mf,{className:"cmplz-select-group__trigger"},(0,a.createElement)(n.s3,null),(0,a.createElement)(c.default,{name:"chevron-down"})),(0,a.createElement)(n.kP,{className:"cmplz-select-group__content",position:"popper"},(0,a.createElement)(n.O4,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-up"})),(0,a.createElement)(n.mm,{className:"cmplz-select-group__viewport"},(0,a.createElement)(n.WM,null,Object.entries(i).map((([e,l])=>(0,a.createElement)(n.iY,{disabled:Array.isArray(m)&&m.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,a.createElement)(n.CC,null,l)))))),(0,a.createElement)(n.y8,{className:"cmplz-select-group__scroll-button"},(0,a.createElement)(c.default,{name:"chevron-down"})))))}))}}]);