PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.10.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.10.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
ablocks / assets / build / demo-import.js

demo-import.js in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.10.0, at assets/build/demo-import.js

3 lines 98.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{var e={2694(e,t,n){"use strict";var o=n(6925);function s(){}function a(){}a.resetWarningCache=s,e.exports=function(){function e(e,t,n,s,a,r){if(r!==o){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:s};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338(e,t,n){"use strict";var o=n(75795);t.H=o.createRoot,o.hydrateRoot},75795(e){"use strict";e.exports=window.ReactDOM},46942(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=r(e,a(n)))}return e}function a(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)o.call(e,n)&&e[n]&&(t=r(t,n));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>xt,hasStandardBrowserEnv:()=>St,hasStandardBrowserWebWorkerEnv:()=>Nt,navigator:()=>wt,origin:()=>vt});var t=n(5338);const o=window.React;var s=n.n(o);const a=window.wp.i18n,r=window.ReactJSXRuntime,i=({render:e})=>(0,r.jsxs)("div",{className:"ablocks-topbar",children:[(0,r.jsx)("div",{className:"ablocks-topbar__entry-left",children:(0,r.jsx)("h4",{className:"ablocks-topbar--heading",children:(0,a.__)("Import Demo","ablocks")})}),(0,r.jsx)("div",{className:"ablocks-topbar__entry-right",children:e()})]});var l=n(5556),c=n.n(l);const d={placeholder:c().string,onSearchHandler:c().func};function u({placeholder:e=(0,a.__)("Search…","ablocks"),defaultValue:t="",onSearchHandler:n=()=>{}}){const[i,l]=(0,o.useState)(t),c=(0,o.useCallback)((d=e=>{n(e)},u=1e3,p=null,f=null,h=function(){p&&(clearTimeout(p),f=null,p=null)},g=function(){if(!u)return d.apply(this,arguments);var e=this,t=arguments,n=m&&!p;return h(),f=function(){d.apply(e,t)},p=setTimeout(function(){if(p=null,!n){var e=f;return f=null,e()}},u),n?f():void 0},g.cancel=h,g.flush=function(){var e=f;h(),e&&e()},g),[n]);var d,u,m,p,f,h,g;return(0,r.jsx)(s().Fragment,{children:(0,r.jsxs)("div",{className:"ablocks-search-component",children:[(0,r.jsx)("span",{className:"ablocks-search-component__search ablocks-icon ablocks-icon--search"}),(0,r.jsx)("input",{id:"search",type:"text",className:"ablocks-search-component__input ablocks-input",placeholder:e,value:i,onChange:e=>{return t=e.target.value,l(t),void c(t);var t}}),i&&(0,r.jsx)("button",{onClick:()=>{i&&(l(""),c(""))},className:"ablocks-search-component__control",children:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--close"})})]})})}u.propTypes=d;const{entries:m,setPrototypeOf:p,isFrozen:f,getPrototypeOf:h,getOwnPropertyDescriptor:g}=Object;let{freeze:b,seal:_,create:y}=Object,{apply:k,construct:x}="undefined"!=typeof Reflect&&Reflect;b||(b=function(e){return e}),_||(_=function(e){return e}),k||(k=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return e.apply(t,o)}),x||(x=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const w=F(Array.prototype.forEach),S=F(Array.prototype.lastIndexOf),N=F(Array.prototype.pop),v=F(Array.prototype.push),E=F(Array.prototype.splice),T=F(String.prototype.toLowerCase),R=F(String.prototype.toString),j=F(String.prototype.match),I=F(String.prototype.replace),A=F(String.prototype.indexOf),O=F(String.prototype.trim),C=F(Object.prototype.hasOwnProperty),L=F(RegExp.prototype.test),D=(P=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x(P,t)});var P;function F(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return k(e,t,o)}}function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;p&&p(e,null);let o=t.length;for(;o--;){let s=t[o];if("string"==typeof s){const e=n(s);e!==s&&(f(t)||(t[o]=e),s=e)}e[s]=!0}return e}function U(e){for(let t=0;t<e.length;t++)C(e,t)||(e[t]=null);return e}function B(e){const t=y(null);for(const[n,o]of m(e))C(e,n)&&(Array.isArray(o)?t[n]=U(o):o&&"object"==typeof o&&o.constructor===Object?t[n]=B(o):t[n]=o);return t}function z(e,t){for(;null!==e;){const n=g(e,t);if(n){if(n.get)return F(n.get);if("function"==typeof n.value)return F(n.value)}e=h(e)}return function(){return null}}const H=b(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),q=b(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),W=b(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$=b(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Y=b(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),G=b(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),V=b(["#text"]),J=b(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),K=b(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),X=b(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Q=b(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z=_(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ee=_(/<%[\w\W]*|[\w\W]*%>/gm),te=_(/\$\{[\w\W]*/gm),ne=_(/^data-[\-\w.\u00B7-\uFFFF]+$/),oe=_(/^aria-[\-\w]+$/),se=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ae=_(/^(?:\w+script|data):/i),re=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ie=_(/^html$/i),le=_(/^[a-z][.\w]*(-[.\w]+)+$/i);var ce=Object.freeze({__proto__:null,ARIA_ATTR:oe,ATTR_WHITESPACE:re,CUSTOM_ELEMENT:le,DATA_ATTR:ne,DOCTYPE_NAME:ie,ERB_EXPR:ee,IS_ALLOWED_URI:se,IS_SCRIPT_OR_DATA:ae,MUSTACHE_EXPR:Z,TMPLIT_EXPR:te});const de=function(){return"undefined"==typeof window?null:window};!function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de();const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:o}=t;const s=o,a=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:h}=t,g=c.prototype,_=z(g,"cloneNode"),k=z(g,"remove"),x=z(g,"nextSibling"),P=z(g,"childNodes"),F=z(g,"parentNode");if("function"==typeof i){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let U,Z="";const{implementation:ee,createNodeIterator:te,createDocumentFragment:ne,getElementsByTagName:oe}=o,{importNode:ae}=s;let re={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof m&&"function"==typeof F&&ee&&void 0!==ee.createHTMLDocument;const{MUSTACHE_EXPR:le,ERB_EXPR:ue,TMPLIT_EXPR:me,DATA_ATTR:pe,ARIA_ATTR:fe,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:be}=ce;let{IS_ALLOWED_URI:_e}=ce,ye=null;const ke=M({},[...H,...q,...W,...Y,...V]);let xe=null;const we=M({},[...J,...K,...X,...Q]);let Se=Object.seal(y(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ne=null,ve=null;const Ee=Object.seal(y(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,Re=!0,je=!1,Ie=!0,Ae=!1,Oe=!0,Ce=!1,Le=!1,De=!1,Pe=!1,Fe=!1,Me=!1,Ue=!0,Be=!1,ze=!0,He=!1,qe={},We=null;const $e=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Ge=M({},["audio","video","img","source","image","track"]);let Ve=null;const Je=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Ze=Qe,et=!1,tt=null;const nt=M({},[Ke,Xe,Qe],R);let ot=M({},["mi","mo","mn","ms","mtext"]),st=M({},["annotation-xml"]);const at=M({},["title","style","font","a","script"]);let rt=null;const it=["application/xhtml+xml","text/html"];let lt=null,ct=null;const dt=o.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=B(e),rt=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===rt?R:T,ye=C(e,"ALLOWED_TAGS")?M({},e.ALLOWED_TAGS,lt):ke,xe=C(e,"ALLOWED_ATTR")?M({},e.ALLOWED_ATTR,lt):we,tt=C(e,"ALLOWED_NAMESPACES")?M({},e.ALLOWED_NAMESPACES,R):nt,Ve=C(e,"ADD_URI_SAFE_ATTR")?M(B(Je),e.ADD_URI_SAFE_ATTR,lt):Je,Ye=C(e,"ADD_DATA_URI_TAGS")?M(B(Ge),e.ADD_DATA_URI_TAGS,lt):Ge,We=C(e,"FORBID_CONTENTS")?M({},e.FORBID_CONTENTS,lt):$e,Ne=C(e,"FORBID_TAGS")?M({},e.FORBID_TAGS,lt):B({}),ve=C(e,"FORBID_ATTR")?M({},e.FORBID_ATTR,lt):B({}),qe=!!C(e,"USE_PROFILES")&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ae=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Ce=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,ze=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||se,Ze=e.NAMESPACE||Qe,ot=e.MATHML_TEXT_INTEGRATION_POINTS||ot,st=e.HTML_INTEGRATION_POINTS||st,Se=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ae&&(Re=!1),Fe&&(Pe=!0),qe&&(ye=M({},V),xe=y(null),!0===qe.html&&(M(ye,H),M(xe,J)),!0===qe.svg&&(M(ye,q),M(xe,K),M(xe,Q)),!0===qe.svgFilters&&(M(ye,W),M(xe,K),M(xe,Q)),!0===qe.mathMl&&(M(ye,Y),M(xe,X),M(xe,Q))),C(e,"ADD_TAGS")||(Ee.tagCheck=null),C(e,"ADD_ATTR")||(Ee.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ee.tagCheck=e.ADD_TAGS:(ye===ke&&(ye=B(ye)),M(ye,e.ADD_TAGS,lt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ee.attributeCheck=e.ADD_ATTR:(xe===we&&(xe=B(xe)),M(xe,e.ADD_ATTR,lt))),e.ADD_URI_SAFE_ATTR&&M(Ve,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(We===$e&&(We=B(We)),M(We,e.FORBID_CONTENTS,lt)),e.ADD_FORBID_CONTENTS&&(We===$e&&(We=B(We)),M(We,e.ADD_FORBID_CONTENTS,lt)),ze&&(ye["#text"]=!0),Ce&&M(ye,["html","head","body"]),ye.table&&(M(ye,["tbody"]),delete Ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');U=e.TRUSTED_TYPES_POLICY,Z=U.createHTML("")}else void 0===U&&(U=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(h,a)),null!==U&&"string"==typeof Z&&(Z=U.createHTML(""));b&&b(e),ct=e}},pt=M({},[...q,...W,...$]),ft=M({},[...Y,...G]),ht=function(e){v(n.removed,{element:e});try{F(e).removeChild(e)}catch(t){k(e)}},gt=function(e,t){try{v(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){v(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Pe||Fe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if(De)e="<remove></remove>"+e;else{const t=j(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===rt&&Ze===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const s=U?U.createHTML(e):e;if(Ze===Qe)try{t=(new f).parseFromString(s,rt)}catch(e){}if(!t||!t.documentElement){t=ee.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?Z:s}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),Ze===Qe?oe.call(t,Ce?"html":"body")[0]:Ce?t.documentElement:a},_t=function(e){return te.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},yt=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},kt=function(e){return"function"==typeof l&&e instanceof l};function xt(e,t,o){w(e,e=>{e.call(n,t,o,ct)})}const wt=function(e){let t=null;if(xt(re.beforeSanitizeElements,e,null),yt(e))return ht(e),!0;const o=lt(e.nodeName);if(xt(re.uponSanitizeElement,e,{tagName:o,allowedTags:ye}),Oe&&e.hasChildNodes()&&!kt(e.firstElementChild)&&L(/<[/\w!]/g,e.innerHTML)&&L(/<[/\w!]/g,e.textContent))return ht(e),!0;if(7===e.nodeType)return ht(e),!0;if(Oe&&8===e.nodeType&&L(/<[/\w]/g,e.data))return ht(e),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(o))&&(!ye[o]||Ne[o])){if(!Ne[o]&&Nt(o)){if(Se.tagNameCheck instanceof RegExp&&L(Se.tagNameCheck,o))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(o))return!1}if(ze&&!We[o]){const t=F(e)||e.parentNode,n=P(e)||e.childNodes;if(n&&t)for(let o=n.length-1;o>=0;--o){const s=_(n[o],!0);s.__removalCount=(e.__removalCount||0)+1,t.insertBefore(s,x(e))}}return ht(e),!0}return e instanceof c&&!function(e){let t=F(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});const n=T(e.tagName),o=T(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Xe?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===o||ot[o]):Boolean(pt[n]):e.namespaceURI===Ke?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Xe?"math"===n&&st[o]:Boolean(ft[n]):e.namespaceURI===Qe?!(t.namespaceURI===Xe&&!st[o])&&!(t.namespaceURI===Ke&&!ot[o])&&!ft[n]&&(at[n]||!pt[n]):!("application/xhtml+xml"!==rt||!tt[e.namespaceURI]))}(e)?(ht(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!L(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ae&&3===e.nodeType&&(t=e.textContent,w([le,ue,me],e=>{t=I(t,e," ")}),e.textContent!==t&&(v(n.removed,{element:e.cloneNode()}),e.textContent=t)),xt(re.afterSanitizeElements,e,null),!1):(ht(e),!0)},St=function(e,t,n){if(ve[t])return!1;if(Ue&&("id"===t||"name"===t)&&(n in o||n in dt))return!1;if(Re&&!ve[t]&&L(pe,t));else if(Te&&L(fe,t));else if(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e));else if(!xe[t]||ve[t]){if(!(Nt(e)&&(Se.tagNameCheck instanceof RegExp&&L(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&L(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t,e))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&L(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Ve[t]);else if(L(_e,I(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!Ye[e])if(je&&!L(he,I(n,ge,"")));else if(n)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&j(e,be)},vt=function(e){xt(re.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||yt(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let s=t.length;for(;s--;){const a=t[s],{name:r,namespaceURI:i,value:l}=a,c=lt(r),d=l;let u="value"===r?d:O(d);if(o.attrName=c,o.attrValue=u,o.keepAttr=!0,o.forceKeepAttr=void 0,xt(re.uponSanitizeAttribute,e,o),u=o.attrValue,!Be||"id"!==c&&"name"!==c||(gt(r,e),u="user-content-"+u),Oe&&L(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){gt(r,e);continue}if("attributename"===c&&j(u,"href")){gt(r,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){gt(r,e);continue}if(!Ie&&L(/\/>/i,u)){gt(r,e);continue}Ae&&w([le,ue,me],e=>{u=I(u,e," ")});const m=lt(e.nodeName);if(St(m,c,u)){if(U&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(i);else switch(h.getAttributeType(m,c)){case"TrustedHTML":u=U.createHTML(u);break;case"TrustedScriptURL":u=U.createScriptURL(u)}if(u!==d)try{i?e.setAttributeNS(i,r,u):e.setAttribute(r,u),yt(e)?ht(e):N(n.removed)}catch(t){gt(r,e)}}else gt(r,e)}xt(re.afterSanitizeAttributes,e,null)},Et=function e(t){let n=null;const o=_t(t);for(xt(re.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)xt(re.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof r&&e(n.content);xt(re.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,a=null,i=null,c=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!kt(e)){if("function"!=typeof e.toString)throw D("toString is not a function");if("string"!=typeof(e=e.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Le||mt(t),n.removed=[],"string"==typeof e&&(He=!1),He){if(e.nodeName){const t=lt(e.nodeName);if(!ye[t]||Ne[t])throw D("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)o=bt("\x3c!----\x3e"),a=o.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!Pe&&!Ae&&!Ce&&-1===e.indexOf("<"))return U&&Me?U.createHTML(e):e;if(o=bt(e),!o)return Pe?null:Me?Z:""}o&&De&&ht(o.firstChild);const d=_t(He?e:o);for(;i=d.nextNode();)wt(i),vt(i),i.content instanceof r&&Et(i.content);if(He)return e;if(Pe){if(Fe)for(c=ne.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(xe.shadowroot||xe.shadowrootmode)&&(c=ae.call(s,c,!0)),c}let u=Ce?o.outerHTML:o.innerHTML;return Ce&&ye["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&L(ie,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),Ae&&w([le,ue,me],e=>{u=I(u,e," ")}),U&&Me?U.createHTML(u):u},n.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Le=!0},n.clearConfig=function(){ct=null,Le=!1},n.isValidAttribute=function(e,t,n){ct||mt({});const o=lt(e),s=lt(t);return St(o,s,n)},n.addHook=function(e,t){"function"==typeof t&&v(re[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=S(re[e],t);return-1===n?void 0:E(re[e],n,1)[0]}return N(re[e])},n.removeHooks=function(e){re[e]=[]},n.removeAllHooks=function(){re={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const ue=window.wp.date;function me(e,t){return function(){return e.apply(t,arguments)}}const{toString:pe}=Object.prototype,{getPrototypeOf:fe}=Object,{iterator:he,toStringTag:ge}=Symbol,be=(_e=Object.create(null),e=>{const t=pe.call(e);return _e[t]||(_e[t]=t.slice(8,-1).toLowerCase())});var _e;const ye=e=>(e=e.toLowerCase(),t=>be(t)===e),ke=e=>t=>typeof t===e,{isArray:xe}=Array,we=ke("undefined");function Se(e){return null!==e&&!we(e)&&null!==e.constructor&&!we(e.constructor)&&Ee(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=ye("ArrayBuffer"),ve=ke("string"),Ee=ke("function"),Te=ke("number"),Re=e=>null!==e&&"object"==typeof e,je=e=>{if("object"!==be(e))return!1;const t=fe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ge in e||he in e)},Ie=ye("Date"),Ae=ye("File"),Oe=ye("Blob"),Ce=ye("FileList"),Le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},De=void 0!==Le.FormData?Le.FormData:void 0,Pe=ye("URLSearchParams"),[Fe,Me,Ue,Be]=["ReadableStream","Request","Response","Headers"].map(ye);function ze(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,s;if("object"!=typeof e&&(e=[e]),xe(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{if(Se(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let r;for(o=0;o<a;o++)r=s[o],t.call(null,e[r],r,e)}}function He(e,t){if(Se(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o,s=n.length;for(;s-- >0;)if(o=n[s],t===o.toLowerCase())return o;return null}const qe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:globalThis,We=e=>!we(e)&&e!==qe,$e=(Ye="undefined"!=typeof Uint8Array&&fe(Uint8Array),e=>Ye&&e instanceof Ye);var Ye;const Ge=ye("HTMLFormElement"),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Je=ye("RegExp"),Ke=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};ze(n,(n,s)=>{let a;!1!==(a=t(n,s,e))&&(o[s]=a||n)}),Object.defineProperties(e,o)},Xe=ye("AsyncFunction"),Qe=(Ze="function"==typeof setImmediate,et=Ee(qe.postMessage),Ze?setImmediate:et?(tt=`axios@${Math.random()}`,nt=[],qe.addEventListener("message",({source:e,data:t})=>{e===qe&&t===tt&&nt.length&&nt.shift()()},!1),e=>{nt.push(e),qe.postMessage(tt,"*")}):e=>setTimeout(e));var Ze,et,tt,nt;const ot="undefined"!=typeof queueMicrotask?queueMicrotask.bind(qe):"undefined"!=typeof process&&process.nextTick||Qe,st={isArray:xe,isArrayBuffer:Ne,isBuffer:Se,isFormData:e=>{let t;return e&&(De&&e instanceof De||Ee(e.append)&&("formdata"===(t=be(e))||"object"===t&&Ee(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ne(e.buffer),t},isString:ve,isNumber:Te,isBoolean:e=>!0===e||!1===e,isObject:Re,isPlainObject:je,isEmptyObject:e=>{if(!Re(e)||Se(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Fe,isRequest:Me,isResponse:Ue,isHeaders:Be,isUndefined:we,isDate:Ie,isFile:Ae,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Oe,isRegExp:Je,isFunction:Ee,isStream:e=>Re(e)&&Ee(e.pipe),isURLSearchParams:Pe,isTypedArray:$e,isFileList:Ce,forEach:ze,merge:function e(){const{caseless:t,skipUndefined:n}=We(this)&&this||{},o={},s=(s,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const r=t&&He(o,a)||a;je(o[r])&&je(s)?o[r]=e(o[r],s):je(s)?o[r]=e({},s):xe(s)?o[r]=s.slice():n&&we(s)||(o[r]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ze(arguments[e],s);return o},extend:(e,t,n,{allOwnKeys:o}={})=>(ze(t,(t,o)=>{n&&Ee(t)?Object.defineProperty(e,o,{value:me(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let s,a,r;const i={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)r=s[a],o&&!o(r,e,t)||i[r]||(t[r]=e[r],i[r]=!0);e=!1!==n&&fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:be,kindOfTest:ye,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(xe(e))return e;let t=e.length;if(!Te(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[he]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:Ge,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Ke,freezeMethods:e=>{Ke(e,(t,n)=>{if(Ee(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=e[n];Ee(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach(e=>{n[e]=!0})};return xe(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:He,global:qe,isContextDefined:We,isSpecCompliantForm:function(e){return!!(e&&Ee(e.append)&&"FormData"===e[ge]&&e[he])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(Re(e)){if(t.indexOf(e)>=0)return;if(Se(e))return e;if(!("toJSON"in e)){t[o]=e;const s=xe(e)?[]:{};return ze(e,(e,t)=>{const a=n(e,o+1);!we(a)&&(s[t]=a)}),t[o]=void 0,s}}return e};return n(e,0)},isAsyncFn:Xe,isThenable:e=>e&&(Re(e)||Ee(e))&&Ee(e.then)&&Ee(e.catch),setImmediate:Qe,asap:ot,isIterable:e=>null!=e&&Ee(e[he])};class at extends Error{static from(e,t,n,o,s,a){const r=new at(e.message,t||e.code,n,o,s);return r.cause=e,r.name=e.name,null!=e.status&&null==r.status&&(r.status=e.status),a&&Object.assign(r,a),r}constructor(e,t,n,o,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:st.toJSONObject(this.config),code:this.code,status:this.status}}}at.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",at.ERR_BAD_OPTION="ERR_BAD_OPTION",at.ECONNABORTED="ECONNABORTED",at.ETIMEDOUT="ETIMEDOUT",at.ERR_NETWORK="ERR_NETWORK",at.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",at.ERR_DEPRECATED="ERR_DEPRECATED",at.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",at.ERR_BAD_REQUEST="ERR_BAD_REQUEST",at.ERR_CANCELED="ERR_CANCELED",at.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",at.ERR_INVALID_URL="ERR_INVALID_URL";const rt=at;function it(e){return st.isPlainObject(e)||st.isArray(e)}function lt(e){return st.endsWith(e,"[]")?e.slice(0,-2):e}function ct(e,t,n){return e?e.concat(t).map(function(e,t){return e=lt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const dt=st.toFlatObject(st,{},null,function(e){return/^is[A-Z]/.test(e)}),ut=function(e,t,n){if(!st.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(n=st.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!st.isUndefined(t[e])})).metaTokens,s=n.visitor||c,a=n.dots,r=n.indexes,i=(n.Blob||"undefined"!=typeof Blob&&Blob)&&st.isSpecCompliantForm(t);if(!st.isFunction(s))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(st.isDate(e))return e.toISOString();if(st.isBoolean(e))return e.toString();if(!i&&st.isBlob(e))throw new rt("Blob is not supported. Use a Buffer instead.");return st.isArrayBuffer(e)||st.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,s){let i=e;if(st.isReactNative(t)&&st.isReactNativeBlob(e))return t.append(ct(s,n,a),l(e)),!1;if(e&&!s&&"object"==typeof e)if(st.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else if(st.isArray(e)&&function(e){return st.isArray(e)&&!e.some(it)}(e)||(st.isFileList(e)||st.endsWith(n,"[]"))&&(i=st.toArray(e)))return n=lt(n),i.forEach(function(e,o){!st.isUndefined(e)&&null!==e&&t.append(!0===r?ct([n],o,a):null===r?n:n+"[]",l(e))}),!1;return!!it(e)||(t.append(ct(s,n,a),l(e)),!1)}const d=[],u=Object.assign(dt,{defaultVisitor:c,convertValue:l,isVisitable:it});if(!st.isObject(e))throw new TypeError("data must be an object");return function e(n,o){if(!st.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+o.join("."));d.push(n),st.forEach(n,function(n,a){!0===(!(st.isUndefined(n)||null===n)&&s.call(t,n,st.isString(a)?a.trim():a,o,u))&&e(n,o?o.concat(a):[a])}),d.pop()}}(e),t};function mt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function pt(e,t){this._pairs=[],e&&ut(e,this,t)}const ft=pt.prototype;ft.append=function(e,t){this._pairs.push([e,t])},ft.toString=function(e){const t=e?function(t){return e.call(this,t,mt)}:mt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ht=pt;function gt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bt(e,t,n){if(!t)return e;const o=n&&n.encode||gt,s=st.isFunction(n)?{serialize:n}:n,a=s&&s.serialize;let r;if(r=a?a(t,s):st.isURLSearchParams(t)?t.toString():new ht(t,s).toString(o),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}const _t=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){st.forEach(this.handlers,function(t){null!==t&&e(t)})}},yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},kt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ht,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},xt="undefined"!=typeof window&&"undefined"!=typeof document,wt="object"==typeof navigator&&navigator||void 0,St=xt&&(!wt||["ReactNative","NativeScript","NS"].indexOf(wt.product)<0),Nt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,vt=xt&&window.location.href||"http://localhost",Et={...e,...kt},Tt=function(e){function t(e,n,o,s){let a=e[s++];if("__proto__"===a)return!0;const r=Number.isFinite(+a),i=s>=e.length;return a=!a&&st.isArray(o)?o.length:a,i?(st.hasOwnProp(o,a)?o[a]=[o[a],n]:o[a]=n,!r):(o[a]&&st.isObject(o[a])||(o[a]=[]),t(e,n,o[a],s)&&st.isArray(o[a])&&(o[a]=function(e){const t={},n=Object.keys(e);let o;const s=n.length;let a;for(o=0;o<s;o++)a=n[o],t[a]=e[a];return t}(o[a])),!r)}if(st.isFormData(e)&&st.isFunction(e.entries)){const n={};return st.forEachEntry(e,(e,o)=>{t(function(e){return st.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),o,n,0)}),n}return null},Rt={transitional:yt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,s=st.isObject(e);if(s&&st.isHTMLForm(e)&&(e=new FormData(e)),st.isFormData(e))return o?JSON.stringify(Tt(e)):e;if(st.isArrayBuffer(e)||st.isBuffer(e)||st.isStream(e)||st.isFile(e)||st.isBlob(e)||st.isReadableStream(e))return e;if(st.isArrayBufferView(e))return e.buffer;if(st.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ut(e,new Et.classes.URLSearchParams,{visitor:function(e,t,n,o){return Et.isNode&&st.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=st.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ut(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||o?(t.setContentType("application/json",!1),function(e){if(st.isString(e))try{return(0,JSON.parse)(e),st.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Rt.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(st.isResponse(e)||st.isReadableStream(e))return e;if(e&&st.isString(e)&&(n&&!this.responseType||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw rt.from(e,rt.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Et.classes.FormData,Blob:Et.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};st.forEach(["delete","get","head","post","put","patch"],e=>{Rt.headers[e]={}});const jt=Rt,It=st.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),At=Symbol("internals");function Ot(e){return e&&String(e).trim().toLowerCase()}function Ct(e){return!1===e||null==e?e:st.isArray(e)?e.map(Ct):String(e).replace(/[\r\n]+$/,"")}function Lt(e,t,n,o,s){return st.isFunction(o)?o.call(this,t,n):(s&&(t=n),st.isString(t)?st.isString(o)?-1!==t.indexOf(o):st.isRegExp(o)?o.test(t):void 0:void 0)}class Dt{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function s(e,t,n){const s=Ot(t);if(!s)throw new Error("header name must be a non-empty string");const a=st.findKey(o,s);(!a||void 0===o[a]||!0===n||void 0===n&&!1!==o[a])&&(o[a||t]=Ct(e))}const a=(e,t)=>st.forEach(e,(e,n)=>s(e,n,t));if(st.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(st.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,o,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),o=e.substring(s+1).trim(),!n||t[n]&&It[n]||("set-cookie"===n?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t})(e),t);else if(st.isObject(e)&&st.isIterable(e)){let n,o,s={};for(const t of e){if(!st.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[o=t[0]]=(n=s[o])?st.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=Ot(e)){const n=st.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(st.isFunction(t))return t.call(this,e,n);if(st.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ot(e)){const n=st.findKey(this,e);return!(!n||void 0===this[n]||t&&!Lt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function s(e){if(e=Ot(e)){const s=st.findKey(n,e);!s||t&&!Lt(0,n[s],s,t)||(delete n[s],o=!0)}}return st.isArray(e)?e.forEach(s):s(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const s=t[n];e&&!Lt(0,this[s],s,e,!0)||(delete this[s],o=!0)}return o}normalize(e){const t=this,n={};return st.forEach(this,(o,s)=>{const a=st.findKey(n,s);if(a)return t[a]=Ct(o),void delete t[s];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(s):String(s).trim();r!==s&&delete t[s],t[r]=Ct(o),n[r]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return st.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&st.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[At]=this[At]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=Ot(e);t[o]||(function(e,t){const n=st.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(e,n,s){return this[o].call(this,t,e,n,s)},configurable:!0})})}(n,e),t[o]=!0)}return st.isArray(e)?e.forEach(o):o(e),this}}Dt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),st.reduceDescriptors(Dt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),st.freezeMethods(Dt);const Pt=Dt;function Ft(e,t){const n=this||jt,o=t||n,s=Pt.from(o.headers);let a=o.data;return st.forEach(e,function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function Mt(e){return!(!e||!e.__CANCEL__)}const Ut=class extends rt{constructor(e,t,n){super(null==e?"canceled":e,rt.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Bt(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new rt("Request failed with status code "+n.status,[rt.ERR_BAD_REQUEST,rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const zt=(e,t,n=3)=>{let o=0;const s=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s,a=0,r=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=o[r];s||(s=l),n[a]=i,o[a]=l;let d=r,u=0;for(;d!==a;)u+=n[d++],d%=e;if(a=(a+1)%e,a===r&&(r=(r+1)%e),l-s<t)return;const m=c&&l-c;return m?Math.round(1e3*u/m):void 0}}(50,250);return function(e,t){let n,o,s=0,a=1e3/t;const r=(t,a=Date.now())=>{s=a,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=a?r(e,t):(n=e,o||(o=setTimeout(()=>{o=null,r(n)},a-i)))},()=>n&&r(n)]}(n=>{const a=n.loaded,r=n.lengthComputable?n.total:void 0,i=a-o,l=s(i);o=a,e({loaded:a,total:r,progress:r?a/r:void 0,bytes:i,rate:l||void 0,estimated:l&&r&&a<=r?(r-a)/l:void 0,event:n,lengthComputable:null!=r,[t?"download":"upload"]:!0})},n)},Ht=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},qt=e=>(...t)=>st.asap(()=>e(...t)),Wt=Et.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Et.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Et.origin),Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent)):()=>!0,$t=Et.hasStandardBrowserEnv?{write(e,t,n,o,s,a,r){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];st.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),st.isString(o)&&i.push(`path=${o}`),st.isString(s)&&i.push(`domain=${s}`),!0===a&&i.push("secure"),st.isString(r)&&i.push(`SameSite=${r}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Yt(e,t,n){let o=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(o||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Gt=e=>e instanceof Pt?{...e}:e;function Vt(e,t){t=t||{};const n={};function o(e,t,n,o){return st.isPlainObject(e)&&st.isPlainObject(t)?st.merge.call({caseless:o},e,t):st.isPlainObject(t)?st.merge({},t):st.isArray(t)?t.slice():t}function s(e,t,n,s){return st.isUndefined(t)?st.isUndefined(e)?void 0:o(void 0,e,0,s):o(e,t,0,s)}function a(e,t){if(!st.isUndefined(t))return o(void 0,t)}function r(e,t){return st.isUndefined(t)?st.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function i(n,s,a){return a in t?o(n,s):a in e?o(void 0,n):void 0}const l={url:a,method:a,data:a,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:i,headers:(e,t,n)=>s(Gt(e),Gt(t),0,!0)};return st.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=st.hasOwnProp(l,o)?l[o]:s,r=a(e[o],t[o],o);st.isUndefined(r)&&a!==i||(n[o]=r)}),n}const Jt=e=>{const t=Vt({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:a,headers:r,auth:i}=t;if(t.headers=r=Pt.from(r),t.url=bt(Yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&r.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),st.isFormData(n))if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(st.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&r.set(e,n)})}if(Et.hasStandardBrowserEnv&&(o&&st.isFunction(o)&&(o=o(t)),o||!1!==o&&Wt(t.url))){const e=s&&a&&$t.read(a);e&&r.set(s,e)}return t},Kt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const o=Jt(e);let s=o.data;const a=Pt.from(o.headers).normalize();let r,i,l,c,d,{responseType:u,onUploadProgress:m,onDownloadProgress:p}=o;function f(){c&&c(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(r),o.signal&&o.signal.removeEventListener("abort",r)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=Pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Bt(function(e){t(e),f()},function(e){n(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new rt("Request aborted",rt.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const o=t&&t.message?t.message:"Network Error",s=new rt(o,rt.ERR_NETWORK,e,h);s.event=t||null,n(s),h=null},h.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const s=o.transitional||yt;o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new rt(t,s.clarifyTimeoutError?rt.ETIMEDOUT:rt.ECONNABORTED,e,h)),h=null},void 0===s&&a.setContentType(null),"setRequestHeader"in h&&st.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),st.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),p&&([l,d]=zt(p,!0),h.addEventListener("progress",l)),m&&h.upload&&([i,c]=zt(m),h.upload.addEventListener("progress",i),h.upload.addEventListener("loadend",c)),(o.cancelToken||o.signal)&&(r=t=>{h&&(n(!t||t.type?new Ut(null,e,h):t),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(r),o.signal&&(o.signal.aborted?r():o.signal.addEventListener("abort",r)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(o.url);b&&-1===Et.protocols.indexOf(b)?n(new rt("Unsupported protocol "+b+":",rt.ERR_BAD_REQUEST,e)):h.send(s||null)})},Xt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController;const s=function(e){if(!n){n=!0,r();const t=e instanceof Error?e:this.reason;o.abort(t instanceof rt?t:new Ut(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,s(new rt(`timeout of ${t}ms exceeded`,rt.ETIMEDOUT))},t);const r=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:i}=o;return i.unsubscribe=()=>st.asap(r),i}},Qt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let o,s=0;for(;s<n;)o=s+t,yield e.slice(s,o),s=o},Zt=(e,t,n,o)=>{const s=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*Qt(n,t)}(e,t);let a,r=0,i=e=>{a||(a=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await s.next();if(t)return i(),void e.close();let a=o.byteLength;if(n){let e=r+=a;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw i(e),e}},cancel:e=>(i(e),s.return())},{highWaterMark:2})},{isFunction:en}=st,tn=(({Request:e,Response:t})=>({Request:e,Response:t}))(st.global),{ReadableStream:nn,TextEncoder:on}=st.global,sn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},an=e=>{e=st.merge.call({skipUndefined:!0},tn,e);const{fetch:t,Request:n,Response:o}=e,s=t?en(t):"function"==typeof fetch,a=en(n),r=en(o);if(!s)return!1;const i=s&&en(nn),l=s&&("function"==typeof on?(c=new on,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const d=a&&i&&sn(()=>{let e=!1;const t=new nn,o=new n(Et.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!o}),u=r&&i&&sn(()=>st.isReadableStream(new o("").body)),m={stream:u&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new rt(`Response type '${e}' is not supported`,rt.ERR_NOT_SUPPORT,n)})});return async e=>{let{url:s,method:r,data:i,signal:c,cancelToken:p,timeout:f,onDownloadProgress:h,onUploadProgress:g,responseType:b,headers:_,withCredentials:y="same-origin",fetchOptions:k}=Jt(e),x=t||fetch;b=b?(b+"").toLowerCase():"text";let w=Xt([c,p&&p.toAbortSignal()],f),S=null;const N=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let v;try{if(g&&d&&"get"!==r&&"head"!==r&&0!==(v=await(async(e,t)=>{const o=st.toFiniteNumber(e.getContentLength());return null==o?(async e=>{if(null==e)return 0;if(st.isBlob(e))return e.size;if(st.isSpecCompliantForm(e)){const t=new n(Et.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return st.isArrayBufferView(e)||st.isArrayBuffer(e)?e.byteLength:(st.isURLSearchParams(e)&&(e+=""),st.isString(e)?(await l(e)).byteLength:void 0)})(t):o})(_,i))){let e,t=new n(s,{method:"POST",body:i,duplex:"half"});if(st.isFormData(i)&&(e=t.headers.get("content-type"))&&_.setContentType(e),t.body){const[e,n]=Ht(v,zt(qt(g)));i=Zt(t.body,65536,e,n)}}st.isString(y)||(y=y?"include":"omit");const t=a&&"credentials"in n.prototype,c={...k,signal:w,method:r.toUpperCase(),headers:_.normalize().toJSON(),body:i,duplex:"half",credentials:t?y:void 0};S=a&&new n(s,c);let p=await(a?x(S,k):x(s,c));const f=u&&("stream"===b||"response"===b);if(u&&(h||f&&N)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=st.toFiniteNumber(p.headers.get("content-length")),[n,s]=h&&Ht(t,zt(qt(h),!0))||[];p=new o(Zt(p.body,65536,n,()=>{s&&s(),N&&N()}),e)}b=b||"text";let E=await m[st.findKey(m,b)||"text"](p,e);return!f&&N&&N(),await new Promise((t,n)=>{Bt(t,n,{data:E,headers:Pt.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:S})})}catch(t){if(N&&N(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new rt("Network Error",rt.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw rt.from(t,t&&t.code,e,S,t&&t.response)}}},rn=new Map,ln=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:s}=t,a=[o,s,n];let r,i,l=a.length,c=rn;for(;l--;)r=a[l],i=c.get(r),void 0===i&&c.set(r,i=l?new Map:an(t)),c=i;return i},cn=(ln(),{http:null,xhr:Kt,fetch:{get:ln}});st.forEach(cn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const dn=e=>`- ${e}`,un=e=>st.isFunction(e)||null===e||!1===e,mn=function(e,t){e=st.isArray(e)?e:[e];const{length:n}=e;let o,s;const a={};for(let r=0;r<n;r++){let n;if(o=e[r],s=o,!un(o)&&(s=cn[(n=String(o)).toLowerCase()],void 0===s))throw new rt(`Unknown adapter '${n}'`);if(s&&(st.isFunction(s)||(s=s.get(t))))break;a[n||"#"+r]=s}if(!s){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(dn).join("\n"):" "+dn(e[0]):"as no adapter specified";throw new rt("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s};function pn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ut(null,e)}function fn(e){return pn(e),e.headers=Pt.from(e.headers),e.data=Ft.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mn(e.adapter||jt.adapter,e)(e).then(function(t){return pn(e),t.data=Ft.call(e,e.transformResponse,t),t.headers=Pt.from(t.headers),t},function(t){return Mt(t)||(pn(e),t&&t.response&&(t.response.data=Ft.call(e,e.transformResponse,t.response),t.response.headers=Pt.from(t.response.headers))),Promise.reject(t)})}const hn="1.14.0",gn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const bn={};gn.transitional=function(e,t,n){function o(e,t){return"[Axios v"+hn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new rt(o(s," has been removed"+(t?" in "+t:"")),rt.ERR_DEPRECATED);return t&&!bn[s]&&(bn[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},gn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const yn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new rt("options must be an object",rt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const a=o[s],r=t[a];if(r){const t=e[a],n=void 0===t||r(t,a,e);if(!0!==n)throw new rt("option "+a+" must be "+n,rt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new rt("Unknown option "+a,rt.ERR_BAD_OPTION)}},validators:gn},kn=yn.validators;class xn{constructor(e){this.defaults=e||{},this.interceptors={request:new _t,response:new _t}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Vt(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:s}=t;void 0!==n&&yn.assertOptions(n,{silentJSONParsing:kn.transitional(kn.boolean),forcedJSONParsing:kn.transitional(kn.boolean),clarifyTimeoutError:kn.transitional(kn.boolean),legacyInterceptorReqResOrdering:kn.transitional(kn.boolean)},!1),null!=o&&(st.isFunction(o)?t.paramsSerializer={serialize:o}:yn.assertOptions(o,{encode:kn.function,serialize:kn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),yn.assertOptions(t,{baseUrl:kn.spelling("baseURL"),withXsrfToken:kn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&st.merge(s.common,s[t.method]);s&&st.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Pt.concat(a,s);const r=[];let i=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;i=i&&e.synchronous;const n=t.transitional||yt;n&&n.legacyInterceptorReqResOrdering?r.unshift(e.fulfilled,e.rejected):r.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let d,u=0;if(!i){const e=[fn.bind(this),void 0];for(e.unshift(...r),e.push(...l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=r.length;let m=t;for(;u<d;){const e=r[u++],t=r[u++];try{m=e(m)}catch(e){t.call(this,e);break}}try{c=fn.call(this,m)}catch(e){return Promise.reject(e)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return bt(Yt((e=Vt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}st.forEach(["delete","get","head","options"],function(e){xn.prototype[e]=function(t,n){return this.request(Vt(n||{},{method:e,url:t,data:(n||{}).data}))}}),st.forEach(["post","put","patch"],function(e){function t(t){return function(n,o,s){return this.request(Vt(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}xn.prototype[e]=t(),xn.prototype[e+"Form"]=t(!0)});const wn=xn;class Sn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,s){n.reason||(n.reason=new Ut(e,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Sn(function(t){e=t}),cancel:e}}}const Nn=Sn,vn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vn).forEach(([e,t])=>{vn[t]=e});const En=vn,Tn=function e(t){const n=new wn(t),o=me(wn.prototype.request,n);return st.extend(o,wn.prototype,n,{allOwnKeys:!0}),st.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Vt(t,n))},o}(jt);Tn.Axios=wn,Tn.CanceledError=Ut,Tn.CancelToken=Nn,Tn.isCancel=Mt,Tn.VERSION=hn,Tn.toFormData=ut,Tn.AxiosError=rt,Tn.Cancel=Tn.CanceledError,Tn.all=function(e){return Promise.all(e)},Tn.spread=function(e){return function(t){return e.apply(null,t)}},Tn.isAxiosError=function(e){return st.isObject(e)&&!0===e.isAxiosError},Tn.mergeConfig=Vt,Tn.AxiosHeaders=Pt,Tn.formToJSON=e=>Tt(st.isHTMLForm(e)?new FormData(e):e),Tn.getAdapter=mn,Tn.HttpStatusCode=En,Tn.default=Tn;const Rn=Tn;window.lodash;const{ajax_url:jn,namespace:In,plugin_root_path:An,plugin_root_url:On,is_pro:Cn,route_path:Ln,menu:Dn,nonce:Pn,addons:Fn,ablocks_nonce:Mn,rest_url:Un,toplevel_menu_icon_url:Bn,third_party_plugin_status:zn,settings:Hn,site_url:qn,blocks_status:Wn,theme_builder:$n,admin_url:Yn,is_fse_theme:Gn,post_types:Vn}=window.ABlocksGlobal??{};Rn.create({baseURL:Un,headers:{"content-type":"application/json","X-WP-Nonce":Pn,"Cache-Control":"no-cache"}}),(0,ue.dateI18n)("M j, Y",new Date),(0,ue.dateI18n)("F j, Y",new Date),(0,ue.dateI18n)("m/d/Y",new Date),(0,ue.dateI18n)("m-d-Y",new Date),(0,ue.dateI18n)("m.d.Y",new Date),(0,ue.dateI18n)("d M Y",new Date),(0,ue.dateI18n)("d F Y",new Date),(0,ue.dateI18n)("d-m-Y",new Date),(0,ue.dateI18n)("d.m.Y",new Date),(0,ue.dateI18n)("d/m/Y",new Date),(0,ue.dateI18n)("Y-m-d",new Date),(0,ue.dateI18n)("Y.m.d",new Date),(0,ue.dateI18n)("Y/m/d",new Date),(0,ue.dateI18n)("M, Y",new Date),(0,ue.dateI18n)("M Y",new Date),(0,ue.dateI18n)("F, Y",new Date),(0,ue.dateI18n)("F Y",new Date),(0,a.__)("Normal Text","ablocks");const Jn=async(e={},t=!1)=>{let n=new FormData;return n.append("security",Mn),Object.entries(e).forEach(([e,o])=>{t||"object"!=typeof o||null===o?n.append(e,o):n.append(e,JSON.stringify(o))}),await Rn.post(jn,n).then(e=>e,e=>e.response)},Kn=(e,t)=>{let n=null,o=5e3;const s=e=>{e&&e.preventDefault(),i.remove(),n=null},r=()=>{o-=1e3,o<=0&&(clearInterval(n),s())},i=document.createElement("div");i.className="ablocks-notification ablocks-notification--dashbaord "+(e?`ablocks-notification--${e}`:"ablocks-notification--success"),i.setAttribute("aria-live","polite"),i.onmouseenter=()=>clearInterval(n),i.onmouseleave=()=>n=setInterval(r,1e3);const l=document.createElement("p");l.className="ablocks-notification__message",l.appendChild(document.createTextNode(t)),i.appendChild(l);const c=document.createElement("button");c.className="ablocks-btn ablocks-btn--bg-transparent",c.setAttribute("data-suffix","close-notification"),c.setAttribute("aria-label",(0,a.__)("Close","ablocks")),c.innerHTML='<span class="ablocks-icon ablocks-icon--close" aria-hidden="true"></span>',c.onclick=s,i.appendChild(c),n=setInterval(r,1e3),document.body.appendChild(i)},Xn=window.wp.components,Qn={size:c().string};function Zn({size:e="md"}){return(0,r.jsx)("div",{className:`ablocks-preloader ablocks-preloader--${e}`,children:(0,r.jsx)(Xn.Spinner,{})})}Zn.propTypes=Qn;const eo=({leftContent:e,rightContent:t})=>(0,r.jsxs)("div",{className:"ablocks-SecondaryTopbar",children:[(0,r.jsx)("div",{className:"ablocks-SecondaryTopbar__entry-left",children:e()}),(0,r.jsx)("div",{className:"ablocks-SecondaryTopbar__entry-right",children:t()})]});var to=n(46942),no=n.n(to);const oo=e=>{const{label:t,icon:n,iconPosition:o,isDisabled:s,onClick:a,buttonStyle:i,className:l,buttonType:c,type:d="button",link:u,target:m,suffix:p,preset:f,buttonSize:h}=e,g=no()("ablocks-btn",{["ablocks-btn--"+p]:p,["ablocks-btn--"+f]:f,["ablocks-btn--"+o]:o,["ablocks-btn--"+h]:h,"ablocks-btn--primary":!c&&t,"ablocks-btn--secondary":"secondary"===c&&!s,"ablocks-btn--tertiary":"tertiary"===c&&!s,"ablocks-btn--primary-disabled":s&&!c,"ablocks-btn--secondary-disabled":s&&"secondary"===c,"ablocks-btn--tertiary-disabled":s&&"tertiary"===c});return"link"===d?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("a",{href:u,className:l||g,onClick:a,disabled:s,style:i,rel:"noreferrer",target:m,children:[n&&"right"!==o?n:"",t&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:t}),n&&"right"===o&&n]})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("button",{type:d,className:l||g,disabled:s,onClick:a,style:i,children:["right"!==o&&n,t&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:t}),"right"===o&&n]})})},so={totalItems:c().number,currentPageNumber:c().number,fetchHandler:c().func,rowsPerPage:c().number},ao=({totalItems:e=0,currentPageNumber:t=1,fetchHandler:n=()=>{},rowsPerPage:s=10})=>{const[a,i]=(0,o.useState)(t||1),l=Number.isFinite(e)&&Number.isFinite(s)&&s>0?Math.ceil(e/s):0,c=s>=e?1:t,d=Array.from({length:l},(e,t)=>t+1),u=a<d.length&&e>s,m=a>1&&e>s;(0,o.useEffect)(()=>{i(c)},[s,t]);const p=e=>{i(e),n(e,s)};return(0,r.jsxs)("div",{className:"ablocks-pagination",children:[m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oo,{icon:(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-left"}),(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-left"})]}),onClick:()=>{p(1)}}),(0,r.jsx)(oo,{icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-left"}),onClick:()=>{p(a-1)}})]}),d.length>1&&(0,r.jsx)("ul",{className:"ablocks-pagination-list",children:(()=>{const e=[];if(d.length<=5)d.forEach((t,n)=>{const o=(0,r.jsx)("li",{className:`ablocks-pagination-list__item ${t===a&&"ablocks-pagination-list__item-active"}`,onClick:()=>{p(t)},role:"presentation",children:t},n);e.push(o)});else if(a<=3){for(let t=1;t<=3;t++){const n=(0,r.jsx)("li",{className:`ablocks-pagination-list__item ${t===a&&"ablocks-pagination-list__item-active"}`,onClick:()=>{p(t)},role:"presentation",children:t},t);e.push(n)}e.push((0,r.jsx)("li",{className:"ablocks-pagination-list__item ablocks-pagination-list__item-dots",children:"..."},"dots"));const t=(0,r.jsx)("li",{className:"ablocks-pagination-list__item",onClick:()=>{p(l)},role:"presentation",children:l},l);e.push(t)}else if(a>=l-2){const t=(0,r.jsx)("li",{className:"ablocks-pagination-list__item",onClick:()=>{p(1)},role:"presentation",children:1},1);e.push(t),e.push((0,r.jsx)("li",{className:"ablocks-pagination-list__item ablocks-pagination-list__item-dots",children:"..."},"dots"));for(let t=l-2;t<=l;t++){const n=(0,r.jsx)("li",{className:`ablocks-pagination-list__item ${t===a&&"ablocks-pagination-list__item-active"}`,onClick:()=>{p(t)},role:"presentation",children:t},t);e.push(n)}}else{const t=(0,r.jsx)("li",{className:"ablocks-pagination-list__item",onClick:()=>{p(1)},role:"presentation",children:1},1);e.push(t),e.push((0,r.jsx)("li",{className:"ablocks-pagination-list__item ablocks-pagination-list__item-dots",children:"..."},"dots-start"));for(let t=a-1;t<=a+1;t++){const n=(0,r.jsx)("li",{className:`ablocks-pagination-list__item ${t===a&&"ablocks-pagination-list__item-active"}`,onClick:()=>{p(t)},role:"presentation",children:t},t);e.push(n)}e.push((0,r.jsx)("li",{className:"ablocks-pagination-list__item ablocks-pagination-list__item-dots",children:"..."},"dots-end"));const n=(0,r.jsx)("li",{className:"ablocks-pagination-list__item",onClick:()=>{p(l)},role:"presentation",children:l},l);e.push(n)}return e})()}),u&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oo,{icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"}),onClick:()=>{p(a+1)}}),(0,r.jsx)(oo,{icon:(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"}),(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"})]}),onClick:()=>{p(d.length)}})]})]})};ao.propTypes=so;const ro=ao,io={label:c().oneOfType([c().object,c().string]),size:c().string,className:c().string,preset:c().string,bg:c().string,onClick:c().func,type:c().string,link:c().string,isLoading:c().bool,loadingLabel:c().string,loadingStatus:c().string,icon:c().any,iconPosition:c().string,border:c().string,borderRadius:c().string,isCircle:c().bool,isDisabled:c().bool,style:c().object,suffix:c().string,target:c().string,isPro:c().bool},lo=({label:e="",size:t="md",className:n="",preset:o="purple",onClick:s=()=>{},type:i="button",link:l="#",isLoading:c=!1,loadingLabel:d=null,icon:u=null,iconPosition:m=null,isCircle:p=!1,border:f=null,isDisabled:h=!1,borderRadius:g=null,style:b={},suffix:_="",target:y="",isPro:k=!0,id:x})=>{const w=[`ablocks-btn ablocks-btn--${t}`];if(o&&w.push("ablocks-btn--preset-"+o),m&&w.push("ablocks-btn--icon-"+m),p&&w.push("ablocks-btn--circle"),f&&w.push("ablocks-btn--border-"+f),g&&w.push("ablocks-btn--border-"+g),h&&w.push("ablocks-btn--disabled"),_&&w.push("ablocks-btn--"+_),"link"===i){const t=y?{target:y}:{};return(0,r.jsxs)("a",{href:l,className:n||w.join(" "),type:i,onClick:s,disabled:h||c,style:b,rel:"noreferrer",id:x,...t,children:["right"!==m&&u,c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xn.Spinner,{}),d&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:d})]}):(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:e})}),"right"===m&&u,!k&&(0,r.jsx)("span",{className:"ablocks-pro-badge",children:(0,a.__)("PRO","ablocks")})]})}return(0,r.jsxs)("button",{className:n||w.join(" "),type:i,onClick:s,disabled:h||c,style:b,id:x,children:["right"!==m&&!c&&u,c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xn.Spinner,{}),d&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:d})]}):(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("span",{className:"ablocks-btn--label",children:e})}),"right"===m&&!c&&u,!k&&(0,r.jsx)("span",{className:"ablocks-pro-badge",children:(0,a.__)("PRO","ablocks")})]})};lo.propTypes=io;const co=lo,uo=({onRequestClose:e,currentIndex:t,demos:n,dependencyData:i,installDependenciesAndImport:l,allDependenciesIsInstalled:c,importWithImage:d,setImportWithImage:u,dependencyIndex:m,improtMessages:p,importItem:f,improtingStates:h})=>{const g=(0,o.useRef)();(0,o.useEffect)(()=>{p?.length&&g?.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"})},[g,p?.length]);const b=c?(0,a.__)("Import Now","ablocks"):(0,a.__)("Install and Activate →","ablocks"),_=n[t]?.id===d?.itemId&&d.isChecked,y=n[t]?.images_with_sizes?n[t]?.images_with_sizes[0]?.large?.url:n[t]?.featured_image,k=h.isSuccess&&!h.isRunning?(0,a.__)("Importing Successful","ablocks"):(0,a.__)("Import Failed","ablocks"),x=h.isRunning&&(0,a.__)("Your Theme is Importing","ablocks"),w={background:`url(${y})`,backgroundPosition:"center top",backgroundRepeat:"no-repeat",backgroundSize:"cover"};return(0,r.jsx)(s().Fragment,{children:(0,r.jsx)("div",{className:"ablocks-demo-dependency",children:h.isImportModalLoading?(0,r.jsx)("div",{className:"ablocks-demo-dependency--preloader",children:(0,r.jsx)(Zn,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(co,{onClick:()=>e(),suffix:"dependency-close",icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),preset:"white",size:"sm"}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__page",children:(0,r.jsxs)("div",{className:"ablocks-demo-dependency__content",children:[(0,r.jsx)("div",{className:"ablocks-demo-dependency__image-container",children:(0,r.jsx)("div",{className:"ablocks-demo-importer-thumbnail-placeholder",style:w})}),(0,r.jsxs)("div",{className:"ablocks-demo-dependency__dependency",children:[(0,r.jsx)(r.Fragment,{children:p?.length?(0,r.jsxs)("div",{className:"ablocks-demo-importing",children:[(0,r.jsx)("h2",{className:"ablocks-demo-importing__title",children:h.isRunning?x:k}),(0,r.jsxs)("p",{className:"ablocks-demo-importing__subtitle",children:[h.isRunning&&(0,r.jsx)(r.Fragment,{children:(0,a.__)("Theme Importing in progress. Please do not refresh or go back. This may take a few minutes.","ablocks")}),h.isSuccess&&(0,a.__)("Theme Importing is complete. You can visite website now.","ablocks"),h.isFailed&&(0,a.__)("Theme Importing Failed. Please try again!","ablocks")]}),(0,r.jsxs)("div",{className:"ablocks-demo-importing__status",children:[(0,r.jsxs)("div",{className:"ablocks-demo-importing__loading",children:[(0,r.jsx)("span",{className:"ablocks-demo-importing-loader"}),h.isRunning&&(0,r.jsx)("span",{className:"ablocks-demo-importing__loading-title",children:(0,a.__)("Importing in Progress Please wait…","ablocks")})]}),(0,r.jsx)("ul",{className:"ablocks-demo-importing__list",children:p.map(({action:e,message:t,error:n},o)=>{const s=t?.includes("Failed")||"warning"===t?.level,a=o===p.length-1,i=t||n;return(0,r.jsx)(r.Fragment,{children:i&&(0,r.jsxs)("li",{className:"ablocks-demo-importing__item ablocks-demo-importing__item"+(s||n?"--error":"--success"),children:[s||n?"✖":"✔"," ",`${e}: ${t||n}`,a&&(0,r.jsx)("div",{ref:g})]},o)})})})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"ablocks-demo-dependency--header",children:(0,a.__)("Required Plugins for Theme Import","ablocks")}),(0,r.jsx)("span",{className:"ablocks-demo-dependency--sub-header",children:(0,a.__)("Install and activate the recommended plugins to ensure a smooth theme import and full functionality.","ablocks")}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__card-wrapper",children:i?.length>0&&i.map((e,t)=>{const n=e?.status?.activated&&e?.status?.installed,o=n?(0,a.__)("Installed and Activated","ablocks"):(0,a.__)("Install and Activate","ablocks");return(0,r.jsxs)("div",{className:"ablocks-demo-dependency__card",children:[(0,r.jsxs)("h3",{className:"ablocks-demo-dependency__card-title",children:[e?.status?.activated&&e?.status?.installed?"�
2 ":"⚠️",(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e.name}})]}),(0,r.jsx)(co,{isDisabled:e?.status?.activated&&e?.status?.installed,onClick:()=>l([e],t),isLoading:m===t,label:o,suffix:n?"install":"installed",preset:"white",border:"gray"})]},t)})})]})}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__footer",children:(0,r.jsx)("div",{className:"ablocks-demo-dependency__footer-content",children:h.isSuccess?(0,r.jsx)(co,{label:(0,a.__)("Visit Website","ablocks"),type:"link",link:qn,target:"_blank",iconPosition:"right",icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--arrow-right"}),suffix:"website"}):(0,r.jsxs)("div",{className:"ablocks-demo-dependency__footer-right",children:[(0,r.jsxs)("div",{className:"ablocks-demo-dependency__checkbox-container",children:[(0,r.jsx)("input",{id:"select-card",type:"checkbox",className:"ablocks-demo-dependency__checkbox",checked:_,onChange:()=>{parseInt(n[t].id)===parseInt(d.itemId)||n[t].file_url===d.file_url?u({itemId:null,file_url:"",isChecked:!1}):u({file_url:n[t].file_url,itemId:n[t].id,isChecked:!0})}}),(0,r.jsx)("label",{className:"ablocks-demo-dependency__checkbox-label",htmlFor:"select-card",children:(0,a.__)("Import with Image","ablocks")})]}),(0,r.jsx)(co,{label:b,isLoading:h.isRunning,size:"sm",onClick:async()=>{confirm((0,a.__)("Importing this demo will replace your current header, footer, and homepage. Continue?","ablocks"))&&(c?f(n[t],!0):l(i,t,!0))},suffix:c?"import-now":"insatall-activate"})]})})})]})]})})]})})})},mo=({index:e,importLoading:t,demo:n,demoUrl:o,checkDependenciesAndImport:s,setCurrentIndex:i,setImprotingStates:l})=>{const c={background:`url(${n?.images_with_sizes?n?.images_with_sizes[0]?.large?.url:n?.featured_image})`,backgroundPosition:"center top",backgroundRepeat:"no-repeat",backgroundSize:"cover"};return(0,r.jsxs)("div",{className:"ablocks-import-demo-content__card "+(t?.currentIndex===e?"loading-active":""),children:[(0,r.jsx)("div",{className:"ablocks-import-demo-content__card__image-container",children:(0,r.jsx)("div",{className:"ablocks-demo-importer-thumbnail-placeholder",style:c??o})}),(0,r.jsx)("div",{className:"ablocks-import-demo-content--buttons",children:(0,r.jsxs)("div",{className:"ablocks-import-demo-actions",children:[(0,r.jsx)(co,{onClick:()=>{l(e=>({...e,isImportModalLoading:!0})),s(n,e),i(e)},isLoading:t?.currentIndex===e,label:(0,a.__)("Start Import","ablocks"),preset:"white",suffix:"import"}),(0,r.jsx)(co,{onClick:()=>window.open(n?.demo_url,"_blank"),label:(0,a.__)("Live Preview","ablocks"),suffix:"live"})]})}),(0,r.jsx)("p",{className:"ablocks-import-demo-template-name",children:n?.title??(0,a.__)("Import","ablocks")+e+1})]},e)},po=({category:e,selectedCategory:t,setSelectedCategory:n,handleFilterByCategory:s})=>{const[i,l]=(0,o.useState)(!1),c=(0,o.useRef)(null),d=e.slice(0,6),u=e.slice(6),m=e=>{n(e),s(e),l(!1)};return(0,o.useEffect)(()=>{const e=e=>!c.current.contains(e.target)&&l(!1);return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.jsxs)("ul",{className:"ablocks-import-demo-content__category",ref:c,children:[d.map((e,n)=>(0,r.jsx)("li",{role:"presentation",className:"ablocks-import-demo-content__category__title "+(e.slug===t.slug?"ablocks-import-demo-content__category--title-active":""),onClick:()=>m(e),children:e.label},n)),u.length>0&&(0,r.jsxs)("li",{className:"ablocks-import-demo-content__category__title ablocks-import-demo-content__category__more",onClick:()=>l(e=>!e),children:[(0,a.__)("More","ablocks"),i?(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-down"}):(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"}),i&&(0,r.jsx)("ul",{className:"ablocks-import-demo-content__category__dropdown",children:u.map((e,n)=>(0,r.jsx)("li",{className:"ablocks-import-demo-content__category__dropdown__item "+(e.slug===t.slug?"ablocks-import-demo-content__category__dropdown__item--active":""),onClick:()=>m(e),children:e.label},n))})]})]})},fo=()=>{const e=(0,o.useRef)(),[t,n]=(0,o.useState)([]),[s,l]=(0,o.useState)([]),[c,d]=(0,o.useState)([]),[m,p]=(0,o.useState)({label:(0,a.__)("All","ablocks"),slug:"all"}),[f,h]=(0,o.useState)(!0),[g,b]=(0,o.useState)(""),[_,y]=(0,o.useState)(""),[k,x]=(0,o.useState)([]),[w,S]=(0,o.useState)(null),[N,v]=(0,o.useState)(!1),[E,T]=(0,o.useState)({page:1,perPage:10,total:0}),[R,j]=(0,o.useState)(!1),[I,A]=(0,o.useState)({currentIndex:null,isLoading:!1}),[O,C]=(0,o.useState)({itemId:null,isChecked:!1}),[L,D]=(0,o.useState)([]),[P,F]=(0,o.useState)({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1});(0,o.useMemo)(()=>{if(k.length){const e=k.every(e=>e.status.installed&&e.status.activated);j(e)}},[k]),(0,o.useMemo)(()=>{k?.length&&e?.current?.scrollIntoView({behavior:"smooth",block:"start"})},[e,k?.length,P.isImportModalLoading]);const M=On+"assets/images/template-placeholder.png";(0,o.useEffect)(()=>{N||B()},[N]);const U=(e,n="")=>{if(e.success)return T({page:e.data.page,total:e.data.total}),1!==E.page||n?e.data.posts:[...t,...e.data.posts];throw new Error("Invalid response status")},B=async(e=null,t)=>{let o={};const s=t||m;s&&"all"!==s.slug&&(o={category:s.slug,...o}),h(!0);try{if(null===e){const{data:e}=await Jn({action:"ablocks/get_theme_demos"});if(e.data.demos=e.data.demos?.map(e=>({...e,id:Math.floor(1e7+9e7*Math.random()),type:"theme_demo"}))||[],!e.success)throw new Error("Initial request failed");let t=[...e.data.demos];if(n(e.data.demos),e.data.preloaded_demo){const{data:n}=await Jn({action:"ablocks/get_demo_list",type:"template",...o}),s=U(n);t=[...t,...s];const{data:r}=await Jn({action:"ablocks/get_demo_categories",type:"template",...o}),i=r?.data?.map(e=>({label:(0,a.__)(e?.name,"ablocks"),slug:e?.slug}))||[],l=Array.isArray(e?.data?.categories)&&e.data.categories.length>0?e?.data?.categories:i;d([{label:(0,a.__)("All","ablocks"),slug:"all"},...l])}l(t)}else{const{data:t}=await Jn({action:"ablocks/get_demo_list",type:"template",...o,page:e}),n=U(t);l(n)}}catch(e){Kn("error",(0,a.__)("Something went wrong! please try again.","ablocks"))}finally{h(!1)}},z=async(e,t)=>{D([]),A({currentIndex:t,isLoading:!0});const n=e?.plugins||e?.dependencies;try{const e=await Jn({action:"ablocks/check_dependencies",dependencies:n});e.data.success&&(F({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),x(e.data.data),A({currentIndex:null,isLoading:!1}))}catch(e){Kn("error",e.message),A({currentIndex:null,isLoading:!1})}},H=async(e,t)=>{F({isSuccess:!1,isFailed:!1,isRunning:!0,isImportModalLoading:!1}),D([]);let n=jn+`?action=ablocks/import_template&security=${Mn}&file_url=${e?.file_url}&widget_file_url=${e?.widget_file_url??""}&customizer_file_url=${e?.customizer_file_url??""}&codestar_file_url=${e?.codestar_file_url??""}&redux_options=${e?.redux_options?JSON.stringify(e.redux_options):""}`;!R&&!t||parseInt(O.itemId)!==parseInt(e.id)&&O.file_url!==e.file_url||(n+=`&with_images=${O.isChecked}`);const o=new EventSource(n,{withCredentials:!0});o.onmessage=e=>{const t=JSON.parse(e.data);"complete"!==t.action||t.error?"complete"===t.action&&t.error?(F({isSuccess:!1,isFailed:!0,isRunning:!1,isImportModalLoading:!1}),Kn("error",t.error),D(e=>[...e,t])):D(e=>[...e,t]):(D(e=>[...e,t]),Kn("success",(0,a.__)("Template sucessfully imported!","ablocks")),F({isSuccess:!0,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),o.close())},o.onerror=()=>{o.close()}},q=async e=>{W(),h(!0);const n=t.filter(e=>e.categories.some(e=>e.slug===m.slug));try{let t={};"all"!==e?.slug&&(t={category:e?.slug,...t}),_&&(t={q:_,...t});const{data:o}=await Jn({action:"ablocks/get_demo_list",type:"template",...t}),s=U(o);l([...n,...s])}catch(e){Kn("error",(0,a.__)("Something wen wrong! Please try again.","ablocks")),h(!1)}finally{h(!1)}},W=()=>{F({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),x([]),D([])},$=()=>{W(),v(!0),Jn({action:"ablocks/clear_demo_transients"}).then(()=>{v(!1)})};return(0,r.jsxs)("div",{ref:e,children:[(0,r.jsx)(i,{render:()=>(0,r.jsx)(co,{label:(0,a.__)("Sync Templates","ablocks"),icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--assets-generation"}),suffix:"sync-btn",isLoading:N,onClick:$})}),(0,r.jsx)(eo,{leftContent:()=>(0,r.jsx)(po,{category:c,selectedCategory:m,setSelectedCategory:p,handleFilterByCategory:q}),rightContent:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{role:"button",tabIndex:0,className:"ablocks-icon ablocks-icon--assets-generation","aria-disabled":N,onClick:N?void 0:$}),(0,r.jsx)(u,{defaultValue:_,onSearchHandler:e=>(async e=>{W(),h(!0);const n=e.toLowerCase().trim();y(n);try{const o=t.filter(e=>e.title?.toLowerCase().includes(n));let s={};m&&"all"!==m.slug&&(s={category:m.slug,...s}),n&&(s={q:n,...s});const{data:a}=await Jn({action:"ablocks/get_demo_list",type:"template",...s}),r=U(a,e);l([...o,...r])}catch(e){Kn("error",(0,a.__)("Something wen wrong! Please try again.","ablocks")),h(!1)}finally{h(!1)}})(e.trim())})]})}),(0,r.jsxs)("div",{className:"ablocks-import-demo-content",children:[k?.length>0&&(0,r.jsx)(uo,{onRequestClose:W,currentIndex:g,demos:s,dependencyData:k,importLoading:I,installDependenciesAndImport:async(e,t=null,n=!1)=>{let o;A({currentIndex:g,isLoading:!0});for(let t=0;t<e?.length;t++)S(k.findIndex(n=>n?.slug===e[t]?.slug)||t),o=await Jn({action:"ablocks/install_and_active",dependency:e[t]}).catch(e=>{A({currentIndex:null,isLoading:!1}),Kn("error",e.message)});if(o?.data?.success){S(null),Kn("success",(0,a.__)("successfully installed and activated","ablocks"));const o=k.map(t=>({...t,status:e.some(e=>t?.slug===e?.slug)?{installed:!0,activated:!0}:t.status})),r=o.every(e=>e.status.installed&&e.status.activated);r&&n&&H(s[t],r),x(o),A({currentIndex:null,isLoading:!1})}else A({currentIndex:null,isLoading:!1})},setImportLoading:A,allDependenciesIsInstalled:R,importWithImage:O,setImportWithImage:C,dependencyIndex:w,improtMessages:L,importItem:H,setImprotingStates:F,improtingStates:P}),f?(0,r.jsx)(Zn,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"ablocks-import-demo-content__cards",children:s.length>0&&s.length>0?s.map((e,t)=>(0,r.jsx)(mo,{index:t,setCurrentIndex:b,importLoading:I,demo:e,demoUrl:M,importWithImage:O,setImportWithImage:C,onRequestClose:W,setImprotingStates:F,checkDependenciesAndImport:z},t)):(0,r.jsx)("p",{className:"ablocks-no-data-message",children:(0,a.__)("No item found","ablocks")})}),(0,r.jsx)(ro,{totalItems:E.total,currentPageNumber:E.page,fetchHandler:e=>B(e)})]})]})]})},ho=({leftContent:e,rightContent:t})=>(0,r.jsxs)("div",{className:"ablocks-SecondaryTopbar",children:[(0,r.jsx)("div",{className:"ablocks-SecondaryTopbar__entry-left",children:e()}),(0,r.jsx)("div",{className:"ablocks-SecondaryTopbar__entry-right",children:t()})]}),go=({onRequestClose:e,currentIndex:t,demos:n,dependencyData:i,installDependenciesAndImport:l,allDependenciesIsInstalled:c,importWithImage:d,setImportWithImage:u,dependencyIndex:m,improtMessages:p,importItem:f,improtingStates:h})=>{const g=(0,o.useRef)();(0,o.useEffect)(()=>{p?.length&&g?.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"})},[g,p?.length]);const b=c?(0,a.__)("Import Now","ablocks"):(0,a.__)("Install and Activate →","ablocks"),_=n[t]?.id===d?.itemId&&d.isChecked,y=n[t]?.images_with_sizes?n[t]?.images_with_sizes[0]?.large?.url:n[t]?.featured_image,k=h.isSuccess&&!h.isRunning?(0,a.__)("Importing Successful","ablocks"):(0,a.__)("Import Failed","ablocks"),x=h.isRunning&&(0,a.__)("Your Theme is Importing","ablocks"),w={background:`url(${y})`,backgroundPosition:"center top",backgroundRepeat:"no-repeat",backgroundSize:"cover"};return(0,r.jsx)(s().Fragment,{children:(0,r.jsx)("div",{className:"ablocks-demo-dependency",children:h.isImportModalLoading?(0,r.jsx)("div",{className:"ablocks-demo-dependency--preloader",children:(0,r.jsx)(Zn,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(co,{onClick:()=>e(),suffix:"dependency-close",icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),preset:"white",size:"sm"}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__page",children:(0,r.jsxs)("div",{className:"ablocks-demo-dependency__content",children:[(0,r.jsx)("div",{className:"ablocks-demo-dependency__image-container",children:(0,r.jsx)("div",{className:"ablocks-demo-importer-thumbnail-placeholder",style:w})}),(0,r.jsxs)("div",{className:"ablocks-demo-dependency__dependency",children:[(0,r.jsx)(r.Fragment,{children:p?.length?(0,r.jsxs)("div",{className:"ablocks-demo-importing",children:[(0,r.jsx)("h2",{className:"ablocks-demo-importing__title",children:h.isRunning?x:k}),(0,r.jsxs)("p",{className:"ablocks-demo-importing__subtitle",children:[h.isRunning&&(0,r.jsx)(r.Fragment,{children:(0,a.__)("Theme Importing in progress. Please do not refresh or go back. This may take a few minutes.","ablocks")}),h.isSuccess&&(0,a.__)("Theme Importing is complete. You can visite website now.","ablocks"),h.isFailed&&(0,a.__)("Theme Importing Failed. Please try again!","ablocks")]}),(0,r.jsxs)("div",{className:"ablocks-demo-importing__status",children:[(0,r.jsxs)("div",{className:"ablocks-demo-importing__loading",children:[(0,r.jsx)("span",{className:"ablocks-demo-importing-loader"}),h.isRunning&&(0,r.jsx)("span",{className:"ablocks-demo-importing__loading-title",children:(0,a.__)("Importing in Progress Please wait…","ablocks")})]}),(0,r.jsx)("ul",{className:"ablocks-demo-importing__list",children:p.map(({action:e,message:t,error:n},o)=>{const s=t?.includes("Failed"),a=o===p.length-1,i=t||n;return(0,r.jsx)(r.Fragment,{children:i&&(0,r.jsxs)("li",{className:"ablocks-demo-importing__item ablocks-demo-importing__item"+(s||n?"--error":"--success"),children:[s||n?"✖":"✔"," ",`${e}: ${t||n}`,a&&(0,r.jsx)("div",{ref:g})]})})})})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"ablocks-demo-dependency--header",children:(0,a.__)("Required Plugins for Theme Import","ablocks")}),(0,r.jsx)("span",{className:"ablocks-demo-dependency--sub-header",children:(0,a.__)("Install and activate the recommended plugins to ensure a smooth theme import and full functionality.","ablocks")}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__card-wrapper",children:i?.length>0&&i.map((e,t)=>{const n=e?.status?.activated&&e?.status?.installed,o=n?(0,a.__)("Installed and Activated","ablocks"):(0,a.__)("Install and Activate","ablocks");return(0,r.jsxs)("div",{className:"ablocks-demo-dependency__card",children:[(0,r.jsxs)("h3",{className:"ablocks-demo-dependency__card-title",children:[e?.status?.activated&&e?.status?.installed?"�
3 ":"⚠️",(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e.name}})]}),(0,r.jsx)(co,{isDisabled:e?.status?.activated&&e?.status?.installed,onClick:()=>l([e],t),isLoading:m===t,label:o,suffix:n?"install":"installed",preset:"white",border:"gray"})]},t)})})]})}),(0,r.jsx)("div",{className:"ablocks-demo-dependency__footer",children:(0,r.jsx)("div",{className:"ablocks-demo-dependency__footer-content",children:h.isSuccess?(0,r.jsx)(co,{label:(0,a.__)("Visit Website","ablocks"),type:"link",link:qn,target:"_blank",iconPosition:"right",icon:(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--arrow-right"}),suffix:"website"}):(0,r.jsxs)("div",{className:"ablocks-demo-dependency__footer-right",children:[(0,r.jsxs)("div",{className:"ablocks-demo-dependency__checkbox-container",children:[(0,r.jsx)("input",{id:"select-card",type:"checkbox",className:"ablocks-demo-dependency__checkbox",checked:_,onChange:()=>{parseInt(n[t].id)===parseInt(d.itemId)?u({itemId:null,isChecked:!1}):u({itemId:n[t].id,isChecked:!0})}}),(0,r.jsx)("label",{className:"ablocks-demo-dependency__checkbox-label",htmlFor:"select-card",children:(0,a.__)("Import with Image","ablocks")})]}),(0,r.jsx)(co,{label:b,isLoading:h.isRunning,size:"sm",onClick:async()=>{confirm((0,a.__)("Importing this demo will replace your current header, footer, and homepage. Continue?","ablocks"))&&(c?f(n[t],!0):l(i,t,!0))},suffix:c?"import-now":"insatall-activate"})]})})})]})]})})]})})})},bo=({index:e,importLoading:t,demo:n,demoUrl:o,checkDependenciesAndImport:s,setCurrentIndex:i,setImprotingStates:l})=>{const c={background:`url(${n?.images_with_sizes?n?.images_with_sizes[0]?.large?.url:n?.featured_image})`,backgroundPosition:"center top",backgroundRepeat:"no-repeat",backgroundSize:"cover"};return(0,r.jsxs)("div",{className:"ablocks-import-demo-content__card "+(t?.currentIndex===e?"loading-active":""),children:[(0,r.jsx)("div",{className:"ablocks-import-demo-content__card__image-container",children:(0,r.jsx)("div",{className:"ablocks-demo-importer-thumbnail-placeholder",style:c??o})}),(0,r.jsx)("div",{className:"ablocks-import-demo-content--buttons",children:(0,r.jsxs)("div",{className:"ablocks-import-demo-actions",children:[(0,r.jsx)(co,{onClick:()=>{l(e=>({...e,isImportModalLoading:!0})),s(n,e),i(e)},isLoading:t?.currentIndex===e,label:(0,a.__)("Start Import","ablocks"),preset:"white",suffix:"import"}),(0,r.jsx)(co,{onClick:()=>window.open(n?.demo_url,"_blank"),label:(0,a.__)("Live Preview","ablocks"),suffix:"live"})]})}),(0,r.jsx)("p",{className:"ablocks-import-demo-template-name",children:n?.title??(0,a.__)("Import","ablocks")+e+1})]},e)},_o=({category:e,selectedCategory:t,setSelectedCategory:n,handleFilterByCategory:s})=>{const[i,l]=(0,o.useState)(!1),c=(0,o.useRef)(null),d=e.slice(0,6),u=e.slice(6),m=e=>{n(e),s(e),l(!1)};return(0,o.useEffect)(()=>{const e=e=>!c.current.contains(e.target)&&l(!1);return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.jsxs)("ul",{className:"ablocks-import-demo-content__category",ref:c,children:[d.map((e,n)=>(0,r.jsx)("li",{role:"presentation",className:"ablocks-import-demo-content__category__title "+(e.slug===t.slug?"ablocks-import-demo-content__category--title-active":""),onClick:()=>m(e),children:e.label},n)),u.length>0&&(0,r.jsxs)("li",{className:"ablocks-import-demo-content__category__title ablocks-import-demo-content__category__more",onClick:()=>l(e=>!e),children:[(0,a.__)("More","ablocks"),i?(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-down"}):(0,r.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"}),i&&(0,r.jsx)("ul",{className:"ablocks-import-demo-content__category__dropdown",children:u.map((e,n)=>(0,r.jsx)("li",{className:"ablocks-import-demo-content__category__dropdown__item "+(e.slug===t.slug?"ablocks-import-demo-content__category__dropdown__item--active":""),onClick:()=>m(e),children:e.label},n))})]})]})},yo=({isAcademy:e=!1,selectedCat:t=[],handleNext:n})=>{let s="";t.length>0&&(s=t.join(","));const i=(0,o.useRef)(),[l,c]=(0,o.useState)([]),[d,m]=(0,o.useState)([]),[p,f]=(0,o.useState)([]),[h,g]=(0,o.useState)([]),[b,_]=(0,o.useState)(!0),[y,k]=(0,o.useState)(""),[x,w]=(0,o.useState)(""),[S,N]=(0,o.useState)([]),[v,E]=(0,o.useState)(null),[T,R]=(0,o.useState)(!1),[j,I]=(0,o.useState)({page:1,perPage:10,total:0}),[A,O]=(0,o.useState)(!1),[C,L]=(0,o.useState)({currentIndex:null,isLoading:!1}),[D,P]=(0,o.useState)({itemId:null,isChecked:!1}),[F,M]=(0,o.useState)([]),[U,B]=(0,o.useState)({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1});(0,o.useMemo)(()=>{if(S.length){const e=S.every(e=>e.status.installed&&e.status.activated);O(e)}},[S]),(0,o.useMemo)(()=>{S?.length&&i?.current?.scrollIntoView({behavior:"smooth",block:"start"})},[i,S?.length,U.isImportModalLoading]);const z=On+"assets/images/template-placeholder.png";(0,o.useEffect)(()=>{(async()=>{T&&!e||await q()})()},[T]);const H=(e,t="")=>{if(e.success)return I({page:e.data.page,total:e.data.total}),1!==j.page||t?e.data.posts:[...l,...e.data.posts];throw new Error("Invalid response status")},q=async(t=null,n)=>{const o={};s&&(o.category=s);const r=n||h;r&&r.slug&&"all"!==r.slug&&!e&&(o.category=o.category?`${r.slug}, ${o.category}`:r.slug),_(!0);try{if("object"==typeof t&&null===t){const{data:t}=await Jn({action:"ablocks/get_demo_list",type:"template",...o}),n=[...H(t)],{data:s}=await Jn({action:"ablocks/get_demo_categories",type:"template",...o}),r=s?.data?.map(e=>({label:(0,a.__)(e.name,"ablocks"),slug:e.slug}))||[];if(e){const e=r.filter(e=>"education"===e.slug);f(e),g(e[0]||{})}else{const e={label:(0,a.__)("All","ablocks"),slug:"all"};f([e,...r]),g(e)}m(n)}else{const{data:e}=await Jn({action:"ablocks/get_demo_list",type:"template",...o,page:t}),n=H(e);m(n)}}catch(e){console.error("Fetch error:",e),Kn("error",(0,a.__)("Something went wrong! please try again.","ablocks"))}finally{_(!1)}},W=async(e,t)=>{M([]),L({currentIndex:t,isLoading:!0});const n=e?.plugins||e?.dependencies;try{const e=await Jn({action:"ablocks/check_dependencies",dependencies:n});e.data.success&&(B({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),N(e.data.data),L({currentIndex:null,isLoading:!1}))}catch(e){Kn("error",e.message),L({currentIndex:null,isLoading:!1})}},$=async(t,o)=>{B({isSuccess:!1,isFailed:!1,isRunning:!0,isImportModalLoading:!1}),M([]);let s=jn+`?action=ablocks/import_template&security=${Mn}&file_url=${t?.file_url}`;(A||o)&&parseInt(D.itemId)===parseInt(t.id)&&(s+=`&with_images=${D.isChecked}`);const r=new EventSource(s,{withCredentials:!0});r.onmessage=t=>{const o=JSON.parse(t.data);"complete"!==o.action||o.error?"complete"===o.action&&o.error?(B({isSuccess:!1,isFailed:!0,isRunning:!1,isImportModalLoading:!1}),Kn("error",o.error),M(e=>[...e,o])):M(e=>[...e,o]):(M(e=>[...e,o]),Kn("success",(0,a.__)("Template sucessfully imported!","ablocks")),B({isSuccess:!0,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),r.close(),(e||n)&&n())},r.onerror=()=>{r.close()}},Y=async e=>{G(),_(!0);const t=l.filter(e=>e.categories.some(e=>e.slug===h.slug));try{let n={};"all"!==e?.slug&&(n={category:e?.slug,...n}),x&&(n={q:x,...n});const{data:o}=await Jn({action:"ablocks/get_demo_list",type:"template",...n}),s=H(o);m([...t,...s])}catch(e){Kn("error",(0,a.__)("Something wen wrong! Please try again.","ablocks")),_(!1)}finally{_(!1)}},G=()=>{B({isSuccess:!1,isFailed:!1,isRunning:!1,isImportModalLoading:!1}),N([]),M([])},V=()=>{G(),R(!0),Jn({action:"ablocks/clear_demo_transients"}).then(()=>{R(!1)})};return(0,r.jsxs)("div",{ref:i,children:[(0,r.jsx)(ho,{leftContent:()=>(0,r.jsx)(_o,{category:p,selectedCategory:h,setSelectedCategory:g,handleFilterByCategory:Y}),rightContent:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{role:"button",tabIndex:0,className:"ablocks-icon ablocks-icon--assets-generation","aria-disabled":T,onClick:T?void 0:V}),(0,r.jsx)(u,{defaultValue:x,onSearchHandler:e=>(async e=>{G(),_(!0);const t=e.toLowerCase().trim();w(t);try{const n=l.filter(e=>e.title?.toLowerCase().includes(t)),o={};t&&(o.q=t),s&&(o.category=s),h?.slug&&"all"!==h.slug&&(o.category=o.category?`${h.slug}, ${o.category}`:h.slug);const{data:a}=await Jn({action:"ablocks/get_demo_list",type:"template",...o}),r=H(a,e);m([...n,...r])}catch(e){Kn("error",(0,a.__)("Something wen wrong! Please try again.","ablocks")),_(!1)}finally{_(!1)}})(e.trim())})]})}),(0,r.jsxs)("div",{className:"ablocks-import-demo-content",children:[S?.length>0&&(0,r.jsx)(go,{onRequestClose:G,currentIndex:y,demos:d,dependencyData:S,importLoading:C,installDependenciesAndImport:async(e,t=null,n=!1)=>{let o;L({currentIndex:y,isLoading:!0});for(let t=0;t<e?.length;t++)E(S.findIndex(n=>parseInt(n.id)===parseInt(e[t].id))||t),o=await Jn({action:"ablocks/install_and_active",dependency:e[t]}).catch(e=>{L({currentIndex:null,isLoading:!1}),Kn("error",e.message)});if(o?.data?.success){E(null),Kn("success",(0,a.__)("successfully installed and activated","ablocks"));const o=S.map(t=>({...t,status:e.some(e=>parseInt(t.id)===parseInt(e.id))?{installed:!0,activated:!0}:t.status})),s=o.every(e=>e.status.installed&&e.status.activated);s&&n&&$(d[t],s),N(o),L({currentIndex:null,isLoading:!1})}else L({currentIndex:null,isLoading:!1})},setImportLoading:L,allDependenciesIsInstalled:A,importWithImage:D,setImportWithImage:P,dependencyIndex:v,improtMessages:F,importItem:$,setImprotingStates:B,improtingStates:U}),b?(0,r.jsx)(Zn,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"ablocks-import-demo-content__cards",children:d.length>0&&d.length>0?d.map((e,t)=>(0,r.jsx)(bo,{index:t,setCurrentIndex:k,importLoading:C,demo:e,demoUrl:z,importWithImage:D,setImportWithImage:P,onRequestClose:G,setImprotingStates:B,checkDependenciesAndImport:W},t)):(0,r.jsx)("p",{className:"ablocks-no-data-message",children:(0,a.__)("No item found","ablocks")})}),(0,r.jsx)(ro,{totalItems:j.total,currentPageNumber:j.page,fetchHandler:e=>q(e)})]})]})]})};document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("ablocks-theme-demo-importer");wp.hooks.addFilter("ablocks.demo-importer.content","ablocks.demo-importer-content",(e,t)=>(0,r.jsx)(yo,{...t})),e&&(0,t.H)(e).render((0,r.jsx)(fo,{}))})})()})();