!function(){var e={};e=React;var t=t=>{let{control:n,customizerSetting:o,defaultArray:i,valueArray:r,valueUnit:a}=t,[l,c]=(0,e.useState)(()=>r),s=e=>{let t="",n="",o="";return""!==e&&(o=-1<(e=(e="string"!=typeof e?e.toString():e).trim()).indexOf("-")?"-":"",""!==(e=e.replace(o,""))?(t=e.replace(/\d+/g,""),n=parseFloat(n=o+(n=e.replace(t,"")).trim())):n=o),{unit:t,number:n}},u=e=>{let t;for(let n in e)Object.hasOwnProperty.call(e,n)&&(""!==(t=e[n])&&(t=(t=s(t)).number+a),e[n]=t);return e};n.updateComponentState=e=>{c((e=>{let t;for(let n in e)Object.hasOwnProperty.call(e,n)&&(t=s(e[n]),e[n]=t.number);return e})(e))};let m=`kirki-control-input-${t.type}-top`,p=(0,e.useRef)(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},(t.label||t.description)&&React.createElement(React.Fragment,null,React.createElement("label",{className:"kirki-control-label",htmlFor:m},t.label&&React.createElement("span",{className:"customize-control-title"},t.label),t.description&&React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:t.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:t.setNotificationContainer})),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:e=>{let n=""!==t.default&&void 0!==t.default?i:r;o.set(u(n))}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("div",{class:"kirki-control-fields"},(()=>{let e=[];for(let t in l)Object.hasOwnProperty.call(l,t)&&e.push({position:t,value:l[t]});return e})(l).map(e=>{let n=`kirki-control-input kirki-control-input-${e.position}`,i=`kirki-control-input-${t.type}-${e.position}`;return React.createElement("div",{class:"kirki-control-field"},React.createElement("input",{id:i,type:"number",value:e.value||0===e.value?e.value:"",className:n,onChange:t=>{var n;let i;return n=e.position,void((i={...l})[n]=t.target.value,o.set(u(i)))}}),React.createElement("label",{class:"kirki-control-sublabel",htmlFor:i},e.position))}))),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("span",{ref:p,className:"kirki-control-unit"},a))))};function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}let o=wp.customize.Control.extend({initialize:function(e,t){let n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,e,t),wp.customize.control.bind("removed",function e(t){n===t&&(n.destroy(),n.container[0]&&n.container[0].remove?n.container[0].remove():n.container[0]&&n.container[0].parentNode&&n.container[0].parentNode.removeChild(n.container[0]),wp.customize.control.unbind("removed",e))})},setNotificationContainer:function(e){this.notifications.container=e,this.notifications.render()},renderContent:function(){var e;let o=React.createElement(t,n({},this.params,{control:this,customizerSetting:this.setting,setNotificationContainer:this.setNotificationContainer,value:this.params.value}));e=this.container[0],e&&(wp.element.createRoot?wp.element.createRoot(e).render(o):wp.element.render(o,e)),!1!==this.params.choices.allowCollapse&&this.container[0].classList.add("allowCollapse")},ready:function(){let e=this;e.setting.bind(t=>{e.updateComponentState(t)})},updateComponentState:e=>{},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-margin"]=o,wp.customize.controlConstructor["kirki-padding"]=o}();