!function(){var t;!function(){"use strict";wp.customize.kirkiDynamicControl=wp.customize.Control.extend({initialize:function(t,e){let i,n=e||{};if(n.params=n.params||{},n.params.type||(n.params.type="kirki-generic"),n.content){let t=n.content.split('class="');i=(t=t[1].split('"'))[0]}else i="customize-control customize-control-"+n.params.type;!n.params.wrapper_attrs&&n.params.wrapper_atts&&(n.params.wrapper_attrs=n.params.wrapper_atts);let r=document.createElement("li");r.id="customize-control-"+t.replace(/]/g,"").replace(/\[/g,"-"),r.className=i,n.params.wrapper_attrs&&Object.keys(n.params.wrapper_attrs).forEach(function(t){let e=n.params.wrapper_attrs[t];"class"===t?r.className=e=e.replace("{default_class}",i):r.setAttribute(t,e)}),n.params.content=jQuery(r),this.propertyElements=[],wp.customize.Control.prototype.initialize.call(this,t,n),wp.hooks.doAction("kirki.dynamicControl.init.after",t,this,n)},_setUpSettingRootLinks:function(){var t=this,e=(t.container[0]||t.container).querySelectorAll("[data-customize-setting-link]");Array.prototype.forEach.call(e,function(e){var i=e.getAttribute("data-customize-setting-link");i&&wp.customize(i,function(i){var n=new wp.customize.Element(jQuery(e));t.elements.push(n),n.sync(i),n.set(i())})})},_setUpSettingPropertyLinks:function(){var t,e=this;e.setting&&(t=(e.container[0]||e.container).querySelectorAll("[data-customize-setting-property-link]"),Array.prototype.forEach.call(t,function(t){var i,n=t.getAttribute("data-customize-setting-property-link");i=new wp.customize.Element(jQuery(t)),e.propertyElements.push(i),i.set(e.setting()[n]),i.bind(function(t){var i=e.setting();t!==i[n]&&((i=_.clone(i))[n]=t,e.setting.set(i))}),e.setting.bind(function(t){t[n]!==i.get()&&i.set(t[n])})}))},ready:function(){var t=this;t._setUpSettingRootLinks(),t._setUpSettingPropertyLinks(),wp.customize.Control.prototype.ready.call(t),t.deferred.embedded.done(function(){t.initKirkiControl(),wp.hooks.doAction("kirki.dynamicControl.ready.deferred.embedded.done",t)}),wp.hooks.doAction("kirki.dynamicControl.ready.after",t)},embed:function(){var t=this,e=t.section();e&&(wp.customize.section(e,function(e){"kirki-expanded"===e.params.type||e.expanded()||wp.customize.settings.autofocus.control===t.id?t.actuallyEmbed():e.expanded.bind(function(e){e&&t.actuallyEmbed()})}),wp.hooks.doAction("kirki.dynamicControl.embed.after",t))},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve(),wp.hooks.doAction("kirki.dynamicControl.actuallyEmbed.after",this))},focus:function(t){this.actuallyEmbed(),wp.customize.Control.prototype.focus.call(this,t),wp.hooks.doAction("kirki.dynamicControl.focus.after",this)},initKirkiControl:function(t){t=t||this,wp.hooks.doAction("kirki.dynamicControl.initKirkiControl",this);var e=t.container[0]||t.container;e.addEventListener("change",function(e){e.target&&"INPUT"===e.target.tagName&&t.setting.set(e.target.value)}),e.addEventListener("keyup",function(e){e.target&&"INPUT"===e.target.tagName&&t.setting.set(e.target.value)}),e.addEventListener("paste",function(e){e.target&&"INPUT"===e.target.tagName&&setTimeout(function(){t.setting.set(e.target.value)},0)}),e.addEventListener("click",function(e){e.target&&"INPUT"===e.target.tagName&&t.setting.set(e.target.value)})}})}(),(t=wp.customize).Value.prototype.set=function(e){var i,n,r=this._value;return e=this._setter.apply(this,arguments),null===(e=this.validate(e))||_.isEqual(r,e)||(this.id&&t.control(this.id)&&t.control(this.id).params&&t.control(this.id).params.parent_setting&&(i=t.control(this.id).params.parent_setting,(n={})[this.id.replace(i+"[","").replace("]","")]=e,t.control(i).setting.set(Object.assign({},t.control(i).setting._value,n))),this._value=e,this._dirty=!0,this.callbacks.fireWith(this,[e,r])),this},t.Value.prototype.get=function(){var e;return this.id&&t.control(this.id)&&t.control(this.id).params&&t.control(this.id).params.parent_setting?(e=t.control(this.id).params.parent_setting,t.control(e).setting.get()[this.id.replace(e+"[","").replace("]","")]):this._value}}();