File "edit.js"

Full path: /home/dora/public_html/wp-content/plugins/code-snippets/dist/edit.js
File size: 77.68 KB
MIME-type: --
Charset: utf-8

/*! For license information please see edit.js.LICENSE.txt */
(self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[922],{1908:(e,t,n)=>{"use strict";const r=window.React,o=window.ReactDOM;var i=n.n(o),s=n(9142);function c(e,t,n){return(t=(0,s.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(3324),l=n(4184),p=n.n(l),u=["css","js"],d=function(){return{id:0,name:"",desc:"",code:"",tags:[],scope:"global",modified:"",active:!1,network:g(),shared_network:null,priority:10}},f=function(e){var t="string"==typeof e?e:e.scope;return t.endsWith("-css")?"css":t.endsWith("-js")?"js":t.endsWith("content")?"html":"php"},m=function(e){return u.includes(e)},h=function(){var e;return!(null===(e=window.CODE_SNIPPETS)||void 0===e||!e.isLicensed)},b=function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",$:"&#36;"};return e.code=e.code.replace(/[&<>$]/g,(function(e){var n;return null!==(n=t[e])&&void 0!==n?n:e})),e.encoded=!0,e},y={php:["php","text/php"],html:["php","text/php"],css:["css","text/css"],js:["js","text/javascript"],json:["json","application/json"]},g=function(){return window.pagenow.endsWith("-network")},O=function(e,t,n){var r,o=t.id,i=t.name,s=t.scope,c=(0,a.Z)(y[null!=n?n:f(s)],2),l=c[0],p=c[1],u=null!==(r=i.toLowerCase().replace(/[^\w-]+/g,"-"))&&void 0!==r?r:"snippet-".concat(o);!function(e,t,n){var r=document.createElement("a");r.download=t,r.href=URL.createObjectURL(new Blob([e],{type:n})),setTimeout((function(){return URL.revokeObjectURL(r.href)}),4e4),setTimeout((function(){return r.click()}),0)}(e,"".concat(u,".code-snippets.").concat(l),p)};function E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const v=window.wp.components,_=window.wp.i18n;var w=["id","text","name","primary","small","large","type","onClick"];function S(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=function(e){var t=e.id,n=e.text,o=e.name,i=void 0===o?"submit":o,s=e.primary,c=void 0!==s&&s,a=e.small,l=void 0!==a&&a,u=e.large,d=void 0!==u&&u,f=e.type,m=void 0===f?"button":f,h=e.onClick,b=E(e,w);return(0,r.createElement)("button",j(j({id:null!=t?t:i,name:i,type:m},b),{},{onClick:function(e){h&&(e.preventDefault(),h(e))},className:p()("button",{"button-primary":c,"button-large":d,"button-small":l})}),n)},k=function(e){var t=e.open,n=e.title,o=e.onConfirm,i=e.onCancel,s=e.children,c=e.confirmLabel,a=void 0===c?(0,_.__)("OK","code-snippets"):c,l=e.cancelLabel,p=void 0===l?(0,_.__)("Cancel","code-snippets"):l,u=e.confirmButtonClassName;return t?(0,r.createElement)(v.Modal,{title:n,onRequestClose:i,closeButtonLabel:p,isDismissible:!0,onKeyDown:function(e){"Enter"===e.key&&(null==o||o())}},s,(0,r.createElement)(v.Flex,{direction:"row",justify:"flex-end"},(0,r.createElement)(v.Button,{variant:"tertiary",onClick:i},p),(0,r.createElement)(v.Button,{variant:"primary",onClick:o,className:u},a))):null};function C(e){try{return decodeURIComponent(e)}catch(t){return e}}function x(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const r=e.indexOf("?");return-1!==r&&(t=Object.assign(function(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce(((e,t)=>{const[n,r=""]=t.split("=").filter(Boolean).map(C);return n&&function(e,t,n){const r=t.length,o=r-1;for(let i=0;i<r;i++){let r=t[i];!r&&Array.isArray(e)&&(r=e.length.toString()),r=["__proto__","constructor","prototype"].includes(r)?r.toUpperCase():r;const s=!isNaN(Number(t[i+1]));e[r]=i===o?n:e[r]||(s?[]:{}),Array.isArray(e[r])&&!s&&(e[r]={...e[r]}),e=e[r]}}(e,n.replace(/\]/g,"").split("["),r),e}),Object.create(null))}(e),t),n=n.substr(0,r)),n+"?"+function(e){let t="";const n=Object.entries(e);let r;for(;r=n.shift();){let[e,o]=r;if(Array.isArray(o)||o&&o.constructor===Object){const t=Object.entries(o).reverse();for(const[r,o]of t)n.unshift([`${e}[${r}]`,o])}else void 0!==o&&(null===o&&(o=""),t+="&"+[e,o].map(encodeURIComponent).join("="))}return t.substr(1)}(t)}function D(e,t){return function(){return e.apply(t,arguments)}}const{toString:N}=Object.prototype,{getPrototypeOf:R}=Object,A=(T=Object.create(null),e=>{const t=N.call(e);return T[t]||(T[t]=t.slice(8,-1).toLowerCase())});var T;const F=e=>(e=e.toLowerCase(),t=>A(t)===e),I=e=>t=>typeof t===e,{isArray:L}=Array,U=I("undefined"),B=F("ArrayBuffer"),M=I("string"),q=I("function"),Z=I("number"),W=e=>null!==e&&"object"==typeof e,z=e=>{if("object"!==A(e))return!1;const t=R(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},J=F("Date"),H=F("File"),K=F("Blob"),$=F("FileList"),V=F("URLSearchParams");function G(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),L(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),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function X(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 Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Q=e=>!U(e)&&e!==Y,ee=(te="undefined"!=typeof Uint8Array&&R(Uint8Array),e=>te&&e instanceof te);var te;const ne=F("HTMLFormElement"),re=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oe=F("RegExp"),ie=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};G(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},se="abcdefghijklmnopqrstuvwxyz",ce="0123456789",ae={DIGIT:ce,ALPHA:se,ALPHA_DIGIT:se+se.toUpperCase()+ce},le=F("AsyncFunction"),pe={isArray:L,isArrayBuffer:B,isBuffer:function(e){return null!==e&&!U(e)&&null!==e.constructor&&!U(e.constructor)&&q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||q(e.append)&&("formdata"===(t=A(e))||"object"===t&&q(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&B(e.buffer),t},isString:M,isNumber:Z,isBoolean:e=>!0===e||!1===e,isObject:W,isPlainObject:z,isUndefined:U,isDate:J,isFile:H,isBlob:K,isRegExp:oe,isFunction:q,isStream:e=>W(e)&&q(e.pipe),isURLSearchParams:V,isTypedArray:ee,isFileList:$,forEach:G,merge:function e(){const{caseless:t}=Q(this)&&this||{},n={},r=(r,o)=>{const i=t&&X(n,o)||o;z(n[i])&&z(r)?n[i]=e(n[i],r):z(r)?n[i]=e({},r):L(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&G(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(G(t,((t,r)=>{n&&q(t)?e[r]=D(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,i,s;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&R(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:A,kindOfTest:F,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(L(e))return e;let t=e.length;if(!Z(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:ne,hasOwnProperty:re,hasOwnProp:re,reduceDescriptors:ie,freezeMethods:e=>{ie(e,((t,n)=>{if(q(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];q(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 L(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)=>(e=+e,Number.isFinite(e)?e:t),findKey:X,global:Y,isContextDefined:Q,ALPHABET:ae,generateString:(e=16,t=ae.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&q(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(W(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=L(e)?[]:{};return G(e,((e,t)=>{const i=n(e,r+1);!U(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:le,isThenable:e=>e&&(W(e)||q(e))&&q(e.then)&&q(e.catch)};function ue(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)}pe.inherits(ue,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:pe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const de=ue.prototype,fe={};["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=>{fe[e]={value:e}})),Object.defineProperties(ue,fe),Object.defineProperty(de,"isAxiosError",{value:!0}),ue.from=(e,t,n,r,o,i)=>{const s=Object.create(de);return pe.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ue.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const me=ue;function he(e){return pe.isPlainObject(e)||pe.isArray(e)}function be(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function ye(e,t,n){return e?e.concat(t).map((function(e,t){return e=be(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ge=pe.toFlatObject(pe,{},null,(function(e){return/^is[A-Z]/.test(e)})),Oe=function(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!pe.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,c=(n.Blob||"undefined"!=typeof Blob&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(o))throw new TypeError("visitor must be a function");function a(e){if(null===e)return"";if(pe.isDate(e))return e.toISOString();if(!c&&pe.isBlob(e))throw new me("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(e)||pe.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let c=e;if(e&&!o&&"object"==typeof e)if(pe.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(pe.isArray(e)&&function(e){return pe.isArray(e)&&!e.some(he)}(e)||(pe.isFileList(e)||pe.endsWith(n,"[]"))&&(c=pe.toArray(e)))return n=be(n),c.forEach((function(e,r){!pe.isUndefined(e)&&null!==e&&t.append(!0===s?ye([n],r,i):null===s?n:n+"[]",a(e))})),!1;return!!he(e)||(t.append(ye(o,n,i),a(e)),!1)}const p=[],u=Object.assign(ge,{defaultVisitor:l,convertValue:a,isVisitable:he});if(!pe.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!pe.isUndefined(n)){if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),pe.forEach(n,(function(n,i){!0===(!(pe.isUndefined(n)||null===n)&&o.call(t,n,pe.isString(i)?i.trim():i,r,u))&&e(n,r?r.concat(i):[i])})),p.pop()}}(e),t};function Ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ve(e,t){this._pairs=[],e&&Oe(e,this,t)}const _e=ve.prototype;_e.append=function(e,t){this._pairs.push([e,t])},_e.toString=function(e){const t=e?function(t){return e.call(this,t,Ee)}:Ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const we=ve;function Se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function je(e,t,n){if(!t)return e;const r=n&&n.encode||Se,o=n&&n.serialize;let i;if(i=o?o(t,n):pe.isURLSearchParams(t)?t.toString():new we(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Pe=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){pe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ce={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:we,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},xe=function(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),c=o>=e.length;return i=!i&&pe.isArray(r)?r.length:i,c?(pe.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&pe.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&pe.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,((e,r)=>{t(function(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},De={"Content-Type":void 0},Ne={transitional:ke,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=pe.isObject(e);if(o&&pe.isHTMLForm(e)&&(e=new FormData(e)),pe.isFormData(e))return r&&r?JSON.stringify(xe(e)):e;if(pe.isArrayBuffer(e)||pe.isBuffer(e)||pe.isStream(e)||pe.isFile(e)||pe.isBlob(e))return e;if(pe.isArrayBufferView(e))return e.buffer;if(pe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Oe(e,new Ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Ce.isNode&&pe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=pe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Oe(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(pe.isString(e))try{return(0,JSON.parse)(e),pe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&pe.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 me.from(e,me.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:Ce.classes.FormData,Blob:Ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};pe.forEach(["delete","get","head"],(function(e){Ne.headers[e]={}})),pe.forEach(["post","put","patch"],(function(e){Ne.headers[e]=pe.merge(De)}));const Re=Ne,Ae=pe.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"]),Te=Symbol("internals");function Fe(e){return e&&String(e).trim().toLowerCase()}function Ie(e){return!1===e||null==e?e:pe.isArray(e)?e.map(Ie):String(e)}function Le(e,t,n,r,o){return pe.isFunction(r)?r.call(this,t,n):(o&&(t=n),pe.isString(t)?pe.isString(r)?-1!==t.indexOf(r):pe.isRegExp(r)?r.test(t):void 0:void 0)}class Ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Fe(t);if(!o)throw new Error("header name must be a non-empty string");const i=pe.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ie(e))}const i=(e,t)=>pe.forEach(e,((e,n)=>o(e,n,t)));return pe.isPlainObject(e)||e instanceof this.constructor?i(e,t):pe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((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]&&Ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=Fe(e)){const n=pe.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(pe.isFunction(t))return t.call(this,e,n);if(pe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Fe(e)){const n=pe.findKey(this,e);return!(!n||void 0===this[n]||t&&!Le(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Fe(e)){const o=pe.findKey(n,e);!o||t&&!Le(0,n[o],o,t)||(delete n[o],r=!0)}}return pe.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&&!Le(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return pe.forEach(this,((r,o)=>{const i=pe.findKey(n,o);if(i)return t[i]=Ie(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ie(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return pe.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&pe.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[Te]=this[Te]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Fe(e);t[r]||(function(e,t){const n=pe.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 pe.isArray(e)?e.forEach(r):r(e),this}}Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),pe.freezeMethods(Ue.prototype),pe.freezeMethods(Ue);const Be=Ue;function Me(e,t){const n=this||Re,r=t||n,o=Be.from(r.headers);let i=r.data;return pe.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function qe(e){return!(!e||!e.__CANCEL__)}function Ze(e,t,n){me.call(this,null==e?"canceled":e,me.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(Ze,me,{__CANCEL__:!0});const We=Ze,ze=Ce.isStandardBrowserEnv?{write:function(e,t,n,r,o,i){const s=[];s.push(e+"="+encodeURIComponent(t)),pe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),pe.isString(r)&&s.push("path="+r),pe.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Je(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const He=Ce.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=pe.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ke(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(c){const a=Date.now(),l=r[s];o||(o=a),n[i]=c,r[i]=a;let p=s,u=0;for(;p!==i;)u+=n[p++],p%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),a-o<t)return;const d=l&&a-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,c=i-n,a=r(c);n=i;const l={loaded:i,total:s,progress:s?i/s:void 0,bytes:c,rate:a||void 0,estimated:a&&s&&i<=s?(s-i)/a:void 0,event:o};l[t?"download":"upload"]=!0,e(l)}}const $e={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=Be.from(e.headers).normalize(),i=e.responseType;let s;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}pe.isFormData(r)&&(Ce.isStandardBrowserEnv||Ce.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let a=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const l=Je(e.baseURL,e.url);function p(){if(!a)return;const r=Be.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:i&&"text"!==i&&"json"!==i?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:r,config:e,request:a}),a=null}if(a.open(e.method.toUpperCase(),je(l,e.params,e.paramsSerializer),!0),a.timeout=e.timeout,"onloadend"in a?a.onloadend=p:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(p)},a.onabort=function(){a&&(n(new me("Request aborted",me.ECONNABORTED,e,a)),a=null)},a.onerror=function(){n(new me("Network Error",me.ERR_NETWORK,e,a)),a=null},a.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ke;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new me(t,r.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,e,a)),a=null},Ce.isStandardBrowserEnv){const t=(e.withCredentials||He(l))&&e.xsrfCookieName&&ze.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in a&&pe.forEach(o.toJSON(),(function(e,t){a.setRequestHeader(t,e)})),pe.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),i&&"json"!==i&&(a.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",Ke(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",Ke(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{a&&(n(!t||t.type?new We(null,e,a):t),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const u=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);u&&-1===Ce.protocols.indexOf(u)?n(new me("Unsupported protocol "+u+":",me.ERR_BAD_REQUEST,e)):a.send(r||null)}))}};pe.forEach($e,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new We(null,e)}function Ge(e){return Ve(e),e.headers=Be.from(e.headers),e.data=Me.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=pe.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=pe.isString(n)?$e[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new me(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(pe.hasOwnProp($e,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!pe.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||Re.adapter)(e).then((function(t){return Ve(e),t.data=Me.call(e,e.transformResponse,t),t.headers=Be.from(t.headers),t}),(function(t){return qe(t)||(Ve(e),t&&t.response&&(t.response.data=Me.call(e,e.transformResponse,t.response),t.response.headers=Be.from(t.response.headers))),Promise.reject(t)}))}const Xe=e=>e instanceof Be?e.toJSON():e;function Ye(e,t){t=t||{};const n={};function r(e,t,n){return pe.isPlainObject(e)&&pe.isPlainObject(t)?pe.merge.call({caseless:n},e,t):pe.isPlainObject(t)?pe.merge({},t):pe.isArray(t)?t.slice():t}function o(e,t,n){return pe.isUndefined(t)?pe.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!pe.isUndefined(t))return r(void 0,t)}function s(e,t){return pe.isUndefined(t)?pe.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function c(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(e,t)=>o(Xe(e),Xe(t),!0)};return pe.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=a[r]||o,s=i(e[r],t[r],r);pe.isUndefined(s)&&i!==c||(n[r]=s)})),n}const Qe={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Qe[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const et={};Qe.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new me(r(o," has been removed"+(t?" in "+t:"")),me.ERR_DEPRECATED);return t&&!et[o]&&(et[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};const tt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new me("option "+i+" must be "+n,me.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new me("Unknown option "+i,me.ERR_BAD_OPTION)}},validators:Qe},nt=tt.validators;class rt{constructor(e){this.defaults=e,this.interceptors={request:new Pe,response:new Pe}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ye(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let i;void 0!==n&&tt.assertOptions(n,{silentJSONParsing:nt.transitional(nt.boolean),forcedJSONParsing:nt.transitional(nt.boolean),clarifyTimeoutError:nt.transitional(nt.boolean)},!1),null!=r&&(pe.isFunction(r)?t.paramsSerializer={serialize:r}:tt.assertOptions(r,{encode:nt.function,serialize:nt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=o&&pe.merge(o.common,o[t.method]),i&&pe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Be.concat(i,o);const s=[];let c=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(c=c&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const a=[];let l;this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)}));let p,u=0;if(!c){const e=[Ge.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,a),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(u=0;u<p;){const e=s[u++],t=s[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ge.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=a.length;u<p;)l=l.then(a[u++],a[u++]);return l}getUri(e){return je(Je((e=Ye(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}pe.forEach(["delete","get","head","options"],(function(e){rt.prototype[e]=function(t,n){return this.request(Ye(n||{},{method:e,url:t,data:(n||{}).data}))}})),pe.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ye(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}rt.prototype[e]=t(),rt.prototype[e+"Form"]=t(!0)}));const ot=rt;class it{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 We(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)}static source(){let e;return{token:new it((function(t){e=t})),cancel:e}}}const st=it,ct={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(ct).forEach((([e,t])=>{ct[t]=e}));const at=ct,lt=function e(t){const n=new ot(t),r=D(ot.prototype.request,n);return pe.extend(r,ot.prototype,n,{allOwnKeys:!0}),pe.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ye(t,n))},r}(Re);lt.Axios=ot,lt.CanceledError=We,lt.CancelToken=st,lt.isCancel=qe,lt.VERSION="1.4.0",lt.toFormData=Oe,lt.AxiosError=me,lt.Cancel=lt.CanceledError,lt.all=function(e){return Promise.all(e)},lt.spread=function(e){return function(t){return e.apply(null,t)}},lt.isAxiosError=function(e){return pe.isObject(e)&&!0===e.isAxiosError},lt.mergeConfig=Ye,lt.AxiosHeaders=Be,lt.formToJSON=e=>xe(pe.isHTMLForm(e)?new FormData(e):e),lt.HttpStatusCode=at,lt.default=lt;const pt=lt;var ut,dt,ft=function(e){return console.debug("Response",e),e},mt=null===(ut=window.CODE_SNIPPETS)||void 0===ut?void 0:ut.restAPI.snippets,ht={headers:{"X-WP-Nonce":null===(dt=window.CODE_SNIPPETS)||void 0===dt?void 0:dt.restAPI.nonce}},bt=function(e,t){var n=e.id,r=e.network;return x([mt,n,t].filter(Boolean).join("/"),{network:!!r||void 0})};function yt(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 gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ot=function(e){var t,n,o,i,s,c,a=e.setSnippet,l=e.setIsWorking,p=e.setCurrentNotice,u=(t=ht,n=(0,r.useMemo)((function(){return pt.create(t)}),[t]),o=(0,r.useMemo)((function(){return{get:function(e){return console.debug("GET ".concat(e)),n.get(e).then(ft)},post:function(e,t){return console.debug("POST ".concat(e),t),n.post(e,t).then(ft)},del:function(e){return console.debug("DELETE ".concat(e)),n.delete(e).then(ft)},axiosInstance:n}}),[n]),i=o.get,s=o.post,c=o.del,(0,r.useMemo)((function(){return{fetchAll:function(e){return i(x(mt,{network:e}))},fetch:function(e,t){return i(x("".concat(mt,"/").concat(e),{network:t}))},create:function(e){return s("".concat(mt),b(e))},update:function(e){return s(bt(e),b(e))},delete:function(e){return c(bt(e))},activate:function(e){return s(bt(e,"activate"))},deactivate:function(e){return s(bt(e,"deactivate"))},export:function(e){return i(bt(e,"export"))},exportCode:function(e){return i(bt(e,"export-code"))}}}),[i,s,c])),d=(0,r.useCallback)((function(e,t){console.error("Request failed",e),l(!1),p(["error",t?"".concat(t," ").concat(e.message):e.message])}),[l,p]),f=(0,r.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,_.__)("Something went wrong.","code-snippets");l(!0),p(void 0),e().then((function(e){var r=e.data;l(!1),r.id?(a(gt({},r)),p(["updated",t(r)])):p(["error","".concat(n," ").concat((0,_.__)("The server did not send a valid response.","code-snippets"))])})).catch((function(e){return d(e,n)}))}),[d,l,a,p]),m=(0,r.useCallback)((function(e,t){l(!0),t().then((function(t){var n=t.data;l(!1),console.info("file response",t),"string"==typeof n?O(n,e):O(JSON.stringify(n,void 0,2),e,"json")})).catch((function(e){return d(e,(0,_.__)("Could not download export file.","code-snippets"))}))}),[d,l]),h=(0,r.useCallback)((function(e,t,n){e.id?f((function(){return u.update(e)}),n,(0,_.__)("Could not update snippet.","code-snippets")):f((function(){return u.create(e)}),t,(0,_.__)("Could not create snippet.","code-snippets"))}),[u,f]);return(0,r.useMemo)((function(){return{submit:function(e){h(e,(function(){return(0,_.__)("Snippet created.","code-snippets")}),(function(){return(0,_.__)("Snippet updated.","code-snippets")}))},submitAndActivate:function(e,t){h(gt(gt({},e),{},{active:t}),(function(e){return e.active?(0,_.__)("Snippet created and activated.","code-snippets"):(0,_.__)("Snippet created.","code-snippets")}),(function(e){return e.active?"single-use"===e.scope?(0,_.__)("Snippet updated and executed.","code-snippets"):(0,_.__)("Snippet updated and activated.","code-snippets"):(0,_.__)("Snippet updated.","code-snippets")}))},delete:function(e){u.delete(e).then((function(){return p(["updated",(0,_.__)("Snippet deleted.","code-snippets")])})).catch((function(e){return d(e,(0,_.__)("Could not delete snippet.","code-snippets"))}))},export:function(e){return m(e,(function(){return u.export(e)}))},exportCode:function(e){return m(e,(function(){return u.exportCode(e)}))}}}),[u,d,m,p,h])},Et=["snippet","isWorking"];function vt(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}var _t,wt=function(e){var t,n=e.actions,o=e.snippet,i=e.isWorking,s=(0,r.useState)(!1),c=(0,a.Z)(s,2),l=c[0],p=c[1],u=(0,r.useState)(),d=(0,a.Z)(u,2),f=d[0],m=d[1],h=!o.shared_network||!g(),b=h&&(null===(t=window.CODE_SNIPPETS_EDIT)||void 0===t?void 0:t.activateByDefault)&&!o.active&&"single-use"!==o.scope,y=""===o.code.trim(),O=""===o.name.trim(),E=function(e,t){y||O?(p(!0),m((function(){return t}))):t()},v=function(){p(!1),m(void 0)};return(0,r.createElement)(r.Fragment,null,b?"":(0,r.createElement)(P,{primary:!0,name:"save_snippet",text:(0,_.__)("Save Changes","code-snippets"),onClick:function(e){return E(0,(function(){return n.submit(o)}))},disabled:i}),"single-use"===o.scope?(0,r.createElement)(P,{name:"save_snippet_execute",text:(0,_.__)("Save Changes and Execute Once","code-snippets"),onClick:function(e){return E(0,(function(){return n.submitAndActivate(o,!0)}))},disabled:i}):h?o.active?(0,r.createElement)(P,{name:"save_snippet_deactivate",text:(0,_.__)("Save Changes and Deactivate","code-snippets"),onClick:function(e){return E(0,(function(){return n.submitAndActivate(o,!1)}))},disabled:i}):(0,r.createElement)(P,{primary:b,name:"save_snippet_activate",text:(0,_.__)("Save Changes and Activate","code-snippets"),onClick:function(e){return E(0,(function(){return n.submitAndActivate(o,!0)}))},disabled:i}):"",b?(0,r.createElement)(P,{name:"save_snippet",text:(0,_.__)("Save Changes","code-snippets"),onClick:function(e){return E(0,(function(){return n.submit(o)}))},disabled:i}):"",(0,r.createElement)(k,{open:l,title:(0,_.__)("Snippet incomplete","code-snippets"),confirmLabel:(0,_.__)("Continue","code-snippets"),onCancel:v,onConfirm:function(){null==f||f(),v()}},(0,r.createElement)("p",null,y&&O?(0,_.__)("This snippet has no code or title. Continue?","code-snippets"):y?(0,_.__)("This snippet has no snippet code. Continue?","code-snippets"):O?(0,_.__)("This snippet has no title. Continue?","code-snippets"):"")))},St=function(e){var t,n=e.snippet,o=e.isWorking,i=E(e,Et),s=Ot(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i)),l=(0,r.useState)(!1),p=(0,a.Z)(l,2),u=p[0],d=p[1];return(0,r.createElement)("p",{className:"submit"},(0,r.createElement)(wt,{actions:s,snippet:n,isWorking:o}),n.id?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(P,{name:"export_snippet",text:(0,_.__)("Export","code-snippets"),onClick:function(){return s.export(n)},disabled:o}),null!==(t=window.CODE_SNIPPETS_EDIT)&&void 0!==t&&t.enableDownloads?(0,r.createElement)(P,{name:"export_snippet_code",text:(0,_.__)("Export Code","code-snippets"),onClick:function(){return s.exportCode(n)},disabled:o}):"",(0,r.createElement)(P,{name:"delete_snippet",text:(0,_.__)("Delete","code-snippets"),onClick:function(){return d(!0)},disabled:o})):"",o?(0,r.createElement)(v.Spinner,null):"",(0,r.createElement)(k,{open:u,title:(0,_.__)("Permanently delete?","code-snippets"),confirmLabel:(0,_.__)("Delete","code-snippet"),confirmButtonClassName:"is-destructive",onCancel:function(){return d(!1)},onConfirm:function(){d(!1),s.delete(n)}},(0,r.createElement)("p",null,(0,_.__)("You are about to permanently delete this snippet.","code-snippets")," ",(0,_.__)("Are you sure?","code-snippets")),(0,r.createElement)("p",null,(0,r.createElement)("strong",null,(0,_.__)("This action cannot be undone.","code-snippets")))))},jt=(c(_t={},"2",39),c(_t,"6",69),c(_t,"200",119),_t),Pt=function(){var e=(0,r.useState)("6"),t=(0,a.Z)(e,2),n=t[0],o=t[1];return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,(0,r.createElement)("strong",null,(0,_.__)("How many websites do you plan to use Code Snippets on?","code-snippets"))),(0,r.createElement)("p",null,(0,_.__)("We offer three distinct plans, each tailored to meet your needs.","code-snippets")),(0,r.createElement)("p",{className:"upgrade-plans"},Object.keys(jt).map((function(e){return(0,r.createElement)("label",{key:"".concat(e,"-sites")},(0,r.createElement)("input",{type:"radio",checked:e===n.toString(),onClick:function(){return o(e)}})," ",(0,_.sprintf)((0,_._n)("%d site","%d sites",Number(e),"code-snippets"),e))}))),(0,r.createElement)("p",{className:"action-buttons"},(0,r.createElement)("span",{className:"current-plan-cost"},(0,_.sprintf)((0,_.__)("$%s per year","code-snippets"),jt[n])),(0,r.createElement)(v.ExternalLink,{className:"button button-primary button-large",href:"https://checkout.freemius.com/mode/dialog/plugin/10565/plan/17873/licenses/".concat(n,"/")},(0,_.__)("Upgrade Now","code-snippets"))))},kt=function(e){var t=e.nextTab;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,(0,_.__)("You are using the free version of Code Snippets.","code-snippets")," ",(0,_.__)("Upgrade to Code Snippets Pro to unleash its full potential:","code-snippets"),(0,r.createElement)("ul",null,(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("CSS stylesheet snippets: ","code-snippets")),(0,_.__)("Craft impeccable websites with advanced CSS snippets.","code-snippets")),(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("JavaScript snippets: ","code-snippets")),(0,_.__)("Enhance user interaction with the power of JavaScript.","code-snippets")),(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("Specialized Elementor widgets: ","code-snippets")),(0,_.__)("Easily customize your site with Elementor widgets.","code-snippets")),(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("Integration with block editor: ","code-snippets")),(0,_.__)("Seamlessly incorporate your snippets within the block editor.","code-snippets")),(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("WP-CLI snippet commands: ","code-snippets")),(0,_.__)("Access and control your snippets directly from the command line.","code-snippets")),(0,r.createElement)("li",null,(0,r.createElement)("strong",null,(0,_.__)("Premium support: ","code-snippets")),(0,_.__)("Direct access to our team. We're happy to help!","code-snippets"))),(0,_.__)("…and so much more!","code-snippets")),(0,r.createElement)("p",{className:"action-buttons"},(0,r.createElement)(v.ExternalLink,{className:"button button-secondary",href:"https://codesnippets.pro/pricing/"},(0,_.__)("Learn More","code-snippets")),(0,r.createElement)("button",{className:"button button-primary button-large",onClick:t},(0,_.__)("See Plans","code-snippets"),(0,r.createElement)("span",{className:"dashicons dashicons-arrow-right"}))))},Ct=function(e){var t,n=e.isOpen,o=e.setIsOpen,i=(0,r.useState)(0),s=(0,a.Z)(i,2),c=s[0],l=s[1];return n?(0,r.createElement)(v.Modal,{title:"",className:"code-snippets-upgrade-dialog",onRequestClose:function(){o(!1),l(0)}},(0,r.createElement)("h1",{className:"logo"},(0,r.createElement)("img",{src:"".concat(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.pluginUrl,"/assets/icon.svg"),alt:""}),(0,_.__)("Code Snippets Pro","code-snippets")),0===c?(0,r.createElement)(kt,{nextTab:function(){return l(1)}}):(0,r.createElement)(Pt,null)):null};function xt(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 Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nt="snippet_description",Rt=[["bold","italic","underline","strikethrough","blockquote","bullist","numlist","alignleft","aligncenter","alignright","link","wp_adv","code_snippets"],["formatselect","forecolor","pastetext","removeformat","charmap","outdent","indent","undo","redo","spellchecker"]],At=function(e){var t,n,o,i=e.snippet,s=e.setSnippet,c=e.isReadOnly,a=(0,r.useCallback)((function(e){return s((function(t){return Dt(Dt({},t),{},{desc:e})}))}),[s]);return(0,r.useEffect)((function(){var e;e=function(){return function(e){var t,n;null===(t=window.wp.editor)||void 0===t||t.initialize(Nt,{mediaButtons:null===(n=window.CODE_SNIPPETS_EDIT)||void 0===n?void 0:n.descEditorOptions.mediaButtons,quicktags:!0,tinymce:{toolbar:Rt.map((function(e){return e.join(" ")})),setup:function(t){t.on("change",(function(){return e(t.getContent())}))}}})}(a)},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}),[a]),null!==(t=window.CODE_SNIPPETS_EDIT)&&void 0!==t&&t.enableDescription?(0,r.createElement)("div",{className:"snippet-description-container"},(0,r.createElement)("h2",null,(0,r.createElement)("label",{htmlFor:Nt},(0,_.__)("Description","code-snippets"))),(0,r.createElement)("textarea",{id:Nt,className:"wp-editor-area",onChange:function(e){return a(e.target.value)},autoComplete:"off",disabled:c,rows:null!==(n=null===(o=window.CODE_SNIPPETS_EDIT)||void 0===o?void 0:o.descEditorOptions.rows)&&void 0!==n?n:5,cols:40},i.desc)):null};function Tt(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 Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var It=function(e){var t=e.snippet,n=e.setSnippet,o=e.isReadOnly;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h2",{className:"screen-reader-text"},(0,_.__)("Sharing Settings","code-snippets")),(0,r.createElement)("p",{className:"snippet-sharing-setting"},(0,r.createElement)("label",{htmlFor:"snippet_sharing"},(0,r.createElement)("input",{type:"checkbox",name:"snippet_sharing",checked:!!t.shared_network,disabled:o,onChange:function(e){return n((function(t){return Ft(Ft({},t),{},{shared_network:e.target.checked})}))}}),(0,_.__)("Allow this snippet to be activated on individual sites on the network","code-snippets"))))};function Lt(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 Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bt=function(e){var t=e.snippet,n=e.setSnippet,o=e.isReadOnly;return(0,r.createElement)("div",{id:"titlediv"},(0,r.createElement)("div",{id:"titlewrap"},(0,r.createElement)("label",{htmlFor:"title",className:"screen-reader-text"},(0,_.__)("Name","code-snippets")),(0,r.createElement)("input",{id:"title",type:"text",name:"snippet_name",autoComplete:"off",value:t.name,disabled:o,placeholder:(0,_.__)("Enter title here","code-snippets"),onChange:function(e){return n((function(t){return Ut(Ut({},t),{},{name:e.target.value})}))}})))};function Mt(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 qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zt=function(e){var t=e.snippet,n=e.setSnippet,o=e.isReadOnly;return"html"===f(t)?null:(0,r.createElement)("p",{className:"snippet-priority",title:(0,_.__)("Snippets with a lower priority number will run before those with a higher number.","code-snippets")},(0,r.createElement)("label",{htmlFor:"snippet_priority"},"".concat((0,_.__)("Priority","code-snippets")," ")),(0,r.createElement)("input",{type:"number",id:"snippet_priority",name:"snippet_priority",value:t.priority,disabled:o,onChange:function(e){return n((function(t){return qt(qt({},t),{},{priority:parseInt(e.target.value,10)})}))}}))},Wt=["php","html","css","js"],zt={php:["global","admin","front-end","single-use"],html:["content","head-content","footer-content"],css:["admin-css","site-css"],js:["site-head-js","site-footer-js"]},Jt=n(907),Ht=n(181);function Kt(e){return function(e){if(Array.isArray(e))return(0,Jt.Z)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,Ht.Z)(e)||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.")}()}var $t=function(e,t){return"[".concat([e].concat(Kt(Object.entries(t).filter((function(e){var t=(0,a.Z)(e,2)[1];return Boolean(t)})).map((function(e){var t=(0,a.Z)(e,2),n=t[0],r=t[1];return"boolean"==typeof r?n:"".concat(n,"=").concat(JSON.stringify(r))})))).filter(Boolean).join(" "),"]")},Vt=["text","copyIcon","successIcon"];function Gt(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}var Xt=function(e){var t=e.text,n=e.copyIcon,o=void 0===n?"clipboard":n,i=e.successIcon,s=void 0===i?"yes":i,l=E(e,Vt),p=(0,r.useState)(!1),u=(0,a.Z)(p,2),d=u[0],f=u[1];return window.navigator.clipboard?(0,r.createElement)("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({href:"#",className:"code-snippets-copy-text dashicons dashicons-".concat(d?s:o),onClick:function(e){var n;e.preventDefault(),null===(n=window.navigator.clipboard)||void 0===n||n.writeText(t).then((function(){f(!0),setTimeout((function(){return f(!1)}),3e3)})).catch((function(e){return console.error(e)}))}},l)):null};function Yt(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 Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var en="code_snippet",tn={global:"admin-site",admin:"admin-tools","front-end":"admin-appearance","single-use":"clock",content:"shortcode","head-content":"editor-code","footer-content":"editor-code","admin-css":"dashboard","site-css":"admin-customizer","site-head-js":"media-code","site-footer-js":"media-code"},nn={global:(0,_.__)("Run snippet everywhere","code-snippets"),admin:(0,_.__)("Only run in administration area","code-snippets"),"front-end":(0,_.__)("Only run on site front-end","code-snippets"),"single-use":(0,_.__)("Only run once","code-snippets"),content:(0,_.__)("Only display when inserted into a post or page.","code-snippets"),"head-content":(0,_.__)("Display in site <head> section.","code-snippets"),"footer-content":(0,_.__)("Display at the end of the <body> section, in the footer.","code-snippets"),"site-css":(0,_.__)("Site front-end styles","code-snippets"),"admin-css":(0,_.__)("Administration area styles","code-snippets"),"site-footer-js":(0,_.__)("Load JS at the end of the <body> section","code-snippets"),"site-head-js":(0,_.__)("Load JS in the <head> section","code-snippets")},rn=function(e){var t=e.atts;return(0,r.createElement)("p",null,(0,r.createElement)("code",{className:"shortcode-tag"},$t(en,t)),(0,r.createElement)(Xt,{title:(0,_.__)("Copy shortcode to clipboard","code-snippets"),text:$t(en,t)}))},on=function(e){var t=e.optionLabels,n=e.options,o=e.setOptions,i=e.isReadOnly;return(0,r.createElement)("p",{className:"html-shortcode-options"},(0,r.createElement)("strong",null,(0,_.__)("Shortcode Options: ","code-snippets")),t.map((function(e){var t=(0,a.Z)(e,2),s=t[0],l=t[1];return(0,r.createElement)("label",{key:s},(0,r.createElement)("input",{type:"checkbox",value:s,checked:n[s],disabled:i,onChange:function(e){return o((function(t){return Qt(Qt({},t),{},c({},s,e.target.checked))}))}})," ".concat(l))})))},sn=function(e){var t=e.snippet,n=e.isReadOnly,o=(0,r.useState)((function(){return{php:t.code.includes("<?"),format:!0,shortcodes:!1}})),i=(0,a.Z)(o,2),s=i[0],c=i[1];return"content"===t.scope?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"description"},(0,_.__)("There are multiple options for inserting this snippet into a post, page or other content.","code-snippets")," ",t.id?(0,_.__)("You can copy the below shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).","code-snippets"):(0,_.__)("After saving, you can copy a shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).","code-snippets")," ",(0,r.createElement)(v.ExternalLink,{href:(0,_.__)("https://help.codesnippets.pro/article/50-inserting-snippets","code-snippets")},(0,_.__)("Learn more","code-snippets"))),t.id?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(rn,{atts:Qt({id:t.id,network:t.network||g()},s)}),(0,r.createElement)(on,{options:s,setOptions:c,isReadOnly:n,optionLabels:[["php",(0,_.__)("Evaluate PHP code","code-snippets")],["format",(0,_.__)("Add paragraphs and formatting","code-snippets")],["shortcodes",(0,_.__)("Evaluate additional shortcode tags","code-snippets")]]})):null):null},cn=function(e){var t=e.snippet,n=e.setSnippet,o=e.isReadOnly;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h2",{className:"screen-reader-text"},(0,_.__)("Scope","code-snippets")),Wt.filter((function(e){return!t.id||e===f(t)})).map((function(e){return(0,r.createElement)("p",{key:e,className:"snippet-scope ".concat(e,"-scopes-list")},zt[e].map((function(e){return(0,r.createElement)("label",{key:e},(0,r.createElement)("input",{type:"radio",name:"snippet_scope",value:e,checked:e===t.scope,onChange:function(t){return t.target.checked&&n((function(t){return Qt(Qt({},t),{},{scope:e})}))},disabled:o})," ",(0,r.createElement)("span",{className:"dashicons dashicons-".concat(tn[e])})," ".concat(nn[e]))})),"html"===e?(0,r.createElement)(sn,{snippet:t,setSnippet:n,isReadOnly:o}):null)})))},an=n(1002),ln=n(136),pn=n(9611),un=function(e){var t=e.id,n=e.suggestions,o=e.onSelect;return(0,r.createElement)("div",{className:"tagger-completion"},(0,r.createElement)("datalist",{id:t},n.map((function(e){return(0,r.createElement)("option",{key:e,value:e,onClick:function(){return o(e)}})}))))},dn=function(e){var t=e.tags,n=e.onRemove;return(0,r.createElement)(r.Fragment,null,t.map((function(e){return(0,r.createElement)("li",{key:e},(0,r.createElement)("span",null,(0,r.createElement)("span",{className:"label"},e),(0,r.createElement)("a",{href:".#",className:"close",onClick:function(t){n(e),t.preventDefault()}},"×")))})))},fn=["id","tags","onChange","tagLimit","completions","addOnBlur","allowSpaces","allowDuplicates","completionMinLength"];function mn(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 hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bn(){bn=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,o){var i=new RegExp(e,r);return t.set(i,o||t.get(e)),(0,pn.Z)(i,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){var o=r[n];if("number"==typeof o)t[n]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;t[n]=e[o[i]]}return t}),Object.create(null))}return(0,ln.Z)(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var o=n.indices;o&&(o.groups=r(o,this))}return n},n.prototype[Symbol.replace]=function(n,o){if("string"==typeof o){var i=t.get(this);return e[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var s=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=(0,an.Z)(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,s)),o.apply(this,e)}))}return e[Symbol.replace].call(this,n,o)},bn.apply(this,arguments)}var yn,gn=bn(/([-\\^$[\]()+{}?*.|])/g,{specialChar:1}),On=function(e){var t=e.id,n=e.tags,o=e.onChange,i=e.tagLimit,s=e.completions,c=e.addOnBlur,l=void 0!==c&&c,p=e.allowSpaces,u=void 0===p||p,d=e.allowDuplicates,f=void 0!==d&&d,m=e.completionMinLength,h=void 0===m?2:m,b=E(e,fn),y=(0,r.useRef)(null),g=(0,r.useState)(""),O=(0,a.Z)(g,2),v=O[0],_=O[1],w=(0,r.useState)(!1),S=(0,a.Z)(w,2),j=S[0],P=S[1],k=(0,r.useState)([]),C=(0,a.Z)(k,2),x=C[0],D=C[1],N=(0,r.useState)(),R=(0,a.Z)(N,2),A=R[0],T=R[1],F=function(){return Boolean(i&&0<i&&n.length>=i)},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.trim(),t=!["",'""',"''","``",void 0,null].includes(e)&&!F()&&(f||!n.includes(e));return t&&o([].concat(Kt(n),[e])),_(""),t},L=function(e){return o(e?n.filter((function(t){return t!==e})):n.slice(0,-1))},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.length>=h;e&&function(e,t,n){if(e)if("function"==typeof e){var r=e(t);r&&"then"in r&&"function"==typeof r.then?r.then((function(e){return n(e)})):r instanceof Array&&n(r)}else n(e)}(s,v,(function(e){T(x),e.length&&D(f?e:e.filter((function(e){return!n.includes(e)})))})),P(e)};return(0,r.createElement)("div",{className:"tagger wrap"},(0,r.createElement)("ul",{onClick:function(){var e;return null===(e=y.current)||void 0===e?void 0:e.focus()}},(0,r.createElement)(dn,{tags:n,onRemove:L}),(0,r.createElement)("li",{className:"tagger-new"},(0,r.createElement)("input",hn(hn({},b),{},{id:t,type:"text",ref:y,value:v,list:"tagger-completion-".concat(j?"":"-disabled").concat(t),onBlur:function(){return l?I():void 0},onChange:function(e){return _(e.target.value)},onKeyDown:function(e){var t=e.key,n=e.ctrlKey,r=e.metaKey;if("Enter"===t||","===t||" "===t&&!u)I();else if("Backspace"!==t||v){if(" "===t&&(n||r))U(!0);else if(!F()||"Tab"===t)return}else L();e.preventDefault(),e.stopPropagation()},onInput:function(){j&&A&&function(e,t){if(null==e||!e.includes(t))return!1;var n=new RegExp("^".concat(t.replace(gn,"\\$1")));return 1===e.filter((function(e){return n.test(e)})).length}(A,v.trim())?I()&&P(!1):U()}})),(0,r.createElement)(un,{id:"tagger-completion-".concat(t),suggestions:x.filter((function(e){return!n.includes(e)})),onSelect:function(e){I(e),D([]),P(!1)}}))))};function En(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 vn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):En(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _n=null===(yn=window.CODE_SNIPPETS_EDIT)||void 0===yn?void 0:yn.tagOptions,wn=function(e){var t=e.snippet,n=e.setSnippet,o=e.isReadOnly;return null!=_n&&_n.enabled?(0,r.createElement)("div",{className:"snippet-tags-container"},(0,r.createElement)("h2",null,(0,r.createElement)("label",{htmlFor:"snippet_tags"},(0,_.__)("Tags","code-snippets"))),(0,r.createElement)(On,{id:"snippet_tags",onChange:function(e){return n((function(t){return vn(vn({},t),{},{tags:e})}))},tags:t.tags,disabled:o,completions:_n.availableTags,allowSpaces:_n.allowSpaces,placeholder:(0,_.__)("Enter a list of tags; separated by commas","code-snippets")})):null};function Sn(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 jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pn=function(e){var t=e.classNames,n=e.onRemove,o=e.children;return(0,r.createElement)("div",{id:"message",className:p()("notice fade is-dismissible",t)},(0,r.createElement)(r.Fragment,null,o),(0,r.createElement)("button",{type:"button",className:"notice-dismiss",onClick:function(e){e.preventDefault(),n(e)}},(0,r.createElement)("span",{className:"screen-reader-text"},(0,_.__)("Dismiss notice.","code-snippets"))))},kn=function(e){var t=e.notice,n=e.setNotice,o=e.snippet,i=e.setSnippet;return(0,r.createElement)(r.Fragment,null,t?(0,r.createElement)(Pn,{classNames:t[0],onRemove:function(){return n(void 0)}},(0,r.createElement)("p",null,t[1])):null,o.code_error?(0,r.createElement)(Pn,{classNames:"error",onRemove:function(){return i((function(e){return jn(jn({},e),{},{code_error:null})}))}},(0,r.createElement)("p",null,(0,r.createElement)("strong",null,(0,_.sprintf)((0,_.__)("Snippet automatically deactivated due to an error on line %d:","code-snippets"),o.code_error[1])),(0,r.createElement)("blockquote",null,o.code_error[0]))):null)},Cn=window.CODE_SNIPPETS_EDIT,xn=function(e){var t=e.snippet,n=e.setSnippet,o=e.codeEditorInstance;return(0,r.createElement)("h1",null,t.id?(0,_.__)("Edit Snippet","code-snippets"):(0,_.__)("Add New Snippet","code-snippets"),t.id?(0,r.createElement)(r.Fragment,null," ",(0,r.createElement)("a",{href:null==Cn?void 0:Cn.addNewUrl,className:"page-title-action",onClick:function(){var e;n((function(){return d()})),null==o||o.codemirror.setValue(""),null===(e=window.tinymce)||void 0===e||e.activeEditor.setContent("")}},(0,_._x)("Add New","snippet","code-snippets"))):null,(null==Cn?void 0:Cn.pageTitleActions)&&Object.entries(Cn.pageTitleActions).map((function(e){var t=(0,a.Z)(e,2),n=t[0],o=t[1];return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("a",{key:n,href:o,className:"page-title-action"},n)," ")})))},Dn=(n(2692),(0,_._x)("-","keyboard shortcut separator","code-snippets")),Nn={Cmd:(0,_._x)("Cmd","keyboard key","code-snippets"),Ctrl:(0,_._x)("Ctrl","keyboard key","code-snippets"),Shift:(0,_._x)("Shift","keyboard key","code-snippets"),Option:(0,_._x)("Option","keyboard key","code-snippets"),Alt:(0,_._x)("Alt","keyboard key","code-snippets"),Tab:(0,_._x)("Tab","keyboard key","code-snippets"),Up:(0,_._x)("Up","keyboard key","code-snippets"),Down:(0,_._x)("Down","keyboard key","code-snippets"),A:(0,_._x)("A","keyboard key","code-snippets"),D:(0,_._x)("D","keyboard key","code-snippets"),F:(0,_._x)("F","keyboard key","code-snippets"),G:(0,_._x)("G","keyboard key","code-snippets"),R:(0,_._x)("R","keyboard key","code-snippets"),S:(0,_._x)("S","keyboard key","code-snippets"),Y:(0,_._x)("Y","keyboard key","code-snippets"),Z:(0,_._x)("Z","keyboard key","code-snippets"),"/":(0,_._x)("/","keyboard key","code-snippets"),"[":(0,_._x)("]","keyboard key","code-snippets"),"]":(0,_._x)("]","keyboard key","code-snippets")},Rn=[{label:(0,_.__)("Save changes","code-snippets"),mod:"Cmd",key:"S"},{label:(0,_.__)("Select all","code-snippets"),mod:"Cmd",key:"A"},{label:(0,_.__)("Begin searching","code-snippets"),mod:"Cmd",key:"F"},{label:(0,_.__)("Find next","code-snippets"),mod:"Cmd",key:"G"},{label:(0,_.__)("Find previous","code-snippets"),mod:["Shift","Cmd"],key:"G"},{label:(0,_.__)("Replace","code-snippets"),mod:["Shift","Cmd"],key:"F"},{label:(0,_.__)("Replace all","code-snippets"),mod:["Shift","Cmd","Option"],key:"R"},{label:(0,_.__)("Persistent search","code-snippets"),mod:"Alt",key:"F"},{label:(0,_.__)("Toggle comment","code-snippets"),mod:"Cmd",key:"/"},{label:(0,_.__)("Swap line up","code-snippets"),mod:"Option",key:"Up"},{label:(0,_.__)("Swap line down","code-snippets"),mod:"Option",key:"Down"},{label:(0,_.__)("Auto-indent current line or selection","code-snippets"),mod:"Shift",key:"Tab"}],An=function(e){var t=e.editorTheme;return(0,r.createElement)("div",{className:"snippet-editor-help"},(0,r.createElement)("div",{className:"editor-help-tooltip cm-s-".concat(t)},(0,_._x)("?","help tooltip","code-snippets")),(0,r.createElement)("div",{className:p()("editor-help-text",{"platform-mac":window.navigator.platform.match("Mac")})},(0,r.createElement)("table",null,Rn.map((function(e){var t=e.label,n=e.mod,o=e.key;return(0,r.createElement)("tr",{key:t},(0,r.createElement)("td",null,t),(0,r.createElement)("td",null,(Array.isArray(n)?n:[n]).map((function(e){return"Ctrl"===e||"Cmd"===e?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("kbd",{className:"pc-key"},Nn.Ctrl),(0,r.createElement)("kbd",{className:"mac-key"},Nn.Cmd),Dn):"Option"===n?(0,r.createElement)("span",{className:"mac-key"},(0,r.createElement)("kbd",{className:"mac-key"},Nn.Option),Dn):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("kbd",null,Nn[e]),Dn)})),(0,r.createElement)("kbd",null,Nn[o])))})))))},Tn=["snippet","setSnippet","editorInstance","setEditorInstance"];function Fn(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 In(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ln=function(e){var t,n,o=e.snippet,i=e.setSnippet,s=e.editorInstance,a=e.setEditorInstance,l=E(e,Tn),p=Ot(In({setSnippet:i},l)),u=(0,r.useRef)(null);return(0,r.useEffect)((function(){a((function(e){return u.current&&!e&&(e=window.wp.codeEditor.initialize(u.current)).codemirror.on("changes",(function(e){return i((function(t){return In(In({},t),{},{code:e.getValue()})}))})),e}))}),[a,u,i]),(0,r.useEffect)((function(){if(s){var e,t=s.codemirror.getOption("extraKeys"),n=window.navigator.platform.match("Mac")?"Cmd":"Ctrl",r=function(){return p.submit(o)};s.codemirror.setOption("extraKeys",In(In({},"object"===(0,an.Z)(t)?t:void 0),{},(c(e={},"".concat(n,"-S"),r),c(e,"".concat(n,"-Enter"),r),e)))}}),[p,s,o]),(0,r.createElement)("div",{className:"snippet-editor"},(0,r.createElement)("textarea",{ref:u,id:"snippet_code",name:"snippet_code",rows:200,spellCheck:!1,onChange:function(e){return i((function(t){return In(In({},t),{},{code:e.target.value})}))}},o.code),(0,r.createElement)(An,{editorTheme:null!==(t=null===(n=window.CODE_SNIPPETS_EDIT)||void 0===n?void 0:n.editorTheme)&&void 0!==t?t:"default"}))},Un=["snippet","setSnippet","codeEditorInstance","setCodeEditorInstance","openUpgradeDialog"];function Bn(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 Mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qn=function(e){var t=e.tabType,n=e.label,o=e.currentType,i=e.setSnippet,s=e.openUpgradeDialog;return(0,r.createElement)("a",Mn({"data-snippet-type":t,className:p()({"nav-tab":!0,"nav-tab-active":t===o,"nav-tab-inactive":m(t)&&!h()})},m(t)&&!h()?{title:(0,_.__)("Learn more about Code Snippets Pro.","code-snippets"),href:"https://codesnippets.pro/pricing/",target:"_blank",onClick:function(e){e.preventDefault(),s()}}:{href:x(window.location.href,{type:t}),onClick:function(e){e.preventDefault();var n=zt[t][0];i((function(e){return Mn(Mn({},e),{},{scope:n})}))}}),"".concat(n," "),(0,r.createElement)("span",{className:"badge"},t))},Zn={php:(0,_.__)("Functions","code-snippets"),html:(0,_.__)("Content","code-snippets"),css:(0,_.__)("Styles","code-snippets"),js:(0,_.__)("Scripts","code-snippets")},Wn={css:"text/css",js:"javascript",php:"text/x-php",html:"application/x-httpd-php"},zn=function(e){var t=e.codeEditor,n=e.setSnippet,o=e.snippetType,i=e.openUpgradeDialog;return(0,r.useEffect)((function(){t.setOption("lint","php"===o||"css"===o),o in Wn&&(t.setOption("mode",Wn[o]),t.refresh())}),[t,o]),(0,r.createElement)("h2",{className:"nav-tab-wrapper",id:"snippet-type-tabs"},Wt.map((function(e){return(0,r.createElement)(qn,{key:e,tabType:e,label:Zn[e],currentType:o,setSnippet:n,openUpgradeDialog:i})})),h()?null:(0,r.createElement)("a",{className:"button button-large nav-tab-button nav-tab-inactive go-pro-button",href:"https://codesnippets.pro/pricing/",title:"Find more about Pro",onClick:function(e){e.preventDefault(),i()}},(0,_._x)("Upgrade to ","Upgrade to Pro","code-snippets"),(0,r.createElement)("span",{className:"badge"},(0,_._x)("Pro","Upgrade to Pro","code-snippets"))))},Jn=function(e){var t,n=e.snippet,o=e.setSnippet,i=e.codeEditorInstance,s=e.setCodeEditorInstance,c=e.openUpgradeDialog,a=E(e,Un),l=f(n);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"snippet-code-container"},(0,r.createElement)("h2",null,(0,r.createElement)("label",{htmlFor:"snippet_code"},(0,_.__)("Code","code-snippets")," ",n.id?(0,r.createElement)("span",{className:"snippet-type-badge","data-snippet-type":l},l):null)),n.id||null!==(t=window.CODE_SNIPPETS_EDIT)&&void 0!==t&&t.isPreview||!i?"":(0,r.createElement)(zn,{setSnippet:o,snippetType:l,codeEditor:i.codemirror,openUpgradeDialog:c}),(0,r.createElement)(Ln,Mn({snippet:n,setSnippet:o,editorInstance:i,setEditorInstance:s},a))))},Hn=["snippet","isWorking"],Kn=["codeEditorInstance"];function $n(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}var Vn=function(e){var t=e.codeEditorInstance;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("label",{htmlFor:"snippet-code-direction",className:"screen-reader-text"},(0,_.__)("Code Direction","code-snippets")),(0,r.createElement)("select",{id:"snippet-code-direction",onChange:function(e){return null==t?void 0:t.codemirror.setOption("direction","rtl"===e.target.value?"rtl":"ltr")}},(0,r.createElement)("option",{value:"ltr"},(0,_.__)("LTR","code-snippets")),(0,r.createElement)("option",{value:"rtl"},(0,_.__)("RTL","code-snippets"))))},Gn=function(e){var t=e.snippet,n=e.isWorking,o=E(e,Hn),i=Ot(o);return(0,r.createElement)(r.Fragment,null,n?(0,r.createElement)(v.Spinner,null):"",(0,r.createElement)(P,{small:!0,id:"save_snippet_extra",text:(0,_.__)("Save Changes","code-snippets"),title:(0,_.__)("Save Snippet","code-snippets"),onClick:function(){return i.submit(t)},disabled:n}),"single-use"===t.scope?(0,r.createElement)(P,{small:!0,id:"save_snippet_execute_extra",text:(0,_.__)("Execute Once","code-snippets"),title:(0,_.__)("Save Snippet and Execute Once","code-snippets"),onClick:function(){return i.submitAndActivate(t,!0)},disabled:n}):t.active?(0,r.createElement)(P,{small:!0,id:"save_snippet_deactivate_extra",text:(0,_.__)("Deactivate","code-snippets"),title:(0,_.__)("Save Snippet and Deactivate","code-snippets"),onClick:function(){return i.submitAndActivate(t,!1)},disabled:n}):(0,r.createElement)(P,{small:!0,id:"save_snippet_activate_extra",text:(0,_.__)("Activate","code-snippets"),title:(0,_.__)("Save Snippet and Activate","code-snippets"),onClick:function(){return i.submitAndActivate(t,!0)},disabled:n}))},Xn=function(e){var t,n=e.codeEditorInstance,o=E(e,Kn);return(0,r.createElement)("p",{className:"submit-inline"},null!==(t=window.CODE_SNIPPETS_EDIT)&&void 0!==t&&t.extraSaveButtons?(0,r.createElement)(Gn,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$n(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):"",(0,_.isRTL)()?(0,r.createElement)(Vn,{codeEditorInstance:n}):"")};function Yn(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 Qn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yn(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var er=window.CODE_SNIPPETS_EDIT,tr=function(e,t){var n=e.active,r=e.code_error,o=e.id,i=e.scope;return p()("snippet-form","".concat(i,"-snippet"),"".concat(f(i),"-snippet"),"".concat(o?"saved":"new","-snippet"),"".concat(n?"active":"inactive","-snippet"),{"erroneous-snippet":!!r,"read-only-snippet":t})},nr=document.getElementById("edit-snippet-form-container");i().render((0,r.createElement)((function(){var e=(0,r.useState)((function(){var e;return null!==(e=null==er?void 0:er.snippet)&&void 0!==e?e:d()})),t=(0,a.Z)(e,2),n=t[0],o=t[1],i=(0,r.useState)(!1),s=(0,a.Z)(i,2),c=s[0],l=s[1],p=(0,r.useState)(!1),m=(0,a.Z)(p,2),b=m[0],y=m[1],O=(0,r.useState)(),E=(0,a.Z)(O,2),v=E[0],_=E[1],w=(0,r.useState)(),S=(0,a.Z)(w,2),j=S[0],P=S[1],k=(0,r.useMemo)((function(){return!h()&&function(e){return u.includes(f(e))}(n.scope)}),[n.scope]),C={snippet:n,setSnippet:o,isReadOnly:k},x=Qn(Qn({},C),{},{isWorking:c,setIsWorking:l,setCurrentNotice:_});return(0,r.createElement)("div",{className:"wrap"},(0,r.createElement)(xn,Qn(Qn({},C),{},{codeEditorInstance:j})),(0,r.createElement)(kn,Qn({notice:v,setNotice:_},C)),(0,r.createElement)("div",{id:"snippet-form",className:tr(n,k)},(0,r.createElement)(Bt,Qn({},C)),(0,r.createElement)(Xn,Qn(Qn({},x),{},{codeEditorInstance:j})),(0,r.createElement)(Jn,Qn(Qn({},x),{},{openUpgradeDialog:function(){return y(!0)},codeEditorInstance:j,setCodeEditorInstance:P})),(0,r.createElement)("div",{className:"below-snippet-editor"},(0,r.createElement)(cn,Qn({},C)),(0,r.createElement)(Zt,Qn({},C))),g()?(0,r.createElement)(It,Qn({},C)):null,null!=er&&er.enableDescription?(0,r.createElement)(At,Qn({},C)):null,null!=er&&er.tagOptions.enabled?(0,r.createElement)(wn,Qn({},C)):null,(0,r.createElement)(St,Qn({},x))),(0,r.createElement)(Ct,{isOpen:b,setIsOpen:y}))}),null),nr)},4184:(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];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var c in n)r.call(n,c)&&n[c]&&e.push(c)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},136:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9611);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},9611:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})}},e=>{e(e.s=1908)}]);