PNG %k25u25%fgd5n!
/home/mkuwqnjx/palaknaturals.com/wp-content/plugins/code-snippets/dist/import.js
/*! For license information please see import.js.LICENSE.txt */
(()=>{var e={5338:(e,t,n)=>{"use strict";var r=n(5795);t.H=r.createRoot,r.hydrateRoot},1020:(e,t,n)=>{"use strict";var r=n(1609),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,s={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!c.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:o,type:e,key:l,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=l,t.jsxs=l},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM},4633:(e,t,n)=>{var r=n(3738).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},s=Object.prototype,i=s.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,s=Object.create(o.prototype),i=new N(r||[]);return a(s,"_invoke",{value:T(e,n,i)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var m="suspendedStart",g="suspendedYield",y="executing",x="completed",b={};function v(){}function w(){}function S(){}var j={};d(j,l,(function(){return this}));var _=Object.getPrototypeOf,O=_&&_(_(F([])));O&&O!==s&&i.call(O,l)&&(j=O);var E=S.prototype=v.prototype=Object.create(j);function R(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(o,s,a,c){var l=h(e[o],e,s);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==r(p)&&i.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(s,s):s()}})}function T(e,n,r){var o=m;return function(s,i){if(o===y)throw Error("Generator is already running");if(o===x){if("throw"===s)throw i;return{value:t,done:!0}}for(r.method=s,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===b)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=x,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?x:g,l.arg===b)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=x,r.method="throw",r.arg=l.arg)}}}function k(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var s=h(o,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,b;var i=s.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function F(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,s=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=S,a(E,"constructor",{value:S,configurable:!0}),a(S,"constructor",{value:w,configurable:!0}),w.displayName=d(S,p,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,d(e,p,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},R(A.prototype),d(A.prototype,u,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,o,s){void 0===s&&(s=Promise);var i=new A(f(e,t,r,o),s);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},R(E),d(E,p,"Generator"),d(E,l,(function(){return this})),d(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=F,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var c=i.call(s,"catchLoc"),l=i.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:F(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,s(n)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.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)r.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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:()=>We,hasStandardBrowserEnv:()=>He,hasStandardBrowserWebWorkerEnv:()=>Je,navigator:()=>Ve,origin:()=>Ge});var t=n(1609),r=n.n(t),o=n(5338);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,s,i,a=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return a}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const c=window.wp.i18n;function l(e,t,n,r,o,s,i){try{var a=e[s](i),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function i(e){l(s,r,o,i,a,"next",e)}function a(e){l(s,r,o,i,a,"throw",e)}i(void 0)}))}}var p=n(4756),d=n.n(p);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function h(e,t,n){return(t=function(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var g=n(6942),y=n.n(g),x=n(4848),b=["id","children","className","name","primary","secondary","small","large","link","type","onClick"];function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(e){var t=e.id,n=e.children,r=e.className,o=e.name,s=e.primary,i=void 0!==s&&s,a=e.secondary,c=void 0!==a&&a,l=e.small,u=void 0!==l&&l,p=e.large,d=void 0!==p&&p,f=e.link,h=void 0!==f&&f,g=e.type,v=void 0===g?"button":g,S=e.onClick,j=m(e,b);return(0,x.jsx)("button",w(w({id:null!=t?t:o,name:o,type:v},j),{},{onClick:function(e){S&&(e.preventDefault(),S(e))},className:y()("button",r,{"button-primary":i,"button-secondary":c,"button-large":d,"button-small":u,"button-link":h}),children:n}))},j=["children","className","variant","style"];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=r().forwardRef((function(e,t){var n=e.children,r=e.className,o=e.variant,s=void 0===o?"default":o,i=e.style,a=m(e,j),c=O({backgroundColor:"#ffffff",padding:"25px",borderRadius:"5px",border:"1px solid #e0e0e0",marginBottom:"10px",width:"100%"},i);return(0,x.jsx)("div",O(O({ref:t,className:y()({"import-controls":"controls"===s},r),style:c},a),{},{children:n}))}));E.displayName="ImportCard";var R=["children","active","className","style"];function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=function(e){var t=e.children,n=e.active,r=void 0!==n&&n,o=e.className,s=e.style,i=m(e,R),a=T({display:r?"block":"none",paddingTop:0},s);return(0,x.jsx)("div",T(T({className:o,style:a},i),{},{children:t}))},C=function(e){var t=e.value,n=e.onChange;return(0,x.jsxs)(E,{children:[(0,x.jsx)("h2",{style:{margin:"0 0 1em 0"},children:(0,c.__)("Duplicate Snippets","code-snippets")}),(0,x.jsx)("p",{className:"description",style:{marginBottom:"1em"},children:(0,c.__)("What should happen if an existing snippet is found with an identical name to an imported snippet?","code-snippets")}),(0,x.jsx)("fieldset",{children:(0,x.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[(0,x.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",cursor:"pointer"},children:[(0,x.jsx)("input",{type:"radio",name:"duplicate_action",value:"ignore",checked:"ignore"===t,onChange:function(e){return n(e.target.value)},style:{marginTop:"2px"}}),(0,x.jsx)("span",{children:(0,c.__)("Ignore any duplicate snippets: import all snippets from the file regardless and leave all existing snippets unchanged.","code-snippets")})]}),(0,x.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",cursor:"pointer"},children:[(0,x.jsx)("input",{type:"radio",name:"duplicate_action",value:"replace",checked:"replace"===t,onChange:function(e){return n(e.target.value)},style:{marginTop:"2px"}}),(0,x.jsx)("span",{children:(0,c.__)("Replace any existing snippets with a newly imported snippet of the same name.","code-snippets")})]}),(0,x.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",cursor:"pointer"},children:[(0,x.jsx)("input",{type:"radio",name:"duplicate_action",value:"skip",checked:"skip"===t,onChange:function(e){return n(e.target.value)},style:{marginTop:"2px"}}),(0,x.jsx)("span",{children:(0,c.__)("Do not import any duplicate snippets; leave all existing snippets unchanged.","code-snippets")})]})]})})]})},P=function(e){var n=e.fileInputRef,r=e.onFileSelect,o=e.disabled,s=void 0!==o&&o,i=function(e){var n=e.onFilesDrop,r=a((0,t.useState)(!1),2),o=r[0],s=r[1];return{dragOver:o,handleDragOver:function(e){e.preventDefault(),s(!0)},handleDragLeave:function(e){e.preventDefault(),s(!1)},handleDrop:function(e){e.preventDefault(),s(!1);var t=e.dataTransfer.files;t.length>0&&n(t)}}}({onFilesDrop:r}),l=i.dragOver,u=i.handleDragOver,p=i.handleDragLeave,d=i.handleDrop;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"upload-drop-zone ".concat(l?"drag-over":""),onDragOver:u,onDragLeave:p,onDrop:d,onClick:function(){var e;s||null===(e=n.current)||void 0===e||e.click()},style:{border:"2px dashed ".concat(l?"#0073aa":"#ccd0d4"),borderRadius:"4px",padding:"40px 20px",textAlign:"center",cursor:s?"not-allowed":"pointer",backgroundColor:l?"#f0f6fc":s?"#f6f7f7":"#fafafa",marginBottom:"20px",transition:"all 0.3s ease",opacity:s?.6:1},children:[(0,x.jsx)("div",{style:{fontSize:"48px",marginBottom:"10px",color:"#666"},children:"📁"}),(0,x.jsx)("p",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"500"},children:(0,c.__)("Drag and drop files here, or click to browse","code-snippets")}),(0,x.jsx)("p",{style:{margin:"0",color:"#666",fontSize:"14px"},children:(0,c.__)("Supports JSON and XML files","code-snippets")})]}),(0,x.jsx)("input",{ref:n,type:"file",accept:"application/json,.json,text/xml",multiple:!0,onChange:function(e){return r(e.target.files)},style:{display:"none"},disabled:s})]})},N=function(e){if(0===e)return"0 Bytes";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},F=function(e){var t=e.files,n=e.onRemoveFile;return(0,x.jsxs)("div",{className:"selected-files",style:{marginBottom:"20px"},children:[(0,x.jsxs)("h3",{style:{margin:"0 0 12px 0",fontSize:"14px",fontWeight:"600"},children:[(0,c.__)("Selected Files:","code-snippets")," (",t.length,")"]}),(0,x.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:Array.from(t).map((function(e,t){return(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9f9f9",borderRadius:"4px",border:"1px solid #ddd"},children:[(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,x.jsx)("span",{style:{fontSize:"16px"},children:"📄"}),(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{style:{fontWeight:"500"},children:e.name}),(0,x.jsx)("div",{style:{fontSize:"12px",color:"#666"},children:N(e.size)})]})]}),(0,x.jsx)("button",{type:"button",onClick:function(e){e.stopPropagation(),n(t)},style:{background:"none",border:"none",color:"#d63638",cursor:"pointer",fontSize:"16px",padding:"4px"},title:(0,c.__)("Remove file","code-snippets"),children:"✕"})]},t)}))})]})},L=function(e){var t=e.snippets,n=e.selectedSnippets,r=e.isAllSelected,o=e.onSnippetToggle,s=e.onSelectAll,i=function(e){switch(e){case"css":return"#9B59B6";case"js":return"#FFEB3B";case"html":return"#EF6A36";default:return"#1D97C6"}};return(0,x.jsxs)("table",{className:"wp-list-table widefat fixed striped",style:{borderRadius:"5px",tableLayout:"fixed"},children:[(0,x.jsx)("thead",{children:(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{scope:"col",className:"check-column",style:{padding:"8px 0",width:"40px"},children:(0,x.jsx)("input",{type:"checkbox",checked:r,onChange:s})}),(0,x.jsx)("th",{scope:"col",style:{width:"200px"},children:(0,c.__)("Name","code-snippets")}),(0,x.jsx)("th",{scope:"col",style:{width:"90px",textAlign:"center"},children:(0,c.__)("Type","code-snippets")}),(0,x.jsx)("th",{scope:"col",style:{width:"auto"},children:(0,c.__)("Description","code-snippets")}),(0,x.jsx)("th",{scope:"col",style:{width:"120px"},children:(0,c.__)("Tags","code-snippets")})]})}),(0,x.jsx)("tbody",{children:t.map((function(e){return(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{scope:"row",className:"check-column",children:(0,x.jsx)("input",{type:"checkbox",checked:n.has(e.table_data.id),onChange:function(){return o(e.table_data.id)}})}),(0,x.jsxs)("td",{children:[(0,x.jsx)("strong",{children:e.table_data.title}),e.source_file&&(0,x.jsxs)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:["from ",e.source_file]})]}),(0,x.jsx)("td",{style:{width:"90px",textAlign:"center"},children:(0,x.jsx)("span",{style:{backgroundColor:i(e.table_data.type),color:"white",padding:"3px 6px",fontSize:"10px",textTransform:"uppercase",borderRadius:"3px"},children:e.table_data.type})}),(0,x.jsx)("td",{children:(t=e.table_data.description,r=t||(0,c.__)("No description","code-snippets"),r.length>50?r.substring(0,50)+"...":r)}),(0,x.jsx)("td",{children:e.table_data.tags||"—"})]},e.table_data.id);var t,r}))})]})},D=function(e){var t=e.result;return(0,x.jsx)(E,{children:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[(0,x.jsx)("div",{style:{backgroundColor:t.success?"#00a32a":"#d63638",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"},children:(0,x.jsx)("span",{style:{color:"white",fontSize:"14px",fontWeight:"bold"},children:t.success?"✓":"✕"})}),(0,x.jsxs)("div",{style:{flex:1},children:[(0,x.jsx)("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"600"},children:t.success?(0,c.__)("Import Successful!","code-snippets"):(0,c.__)("Import Failed","code-snippets")}),(0,x.jsx)("p",{style:{margin:"0 0 8px 0",color:"#666"},children:t.message}),t.success&&(0,x.jsxs)("p",{style:{margin:"0",color:"#666"},children:[(0,c.__)("Go to ","code-snippets"),(0,x.jsx)("a",{href:"admin.php?page=snippets",style:{color:"#2271b1",textDecoration:"none"},children:(0,c.__)("All Snippets","code-snippets")}),(0,c.__)(" to activate your imported snippets.","code-snippets")]}),t.warnings&&t.warnings.length>0&&(0,x.jsxs)("div",{style:{marginTop:"12px"},children:[(0,x.jsx)("h4",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"#d63638"},children:(0,c.__)("Warnings:","code-snippets")}),(0,x.jsx)("ul",{style:{margin:"0",paddingLeft:"20px"},children:t.warnings.map((function(e,t){return(0,x.jsx)("li",{style:{color:"#666",fontSize:"14px"},children:e},t)}))})]})]})]})})};function I(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:B}=Object,z=(M=Object.create(null),e=>{const t=U.call(e);return M[t]||(M[t]=t.slice(8,-1).toLowerCase())});var M;const q=e=>(e=e.toLowerCase(),t=>z(t)===e),W=e=>t=>typeof t===e,{isArray:V}=Array,H=W("undefined"),J=q("ArrayBuffer"),G=W("string"),K=W("function"),$=W("number"),X=e=>null!==e&&"object"==typeof e,Y=e=>{if("object"!==z(e))return!1;const t=B(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Q=q("Date"),Z=q("File"),ee=q("Blob"),te=q("FileList"),ne=q("URLSearchParams"),[re,oe,se,ie]=["ReadableStream","Request","Response","Headers"].map(q);function ae(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),V(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function ce(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const le="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ue=e=>!H(e)&&e!==le,pe=(de="undefined"!=typeof Uint8Array&&B(Uint8Array),e=>de&&e instanceof de);var de;const fe=q("HTMLFormElement"),he=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),me=q("RegExp"),ge=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ae(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},ye=q("AsyncFunction"),xe=(be="function"==typeof setImmediate,ve=K(le.postMessage),be?setImmediate:ve?(we=`axios@${Math.random()}`,Se=[],le.addEventListener("message",(({source:e,data:t})=>{e===le&&t===we&&Se.length&&Se.shift()()}),!1),e=>{Se.push(e),le.postMessage(we,"*")}):e=>setTimeout(e));var be,ve,we,Se;const je="undefined"!=typeof queueMicrotask?queueMicrotask.bind(le):"undefined"!=typeof process&&process.nextTick||xe,_e={isArray:V,isArrayBuffer:J,isBuffer:function(e){return null!==e&&!H(e)&&null!==e.constructor&&!H(e.constructor)&&K(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||K(e.append)&&("formdata"===(t=z(e))||"object"===t&&K(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&J(e.buffer),t},isString:G,isNumber:$,isBoolean:e=>!0===e||!1===e,isObject:X,isPlainObject:Y,isReadableStream:re,isRequest:oe,isResponse:se,isHeaders:ie,isUndefined:H,isDate:Q,isFile:Z,isBlob:ee,isRegExp:me,isFunction:K,isStream:e=>X(e)&&K(e.pipe),isURLSearchParams:ne,isTypedArray:pe,isFileList:te,forEach:ae,merge:function e(){const{caseless:t}=ue(this)&&this||{},n={},r=(r,o)=>{const s=t&&ce(n,o)||o;Y(n[s])&&Y(r)?n[s]=e(n[s],r):Y(r)?n[s]=e({},r):V(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ae(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(ae(t,((t,r)=>{n&&K(t)?e[r]=I(t,n):e[r]=t}),{allOwnKeys:r}),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,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&B(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:z,kindOfTest:q,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!$(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:fe,hasOwnProperty:he,hasOwnProp:he,reduceDescriptors:ge,freezeMethods:e=>{ge(e,((t,n)=>{if(K(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];K(r)&&(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={},r=e=>{e.forEach((e=>{n[e]=!0}))};return V(e)?r(e):r(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:ce,global:le,isContextDefined:ue,isSpecCompliantForm:function(e){return!!(e&&K(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(X(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=V(e)?[]:{};return ae(e,((e,t)=>{const s=n(e,r+1);!H(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ye,isThenable:e=>e&&(X(e)||K(e))&&K(e.then)&&K(e.catch),setImmediate:xe,asap:je};function Oe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}_e.inherits(Oe,Error,{toJSON:function(){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:_e.toJSONObject(this.config),code:this.code,status:this.status}}});const Ee=Oe.prototype,Re={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Re[e]={value:e}})),Object.defineProperties(Oe,Re),Object.defineProperty(Ee,"isAxiosError",{value:!0}),Oe.from=(e,t,n,r,o,s)=>{const i=Object.create(Ee);return _e.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Oe.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Ae=Oe;function Te(e){return _e.isPlainObject(e)||_e.isArray(e)}function ke(e){return _e.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,n){return e?e.concat(t).map((function(e,t){return e=ke(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Pe=_e.toFlatObject(_e,{},null,(function(e){return/^is[A-Z]/.test(e)})),Ne=function(e,t,n){if(!_e.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=_e.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!_e.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&_e.isSpecCompliantForm(t);if(!_e.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(_e.isDate(e))return e.toISOString();if(!a&&_e.isBlob(e))throw new Ae("Blob is not supported. Use a Buffer instead.");return _e.isArrayBuffer(e)||_e.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(_e.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(_e.isArray(e)&&function(e){return _e.isArray(e)&&!e.some(Te)}(e)||(_e.isFileList(e)||_e.endsWith(n,"[]"))&&(a=_e.toArray(e)))return n=ke(n),a.forEach((function(e,r){!_e.isUndefined(e)&&null!==e&&t.append(!0===i?Ce([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!Te(e)||(t.append(Ce(o,n,s),c(e)),!1)}const u=[],p=Object.assign(Pe,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!_e.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!_e.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),_e.forEach(n,(function(n,s){!0===(!(_e.isUndefined(n)||null===n)&&o.call(t,n,_e.isString(s)?s.trim():s,r,p))&&e(n,r?r.concat(s):[s])})),u.pop()}}(e),t};function Fe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Le(e,t){this._pairs=[],e&&Ne(e,this,t)}const De=Le.prototype;De.append=function(e,t){this._pairs.push([e,t])},De.toString=function(e){const t=e?function(t){return e.call(this,t,Fe)}:Fe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ie=Le;function Ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,n){if(!t)return e;const r=n&&n.encode||Ue;_e.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):_e.isURLSearchParams(t)?t.toString():new Ie(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ze=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){_e.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},We="undefined"!=typeof window&&"undefined"!=typeof document,Ve="object"==typeof navigator&&navigator||void 0,He=We&&(!Ve||["ReactNative","NativeScript","NS"].indexOf(Ve.product)<0),Je="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ge=We&&window.location.href||"http://localhost",Ke={...e,...qe},$e=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&_e.isArray(r)?r.length:s,a?(_e.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&_e.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&_e.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(_e.isFormData(e)&&_e.isFunction(e.entries)){const n={};return _e.forEachEntry(e,((e,r)=>{t(function(e){return _e.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Xe={transitional:Me,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=_e.isObject(e);if(o&&_e.isHTMLForm(e)&&(e=new FormData(e)),_e.isFormData(e))return r?JSON.stringify($e(e)):e;if(_e.isArrayBuffer(e)||_e.isBuffer(e)||_e.isStream(e)||_e.isFile(e)||_e.isBlob(e)||_e.isReadableStream(e))return e;if(_e.isArrayBufferView(e))return e.buffer;if(_e.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ne(e,new Ke.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Ke.isNode&&_e.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=_e.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ne(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(_e.isString(e))try{return(0,JSON.parse)(e),_e.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Xe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(_e.isResponse(e)||_e.isReadableStream(e))return e;if(e&&_e.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ae.from(e,Ae.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:Ke.classes.FormData,Blob:Ke.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_e.forEach(["delete","get","head","post","put","patch"],(e=>{Xe.headers[e]={}}));const Ye=Xe,Qe=_e.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"]),Ze=Symbol("internals");function et(e){return e&&String(e).trim().toLowerCase()}function tt(e){return!1===e||null==e?e:_e.isArray(e)?e.map(tt):String(e)}function nt(e,t,n,r,o){return _e.isFunction(r)?r.call(this,t,n):(o&&(t=n),_e.isString(t)?_e.isString(r)?-1!==t.indexOf(r):_e.isRegExp(r)?r.test(t):void 0:void 0)}class rt{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=et(t);if(!o)throw new Error("header name must be a non-empty string");const s=_e.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=tt(e))}const s=(e,t)=>_e.forEach(e,((e,n)=>o(e,n,t)));if(_e.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(_e.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Qe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(_e.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=et(e)){const n=_e.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 r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(_e.isFunction(t))return t.call(this,e,n);if(_e.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=et(e)){const n=_e.findKey(this,e);return!(!n||void 0===this[n]||t&&!nt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=et(e)){const o=_e.findKey(n,e);!o||t&&!nt(0,n[o],o,t)||(delete n[o],r=!0)}}return _e.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!nt(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return _e.forEach(this,((r,o)=>{const s=_e.findKey(n,o);if(s)return t[s]=tt(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=tt(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return _e.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&_e.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")}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[Ze]=this[Ze]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=et(e);t[r]||(function(e,t){const n=_e.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return _e.isArray(e)?e.forEach(r):r(e),this}}rt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_e.reduceDescriptors(rt.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),_e.freezeMethods(rt);const ot=rt;function st(e,t){const n=this||Ye,r=t||n,o=ot.from(r.headers);let s=r.data;return _e.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function it(e){return!(!e||!e.__CANCEL__)}function at(e,t,n){Ae.call(this,null==e?"canceled":e,Ae.ERR_CANCELED,t,n),this.name="CanceledError"}_e.inherits(at,Ae,{__CANCEL__:!0});const ct=at;function lt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ae("Request failed with status code "+n.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ut=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,p=0;for(;u!==s;)p+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*p/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s,e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},pt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},dt=e=>(...t)=>_e.asap((()=>e(...t))),ft=Ke.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ke.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ke.origin),Ke.navigator&&/(msie|trident)/i.test(Ke.navigator.userAgent)):()=>!0,ht=Ke.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];_e.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),_e.isString(r)&&i.push("path="+r),_e.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function mt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const gt=e=>e instanceof ot?{...e}:e;function yt(e,t){t=t||{};const n={};function r(e,t,n,r){return _e.isPlainObject(e)&&_e.isPlainObject(t)?_e.merge.call({caseless:r},e,t):_e.isPlainObject(t)?_e.merge({},t):_e.isArray(t)?t.slice():t}function o(e,t,n,o){return _e.isUndefined(t)?_e.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!_e.isUndefined(t))return r(void 0,t)}function i(e,t){return _e.isUndefined(t)?_e.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(gt(e),gt(t),0,!0)};return _e.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);_e.isUndefined(i)&&s!==a||(n[r]=i)})),n}const xt=e=>{const t=yt({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=ot.from(a),t.url=Be(mt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),_e.isFormData(r))if(Ke.hasStandardBrowserEnv||Ke.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Ke.hasStandardBrowserEnv&&(o&&_e.isFunction(o)&&(o=o(t)),o||!1!==o&&ft(t.url))){const e=s&&i&&ht.read(i);e&&a.set(s,e)}return t},bt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=xt(e);let o=r.data;const s=ot.from(r.headers).normalize();let i,a,c,l,u,{responseType:p,onUploadProgress:d,onDownloadProgress:f}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ot.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());lt((function(e){t(e),h()}),(function(e){n(e),h()}),{data:p&&"text"!==p&&"json"!==p?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ae("Request aborted",Ae.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Ae("Network Error",Ae.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Me;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ae(t,o.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&_e.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),_e.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),p&&"json"!==p&&(m.responseType=r.responseType),f&&([c,u]=ut(f,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=ut(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new ct(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Ke.protocols.indexOf(y)?n(new Ae("Unsupported protocol "+y+":",Ae.ERR_BAD_REQUEST,e)):m.send(o||null)}))},vt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ae?t:new ct(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new Ae(`timeout ${t} of ms exceeded`,Ae.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>_e.asap(i),a}},wt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},St=(e,t,n,r)=>{const o=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*wt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},jt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,_t=jt&&"function"==typeof ReadableStream,Ot=jt&&("function"==typeof TextEncoder?(Et=new TextEncoder,e=>Et.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Et;const Rt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},At=_t&&Rt((()=>{let e=!1;const t=new Request(Ke.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Tt=_t&&Rt((()=>_e.isReadableStream(new Response("").body))),kt={stream:Tt&&(e=>e.body)};var Ct;jt&&(Ct=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!kt[e]&&(kt[e]=_e.isFunction(Ct[e])?t=>t[e]():(t,n)=>{throw new Ae(`Response type '${e}' is not supported`,Ae.ERR_NOT_SUPPORT,n)})})));const Pt={http:null,xhr:bt,fetch:jt&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:p="same-origin",fetchOptions:d}=xt(e);l=l?(l+"").toLowerCase():"text";let f,h=vt([o,s&&s.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(c&&At&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=_e.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(_e.isBlob(e))return e.size;if(_e.isSpecCompliantForm(e)){const t=new Request(Ke.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return _e.isArrayBufferView(e)||_e.isArrayBuffer(e)?e.byteLength:(_e.isURLSearchParams(e)&&(e+=""),_e.isString(e)?(await Ot(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(_e.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=pt(g,ut(dt(c)));r=St(n.body,65536,e,t)}}_e.isString(p)||(p=p?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?p:void 0});let s=await fetch(f);const i=Tt&&("stream"===l||"response"===l);if(Tt&&(a||i&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=_e.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&pt(t,ut(dt(a),!0))||[];s=new Response(St(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let y=await kt[_e.findKey(kt,l)||"text"](s,e);return!i&&m&&m(),await new Promise(((t,n)=>{lt(t,n,{data:y,headers:ot.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ae("Network Error",Ae.ERR_NETWORK,e,f),{cause:t.cause||t});throw Ae.from(t,t&&t.code,e,f)}})};_e.forEach(Pt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Nt=e=>`- ${e}`,Ft=e=>_e.isFunction(e)||null===e||!1===e,Lt=e=>{e=_e.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!Ft(n)&&(r=Pt[(t=String(n)).toLowerCase()],void 0===r))throw new Ae(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Dt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ct(null,e)}function It(e){return Dt(e),e.headers=ot.from(e.headers),e.data=st.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lt(e.adapter||Ye.adapter)(e).then((function(t){return Dt(e),t.data=st.call(e,e.transformResponse,t),t.headers=ot.from(t.headers),t}),(function(t){return it(t)||(Dt(e),t&&t.response&&(t.response.data=st.call(e,e.transformResponse,t.response),t.response.headers=ot.from(t.response.headers))),Promise.reject(t)}))}const Ut={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ut[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Bt={};Ut.transitional=function(e,t,n){function r(e,t){return"[Axios v1.8.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Ae(r(o," has been removed"+(t?" in "+t:"")),Ae.ERR_DEPRECATED);return t&&!Bt[o]&&(Bt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Ut.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const zt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Ae("option "+s+" must be "+n,Ae.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}},validators:Ut},Mt=zt.validators;class qt{constructor(e){this.defaults=e,this.interceptors={request:new ze,response:new ze}}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=yt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&zt.assertOptions(n,{silentJSONParsing:Mt.transitional(Mt.boolean),forcedJSONParsing:Mt.transitional(Mt.boolean),clarifyTimeoutError:Mt.transitional(Mt.boolean)},!1),null!=r&&(_e.isFunction(r)?t.paramsSerializer={serialize:r}:zt.assertOptions(r,{encode:Mt.function,serialize:Mt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),zt.assertOptions(t,{baseUrl:Mt.spelling("baseURL"),withXsrfToken:Mt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&_e.merge(o.common,o[t.method]);o&&_e.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ot.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,p=0;if(!a){const e=[It.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);p<u;)l=l.then(e[p++],e[p++]);return l}u=i.length;let d=t;for(p=0;p<u;){const e=i[p++],t=i[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=It.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,u=c.length;p<u;)l=l.then(c[p++],c[p++]);return l}getUri(e){return Be(mt((e=yt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}_e.forEach(["delete","get","head","options"],(function(e){qt.prototype[e]=function(t,n){return this.request(yt(n||{},{method:e,url:t,data:(n||{}).data}))}})),_e.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(yt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}qt.prototype[e]=t(),qt.prototype[e+"Form"]=t(!0)}));const Wt=qt;class Vt{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 r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ct(e,r,o),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 Vt((function(t){e=t})),cancel:e}}}const Ht=Vt,Jt={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};Object.entries(Jt).forEach((([e,t])=>{Jt[t]=e}));const Gt=Jt,Kt=function e(t){const n=new Wt(t),r=I(Wt.prototype.request,n);return _e.extend(r,Wt.prototype,n,{allOwnKeys:!0}),_e.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(yt(t,n))},r}(Ye);Kt.Axios=Wt,Kt.CanceledError=ct,Kt.CancelToken=Ht,Kt.isCancel=it,Kt.VERSION="1.8.4",Kt.toFormData=Ne,Kt.AxiosError=Ae,Kt.Cancel=Kt.CanceledError,Kt.all=function(e){return Promise.all(e)},Kt.spread=function(e){return function(t){return e.apply(null,t)}},Kt.isAxiosError=function(e){return _e.isObject(e)&&!0===e.isAxiosError},Kt.mergeConfig=yt,Kt.AxiosHeaders=ot,Kt.formToJSON=e=>$e(_e.isHTMLForm(e)?new FormData(e):e),Kt.getAdapter=Lt,Kt.HttpStatusCode=Gt,Kt.default=Kt;const $t=Kt;var Xt,Yt,Qt,Zt,en=function(){var e=u(d().mark((function e(t,n,r,o){var a,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=console).debug.apply(a,["".concat(t," ").concat(n)].concat(function(e){if(Array.isArray(e))return s(e)}(l=o?[o]:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||i(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),e.next=3,r;case 3:return c=e.sent,console.debug("Response",c),e.abrupt("return",c);case 6:case"end":return e.stop()}var l}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),tn=function(e){var n=(0,t.useMemo)((function(){return $t.create(e)}),[e]);return(0,t.useMemo)((function(){return{get:function(e){return en("GET",e,n.get(e))},post:function(e,t){return en("POST",e,n.post(e,t),t)},del:function(e){return en("DELETE",e,n.delete(e))},axiosInstance:n}}),[n])},nn="".concat(null===(Xt=window.CODE_SNIPPETS)||void 0===Xt?void 0:Xt.restAPI.base,"code-snippets/v1/"),rn={headers:{"X-WP-Nonce":null===(Yt=window.CODE_SNIPPETS)||void 0===Yt?void 0:Yt.restAPI.nonce}},on=function(){return window.pagenow.endsWith("-network")},sn=function(){var e,n=a((0,t.useState)("ignore"),2),r=n[0],o=n[1],s=a((0,t.useState)("upload"),2),i=s[0],l=s[1],p=(0,t.useRef)(null),f=function(){var e=a((0,t.useState)(null),2),n=e[0],r=e[1],o=(0,t.useRef)(null);return{selectedFiles:n,fileInputRef:o,handleFileSelect:function(e){r(e)},removeFile:function(e){if(n){var t=function(e,t){for(var n=new DataTransfer,r=0;r<e.length;r++)r!==t&&n.items.add(e[r]);return n.files}(n,e);r(t),o.current&&(o.current.files=t)}},clearFiles:function(){r(null),o.current&&(o.current.value="")},triggerFileInput:function(){var e;null===(e=o.current)||void 0===e||e.click()}}}(),h=function(){var e,n=a((0,t.useState)(!1),2),r=n[0],o=n[1],s=a((0,t.useState)(!1),2),i=s[0],l=s[1],p=a((0,t.useState)([]),2),f=p[0],h=p[1],m=a((0,t.useState)(null),2),g=m[0],y=m[1],x=(e=tn(rn).axiosInstance,(0,t.useMemo)((function(){return{parseFiles:function(t){for(var n=new FormData,r=0;r<t.files.length;r++)n.append("files[]",t.files[r]);return e.post("".concat(nn,"file-upload/parse"),n,{headers:{"Content-Type":"multipart/form-data"}})},importSnippets:function(t){return e.post("".concat(nn,"file-upload/import"),t)}}}),[e])),b=function(){var e=u(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&0!==t.length){e.next=3;break}return alert((0,c.__)("Please select files to upload.","code-snippets")),e.abrupt("return",!1);case 3:return o(!0),y(null),e.prev=5,e.next=8,x.parseFiles({files:t});case 8:return n=e.sent,h(n.data.snippets),n.data.warnings&&n.data.warnings.length>0&&y({success:!0,message:n.data.message,warnings:n.data.warnings}),e.abrupt("return",!0);case 14:return e.prev=14,e.t0=e.catch(5),console.error("Parse error:",e.t0),y({success:!1,message:e.t0 instanceof Error?e.t0.message:(0,c.__)("An unknown error occurred.","code-snippets")}),e.abrupt("return",!1);case 19:return e.prev=19,o(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[5,14,19,22]])})));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=u(d().mark((function e(t,n){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.length){e.next=3;break}return alert((0,c.__)("Please select snippets to import.","code-snippets")),e.abrupt("return",!1);case 3:return l(!0),y(null),e.prev=5,e.next=8,x.importSnippets({snippets:t,duplicate_action:n,network:on()});case 8:return r=e.sent,y({success:!0,message:r.data.message,imported:r.data.imported}),e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(5),console.error("Import error:",e.t0),y({success:!1,message:e.t0 instanceof Error?e.t0.message:(0,c.__)("An unknown error occurred.","code-snippets")}),e.abrupt("return",!1);case 18:return e.prev=18,l(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[5,13,18,21]])})));return function(t,n){return e.apply(this,arguments)}}();return{isUploading:r,isImporting:i,availableSnippets:f,uploadResult:g,parseFiles:b,importSnippets:v,resetWorkflow:function(){h([]),y(null)},clearUploadResult:function(){y(null)}}}(),m=function(e){var n=a((0,t.useState)(new Set),2),r=n[0],o=n[1],s=r.size===e.length&&e.length>0;return{selectedSnippets:r,handleSnippetToggle:function(e){var t=new Set(r);t.has(e)?t.delete(e):t.add(e),o(t)},handleSelectAll:function(){r.size===e.length?o(new Set):o(new Set(e.map((function(e){return e.table_data.id}))))},clearSelection:function(){o(new Set)},getSelectedSnippets:function(){return e.filter((function(e){return r.has(e.table_data.id)}))},isAllSelected:s}}(h.availableSnippets);(0,t.useEffect)((function(){"select"===i&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})}),[i]);var g=function(){var e=u(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f.selectedFiles){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,h.parseFiles(f.selectedFiles);case 4:e.sent&&(m.clearSelection(),l("select"));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=u(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=m.getSelectedSnippets(),e.next=3,h.importSnippets(t,r);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=!f.selectedFiles||0===f.selectedFiles.length||h.isUploading,v=0===m.selectedSnippets.size||h.isImporting;return(0,x.jsx)("div",{className:"wrap",children:(0,x.jsxs)("div",{className:"import-form-container",style:{maxWidth:"800px"},children:[(0,x.jsx)("p",{children:(0,c.__)("Upload one or more Code Snippets export files and the snippets will be imported.","code-snippets")}),(0,x.jsxs)("p",{children:[(0,c.__)("Afterward, you will need to visit the ","code-snippets"),(0,x.jsx)("a",{href:"admin.php?page=snippets",children:(0,c.__)("All Snippets","code-snippets")}),(0,c.__)(" page to activate the imported snippets.","code-snippets")]}),"upload"===i&&(0,x.jsx)(x.Fragment,{children:(!h.uploadResult||!h.uploadResult.success)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(C,{value:r,onChange:o}),(0,x.jsxs)(E,{children:[(0,x.jsx)("h2",{style:{margin:"0 0 1em 0"},children:(0,c.__)("Choose Files","code-snippets")}),(0,x.jsx)("p",{className:"description",style:{marginBottom:"1em"},children:(0,c.__)("Choose one or more Code Snippets (.xml or .json) files to parse and preview.","code-snippets")}),(0,x.jsx)(P,{fileInputRef:f.fileInputRef,onFileSelect:function(e){f.handleFileSelect(e),h.clearUploadResult()},disabled:h.isUploading}),f.selectedFiles&&f.selectedFiles.length>0&&(0,x.jsx)(F,{files:f.selectedFiles,onRemoveFile:f.removeFile}),(0,x.jsx)("div",{style:{textAlign:"center"},children:(0,x.jsx)(S,{primary:!0,onClick:g,disabled:b,style:{minWidth:"200px"},children:h.isUploading?(0,c.__)("Uploading files...","code-snippets"):(0,c.__)("Upload files","code-snippets")})})]})]})}),"select"===i&&h.availableSnippets.length>0&&!(null!==(e=h.uploadResult)&&void 0!==e&&e.success)&&(0,x.jsxs)(E,{ref:p,children:[(0,x.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:(0,x.jsx)(S,{onClick:function(){l("upload"),f.clearFiles(),m.clearSelection(),h.resetWorkflow()},className:"button-link",children:(0,c.__)("← Upload Different Files","code-snippets")})}),(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("h3",{style:{margin:"0"},children:[(0,c.__)("Available Snippets","code-snippets")," (",h.availableSnippets.length,")"]}),(0,x.jsx)("p",{style:{margin:"0.5em 0 1em 0",color:"#666"},children:(0,c.__)("Select the snippets you want to import:","code-snippets")})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)(S,{onClick:m.handleSelectAll,style:{marginRight:"10px"},children:m.isAllSelected?(0,c.__)("Deselect All","code-snippets"):(0,c.__)("Select All","code-snippets")}),(0,x.jsxs)(S,{primary:!0,onClick:y,disabled:v,children:[h.isImporting?(0,c.__)("Importing...","code-snippets"):(0,c.__)("Import Selected","code-snippets")," (",m.selectedSnippets.size,")"]})]})]}),(0,x.jsx)(L,{snippets:h.availableSnippets,selectedSnippets:m.selectedSnippets,isAllSelected:m.isAllSelected,onSnippetToggle:m.handleSnippetToggle,onSelectAll:m.handleSelectAll}),(0,x.jsxs)("div",{style:{textAlign:"end",marginTop:"1em"},children:[(0,x.jsx)(S,{onClick:m.handleSelectAll,style:{marginRight:"10px"},children:m.isAllSelected?(0,c.__)("Deselect All","code-snippets"):(0,c.__)("Select All","code-snippets")}),(0,x.jsxs)(S,{primary:!0,onClick:y,disabled:v,children:[h.isImporting?(0,c.__)("Importing...","code-snippets"):(0,c.__)("Import Selected","code-snippets")," (",m.selectedSnippets.size,")"]})]})]}),h.uploadResult&&(0,x.jsx)(D,{result:h.uploadResult})]})})},an=function(e){var t=e.importers,n=e.selectedImporter,r=e.onImporterChange,o=e.isLoading;return(0,x.jsxs)(E,{variant:"controls",children:[(0,x.jsx)("label",{htmlFor:"importer-select",children:(0,x.jsx)("h2",{style:{margin:"0 0 1em 0"},children:(0,c.__)("Select Plugin","code-snippets")})}),(0,x.jsxs)("select",{id:"importer-select",value:n,onChange:function(e){return r(e.target.value)},className:"regular-text",style:{display:"block",marginTop:"5px",width:"100%",maxWidth:"300px"},disabled:o,children:[(0,x.jsx)("option",{value:"",children:(0,c.__)("-- Select an importer --","code-snippets")}),t.map((function(e){return(0,x.jsxs)("option",{value:e.name,disabled:!e.is_active,children:[e.title," ",e.is_active?"":(0,c.__)("(Inactive)","code-snippets")]},e.name)}))]}),o&&(0,x.jsx)("p",{style:{margin:"10px 0 0 0",color:"#666",fontSize:"14px"},children:(0,c.__)("Loading snippets...","code-snippets")})]})},cn=function(e){var t=e.autoAddTags,n=e.tagValue,r=e.onAutoAddTagsChange,o=e.onTagValueChange;return(0,x.jsxs)(E,{children:[(0,x.jsx)("h2",{style:{margin:"0 0 1em 0"},children:(0,c.__)("Import options","code-snippets")}),(0,x.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",cursor:"pointer"},children:[(0,x.jsx)("input",{type:"checkbox",checked:t,onChange:function(e){return r(e.target.checked)},style:{marginTop:"2px"}}),(0,x.jsxs)("div",{style:{flex:1},children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("strong",{children:(0,c.__)("Automatically add Tag","code-snippets")}),(0,x.jsx)("br",{}),(0,x.jsx)("span",{style:{color:"#666",fontSize:"0.9em"},children:(0,c.__)("For your convenience, we can add a tag on every imported snippet.","code-snippets")})]}),t&&(0,x.jsx)("div",{style:{marginTop:"12px"},children:(0,x.jsx)("input",{type:"text",value:n,onChange:function(e){return o(e.target.value)},placeholder:(0,c.__)("Add tag...","code-snippets"),className:"regular-text",style:{width:"100%",maxWidth:"300px"}})})]})]})]})},ln=function(e){var t=e.snippets,n=e.selectedSnippets,r=e.onSnippetToggle,o=e.onSelectAll,s=e.onImport,i=e.isImporting,a=n.size===t.length&&t.length>0;return(0,x.jsxs)(E,{className:"snippets-table-container",children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("h2",{style:{margin:"0"},children:[(0,c.__)("Available Snippets","code-snippets")," (",t.length,")"]}),(0,x.jsx)("p",{style:{margin:"0.5em 0 1em 0"},children:(0,c.__)("We found the following snippets.","code-snippets")})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)(S,{onClick:o,style:{marginRight:"10px"},children:a?(0,c.__)("Deselect All","code-snippets"):(0,c.__)("Select All","code-snippets")}),(0,x.jsxs)(S,{primary:!0,onClick:s,disabled:0===n.size||i,children:[i?(0,c.__)("Importing...","code-snippets"):(0,c.__)("Import Selected","code-snippets")," (",n.size,")"]})]})]}),(0,x.jsxs)("table",{className:"wp-list-table widefat fixed striped",style:{borderRadius:"5px"},children:[(0,x.jsx)("thead",{children:(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{scope:"col",className:"check-column",style:{padding:"8px 0"},children:(0,x.jsx)("input",{type:"checkbox",checked:a,onChange:o})}),(0,x.jsx)("th",{scope:"col",children:(0,c.__)("Snippet Name","code-snippets")}),(0,x.jsx)("th",{scope:"col",style:{textAlign:"end",width:"50px"},children:(0,c.__)("ID","code-snippets")})]})}),(0,x.jsx)("tbody",{children:t.map((function(e){return(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{scope:"row",className:"check-column",children:(0,x.jsx)("input",{type:"checkbox",checked:n.has(e.table_data.id),onChange:function(){return r(e.table_data.id)}})}),(0,x.jsx)("td",{children:e.table_data.title}),(0,x.jsx)("td",{style:{textAlign:"end",width:"50px"},children:e.table_data.id})]},e.table_data.id)}))})]}),(0,x.jsxs)("div",{style:{textAlign:"end",marginTop:"1em"},children:[(0,x.jsx)(S,{onClick:o,style:{marginRight:"10px"},children:a?(0,c.__)("Deselect All","code-snippets"):(0,c.__)("Select All","code-snippets")}),(0,x.jsxs)(S,{primary:!0,onClick:s,disabled:0===n.size||i,children:[i?(0,c.__)("Importing...","code-snippets"):(0,c.__)("Import Selected","code-snippets")," (",n.size,")"]})]})]})},un=function(e){var t=e.type,n=e.title,r=e.message,o=e.showSnippetsLink,s=void 0!==o&&o,i="error"===t;return(0,x.jsxs)(E,{variant:"controls",style:{display:"flex",alignItems:"flex-start",gap:"12px",marginBottom:"20px"},children:[(0,x.jsx)("div",{style:{backgroundColor:i?"#d63638":"#00a32a",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"},children:(0,x.jsx)("span",{style:{color:"white",fontSize:"14px",fontWeight:"bold"},children:i?"✕":"✓"})}),(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"600"},children:n}),(0,x.jsxs)("p",{style:{margin:"0",color:"#666"},children:[r,s&&(0,x.jsxs)(x.Fragment,{children:[" ",(0,x.jsx)("a",{href:"admin.php?page=snippets",style:{color:"#2271b1",textDecoration:"none"},children:(0,c.__)("Code Snippets Library","code-snippets")}),"."]})]})]})]})},pn="".concat(null===(Qt=window.CODE_SNIPPETS)||void 0===Qt?void 0:Qt.restAPI.base,"code-snippets/v1/"),dn={headers:{"X-WP-Nonce":null===(Zt=window.CODE_SNIPPETS)||void 0===Zt?void 0:Zt.restAPI.nonce}},fn=function(){var e=tn(dn),n=e.get,r=e.post;return(0,t.useMemo)((function(){return{fetchAll:function(){return n("".concat(pn,"importers"))},fetchSnippets:function(e){return n("".concat(pn).concat(e))},importSnippets:function(e,t){return r("".concat(pn).concat(e,"/import"),t)}}}),[n,r])},hn=function(){var e=a((0,t.useState)(!1),2),n=e[0],r=e[1],o=function(){var e=a((0,t.useState)([]),2),n=e[0],r=e[1],o=a((0,t.useState)(""),2),s=o[0],i=o[1],c=a((0,t.useState)(!0),2),l=c[0],p=c[1],f=a((0,t.useState)(null),2),h=f[0],m=f[1],g=a((0,t.useState)(""),2),y=g[0],x=g[1],b=fn();return(0,t.useEffect)((function(){var e=function(){var e=u(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.fetchAll();case 3:t=e.sent,r(t.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),m(e.t0 instanceof Error?e.t0.message:"Unknown error");case 10:return e.prev=10,p(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})));return function(){return e.apply(this,arguments)}}();e()}),[b]),{importers:n,selectedImporter:s,isLoading:l,error:h,tagValue:y,setTagValue:x,handleImporterChange:function(e){i(e),x("imported-".concat(e))}}}(),s=function(){var e=a((0,t.useState)([]),2),n=e[0],r=e[1],o=a((0,t.useState)(!1),2),s=o[0],i=o[1],l=a((0,t.useState)(null),2),p=l[0],f=l[1],h=a((0,t.useState)(!1),2),m=h[0],g=h[1],y=a((0,t.useState)(null),2),x=y[0],b=y[1],v=a((0,t.useState)([]),2),w=v[0],S=v[1],j=fn(),_=function(){var e=u(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return alert((0,c.__)("Please select an importer.","code-snippets")),e.abrupt("return",!1);case 3:return i(!0),f(null),r([]),E(),e.prev=7,e.next=10,j.fetchSnippets(t);case 10:return n=e.sent,r(n.data),e.abrupt("return",!0);case 15:return e.prev=15,e.t0=e.catch(7),f(e.t0 instanceof Error?e.t0.message:"Unknown error"),e.abrupt("return",!1);case 19:return e.prev=19,i(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[7,15,19,22]])})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=u(d().mark((function e(t,n,o,s){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==n.length){e.next=3;break}return alert((0,c.__)("Please select snippets to import.","code-snippets")),e.abrupt("return",!1);case 3:if(t){e.next=6;break}return alert((0,c.__)("Please select an importer.","code-snippets")),e.abrupt("return",!1);case 6:return g(!0),b(null),S([]),e.prev=9,e.next=12,j.importSnippets(t,{ids:n,network:on(),auto_add_tags:o,tag_value:o?s:void 0});case 12:if(i=e.sent,S(i.data.imported),!(i.data.imported.length>0)){e.next=19;break}return r([]),e.abrupt("return",!0);case 19:return alert((0,c.__)("No snippets were imported.","code-snippets")),e.abrupt("return",!1);case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(9),b(e.t0 instanceof Error?e.t0.message:"Unknown error"),e.abrupt("return",!1);case 27:return e.prev=27,g(!1),e.finish(27);case 30:case"end":return e.stop()}}),e,null,[[9,23,27,30]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),E=function(){S([]),b(null)};return{snippets:n,isLoadingSnippets:s,snippetsError:p,isImporting:m,importError:x,importSuccess:w,loadSnippets:_,importSnippets:O,clearResults:E,resetAll:function(){r([]),E(),f(null)}}}(),i=function(e){var n=a((0,t.useState)(new Set),2),r=n[0],o=n[1],s=r.size===e.length&&e.length>0;return{selectedSnippets:r,handleSnippetToggle:function(e){var t=new Set(r);t.has(e)?t.delete(e):t.add(e),o(t)},handleSelectAll:function(){r.size===e.length?o(new Set):o(new Set(e.map((function(e){return e.table_data.id}))))},clearSelection:function(){o(new Set)},getSelectedSnippets:function(){return e.filter((function(e){return r.has(e.table_data.id)}))},isAllSelected:s}}(s.snippets),l=function(){var e=u(d().mark((function e(t){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.handleImporterChange(t),i.clearSelection(),s.resetAll(),!t){e.next=6;break}return e.next=6,s.loadSnippets(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),p=function(){var e=u(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Array.from(i.selectedSnippets),e.next=3,s.importSnippets(o.selectedImporter,t,n,o.tagValue);case 3:e.sent&&i.clearSelection();case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return o.isLoading?(0,x.jsx)("div",{className:"wrap",children:(0,x.jsx)("p",{children:(0,c.__)("Loading importers...","code-snippets")})}):o.error?(0,x.jsx)("div",{className:"wrap",children:(0,x.jsx)("div",{className:"notice notice-error",children:(0,x.jsxs)("p",{children:[(0,c.__)("Error loading importers:","code-snippets")," ",o.error]})})}):(0,x.jsx)("div",{className:"wrap",children:(0,x.jsxs)("div",{className:"import-form-container",style:{maxWidth:"800px"},children:[(0,x.jsx)("p",{children:(0,c.__)("If you are using another Snippets plugin, you can import all existing snippets to your Code Snippets library.","code-snippets")}),(0,x.jsx)(an,{importers:o.importers,selectedImporter:o.selectedImporter,onImporterChange:l,isLoading:s.isLoadingSnippets}),s.snippetsError&&(0,x.jsx)(un,{type:"error",title:(0,c.__)("Error loading snippets","code-snippets"),message:s.snippetsError}),s.importError&&(0,x.jsx)(un,{type:"error",title:(0,c.__)("Error importing snippets","code-snippets"),message:s.importError}),s.importSuccess.length>0&&(0,x.jsx)(un,{type:"success",title:"".concat(s.importSuccess.length," ").concat((0,c.__)("Snippets imported!","code-snippets")),message:(0,c.__)("We successfully imported all snippets to your library. Go to ","code-snippets"),showSnippetsLink:!0}),o.selectedImporter&&!s.isLoadingSnippets&&!s.snippetsError&&0===s.snippets.length&&0===s.importSuccess.length&&(0,x.jsx)(E,{children:(0,x.jsxs)("div",{style:{textAlign:"center",padding:"40px 20px",color:"#666"},children:[(0,x.jsx)("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"📭"}),(0,x.jsx)("h3",{style:{margin:"0 0 8px 0",fontSize:"18px",color:"#333"},children:(0,c.__)("No snippets found","code-snippets")}),(0,x.jsx)("p",{style:{margin:"0",fontSize:"14px"},children:(0,c.__)("No snippets were found for the selected plugin. Make sure the plugin is installed and has snippets configured.","code-snippets")})]})}),s.snippets.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(cn,{autoAddTags:n,tagValue:o.tagValue,onAutoAddTagsChange:r,onTagValueChange:o.setTagValue}),(0,x.jsx)(ln,{snippets:s.snippets,selectedSnippets:i.selectedSnippets,onSnippetToggle:i.handleSnippetToggle,onSelectAll:i.handleSelectAll,onImport:p,isImporting:s.isImporting})]})]})})},mn=function(){var e=a((0,t.useState)("upload"),2),n=e[0],r=e[1];(0,t.useEffect)((function(){var e=new URLSearchParams(window.location.search).get("tab");"plugins"!==e&&"upload"!==e||r(e)}),[]);var o=function(e){r(e);var t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.replaceState({},"",t)};return(0,x.jsxs)("div",{className:"narrow",style:{maxWidth:"800px"},children:[(0,x.jsxs)("h2",{className:"nav-tab-wrapper",style:{marginBottom:"20px"},children:[(0,x.jsx)("a",{className:"nav-tab".concat("upload"===n?" nav-tab-active":""),href:"#",onClick:function(e){e.preventDefault(),o("upload")},children:(0,c.__)("Import Snippets","code-snippets")}),(0,x.jsx)("a",{className:"nav-tab".concat("plugins"===n?" nav-tab-active":""),href:"#",onClick:function(e){e.preventDefault(),o("plugins")},children:(0,c.__)("Import from other plugins","code-snippets")})]}),(0,x.jsx)(k,{active:"upload"===n,children:(0,x.jsx)(sn,{})}),(0,x.jsx)(k,{active:"plugins"===n,children:(0,x.jsx)(hn,{})})]})},gn=document.getElementById("import-container");gn?(0,o.H)(gn).render((0,x.jsx)(mn,{})):console.error("Could not find import container.")})()})();