!function(){var e={487:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,o=0;n>>5]|=e[n]<<24-o%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-a)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],o=0,r=0;o>>6-2*r);return n}},e.exports=n},738:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:function(e,t,n){var o,r,a,i,c;o=n(12),r=n(487).utf8,a=n(738),i=n(487).bin,(c=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?i.stringToBytes(e):r.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=o.bytesToWords(e),l=8*e.length,s=1732584193,u=-271733879,p=-1732584194,d=271733878,f=0;f>>24)|4278255360&(n[f]<<24|n[f]>>>8);n[l>>>5]|=128<>>9<<4)]=l;var m=c._ff,y=c._gg,h=c._hh,v=c._ii;for(f=0;f>>0,u=u+g>>>0,p=p+_>>>0,d=d+w>>>0}return o.endian([s,u,p,d])})._ff=function(e,t,n,o,r,a,i){var c=e+(t&n|~t&o)+(r>>>0)+i;return(c<>>32-a)+t},c._gg=function(e,t,n,o,r,a,i){var c=e+(t&o|n&~o)+(r>>>0)+i;return(c<>>32-a)+t},c._hh=function(e,t,n,o,r,a,i){var c=e+(t^n^o)+(r>>>0)+i;return(c<>>32-a)+t},c._ii=function(e,t,n,o,r,a,i){var c=e+(n^(t|~o))+(r>>>0)+i;return(c<>>32-a)+t},c._blocksize=16,c._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=o.wordsToBytes(c(e,t));return t&&t.asBytes?n:t&&t.asString?i.bytesToString(n):o.bytesToHex(n)}},496:function(e){for(var t=self.crypto||self.msCrypto,n="-_",o=36;o--;)n+=o.toString(36);for(o=36;o---10;)n+=o.toString(36).toUpperCase();e.exports=function(e){var r="",a=t.getRandomValues(new Uint8Array(e||21));for(o=e||21;o--;)r+=n[63&a[o]];return r}},539:function(e,t){var n,o,r; /*! * php-unserialize-js JavaScript Library * https://github.com/bd808/php-unserialize-js * * Copyright 2013 Bryan Davis and contributors * Released under the MIT license * http://www.opensource.org/licenses/MIT */!function(a,i){"use strict";o=[],void 0===(r="function"==typeof(n=function(){return function(e){var t,n=0,o=[],r=0,a=function(){var t=e.indexOf(":",n),o=e.substring(n,t);return n=t+2,parseInt(o,10)},i=function(){var t=e.indexOf(";",n),o=e.substring(n,t);return n=t+1,parseInt(o,10)},c=function(){var e=i();return o[r++]=e,e},l=function(){var t=e.indexOf(";",n),a=e.substring(n,t);return n=t+1,a=parseFloat(a),o[r++]=a,a},s=function(){var t=e.indexOf(";",n),a=e.substring(n,t);return n=t+1,a="1"===a,o[r++]=a,a},u=function(t='"'){for(var o,r,i=a(),c=0,l=0;l2047?3:2;return e.charAt(n+c)!==t&&(c+=e.indexOf('"',n+c)-n-c),r=e.substring(n,n+c),n+=c+2,r},p=function(){var e=u();return o[r++]=e,e},d=function(){var t=e.charAt(n);return n+=2,t},f=function(){var e=d();switch(e){case"i":return i();case"s":return u();default:throw new Error("Unknown key type '"+e+"' at position "+(n-2))}},m=function(){var e,i,c,l,s,u=a(),p=[],d={},m=p,y=r++;o[y]=m;try{for(c=0;c0)return o=e.substring(1,a),r=e.substr(a+1),"*"===o||t===o?r:o+"::"+r;var i="Expected two characters in non-public property name '"+e+"' at position "+(n-e.length-2);throw new Error(i)}return e},h=function(){var e,i,c,l,s={},p=r++,d=u();o[p]=s,e=a();try{for(l=0;l=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},382:function(e,t,n){var o=n(313);e.exports=function(e){var t=o.useState(e.id),n=function(){return t[1](e.id)};return o.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},313:function(e){"use strict";e.exports=window.React},61:function(e,t,n){var o=n(698).default;function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=r=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,i=a.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},s=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,o){var r=t&&t.prototype instanceof _?t:_,a=Object.create(r.prototype),i=new L(o||[]);return c(a,"_invoke",{value:N(e,n,i)}),a}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var y="suspendedStart",h="suspendedYield",v="executing",b="completed",g={};function _(){}function w(){}function E(){}var O={};d(O,s,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(A([])));j&&j!==a&&i.call(j,s)&&(O=j);var x=E.prototype=_.prototype=Object.create(O);function C(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(r,a,c,l){var s=m(e[r],e,a);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==o(p)&&i.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,c,l)}),(function(e){n("throw",e,c,l)})):t.resolve(p).then((function(e){u.value=e,c(u)}),(function(e){return n("throw",e,c,l)}))}l(s.arg)}var r;c(this,"_invoke",{value:function(e,o){function a(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(a,a):a()}})}function N(e,n,o){var r=y;return function(a,i){if(r===v)throw Error("Generator is already running");if(r===b){if("throw"===a)throw i;return{value:t,done:!0}}for(o.method=a,o.arg=i;;){var c=o.delegate;if(c){var l=P(c,o);if(l){if(l===g)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===y)throw r=b,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=v;var s=m(e,n,o);if("normal"===s.type){if(r=o.done?b:h,s.arg===g)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(r=b,o.method="throw",o.arg=s.arg)}}}function P(e,n){var o=n.method,r=e.iterator[o];if(r===t)return n.delegate=null,"throw"===o&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g;var a=m(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r=0;--r){var a=this.tryEntries[r],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(l&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:A(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),g}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,n){var o=n(61)();e.exports=o;try{regeneratorRuntime=o}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.components;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=(0,e.useContext)(Q),o=n.isAdvancedMode,r=n.remoteConditions,a=n.allLanguages,i=r;return{isAdvancedMode:o,allRules:i.reduce((function(e,t){var n=t.rules,o=t.title;return[].concat(l(e),l(n.map((function(e){return h(h({},e),{},{group:o})}))))}),[]).reduce((function(e,n){var o=n.title,r=n.id,a=n.sub_ids,i=void 0===a?[]:a,c=m(n,["title","id","sub_ids"]);return[].concat(l(e),[h({key:t&&i.length>0&&i.find((function(e){return e.id===t.rule}))?t.rule:r,value:o,sub_ids:i},c)])}),[]),rulesToUse:i,allLanguages:a}};function b(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return T.fetch(e,t,n)};function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function A(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";D("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_entities"),A(A({entity:n},e?{search_query:e}:{}),h),{fetcherName:"conditions-get-all-entities-picker"}).then((function(e){return e.json()})).then((function(e){var t=e.data.entities;y(l(t).filter((function(e,t,n){return n.findIndex((function(t){return t.id===e.id}))===t})))}))};return(0,e.useEffect)((function(){v()}),[n,p]),(0,e.createElement)(c.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,searchPlaceholder:(0,i.__)("Type to search by ID or title...","blocksy-companion"),placeholder:o,choices:[].concat(l(s),l(m.map((function(e){return A({key:e.id,value:e.label},e.group?{group:e.group}:{})})))),search:!0},value:u,onChange:function(e){return d(m.find((function(t){return t.id===e}))||e)},onInputValueChange:function(e){m.find((function(t){var n=t.label,o=t.id;return n===e||o===e}))||v(e)}})};function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t(o.payload.end?new Date(o.payload.end).getTime():(new Date).getTime())&&(o.payload.end=e),n(M(M({},o),{},{payload:M(M(M({},o.payload),o.payload.start?{}:{start:g}),{},p({},l,e))}))}})),document.body))},I=window.wp.date;function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function U(e){for(var t=1;t0||d&&d.is_custom_rule&&d.has_text_field||d&&d.is_custom_rule&&d.choices;return(0,e.createElement)("div",{className:f()("ct-condition-group",o,{"ct-cols-3":m,"ct-cols-2":!m})},(0,e.createElement)(c.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return"include"===r.type?(0,e.createElement)("span",{className:"ct-include"},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"}))):"exclude"===r.type?(0,e.createElement)("span",{className:"ct-exclude"},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,9v2H0V9H20z"}))):null},placeholder:(0,i.__)("Select variation","blocksy-companion"),choices:{include:(0,i.__)("Include","blocksy-companion"),exclude:(0,i.__)("Exclude","blocksy-companion")}},value:r.type,onChange:function(e){l(q(q({},r),{},{type:e}))}}),(0,e.createElement)(c.Select,{key:"second",option:{appendToBody:!0,placeholder:(0,i.__)("Select rule","blocksy-companion"),choices:u,search:!0},value:r.rule,onChange:function(e){var t=u.find((function(t){return t.key===e}));t.sub_ids&&t.sub_ids.length>0?l(q(q({},r),{},{rule:t.sub_ids[0].id})):l(q(q({},r),{},{rule:e}))}}),("post_ids"===r.rule||"custom_post_type_ids"===r.rule||"product_ids"===r.rule||"page_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:"post_ids"===r.rule?(0,i.__)("Select post","blocksy-companion"):"page_ids"===r.rule?(0,i.__)("Select page","blocksy-companion"):"product_ids"===r.rule?(0,i.__)("Select product","blocksy-companion"):(0,i.__)("Custom Post Type ID","blocksy-companion"),entity:"posts",postType:{post_ids:"post",page_ids:"page",product_ids:"product",custom_post_type_ids:"ct_cpt"}[r.rule],value:(r.payload||{}).post_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{post_id:t})}))}}),("taxonomy_ids"===r.rule||"post_with_taxonomy_ids"===r.rule||"card_post_with_taxonomy_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies",value:(r.payload||{}).taxonomy_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{taxonomy_id:t})}))}}),("product_with_taxonomy_ids"===r.rule||"product_taxonomy_ids"===r.rule||"card_product_with_taxonomy_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies",postType:"product",value:(r.payload||{}).taxonomy_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{taxonomy_id:t})}))}}),"current_language"===r.rule&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:(0,i.__)("Select language","blocksy-companion"),choices:p.map((function(e){return{key:e.id,value:e.name}})),search:!0},value:(r.payload||{}).language||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{language:e})}))}}),"user_post_author_id"===r.rule&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select user","blocksy-companion"),entity:"users",value:(r.payload||{}).user_id||"",additionOptions:[{key:"current_user",value:(0,i.__)("Current user","blocksy-companion")}],onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{user_id:t})}))}}),"author"===r.rule&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select user","blocksy-companion"),entity:"users",value:(r.payload||{}).user_id||"all_users",additionOptions:[{key:"all_users",value:(0,i.__)("All authors","blocksy-companion")}],onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{user_id:t})}))}}),d&&d.sub_ids&&d.sub_ids.length>0&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,placeholder:(0,i.__)("Select sub field","blocksy-companion"),choices:d.sub_ids.map((function(e){return{key:e.id,value:e.title}})),search:!0,inputClassName:"ct-dropdown-normal-width"},value:r.rule,onChange:function(e){l(q(q({},r),{},{rule:e}))}}),"start_end_date"===r.rule&&(0,e.createElement)(B,{condition:r,onChange:l}),"schedule_date"===r.rule&&(0,e.createElement)(V,{condition:r,onChange:l}),"request_referer"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"website.com",value:r.payload.referer,onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{referer:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display based on referer domain","blocksy-companion")))),"request_cookie"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"cookie_name",value:(r.payload||{}).cookie||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{cookie:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display if cookie is present","blocksy-companion")))),"request_url"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"example=campaignID",value:r.payload.url||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{url:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display if query string is present in URL","blocksy-companion")))),d&&d.is_custom_rule&&d.has_text_field&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"",value:r.payload.value||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{value:e.target.value})}))}})),d&&d.is_custom_rule&&d.choices&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,placeholder:(0,i.__)("Select value","blocksy-companion"),choices:d.choices,search:!0,inputClassName:"ct-dropdown-normal-width"},value:r.payload.value||d.choices[0].key,onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{value:e})}))}}),(0,e.createElement)("button",{type:"button",className:"ct-remove-condition-group",onClick:function(e){e.preventDefault(),a()}},(0,e.createElement)("svg",{width:"7px",height:"7px",fill:"currentColor",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"m12 14.7 9.3 9.3 2.7-2.7-9.3-9.3L24 2.7 21.3 0 12 9.3 2.7 0 0 2.7 9.3 12 0 21.3 2.7 24l9.3-9.3z"}))))};function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function W(e){for(var t=1;t0?[W(W({},n),{},{conditions:t})]:[]),l(o.conditions.slice(a+1))))},onChange:function(e){0===e.length?r([].concat(l(o.conditions.slice(0,a)),l(o.conditions.slice(a+1)))):r(o.conditions.map((function(t,n){return W({},n===a?W(W({},t),{},{conditions:e}):t)})))}})),n.relation||(i=(0,e.createElement)(Y,{className:s,condition:n,onChange:function(e){r(o.conditions.map((function(t,n){return W({},n===a?e:t)})))},onAdd:function(){"OR"!==o.relation?r([].concat(l(o.conditions),[{type:"include",rule:h[0].rules[0].id,payload:{}}])):r(o.conditions.map((function(e,t){return W({},t===a?{relation:"AND",conditions:[e,{type:"include",rule:h[0].rules[0].id,payload:{}}]}:e)})))},onRemove:function(){r([].concat(l(o.conditions.slice(0,a)),l(o.conditions.slice(a+1))))}})),(0,e.createElement)(e.Fragment,{key:a},b&&a>0&&(0,e.createElement)("div",{className:f()("ct-condition-relation",{"ct-hovered":d===a})},(0,e.createElement)("ul",{onMouseEnter:function(){m(a)},onMouseLeave:function(){m(null)}},"AND"===o.relation&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("li",{onClick:function(){c&&(m(null),c(a))}},(0,e.createElement)("span",null,"OR")),(0,e.createElement)("li",{className:"active"},(0,e.createElement)("span",null,"AND"))),"OR"===o.relation&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("li",{className:"active"},(0,e.createElement)("span",null,"OR")),(0,e.createElement)("li",{onClick:function(){m(null),r([].concat(l(o.conditions.slice(0,a-1)),[{relation:"AND",conditions:o.conditions.slice(a-1,a+1).reduce((function(e,t){return[].concat(l(e),l(t.conditions?t.conditions:[t]))}),[])}],l(o.conditions.slice(a+1,o.conditions.length))))}},(0,e.createElement)("span",null,"AND"))))),i)}));return"OR"===o.relation&&1===o.conditions.length||!b?g:(0,e.createElement)("div",{className:f()("ct-relation-group",u),"data-relation":o.relation},g,"AND"===o.relation&&(0,e.createElement)("div",{className:"ct-condition-relation ct-add-and-relation"},(0,e.createElement)("span",{onClick:function(){r([].concat(l(o.conditions),[{type:"include",rule:h[0].rules[0].id,payload:{}}]))}},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"})))))};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Z(e){for(var t=1;t1||_.conditions.find((function(e){return e.relation})))&&(0,e.createElement)("span",null,(0,i.__)("Advanced Mode","blocksy-companion"),(0,e.createElement)(c.Switch,{value:w,onChange:function(e){_.conditions.find((function(e){return e.relation}))&&o(Z(Z({},_),{},{conditions:_.conditions.reduce((function(e,t){return[].concat(l(e),l(t.conditions?t.conditions:[t]))}),[])})),g(e)},option:{behavior:"boolean"}})))))},ne=function(t){var n=t.option,o=n.display,r=void 0===o?"inline":o,l=n.filter,s=void 0===l?"all":l,u=n.modalTitle,p=void 0===u?(0,i.__)("Transparent Header Display Conditions","blocksy-companion"):u,d=n.modalDescription,f=void 0===d?(0,i.__)("Add one or more conditions to display the transparent header.","blocksy-companion"):d,m=n.addConditionButtonLabel,y=void 0===m?(0,i.__)("Add Display Condition","blocksy-companion"):m,h=t.value,v=t.onChange,b=a((0,e.useState)(!1),2),g=b[0],_=b[1],w=a((0,e.useState)(null),2),E=w[0],O=w[1];return"inline"===r?(0,e.createElement)(te,{filter:s,value:h,onChange:v,addConditionButtonLabel:y}):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),_(!0),O(null)}},Object.keys(h).length>0?(0,i.__)("Edit Conditions","blocksy-companion"):(0,i.__)("Add Conditions","blocksy-companion")),(0,e.createElement)(c.Overlay,{items:g,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){_(!1),O(null)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",null,p),(0,e.createElement)("p",null,f),(0,e.createElement)("div",{className:"ct-modal-scroll"},(0,e.createElement)(te,{filter:s,value:E||h,onChange:function(e){O(e)},addConditionButtonLabel:y})),(0,e.createElement)("div",{className:"ct-modal-actions has-divider"},(0,e.createElement)("button",{className:"button-primary",disabled:!E,onClick:function(){v(E),_(!1)}},(0,i.__)("Save Conditions","blocksy-companion"))))}}))},oe="object"===("undefined"==typeof window?"undefined":s(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":s(self))&&self.self===self?self:"object"===(void 0===n.g?"undefined":s(n.g))&&n.g.global===n.g?n.g:void 0;function re(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){ce(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function ae(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function ie(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var ce="object"!==("undefined"==typeof window?"undefined":s(window))||window!==oe?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var o=oe.URL||oe.webkitURL,r=document.createElement("a");t=t||e.name||"download",r.download=t,r.rel="noopener","string"==typeof e?(r.href=e,r.origin!==location.origin?ae(r.href)?re(e,t,n):ie(r,r.target="_blank"):ie(r)):(r.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(r.href)}),4e4),setTimeout((function(){ie(r)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(ae(e))re(e,t,n);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){ie(o)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==s(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,n),t)}:function(e,t,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return re(e,t,n);var r="application/octet-stream"===e.type,a=/constructor/i.test(oe.HTMLElement)||oe.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||r&&a)&&"object"===("undefined"==typeof FileReader?"undefined":s(FileReader))){var c=new FileReader;c.onloadend=function(){var e=c.result;e=i?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},c.readAsDataURL(e)}else{var l=oe.URL||oe.webkitURL,u=l.createObjectURL(e);o?o.location=u:location.href=u,o=null,setTimeout((function(){l.revokeObjectURL(u)}),4e4)}},le=ce,se=n(539),ue=n.n(se),pe=function(){return new Promise((function(e){var t=new FormData;t.append("action","blocksy_customizer_wipe_caches"),t.append("wp_customize","on"),fetch(window.ajaxurl,{method:"POST",body:t}).then((function(t){200===t.status&&t.json().then((function(t){t.success,t.data;e()}))}))}))},de=function(){var t=a((0,e.useState)(null),2),n=t[0],o=t[1],r=a((0,e.useState)(null),2),s=r[0],u=r[1],p=a((0,e.useState)(!1),2),d=p[0],m=p[1],y=a((0,e.useState)(!1),2),h=y[0],v=y[1],b=a((0,e.useState)(!1),2),g=b[0],_=b[1],w=a((0,e.useState)(["options"]),2),E=w[0],O=w[1],k=(0,e.useRef)(),j=(0,e.useRef)();return(0,e.useEffect)((function(){var e=function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",m(!0)},t=function(e){e.stopPropagation(),e.preventDefault(),m(!1)},n=function(e){e.stopPropagation(),e.preventDefault(),m(!1);var t=Array.from(e.dataTransfer.files||[]);if(Array.from(e.dataTransfer.items||[]).length>0){var n=e.dataTransfer.items[0].getAsFile();o(n)}else t.length>0&&o(t[0])};return j.current.addEventListener("dragover",e,!1),j.current.addEventListener("dragleave",t,!1),j.current.addEventListener("drop",n,!1),function(){j.current&&(j.current.removeEventListener("dragover",e,!1),j.current.removeEventListener("dragleave",t,!1),j.current.removeEventListener("drop",n,!1))}}),[]),(0,e.createElement)("div",{className:"ct-import-export"},(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Export Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Easily export the theme customizer settings.","blocksy-companion"))),(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),v(!0)}},(0,i.__)("Export Customizations","blocksy-companion")))),(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Import Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Easily import the theme customizer settings.","blocksy-companion"))),(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("div",{className:"ct-file-upload"},(0,e.createElement)("div",{className:"ct-attachment"},(0,e.createElement)("button",{type:"button",className:f()("ct-upload-button",{active:d}),ref:j,onClick:function(){k.current.click()}},n?n.name:(0,i.__)("Click or drop to upload a file...","blocksy-companion"))),(0,e.createElement)("input",{ref:k,type:"file",onChange:function(e){var t=a(e.target.files,1)[0];o(t)}}),(0,e.createElement)("button",{className:f()("button-primary",{"ct-loading":g}),disabled:!n,onClick:function(e){if(e.preventDefault(),n){_(!0);var t=new FileReader;t.readAsText(n,"UTF-8"),t.onload=function(e){try{fetch("".concat(window.ajaxurl,"?action=blocksy_customizer_import&wp_customize=on&nonce=").concat(ct_customizer_localizations.customizer_reset_none),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ue()(e.target.result))}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;pe().then((function(){location.reload()}))}))}))}catch(e){}}}}},g?(0,e.createElement)("svg",{width:"14",height:"14",viewBox:"0 0 100 100"},(0,e.createElement)("g",{transform:"translate(50,50)"},(0,e.createElement)("g",{transform:"scale(1)"},(0,e.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"currentColor"}),(0,e.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"var(--ui-accent-color)",transform:"rotate(161.634)"},(0,e.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))))):(0,i.__)("Import Customizations","blocksy-companion"))))),ct_customizer_localizations.has_child_theme&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Copy Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Copy and import your customizations from parent or child theme.","blocksy-companion"))),ct_customizer_localizations.is_parent_theme&&(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),u("child")}},(0,i.__)("Copy From Child Theme","blocksy-companion")))),!ct_customizer_localizations.is_parent_theme&&(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),u("parent")}},(0,i.__)("Copy From Parent Theme","blocksy-companion"))))),(0,e.createElement)(c.Overlay,{items:s,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&(0,i.__)("Copy From Parent Theme","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,i.__)("Copy From Child Theme","blocksy-companion")),(0,e.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&(0,i.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,i.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",s);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;pe().then((function(){location.reload()}))}))}))}catch(e){}}},(0,i.__)("Yes, I am sure","blocksy-companion"))))}}),(0,e.createElement)(c.Overlay,{items:h,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return v(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},(0,i.__)("Export Settings","blocksy-companion")),(0,e.createElement)("p",null,(0,i.__)("Choose what set of settings you want to export.","blocksy-companion")),(0,e.createElement)("div",{className:"ct-checkboxes-container","data-type":"grid:bordered"},["options","widgets"].map((function(t){return(0,e.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===E.length&&E[0]===t||O((function(e){return e.includes(t)?e.filter((function(e){return e!==t})):[].concat(l(e),[t])}))}},(0,e.createElement)("span",{className:f()("ct-checkbox",{active:E.includes(t)})},(0,e.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},(0,e.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))),{options:(0,i.__)("Customizer settings","blocksy-companion"),widgets:(0,i.__)("Widgets settings","blocksy-companion")}[t])}))),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),v(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",E.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){var o=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});le(o,"".concat(n.site_url.replace("http://","").replace("https://","").replace(".","-").replace("/","-"),"-export.dat")),v(!1)}}))}))}catch(e){}}},(0,i.__)("Export","blocksy-companion"))))}}))},fe=window.ctEvents,me=n.n(fe),ye=window.wp.hooks;function he(e,t,n,o,r,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(o,r)}var ve=n(687),be=n.n(ve),ge=n(459),_e=n.n(ge),we=n(616),Ee=n.n(we),Oe=n(382),ke=n.n(Oe),je=Ee()(),xe=function(t){t.forcedEdit;var n,o,r=t.headerId,s=a((0,e.useState)(!1),2),u=s[0],d=s[1],f=a((0,e.useState)(null),2),m=f[0],y=f[1],h=(0,e.useContext)(c.PlacementsDragDropContext),v=(h.builderValueCollection,h.builderValueDispatch,(0,e.useRef)()),b=ke()(je),g=_e()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(n=be().mark((function e(t){var n,o,r;return be().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,o=n.success,r=n.data,o&&r.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",r.conditions);case 8:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(o,r){var a=n.apply(e,t);function i(e){he(a,o,r,i,c,"next",e)}function c(e){he(a,o,r,i,c,"throw",e)}i(void 0)}))},function(e){return o.apply(this,arguments)}),depends:[b]}),_=g.data,w=g.isLoading;g.error;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),e.stopPropagation(),w||d(!0)}},(0,i.__)("Add/Edit Conditions","blocksy-companion")),(0,e.createElement)(c.Overlay,{items:u,initialFocusRef:v,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){d(!1),y(null)},render:function(){var t;return(0,e.createElement)("div",{className:"ct-modal-content",ref:v},(0,e.createElement)("h2",null,sprintf((0,i.__)("Display Conditions","blocksy-companion"))),(0,e.createElement)("p",null,(0,i.__)("Add one or more conditions in order to display your header.","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-scroll"},(0,e.createElement)(c.OptionsPanel,{onChange:function(e,t){y((function(e){return[].concat(l((e||_).filter((function(e){return e.id!==r}))),[{id:r,conditions:t}])}))},options:{conditions:(t={type:"blocksy-display-condition",design:"none",value:[]},p(t,"design","none"),p(t,"label",!1),t)},value:{conditions:((m||_).find((function(e){return e.id===r}))||{conditions:[]}).conditions},hasRevertButton:!1})),(0,e.createElement)("div",{className:"ct-modal-actions has-divider"},(0,e.createElement)("button",{className:"button-primary",disabled:!m,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(m)}).then((function(e){return e.json()})).then((function(){je(),d(!1)}))}},(0,i.__)("Save Conditions","blocksy-companion"))))}}))};function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Se(e){for(var t=1;t-1?{conditions_button:{label:(0,i.__)("Edit Conditions","blocksy-companion"),type:"jsx",design:"block",render:function(){return(0,e.createElement)(xe,{headerId:o})}},divider:{type:"ct-divider"}}:{}),p)};return(0,e.createElement)(c.PanelMetaWrapper,z({id:l,key:o,option:m},d,{getActualOption:function(t){var n=t.open;return(0,e.createElement)(e.Fragment,null,o===u.id&&(0,e.createElement)(c.Panel,{id:l,getValues:function(){return Se({id:o},u.settings||{})},option:m,onChangeFor:function(e,t){s({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:t,values:(0,c.getValueFromInput)(p,Array.isArray(u.settings)?{}:u.settings||{})}})},view:"simple"}),(0,e.createElement)("li",{className:f()({active:o===u.id,"ct-global":"type-1"===o}),onClick:function(){o===u.id?n():s({type:"PICK_BUILDER_SECTION",payload:{id:o}})}},(0,e.createElement)("span",{className:"ct-panel-name"},a),o.indexOf("ct-custom")>-1&&o!==u.id&&(0,e.createElement)("span",{className:"ct-remove-instance","data-tooltip-reveal":"top",onClick:function(e){e.preventDefault(),e.stopPropagation(),r(o)}},(0,e.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Remove header","blocksy-companion")))))}}))}))),(0,e.createElement)(t.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})),(0,e.createElement)(c.Overlay,{items:o,className:"ct-admin-modal ct-reset-options",onDismiss:function(){return r(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},(0,i.__)("Remove Header","blocksy-companion")),(0,e.createElement)("p",null,(0,i.__)("You are about to remove a custom header, are you sure you want to continue?","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),r(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault(),s({type:"REMOVE_BUILDER_SECTION",payload:{id:o}}),r(!1)}},(0,i.__)("Confirm","blocksy-companion"))))}}))};me().on("blocksy:options:before-option",(function(n){if(n.option&&"ct-header-builder"===n.option.type){var o=n.content;n.content=(0,e.createElement)(e.Fragment,null,o,(0,e.createElement)(t.Fill,{name:"PlacementsBuilderPanelsManager"},(0,e.createElement)(Ne,null)))}})),me().on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=ne,e["blocksy-customizer-options-manager"]=de}))}()}();