PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | dist/settings.js +1 -1 3.10.1 → trunk View file →
@@ -1,2 +1,2 @@
1 1 /*! For license information please see settings.js.LICENSE.txt */
2 -(self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[6472],{5896(e,t,r){"use strict";r.d(t,{M:()=>S});var n=r(3453),o=r(4467),i=r(7723),s=r(6942),c=r.n(s),a=r(1609),l=r(6492),u=r(6842),p=r(6788),d=r(8586),f=r(3028),v=r(3780),h=r(401),y=r(7882),b=r(790);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(t){(0,o.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var g=new URLSearchParams(window.location.search),x=function(e){var t=e.name,r=e.url,n=e.label,o=(0,a.useMemo)(function(){return new URL(r).searchParams.get("page")},[r]),i=!g.get("subpage")&&g.get("page")===o;return(0,b.jsx)("li",{children:(0,b.jsx)("a",m(m({href:r,className:c()("".concat(t,"-link"),{"active-link":i})},!o&&{target:"_blank",rel:"noopener noreferrer"}),{},{children:n}))})},j=function(){var e,t;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x,{name:"docs",url:"https://codesnippets.pro/docs",label:(0,i.__)("Docs","code-snippets")}),(0,b.jsx)(x,{name:"cloud",url:"https://codesnippets.cloud/",label:(0,i.__)("Cloud Dashboard","code-snippets")}),(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.welcome)&&(0,b.jsx)(x,{name:"welcome",url:window.CODE_SNIPPETS.urls.welcome,label:(0,i.__)("What's New","code-snippets")}),(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.import)&&(0,b.jsx)(x,{name:"import-snippets",url:window.CODE_SNIPPETS.urls.import,label:(0,i._x)("Import","snippets","code-snippets")})]})},_=function(){return(0,b.jsx)("li",{className:"toolbar-more-item",children:(0,b.jsxs)("details",{className:"toolbar-more-menu",children:[(0,b.jsxs)("summary",{children:[(0,i.__)("More","code-snippets"),(0,b.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})]}),(0,b.jsx)("ul",{children:(0,b.jsx)(j,{})})]})})},O=function(){var e,t=(0,a.useState)(!1),r=(0,n.A)(t,2),o=r[0],s=r[1];return(0,b.jsxs)("div",{className:"code-snippets-toolbar-upper",children:[(0,b.jsxs)("div",{className:"logo",children:[(0,b.jsx)("img",{src:"".concat(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.plugin,"/assets/icon.svg"),alt:(0,i.__)("Code Snippets logo","code-snippets"),"aria-hidden":"true"}),(0,b.jsx)("div",{children:(0,i.__)("Code Snippets","code-snippets")})]}),(0,b.jsx)("nav",{"aria-label":(0,i.__)("Main links","code-snippets"),children:(0,b.jsxs)("ul",{children:[(0,b.jsx)(j,{}),(0,b.jsx)(_,{}),(0,l.W9)()&&(0,b.jsx)("li",{className:"toolbar-upgrade-item",children:(0,b.jsx)("a",{className:"button button-large button-secondary",href:"https://codesnippets.pro/pricing/",target:"_blank",rel:"noopener noreferrer",onClick:function(e){e.preventDefault(),s(!0)},children:(0,i.__)("Upgrade to Pro","code-snippets")})})]})}),(0,b.jsx)(y.o,{isOpen:o,setIsOpen:s})]})},C=function(e){var t,r=e.subpage,n=e.label,o=e.Icon,s=e.isPro;return(0,b.jsx)("li",{children:(0,b.jsxs)("a",{href:(0,u.c$)(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.manage,{subpage:r}),className:c()("".concat(r,"-link"),{"active-link":r===g.get("subpage")}),children:[(0,b.jsx)(o,{"aria-hidden":"true"}),(0,b.jsx)("span",{className:"toolbar-nav-label",children:n}),s&&!(0,l.QX)()&&(0,b.jsx)("span",{className:"pro-chip",children:(0,i.__)("Pro","code-snippets")})]})})},P=function(){var e;return(0,b.jsx)("div",{className:"code-snippets-toolbar-lower",children:(0,b.jsx)("nav",{"aria-label":(0,i.__)("Main features","code-snippets"),children:(0,b.jsxs)("ul",{children:[(0,b.jsx)(C,{subpage:"snippets",label:(0,i.__)("Snippets","code-snippets"),Icon:h.M}),(0,l.QX)()&&(0,b.jsx)(C,{subpage:"blueprints",label:(0,i.__)("Blueprints","code-snippets"),Icon:p.J}),(0,b.jsx)(C,{subpage:"cloud-community",label:(0,i.__)("Cloud Community","code-snippets"),Icon:d.z}),(0,b.jsx)(C,{subpage:"cloud-library",label:(0,i.__)("Cloud Library","code-snippets"),Icon:f.$,isPro:!0}),!(0,l.QX)()&&(0,b.jsx)(C,{subpage:"blueprints",label:(0,i.__)("Blueprints","code-snippets"),Icon:p.J,isPro:!0}),(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.settings)&&(0,b.jsx)("li",{className:"toolbar-end-item",children:(0,b.jsxs)("a",{href:window.CODE_SNIPPETS.urls.settings,className:"settings-link",children:[(0,b.jsx)(v.Z,{"aria-hidden":"true"}),(0,b.jsx)("span",{className:"toolbar-nav-label",children:(0,i.__)("Settings","code-snippets")})]})})]})})})},S=function(){return(0,b.jsxs)("div",{className:"code-snippets-toolbar",children:[(0,b.jsx)(O,{}),(0,b.jsx)(P,{})]})}},7882(e,t,r){"use strict";r.d(t,{o:()=>c});var n=r(6087),o=(r(1609),r(7723)),i=r(6427),s=r(790),c=function(e){var t,r=e.isOpen,n=e.setIsOpen;return r?(0,s.jsxs)(i.Modal,{"aria-labelledby":"code-snippets-upsell-dialog-title",className:"code-snippets-upsell code-snippets-upsell-dialog",onRequestClose:function(){n(!1)},children:[(0,s.jsx)("img",{src:"".concat(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.plugin,"/assets/icon.svg"),alt:(0,o.__)("Code Snippets logo","code-snippets")}),(0,s.jsx)(a,{})]}):null},a=function(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{id:"code-snippets-upsell-dialog-title",children:(0,n.createInterpolateElement)((0,o.__)("Unlock all cloud sync features and many more, with <span>Code Snippets Pro</span>","code-snippets"),{span:(0,s.jsx)("span",{})})}),(0,s.jsx)("p",{children:(0,n.createInterpolateElement)((0,o.__)("With Code Snippets Pro you can connect your WordPress sites to the code snippets cloud platform and be able to <strong>backup, synchronise, collaborate, and deploy</strong> your snippets from one central location.","code-snippets"),{strong:(0,s.jsx)("strong",{})})}),(0,s.jsx)("a",{href:"https://codesnippets.pro/pricing/",className:"button button-primary button-large",rel:"noreferrer",target:"_blank",children:(0,o.__)("Explore Code Snippets Pro","code-snippets")}),(0,s.jsx)("p",{children:(0,o.__)("Here's what else you get with Pro:","code-snippets")}),(0,s.jsxs)("ul",{children:[(0,s.jsx)("li",{children:(0,o.__)("Create, explain and verify snippets with AI","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Control when snippets run with Conditions","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("CSS stylesheet snippets","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Minified JavaScript snippets","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Editor blocks and Elementor widgets","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Cloud sync and backup","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Cloud share and deploy","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("Cloud bundles and teams","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("WP-CLI commands","code-snippets")}),(0,s.jsx)("li",{children:(0,o.__)("And much more!","code-snippets")})]})]})}},6788(e,t,r){"use strict";r.d(t,{J:()=>c});var n=r(4467),o=(r(1609),r(790));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=function(e){return(0,o.jsx)("svg",s(s({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,o.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"M19.499 17.334a2.167 2.167 0 1 1-2.167 2.167m2.167-2.167a2.167 2.167 0 0 0-2.167 2.167m2.167-2.167V8.667m-2.167 10.834H8.665m0 0A2.167 2.167 0 0 0 6.5 17.334m2.166 2.167A2.167 2.167 0 1 1 6.5 17.334m0 0V8.667m2.166-2.166A2.167 2.167 0 1 0 6.5 8.667m2.166-2.166A2.167 2.167 0 0 1 6.5 8.667m2.166-2.166h8.667m0 0a2.167 2.167 0 1 1 2.167 2.166m-2.167-2.166a2.167 2.167 0 0 0 2.167 2.166M8.124 8.126l9.75 9.75m-9.75 0 9.75-9.75"})}))}},8586(e,t,r){"use strict";r.d(t,{z:()=>c});var n=r(4467),o=(r(1609),r(790));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=function(e){return(0,o.jsx)("svg",s(s({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,o.jsx)("path",{d:"M20.0417 20.0417L22.75 22.75M4.33333 6.5H21.6667M4.33333 13H8.66666M4.33333 19.5H8.66666M11.9167 16.25C11.9167 17.3993 12.3732 18.5015 13.1859 19.3141C13.9985 20.1268 15.1007 20.5833 16.25 20.5833C17.3993 20.5833 18.5015 20.1268 19.3141 19.3141C20.1268 18.5015 20.5833 17.3993 20.5833 16.25C20.5833 15.1007 20.1268 13.9985 19.3141 13.1859C18.5015 12.3732 17.3993 11.9167 16.25 11.9167C15.1007 11.9167 13.9985 12.3732 13.1859 13.1859C12.3732 13.9985 11.9167 15.1007 11.9167 16.25Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},3028(e,t,r){"use strict";r.d(t,{$:()=>c});var n=r(4467),o=(r(1609),r(790));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=function(e){return(0,o.jsx)("svg",s(s({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,o.jsx)("path",{d:"M11.9167 19.5045H7.21175C4.42541 19.5002 2.16666 17.326 2.16666 14.6436C2.16666 11.9624 4.42541 9.78812 7.21175 9.78812C7.6375 7.87928 9.15525 6.32145 11.193 5.7007C13.2297 5.08103 15.4787 5.49162 17.0907 6.78403C18.7027 8.0732 19.4328 10.0416 19.0082 11.9505H20.0807C20.8821 11.9519 21.6621 12.2097 22.3067 12.686C22.9513 13.1624 23.4266 13.8324 23.6632 14.5981M21.6667 22.7502L23.8333 20.5835L21.6667 18.4169M18.4167 18.4169L16.25 20.5835L18.4167 22.7502",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},3780(e,t,r){"use strict";r.d(t,{Z:()=>c});var n=r(4467),o=(r(1609),r(790));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=function(e){return(0,o.jsxs)("svg",s(s({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,o.jsx)("path",{d:"M11.1854 4.67675C11.6469 2.77442 14.3531 2.77442 14.8146 4.67675C14.8838 4.96253 15.0196 5.22793 15.2108 5.45133C15.402 5.67474 15.6432 5.84984 15.9149 5.96239C16.1865 6.07494 16.4809 6.12176 16.7741 6.09902C17.0673 6.07629 17.3509 5.98466 17.602 5.83158C19.2736 4.81325 21.1878 6.72642 20.1695 8.39908C20.0166 8.65004 19.9252 8.93353 19.9025 9.2265C19.8798 9.51948 19.9266 9.81367 20.039 10.0852C20.1514 10.3567 20.3263 10.5978 20.5495 10.789C20.7726 10.9802 21.0377 11.116 21.3233 11.1854C23.2256 11.6469 23.2256 14.3531 21.3233 14.8146C21.0375 14.8838 20.7721 15.0196 20.5487 15.2108C20.3253 15.402 20.1502 15.6432 20.0376 15.9149C19.9251 16.1865 19.8782 16.4809 19.901 16.7741C19.9237 17.0673 20.0153 17.3509 20.1684 17.602C21.1868 19.2736 19.2736 21.1878 17.6009 20.1695C17.35 20.0166 17.0665 19.9252 16.7735 19.9025C16.4805 19.8798 16.1863 19.9266 15.9148 20.039C15.6433 20.1514 15.4022 20.3263 15.211 20.5495C15.0198 20.7726 14.884 21.0377 14.8146 21.3233C14.3531 23.2256 11.6469 23.2256 11.1854 21.3233C11.1162 21.0375 10.9804 20.7721 10.7892 20.5487C10.598 20.3253 10.3568 20.1502 10.0851 20.0376C9.81347 19.9251 9.51907 19.8782 9.2259 19.901C8.93273 19.9237 8.64907 20.0153 8.398 20.1684C6.72642 21.1868 4.81217 19.2736 5.8305 17.6009C5.98336 17.35 6.07485 17.0665 6.09752 16.7735C6.1202 16.4805 6.07343 16.1863 5.96101 15.9148C5.84859 15.6433 5.6737 15.4022 5.45055 15.211C5.22739 15.0198 4.96228 14.884 4.67675 14.8146C2.77442 14.3531 2.77442 11.6469 4.67675 11.1854C4.96253 11.1162 5.22793 10.9804 5.45133 10.7892C5.67474 10.598 5.84984 10.3568 5.96239 10.0851C6.07494 9.81347 6.12176 9.51907 6.09902 9.2259C6.07629 8.93273 5.98466 8.64907 5.83158 8.398C4.81325 6.72642 6.72642 4.81217 8.39908 5.8305C9.48242 6.48917 10.8864 5.90633 11.1854 4.67675Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M9.75 13C9.75 13.862 10.0924 14.6886 10.7019 15.2981C11.3114 15.9076 12.138 16.25 13 16.25C13.862 16.25 14.6886 15.9076 15.2981 15.2981C15.9076 14.6886 16.25 13.862 16.25 13C16.25 12.138 15.9076 11.3114 15.2981 10.7019C14.6886 10.0924 13.862 9.75 13 9.75C12.138 9.75 11.3114 10.0924 10.7019 10.7019C10.0924 11.3114 9.75 12.138 9.75 13Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))}},401(e,t,r){"use strict";r.d(t,{M:()=>c});var n=r(4467),o=(r(1609),r(790));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var c=function(e){return(0,o.jsx)("svg",s(s({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,o.jsx)("path",{d:"M7.58333 8.66634L3.25 12.9997L7.58333 17.333M18.4167 8.66634L22.75 12.9997L18.4167 17.333M15.1667 4.33301L10.8333 21.6663",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},5070(e,t,r){"use strict";var n=r(5896),o=r(2284),i=r(5501),s=r(3662),c=r(6842);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(){l=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,o){var i=RegExp(e,n);return t.set(i,o||t.get(e)),(0,s.A)(i,r.prototype)}function n(e,r){var n=t.get(r);return Object.keys(n).reduce(function(t,r){var o=n[r];if("number"==typeof o)t[r]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;t[r]=e[o[i]]}return t},Object.create(null))}return(0,i.A)(r,RegExp),r.prototype.exec=function(t){var r=e.exec.call(this,t);if(r){r.groups=n(r,this);var o=r.indices;o&&(o.groups=n(o,this))}return r},r.prototype[Symbol.replace]=function(r,i){if("string"==typeof i){var s=t.get(this);return e[Symbol.replace].call(this,r,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,r){if(""===r)return e;var n=s[t];return Array.isArray(n)?"$"+n.join("$"):"number"==typeof n?"$"+n:""}))}if("function"==typeof i){var c=this;return e[Symbol.replace].call(this,r,function(){var e=arguments;return"object"!=(0,o.A)(e[e.length-1])&&(e=[].slice.call(e)).push(n(e,c)),i.apply(this,e)})}return e[Symbol.replace].call(this,r,i)},l.apply(this,arguments)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r(1379);var p,d,f,v=r(467),h=r(4756),y=r.n(h),b=window.__code_snippets_i18n,w=function(){var e=(0,v.A)(y().mark(function e(t,r){var n,o;return y().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new URLSearchParams,Object.keys(t).forEach(function(e){return n.append(e,t[e])}),r.ajaxurl){e.next=4;break}throw new Error("ajaxurl not defined in config");case 4:return e.next=6,fetch(r.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:n.toString(),credentials:"same-origin"});case 6:return o=e.sent,e.next=9,o.json();case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}();(0,r(9028).o)("code-snippets-toolbar-container",n.M),function(){var e=document.getElementById("settings-sections-tabs");if(e){!function(e){var t,r=e.closest(".snippet-type-nav-wrapper");if(r){var n=function(){var t=e.scrollWidth-e.clientWidth-e.scrollLeft;r.classList.toggle("has-scroll-start",1<e.scrollLeft),r.classList.toggle("has-scroll-end",1<t)};e.addEventListener("scroll",n,{passive:!0});var o=new ResizeObserver(n);o.observe(e),o.observe(null!==(t=e.firstElementChild)&&void 0!==t?t:e),n()}}(e);var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}(e.querySelectorAll(".snippet-type-link"));try{var n=function(){var r=t.value;r.addEventListener("click",function(t){t.preventDefault();var n=r.getAttribute("data-section");n&&(function(e,t,r){var n,o,i;null===(n=e.querySelector(".active-type"))||void 0===n||n.classList.remove("active-type"),t.classList.add("active-type"),(0,c.ev)({section:r}),null===(o=e.closest(".wrap"))||void 0===o||o.setAttribute("data-active-tab",r),document.querySelectorAll(".cloud-message").forEach(function(e){e.classList.add("hidden")}),"version-switch"!==r&&(null===(i=document.getElementById("version-switch-warning"))||void 0===i||i.classList.add("hidden"))}(e,r,n),function(e){var t;"editor"===e&&(null===(t=window.code_snippets_editor_preview)||void 0===t||t.codemirror.refresh())}(n),function(e){var t=document.querySelector("input[name=_wp_http_referer]");if(t){var r=t.value.replace(l(/([&?]section=)[^&]+/,{base:1}),"$1".concat(e));t.value=r+(r===t.value?"&section=".concat(e):"")}else console.error("could not find http referer")}(n))})};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}else console.error("Could not find snippets tabs")}(),p=document.getElementById("snippets-screen-meta-slot"),d=document.getElementById("screen-meta"),f=document.getElementById("screen-meta-links"),p&&d&&f&&p.append(d,f),function(){var e,t=function(){var e=window.wp.codeEditor,t=document.getElementById("code_snippets_editor_preview");if(t&&e)return window.code_snippets_editor_preview=e.initialize(t),window.code_snippets_editor_preview.codemirror;console.error("Could not initialise CodeMirror on textarea.",t)}(),r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}(window.code_snippets_editor_settings);try{var n=function(){var r=e.value,n=document.querySelector('[name="code_snippets_settings[editor]['.concat(r.name,']"]'));null==n||n.addEventListener("change",function(){var e=r.codemirror,o=function(){switch(r.type){case"select":return(e=n).options[e.selectedIndex].value;case"checkbox":return n.checked;case"number":return parseInt(n.value,10);default:return null}var e}();if(null!==o)if("font_size"===r.name){var i=document.querySelector(".CodeMirror-code");i&&i instanceof HTMLElement&&(i.style.fontSize="".concat(o,"px"))}else null==t||t.setOption(e,o)})};for(r.s();!(e=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}(),function(){var e,t,r=(null!==(e=null===(t=document.querySelector(".current-version"))||void 0===t?void 0:t.textContent)&&void 0!==e?e:"").trim(),n=window.code_snippets_version_switch;if(!n)throw Error("version switch config missing");var o,i,s=document.getElementById("switch-version-btn"),c=document.getElementById("target_version"),a=document.getElementById("version-switch-result"),l=document.getElementById("refresh-versions-btn");c&&function(e,t,r){var n=document.getElementById("version-switch-warning");e.addEventListener("change",function(){var o=e.value;t&&(o&&o!==r?(t.disabled=!1,null==n||n.classList.remove("hidden")):(t.disabled=!0,null==n||n.classList.add("hidden")))})}(c,s,r),s&&c&&a&&function(e,t,r,n,o){e.addEventListener("click",function(){(0,v.A)(y().mark(function i(){var s,c,a,l,u,p,d,f,v,h;return y().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if((a=t.value)&&a!==o){i.next=6;break}return r.className="notice notice-warning",r.innerHTML="<p>".concat(null==b?void 0:b.selectDifferent,"</p>"),r.style.display="",i.abrupt("return");case 6:return e.disabled=!0,l=null!==(s=e.textContent)&&void 0!==s?s:"",e.textContent=null!==(c=null==b?void 0:b.switching)&&void 0!==c?c:"",r.className="notice notice-info",r.innerHTML="<p>".concat(null==b?void 0:b.processing,"</p>"),r.style.display="",i.prev=12,i.next=15,w({action:"code_snippets_switch_version",target_version:a,nonce:null!==(u=n.nonce_switch)&&void 0!==u?u:""},n);case 15:if(!(f=i.sent).success){i.next=21;break}return r.className="notice notice-success",r.innerHTML="<p>".concat(null!==(v=null===(h=f.data)||void 0===h?void 0:h.message)&&void 0!==v?v:"","</p>"),setTimeout(function(){return window.location.reload()},3e3),i.abrupt("return");case 21:r.className="notice notice-error",r.innerHTML="<p>".concat(null!==(p=null===(d=f.data)||void 0===d?void 0:d.message)&&void 0!==p?p:null==b?void 0:b.error,"</p>"),e.disabled=!1,e.textContent=l,i.next=33;break;case 27:i.prev=27,i.t0=i.catch(12),r.className="notice notice-error",r.innerHTML="<p>".concat(null==b?void 0:b.errorSwitch,"</p>"),e.disabled=!1,e.textContent=l;case 33:case"end":return i.stop()}},i,null,[[12,27]])}))()})}(s,c,a,n,r),l&&(i=n,(o=l).addEventListener("click",function(){(0,v.A)(y().mark(function e(){var t,r,n,s,c;return y().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(t=o.textContent)&&void 0!==t?t:"",o.disabled=!0,o.textContent=null!==(r=null==b?void 0:b.error)&&void 0!==r?r:"",e.prev=3,e.next=6,w({action:"code_snippets_refresh_versions",nonce:null!==(s=i.nonce_refresh)&&void 0!==s?s:""},i);case 6:o.textContent=null!==(c=null==b?void 0:b.refreshed)&&void 0!==c?c:"",setTimeout(function(){o.disabled=!1,o.textContent=n,window.location.reload()},1e3),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),o.disabled=!1,o.textContent=n;case 14:case"end":return e.stop()}},e,null,[[3,10]])}))()}))}()},9028(e,t,r){"use strict";r.d(t,{h:()=>c,o:()=>s});var n=r(1609),o=r(5795),i=r(790),s=function(e,t){var r=document.getElementById(e);r?(0,o.createRoot)(r).render((0,i.jsx)(t,{})):console.error("Could not find element #".concat(e,"."))},c=function(e){var t=(0,n.createContext)(void 0);return[t,function(){var r=(0,n.useContext)(t);if(void 0===r)throw Error("".concat(e," can only be used within a corresponding context provider."));return r}]}},6492(e,t,r){"use strict";r.d(t,{QX:()=>i,U0:()=>o,W9:()=>s,i_:()=>n});var n=function(){var e;return!0===(null===(e=window.pagenow)||void 0===e?void 0:e.endsWith("-network"))},o=function(){return null!==/mac/i.exec(window.navigator.userAgent)},i=function(){var e;return!(null===(e=window.CODE_SNIPPETS)||void 0===e||!e.isLicensed)},s=function(){var e;return!(i()||null!==(e=window.CODE_SNIPPETS)&&void 0!==e&&e.hideUpsell)}},6842(e,t,r){"use strict";r.d(t,{c$:()=>a,ev:()=>s});var n=r(2284),o=r(3453),i=r(3832),s=function(e){if("URLSearchParams"in window){for(var t=new URLSearchParams(window.location.search),r=0,n=Object.entries(e);r<n.length;r++){var i=(0,o.A)(n[r],2),s=i[0],c=i[1];c?t.set(s,String(c)):t.delete(s)}var a=window.location.toString().replace(window.location.search,"?".concat(t.toString()));window.history.replaceState({},document.title,a)}},c=function(e){switch(!0){case null==e:return;case"boolean"==typeof e:return e?"1":"0";case"number"==typeof e:case"string"==typeof e:return String(e);default:throw new Error("Unsupported query arg type: ".concat((0,n.A)(e)))}},a=function(e,t){for(var r={},n=0,s=Object.entries(t);n<s.length;n++){var a=(0,o.A)(s[n],2),l=a[0],u=a[1],p=c(u);void 0!==p&&(r[l]=p)}return(0,i.addQueryArgs)(e,r)}},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM},790(e){"use strict";e.exports=window.ReactJSXRuntime},6427(e){"use strict";e.exports=window.wp.components},6087(e){"use strict";e.exports=window.wp.element},7723(e){"use strict";e.exports=window.wp.i18n},3832(e){"use strict";e.exports=window.wp.url},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,r){var n=r(5546);function o(){var t,r,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.toStringTag||"@@toStringTag";function a(e,o,i,s){var c=o&&o.prototype instanceof u?o:u,a=Object.create(c.prototype);return n(a,"_invoke",function(e,n,o){var i,s,c,a=0,u=o||[],p=!1,d={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,s=0,c=t,d.n=r,l}};function f(e,n){for(s=e,c=n,r=0;!p&&a&&!o&&r<u.length;r++){var o,i=u[r],f=d.p,v=i[2];e>3?(o=v===n)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=e<2&&f<i[1])?(s=0,d.v=n,d.n=i[1]):f<v&&(o=e<3||i[0]>n||n>v)&&(i[4]=e,i[5]=n,d.n=v,s=0))}if(o||e>1)return l;throw p=!0,n}return function(o,u,v){if(a>1)throw TypeError("Generator is already running");for(p&&1===u&&f(u,v),s=u,c=v;(r=s<2?t:c)||!p;){i||(s?s<3?(s>1&&(d.n=-1),f(s,c)):d.n=c:d.v=c);try{if(a=2,i){if(s||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,s<2&&(s=0)}else 1===s&&(r=i.return)&&r.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((r=(p=d.n<0)?c:e.call(n,d))!==l)break}catch(e){i=t,s=1,c=e}finally{a=1}}return{value:r,done:p}}}(e,i,s),!0),a}var l={};function u(){}function p(){}function d(){}r=Object.getPrototypeOf;var f=[][s]?r(r([][s]())):(n(r={},s,function(){return this}),r),v=d.prototype=u.prototype=Object.create(f);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,n(e,c,"GeneratorFunction")),e.prototype=Object.create(v),e}return p.prototype=d,n(v,"constructor",d),n(d,"constructor",p),p.displayName="GeneratorFunction",n(d,c,"GeneratorFunction"),n(v),n(v,c,"Generator"),n(v,s,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:a,m:h}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,i){var s=n(e,t,r,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(6993),o=r(1791);e.exports=function(e,t,r,i,s){return new o(n().w(e,t,r,i),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,r){var n=r(5172),o=r(5546);e.exports=function e(t,r){function i(e,o,s,c){try{var a=t[e](o),l=a.value;return l instanceof n?r.resolve(l.v).then(function(e){i("next",e,s,c)},function(e){i("throw",e,s,c)}):r.resolve(l).then(function(e){a.value=e,s(a)},function(e){return i("throw",e,s,c)})}catch(e){c(e)}}var s;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){i(e,n,t,r)})}return s=s?s.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(r,n,o,i){var s=Object.defineProperty;try{s({},"",{})}catch(r){s=0}e.exports=t=function(e,r,n,o){function i(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?s?s(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,r){var n=r(5172),o=r(6993),i=r(5869),s=r(887),c=r(1791),a=r(4373),l=r(579);function u(){"use strict";var t=o(),r=t.m(u),p=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,f[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,l(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=u=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:d,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:c,async:function(e,t,r,n,o){return(d(t)?s:i)(v(e),t,r,n,o)},keys:a,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,r){var n=r(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(r){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(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,r){var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=s(e,i(r)))}return e}function i(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 r in e)n.call(e,r)&&e[r]&&(t=s(t,r));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},467(e,t,r){"use strict";function n(e,t,r,n,o,i,s){try{var c=e[i](s),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var s=e.apply(t,r);function c(e){n(s,o,i,c,a,"next",e)}function a(e){n(s,o,i,c,a,"throw",e)}c(void 0)})}}r.d(t,{A:()=>o})},4467(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(9922);function o(e,t,r){return(t=(0,n.A)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},5501(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(3662);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,n.A)(e,t)}},3662(e,t,r){"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}r.d(t,{A:()=>n})}},e=>{e(e.s=5070)}]);
2 +(self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[6472],{3175(e,t,n){"use strict";n.d(t,{F:()=>N});var r=n(4467),s=n(1609),i=n(7723),o=n(1240),a=n(7834),c=n(7738),l=n(6094),d=n(7894),u=n(752),p=n(4080),f=n(7161),h=n(781),m=n(1755),v=n(2804),b=n(7870),g=n(8493),y=n(4885),_=n(6724),j=n(6940),w=n(790);function x(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?x(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var A={"plan-ready":{target:".ai-agent-plan",padding:6},"plan-accepted":{target:".ai-agent-plan",padding:6},"result-ready":{target:".ai-agent-result__rows",padding:8},applying:{target:".ai-agent-result__edit",padding:6}},S={"typing-prompt":(0,i.__)("Writing a prompt.","code-snippets"),"prompt-sent":(0,i.__)("Prompt sent.","code-snippets"),planning:(0,i.__)("Planning your snippets.","code-snippets"),"plan-ready":(0,i.__)("The plan is ready.","code-snippets"),"plan-accepted":(0,i.__)("Plan accepted.","code-snippets"),building:(0,i.__)("Building the code.","code-snippets"),"result-ready":(0,i.__)("Snippets created.","code-snippets"),"refine-open":(0,i.__)("Choosing snippets to refine.","code-snippets"),"typing-refinement":(0,i.__)("Writing a refinement.","code-snippets"),applying:(0,i.__)("Applying your changes.","code-snippets"),saved:(0,i.__)("Snippets updated and saved to your site.","code-snippets"),finished:(0,i.__)("Demo complete.","code-snippets")},P=function(){var e=(0,_.y)(),t=e.stage,n=e.typedPrompt,r=e.typedRefinement,o=e.snippets,x=e.hasStarted,P=e.isFinished,N=e.reducedMotion,k=e.play,E=e.skip,C=e.replay,D=(0,u.J)("ai-agent"),T=(0,s.useRef)(null);(0,s.useEffect)(function(){var e;P&&(D(),null===(e=T.current)||void 0===e||e.scrollIntoView({behavior:N?"auto":"smooth",block:"end"}))},[P,D,N]);var R=(0,j.Nl)(t,"prompt-sent");return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(a.O,{}),(0,w.jsx)(l.G,{title:(0,i.__)("AI Agent","code-snippets"),description:(0,i.__)("A guided walkthrough of the Pro AI Agent. Press play and watch it plan, build, and refine a snippet on your site.","code-snippets"),hasStarted:x,isFinished:P,onPlay:k,onSkip:E,onReplay:C}),(0,w.jsxs)("section",{className:"ai-agent ai-agent-demo","aria-label":(0,i.__)("AI Agent demo","code-snippets"),children:[(0,w.jsx)("div",{className:"screen-reader-text","aria-live":"polite",children:S[t]}),(0,w.jsx)(c.e,{callout:(0,p.t)(t)}),(0,w.jsx)(d.e,O({},A[t])),(0,w.jsxs)("div",{className:"ai-agent-layout",children:[(0,w.jsxs)("div",{className:"ai-agent-layout__main",children:[!R&&(0,w.jsxs)("div",{className:"ai-agent-empty",children:[(0,w.jsx)("p",{className:"ai-agent-empty__eyebrow",children:(0,i.__)("Start with these prompts","code-snippets")}),(0,w.jsx)("div",{className:"ai-agent-empty__chips",children:y.Qn.map(function(e){return(0,w.jsx)("button",{type:"button",className:"ai-agent-empty__chip",disabled:!0,children:e},e)})})]}),(0,w.jsxs)("div",{className:"ai-agent-thread",children:[(0,j.Nl)(t,"prompt-sent")&&(0,w.jsx)(b.$V,{speaker:"user",children:y.j7}),"planning"===t&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(b.dI,{label:(0,i.__)("Sending your prompt to Code Snippets Cloud.","code-snippets")}),(0,w.jsx)(b.RC,{label:(0,i.__)("Planning your snippets…","code-snippets")})]}),(0,j.Nl)(t,"plan-ready")&&!(0,j.Nl)(t,"building")&&(0,w.jsx)(f.n,{accepted:"plan-accepted"===t}),"building"===t&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(b.dI,{label:(0,i.__)("Building the snippets in Code Snippets Cloud.","code-snippets")}),(0,w.jsx)(b.RC,{label:(0,i.__)("Building the code…","code-snippets")})]}),(0,j.Nl)(t,"result-ready")&&(0,w.jsx)(m.H,{stage:t,snippets:o,typedRefinement:r}),"applying"===t&&(0,w.jsx)(b.RC,{label:(0,i.__)("Applying your changes…","code-snippets")}),(0,j.Nl)(t,"saved")&&(0,w.jsx)(b.$V,{speaker:"assistant",children:y.Ze})]}),(0,w.jsx)(h.z,{value:(0,j.Nl)(t,"planning")?"":n,typing:"typing-prompt"===t,pressed:"prompt-sent"===t,disabled:R,submitLabel:(0,i.__)("Send","code-snippets"),placeholder:(0,i.__)("Describe what you want to build…","code-snippets")})]}),(0,w.jsx)("div",{className:"ai-agent-layout__sidebar",children:(0,w.jsx)(v.W,{stage:t})})]}),P&&(0,w.jsx)("div",{ref:T,className:"ai-agent-demo__closing",role:"region","aria-label":(0,i.__)("AI Agent demo complete","code-snippets"),children:(0,w.jsx)(g.c,{onReplay:C})})]})]})},N=function(){return(0,w.jsx)(o.i,{children:(0,w.jsx)(P,{})})}},7161(e,t,n){"use strict";n.d(t,{n:()=>u}),n(1609);var r=n(7723),s=n(6942),i=n.n(s),o=n(4888),a=n(2449),c=n(4885),l=n(6940),d=n(790),u=function(e){var t=e.accepted,n=(0,r.sprintf)((0,r._n)("Bundle · %d snippet","Bundle · %d snippets",c.a6.parts.length,"code-snippets"),c.a6.parts.length);return(0,d.jsxs)("div",{className:"ai-agent-plan",children:[(0,d.jsxs)("div",{className:"ai-agent-plan__header",children:[(0,d.jsx)("h2",{className:"ai-agent-plan__title",children:c.a6.title}),(0,d.jsx)("span",{className:"ai-agent-plan__badge is-bundle",children:n})]}),(0,d.jsx)("p",{className:"ai-agent-plan__overview",children:c.a6.summary}),(0,d.jsx)("h3",{className:"ai-agent-plan__parts-heading",children:(0,r.__)("What will be created","code-snippets")}),(0,d.jsx)("ul",{className:"ai-agent-plan__parts",children:c.a6.parts.map(function(e){return(0,d.jsxs)("li",{className:"ai-agent-plan__part",children:[(0,d.jsx)(o.E,{name:(0,l.bE)(e.language),small:!0}),(0,d.jsx)("span",{className:"ai-agent-plan__part-name",children:e.name}),(0,d.jsx)("p",{className:"ai-agent-plan__part-desc",children:e.description})]},e.name)})}),(0,d.jsxs)("div",{className:"ai-agent-plan__actions",children:[(0,d.jsx)(a.$,{primary:!0,type:"button",className:i()("ai-agent-demo-accept",{"demo-click":t}),"aria-hidden":"true",tabIndex:-1,children:(0,r.__)("Accept & create","code-snippets")}),(0,d.jsx)(a.$,{secondary:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,r.__)("Refine plan","code-snippets")})]})]})}},781(e,t,n){"use strict";n.d(t,{z:()=>c}),n(1609);var r=n(7723),s=n(6942),i=n.n(s),o=n(2449),a=n(790),c=function(e){var t=e.value,n=e.submitLabel,s=e.placeholder,c=e.typing,l=e.pressed,d=void 0!==l&&l,u=e.disabled,p=void 0!==u&&u;return(0,a.jsxs)("div",{className:i()("ai-agent-prompt","ai-agent-demo-prompt",{"is-typing":c}),children:[(0,a.jsxs)("div",{className:"ai-agent-prompt__input ai-agent-demo-prompt__text","aria-live":"polite",children:[""===t?(0,a.jsx)("span",{className:"ai-agent-demo-prompt__placeholder",children:s}):t,c&&(0,a.jsx)("span",{className:"ai-agent-demo-prompt__caret","aria-hidden":"true"})]}),(0,a.jsxs)("div",{className:"ai-agent-prompt__footer",children:[(0,a.jsx)("span",{className:"ai-agent-prompt__hint",children:(0,r.__)("Enter to send · Shift/Ctrl/⌘+Enter for a new line","code-snippets")}),(0,a.jsx)(o.$,{primary:!0,type:"button",disabled:p,className:i()("ai-agent-demo-send",{"demo-click":d}),"aria-hidden":"true",tabIndex:-1,children:n})]})]})}},1755(e,t,n){"use strict";n.d(t,{H:()=>h});var r=n(3453),s=n(1609),i=n(7723),o=n(4888),a=n(2449),c=n(7166),l=n(781),d=n(6940),u=n(790),p=function(e){var t=e.snippet,n=e.stage,r=e.onPreview;return(0,u.jsxs)("li",{className:"ai-agent-result__row",children:[(0,d.Nl)(n,"refine-open")&&(0,u.jsx)("input",{type:"checkbox",checked:!0,disabled:!0,"aria-label":t.name}),(0,u.jsx)(o.E,{name:(0,d.bE)(t.language),small:!0}),(0,u.jsx)("span",{className:"ai-agent-result__name",children:t.name}),(0,u.jsx)(a.$,{link:!0,type:"button",onClick:r,children:(0,i.__)("Preview code","code-snippets")}),"applying"!==n&&(0,u.jsx)(a.$,{link:!0,type:"button",className:"ai-agent-result__link","aria-hidden":"true",tabIndex:-1,children:(0,i.__)("Edit","code-snippets")})]})},f=function(e){var t=e.stage,n=e.typedRefinement;return(0,d.Nl)(t,"refine-open")?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"ai-agent-result__edit-head",children:[(0,u.jsx)("span",{children:(0,i.__)("Select the snippets to change, then describe the change.","code-snippets")}),(0,u.jsxs)("div",{className:"ai-agent-result__edit-actions",children:[(0,u.jsx)(a.$,{link:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,i.__)("Deselect all","code-snippets")}),(0,u.jsx)(a.$,{link:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,i.__)("Cancel","code-snippets")})]})]}),(0,u.jsx)(l.z,{value:n,typing:"typing-refinement"===t,pressed:"applying"===t,submitLabel:(0,i.__)("Apply changes","code-snippets"),placeholder:(0,i.__)("Describe the changes to the selected snippet(s)…","code-snippets")})]}):(0,u.jsx)(a.$,{secondary:!0,type:"button",className:"ai-agent-result__make-changes","aria-hidden":"true",tabIndex:-1,children:(0,i.__)("Make changes","code-snippets")})},h=function(e){var t=e.stage,n=e.snippets,o=e.typedRefinement,a=(0,s.useState)(),l=(0,r.A)(a,2),h=l[0],m=l[1];return(0,u.jsxs)("div",{className:"ai-agent-result",children:[(0,u.jsxs)("div",{className:"ai-agent-plan__header",children:[(0,u.jsx)("h2",{className:"ai-agent-plan__title",children:(0,i.__)("Dismissible welcome banner","code-snippets")}),(0,u.jsx)("span",{className:"ai-agent-plan__badge is-done",children:"applying"===t?(0,i.__)("Updating…","code-snippets"):(0,i.__)("Created","code-snippets")})]}),(0,u.jsx)("p",{className:"ai-agent-result__lead",children:(0,i.__)("In Pro these snippets would now be on your site, inactive. Preview the code, or make changes below.","code-snippets")}),(0,u.jsx)("ul",{className:"ai-agent-result__rows",children:n.map(function(e){return(0,u.jsx)(p,{snippet:e,stage:t,onPreview:function(){return m(e)}},e.key)})}),(0,u.jsx)("div",{className:"ai-agent-result__edit",children:(0,u.jsx)(f,{stage:t,typedRefinement:o})}),h&&(0,u.jsx)(c.M3,{title:h.name,code:h.code,type:(0,d.bE)(h.language),onRequestClose:function(){return m(void 0)}})]})}},2804(e,t,n){"use strict";n.d(t,{W:()=>v});var r=n(3453),s=n(1609),i=n(7723),o=n(6942),a=n.n(o),c=n(4885),l=n(6940),d=n(790),u=[{label:(0,i.__)("Today","code-snippets"),used:2,limit:25},{label:(0,i.__)("This month","code-snippets"),used:34,limit:300}],p=[(0,i.__)("Hide the admin bar for subscribers","code-snippets"),(0,i.__)("Custom login screen logo","code-snippets")],f=function(){return(0,d.jsxs)("div",{className:"ai-agent-quota",children:[(0,d.jsx)("h2",{className:"ai-agent-sidebar__heading",children:(0,i.__)("AI usage","code-snippets")}),u.map(function(e){var t=e.label,n=e.used,r=e.limit;return(0,d.jsxs)("div",{className:"ai-agent-quota__row",children:[(0,d.jsxs)("div",{className:"ai-agent-quota__label",children:[(0,d.jsx)("span",{children:t}),(0,d.jsx)("span",{children:(0,i.sprintf)((0,i.__)("%1$d / %2$d","code-snippets"),n,r)})]}),(0,d.jsx)("div",{className:"ai-agent-quota__track is-ok",children:(0,d.jsx)("div",{className:"ai-agent-quota__fill",style:{inlineSize:"".concat(100*n/r,"%")}})})]},t)})]})},h=function(e){var t=e.stage,n=function(e){return"applying"===e?{label:(0,i.__)("Updating","code-snippets")}:(0,l.Nl)(e,"result-ready")?{label:(0,i.__)("Completed","code-snippets"),modifier:"is-done"}:(0,l.Nl)(e,"building")?{label:(0,i.__)("Building","code-snippets")}:(0,l.Nl)(e,"plan-ready")?{label:(0,i.__)("Plan ready","code-snippets"),modifier:"is-plan"}:{label:(0,i.__)("Planning","code-snippets")}}(t);return(0,d.jsx)("div",{className:"ai-agent-history",children:(0,d.jsxs)("ul",{className:"ai-agent-history__list",children:[(0,l.Nl)(t,"prompt-sent")&&(0,d.jsx)("li",{className:"ai-agent-history__item is-active",children:(0,d.jsxs)("span",{className:"ai-agent-history__open",children:[(0,d.jsx)("span",{className:"ai-agent-history__title",children:(0,i.__)("Dismissible welcome banner","code-snippets")}),(0,d.jsx)("span",{className:a()("ai-agent-history__status",n.modifier),children:n.label})]})}),p.map(function(e){return(0,d.jsx)("li",{className:"ai-agent-history__item",children:(0,d.jsxs)("span",{className:"ai-agent-history__open",children:[(0,d.jsx)("span",{className:"ai-agent-history__title",children:e}),(0,d.jsx)("span",{className:"ai-agent-history__status is-done",children:(0,i.__)("Completed","code-snippets")})]})},e)})]})})},m=function(e){var t=e.tab,n=e.current,r=e.label,s=e.onSelect;return(0,d.jsx)("button",{type:"button",role:"tab",id:"ai-agent-demo-tab-".concat(t),"aria-selected":t===n,"aria-controls":"ai-agent-demo-panel-".concat(t),className:a()("ai-agent-sidebar__tab",{"is-active":t===n}),onClick:function(){return s(t)},children:r})},v=function(e){var t=e.stage,n=(0,s.useState)("actions"),o=(0,r.A)(n,2),a=o[0],l=o[1];return(0,d.jsxs)("aside",{className:"ai-agent-sidebar","aria-label":(0,i.__)("AI Agent tools","code-snippets"),children:[(0,d.jsxs)("div",{className:"ai-agent-sidebar__tabs",role:"tablist",children:[(0,d.jsx)(m,{tab:"actions",current:a,label:(0,i.__)("Prompt Actions","code-snippets"),onSelect:l}),(0,d.jsx)(m,{tab:"history",current:a,label:(0,i.__)("Past Conversations","code-snippets"),onSelect:l})]}),(0,d.jsxs)("div",{className:"ai-agent-sidebar__panel",role:"tabpanel",id:"ai-agent-demo-panel-actions","aria-labelledby":"ai-agent-demo-tab-actions",hidden:"actions"!==a,children:[(0,d.jsxs)("div",{className:"ai-agent-examples",children:[(0,d.jsx)("h2",{className:"ai-agent-sidebar__heading",children:(0,i.__)("Prompt examples","code-snippets")}),c.Qn.map(function(e){return(0,d.jsx)("button",{type:"button",className:"ai-agent-examples__chip",disabled:!0,children:e},e)})]}),(0,d.jsx)(f,{})]}),(0,d.jsx)("div",{className:"ai-agent-sidebar__panel",role:"tabpanel",id:"ai-agent-demo-panel-history","aria-labelledby":"ai-agent-demo-tab-history",hidden:"history"!==a,children:(0,d.jsx)(h,{stage:t})})]})}},7870(e,t,n){"use strict";n.d(t,{$V:()=>i,RC:()=>o,dI:()=>a}),n(1609);var r=n(7723),s=n(790),i=function(e){var t=e.speaker,n=e.children;return(0,s.jsxs)("div",{className:"ai-agent-message is-".concat(t),children:[(0,s.jsx)("span",{className:"ai-agent-message__role",children:"user"===t?(0,r.__)("You","code-snippets"):(0,r.__)("AI Agent","code-snippets")}),(0,s.jsx)("div",{className:"ai-agent-message__content",children:n})]})},o=function(e){var t=e.label;return(0,s.jsxs)("div",{className:"ai-agent-typing",children:[(0,s.jsxs)("span",{className:"ai-agent-typing__dots","aria-hidden":"true",children:[(0,s.jsx)("i",{}),(0,s.jsx)("i",{}),(0,s.jsx)("i",{})]}),(0,s.jsx)("span",{children:t})]})},a=function(e){var t=e.label;return(0,s.jsxs)("div",{className:"ai-agent-demo-transit",children:[(0,s.jsx)("span",{className:"ai-agent-demo-transit__endpoint",children:(0,r.__)("Your site","code-snippets")}),(0,s.jsx)("span",{className:"ai-agent-demo-transit__track","aria-hidden":"true",children:(0,s.jsx)("span",{className:"ai-agent-demo-transit__pulse"})}),(0,s.jsx)("span",{className:"ai-agent-demo-transit__endpoint",children:(0,r.__)("Code Snippets Cloud","code-snippets")}),(0,s.jsx)("span",{className:"screen-reader-text",children:t})]})}},8493(e,t,n){"use strict";n.d(t,{c:()=>o}),n(1609);var r=n(7723),s=n(1075),i=n(790),o=function(e){var t=e.onReplay;return(0,i.jsxs)(s.T,{title:(0,r.__)("That was a demo — the real agent writes for you","code-snippets"),onReplay:t,children:[(0,i.jsx)("p",{children:(0,r.__)("The whole walkthrough was scripted and ran inside this plugin. No prompt or snippet left your site, and none were added to it.","code-snippets")}),(0,i.jsx)("p",{children:(0,r.__)("In Code Snippets Pro the AI Agent does all of this for whatever you ask it to build, and the snippets it writes are real — saved to your site inactive, until you have read them and switched them on.","code-snippets")})]})}},4080(e,t,n){"use strict";n.d(t,{t:()=>o});var r=n(7723),s={ask:{step:(0,r.__)("Step 1 of 5","code-snippets"),title:(0,r.__)("Ask in plain English","code-snippets"),body:(0,r.__)("No syntax to learn and no boilerplate to copy — describe what you want the site to do, and the agent works out what that means in code.","code-snippets")},plan:{step:(0,r.__)("Step 2 of 5","code-snippets"),title:(0,r.__)("Sent for planning","code-snippets"),body:(0,r.__)("Your request goes to Code Snippets Cloud, which works out what needs building — and whether that is one snippet or several — before writing anything.","code-snippets")},approve:{step:(0,r.__)("Step 3 of 5","code-snippets"),title:(0,r.__)("You approve the plan","code-snippets"),body:(0,r.__)("Nothing is written until you accept. Read what it intends to build, send it back for changes, or let it go ahead.","code-snippets")},build:{step:(0,r.__)("Step 4 of 5","code-snippets"),title:(0,r.__)("Built and added to your site","code-snippets"),body:(0,r.__)("Each part of the plan becomes a real snippet, written to suit your site rather than pulled from a template. They arrive inactive, so nothing runs until you have read the code and switched them on.","code-snippets")},refine:{step:(0,r.__)("Step 5 of 5","code-snippets"),title:(0,r.__)("Refine what it built","code-snippets"),body:(0,r.__)("Not quite right? Say what to change in plain English and it rewrites the snippets in place, keeping the conversation so each refinement builds on the last.","code-snippets")},done:{step:(0,r.__)("Done","code-snippets"),title:(0,r.__)("Ready to review","code-snippets"),body:(0,r.__)("The finished snippets are on your site, waiting for you to check them over and activate them.","code-snippets")}},i={"typing-prompt":"ask","prompt-sent":"plan",planning:"plan","plan-ready":"approve","plan-accepted":"approve",building:"build","result-ready":"build","refine-open":"refine","typing-refinement":"refine",applying:"refine",saved:"done"},o=function(e){var t=i[e];return t?s[t]:void 0}},4885(e,t,n){"use strict";n.d(t,{Lq:()=>p,Qn:()=>a,SK:()=>f,Ze:()=>h,a6:()=>d,cr:()=>b,j7:()=>c,s$:()=>g});var r=n(4467),s=n(7723);function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=[(0,s.__)("Replace a plugin with snippets","code-snippets"),(0,s.__)("Speed up my site","code-snippets"),(0,s.__)("Add a feature","code-snippets"),(0,s.__)("Fix a problem","code-snippets"),(0,s.__)("Customize appearance","code-snippets")],c=(0,s.__)("Add a dismissible welcome banner to the top of my site.","code-snippets"),l=(0,s.__)("Here is what I would build. Two snippets keep the markup and the styling separate, so you can restyle the banner later without touching the PHP.","code-snippets"),d={title:(0,s.__)("Dismissible welcome banner","code-snippets"),summary:l,parts:[{language:"php",name:(0,s.__)("Welcome banner","code-snippets"),description:(0,s.__)("Prints the banner at the top of every front-end page and remembers when a visitor dismisses it.","code-snippets")},{language:"css",name:(0,s.__)("Welcome banner styles","code-snippets"),description:(0,s.__)("Styles the banner bar, its message, and the dismiss button.","code-snippets")}]},u=(0,s.__)("our site","code-snippets"),p=function(){var e,t=null===(e=window.CODE_SNIPPETS_MANAGE)||void 0===e||null===(e=e.aiDemo)||void 0===e?void 0:e.siteName.trim();return void 0===t||""===t?u:t},f=function(e){return(0,s.sprintf)((0,s.__)("Make the banner say “Welcome to %s” and give it our brand colours.","code-snippets"),e)},h=(0,s.__)("Done — the banner now greets visitors by name and uses a warmer gradient.","code-snippets"),m=function(e){return'add_action( \'wp_body_open\', function () {\n\tif ( is_admin() || isset( $_COOKIE[\'cs_welcome_banner_dismissed\'] ) ) {\n\t\treturn;\n\t}\n\n\tprintf(\n\t\t\'<div class="cs-welcome-banner" role="status">\n\t\t\t<p class="cs-welcome-banner__message">%s</p>\n\t\t\t<button type="button" class="cs-welcome-banner__dismiss" aria-label="%s">&times;</button>\n\t\t</div>\',\n\t\tesc_html( \''.concat(e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"' ),\n\t\tesc_attr__( 'Dismiss this message', 'default' )\n\t);\n} );\n\nadd_action( 'wp_footer', function () {\n\t?>\n\t<script>\n\t\tdocument.querySelector( '.cs-welcome-banner__dismiss' )?.addEventListener( 'click', function () {\n\t\t\tdocument.cookie = 'cs_welcome_banner_dismissed=1; path=/; max-age=2592000';\n\t\t\tthis.closest( '.cs-welcome-banner' ).remove();\n\t\t} );\n\t<\/script>\n\t<?php\n} );")},v=function(e){return(0,s.sprintf)((0,s.__)("%s Created by the Code Snippets AI Agent demo, and left inactive so you can review it before switching it on.","code-snippets"),e)},b=function(){return[{key:"banner-php",name:(0,s.__)("Welcome banner","code-snippets"),desc:v((0,s.__)("Shows a dismissible welcome banner at the top of the site.","code-snippets")),language:"php",code:m((0,s.__)("Welcome!","code-snippets"))},{key:"banner-css",name:(0,s.__)("Welcome banner styles","code-snippets"),desc:v((0,s.__)("Styles the welcome banner.","code-snippets")),language:"css",code:".cs-welcome-banner {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 1rem;\n\tpadding-block: 0.75rem;\n\tpadding-inline: 1.5rem;\n\tbackground: #2271b1;\n\tcolor: #fff;\n\tfont-size: 0.95rem;\n}\n\n.cs-welcome-banner__message {\n\tmargin: 0;\n}\n\n.cs-welcome-banner__dismiss {\n\tbackground: none;\n\tborder: 0;\n\tcolor: inherit;\n\tcursor: pointer;\n\tfont-size: 1.25rem;\n\tline-height: 1;\n\tpadding: 0;\n}"}]},g=function(e){var t=(0,s.sprintf)((0,s.__)("Welcome to %s","code-snippets"),e);return[o(o({},b()[0]),{},{code:m(t)}),o(o({},b()[1]),{},{code:".cs-welcome-banner {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 1rem;\n\tpadding-block: 0.9rem;\n\tpadding-inline: 1.5rem;\n\tbackground: linear-gradient(90deg, #1d3c78 0%, #2271b1 55%, #3fa8d4 100%);\n\tcolor: #fff;\n\tfont-size: 1rem;\n\tletter-spacing: 0.01em;\n\ttext-align: center;\n}\n\n.cs-welcome-banner__message {\n\tmargin: 0;\n\tfont-weight: 600;\n}\n\n.cs-welcome-banner__dismiss {\n\tbackground: none;\n\tborder: 0;\n\tcolor: inherit;\n\tcursor: pointer;\n\tfont-size: 1.4rem;\n\tline-height: 1;\n\tpadding: 0;\n\topacity: 0.8;\n\ttransition: opacity 0.15s ease;\n}\n\n.cs-welcome-banner__dismiss:hover {\n\topacity: 1;\n}"})]}},6940(e,t,n){"use strict";n.d(t,{Nl:()=>o,bE:()=>r});var r=function(e){return"javascript"===e?"js":e},s=["idle","typing-prompt","prompt-sent","planning","plan-ready","plan-accepted","building","result-ready","refine-open","typing-refinement","applying","saved","finished"],i=function(e){return s.indexOf(e)},o=function(e,t){return i(e)>=i(t)}},6724(e,t,n){"use strict";n.d(t,{y:()=>c});var r=n(3453),s=n(1609),i=n(4885),o={"prompt-sent":1200,planning:3600,"plan-ready":3800,"plan-accepted":1200,building:3600,"result-ready":3e3,"refine-open":1500,applying:2800,saved:2600},a=function(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches},c=function(){var e=(0,s.useMemo)(a,[]),t=(0,s.useMemo)(i.Lq,[]),n=(0,s.useMemo)(function(){return(0,i.SK)(t)},[t]),c=(0,s.useState)("idle"),l=(0,r.A)(c,2),d=l[0],u=l[1],p=(0,s.useState)(""),f=(0,r.A)(p,2),h=f[0],m=f[1],v=(0,s.useState)(""),b=(0,r.A)(v,2),g=b[0],y=b[1],_=(0,s.useState)([]),j=(0,r.A)(_,2),w=j[0],x=j[1],O=(0,s.useRef)([]),A=(0,s.useCallback)(function(){O.current.forEach(window.clearTimeout),O.current=[]},[]);(0,s.useEffect)(function(){return function(){O.current.forEach(window.clearTimeout)}},[]);var S=(0,s.useCallback)(function(){A(),m(i.j7),y(n),x((0,i.s$)(t)),u("finished")},[A,n,t]),P=(0,s.useCallback)(function(e){u(e),"result-ready"===e&&x((0,i.cr)()),"saved"===e&&x((0,i.s$)(t))},[t]),N=(0,s.useCallback)(function(t,n,r){O.current.push(window.setTimeout(function(){return r(t)},e?250:n))},[e]),k=(0,s.useCallback)(function(t){var r;P(t);var s={"typing-prompt":"prompt-sent","prompt-sent":"planning",planning:"plan-ready","plan-ready":"plan-accepted","plan-accepted":"building",building:"result-ready","result-ready":"refine-open","refine-open":"typing-refinement","typing-refinement":"applying",applying:"saved",saved:"finished"}[t];if(s){var a=function(t){return 1600+(e?0:45*t.length)},c="typing-prompt"===t?a(i.j7):"typing-refinement"===t?a(n):null!==(r=o[t])&&void 0!==r?r:1600;N(s,c,k)}},[P,e,n,N]),E=(0,s.useCallback)(function(){A(),m(""),y(""),x([]),u("idle")},[A]),C=(0,s.useCallback)(function(){E(),O.current.push(window.setTimeout(function(){return k("typing-prompt")},0))},[k,E]),D=(0,s.useCallback)(function(){E(),O.current.push(window.setTimeout(function(){return k("typing-prompt")},250))},[k,E]);return(0,s.useEffect)(function(){var t="typing-prompt"===d?{text:i.j7,set:m}:"typing-refinement"===d?{text:n,set:y}:void 0;if(t){if(!e){var r=0,s=window.setInterval(function(){r+=1,t.set(t.text.slice(0,r)),r>=t.text.length&&window.clearInterval(s)},45);return function(){return window.clearInterval(s)}}t.set(t.text)}},[e,n,d]),{stage:d,typedPrompt:h,typedRefinement:g,snippets:w,hasStarted:"idle"!==d,isFinished:"finished"===d,reducedMotion:e,siteName:t,refinementPrompt:n,play:C,skip:S,replay:D}}},5921(e,t,n){"use strict";n.d(t,{I:()=>f});var r=n(4467),s=(n(1609),n(7723)),i=n(6942),o=n.n(i),a=n(790);function c(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=function(e){var t=e.field,n=e.id;switch(t.type){case"textarea":return(0,a.jsx)("textarea",{id:n,"aria-label":t.label,className:"widefat",rows:5,readOnly:!0,value:t.value});case"select":return(0,a.jsx)("select",{id:n,"aria-label":t.label,disabled:!0,value:t.value,children:(0,a.jsx)("option",{value:t.value,children:t.value})});default:return(0,a.jsx)("input",{type:"text",id:n,"aria-label":t.label,readOnly:!0,value:t.value})}},u=function(e){var t=e.field;return(0,a.jsxs)("div",{className:"blueprint-form-field",children:[(0,a.jsxs)("label",{htmlFor:t.name,children:[t.label," ",t.required&&(0,a.jsx)("span",{className:"required",children:"*"})]}),(0,a.jsx)(d,{field:t,id:t.name}),t.description&&(0,a.jsx)("p",{className:"description",children:t.description})]})},p=function(e){var t=e.repeater;return(0,a.jsxs)("div",{className:"blueprint-form-field blueprint-form-repeater",children:[(0,a.jsx)("label",{htmlFor:"".concat(t.columns[0].name,"-0"),children:t.label}),(0,a.jsxs)("div",{className:"blueprint-form-repeater",children:[t.rows.map(function(e,n){return(0,a.jsxs)("div",{className:"blueprint-form-repeater__row",children:[t.columns.map(function(t,r){var s="".concat(t.name,"-").concat(n);return(0,a.jsxs)("div",{className:"blueprint-form-field blueprint-form-repeater__cell",children:[(0,a.jsx)("label",{htmlFor:s,children:t.label}),(0,a.jsx)(d,{field:l(l({},t),{},{value:e.values[r]}),id:s}),t.description&&(0,a.jsx)("p",{className:"description",children:t.description})]},t.name)}),(0,a.jsx)("div",{className:"blueprint-form-repeater__actions",children:(0,a.jsx)("button",{type:"button",className:"button button-secondary button-small",disabled:!0,children:(0,s.__)("Remove","code-snippets")})})]},e.id)}),(0,a.jsx)("button",{type:"button",className:"button button-secondary blueprint-form-repeater__add",disabled:!0,children:t.addLabel})]})]})},f=function(e){var t=e.section,n=e.isFading;return(0,a.jsxs)("div",{className:o()("blueprint-form-content",{"is-fading":n}),children:[(0,a.jsx)("h3",{children:t.title}),t.description&&(0,a.jsx)("p",{className:"blueprint-form-section-description",children:t.description}),(0,a.jsxs)("div",{className:"blueprint-form-fields",children:[t.fields.map(function(e){return(0,a.jsx)(u,{field:e},e.name)}),t.repeater&&(0,a.jsx)(p,{repeater:t.repeater})]})]})}},2661(e,t,n){"use strict";n.d(t,{S:()=>c}),n(1609);var r=n(7723),s=n(6942),i=n.n(s),o=n(1942),a=n(790),c=function(e){var t=e.activeSection,n=e.browsable,s=e.generating,c=e.onSelect;return(0,a.jsxs)("nav",{className:"blueprint-form-sidebar","aria-label":(0,r.__)("Blueprint sections","code-snippets"),children:[(0,a.jsx)("ul",{children:o.$y.map(function(e){var r=e.id===t;return(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",className:i()("blueprint-form-sidebar__item",{"is-active":r}),"aria-current":r?"step":void 0,disabled:!n,onClick:function(){return c(e.id)},children:(0,a.jsx)("span",{children:e.title})})},e.id)})}),(0,a.jsx)("div",{className:"blueprint-form-sidebar__generate-wrap",children:(0,a.jsx)("button",{type:"button",className:i()("blueprint-form-sidebar__generate",{"demo-click":s}),"aria-hidden":"true",tabIndex:-1,children:(0,r.__)("Generate Code","code-snippets")})})]})}},1307(e,t,n){"use strict";n.d(t,{Y:()=>P});var r=n(4467),s=n(1609),i=n(7723),o=n(1240),a=n(7834),c=n(6094),l=n(7894),d=n(7738),u=n(1075),p=n(752),f=n(5921),h=n(2661),m=n(4411),v=n(3807),b=n(1942),g=n(6200),y=n(6333),_=n(790);function j(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?j(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var x={generating:{target:".blueprint-form-sidebar__generate",padding:8},generated:{target:".blueprints-demo-generated",padding:6}},O={general:(0,i.__)("Filling in the general settings.","code-snippets"),attributes:(0,i.__)("Adding the shortcode attributes.","code-snippets"),output:(0,i.__)("Setting the shortcode output.","code-snippets"),generating:(0,i.__)("Generating the code.","code-snippets"),generated:(0,i.__)("The snippet has been generated.","code-snippets"),finished:(0,i.__)("Demo complete.","code-snippets")},A=function(){return(0,_.jsx)("header",{className:"blueprint-detail__header",children:(0,_.jsx)("div",{className:"blueprint-detail__header-content",children:(0,_.jsxs)("div",{children:[(0,_.jsx)("h2",{children:b.R0}),(0,_.jsx)("p",{children:b.Z4})]})})})},S=function(){var e=(0,g.h)(),t=e.stage,n=e.activeSection,r=e.isFading,o=e.sectionsBrowsable,j=e.hasStarted,S=e.isFinished,P=e.reducedMotion,N=e.selectSection,k=e.play,E=e.skip,C=e.replay,D=(0,s.useRef)(null),T=(0,y.N)(t,"generated"),R=(0,p.J)("blueprints");return(0,s.useEffect)(function(){S&&R()},[S,R]),(0,s.useEffect)(function(){var e,n=P?"auto":"smooth";"generated"===t&&(null===(e=D.current)||void 0===e||e.scrollIntoView({behavior:n,block:"center"})),"finished"===t&&window.scrollTo({top:document.body.scrollHeight,behavior:n})},[P,t]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(a.O,{}),(0,_.jsx)(c.G,{title:(0,i.__)("Blueprints","code-snippets"),description:(0,i.__)("A guided walkthrough of Pro Blueprints. Press play and watch a shortcode blueprint fill itself in and generate a snippet.","code-snippets"),hasStarted:j,isFinished:S,onPlay:k,onSkip:E,onReplay:C}),(0,_.jsxs)("div",{className:"blueprints-demo",children:[(0,_.jsx)("div",{className:"screen-reader-text","aria-live":"polite",children:O[t]}),(0,_.jsx)(d.e,{callout:(0,v.t)(t)}),(0,_.jsx)(l.e,w({},x[t])),(0,_.jsxs)("div",{className:"blueprint-detail",children:[(0,_.jsx)(A,{}),(0,_.jsxs)("div",{className:"blueprint-form-layout",children:[(0,_.jsx)(h.S,{activeSection:n,browsable:o,generating:"generating"===t,onSelect:N}),(0,_.jsx)(f.I,{section:(0,b.Sx)(n),isFading:r})]})]}),T&&(0,_.jsx)(m.K,{ref:D}),S&&(0,_.jsxs)(u.T,{title:(0,i.__)("That was a demo — Blueprints build the code for you","code-snippets"),onReplay:C,children:[(0,_.jsx)("p",{children:(0,i.__)("The whole walkthrough was scripted and ran inside this plugin. No code was generated and nothing was saved.","code-snippets")}),(0,_.jsx)("p",{children:(0,i.__)("Code Snippets Pro ships blueprints for shortcodes, post types, taxonomies, settings pages, and more — fill in the form and it writes the snippet for you.","code-snippets")})]})]})]})},P=function(){return(0,_.jsx)(o.i,{children:(0,_.jsx)(S,{})})}},4411(e,t,n){"use strict";n.d(t,{K:()=>l});var r=n(1609),s=n.n(r),i=n(7723),o=n(4888),a=n(1942),c=n(790),l=s().forwardRef(function(e,t){return(0,c.jsxs)("div",{className:"blueprints-demo-generated",ref:t,role:"status",children:[(0,c.jsx)(o.E,{name:"php"}),(0,c.jsx)("p",{className:"blueprints-demo-generated__text",children:(0,i.sprintf)((0,i.__)("Snippet “%s” has been generated.","code-snippets"),a.R0)})]})});l.displayName="GeneratedNotice"},3807(e,t,n){"use strict";n.d(t,{t:()=>i});var r=n(7723),s={general:{step:(0,r.__)("Step 1 of 3","code-snippets"),title:(0,r.__)("Name the shortcode","code-snippets"),body:(0,r.__)("Every blueprint starts with the basics — the tag you type into a post, and the function that powers it.","code-snippets")},attributes:{step:(0,r.__)("Step 2 of 3","code-snippets"),title:(0,r.__)("Add the attributes","code-snippets"),body:(0,r.__)('Attributes become the values you pass in, like [staff_profile name="Jane Doe"], each with a fallback default.',"code-snippets")},output:{step:(0,r.__)("Step 3 of 3","code-snippets"),title:(0,r.__)("Decide what it renders","code-snippets"),body:(0,r.__)("This is the PHP that runs whenever the shortcode appears. The blueprint wraps it in everything else it needs.","code-snippets")},generating:{step:(0,r.__)("Generating","code-snippets"),title:(0,r.__)("Building the snippet","code-snippets"),body:(0,r.__)("Pro turns the whole form into a finished, working snippet — no boilerplate to write yourself.","code-snippets")},generated:{step:(0,r.__)("Done","code-snippets"),title:(0,r.__)("Your snippet is ready","code-snippets"),body:(0,r.__)("In Pro the finished PHP appears here, ready to review and save to your site.","code-snippets")}},i=function(e){return s[e]}},1942(e,t,n){"use strict";n.d(t,{$y:()=>o,R0:()=>s,Sx:()=>a,Z4:()=>i});var r=n(7723),s=(0,r.__)("Create a Shortcode","code-snippets"),i=(0,r.__)("Create a custom shortcode to display dynamic content using a simple tag.","code-snippets"),o=[{id:"general",title:(0,r.__)("General","code-snippets"),fields:[{name:"functionName",label:(0,r.__)("Function Name","code-snippets"),type:"text",value:"render_staff_profile",required:!0,description:(0,r.__)("The callback function name for your shortcode.","code-snippets")},{name:"shortcodeTag",label:(0,r.__)("Shortcode Tag","code-snippets"),type:"text",value:"staff_profile",required:!0,description:(0,r.__)("The shortcode tag used in content (e.g., [my_shortcode]). Lowercase, no spaces.","code-snippets")},{name:"shortcodeDescription",label:(0,r.__)("Description","code-snippets"),type:"text",value:(0,r.__)("Displays a staff member card with a name and role.","code-snippets"),description:(0,r.__)("Optional description for documentation purposes.","code-snippets")},{name:"textDomain",label:(0,r.__)("Text Domain","code-snippets"),type:"text",value:"code-snippets-blueprints",description:(0,r.__)("Translation text domain. Optional.","code-snippets")},{name:"isEnclosing",label:(0,r.__)("Enclosing Shortcode","code-snippets"),type:"select",value:(0,r.__)("No (self-closing)","code-snippets"),required:!0,description:(0,r.__)("Enclosing shortcodes wrap content: [shortcode]content[/shortcode]","code-snippets")},{name:"supportsNestedShortcodes",label:(0,r.__)("Support Nested Shortcodes","code-snippets"),type:"select",value:(0,r.__)("No","code-snippets"),required:!0,description:(0,r.__)("Process shortcodes within the content using do_shortcode().","code-snippets")}]},{id:"attributes",title:(0,r.__)("Attributes","code-snippets"),description:(0,r.__)("Add shortcode attributes (name and default value). Use $atts in your output code to read them.","code-snippets"),fields:[],repeater:{label:(0,r.__)("Shortcode attributes","code-snippets"),addLabel:(0,r.__)("Add attribute","code-snippets"),columns:[{name:"name",label:(0,r.__)("Attribute name","code-snippets"),type:"text",value:""},{name:"default",label:(0,r.__)("Default value","code-snippets"),type:"text",value:""},{name:"type",label:(0,r.__)("Attribute type","code-snippets"),type:"select",value:""}],rows:[{id:"name",values:["name","Jane Doe",(0,r.__)("Text","code-snippets")]},{id:"role",values:["role","Director",(0,r.__)("Text","code-snippets")]}]}},{id:"output",title:(0,r.__)("Output","code-snippets"),fields:[{name:"useOutputBuffering",label:(0,r.__)("Use Output Buffering","code-snippets"),type:"select",value:(0,r.__)("No (use return statement)","code-snippets"),required:!0,description:(0,r.__)("Enable output buffering to capture echoed content instead of returning.","code-snippets")},{name:"shortcodeCode",label:(0,r.__)("Shortcode Code","code-snippets"),type:"textarea",value:"// Build the card markup from the shortcode attributes.\nreturn sprintf(\n\t'<div class=\"staff-profile\"><h3>%s</h3><p>%s</p></div>',\n\tesc_html( $atts['name'] ),\n\tesc_html( $atts['role'] )\n);",required:!0,description:(0,r.__)("The PHP code that generates the shortcode output. Use $atts for attributes and $content for enclosed content.","code-snippets")}]}],a=function(e){var t;return null!==(t=o.find(function(t){return t.id===e}))&&void 0!==t?t:o[0]}},6333(e,t,n){"use strict";n.d(t,{N:()=>s});var r=["idle","general","attributes","output","generating","generated","finished"],s=function(e,t){return r.indexOf(e)>=r.indexOf(t)}},6200(e,t,n){"use strict";n.d(t,{h:()=>l});var r=n(3453),s=n(1609),i=n(1942),o={general:4500,attributes:4500,output:4800,generating:3600,generated:3e3},a={general:"attributes",attributes:"output",output:"generating",generating:"generated",generated:"finished"},c=function(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches},l=function(){var e=(0,s.useMemo)(c,[]),t=(0,s.useState)("idle"),n=(0,r.A)(t,2),l=n[0],d=n[1],u=(0,s.useState)(i.$y[0].id),p=(0,r.A)(u,2),f=p[0],h=p[1],m=(0,s.useState)(!1),v=(0,r.A)(m,2),b=v[0],g=v[1],y=(0,s.useRef)([]),_=(0,s.useCallback)(function(){y.current.forEach(window.clearTimeout),y.current=[]},[]);(0,s.useEffect)(function(){return function(){y.current.forEach(window.clearTimeout)}},[]);var j=(0,s.useCallback)(function(t){h(function(n){return n===t||(g(!0),y.current.push(window.setTimeout(function(){h(t),g(!1)},e?0:220))),n})},[e]),w=(0,s.useCallback)(function(t){var n;d(t),i.$y.some(function(e){return e.id===t})&&j(t);var r=a[t];if(r){var s=e?250:null!==(n=o[t])&&void 0!==n?n:3e3;y.current.push(window.setTimeout(function(){return w(r)},s))}},[j,e]),x=(0,s.useCallback)(function(){_(),w("general")},[w,_]),O=(0,s.useCallback)(function(){_(),d("idle"),g(!1),h(i.$y[0].id),y.current.push(window.setTimeout(function(){return w("general")},250))},[w,_]),A=(0,s.useCallback)(function(){_(),d("finished"),g(!1),h(i.$y[i.$y.length-1].id)},[_]);return{stage:l,activeSection:f,isFading:b,sectionsBrowsable:"finished"===l,hasStarted:"idle"!==l,isFinished:"finished"===l,reducedMotion:e,selectSection:j,play:x,skip:A,replay:O}}},6007(e,t,n){"use strict";n.d(t,{c:()=>A});var r=n(4467),s=n(3453),i=n(1609),o=n(7723),a=n(7871),c=n(3988),l=n(7834),d=n(7738),u=n(6094),p=n(7894),f=n(1075),h=n(7166),m=n(6010),v=n(1239),b=n(5998),g=n(8552),y=n(790);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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){(0,r.A)(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 w=".cloud-library-snippets tbody tr.demo-featured-row",x={library:{target:".cloud-library-snippets",padding:6},preview:{target:"".concat(w," .demo-preview-button"),padding:6},download:{target:"".concat(w," .demo-action-button"),padding:6},synced:{target:w,padding:4}},O={library:(0,o.__)("Showing the snippets saved in your cloud.","code-snippets"),preview:(0,o.__)("Previewing the snippet code.","code-snippets"),download:(0,o.__)("Downloading the snippet to your site.","code-snippets"),synced:(0,o.__)("The snippet is now synced with your cloud.","code-snippets"),finished:(0,o.__)("Demo complete.","code-snippets")},A=function(){var e=(0,g.$)(),t=e.stage,n=e.hasStarted,r=e.isFinished,_=e.reducedMotion,w=e.play,A=e.skip,S=e.replay,P=(0,i.useMemo)(b.p,[]),N=(0,i.useState)(),k=(0,s.A)(N,2),E=k[0],C=k[1],D=P.find(function(e){return b.z===e.id});(0,i.useEffect)(function(){C("preview"===t?D:void 0)},[D,t]);var T=(0,i.useRef)(null);return(0,i.useEffect)(function(){var e;r&&(null===(e=T.current)||void 0===e||e.scrollIntoView({behavior:_?"auto":"smooth",block:"end"}))},[r,_]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.O,{}),(0,y.jsx)(u.G,{title:(0,o.__)("Cloud Library","code-snippets"),description:(0,o.__)("A guided walkthrough of the Pro Cloud Library. Press play and watch a snippet move from your cloud onto this site.","code-snippets"),hasStarted:n,isFinished:r,onPlay:w,onSkip:A,onReplay:S}),(0,y.jsxs)("div",{className:"cloud-library-demo",children:[(0,y.jsx)("div",{className:"screen-reader-text","aria-live":"polite",children:O[t]}),(0,y.jsx)(d.e,{callout:(0,v.t)(t)}),(0,y.jsx)(p.e,j({},x[t])),(0,y.jsx)("div",{className:"cloud-library-snippets snippets-list-view",children:(0,y.jsx)(c.VZ,{fixed:!0,striped:!0,items:P,columns:(0,m.P)({stage:t,onPreview:C}),getKey:function(e){return e.id},rowClassName:function(e){return b.z===e.id?"demo-featured-row":""}})}),r&&(0,y.jsx)("div",{ref:T,className:"cloud-library-demo__closing",children:(0,y.jsxs)(f.T,{title:(0,o.__)("That was a demo — your cloud travels with you","code-snippets"),onReplay:S,children:[(0,y.jsx)("p",{children:(0,o.__)("The whole walkthrough was scripted and ran inside this plugin. These snippets are examples, and nothing was downloaded or saved.","code-snippets")}),(0,y.jsx)("p",{children:(0,o.__)("With Code Snippets Pro your Cloud Library is available on every site you connect, so a snippet written once can be reused everywhere and kept in sync.","code-snippets")})]})}),E&&(0,y.jsx)(h.M3,{title:E.name,code:E.code,type:(0,a.yo)(E),onRequestClose:function(){return C(void 0)}})]})]})}},1239(e,t,n){"use strict";n.d(t,{t:()=>i});var r=n(7723),s={library:{step:(0,r.__)("Step 1 of 4","code-snippets"),title:(0,r.__)("Your whole cloud, in one place","code-snippets"),body:(0,r.__)("Every snippet and bundle saved to your Code Snippets Cloud account is listed here, on every site you connect — so work you did once is never more than a click away.","code-snippets")},preview:{step:(0,r.__)("Step 2 of 4","code-snippets"),title:(0,r.__)("Read it before you take it","code-snippets"),body:(0,r.__)("Preview shows the full code without leaving the page, so you can check exactly what a snippet does before it touches your site.","code-snippets")},download:{step:(0,r.__)("Step 3 of 4","code-snippets"),title:(0,r.__)("Download in one click","code-snippets"),body:(0,r.__)("The snippet lands in your snippets table straight away — and inactive, so nothing runs until you have looked it over and switched it on.","code-snippets")},synced:{step:(0,r.__)("Step 4 of 4","code-snippets"),title:(0,r.__)("Kept in sync","code-snippets"),body:(0,r.__)("Once downloaded the row shows as synced, with an edit link instead of a download button. Change it here or in the cloud and the two are kept together.","code-snippets")}},i=function(e){return s[e]}},6010(e,t,n){"use strict";n.d(t,{P:()=>x});var r=n(1609),s=n(7723),i=n(8443),o=n(6942),a=n.n(o),c=n(7871),l=n(7947),d=n(4888),u=n(2449),p=n(9345),f=n(3336),h=n(1973),m=n(6166),v=n(5998),b=n(2133),g=n(790),y=function(e,t){return v.z===e.id&&(0,b.N)(t,"synced")},_=function(e){var t=e.snippet,n=e.stage,r=y(t,n),i=r?(0,s.__)("Synced to Cloud","code-snippets"):(0,s.__)("Available in Cloud","code-snippets"),o=function(){return(0,g.jsx)("span",{className:"cloud-sync-indicator",role:"img","aria-label":i,children:r?(0,g.jsx)(m.f,{}):(0,g.jsx)(h.s,{})})};return(0,g.jsx)(f.m,{inline:!0,label:i,icon:(0,g.jsx)(o,{}),children:i})},j=function(e){var t=e.snippet;return t.tags.map(function(e,n){return(0,g.jsxs)(r.Fragment,{children:[e,n<t.tags.length-1?", ":""]},e)})},w=function(e){var t=e.snippet,n=e.stage,r=e.onPreview,i=v.z===t.id;return(0,g.jsxs)("div",{className:"cloud-snippet-action-buttons",children:[(0,g.jsx)(u.$,{secondary:!0,className:a()("demo-preview-button",{"demo-click":i&&"preview"===n}),onClick:function(){return r(t)},children:(0,s.__)("Preview","code-snippets")}),y(t,n)?(0,g.jsx)(u.$,{secondary:!0,className:"demo-action-button","aria-hidden":"true",tabIndex:-1,children:(0,s.__)("Edit","code-snippets")}):(0,g.jsx)(u.$,{primary:!0,"aria-hidden":"true",tabIndex:-1,className:a()("cloud-snippet-download demo-action-button",{"demo-click":i&&"download"===n}),children:(0,s.__)("Download","code-snippets")})]})},x=function(e){var t=e.stage,n=e.onPreview;return[{id:"state",title:(0,g.jsx)(h.s,{role:"img","aria-label":(0,s.__)("Sync Status","code-snippets")}),render:function(e){return(0,g.jsx)(_,{snippet:e,stage:t})}},{id:"name",title:(0,s.__)("Snippet Name","code-snippets"),isPrimary:!0,sortedValue:function(e){return(0,c.lO)(e).toLowerCase()},render:function(e){return(0,g.jsx)("strong",{children:e.name})}},{id:"type",title:(0,s.__)("Type","code-snippets"),sortedValue:function(e){return(0,c.yo)(e)},render:function(e){return(0,g.jsx)(d.E,{name:(0,c.yo)(e)})}},{id:"status",title:(0,s.__)("Status","code-snippets"),sortedValue:function(e){return e.status},render:function(e){return(0,g.jsx)(p.Jv,{status:e.status})}},{id:"desc",title:(0,s.__)("Description","code-snippets"),render:function(e){return(0,g.jsx)("div",{className:"snippet-description-content",children:(0,l.UT)((0,l.Kq)(e.description))})}},{id:"tags",title:(0,s.__)("Tags","code-snippets"),render:function(e){return(0,g.jsx)(j,{snippet:e})}},{id:"date",title:(0,s.__)("Updated","code-snippets"),sortedValue:function(e){return new Date(e.updated).toISOString()},render:function(e){return(0,g.jsx)("span",{className:"modified-column-content",title:e.updated,children:(0,g.jsx)("time",{dateTime:e.updated,children:(0,i.humanTimeDiff)(e.updated,void 0)})})}},{id:"actions",title:(0,g.jsx)("span",{className:"screen-reader-text",children:(0,s.__)("Actions","code-snippets")}),render:function(e){return(0,g.jsx)(w,{snippet:e,stage:t,onPreview:n})}}]}},5998(e,t,n){"use strict";n.d(t,{p:()=>d,z:()=>a});var r=n(4467),s=n(7723),i=n(4148);function o(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 a=4821,c=(0,s.__)("My Code Vault","code-snippets"),l=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({id:0,slug:"",name:"",description:"",code:"",tags:[],scope:"global",codevault:c,total_votes:0,vote_count:0,wp_tested:"6.8",status:i.i.Private,created:"2026-05-04T09:12:00Z",updated:"2026-07-22T14:38:00Z",revision:1,is_owner:!0,local_id:null,update_available:!1},e)},d=function(){return[l({id:a,slug:"sender-name-and-address",name:(0,s.__)("Fix outgoing email sender name","code-snippets"),description:(0,s.__)("Sends site email from the site name and a no-reply address on your own domain, instead of “WordPress”.","code-snippets"),code:"add_filter( 'wp_mail_from_name', function () {\n\treturn get_bloginfo( 'name' );\n} );\n\nadd_filter( 'wp_mail_from', function ( $from ) {\n\t$domain = wp_parse_url( home_url(), PHP_URL_HOST );\n\n\treturn $domain ? 'no-reply@' . str_ireplace( 'www.', '', $domain ) : $from;\n} );",tags:["email","admin"],scope:"global",status:i.i.Pro_Verified,updated:"2026-08-11T10:04:00Z"}),l({id:4788,slug:"disable-comments-everywhere",name:(0,s.__)("Disable comments everywhere","code-snippets"),description:(0,s.__)("Closes comments on every post type and hides the comment menus from the admin.","code-snippets"),code:"add_filter( 'comments_open', '__return_false', 20, 2 );",tags:["comments","cleanup"],scope:"global",status:i.i.Private,updated:"2026-07-02T16:20:00Z"}),l({id:4712,slug:"checkout-field-styles",name:(0,s.__)("Checkout field styles","code-snippets"),description:(0,s.__)("Tidies the spacing and focus states on the checkout form fields.","code-snippets"),code:[".woocommerce-checkout .form-row input:focus {","\toutline: 2px solid #2271b1;","}"].join("\n"),tags:["woocommerce","styles"],scope:"site-css",status:i.i.Public,updated:"2026-06-18T08:55:00Z"}),l({id:4655,slug:"lazy-load-embeds",name:(0,s.__)("Lazy load video embeds","code-snippets"),description:(0,s.__)("Defers YouTube and Vimeo iframes until they are scrolled into view.","code-snippets"),code:["add_filter( 'embed_oembed_html', function ( $html ) {","\treturn str_replace( '<iframe', '<iframe loading=\"lazy\"', $html );","} );"].join("\n"),tags:["performance"],scope:"front-end",status:i.i.AI_Verified,updated:"2026-05-29T11:47:00Z"})]}},2133(e,t,n){"use strict";n.d(t,{N:()=>s});var r=["idle","library","preview","download","synced","finished"],s=function(e,t){return r.indexOf(e)>=r.indexOf(t)}},8552(e,t,n){"use strict";n.d(t,{$:()=>c});var r=n(3453),s=n(1609),i={library:4800,preview:5400,download:4200,synced:4800},o={library:"preview",preview:"download",download:"synced",synced:"finished"},a=function(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches},c=function(){var e=(0,s.useMemo)(a,[]),t=(0,s.useState)("idle"),n=(0,r.A)(t,2),c=n[0],l=n[1],d=(0,s.useRef)([]),u=(0,s.useCallback)(function(){d.current.forEach(window.clearTimeout),d.current=[]},[]);(0,s.useEffect)(function(){return function(){d.current.forEach(window.clearTimeout)}},[]);var p=(0,s.useCallback)(function(t){var n;l(t);var r=o[t];if(r){var s=e?250:null!==(n=i[t])&&void 0!==n?n:3e3;d.current.push(window.setTimeout(function(){return p(r)},s))}},[e]),f=(0,s.useCallback)(function(){u(),p("library")},[p,u]),h=(0,s.useCallback)(function(){u(),l("idle"),d.current.push(window.setTimeout(function(){return p("library")},250))},[p,u]),m=(0,s.useCallback)(function(){u(),l("finished")},[u]);return{stage:c,hasStarted:"idle"!==c,isFinished:"finished"===c,reducedMotion:e,play:f,skip:m,replay:h}}},9144(e,t,n){"use strict";n.d(t,{U:()=>F});var r=n(467),s=n(4467),i=n(45),o=n(3453),a=n(4756),c=n.n(a),l=n(7723),d=n(1609),u=n(6942),p=n.n(u),f=n(6427),h=n(1240),m=n(2456),v=n(7871),b=n(6418),g=n(6172),y=n(2677),_=n(1971),j=n(1192),w=n(7203),x=n(8470),O=n(790),A=["snippetView"],S=["which","doSearch","isSearching","searchResults"];function P(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){(0,s.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var k=function(){var e=(0,w.LL)(),t=e.searchParams,n=e.updateSearchParams,r=e.isSearching,s=e.doSearch,i=(0,d.useId)(),a=(0,d.useState)(t.query),c=(0,o.A)(a,2),u=c[0],p=c[1];return(0,O.jsxs)("form",{className:"cloud-search-form",onSubmit:function(e){e.preventDefault(),s({query:u})},children:[(0,O.jsx)("label",{htmlFor:i,className:"screen-reader-text",children:(0,l.__)("Search method","code-snippets")}),(0,O.jsxs)("select",{id:i,value:t.method,onChange:function(e){return n({method:"codevault"===e.target.value?"codevault":"term"})},children:[(0,O.jsx)("option",{value:"term",children:(0,l.__)("Search by keyword","code-snippets")}),(0,O.jsx)("option",{value:"codevault",children:(0,l.__)("Name of library","code-snippets")})]}),(0,O.jsxs)("div",{className:"cloud-search-query",children:[(0,O.jsx)("input",{id:"cloud-search-query",type:"search",value:u,"aria-label":(0,l.__)("Search query","code-snippets"),onChange:function(e){return p(e.target.value)},placeholder:(0,l.__)("e.g. Remove unused JavaScript…","code-snippets")}),r&&(0,O.jsx)("span",{role:"status","aria-live":"polite",children:(0,O.jsx)("span",{className:"screen-reader-text",children:(0,l.__)("Searching…","code-snippets")})})]}),(0,O.jsx)("button",{type:"submit",className:"button button-primary cloud-search-submit",disabled:r,children:r?(0,O.jsx)(f.Spinner,{}):(0,l.__)("Search Cloud Library","code-snippets")})]})},E=function(e){var t=e.snippets,n=e.selected,r=e.setSelected,s=(0,w.LL)().doSearch;return(0,O.jsx)("ul",{className:p()("cloud-search-results","code-snippets-cards",{"has-selection":t.some(function(e){return n.has(e.id)})}),children:t.map(function(e){return(0,O.jsx)(_.J,{snippet:e,author:(0,O.jsx)(_.U,{codevaultSlug:e.codevault}),isSelected:n.has(e.id),onSnippetDownloaded:function(){return s()},onSelectedChange:(0,v.rA)(e)?function(t){r(function(n){var r=new Set(n);return t?r.add(e.id):r.delete(e.id),r})}:void 0},e.id)})})},C=[{key:"download",label:(0,l.__)("Download","code-snippets")}],D=function(e){var t=e.snippetView,n=(0,i.A)(e,A);return"card"===t?(0,O.jsx)(E,N({},n)):(0,O.jsx)(j.k,N({},n))},T=function(e){var t=e.which,n=e.doSearch,r=e.isSearching,s=e.searchResults,o=(0,i.A)(e,S);return(0,O.jsx)(b.Aj,N({which:t,disabled:r,totalItems:s.totalItems,totalPages:s.totalPages,currentPage:s.page,setCurrentPage:function(e){return n({page:e})}},o))},R=function(e){var t=e.snippetView,n=e.setSnippetView,s=(0,h._)().api,i=(0,w.LL)(),a=i.searchResults,l=i.isSearching,u=i.doSearch,p=function(e){var t=(0,d.useState)(new Set),n=(0,o.A)(t,2),r=n[0],s=n[1];return(0,d.useEffect)(function(){s(new Set)},[e]),{selected:r,setSelected:s}}(null==a?void 0:a.snippets),f=p.selected,b=p.setSelected;if(!a)return null;var g=function(){var e=(0,r.A)(c().mark(function e(t,n){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("download"!==t){e.next=4;break}return e.next=3,Promise.all(a.snippets.filter(function(e){return n.has(e.id)&&(0,v.rA)(e)}).map(function(e){var t=e.id;return s.post("".concat(m.St.cloud.snippets,"/").concat(t,"/download"))}));case 3:u();case 4:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();return(0,O.jsxs)("div",{className:"snippets-list-view",children:[(0,O.jsx)(T,{which:"top",isSearching:l,searchResults:a,selected:f,setSelected:b,doSearch:u,actions:C,doAction:g,selectAllKeys:"card"===t?a.snippets.filter(function(e){return(0,v.rA)(e)}).map(function(e){return e.id}):void 0,extraTableNav:function(){return(0,O.jsx)(x.i,{})},endTableNav:function(e){return"top"===e?(0,O.jsx)(y.v,{snippetView:t,setSnippetView:n}):null}}),(0,O.jsx)(D,{snippets:a.snippets,snippetView:t,selected:f,setSelected:b}),(0,O.jsx)(T,{which:"bottom",isSearching:l,searchResults:a,selected:f,setSelected:b,doSearch:u})]})},I=function(e){var t=e.snippetView,n=e.setSnippetView,r=(0,w.LL)(),s=r.searchResults,i=r.searchParams;return s?0<s.page&&0===s.snippets.length?(0,O.jsx)("div",{className:"banner banner-neutral no-results",children:(0,O.jsx)("p",{children:"codevault"===i.method?(0,l.__)("Could not find a codevault with that name. Please try again.","code-snippets"):(0,l.__)("No snippets could be found with that search term. Please try again.","code-snippets")})}):s.snippets.length?(0,O.jsxs)(O.Fragment,{children:[s.isFeatured?(0,O.jsx)("h2",{className:"cloud-featured-heading",children:(0,l.__)("Featured Snippets","code-snippets")}):(0,O.jsx)("h2",{className:"cloud-snippets-heading",children:(0,l.__)("Search Results","code-snippets")}),(0,O.jsx)(R,{snippetView:t,setSnippetView:n})]}):null:null},L=function(){var e=(0,w.LL)(),t=e.isErrored,n=e.isLoading;return t||n?(0,O.jsx)(g.A,{isLoading:n,errorMessage:t?(0,l.__)("An error occurred while fetching search results. Please try again.","code-snippets"):void 0,loadingNotice:(0,l.__)("Loading snippets from cloud…","code-snippets"),noticeLabel:(0,l.__)("Community snippets status","code-snippets")}):null},F=function(e){var t=e.snippetView,n=e.setSnippetView;return(0,O.jsxs)("div",{className:"cloud-search",children:[(0,O.jsx)(k,{}),(0,O.jsx)(L,{}),(0,O.jsx)(I,{snippetView:t,setSnippetView:n})]})}},1192(e,t,n){"use strict";n.d(t,{k:()=>y});var r=n(9394),s=n(3453),i=n(7723),o=n(1609),a=n(7871),c=n(7947),l=n(4888),d=n(2449),u=n(6254),p=n(9345),f=n(7166),h=n(7203),m=n(790),v=function(e){var t=e.snippet,n=(0,h.LL)().doSearch,r=(0,o.useState)(!1),v=(0,s.A)(r,2),b=v[0],g=v[1];return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("td",{className:"column-name column-primary",children:(0,m.jsx)("strong",{children:(0,m.jsx)("button",{type:"button",className:"cloud-table-name-button",title:(0,i.__)("Preview this snippet","code-snippets"),onClick:function(){return g(!0)},children:t.name})})}),(0,m.jsx)("td",{className:"column-type",children:(0,m.jsx)(l.E,{name:(0,a.yo)(t)})}),(0,m.jsx)("td",{className:"column-status",children:(0,m.jsx)(p.Jv,{status:t.status})}),(0,m.jsx)("td",{className:"column-desc",children:(0,m.jsx)("div",{className:"cloud-table-description",children:(0,c.UT)((0,c.Kq)(t.description))})}),(0,m.jsxs)("td",{className:"column-actions",children:[(0,m.jsxs)("div",{className:"cloud-snippet-action-buttons",children:[(0,m.jsx)(d.$,{secondary:!0,onClick:function(){return g(!0)},children:(0,i.__)("Preview","code-snippets")}),(0,m.jsx)(u.l,{snippet:t,onDownloaded:n})]}),b&&(0,m.jsx)(f.Iw,{snippet:t,setIsOpen:g,onDownloaded:n})]})]})},b=function(e){var t=e.availableIds,n=e.selectedIds,s=e.setSelectedIds;return(0,m.jsx)("td",{className:"column-cb check-column",children:(0,m.jsx)("input",{id:"cb-select-all-cloud-snippets",type:"checkbox",checked:0<t.length&&t.every(function(e){return n.has(e)}),disabled:0===t.length,title:0===t.length?(0,i.__)("Nothing on this page can be downloaded.","code-snippets"):void 0,onChange:function(e){return s(function(n){return new Set(e.target.checked?[].concat((0,r.A)(n),(0,r.A)(t)):(0,r.A)(n).filter(function(e){return!t.includes(e)}))})},"aria-label":(0,i.__)("Select all downloadable snippets","code-snippets")})})},g=function(e){var t=e.snippet,n=e.selected,s=e.setSelected,o=function(e){return e.local_id?(0,i.__)("Already in your library.","code-snippets"):(0,a.rA)(e)?void 0:(0,i.__)("Requires Code Snippets Pro.","code-snippets")}(t);return(0,m.jsx)("th",{scope:"row",className:"check-column",children:(0,m.jsx)("input",{id:"cb-select-".concat(t.id),type:"checkbox",name:"checked[]",checked:!o&&n.has(t.id),disabled:!!o,title:o,"aria-label":o?(0,i.sprintf)((0,i.__)("%1$s cannot be selected: %2$s","code-snippets"),t.name,o):(0,i.sprintf)((0,i.__)("Select %s","code-snippets"),t.name),onChange:function(e){return s(function(n){return new Set(e.target.checked?[].concat((0,r.A)(n),[t.id]):(0,r.A)(n).filter(function(e){return e!==t.id}))})}})})},y=function(e){var t=e.snippets,n=e.selected,r=e.setSelected;return(0,m.jsxs)("table",{className:"wp-list-table widefat fixed striped cloud-snippets-table",children:[(0,m.jsx)("thead",{children:(0,m.jsxs)("tr",{children:[n&&r&&(0,m.jsx)(b,{selectedIds:n,setSelectedIds:r,availableIds:t.filter(function(e){return(0,a.rA)(e)}).map(function(e){return e.id})}),(0,m.jsx)("th",{scope:"col",className:"column-name column-primary",children:(0,i.__)("Name","code-snippets")}),(0,m.jsx)("th",{scope:"col",className:"column-type",children:(0,i.__)("Type","code-snippets")}),(0,m.jsx)("th",{scope:"col",className:"column-status",children:(0,i.__)("Status","code-snippets")}),(0,m.jsx)("th",{scope:"col",className:"column-desc",children:(0,i.__)("Description","code-snippets")}),(0,m.jsx)("th",{scope:"col",className:"column-actions",children:(0,m.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Actions","code-snippets")})})]})}),(0,m.jsx)("tbody",{children:t.map(function(e){return(0,m.jsxs)("tr",{children:[n&&r&&(0,m.jsx)(g,{snippet:e,selected:n,setSelected:r}),(0,m.jsx)(v,{snippet:e})]},e.id)})})]})}},7265(e,t,n){"use strict";n.d(t,{J:()=>_});var r=n(4467),s=n(3453),i=n(1609),o=n(7723),a=n(1240),c=n(3733),l=n(6492),d=n(6842),u=n(7834),p=n(8692),f=n(921),h=n(7882),m=n(7203),v=n(9144),b=n(790),g=[{name:"snippets",label:(0,o.__)("Snippets","code-snippets")},{name:"bundles",label:(0,o.__)("Bundles","code-snippets"),pro:!0}],y=function(){var e=(0,i.useState)(function(){return(0,p.K)(g,"tab")}),t=(0,s.A)(e,2),n=t[0],a=t[1],f=(0,c.e)(),y=f.snippetView,_=f.setSnippetView,j=(0,m.LL)().searchResults;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.M,{className:"community-cloud-nav",ariaLabel:(0,o.__)("Community Cloud types","code-snippets"),tabs:g,getTabCount:function(e){return"snippets"===e.name?null==j?void 0:j.totalItems:void 0},currentTab:n,setCurrentTab:function(e){(0,d.ev)((0,r.A)({},"tab",e.name)),a(e)}}),(0,b.jsx)(u.O,{hidden:"bundles"===n.name}),(!n.pro||(0,l.QX)())&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"snippets-page-header",children:(0,b.jsx)("h1",{children:(0,o.sprintf)((0,o.__)("Community Cloud: %s","code-snippets"),n.label)})}),(0,b.jsx)("hr",{className:"wp-header-end"}),(0,b.jsx)("p",{className:"snippets-page-description",children:(0,o.__)("Search the community cloud and download user-shared snippets directly to your site.","code-snippets")})]}),function(){switch(n.name){case"snippets":return(0,b.jsx)(v.U,{snippetView:y,setSnippetView:_});case"bundles":return(0,b.jsx)(h.p,{})}}()]})},_=function(){return(0,b.jsx)(a.i,{children:(0,b.jsx)(f.J,{children:(0,b.jsx)(m.$B,{children:(0,b.jsx)(y,{})})})})}},8470(e,t,n){"use strict";n.d(t,{i:()=>l});var r=n(4467),s=n(7723),i=n(1609),o=n(7203),a=n(790),c=[{paramName:"category",filterName:"categories",label:(0,s.__)("Snippet Category","code-snippets"),allOptionLabel:(0,s.__)("All Categories","code-snippets")},{paramName:"type",filterName:"types",label:(0,s.__)("Snippet Type","code-snippets"),allOptionLabel:(0,s.__)("All Types","code-snippets")},{paramName:"status",filterName:"statuses",label:(0,s.__)("Snippet Status","code-snippets"),allOptionLabel:(0,s.__)("All Statuses","code-snippets")}],l=function(){var e=(0,o.LL)(),t=e.availableFilters,n=e.searchParams,s=e.doSearch,l=c.filter(function(e){var n=e.filterName;return t[n]&&0<t[n].length});return 0<l.length?(0,a.jsx)("div",{className:"alignleft actions",children:l.map(function(e){var o,c=e.label,l=e.allOptionLabel,d=e.filterName,u=e.paramName;return(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"cloud-search-".concat(d),className:"screen-reader-text",children:c}),(0,a.jsxs)("select",{id:"cloud-search-".concat(d),className:"cloud-search-category-filter",value:n[u],onChange:function(e){return s((0,r.A)({},u,function(e,t,n){if(""!==n){if("number"==typeof t[e]){var r=Number(n);return isNaN(r)?void 0:r}return n}}(u,n,e.target.value)))},children:[(0,a.jsx)("option",{value:"",children:l}),null===(o=t[d])||void 0===o?void 0:o.map(function(e){return(0,a.jsx)("option",{value:e.id,children:e.name},e.id)})]})]},d)})}):null}},7203(e,t,n){"use strict";n.d(t,{$B:()=>D,LL:()=>C});var r,s,i,o,a=n(3453),c=n(2284),l=n(4467),d=n(1609),u=n(9028),p=n(1240),f=n(2456),h=n(6842),m=n(790);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 b(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){(0,l.A)(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 g=Math.min(null!==(r=null!==(s=null===(i=window.CODE_SNIPPETS_MANAGE)||void 0===i?void 0:i.cloudSearchPerPage)&&void 0!==s?s:null===(o=window.CODE_SNIPPETS_MANAGE)||void 0===o?void 0:o.snippetsPerPage)&&void 0!==r?r:10,100),y={SEARCH_QUERY:f.St.cloud.snippets,FEATURED:"".concat(f.St.cloud.snippets,"/featured")},_="paged",j="type",w="status",x="category",O=["term","codevault","ai"],A=function(){var e,t,n,r,s,i,o=Number(null!==(e=(0,h.UY)(_))&&void 0!==e?e:1),a=null!==(t=(0,h.UY)("s"))&&void 0!==t?t:"",c=null!==(n=(0,h.UY)(j))&&void 0!==n?n:"",l=null!==(r=(0,h.UY)(w))&&void 0!==r?r:0,d=(0,h.UY)("by"),u=null!==(s=(0,h.UY)(x))&&void 0!==s?s:"";return{page:isNaN(o)?1:o,type:c,query:a,status:Number(l),method:(i=d,function(e){return O.some(function(t){return t===e})}(i)?i:"term"),category:u}},S=function(e){return"object"===(0,c.A)(e)&&null!==e&&"id"in e&&"number"==typeof e.id&&"name"in e&&"string"==typeof e.name},P=function(e){return Array.isArray(e)?e.filter(S):void 0},N=(0,u.h)("useCloudSearch"),k=(0,a.A)(N,2),E=k[0],C=k[1],D=function(e){var t=e.children,n=function(){var e=(0,p._)().api,t=function(){var e=(0,d.useRef)(0),t=(0,d.useCallback)(function(){return e.current+=1,e.current},[]);return{isCurrentRequest:(0,d.useCallback)(function(t){return t===e.current},[]),nextRequestId:t}}(),n=t.isCurrentRequest,r=t.nextRequestId,s=(0,d.useState)(!1),i=(0,a.A)(s,2),o=i[0],l=i[1],u=(0,d.useState)(!1),f=(0,a.A)(u,2),m=f[0],v=f[1],_=(0,d.useState)(),j=(0,a.A)(_,2),w=j[0],x=j[1],O=(0,d.useState)({}),A=(0,a.A)(O,2),S=A[0],N=A[1];return{isLoading:m,isSearching:o,searchResults:w,availableFilters:S,makeSearchRequest:(0,d.useCallback)(function(t){var s=r(),i=""===t.query.trim();v(!0),l(!i);var o=i?y.FEATURED:y.SEARCH_QUERY;e.getResponse(function(e,t){var n=t.query,r=t.type,s=t.method,i=t.status,o=t.category,a=t.page;return(0,h.c$)(e,{query:n,searchByCodevault:"codevault"===s||void 0,searchMethod:"ai"===s?"ai":void 0,per_page:g,type:r||void 0,category:o||void 0,status:i||void 0,page:a})}(o,t)).then(function(e){n(s)&&(x(function(e,t){var n=e.data;return{page:n.page,isFeatured:t===y.FEATURED,snippets:n.snippets,totalItems:n.total_snippets,totalPages:n.total_pages}}(e,o)),N(function(t){var n,r;return null!==(r=e.data.available_filters,n="object"===(0,c.A)(r)&&r?b(b(b({},"types"in r&&{types:P(r.types)}),"statuses"in r&&{statuses:P(r.statuses)}),"categories"in r&&{categories:P(r.categories)}):void 0)&&void 0!==n?n:t}))}).catch(function(){n(s)&&x(!1)}).finally(function(){n(s)&&(l(!1),v(!1))})},[e,r,n])}}(),r=n.isLoading,s=n.isSearching,i=n.makeSearchRequest,o=n.availableFilters,u=n.searchResults,f=(0,d.useState)(A),v=(0,a.A)(f,2),O=v[0],S=v[1],N=(0,d.useState)(!1),k=(0,a.A)(N,2),C=k[0],D=k[1],T=(0,d.useCallback)(function(e){return S(function(t){return b(b({},t),e)})},[]),R=(0,d.useCallback)(function(e){var t=function(e,t){var n=e.query.trim()!==t.query.trim(),r=e.method!==t.method,s=e.type!==t.type,i=e.status!==t.status,o=e.category!==t.category,a=s||i||o;return n||r?b(b({},e),{},{page:1,type:"",status:0,category:""}):a?b(b({},e),{},{page:1}):e}(b(b({},O),e),O);!function(e){(0,h.ev)((0,l.A)((0,l.A)((0,l.A)((0,l.A)((0,l.A)((0,l.A)({},_,e.page),j,e.type||void 0),"s",e.query||void 0),w,e.status||void 0),"by","codevault"===e.method?"codevault":void 0),x,e.category||void 0))}(t),S(t),i(t)},[i,O]);(0,d.useEffect)(function(){C||(D(!0),i(O))},[i,O,C]);var I=b({doSearch:R,isLoading:r,isSearching:s,searchParams:O,availableFilters:o,updateSearchParams:T},!1===u?{isErrored:!0,searchResults:void 0}:{isErrored:!1,searchResults:u});return(0,m.jsx)(E.Provider,{value:I,children:t})}},2075(e,t,n){"use strict";n.d(t,{x:()=>T});var r=n(4467),s=n(3453),i=n(6942),o=n.n(i),a=n(8443),c=n(6087),l=n(7723),d=n(1609),u=n(2335),p=n(8192),f=n(30),h=n(9595),m=n(3661),v=n(7871),b=n(2449),g=n(8351),y=n(2527),_=n(7166),j=n(3233),w=n(9652),x=n(790);function O(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var S=function(e){var t=e.snippet,n=(0,d.useState)(!1),r=(0,s.A)(n,2),i=r[0],o=r[1];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(b.$,{secondary:!0,onClick:function(){return o(!0)},children:(0,l.__)("Preview","code-snippets")}),i&&(0,x.jsx)(_.FJ,{snippet:t,setIsOpen:o})]})},P=function(e){var t=e.snippet,n=(0,p.q)(),r=(0,f.G)().refreshSnippetsList;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g.Uw,{onSelect:function(){n.create((0,v.m2)(t)).then(r).catch(h.fY)},children:(0,l.__)("Clone","code-snippets")}),(0,x.jsx)(g.Uw,{onSelect:function(){n.export(t).then(function(e){return(0,m.Mc)(e,t)}).catch(h.fY)},children:(0,l.__)("Export","code-snippets")}),(0,x.jsx)(g.Sj,{})]})},N=function(e){var t=e.snippet,n=e.requestDelete,r=(0,p.q)(),s=(0,f.G)().refreshSnippetsList;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g.Sj,{}),t.trashed?(0,x.jsx)(g.Uw,{onSelect:function(){r.restore(t).then(s).catch(h.fY)},children:(0,l.__)("Restore","code-snippets")}):null,(0,x.jsx)(g.Uw,{destructive:!0,onSelect:n,children:t.trashed?(0,l.__)("Delete Permanently","code-snippets"):(0,l.__)("Trash","code-snippets")})]})},k=function(e){var t=e.snippet,n=(0,f.G)().refreshSnippetsList,r=(0,u.S)({snippet:t,onSuccess:n,onError:h.fY}),s=r.requestDelete,i=r.deleteDialogProps;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(g.v$,{label:(0,l.sprintf)((0,l.__)("Actions for %s","code-snippets"),(0,v.lO)(t)),children:[t.trashed?null:(0,x.jsx)(P,{snippet:t}),(0,x.jsxs)(g.Nx,{className:"kebab-menu-priority",children:[(0,x.jsx)("label",{htmlFor:"snippet-".concat(t.id,"-priority"),children:(0,l.__)("Priority","code-snippets")}),(0,x.jsx)(w.db,{snippet:t})]}),(0,v.yq)(t)&&(t.trashed||!t.locked)&&(0,x.jsx)(N,{snippet:t,requestDelete:function(){s()}})]}),(0,x.jsx)(u.K,A({},i))]})},E=function(e){var t=e.snippet;return(0,x.jsxs)(x.Fragment,{children:[(0,v._W)(t)?t.active?(0,x.jsx)("span",{className:"network-active",children:(0,l.__)("Network Active","code-snippets")}):(0,x.jsx)("span",{className:"network-only",children:(0,l.__)("Network Only","code-snippets")}):null,t.trashed?null:(0,x.jsx)(S,{snippet:t}),!t.trashed&&(0,v.yq)(t)?(0,x.jsx)("a",{className:"button button-primary",href:(0,v.l)(t),children:t.locked?(0,l.__)("View","code-snippets"):(0,l.__)("Edit","code-snippets")}):null,(0,v.yq)(t)?(0,x.jsx)(k,{snippet:t}):null]})},C=function(e){var t=e.snippet;return t.modified?(0,x.jsx)("time",{className:"snippet-card-modified",dateTime:t.modified,title:t.modified,children:(0,l.sprintf)((0,l.__)("Modified %s","code-snippets"),(0,a.humanTimeDiff)(t.modified,void 0))}):null},D=function(e){var t=e.snippet;return(0,x.jsxs)("div",{className:"snippet-card-header",children:[(0,x.jsx)(w.ir,{snippet:t}),(0,x.jsx)(w.P2,{snippet:t}),(0,x.jsx)("h3",{children:(0,x.jsx)(w.Xz,{snippet:t})}),(0,x.jsx)(w.ed,{snippet:t})]})},T=function(e){var t=e.snippet,n=e.isSelected,r=e.onSelectedChange,s=(0,j.d)().activeByCondition;return(0,x.jsx)(y.Y,{className:o()("snippet","".concat((0,v.E$)(t,s)?"active":"inactive","-snippet"),"".concat((0,v.yo)(t),"-snippet"),"".concat(t.scope,"-snippet")),isSelected:n,onSelectedChange:r,selectionLabel:(0,l.sprintf)((0,l.__)("Select %s","code-snippets"),(0,v.lO)(t)),footer:(0,x.jsx)(E,{snippet:t}),children:(0,x.jsxs)("div",{className:"card-inner",children:[(0,x.jsx)(D,{snippet:t}),(0<t.tags.length||!!t.modified)&&(0,x.jsxs)("div",{className:o()("snippet-card-meta",{"has-tags":0<t.tags.length}),children:[0<t.tags.length&&(0,x.jsxs)("span",{className:"snippet-card-tags",children:[(0,x.jsx)("span",{className:"snippet-card-tags-label",children:(0,l.__)("Tags:","code-snippets")})," ",(0,x.jsx)(w.we,{snippet:t})]}),(0,x.jsx)(C,{snippet:t})]}),t.desc&&(0,x.jsx)("div",{className:"snippet-description-content",children:(0,x.jsx)(c.RawHTML,{children:t.desc})})]})})}},8588(e,t,n){"use strict";n.d(t,{u:()=>S});var r=n(4467),s=n(3453),i=n(6427),o=n(7723),a=n(6942),c=n.n(a),l=n(1609),d=n(8192),u=n(30),p=n(3661),f=n(6492),h=n(7871),m=n(2449),v=n(7166),b=n(2335),g=n(790);function y(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 _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var j=function(e){var t=e.snippet,n=(0,l.useState)(!1),r=(0,s.A)(n,2),i=r[0],a=r[1];return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.$,{link:!0,onClick:function(){return a(!0)},children:(0,o.__)("Preview","code-snippets")}),i&&(0,g.jsx)(v.FJ,{snippet:t,setIsOpen:a})]})},w=function(e){return e[e.Ready=0]="Ready",e[e.Working=1]="Working",e[e.Errored=2]="Errored",e}(w||{}),x=function(e){var t=e.action,n=e.label,r=e.workingLabel,a=e.failedLabel,d=e.className,u=(0,l.useState)(w.Ready),p=(0,s.A)(u,2),f=p[0],h=p[1];return(0,g.jsx)(m.$,{link:!0,className:c()(d,{"is-busy":f===w.Working}),disabled:f===w.Working,onClick:function(){switch(f){case w.Errored:h(w.Ready);break;case w.Working:break;case w.Ready:h(w.Working),t().then(function(){return h(w.Ready)}).catch(function(){h(w.Errored)})}},children:function(){switch(f){case w.Working:return(0,g.jsxs)("span",{className:"snippet-row-action-feedback",children:[(0,g.jsx)(i.Spinner,{})," ",null!=r?r:(0,o.__)("Loading…","code-snippets")]});case w.Errored:return(0,g.jsxs)("span",{className:"snippet-row-action-error",children:[(0,g.jsx)("span",{className:"dashicons dashicons-warning"}),null!=a?a:(0,o.__)("Failed","code-snippets")]});default:return n}}()})},O=function(e){var t=e.snippet,n=(0,u.G)().refreshSnippetsList,r=(0,b.S)({snippet:t,onSuccess:n}),s=r.requestDelete,i=r.deleteDialogProps;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(x,{action:s,className:"delete",label:t.trashed?(0,o.__)("Delete Permanently","code-snippets"):(0,o.__)("Trash","code-snippets"),workingLabel:t.trashed?(0,o.__)("Deleting…","code-snippets"):(0,o.__)("Trashing…","code-snippets"),failedLabel:(0,o.__)("Failed to delete","code-snippets")}),(0,g.jsx)(b.K,_({},i))]})},A=function(e){var t=e.snippet,n=(0,d.q)(),r=(0,u.G)().refreshSnippetsList,s=t.trashed?null:(0,g.jsx)(j,{snippet:t}),i=t.trashed?null:(0,g.jsx)("a",{href:(0,h.l)(t),children:t.locked?(0,o.__)("View","code-snippets"):(0,o.__)("Edit","code-snippets")}),a=t.trashed?null:(0,g.jsx)(x,{label:(0,o.__)("Clone","code-snippets"),workingLabel:(0,o.__)("Cloning…","code-snippets"),action:function(){return n.create((0,h.m2)(t)).then(r)}}),c=t.trashed?null:(0,g.jsx)(x,{label:(0,o.__)("Export","code-snippets"),workingLabel:(0,o.__)("Exporting…","code-snippets"),action:function(){return n.export(t).then(function(e){return(0,p.Mc)(e,t)})}}),l=t.trashed?(0,g.jsx)(x,{label:(0,o.__)("Restore","code-snippets"),workingLabel:(0,o.__)("Restoring…","code-snippets"),action:function(){return n.restore(t).then(r)}}):null,f=!t.locked||t.trashed?(0,g.jsx)(O,{snippet:t}):null;return(0,g.jsx)(g.Fragment,{children:[s,i,a,l,c,f].filter(function(e){return e}).reduce(function(e,t){return null===e?(0,g.jsx)(g.Fragment,{children:t}):(0,g.jsxs)(g.Fragment,{children:[e," | ",t]})},null)})},S=function(e){var t,n=e.snippet;return(0,f.i_)()||!n.network||n.shared_network?!n.shared_network||null!==(t=window.CODE_SNIPPETS_MANAGE)&&void 0!==t&&t.hasNetworkCap?(0,g.jsx)("div",{className:c()("row-actions",{visible:!n.trashed}),children:(0,g.jsx)(A,{snippet:n})}):null:(0,g.jsx)("div",{className:"row-actions visible",children:n.active?(0,g.jsx)("span",{className:"network-active",children:(0,o.__)("Network Active","code-snippets")}):(0,g.jsx)("span",{className:"network-only",children:(0,o.__)("Network Only","code-snippets")})})}},5485(e,t,n){"use strict";n.d(t,{N:()=>m});var r=n(3453),s=n(9394),i=n(6942),o=n.n(i),a=n(1609),c=n(6842),l=n(6418),d=n(2075),u=n(790),p="paged",f=function(e){var t=e.snippets,n=e.noItems,r=e.selected,s=e.setSelected;return 0<t.length?(0,u.jsx)("ul",{className:o()("code-snippets-cards","snippets-card-grid",{"has-selection":t.some(function(e){return r.has(e.id)})}),children:t.map(function(e){return(0,u.jsx)(d.x,{snippet:e,isSelected:r.has(e.id),onSelectedChange:function(t){s(function(n){var r=new Set(n);return t?r.add(e.id):r.delete(e.id),r})}},e.id)})}):(0,u.jsx)("p",{className:"no-items",children:n})},h=function(e,t){return new Set((0,s.A)(e).filter(function(e){return t.some(function(t){return t.id===e})}))},m=function(e){var t=e.snippets,n=e.actions,s=e.doAction,i=e.extraTableNav,o=e.endTableNav,d=e.itemsPerPage,m=e.noItems,v=e.beforeGrid,b=(0,a.useState)(function(){return new Set}),g=(0,r.A)(b,2),y=g[0],_=g[1],j=(0,a.useState)(function(){return Number((0,c.UY)(p))||1}),w=(0,r.A)(j,2),x=w[0],O=w[1],A=function(e){var t=e.snippets,n=e.itemsPerPage,r=e.currentPage,s=n?Math.ceil(t.length/n):0,i=s?Math.min(r,s):1,o=(0,a.useMemo)(function(){return n?t.slice((i-1)*n,i*n):t},[t,n,i]);return{totalPages:s,safePage:i,visibleSnippets:o}}({snippets:t,itemsPerPage:d,currentPage:x}),S=A.totalPages,P=A.safePage,N=A.visibleSnippets;return(0,u.jsx)("div",{className:"snippets-card-grid-container",children:(0,u.jsxs)(l.HJ,{totalItems:t.length,totalPages:0<S?S:void 0,currentPage:P,setCurrentPage:O,pageSearchParam:p,selected:h(y,N),setSelected:_,selectAllKeys:N.map(function(e){return e.id}),actions:n,doAction:s,extraTableNav:i,endTableNav:o,children:[v,(0,u.jsx)(f,{snippets:N,noItems:m,selected:y,setSelected:_})]})})}},1015(e,t,n){"use strict";n.d(t,{j:()=>O});var r=n(3453),s=n(7723),i=n(1609),o=n(6942),a=n.n(o),c=n(7871),l=n(6842),d=n(3988),u=n(2677),p=n(5485),f=n(2437),h=n(4811),m=n(9652),v=n(3233),b=n(2502),g=n(5840),y=n(790),_=function(){var e,t=(0,b.bB)(),n=t.currentType,r=t.currentTag,i=t.searchQuery,o=n?(0,s.__)("You don't have snippets of this type yet.","code-snippets"):(0,s.__)("You don't have any snippets yet.","code-snippets");return i||r?(0,y.jsxs)(y.Fragment,{children:[(0,s.__)("No snippets were found matching the current search query.","code-snippets"),(0,s.__)(' Please enter a new query or use the "Clear Filters" button above.',"code-snippets")]}):(0,y.jsxs)(y.Fragment,{children:[o," ",(0,y.jsx)("a",{href:(0,l.c$)(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.addNew,{type:n}),children:(0,s.__)("Add a new snippet.","code-snippets")})]})},j=function(e){var t,n=e.snippetView,r=e.setSnippetView,s=e.snippets,o=e.actions,l=e.doAction,f=e.extraTableNav,b=e.hiddenColumns,g=e.truncateRowValues,j=(0,v.d)().activeByCondition,w=(0,i.useMemo)(function(){return(0,m.YD)(b)},[b]),O=null===(t=window.CODE_SNIPPETS_MANAGE)||void 0===t?void 0:t.snippetsPerPage,A=O&&Math.ceil(s.length/O),S=function(e){return"top"===e?(0,y.jsx)(u.v,{snippetView:n,setSnippetView:r}):null};return"card"===n?(0,y.jsx)(p.N,{snippets:s,actions:o,doAction:l,itemsPerPage:O,extraTableNav:f,endTableNav:S,noItems:(0,y.jsx)(_,{}),beforeGrid:(0,y.jsx)(h.e,{})}):(0,y.jsx)(d.VZ,{items:s,getKey:function(e){return e.id},initialSort:x(),className:a()({"truncate-row-values":g}),columns:w,actions:o,doAction:l,totalPages:A,extraTableNav:f,selectAllControl:!0,endTableNav:S,rowClassName:function(e){return function(e,t){return a()("snippet","snippet ".concat((0,c.E$)(e,t)?"active":"inactive","-snippet"),"".concat((0,c.yo)(e),"-snippet"),"".concat(e.scope,"-snippet"),{"trashed-snippet":e.trashed})}(e,j)},noItems:(0,y.jsx)(_,{}),beforeTable:(0,y.jsx)(h.e,{})})},w={"priority-asc":{columnId:"priority",direction:"asc"},"name-asc":{columnId:"name",direction:"asc"},"name-desc":{columnId:"name",direction:"desc"},"modified-desc":{columnId:"date",direction:"desc"},"modified-asc":{columnId:"date",direction:"asc"}},x=function(){var e,t,n;return null!==(e=w[null!==(t=null===(n=window.CODE_SNIPPETS_MANAGE)||void 0===n?void 0:n.listOrder)&&void 0!==t?t:""])&&void 0!==e?e:void 0},O=function(e){var t=e.snippetView,n=e.setSnippetView,s=(0,v.d)().snippetsByStatus,o=(0,b.bB)(),a=o.currentStatus,c=o.setCurrentStatus,l=function(){var e=(0,i.useState)(function(){var e,t;return new Set(null!==(e=null===(t=window.CODE_SNIPPETS_MANAGE)||void 0===t?void 0:t.hiddenColumns)&&void 0!==e?e:[])}),t=(0,r.A)(e,2),n=t[0],s=t[1],o=(0,i.useState)(function(){var e,t;return 0!==Number(null!==(e=null===(t=window.CODE_SNIPPETS_MANAGE)||void 0===t?void 0:t.truncateRowValues)&&void 0!==e?e:1)}),a=(0,r.A)(o,2),c=a[0],l=a[1];return(0,i.useEffect)(function(){var e=document.getElementById("adv-settings");if(e){var t=function(){var t,n;s(new Set(Array.from(e.querySelectorAll(".hide-column-tog:not(:checked)")).map(function(e){return e.value}))),l(null===(t=null===(n=e.querySelector("#snippets-table-truncate-row-values"))||void 0===n?void 0:n.checked)||void 0===t||t)};return t(),e.addEventListener("change",t),function(){e.removeEventListener("change",t)}}},[]),{hiddenColumns:n,truncateRowValues:c}}(),d=l.hiddenColumns,u=l.truncateRowValues,p=(0,i.useMemo)(function(){var e;return null!==(e=s.get(a))&&void 0!==e?e:[]},[s,a]),h=(0,g.gI)(p);return(0,i.useEffect)(function(){b.Am===a||s.has(a)||c(b.Am)},[a,c,s]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(f.G,{}),(0,y.jsx)("div",{className:"snippets-list-view",children:(0,y.jsx)(j,{snippetView:t,setSnippetView:n,snippets:p,actions:"trashed"===a?g.pU:g.Ni,doAction:h,extraTableNav:function(e){var t;return(0,y.jsx)(f.F,{which:e,visibleSnippets:null!==(t=s.get("all"))&&void 0!==t?t:[]})},hiddenColumns:d,truncateRowValues:u})})]})}},63(e,t,n){"use strict";n.d(t,{N:()=>N});var r=n(7723),s=n(6087),i=n(1609),o=n(6942),a=n.n(o),c=n(8435),l=n(1240),d=n(3733),u=n(8192),p=n(30),f=n(8975),h=n(6492),m=n(7871),v=n(6842),b=n(4888),g=n(633),y=n(7834),_=n(7882),j=n(2502),w=n(3233),x=n(1015),O=n(790),A=function(e){var t=e.type,n=e.count,s=(0,j.bB)(),i=s.currentType,o=s.setCurrentType,c=null!=t?t:"all",l=t===i,d=t&&(0,m.sD)(t)&&!(0,h.QX)();return(0,O.jsx)("li",{children:(0,O.jsxs)("a",{href:(0,v.c$)(window.location.href,{type:c}),className:a()("snippet-type-link","".concat(c,"-type-link"),{"active-type":l,"pro-locked-type":d&&!l}),"aria-current":l?"page":void 0,onClick:function(e){e.preventDefault(),o(t)},children:[t&&(0,O.jsx)(b.E,{name:t}),(0,O.jsx)("span",{className:a()("".concat(c,"-label"),"snippet-type-name"),children:t?m.Hi[t]:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"snippet-type-name-full",children:(0,r.__)("All Snippets","code-snippets")}),(0,O.jsx)("span",{className:"snippet-type-name-short",children:(0,r.__)("All","code-snippets")})]})}),void 0!==n&&!d&&(0,O.jsx)("span",{className:"subnav-count",children:n}),d&&(0,O.jsx)("span",{className:"pro-chip",children:(0,r.__)("Pro","code-snippets")})]})})},S=function(){var e;return null!==(e=window.CODE_SNIPPETS_MANAGE)&&void 0!==e&&e.isSafeModeActive?(0,O.jsx)(g.$,{type:"error",children:(0,O.jsxs)("p",{children:[(0,O.jsx)("strong",{children:(0,r.__)("Warning:","code-snippets")}),"\n",(0,r.__)("Safe mode is active and snippets will not execute!","code-snippets"),"\n",(0,s.createInterpolateElement)((0,r.__)("Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> file to turn off safe mode.","code-snippets"),{code:(0,O.jsx)("code",{})}),"\n",(0,O.jsx)("a",{href:"https://codesnippets.pro/doc/safe-mode",target:"_blank",rel:"noreferrer",children:(0,r.__)("Read more","code-snippets")})]})}):null},P=function(){var e,t,n,s,o,l=(0,d.e)(),u=l.snippetView,v=l.setSnippetView,b=(0,j.bB)().currentType,g=(t=(0,p.G)().snippetsList,n=(0,i.useMemo)(function(){return null==t?void 0:t.filter(function(e){return!e.trashed})},[t]),s=(0,i.useMemo)(function(){return null==n?void 0:n.reduce(function(e,t){var n,r=(0,m.yo)(t);return e.set(r,(null!==(n=e.get(r))&&void 0!==n?n:0)+1)},new Map)},[n]),o=null===(e=window.CODE_SNIPPETS_MANAGE)||void 0===e?void 0:e.typeCounts,{getCount:(0,i.useCallback)(function(e){var t;return n?e?null!==(t=null==s?void 0:s.get(e))&&void 0!==t?t:0:n.length:null==o?void 0:o[null!=e?e:"all"]},[n,s,o])}).getCount,P=(0,c.X)(),N=P.atStart,k=P.atEnd,E=P.scrollRef;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{className:a()("snippet-type-nav-wrapper",{"has-scroll-start":!N,"has-scroll-end":!k}),children:(0,O.jsx)("nav",{ref:E,className:"snippet-type-nav","aria-label":(0,r.__)("Snippet types","code-snippets"),children:(0,O.jsxs)("ul",{children:[(0,O.jsx)(A,{count:g()}),f.W.map(function(e){return(0,O.jsx)(A,{type:e,count:g(e)},e)})]})})}),(0,O.jsx)(y.O,{}),(0,O.jsxs)("div",{className:"snippets-page-header",children:[(0,O.jsx)("h1",{children:(0,r.sprintf)((0,r.__)("Local Snippets: %s","code-snippets"),b?m.Hi[b]:(0,r.__)("All Snippets","code-snippets"))}),(0,O.jsx)("a",{href:(0,m.WW)(b),className:"button button-primary",children:(0,r.__)("Add Snippet","code-snippets")})]}),(0,O.jsx)("hr",{className:"wp-header-end"}),(0,O.jsx)(S,{}),b&&!(0,h.QX)()&&(0,m.sD)(b)?(0,O.jsx)(_.p,{}):(0,O.jsx)(w.n,{children:(0,O.jsx)(x.j,{snippetView:u,setSnippetView:v})})]})},N=function(){return(0,O.jsx)(l.i,{children:(0,O.jsx)(u.i,{children:(0,O.jsx)(p.q,{children:(0,O.jsx)(j.kN,{children:(0,O.jsx)(P,{})})})})})}},2437(e,t,n){"use strict";n.d(t,{F:()=>j,G:()=>w});var r=n(9394),s=n(3453),i=n(7723),o=n(1609),a=n(1240),c=n(30),l=n(9595),d=n(2456),u=n(6842),p=n(2057),f=n(4811),h=n(3233),m=n(2502),v=n(790),b=[["all",(0,i.__)("All","code-snippets")],["active",(0,i.__)("Active","code-snippets")],["inactive",(0,i.__)("Inactive","code-snippets")],["recently_active",(0,i.__)("Recently Active","code-snippets")],["locked",(0,i.__)("Locked","code-snippets")],["unlocked",(0,i.__)("Unlocked","code-snippets")],["trashed",(0,i.__)("Trashed","code-snippets")]],g=function(){var e=(0,m.bB)(),t=e.currentStatus,n=e.setCurrentStatus,r=(0,h.d)().snippetsByStatus,a=b.filter(function(e){var t=(0,s.A)(e,1)[0];return r.has(t)&&("unlocked"!==t||r.has("locked"))});return(0,v.jsx)("ul",{className:"subsubsub",children:a.map(function(e){var a,c,l=(0,s.A)(e,2),d=l[0],p=l[1];return(0,v.jsx)(o.Fragment,{children:(0,v.jsx)("li",{className:d,children:(0,v.jsxs)("a",{href:(0,u.c$)(window.location.href,{status:m.Am===d?void 0:d}),className:t===d?"current":void 0,"aria-current":t===d?"page":void 0,onClick:function(e){e.preventDefault(),n(d)},children:[p," ",(0,v.jsx)("span",{className:"count",children:(0,i.sprintf)((0,i._x)("(%d)","table view count","code-snippets"),null!==(a=null===(c=r.get(d))||void 0===c?void 0:c.length)&&void 0!==a?a:0)})]})})},d)})})},y=function(){var e=(0,a._)().api,t=(0,c.G)().refreshSnippetsList;return"recently_active"===(0,m.bB)().currentStatus?(0,v.jsx)("div",{className:"alignleft actions",children:(0,v.jsx)(p.b,{secondary:!0,name:"clear-recent-list",text:(0,i.__)("Clear List","code-snippets"),onClick:function(n){n.preventDefault(),e.del(d.St.recentlyActive).then(t).catch(l.fY)}})}):null},_=function(e){var t=e.visibleSnippets,n=(0,m.bB)(),s=n.currentTag,a=n.setCurrentTag,c=(0,o.useId)(),l=(0,o.useMemo)(function(){return t.reduce(function(e,t){return t.tags.forEach(function(t){return e.add(t)}),e},new Set)},[t]);return 0<l.size?(0,v.jsxs)("div",{className:"alignleft actions",children:[(0,v.jsx)("label",{htmlFor:c,className:"screen-reader-text",children:(0,i.__)("Filter snippets by tag","code-snippets")}),(0,v.jsxs)("select",{id:c,name:"tag",value:s,"aria-label":(0,i.__)("Filter snippets by tag","code-snippets"),onChange:function(e){return a(e.target.value)},children:[(0,v.jsx)("option",{value:"",children:(0,i.__)("All Tags","code-snippets")}),(0,r.A)(l).map(function(e){return(0,v.jsx)("option",{value:e,children:e},e)})]})]}):null},j=function(e){var t=e.which,n=e.visibleSnippets;return(0,v.jsxs)(v.Fragment,{children:["top"===t&&(0,v.jsx)(_,{visibleSnippets:n}),(0,v.jsx)(y,{}),"top"===t&&(0,v.jsx)(f.q,{})]})},w=function(){return(0,v.jsx)("div",{className:"snippets-table-toolbar",children:(0,v.jsx)(g,{})})}},4811(e,t,n){"use strict";n.d(t,{e:()=>c,q:()=>a});var r=n(7723),s=(n(1609),n(2449)),i=n(2502),o=n(790),a=function(){var e=(0,i.bB)(),t=e.searchQuery,n=e.setSearchQuery;return(0,o.jsx)("search",{className:"snippets-search-area",children:(0,o.jsx)("form",{className:"search-box","aria-label":(0,r.__)("Search Snippets","code-snippets"),onSubmit:function(e){e.preventDefault()},children:(0,o.jsx)("input",{type:"search",id:"snippets_search",name:"s",value:null!=t?t:"","aria-label":(0,r.__)("Search Snippets:","code-snippets"),onChange:function(e){return n(e.target.value)},placeholder:(0,r.__)("Search snippets","code-snippets")})})})},c=function(){var e=(0,i.bB)(),t=e.searchQueryText,n=e.searchLineNumber,a=e.currentTag,c=e.setSearchQuery,l=e.setCurrentTag;return t||a?(0,o.jsxs)("p",{className:"snippets-search-subtitle",children:[(0,r.__)("Search results","code-snippets"),t&&(0,r.sprintf)((0,r.__)(" for “%s”","code-snippets"),t),n&&(0,r.sprintf)((0,r.__)(" on line “%d”","code-snippets"),n),a&&(0,r.sprintf)((0,r.__)(" in tag “%s”","code-snippets"),a)," ",(0,o.jsx)(s.$,{small:!0,className:"clear-filters",onClick:function(){c(),l()},children:(0,r.__)("Clear Filters","code-snippets")})]}):null}},9652(e,t,n){"use strict";n.d(t,{P2:()=>C,Xz:()=>k,YD:()=>F,db:()=>R,ed:()=>N,ir:()=>P,we:()=>D});var r=n(4467),s=n(8443),i=n(6087),o=n(7723),a=n(1609),c=n(8192),l=n(30),d=n(9595),u=n(6492),p=n(7871),f=n(2456),h=n(6842),m=n(4888),v=n(6197),b=n(3336),g=n(8588),y=n(3233),_=n(2502),j=n(790);function w(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 x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var O=function(e,t){return(0,h.c$)(window.location.href,{action:"run-once",snippet:e.id,network:e.network?"true":"false",_wpnonce:t})},A=function(e){var t,n,r=e.snippet;return(0,j.jsxs)("a",{className:"snippet-execution-button",title:(0,o.__)("Run Once","code-snippets"),href:O(r,null!==(t=null===(n=window.CODE_SNIPPETS_MANAGE)||void 0===n?void 0:n.runOnceNonce)&&void 0!==t?t:""),onMouseDown:function(e){e.currentTarget.href=O(r,(0,f.GE)())},onClick:function(e){e.preventDefault(),window.location.assign(O(r,(0,f.GE)()))},children:[(0,j.jsx)("span",{className:"screen-reader-text",children:(0,o.__)("Run Once","code-snippets")}),(0,j.jsx)("span",{"aria-hidden":"true",children:" "})]})},S=function(e){var t=e.snippet,n=(0,c.q)(),r=n.activate,s=n.deactivate,i=(0,l.G)().refreshSnippetsList,a=t.network&&!t.shared_network?t.active?(0,o.__)("Network Deactivate","code-snippets"):(0,o.__)("Network Activate","code-snippets"):t.active?(0,o.__)("Deactivate","code-snippets"):(0,o.__)("Activate","code-snippets");return(0,j.jsx)("input",{id:"snippet-".concat(t.id,"-switch"),type:"checkbox",role:"switch",checked:t.active,"aria-checked":t.active,className:"switch",title:a,"aria-label":a,onChange:function(){(t.active?s(t):r(t)).then(i).catch(d.fY)}})},P=function(e){var t,n,r=e.snippet,s=(0,y.d)().activeByCondition;if(r.trashed)return"";switch(r.scope){case"single-use":return(0,j.jsx)(A,{snippet:r});case"condition":return(0,j.jsx)("a",{className:"snippet-condition-count",href:(0,p.l)(r),children:null!==(t=null===(n=s.get(r.id))||void 0===n?void 0:n.length)&&void 0!==t?t:0});default:return(0,j.jsx)(S,{snippet:r})}},N=function(e){var t=e.snippet;return(0,j.jsx)("div",{className:"extra-icons",children:t.locked&&(0,j.jsx)(b.m,{inline:!0,end:!0,label:(0,o.__)("About snippet lock","code-snippets"),icon:(0,j.jsx)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),children:(0,o.__)("This snippet is locked and cannot be modified.","code-snippets")})})},k=function(e){var t,n=e.snippet;return(0,j.jsxs)("span",{className:"snippet-name-group",children:[!n.trashed&&((0,u.i_)()||!n.network||null!==(t=window.CODE_SNIPPETS_MANAGE)&&void 0!==t&&t.hasNetworkCap)?(0,j.jsx)("a",{href:(0,p.l)(n),className:"snippet-name",title:(0,p.lO)(n),children:(0,p.lO)(n)}):(0,j.jsx)("span",{className:"snippet-name",title:(0,p.lO)(n),children:(0,p.lO)(n)}),n.shared_network&&(0,j.jsx)("span",{className:"badge",children:(0,o.__)("Shared on Network","code-snippets")})]})},E=function(e){var t=e.snippet;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(N,{snippet:t}),(0,j.jsx)(k,{snippet:t}),(0,j.jsx)(g.u,{snippet:t})]})},C=function(e){var t=e.snippet,n=(0,_.bB)().setCurrentType,r=(0,p.yo)(t);return(0,j.jsx)("a",{href:(0,h.c$)(window.location.href,{type:r}),onClick:function(e){e.preventDefault(),n(r)},children:(0,j.jsx)(m.E,{name:r})})},D=function(e){var t=e.snippet;return t.tags.map(function(e,n){return(0,j.jsxs)(a.Fragment,{children:[(0,j.jsx)("a",{href:(0,h.c$)(window.location.href,{tag:e}),children:e},e),n<t.tags.length-1?", ":""]},e)})},T=function(e){var t=e.snippet;return t.modified?(0,j.jsx)("span",{className:"modified-column-content",title:t.modified,children:(0,j.jsx)("time",{dateTime:t.modified,children:(0,s.humanTimeDiff)(t.modified,void 0)})}):(0,j.jsx)(j.Fragment,{children:"—"})},R=function(e){var t=e.snippet;return(0,j.jsx)(v.u,{snippet:t})},I=function(e){var t=e.snippet,n=t.createdBy,r=t.updatedBy,s=null!=r?r:n;if(!s)return(0,j.jsx)("span",{className:"snippet-author is-unknown",children:"—"});var i=n&&r&&n.id!==r.id?(0,o.sprintf)((0,o.__)("Created by %1$s · Last edited by %2$s","code-snippets"),n.displayName,r.displayName):n?(0,o.sprintf)((0,o.__)("Created by %s","code-snippets"),n.displayName):(0,o.sprintf)((0,o.__)("Last edited by %s","code-snippets"),s.displayName);return(0,j.jsxs)("span",{className:"snippet-author",title:i,children:[s.avatarUrl&&(0,j.jsx)("img",{className:"snippet-author__avatar",src:s.avatarUrl,alt:"",width:20,height:20}),(0,j.jsx)("span",{className:"snippet-author__name",children:s.displayName})]})},L=[{id:"activate",title:(0,j.jsx)("span",{className:"screen-reader-text",children:(0,o.__)("Activate","code-snippets")}),render:function(e){return(0,j.jsx)(P,{snippet:e})}},{id:"id",title:(0,o.__)("ID","code-snippets"),sortedValue:function(e){return e.id},render:function(e){return e.id}},{id:"name",title:(0,o.__)("Name","code-snippets"),isPrimary:!0,sortedValue:function(e){return(0,p.lO)(e).toLowerCase()},render:function(e){return(0,j.jsx)(E,{snippet:e})}},{id:"type",title:(0,o.__)("Type","code-snippets"),sortedValue:function(e){return(0,p.yo)(e)},render:function(e){return(0,j.jsx)(C,{snippet:e})}},{id:"desc",title:(0,o.__)("Description","code-snippets"),render:function(e){return(0,j.jsx)("div",{className:"snippet-description-content",children:(0,j.jsx)(i.RawHTML,{children:e.desc})})}},{id:"tags",title:(0,o.__)("Tags","code-snippets"),render:function(e){return(0,j.jsx)(D,{snippet:e})}},{id:"date",title:(0,o.__)("Modified","code-snippets"),sortedValue:function(e){return e.modified?new Date(e.modified).toISOString():""},render:function(e){return(0,j.jsx)(T,{snippet:e})}},{id:"priority",title:(0,o.__)("Priority","code-snippets"),sortedValue:function(e){return e.priority},render:function(e){return(0,j.jsx)(v.u,{snippet:e})}},{id:"author",title:(0,o.__)("Author","code-snippets"),sortedValue:function(e){return function(e){var t,n,r;return null!==(t=null===(n=null!==(r=e.updatedBy)&&void 0!==r?r:e.createdBy)||void 0===n?void 0:n.displayName)&&void 0!==t?t:""}(e).toLowerCase()},render:function(e){return(0,j.jsx)(I,{snippet:e})}}],F=function(e){return L.map(function(t){return x(x({},t),{},{isHidden:e.has(t.id)})})}},3233(e,t,n){"use strict";n.d(t,{d:()=>m,n:()=>v});var r=n(3453),s=n(1609),i=n(9028),o=n(3561),a=n(7871),c=n(30),l=n(2502),d=n(790),u=function(e,t,n){var r;null!==(r=e.get(t))&&void 0!==r&&r.push(n)||e.set(t,[n])},p=(0,i.h)("useFilteredSnippets"),f=(0,r.A)(p,2),h=f[0],m=f[1],v=function(e){var t=e.children,n=(0,c.G)().snippetsList,r=(0,l.bB)(),i=r.currentType,p=r.currentTag,f=r.searchLineNumber,m=r.searchQueryText,v=(0,s.useMemo)(function(){var e,t;return null!==(e=null!=n?n:null===(t=window.CODE_SNIPPETS_MANAGE)||void 0===t||null===(t=t.snippetsList)||void 0===t?void 0:t.map(o.y))&&void 0!==e?e:[]},[n]),b=(0,s.useMemo)(function(){var e=["name","desc","code","tags"],t=null==m?void 0:m.toLowerCase().trim();return v.filter(function(n){if(i&&(0,a.yo)(n)!==i)return!1;if(p&&!n.tags.includes(p))return!1;if(t){var r;if(void 0!==f)return(null!==(r=n.code.split("\n")[f])&&void 0!==r?r:"").includes(t);var s=e.some(function(e){return("tags"===e?n.tags.join(" "):n[e]).toLowerCase().includes(t)});return String(n.id)===t||s||function(e,t){return[e.updatedBy,e.createdBy].some(function(e){return Boolean(null==e?void 0:e.displayName.toLowerCase().includes(t))})}(n,t)}return!0})},[v,p,i,m,f]),g=(0,s.useMemo)(function(){return function(e){return e.reduce(function(e,t){return t.active&&u(e,t.conditionId,t),e},new Map)}(v)},[v]),y=(0,s.useMemo)(function(){return function(e,t){return e.reduce(function(e,n){return n.trashed?u(e,"trashed",n):(u(e,"all",n),u(e,(0,a.E$)(n,t)?"active":"inactive",n),u(e,n.locked?"locked":"unlocked",n),n.lastActive&&u(e,"recently_active",n)),e},new Map)}(b,g)},[b,g]),_={snippetsByStatus:y,activeByCondition:g};return(0,d.jsx)(h.Provider,{value:_,children:t})}},2502(e,t,n){"use strict";n.d(t,{Am:()=>h,bB:()=>g,kN:()=>y});var r=n(2284),s=n(3453),i=n(5501),o=n(3662),a=n(1609),c=n(8975),l=n(9028),d=n(6842),u=n(790);function p(){p=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,s){var i=RegExp(e,r);return t.set(i,s||t.get(e)),(0,o.A)(i,n.prototype)}function s(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var s=r[n];if("number"==typeof s)t[n]=e[s];else{for(var i=0;void 0===e[s[i]]&&i+1<s.length;)i++;t[n]=e[s[i]]}return t},Object.create(null))}return(0,i.A)(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=s(n,this);var r=n.indices;r&&(r.groups=s(r,this))}return n},n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var o=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(""===n)return e;var r=o[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""}))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=(0,r.A)(e[e.length-1])&&(e=[].slice.call(e)).push(s(e,a)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},p.apply(this,arguments)}var f=["all","active","inactive","recently_active","locked","unlocked","trashed"],h="all",m=(0,l.h)("useSnippetsFilters"),v=(0,s.A)(m,2),b=v[0],g=v[1],y=function(e){var t=e.children,n=(0,a.useState)(function(){return(0,d.UY)("tag")}),r=(0,s.A)(n,2),i=r[0],o=r[1],l=(0,a.useState)(function(){return(0,d.UY)("s")}),m=(0,s.A)(l,2),v=m[0],g=m[1],y=(0,a.useState)(function(){var e=(0,d.UY)("type");return function(e){return c.W.includes(e)}(e)?e:void 0}),_=(0,s.A)(y,2),j=_[0],w=_[1],x=(0,a.useState)(function(){var e=(0,d.UY)("status");return function(e){return f.includes(e)}(e)?e:h}),O=(0,s.A)(x,2),A=O[0],S=O[1],P=(0,a.useMemo)(function(){return r=null!=(n=null==(e=v)?void 0:e.trim().match(p(/@line:(\d+)/,{line:1})))&&null!==(t=n.groups)&&void 0!==t&&t.line?parseInt(n.groups.line,10):void 0,n&&r?[null==e?void 0:e.replace(n[0],"").trim(),r]:[e,void 0];var e,t,n,r},[v]),N=(0,s.A)(P,2),k=N[0],E=N[1],C={currentTag:i,currentType:j,searchQuery:v,currentStatus:A,searchQueryText:k,searchLineNumber:E,setCurrentType:(0,a.useCallback)(function(e){w(e),(0,d.ev)({type:e})},[]),setCurrentStatus:(0,a.useCallback)(function(e){S(e),(0,d.ev)({status:h===e?"":e})},[]),setCurrentTag:(0,a.useCallback)(function(e){o(e),(0,d.ev)({tag:e})},[]),setSearchQuery:(0,a.useCallback)(function(e){g(e),(0,d.ev)({s:e})},[])};return(0,u.jsx)(b.Provider,{value:C,children:t})}},6703(e,t,n){"use strict";n.d(t,{N:()=>r.N});var r=n(63)},5840(e,t,n){"use strict";n.d(t,{Ni:()=>h,gI:()=>y,pU:()=>m});var r=n(467),s=n(4756),i=n.n(s),o=n(7723),a=n(8192),c=n(30),l=n(9595),d=n(3661),u=n(7871);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function f(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}var h=[{key:"activate",label:(0,o.__)("Activate","code-snippets")},{key:"deactivate",label:(0,o.__)("Deactivate","code-snippets")},{key:"clone",label:(0,o.__)("Clone","code-snippets")},{key:"export",label:(0,o.__)("Export","code-snippets")},{key:"download",label:(0,o.__)("Download","code-snippets")},{key:"trash",label:(0,o.__)("Trash","code-snippets")}],m=[{key:"restore",label:(0,o.__)("Restore","code-snippets")},{key:"delete",label:(0,o.__)("Delete Permanently","code-snippets")}],v=function(e){var t,n;if(0===e.length)return Promise.resolve();var r=document.createElement("form"),s=function(e,t){var n=document.createElement("input");n.type="hidden",n.name=e,n.value=t,r.appendChild(n)};return r.method="post",r.action=window.location.href,r.hidden=!0,s("code_snippets_action","bulk-download"),s("code_snippets_bulk_download_nonce",null!==(t=null===(n=window.CODE_SNIPPETS_MANAGE)||void 0===n?void 0:n.bulkDownloadNonce)&&void 0!==t?t:""),s("snippets",JSON.stringify(e.map(function(e){return{id:e.id,network:e.network}}))),document.body.appendChild(r),r.submit(),window.setTimeout(function(){r.remove()},0),Promise.resolve()},b=function(e){return e.reduce(function(e,t){return e.then(function(){return new Promise(function(e){v([t]),window.setTimeout(e,200)})})},Promise.resolve())},g=function(){var e=(0,r.A)(i().mark(function e(t,n,r){var s,o,a;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0<t.length)){e.next=20;break}s=p(t),e.prev=2,s.s();case 4:if((o=s.n()).done){e.next=10;break}return a=o.value,e.next=8,n(a).catch(l.fY);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),s.e(e.t0);case 15:return e.prev=15,s.f(),e.finish(15);case 18:return e.next=20,r();case 20:case"end":return e.stop()}},e,null,[[2,12,15,18]])}));return function(t,n,r){return e.apply(this,arguments)}}(),y=function(e){var t=(0,a.q)(),n=(0,c.G)().refreshSnippetsList;return function(){var s=(0,r.A)(i().mark(function r(s,o){var a,c;return i().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=s,r.next="activate"===r.t0?3:"deactivate"===r.t0?6:"clone"===r.t0?9:"export"===r.t0?12:"download"===r.t0?14:"trash"===r.t0||"delete"===r.t0?16:void 0===r.t0?19:20;break;case 3:return r.next=5,g(e.filter(function(e){return o.has(e.id)&&!e.active}),function(e){return t.activate({id:e.id,network:e.network})},n);case 5:case 8:case 11:case 18:case 19:return r.abrupt("break",20);case 6:return r.next=8,g(e.filter(function(e){return o.has(e.id)&&e.active}),function(e){return t.deactivate({id:e.id,network:e.network})},n);case 9:return r.next=11,g(e.filter(function(e){return o.has(e.id)&&!e.trashed}),function(e){return t.create((0,u.m2)(e))},n);case 12:return(0,d._j)(e.filter(function(e){return o.has(e.id)})),r.abrupt("break",20);case 14:return c=e.filter(function(e){return o.has(e.id)}),r.abrupt("return",1<c.length&&(null===(a=window.CODE_SNIPPETS_MANAGE)||void 0===a||!a.supportsZipDownloads)?b(c):v(c));case 16:return r.next=18,g(e.filter(function(e){return o.has(e.id)}),function(e){return t.delete({id:e.id,network:e.network})},n);case 20:case"end":return r.stop()}},r)}));return function(e,t){return s.apply(this,arguments)}}()}},1594(e,t,n){"use strict";n.d(t,{H:()=>l,R:()=>c});var r=n(3175),s=n(1307),i=n(6007),o=n(7265),a=n(6703),c=["snippets","blueprints","cloud-community","cloud-library","ai-agent"],l={snippets:{Component:a.N},blueprints:{Component:s.Y,demo:"announce"},"cloud-community":{Component:o.J},"cloud-library":{Component:i.c,demo:"quiet"},"ai-agent":{Component:r.F,demo:"announce"}}},4888(e,t,n){"use strict";n.d(t,{E:()=>a}),n(1609);var r=n(6942),s=n.n(r),i=n(790),o={cond:"randomize",cloud:"cloud",bundles:"screenoptions",cloud_search:"search"},a=function(e){var t=e.name,n=e.small,r=e.inverted,a=e.children;return(0,i.jsx)("span",{className:s()("badge","".concat(t,"-badge"),{"small-badge":n,"inverted-badge":r}),children:o[t]?(0,i.jsx)("span",{className:"dashicons dashicons-".concat(o[t]),"aria-hidden":"true"}):null!=a?a:t})}},2449(e,t,n){"use strict";n.d(t,{$:()=>u});var r=n(4467),s=n(45),i=(n(1609),n(6942)),o=n.n(i),a=n(790),c=["id","children","className","name","primary","secondary","small","large","link","type","onClick"];function l(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u=function(e){var t=e.id,n=e.children,r=e.className,i=e.name,l=e.primary,u=void 0!==l&&l,p=e.secondary,f=void 0!==p&&p,h=e.small,m=void 0!==h&&h,v=e.large,b=void 0!==v&&v,g=e.link,y=void 0!==g&&g,_=e.type,j=void 0===_?"button":_,w=e.onClick,x=(0,s.A)(e,c);return(0,a.jsx)("button",d(d({id:null!=t?t:i,name:i,type:j},x),{},{onClick:function(e){w&&(e.preventDefault(),w(e))},className:o()("button",r,{"button-primary":u,"button-secondary":f,"button-large":b,"button-small":m,"button-link":y}),children:n}))}},3425(e,t,n){"use strict";n.d(t,{T:()=>o}),n(1609);var r=n(7723),s=n(6427),i=n(790),o=function(e){var t=e.open,n=e.title,o=e.onConfirm,a=e.onCancel,c=e.children,l=e.confirmLabel,d=void 0===l?(0,r.__)("OK","code-snippets"):l,u=e.cancelLabel,p=void 0===u?(0,r.__)("Cancel","code-snippets"):u,f=e.confirmButtonClassName;return t?(0,i.jsxs)(s.Modal,{title:n,onRequestClose:a,closeButtonLabel:(0,r.__)("Close dialog","code-snippets"),isDismissible:!0,children:[c,(0,i.jsxs)(s.Flex,{direction:"row",justify:"flex-end",children:[(0,i.jsx)(s.Button,{variant:"tertiary",onClick:a,children:p}),(0,i.jsx)(s.Button,{variant:"primary",onClick:o,className:f,children:d})]})]}):null}},8351(e,t,n){"use strict";n.d(t,{Nx:()=>f,Sj:()=>p,Uw:()=>u,v$:()=>h});var r=n(3453),s=n(6942),i=n.n(s),o=n(1609),a=n(5150),c=n(790),l=["button:not(:disabled)","[href]","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"])'].join(", "),d=(0,o.createContext)({closeMenu:function(){}}),u=function(e){var t=e.onSelect,n=e.destructive,r=e.disabled,s=e.className,a=e.children,l=(0,o.useContext)(d).closeMenu;return(0,c.jsx)("li",{children:(0,c.jsx)("button",{type:"button",className:i()("kebab-menu-item",{"kebab-menu-item-destructive":n},s),disabled:r,onClick:function(){null==t||t(),l()},children:a})})},p=function(){return(0,c.jsx)("li",{"aria-hidden":"true",className:"kebab-menu-divider"})},f=function(e){var t=e.className,n=e.children;return(0,c.jsx)("li",{className:i()("kebab-menu-row",t),children:n})},h=function(e){var t=e.label,n=e.className,s=e.children,u=(0,o.useState)(!1),p=(0,r.A)(u,2),f=p[0],h=p[1],m=(0,o.useRef)(null),v=(0,o.useRef)(null),b=(0,o.useRef)(null),g=(0,o.useId)(),y=(0,o.useCallback)(function(){var e;h(!1),null===(e=v.current)||void 0===e||e.focus()},[]),_={isOpen:f,setIsOpen:h,closeMenu:y,containerRef:m,triggerRef:v,popoverRef:b},j=function(e){var t=e.isOpen,n=e.triggerRef,s=e.popoverRef,i=(0,o.useState)(!1),a=(0,r.A)(i,2),c=a[0],l=a[1];return(0,o.useLayoutEffect)(function(){if(t&&s.current){var e,r,i=s.current.getBoundingClientRect(),o=null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect();l(i.bottom>window.innerHeight&&(null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0)>i.height);var a=s.current.querySelector("button:not(:disabled)");(null!=a?a:s.current).focus()}else l(!1)},[t,n,s]),c}(_);return function(e){var t=e.isOpen,n=e.setIsOpen,r=e.closeMenu,s=e.containerRef,i=e.popoverRef;(0,o.useEffect)(function(){if(t){var e=function(e){var t;e.target instanceof Node&&(null===(t=s.current)||void 0===t||!t.contains(e.target))&&n(!1)},o=function(e){var t;e.target instanceof Node&&(null===(t=s.current)||void 0===t||!t.contains(e.target))&&n(!1)},a=function(e){return function(e,t){var n=t.closeMenu,r=t.popoverRef;if("Escape"===e.key)return e.preventDefault(),void n();if(r.current){var s=document.activeElement;if(!(s instanceof HTMLElement&&(s.isContentEditable||s.matches("input, select, textarea")))){var i=Array.from(r.current.querySelectorAll(l)),o=s instanceof HTMLElement?i.indexOf(s):-1;0<i.length&&["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),i[function(){switch(e.key){case"Home":return 0;case"End":return i.length-1;default:return(o+("ArrowDown"===e.key?1:-1)+i.length)%i.length}}()].focus())}}}(e,{closeMenu:r,popoverRef:i})};return document.addEventListener("mousedown",e),document.addEventListener("focusin",o),document.addEventListener("keydown",a),function(){document.removeEventListener("mousedown",e),document.removeEventListener("focusin",o),document.removeEventListener("keydown",a)}}},[t,n,r,s,i])}(_),(0,c.jsxs)("div",{ref:m,className:i()("kebab-menu",n),children:[(0,c.jsx)("button",{ref:v,type:"button",className:"kebab-menu-trigger","aria-label":t,"aria-expanded":f,"aria-controls":g,onClick:function(){return h(function(e){return!e})},children:(0,c.jsx)(a.T,{})}),f?(0,c.jsx)(d.Provider,{value:{closeMenu:y},children:(0,c.jsx)("ul",{ref:b,id:g,tabIndex:-1,"aria-label":t,className:i()("kebab-menu-popover",{"kebab-menu-popover-top":j}),children:s})}):null]})}},5497(e,t,n){"use strict";n.d(t,{i:()=>u});var r=n(4467),s=(n(1609),n(6942)),i=n.n(s),o=n(7723),a=n(790);function c(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=function(e){var t,n=e.column,r=e.cellProps,s=e.sortColumn,c=e.sortDirection,d=e.setSortColumn,u=e.setSortDirection,p=n.id===(null==s?void 0:s.id),f=p?"asc"===c?"desc":"asc":null!==(t=n.defaultSortDirection)&&void 0!==t?t:"asc",h=p?c:"asc"===f?"desc":"asc",m=p?"asc"===c?"ascending":"descending":void 0;return(0,a.jsx)("th",l(l({},r),{},{"aria-sort":m,className:i()(r.className,p?"sorted":"sortable",h),children:(0,a.jsxs)("button",{type:"button",className:"list-table-sort-button",onClick:function(){d(n),u(f)},children:[(0,a.jsx)("span",{className:"sortable-column-title",children:n.title}),(0,a.jsxs)("span",{className:"sorting-indicators",children:[(0,a.jsx)("span",{className:"sorting-indicator asc","aria-hidden":"true"}),(0,a.jsx)("span",{className:"sorting-indicator desc","aria-hidden":"true"})]}),p?null:(0,a.jsx)("span",{className:"screen-reader-text",children:"asc"===f?(0,o.__)("Sort ascending.","code-snippets"):(0,o.__)("Sort descending.","code-snippets")})]})}))},u=function(e){var t=e.items,n=e.which,r=e.getKey,s=e.columns,c=e.sortColumn,u=e.selected,p=e.setSelected,f=e.setSortColumn,h=e.sortDirection,m=e.setSortDirection;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"column-cb check-column",children:(0,a.jsx)("input",{id:"cb-select-all-".concat(n),type:"checkbox",name:"checked[]",checked:0<t.length&&t.every(function(e){return u.has(r(e))}),"aria-label":(0,o.__)("Select All","code-snippets"),onChange:function(e){p(new Set(e.target.checked?t.map(r):[]))}})}),s.map(function(e){var t={id:"head"===n?e.id.toString():void 0,scope:"col",className:i()("manage-column","column-".concat(e.id),"".concat(e.id,"-column"),{hidden:e.isHidden,"column-primary":e.isPrimary})};return e.sortedValue?(0,a.jsx)(d,{column:e,cellProps:t,sortColumn:c,sortDirection:h,setSortColumn:f,setSortDirection:m},e.id):(0,a.jsx)("th",l(l({},t),{},{children:e.title}),e.id)})]})}},3232(e,t,n){"use strict";n.d(t,{VZ:()=>j});var r=n(3453),s=n(4467),i=n(45),o=n(1609),a=n(6942),c=n.n(a),l=n(6842),d=n(5497),u=n(6671),p=n(6418),f=n(790),h=["fixed","striped","children","className"],m=["items","getKey","totalPages","pageSearchParam","initialSort"],v=["getKey","actions","columns","noItems","doAction","disabled","totalItems","totalPages","currentPage","beforeTable","endTableNav","rowClassName","visibleItems","sortDirection","extraTableNav","selectAllControl","setCurrentPage","pageSearchParam"];function b(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){(0,s.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var y=function(e,t,n){return new Set(e.map(t).filter(function(e){return n.has(e)}))},_=function(e){var t=e.fixed,n=e.striped,r=e.children,s=e.className,o=(0,i.A)(e,h);return(0,f.jsxs)("table",{className:c()("wp-list-table widefat",{striped:n,fixed:t},s),children:[(0,f.jsx)("thead",{children:(0,f.jsx)(d.i,g({which:"head"},o))}),(0,f.jsx)("tbody",{children:r}),(0,f.jsx)("tfoot",{children:(0,f.jsx)(d.i,g({which:"foot"},o))})]})},j=function(e){var t=e.items,n=e.getKey,s=e.totalPages,a=e.pageSearchParam,c=void 0===a?"paged":a,d=e.initialSort,u=(0,i.A)(e,m),p=(0,o.useState)(function(){return d?u.columns.find(function(e){return e.id===d.columnId&&e.sortedValue}):void 0}),h=(0,r.A)(p,2),v=h[0],b=h[1],y=(0,o.useState)(function(){return c&&Number((0,l.UY)(c))||1}),_=(0,r.A)(y,2),j=_[0],x=_[1],O=(0,o.useState)(function(){var e;return null!==(e=null==d?void 0:d.direction)&&void 0!==e?e:"asc"}),A=(0,r.A)(O,2),S=A[0],P=A[1],N=(0,o.useMemo)(function(){return function(e,t){var n=t.currentPage,r=t.totalPages;if(r){var s=Math.ceil(e.length/r),i=(n-1)*s,o=i+s;return e.slice(i,o)}return e}(function(e,t,n){return e.toSorted(function(e,r){var s,i,o=null==t||null===(s=t.sortedValue)||void 0===s?void 0:s.call(t,e),a=null==t||null===(i=t.sortedValue)||void 0===i?void 0:i.call(t,r);return void 0===o||void 0===a?0:o<a?"asc"===n?-1:1:o>a?"asc"===n?1:-1:0})}(t,v,S),{currentPage:j,totalPages:s})},[t,v,S,j,s]);return(0,f.jsx)(w,g({getKey:n,totalItems:t.length,totalPages:s,visibleItems:N,pageSearchParam:c,sortColumn:v,sortDirection:S,currentPage:j,setSortColumn:b,setSortDirection:P,setCurrentPage:x},u))},w=function(e){var t=e.getKey,n=e.actions,s=e.columns,a=e.noItems,c=e.doAction,l=e.disabled,d=void 0!==l&&l,h=e.totalItems,m=e.totalPages,b=e.currentPage,j=e.beforeTable,w=e.endTableNav,x=e.rowClassName,O=e.visibleItems,A=e.sortDirection,S=void 0===A?"asc":A,P=e.extraTableNav,N=e.selectAllControl,k=e.setCurrentPage,E=e.pageSearchParam,C=(0,i.A)(e,v),D=(0,o.useState)(function(){return new Set}),T=(0,r.A)(D,2),R=T[0],I=T[1];return(0,f.jsxs)(p.HJ,{totalItems:h,selected:y(O,t,R),selectAllKeys:N?O.map(t):void 0,actions:n,doAction:c,extraTableNav:P,endTableNav:w,disabled:d,currentPage:b,totalPages:m,pageSearchParam:E,setSelected:I,setCurrentPage:k,children:[j,(0,f.jsx)(_,g(g({items:O},C),{},{getKey:t,columns:s,selected:R,setSelected:I,sortDirection:S,children:(0,f.jsx)(u.o,{items:O,getKey:t,columns:s,noItems:a,rowClassName:x,selected:R,setSelected:I})}))]})}},6418(e,t,n){"use strict";n.d(t,{Aj:()=>x,HJ:()=>O});var r=n(4467),s=n(45),i=n(9394),o=n(3453),a=n(1609),c=n(7723),l=n(6427),d=n(9595),u=n(2057),p=n(5916),f=n(790),h=["which","actions","doAction","selected","setSelected","totalItems","totalPages","extraTableNav","endTableNav","selectAllKeys"],m=["children"];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 b(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){(0,r.A)(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}function g(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}var y=function(e){var t=e.actions,n=(0,a.useMemo)(function(){var e,n=[],r=new Map,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(t);try{for(s.s();!(e=s.n()).done;){var o,a=e.value;void 0===a.group?n.push(a):r.set(a.group,[].concat((0,i.A)(null!==(o=r.get(a.group))&&void 0!==o?o:[]),[a]))}}catch(e){s.e(e)}finally{s.f()}return[n,Array.from(r.entries())]},[t]),r=(0,o.A)(n,2),s=r[0],c=r[1];return(0,f.jsxs)(f.Fragment,{children:[s.map(function(e){return(0,f.jsx)("option",{value:e.key,children:e.label},e.key)}),c.map(function(e){var t=(0,o.A)(e,2),n=t[0],r=t[1];return(0,f.jsx)("optgroup",{label:n,children:r.map(function(e){return(0,f.jsx)("option",{value:e.label,children:e.label},e.label)})},n)})]})},_=function(e){var t=e.which,n=e.actions,r=e.selectedAction,s=e.setSelectedAction,i=e.label;return(0,f.jsxs)("select",{name:"action".concat("bottom"===t?"-2":""),id:"bulk-action-selector-".concat(t),value:r,onChange:function(e){var t=e.target.value;t&&"-1"!==t?function(e,t){return t.some(function(t){return t.key===e})}(t,n)&&s(t):s(void 0)},children:[(0,f.jsx)("option",{value:"-1",children:i}),(0,f.jsx)(y,{actions:n})]})},j=function(e){var t=e.which,n=e.actions,r=e.selected,s=e.doAction,i=e.onActionSuccess,p=e.disabled,h=e.selectLabel,m=(0,a.useState)(),v=(0,o.A)(m,2),b=v[0],g=v[1],y=(0,a.useState)(!1),j=(0,o.A)(y,2),w=j[0],x=j[1];return(0,f.jsxs)("div",{className:"alignleft actions bulkactions",children:[(0,f.jsx)("label",{htmlFor:"bulk-action-selector-".concat(t),className:"screen-reader-text",children:(0,c.__)("Select bulk action","code-snippets")}),(0,f.jsx)(_,{which:t,actions:n,selectedAction:b,setSelectedAction:g,label:null!=h?h:(0,c.__)("Bulk actions","code-snippets")}),(0,f.jsx)(u.b,{id:"doaction".concat("bottom"===t?"-2":""),name:"bulk_action",text:(0,c.__)("Apply","code-snippets"),className:"action",disabled:!!p||w||!b||0===r.size,onClick:function(e){e.preventDefault(),b&&(x(!0),s(b,r).then(function(){null==i||i()}).catch(d.fY).finally(function(){return x(!1)}))}}),w?(0,f.jsx)(l.Spinner,{}):null]})},w=function(e){var t=e.keys,n=e.selected,r=e.setSelected;return(0,f.jsxs)("label",{className:"tablenav-select-all",children:[(0,f.jsx)("input",{type:"checkbox",checked:0<t.length&&t.every(function(e){return n.has(e)}),disabled:0===t.length,"aria-label":(0,c.__)("Select all items","code-snippets"),onChange:function(e){var n=e.target.checked;r(function(e){var r=new Set(e);return t.forEach(function(e){return n?r.add(e):r.delete(e)}),r})}}),(0,c.__)("Select all","code-snippets")]})},x=function(e){var t=e.which,n=e.actions,r=e.doAction,i=e.selected,o=e.setSelected,a=e.totalItems,c=e.totalPages,l=void 0===c?0:c,d=e.extraTableNav,u=e.endTableNav,m=e.selectAllKeys,v=(0,s.A)(e,h),g="top"===t,y=0<a&&Boolean(n);return g&&Boolean(null!=d?d:u)||y||0<l?(0,f.jsxs)("div",{className:"tablenav ".concat(t),children:[0<a&&n&&r&&(0,f.jsx)(j,{which:t,actions:n,doAction:r,disabled:v.disabled,selected:i,onActionSuccess:function(){return o(new Set)}}),g&&m?(0,f.jsx)(w,{keys:m,selected:i,setSelected:o}):null,g?null==d?void 0:d(t):null,0<l||g&&u?(0,f.jsxs)("div",{className:"tablenav-end-group",children:[0<l&&(0,f.jsx)(p.x,b({},b({totalPages:l,totalItems:a,which:t},v))),g?null==u?void 0:u(t):null]}):null,(0,f.jsx)("br",{className:"clear"})]}):null},O=function(e){var t=e.children,n=(0,s.A)(e,m);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(x,b({which:"top"},n)),t,(0,f.jsx)(x,b({which:"bottom"},n))]})}},5916(e,t,n){"use strict";n.d(t,{x:()=>f});var r=n(4467),s=n(3453),i=n(1609),o=n(6942),a=n.n(o),c=n(7723),l=n(6842),d=n(5158),u=n(790),p=function(e){var t=e.which,n=e.disabled,r=e.totalPages,s=e.totalItems,i=e.inputValue,o=e.currentPage,l=e.pageSearchParam,p=e.setCurrentPage,f=e.setInputValue,h="top"===t?(0,c.__)("Pagination, before the table","code-snippets"):(0,c.__)("Pagination, after the table","code-snippets");return(0,u.jsx)("nav",{className:"tablenav-pages-nav","aria-label":h,children:(0,u.jsxs)("form",{className:a()("tablenav-pages",{"one-page":r&&1===r,"no-pages":!r}),onSubmit:function(e){e.preventDefault(),p(i)},children:[(0,u.jsx)("span",{className:"displaying-num",children:(0,c.sprintf)((0,c._n)("%s item","%s items",s,"code-snippets"),s)}),"\n",(0,u.jsx)(d.R,{which:t,disabled:n,totalPages:r,inputValue:i,currentPage:o,pageSearchParam:l,setCurrentPage:p,setInputValue:f})]})})},f=function(e){var t=e.which,n=e.disabled,o=e.totalItems,a=e.totalPages,c=e.currentPage,d=e.setCurrentPage,f=e.pageSearchParam,h=(0,i.useState)(c),m=(0,s.A)(h,2),v=m[0],b=m[1];return(0,u.jsx)(p,{which:t,inputValue:v,currentPage:c,totalItems:o,totalPages:a,disabled:n,setInputValue:b,setCurrentPage:function(e){if(e){var t=Math.max(1,Math.min(e,a));b(t),d(t),f&&(0,l.ev)((0,r.A)({},f,1===t?void 0:t))}}})}},5158(e,t,n){"use strict";n.d(t,{R:()=>y});var r=n(45),s=n(4467),i=(n(1609),n(7723)),o=n(6842),a=n(2449),c=n(790),l=["currentPage"],d=["currentPage","totalPages"],u=["which","totalPages","currentPage"];function p(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 f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){(0,s.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=function(e){var t=e.icon,n=e.newPage,r=e.disabled,i=e.className,l=e.helperText,d=e.setCurrentPage,u=e.pageSearchParam;return u?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("a",{className:"".concat(i," button"),href:(0,o.c$)(window.location.href,(0,s.A)({},u,1===n?void 0:n)),onClick:function(e){e.preventDefault(),d(n)},children:[(0,c.jsx)("span",{className:"screen-reader-text",children:l}),(0,c.jsx)("span",{"aria-hidden":!0,children:t})]}),"\n"]}):(0,c.jsxs)(a.$,{className:i,onClick:function(){return d(n)},disabled:r,children:[(0,c.jsx)("span",{className:"screen-reader-text",children:l}),(0,c.jsx)("span",{"aria-hidden":!0,children:t})]})},m=function(e){var t=e.currentPage,n=(0,r.A)(e,l);return 1===t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true",children:"«"}),"\n",(0,c.jsx)("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true",children:"‹"}),"\n"]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(h,f({icon:(0,c.jsx)(c.Fragment,{children:"«"}),newPage:1,className:"first-page",helperText:(0,i.__)("First page","code-snippets")},n)),"\n",(0,c.jsx)(h,f({icon:(0,c.jsx)(c.Fragment,{children:"‹"}),newPage:Math.max(1,t-1),className:"prev-page",helperText:(0,i.__)("Previous page","code-snippets")},n)),"\n"]})},v=function(e){var t=e.currentPage,n=e.totalPages,s=(0,r.A)(e,d);return n===t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true",children:"›"}),"\n",(0,c.jsx)("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true",children:"»"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(h,f({icon:(0,c.jsx)(c.Fragment,{children:"›"}),newPage:Math.min(n,t+1),className:"next-page",helperText:(0,i.__)("Next page","code-snippets")},s)),"\n",(0,c.jsx)(h,f({icon:(0,c.jsx)(c.Fragment,{children:"»"}),newPage:n,className:"last-page",helperText:(0,i.__)("Last page","code-snippets")},s)),"\n"]})},b=function(e){var t=e.which,n=e.disabled,r=e.inputName,s=e.inputValue,o=e.totalPages,a=e.setInputValue,l=e.confirmInputValue;return(0,c.jsx)("input",{className:"current-page",id:"current-page-selector-".concat(t),"aria-label":(0,i.__)("Current Page","code-snippets"),type:"text",name:r,value:s,size:o.toString().length,disabled:n,"aria-describedby":"table-paging-".concat(t),onBlur:l,onChange:function(e){var t=Number(e.target.value);t&&a(t)}})},g=function(e){var t=e.which,n=e.totalPages,s=e.currentPage,o=(0,r.A)(e,u);return"bottom"===t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Current Page","code-snippets")}),(0,c.jsx)("span",{className:"paging-input",children:(0,c.jsx)("span",{className:"tablenav-paging-text",children:(0,i.sprintf)((0,i._x)("%1$s of %2$s","paging","code-snippets"),s,n)})})]}):(0,c.jsxs)("span",{className:"paging-input",id:"table-paging-".concat(t),children:[(0,c.jsx)(b,f({which:t,totalPages:n},o)),(0,c.jsxs)("span",{className:"tablenav-paging-text",children:[" ".concat((0,i.__)("of","code-snippets")," "),(0,c.jsx)("span",{className:"total-pages",children:n})]})]})},y=function(e){var t=e.which,n=e.disabled,r=e.totalPages,s=e.inputValue,i=e.currentPage,o=e.setCurrentPage,a=e.setInputValue,l=e.pageSearchParam;return(0,c.jsxs)("span",{className:"pagination-links",children:[(0,c.jsx)(m,{disabled:n,currentPage:i,setCurrentPage:o,pageSearchParam:l}),(0,c.jsx)(g,{which:t,disabled:n,totalPages:r,currentPage:i,inputName:l,inputValue:s,setInputValue:a,confirmInputValue:function(){return o(s)}}),"\n",(0,c.jsx)(v,{disabled:n,totalPages:r,currentPage:i,setCurrentPage:o,pageSearchParam:l})]})}},6671(e,t,n){"use strict";n.d(t,{o:()=>l}),n(1609);var r=n(6942),s=n.n(r),i=n(7723),o=n(790),a=function(e){var t=e.item,n=e.selected,r=e.setSelected,s=e.getKey;return(0,o.jsx)("th",{scope:"row",className:"check-column",children:(0,o.jsx)("input",{id:"cb-select-".concat(s(t)),type:"checkbox",name:"checked[]","aria-label":(0,i.__)("Select snippet","code-snippets"),checked:n.has(s(t)),onChange:function(e){r(function(n){var r=new Set(n);return e.target.checked?r.add(s(t)):r.delete(s(t)),r})}})})},c=function(e){var t=e.item,n=e.column,r=s()("".concat(n.id,"-column"),"column-".concat(n.id),{hidden:n.isHidden});return n.isHeading?(0,o.jsx)("th",{className:r,children:n.render(t)}):(0,o.jsx)("td",{className:r,children:n.render(t)})},l=function(e){var t=e.items,n=e.getKey,r=e.columns,s=e.noItems,i=e.selected,l=e.setSelected,d=e.rowClassName;return 0<t.length?t.map(function(e){return(0,o.jsxs)("tr",{className:null==d?void 0:d(e),children:[(0,o.jsx)(a,{item:e,selected:i,setSelected:l,getKey:n}),r.map(function(t){return(0,o.jsx)(c,{item:e,column:t},t.id)})]},n(e))}):(0,o.jsx)("tr",{className:"no-items",children:(0,o.jsx)("td",{className:"colspanchange",colSpan:r.length,children:s})})}},3988(e,t,n){"use strict";n.d(t,{VZ:()=>r.VZ});var r=n(3232)},6172(e,t,n){"use strict";n.d(t,{A:()=>o}),n(1609);var r=n(7723),s=n(633),i=n(790),o=function(e){var t=e.isLoading,n=e.errorMessage,o=e.loadingNotice,a=e.noticeLabel;switch(!0){case t:return(0,i.jsx)(s.$,{"aria-label":a,className:"inline",children:(0,i.jsx)("p",{children:o})});case void 0!==n:return(0,i.jsx)(s.$,{"aria-label":a,className:"inline",type:"error",children:(0,i.jsx)("p",{children:n})});default:return(0,i.jsx)(s.$,{"aria-label":a,className:"inline",type:"warning",children:(0,i.jsx)("p",{children:(0,r.__)("An unknown error occurred. Please try again.","code-snippets")})})}}},633(e,t,n){"use strict";n.d(t,{$:()=>h,h:()=>m});var r=n(4467),s=n(45),i=n(7723),o=n(6942),a=n.n(o),c=(n(1609),n(790)),l=["className","type","children"],d=["className","onDismiss","children"];function u(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){return"error"===e||"warning"===e},h=function(e){var t=e.className,n=e.type,i=e.children,o=(0,s.A)(e,l);return(0,c.jsx)("div",p(p({className:a()("notice","code-snippets-notice",(0,r.A)({},"notice-".concat(n),n),t),role:f(n)?"alert":"status","aria-live":f(n)?"assertive":"polite"},o),{},{children:i}))},m=function(e){var t=e.className,n=e.onDismiss,r=e.children,o=(0,s.A)(e,d);return(0,c.jsxs)(h,p(p({className:a()("is-dismissible",t)},o),{},{children:[r,(0,c.jsx)("button",{type:"button",className:"notice-dismiss",onClick:function(e){e.preventDefault(),n()},children:(0,c.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Dismiss notice.","code-snippets")})})]}))}},7834(e,t,n){"use strict";n.d(t,{O:()=>o});var r=n(1609),s=n(790),i="snippets-screen-meta-slot",o=function(e){var t=e.hidden,n=void 0!==t&&t;return(0,r.useEffect)(function(){var e=document.getElementById(i),t=document.getElementById("screen-meta"),n=document.getElementById("screen-meta-links");if(e&&t&&n){var r=t.parentElement;return e.append(t,n),function(){null==r||r.prepend(t,n)}}},[]),(0,s.jsx)("div",{id:i,className:"snippets-screen-meta-slot",hidden:n})}},2677(e,t,n){"use strict";n.d(t,{v:()=>l}),n(1609);var r=n(6942),s=n.n(r),i=n(7723),o=n(3798),a=n(8526),c=n(790),l=function(e){var t=e.snippetView,n=e.setSnippetView,r=e.className;return(0,c.jsxs)("div",{className:s()("snippet-view-toggle",r),role:"group","aria-label":(0,i.__)("Snippet view","code-snippets"),children:[(0,c.jsxs)("button",{type:"button",className:s()("snippet-view-toggle-option",{"active-view":"card"===t}),"aria-pressed":"card"===t,title:(0,i.__)("Switch to card view","code-snippets"),onClick:function(){return n("card")},children:[(0,c.jsx)(o.H,{"aria-hidden":"true"}),(0,c.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Card view","code-snippets")})]}),(0,c.jsxs)("button",{type:"button",className:s()("snippet-view-toggle-option",{"active-view":"table"===t}),"aria-pressed":"table"===t,title:(0,i.__)("Switch to table view","code-snippets"),onClick:function(){return n("table")},children:[(0,c.jsx)(a.X,{"aria-hidden":"true"}),(0,c.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Table view","code-snippets")})]})]})}},2057(e,t,n){"use strict";n.d(t,{b:()=>u});var r=n(4467),s=n(45),i=(n(1609),n(6942)),o=n.n(i),a=n(7723),c=n(790),l=["id","text","name","primary","secondary","small","large","wrap","className"];function d(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 u=function(e){var t=e.id,n=e.text,i=e.name,u=void 0===i?"submit":i,p=e.primary,f=e.secondary,h=e.small,m=e.large,v=e.wrap,b=e.className,g=(0,s.A)(e,l),y=(0,c.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({id:null!=t?t:u,type:"submit",name:u,value:null!=n?n:(0,a.__)("Save Changes","code-snippets"),className:o()("button",{"button-primary":p,"button-secondary":f,"button-small":h,"button-large":m},b)},g));return v?(0,c.jsx)("p",{className:"submit",children:y}):y}},8692(e,t,n){"use strict";n.d(t,{K:()=>p,M:()=>h});var r=n(4467),s=n(6942),i=n.n(s),o=n(7723),a=(n(1609),n(6492)),c=n(8435),l=n(6842),d=n(790);function u(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}var p=function(e,t){var n,r=(0,l.UY)(t),s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(e);try{for(s.s();!(n=s.n()).done;){var i=n.value;if(i.name===r)return i}}catch(e){s.e(e)}finally{s.f()}return e[0]},f=function(e){var t=e.tab,n=e.currentTab,s=e.getTabCount,c=e.setCurrentTab,u=e.queryParamName,p=null==s?void 0:s(t);return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",className:i()("snippet-type-link","".concat(t.name,"-subnav-link"),{"active-type":t.name===n.name}),"aria-current":t.name===n.name?"page":void 0,onClick:function(){c(t),u&&(0,l.ev)((0,r.A)({},u,t.name))},children:[(0,d.jsx)("span",{children:t.label}),void 0!==p&&(0,d.jsx)("span",{className:"subnav-count",children:p}),t.pro&&!(0,a.QX)()&&(0,d.jsx)("span",{className:"pro-chip",children:(0,o.__)("Pro","code-snippets")})]})})},h=function(e){var t=e.tabs,n=e.ariaLabel,r=e.className,s=e.currentTab,o=e.getTabCount,a=e.setCurrentTab,l=e.queryParamName,u=(0,c.X)(),p=u.atStart,h=u.atEnd,m=u.scrollRef;return(0,d.jsx)("div",{className:i()("snippet-type-nav-wrapper",{"has-scroll-start":!p,"has-scroll-end":!h}),children:(0,d.jsx)("nav",{ref:m,className:i()("snippet-type-nav",r),"aria-label":n,children:(0,d.jsx)("ul",{children:t.map(function(e){return(0,d.jsx)(f,{tab:e,currentTab:s,getTabCount:o,setCurrentTab:a,queryParamName:l},e.name)})})})})}},5896(e,t,n){"use strict";n.d(t,{M:()=>I});var r,s,i=n(3453),o=n(4467),a=n(7723),c=n(6942),l=n.n(c),d=n(1609),u=n(6492),p=n(6842),f=n(1594),h=n(752),m=n(6760),v=n(6788),b=n(8586),g=n(3028),y=n(3780),_=n(401),j=n(7882),w=n(790);function x(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?x(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var A=new URLSearchParams(window.location.search),S=null!==(r=window.CODE_SNIPPETS)&&void 0!==r&&r.urls.manage?new URL(window.CODE_SNIPPETS.urls.manage).searchParams.get("page"):null,P=A.get("page")===S?null!==(s=(0,p.jW)("subpage",f.R))&&void 0!==s?s:f.R[0]:null,N=function(e){var t=e.name,n=e.url,r=e.label,s=(0,d.useMemo)(function(){return new URL(n).searchParams.get("page")},[n]),i=!A.get("subpage")&&A.get("page")===s;return(0,w.jsx)("li",{children:(0,w.jsx)("a",O(O({href:n,className:l()("".concat(t,"-link"),{"active-link":i})},!s&&{target:"_blank",rel:"noopener noreferrer"}),{},{children:r}))})},k=function(){var e,t,n,r,s;return(0,w.jsxs)(w.Fragment,{children:[(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.insights)&&(0,w.jsx)(N,{name:"insights",url:window.CODE_SNIPPETS.urls.insights,label:(0,a.__)("Insights","code-snippets")}),(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.import)&&(0,w.jsx)(N,{name:"import-snippets",url:window.CODE_SNIPPETS.urls.import,label:(0,a._x)("Import","snippets","code-snippets")}),(null===(n=window.CODE_SNIPPETS)||void 0===n?void 0:n.urls.welcome)&&(0,w.jsx)(N,{name:"welcome",url:window.CODE_SNIPPETS.urls.welcome,label:(0,a.__)("What's New","code-snippets")}),(0,w.jsx)(N,{name:"docs",url:"https://codesnippets.pro/docs",label:(0,a.__)("Docs","code-snippets")}),(0,w.jsx)(N,{name:"cloud",url:null!==(r=null===(s=window.CODE_SNIPPETS)||void 0===s?void 0:s.urls.cloud)&&void 0!==r?r:"https://codesnippets.cloud",label:(0,a.__)("Cloud Dashboard","code-snippets")})]})},E=function(){return(0,w.jsx)("li",{className:"toolbar-more-item",children:(0,w.jsxs)("details",{className:"toolbar-more-menu",children:[(0,w.jsxs)("summary",{children:[(0,a.__)("More","code-snippets"),(0,w.jsx)("span",{className:"dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})]}),(0,w.jsx)("ul",{children:(0,w.jsx)(k,{})})]})})},C=function(){var e,t=(0,d.useState)(!1),n=(0,i.A)(t,2),r=n[0],s=n[1];return(0,w.jsxs)("div",{className:"code-snippets-toolbar-upper",children:[(0,w.jsxs)("div",{className:"logo",children:[(0,w.jsx)("img",{src:"".concat(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.plugin,"/assets/icon.svg"),alt:(0,a.__)("Code Snippets logo","code-snippets"),"aria-hidden":"true"}),(0,w.jsx)("div",{children:(0,a.__)("Code Snippets","code-snippets")})]}),(0,w.jsx)("nav",{"aria-label":(0,a.__)("Main links","code-snippets"),children:(0,w.jsxs)("ul",{children:[(0,w.jsx)(k,{}),(0,w.jsx)(E,{}),(0,u.W9)()&&(0,w.jsx)("li",{className:"toolbar-upgrade-item",children:(0,w.jsx)("a",{className:"button button-large button-secondary",href:"https://codesnippets.pro/pricing/",target:"_blank",rel:"noopener noreferrer",onClick:function(e){e.preventDefault(),s(!0)},children:(0,a.__)("Upgrade to Pro","code-snippets")})})]})}),(0,w.jsx)(j.o,{isOpen:r,setIsOpen:s})]})},D=function(e){var t,n=e.subpage,r=e.label,s=e.Icon,i=f.H[n],o=i.demo,c=i.isPro,d="announce"===o&&!(0,h.F)(n);return(0,w.jsx)("li",{children:(0,w.jsxs)("a",{href:(0,p.c$)(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.manage,{subpage:n}),className:l()("".concat(n,"-link"),{"active-link":n===P}),children:[(0,w.jsx)(s,{"aria-hidden":"true"}),(0,w.jsx)("span",{className:"toolbar-nav-label",children:r}),o&&(d?(0,w.jsx)("span",{className:"new-chip",children:(0,a.__)("New","code-snippets")}):(0,w.jsx)("span",{className:"demo-chip",children:(0,a.__)("Demo","code-snippets")})),c&&!(0,u.QX)()&&(0,w.jsx)("span",{className:"pro-chip",children:(0,a.__)("Pro","code-snippets")})]})})},T=function(){var e;return null!==(e=window.CODE_SNIPPETS)&&void 0!==e&&e.urls.settings?(0,w.jsx)("li",{children:(0,w.jsxs)("a",{href:window.CODE_SNIPPETS.urls.settings,className:l()("settings-link",{"active-link":"snippets-settings"===A.get("page")}),children:[(0,w.jsx)(y.Z,{"aria-hidden":"true"}),(0,w.jsx)("span",{className:"toolbar-nav-label",children:(0,a.__)("Settings","code-snippets")})]})}):null},R=function(){return(0,w.jsx)("div",{className:"code-snippets-toolbar-lower",children:(0,w.jsx)("nav",{"aria-label":(0,a.__)("Main features","code-snippets"),children:(0,w.jsxs)("ul",{children:[(0,w.jsx)(D,{subpage:"snippets",label:(0,a.__)("Snippets","code-snippets"),Icon:_.M}),(0,u.QX)()&&(0,w.jsx)(D,{subpage:"blueprints",label:(0,a.__)("Blueprints","code-snippets"),Icon:v.J}),(0,w.jsx)(D,{subpage:"cloud-community",label:(0,a.__)("Cloud Community","code-snippets"),Icon:b.z}),(0,w.jsx)(D,{subpage:"cloud-library",label:(0,a.__)("Cloud Library","code-snippets"),Icon:g.$}),!(0,u.QX)()&&(0,w.jsx)(D,{subpage:"blueprints",label:(0,a.__)("Blueprints","code-snippets"),Icon:v.J}),(0,w.jsx)(D,{subpage:"ai-agent",label:(0,a.__)("AI Agent","code-snippets"),Icon:m.L}),(0,w.jsx)(T,{})]})})})},I=function(){return(0,w.jsxs)("div",{className:"code-snippets-toolbar",children:[(0,w.jsx)(C,{}),(0,w.jsx)(R,{})]})}},3336(e,t,n){"use strict";n.d(t,{m:()=>l,y:()=>d});var r=n(1609),s=n(6942),i=n.n(s),o=n(7723),a=n(7947),c=n(790),l=function(e){var t=e.block,n=e.inline,s=e.start,a=e.end,l=e.icon,d=e.className,u=e.children,p=e.label,f=(0,r.useId)();return(0,c.jsxs)("div",{className:i()("tooltip help-tooltip",{"tooltip-block":t,"tooltip-inline":n,"tooltip-start":s,"tooltip-end":a},d),children:[(0,c.jsx)("button",{type:"button",className:"tooltip-trigger","aria-label":null!=p?p:(0,o.__)("More information","code-snippets"),"aria-describedby":f,children:null!=l?l:(0,c.jsx)("span",{className:"dashicons dashicons-editor-help","aria-hidden":"true"})}),(0,c.jsx)("div",{role:"tooltip",className:"tooltip-content",id:f,children:u})]})},d=function(e){var t=e.message;return(0,c.jsx)(l,{block:!0,end:!0,label:(0,o.__)("Error","code-snippets"),icon:(0,c.jsx)("span",{className:"dashicons dashicons-warning","aria-hidden":"true"}),children:"".concat((0,a.Bu)(t,".!?"),". ").concat((0,o.__)("Please try again.","code-snippets"))})}},7882(e,t,n){"use strict";n.d(t,{o:()=>a,p:()=>l});var r=n(6087),s=(n(1609),n(7723)),i=n(6427),o=n(790),a=function(e){var t,n=e.isOpen,r=e.setIsOpen;return n?(0,o.jsxs)(i.Modal,{"aria-labelledby":"code-snippets-upsell-dialog-title",className:"code-snippets-upsell code-snippets-upsell-dialog",onRequestClose:function(){r(!1)},children:[(0,o.jsx)("img",{src:"".concat(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.plugin,"/assets/icon.svg"),alt:(0,s.__)("Code Snippets logo","code-snippets")}),(0,o.jsx)(c,{})]}):null},c=function(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h1",{id:"code-snippets-upsell-dialog-title",children:(0,r.createInterpolateElement)((0,s.__)("Unlock all cloud sync features and many more, with <span>Code Snippets Pro</span>","code-snippets"),{span:(0,o.jsx)("span",{})})}),(0,o.jsx)("p",{children:(0,r.createInterpolateElement)((0,s.__)("With Code Snippets Pro you can connect your WordPress sites to the code snippets cloud platform and be able to <strong>backup, synchronise, collaborate, and deploy</strong> your snippets from one central location.","code-snippets"),{strong:(0,o.jsx)("strong",{})})}),(0,o.jsx)("a",{href:"https://codesnippets.pro/pricing/",className:"button button-primary button-large",rel:"noreferrer",target:"_blank",children:(0,s.__)("Explore Code Snippets Pro","code-snippets")}),(0,o.jsx)("p",{children:(0,s.__)("Here's what else you get with Pro:","code-snippets")}),(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:(0,s.__)("Create, explain and verify snippets with AI","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Control when snippets run with Conditions","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("CSS stylesheet snippets","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Minified JavaScript snippets","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Editor blocks and Elementor widgets","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Cloud sync and backup","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Cloud share and deploy","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("Cloud bundles and teams","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("WP-CLI commands","code-snippets")}),(0,o.jsx)("li",{children:(0,s.__)("And much more!","code-snippets")})]})]})},l=function(){return(0,o.jsx)("div",{className:"code-snippets-upsell code-snippets-upsell-page",children:(0,o.jsx)(c,{})})}},1971(e,t,n){"use strict";n.d(t,{J:()=>g,U:()=>v});var r=n(3453),s=n(8443),i=n(7723),o=n(1609),a=n(7871),c=n(7947),l=n(4888),d=n(2449),u=n(2527),p=n(7166),f=n(9345),h=n(6254),m=n(790),v=function(e){var t,n=e.codevaultSlug;return(0,m.jsx)("p",{className:"cloud-snippet-author",children:(0,m.jsx)("a",{href:"".concat(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.cloud,"/codevault/").concat(n),target:"_blank",rel:"noopener noreferrer",children:(0,i.sprintf)((0,i.__)("By %s","code-snippets"),n)})})},b=function(e){var t=e.snippet,n=e.author,r=e.setIsPreviewOpen;return(0,m.jsxs)("div",{className:"cloud-snippet card-inner",children:[(0,m.jsxs)("div",{className:"snippet-card-header",children:[(0,m.jsx)(l.E,{name:(0,a.yo)(t)}),(0,m.jsx)("h3",{children:(0,m.jsx)("button",{type:"button",className:"cloud-snippet-title-button",title:(0,i.__)("Preview this snippet","code-snippets"),onClick:function(){r(!0)},children:t.name})})]}),0<t.tags.length||t.updated?(0,m.jsxs)("div",{className:"snippet-card-meta",children:[0<t.tags.length?(0,m.jsxs)("span",{className:"cloud-snippet-tags",children:[(0,m.jsx)("span",{className:"snippet-card-tags-label",children:(0,i.__)("Tags:","code-snippets")})," ",t.tags.join(", ")]}):null,t.updated?(0,m.jsx)("time",{className:"snippet-card-modified",dateTime:t.updated,title:t.updated,children:(0,i.sprintf)((0,i.__)("Modified %s","code-snippets"),(0,s.humanTimeDiff)(t.updated,void 0))}):null]}):null,t.description?(0,m.jsx)("p",{className:"snippet-description-content",children:(0,c.UT)((0,c.Kq)(t.description))}):null,n]})},g=function(e){var t=e.snippet,n=e.author,s=e.isSelected,a=void 0!==s&&s,c=e.onSelectedChange,l=e.onSnippetDownloaded,v=(0,o.useState)(!1),g=(0,r.A)(v,2),y=g[0],_=g[1];return(0,m.jsxs)(u.Y,{className:"cloud-search-result",isSelected:a,onSelectedChange:c,selectionLabel:(0,i.sprintf)((0,i.__)("Select %s","code-snippets"),t.name),footerStatus:(0,m.jsx)(f.hQ,{status:t.status}),footer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.$,{secondary:!0,onClick:function(){return _(!0)},children:(0,i.__)("Preview","code-snippets")}),(0,m.jsx)(h.l,{snippet:t,onDownloaded:l})]}),children:[(0,m.jsx)(b,{snippet:t,author:n,setIsPreviewOpen:_}),y&&(0,m.jsx)(p.Iw,{snippet:t,setIsOpen:_,onDownloaded:l})]})}},6254(e,t,n){"use strict";n.d(t,{l:()=>v});var r=n(3453),s=n(1609),i=n(7723),o=n(6427),a=n(1240),c=n(2456),l=n(7871),d=n(6492),u=n(2449),p=n(3336),f=n(7882),h=n(921),m=n(790),v=function(e){var t,n,v=e.snippet,b=e.onDownloaded,g=(0,a._)().api,y=(0,h.H)(),_=y.downloadRecords,j=y.updateDownloadRecord,w=(0,s.useState)(),x=(0,r.A)(w,2),O=x[0],A=x[1],S=(0,s.useState)(!1),P=(0,r.A)(S,2),N=P[0],k=P[1],E=null!==(t=_[v.id])&&void 0!==t?t:{},C=E.isDownloading,D=void 0!==C&&C,T=E.localId,R=null!==(n=v.local_id)&&void 0!==n?n:T;return R?(0,m.jsx)("a",{className:"button button-primary",href:(0,l.l)({id:R}),target:"_blank",rel:"noopener noreferrer",children:(0,i.__)("Edit","code-snippets")}):(0,l.B6)(v)&&!(0,d.QX)()?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u.$,{className:"cloud-pro-button",onClick:function(){return k(!0)},children:(0,i.__)("Pro Only","code-snippets")}),(0,m.jsx)(f.o,{isOpen:N,setIsOpen:k})]}):(0,m.jsxs)(m.Fragment,{children:[D&&(0,m.jsx)(o.Spinner,{}),O&&(0,m.jsx)(p.y,{message:O}),(0,m.jsx)(u.$,{primary:!0,onClick:function(){j(v.id,{isDownloading:!0}),A(void 0),g.post("".concat(c.St.cloud.snippets,"/").concat(v.id,"/download")).then(function(e){j(v.id,{localId:e.snippet_id}),null==b||b()}).catch(function(e){A("string"==typeof e?e:(0,i.__)("An error occurred while trying to download the snippet.","code-snippets"))}).finally(function(){return j(v.id,{isDownloading:!1})})},disabled:D,children:(0,i.__)("Download","code-snippets")})]})}},9345(e,t,n){"use strict";n.d(t,{Jv:()=>u,hQ:()=>d});var r=n(4467),s=(n(1609),n(7723)),i=n(4148),o=n(790),a=function(e){switch(e){case i.i.Public:return(0,s.__)("Public","code-snippets");case i.i.Private:return(0,s.__)("Private","code-snippets");case i.i.Unverified:return(0,s.__)("Unverified","code-snippets");case i.i.AI_Verified:return(0,s.__)("AI Verified","code-snippets");case i.i.Pro_Verified:return(0,s.__)("Pro Verified","code-snippets");default:return(0,s.__)("Unknown","code-snippets")}},c=(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},i.i.Public,"public"),i.i.Private,"private"),i.i.Unverified,"failure"),i.i.AI_Verified,"info"),i.i.Pro_Verified,"success"),l=function(e){var t;return null===(t=i.i[e])||void 0===t?void 0:t.toLowerCase().replace("_","-")},d=function(e){var t,n=e.status;return(0,o.jsx)("span",{className:"cloud-snippet-status cloud-snippet-status-".concat(null!==(t=l(n))&&void 0!==t?t:"unknown"),children:a(n)})},u=function(e){var t,n=e.status;return(0,o.jsx)("span",{className:"badge ".concat(null!==(t=c[n])&&void 0!==t?t:"neutral","-badge"),children:a(n)})}},921(e,t,n){"use strict";n.d(t,{H:()=>f,J:()=>h});var r=n(4467),s=n(3453),i=n(1609),o=n(9028),a=n(790);function c(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=(0,o.h)("useCloudSnippetDownloads"),u=(0,s.A)(d,2),p=u[0],f=u[1],h=function(e){var t=e.children,n=(0,i.useState)({}),o=(0,s.A)(n,2),c=o[0],d=o[1],u=(0,i.useCallback)(function(e,t){return d(function(n){return l(l({},n),{},(0,r.A)({},e,l(l({isDownloading:!1},n[e]),t)))})},[]);return(0,a.jsx)(p.Provider,{value:{downloadRecords:c,updateDownloadRecord:u},children:t})}},7738(e,t,n){"use strict";n.d(t,{e:()=>s}),n(1609);var r=n(790),s=function(e){var t=e.callout;return t?(0,r.jsxs)("aside",{className:"demo-callout","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"demo-callout__step",children:t.step}),(0,r.jsx)("h3",{className:"demo-callout__title",children:t.title}),(0,r.jsx)("p",{className:"demo-callout__body",children:t.body})]},t.title):null}},6094(e,t,n){"use strict";n.d(t,{G:()=>o}),n(1609);var r=n(7723),s=n(2449),i=n(790),o=function(e){var t=e.title,n=e.description,o=e.hasStarted,a=e.isFinished,c=e.onPlay,l=e.onSkip,d=e.onReplay;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"snippets-page-header demo-page-header",children:[(0,i.jsxs)("h1",{children:[t,(0,i.jsx)("span",{className:"demo-chip",children:(0,r.__)("Demo","code-snippets")})]}),(0,i.jsxs)("div",{className:"demo-controls",children:[!o&&(0,i.jsx)(s.$,{primary:!0,large:!0,type:"button",className:"demo-play",onClick:c,children:(0,r.__)("Play demo","code-snippets")}),o&&!a&&(0,i.jsx)(s.$,{secondary:!0,type:"button",onClick:l,children:(0,r.__)("Skip animation","code-snippets")}),a&&(0,i.jsx)(s.$,{primary:!0,type:"button",onClick:d,children:(0,r.__)("Run demo again","code-snippets")})]})]}),(0,i.jsx)("p",{className:"snippets-page-description",children:n})]})}},7894(e,t,n){"use strict";n.d(t,{e:()=>o});var r=n(3453),s=n(1609),i=n(790),o=function(e){var t=e.target,n=e.padding,o=void 0===n?8:n,a=(0,s.useState)(),c=(0,r.A)(a,2),l=c[0],d=c[1],u=(0,s.useCallback)(function(){d(t?function(e,t){var n=document.querySelector(e);if(n){var r=n.getBoundingClientRect();return{top:r.top-t,left:r.left-t,width:r.width+2*t,height:r.height+2*t}}}(t,o):void 0)},[o,t]);if((0,s.useEffect)(function(){if(u(),t){var e=new ResizeObserver(u);return e.observe(document.body),window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),function(){e.disconnect(),window.removeEventListener("scroll",u),window.removeEventListener("resize",u)}}},[u,t]),!l)return null;var p=l.top,f=l.left,h=l.width,m=l.height,v=[{insetBlockStart:0,insetInlineStart:0,inlineSize:"100%",blockSize:"".concat(Math.max(0,p),"px")},{insetBlockStart:"".concat(p+m,"px"),insetInlineStart:0,inlineSize:"100%",insetBlockEnd:0},{insetBlockStart:"".concat(p,"px"),insetInlineStart:0,inlineSize:"".concat(Math.max(0,f),"px"),blockSize:"".concat(m,"px")},{insetBlockStart:"".concat(p,"px"),insetInlineStart:"".concat(f+h,"px"),insetInlineEnd:0,blockSize:"".concat(m,"px")}],b={insetBlockStart:"".concat(p,"px"),insetInlineStart:"".concat(f,"px"),inlineSize:"".concat(h,"px"),blockSize:"".concat(m,"px")};return(0,i.jsxs)("div",{className:"demo-spotlight","aria-hidden":"true",children:[v.map(function(e,t){return(0,i.jsx)("div",{className:"demo-spotlight__panel",style:e},t)}),(0,i.jsx)("div",{className:"demo-spotlight__ring",style:b})]})}},1075(e,t,n){"use strict";n.d(t,{T:()=>o}),n(1609);var r=n(7723),s=n(2449),i=n(790),o=function(e){var t=e.title,n=e.children,o=e.onReplay;return(0,i.jsxs)("div",{className:"demo-upsell",children:[(0,i.jsx)("h2",{className:"demo-upsell__title",children:t}),n,(0,i.jsxs)("div",{className:"demo-upsell__actions",children:[(0,i.jsx)("a",{className:"button button-primary button-large",href:"https://codesnippets.pro/pricing/",target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("Upgrade to Pro","code-snippets")}),(0,i.jsx)(s.$,{secondary:!0,type:"button",onClick:o,children:(0,r.__)("Run demo again","code-snippets")})]})]})}},752(e,t,n){"use strict";n.d(t,{F:()=>a,J:()=>c});var r=n(1609),s=n(1240),i=n(9595),o=n(2456),a=function(e){var t,n;return null!==(t=null===(n=window.CODE_SNIPPETS)||void 0===n||null===(n=n.demosSeen)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},c=function(e){var t=(0,s._)().api,n=(0,r.useRef)(!1);return(0,r.useCallback)(function(){n.current||a(e)||(n.current=!0,t.post(o.St.preferences.demosSeen,{demo:e}).catch(i.fY))},[t,e])}},6760(e,t,n){"use strict";n.d(t,{L:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M13 3.25l2.167 5.583L20.75 11l-5.583 2.167L13 18.75l-2.167-5.583L5.25 11l5.583-2.167L13 3.25zM20.583 17.333l.65 1.734 1.734.65-1.734.65-.65 1.733-.65-1.733-1.733-.65 1.733-.65.65-1.734z"})}))}},6788(e,t,n){"use strict";n.d(t,{J:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"M19.499 17.334a2.167 2.167 0 1 1-2.167 2.167m2.167-2.167a2.167 2.167 0 0 0-2.167 2.167m2.167-2.167V8.667m-2.167 10.834H8.665m0 0A2.167 2.167 0 0 0 6.5 17.334m2.166 2.167A2.167 2.167 0 1 1 6.5 17.334m0 0V8.667m2.166-2.166A2.167 2.167 0 1 0 6.5 8.667m2.166-2.166A2.167 2.167 0 0 1 6.5 8.667m2.166-2.166h8.667m0 0a2.167 2.167 0 1 1 2.167 2.166m-2.167-2.166a2.167 2.167 0 0 0 2.167 2.166M8.124 8.126l9.75 9.75m-9.75 0 9.75-9.75"})}))}},3798(e,t,n){"use strict";n.d(t,{H:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsxs)("svg",o(o({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,s.jsx)("rect",{x:"2",y:"2",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.6"}),(0,s.jsx)("rect",{x:"10.5",y:"2",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.6"}),(0,s.jsx)("rect",{x:"2",y:"10.5",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.6"}),(0,s.jsx)("rect",{x:"10.5",y:"10.5",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.6"})]}))}},8586(e,t,n){"use strict";n.d(t,{z:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M20.0417 20.0417L22.75 22.75M4.33333 6.5H21.6667M4.33333 13H8.66666M4.33333 19.5H8.66666M11.9167 16.25C11.9167 17.3993 12.3732 18.5015 13.1859 19.3141C13.9985 20.1268 15.1007 20.5833 16.25 20.5833C17.3993 20.5833 18.5015 20.1268 19.3141 19.3141C20.1268 18.5015 20.5833 17.3993 20.5833 16.25C20.5833 15.1007 20.1268 13.9985 19.3141 13.1859C18.5015 12.3732 17.3993 11.9167 16.25 11.9167C15.1007 11.9167 13.9985 12.3732 13.1859 13.1859C12.3732 13.9985 11.9167 15.1007 11.9167 16.25Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},5150(e,t,n){"use strict";n.d(t,{T:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsxs)("svg",o(o({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,s.jsx)("circle",{cx:"9",cy:"3.5",r:"1.6",fill:"currentColor"}),(0,s.jsx)("circle",{cx:"9",cy:"9",r:"1.6",fill:"currentColor"}),(0,s.jsx)("circle",{cx:"9",cy:"14.5",r:"1.6",fill:"currentColor"})]}))}},3028(e,t,n){"use strict";n.d(t,{$:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M11.9167 19.5045H7.21175C4.42541 19.5002 2.16666 17.326 2.16666 14.6436C2.16666 11.9624 4.42541 9.78812 7.21175 9.78812C7.6375 7.87928 9.15525 6.32145 11.193 5.7007C13.2297 5.08103 15.4787 5.49162 17.0907 6.78403C18.7027 8.0732 19.4328 10.0416 19.0082 11.9505H20.0807C20.8821 11.9519 21.6621 12.2097 22.3067 12.686C22.9513 13.1624 23.4266 13.8324 23.6632 14.5981M21.6667 22.7502L23.8333 20.5835L21.6667 18.4169M18.4167 18.4169L16.25 20.5835L18.4167 22.7502",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},3780(e,t,n){"use strict";n.d(t,{Z:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsxs)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,s.jsx)("path",{d:"M11.1854 4.67675C11.6469 2.77442 14.3531 2.77442 14.8146 4.67675C14.8838 4.96253 15.0196 5.22793 15.2108 5.45133C15.402 5.67474 15.6432 5.84984 15.9149 5.96239C16.1865 6.07494 16.4809 6.12176 16.7741 6.09902C17.0673 6.07629 17.3509 5.98466 17.602 5.83158C19.2736 4.81325 21.1878 6.72642 20.1695 8.39908C20.0166 8.65004 19.9252 8.93353 19.9025 9.2265C19.8798 9.51948 19.9266 9.81367 20.039 10.0852C20.1514 10.3567 20.3263 10.5978 20.5495 10.789C20.7726 10.9802 21.0377 11.116 21.3233 11.1854C23.2256 11.6469 23.2256 14.3531 21.3233 14.8146C21.0375 14.8838 20.7721 15.0196 20.5487 15.2108C20.3253 15.402 20.1502 15.6432 20.0376 15.9149C19.9251 16.1865 19.8782 16.4809 19.901 16.7741C19.9237 17.0673 20.0153 17.3509 20.1684 17.602C21.1868 19.2736 19.2736 21.1878 17.6009 20.1695C17.35 20.0166 17.0665 19.9252 16.7735 19.9025C16.4805 19.8798 16.1863 19.9266 15.9148 20.039C15.6433 20.1514 15.4022 20.3263 15.211 20.5495C15.0198 20.7726 14.884 21.0377 14.8146 21.3233C14.3531 23.2256 11.6469 23.2256 11.1854 21.3233C11.1162 21.0375 10.9804 20.7721 10.7892 20.5487C10.598 20.3253 10.3568 20.1502 10.0851 20.0376C9.81347 19.9251 9.51907 19.8782 9.2259 19.901C8.93273 19.9237 8.64907 20.0153 8.398 20.1684C6.72642 21.1868 4.81217 19.2736 5.8305 17.6009C5.98336 17.35 6.07485 17.0665 6.09752 16.7735C6.1202 16.4805 6.07343 16.1863 5.96101 15.9148C5.84859 15.6433 5.6737 15.4022 5.45055 15.211C5.22739 15.0198 4.96228 14.884 4.67675 14.8146C2.77442 14.3531 2.77442 11.6469 4.67675 11.1854C4.96253 11.1162 5.22793 10.9804 5.45133 10.7892C5.67474 10.598 5.84984 10.3568 5.96239 10.0851C6.07494 9.81347 6.12176 9.51907 6.09902 9.2259C6.07629 8.93273 5.98466 8.64907 5.83158 8.398C4.81325 6.72642 6.72642 4.81217 8.39908 5.8305C9.48242 6.48917 10.8864 5.90633 11.1854 4.67675Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M9.75 13C9.75 13.862 10.0924 14.6886 10.7019 15.2981C11.3114 15.9076 12.138 16.25 13 16.25C13.862 16.25 14.6886 15.9076 15.2981 15.2981C15.9076 14.6886 16.25 13.862 16.25 13C16.25 12.138 15.9076 11.3114 15.2981 10.7019C14.6886 10.0924 13.862 9.75 13 9.75C12.138 9.75 11.3114 10.0924 10.7019 10.7019C10.0924 11.3114 9.75 12.138 9.75 13Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))}},401(e,t,n){"use strict";n.d(t,{M:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M7.58333 8.66634L3.25 12.9997L7.58333 17.333M18.4167 8.66634L22.75 12.9997L18.4167 17.333M15.1667 4.33301L10.8333 21.6663",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}},8526(e,t,n){"use strict";n.d(t,{X:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M2.5 4.5H15.5M2.5 9H15.5M2.5 13.5H15.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})}))}},1973(e,t,n){"use strict";n.d(t,{s:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M5.09053 13.7643C3.12371 13.7643 1.5293 12.2296 1.5293 10.3362C1.5293 8.44351 3.12371 6.90874 5.09053 6.90874C5.39106 5.56133 6.46242 4.46168 7.90083 4.02351C9.33848 3.58609 10.926 3.87592 12.0639 4.78821C13.2018 5.69821 13.7172 7.08768 13.4174 8.4351H14.1745C15.6374 8.4351 16.8234 9.62804 16.8234 11.1009C16.8234 12.5745 15.6374 13.7674 14.1737 13.7674H5.09053",stroke:"#6A8083",strokeWidth:"1.41177",strokeLinecap:"round",strokeLinejoin:"round"})}))}},6166(e,t,n){"use strict";n.d(t,{f:()=>a});var r=n(4467),s=(n(1609),n(790));function i(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?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a=function(e){return(0,s.jsx)("svg",o(o({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,s.jsx)("path",{d:"M8.41165 13.7674H5.09053C3.12371 13.7643 1.5293 12.2296 1.5293 10.3362C1.5293 8.44351 3.12371 6.90874 5.09053 6.90874C5.39106 5.56133 6.46242 4.46168 7.90083 4.02351C9.33848 3.58609 10.926 3.87592 12.0639 4.78821C13.2018 5.69821 13.7172 7.08768 13.4174 8.4351H14.1745C15.2359 8.4351 16.1512 9.06216 16.5741 9.96986M11.4705 14.529L12.9999 16.0585L16.0587 12.9996",stroke:"#0BAEC3",strokeWidth:"1.41177",strokeLinecap:"round",strokeLinejoin:"round"})}))}},2335(e,t,n){"use strict";n.d(t,{K:()=>m,S:()=>v});var r=n(467),s=n(3453),i=n(4756),o=n.n(i),a=n(1609),c=n(7723),l=n(6087),d=n(3425),u=n(8192),p=n(790),f=function(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{style:{marginBlockStart:0},children:(0,l.createInterpolateElement)((0,c.__)("This snippet is currently <strong>active</strong>.","code-snippets"),{strong:(0,p.jsx)("strong",{})})}),(0,p.jsx)("p",{children:(0,c.__)("Moving it to the trash will also deactivate it.","code-snippets")})]})},h=function(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{style:{marginBlockStart:0},children:(0,l.createInterpolateElement)((0,c.__)("The snippet will be <strong>permanently deleted</strong>.","code-snippets"),{strong:(0,p.jsx)("strong",{})})}),(0,p.jsx)("p",{children:(0,c.__)("This action cannot be undone.","code-snippets")})]})},m=function(e){var t=e.snippet,n=e.isDialogOpen,r=e.setIsDialogOpen,s=e.makeDeleteRequest;return(0,p.jsx)(d.T,{open:n,title:(0,c.__)("Are you sure?","code-snippets"),confirmLabel:t.trashed?(0,c.__)("Delete","code-snippets"):(0,c.__)("Trash","code-snippets"),confirmButtonClassName:"is-destructive",onCancel:function(){return r(!1)},onConfirm:function(){r(!1),s()},children:t.trashed?(0,p.jsx)(h,{}):(0,p.jsx)(f,{})})},v=function(e){var t=e.snippet,n=e.setIsWorking,i=e.onSuccess,c=e.onError,l=(0,u.q)(),d=(0,a.useState)(!1),p=(0,s.A)(d,2),f=p[0],h=p[1],m=function(){var e=(0,r.A)(o().mark(function e(){return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return null==n||n(!0),e.prev=1,e.next=4,l.delete(t);case 4:return e.next=6,null==i?void 0:i();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),null==c||c(e.t0);case 11:return e.prev=11,null==n||n(!1),e.finish(11);case 14:case"end":return e.stop()}},e,null,[[1,8,11,14]])}));return function(){return e.apply(this,arguments)}}(),v=function(){var e=(0,r.A)(o().mark(function e(){return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.active&&!t.trashed){e.next=4;break}h(!0),e.next=6;break;case 4:return e.next=6,m();case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();return{requestDelete:v,deleteDialogProps:{snippet:t,isDialogOpen:f,setIsDialogOpen:h,makeDeleteRequest:m}}}},2527(e,t,n){"use strict";n.d(t,{Y:()=>o}),n(1609);var r=n(6942),s=n.n(r),i=n(790),o=function(e){var t=e.className,n=e.isSelected,r=void 0!==n&&n,o=e.onSelectedChange,a=e.selectionLabel,c=e.footer,l=e.footerStatus,d=e.children;return(0,i.jsxs)("li",{className:s()("code-snippets-card",t,{"is-selectable":void 0!==o,"is-selected":void 0!==o&&r}),children:[void 0!==o?(0,i.jsx)("div",{className:"snippet-card-corner",children:(0,i.jsx)("input",{type:"checkbox",className:"snippet-card-select",checked:r,"aria-label":a,onChange:function(e){return o(e.target.checked)}})}):null,d,void 0!==c||void 0!==l?(0,i.jsxs)("footer",{children:[(0,i.jsx)("div",{className:"snippet-card-footer-status",children:l}),(0,i.jsx)("div",{className:"snippet-card-footer-actions",children:c})]}):null]})}},7166(e,t,n){"use strict";n.d(t,{FJ:()=>k,Iw:()=>S,M3:()=>A});var r=n(4467),s=n(3453),i=n(6427),o=n(7723),a=n(1609),c=n(8192),l=n(30),d=n(9595),u=n(3661),p=n(7871),f=n(4888),h=n(2449),m=n(6254),v=n(2335),b=n(790);function g(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 y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _={css:"text/css",js:"javascript",php:"text/x-php",html:"application/x-httpd-php"},j=function(){return window.isSecureContext?navigator.clipboard:void 0},w=function(e){var t,n,r;return{extraKeys:{Tab:!1,"Shift-Tab":!1},readOnly:!0,lineNumbers:!0,theme:null!==(t=null===(n=window.CODE_SNIPPETS_MANAGE)||void 0===n?void 0:n.editorTheme)&&void 0!==t?t:"default",mode:null!==(r=_[e])&&void 0!==r?r:_.php,screenReaderLabel:(0,o.__)("Snippet code preview","code-snippets")}},x=function(e){return e[e.Ready=0]="Ready",e[e.Copied=1]="Copied",e[e.Failed=2]="Failed",e}(x||{}),O=function(e){var t=e.code,n=(0,a.useState)(x.Ready),r=(0,s.A)(n,2),i=r[0],c=r[1];return(0,b.jsx)(h.$,{secondary:!0,onClick:function(){var e=j();e?e.writeText(t).then(function(){return c(x.Copied)}).catch(function(){return c(x.Failed)}):c(x.Failed)},children:function(){switch(i){case x.Copied:return(0,o.__)("Copied","code-snippets");case x.Failed:return(0,o.__)("Copy unavailable","code-snippets");case x.Ready:return(0,o.__)("Copy code","code-snippets")}}()})},A=function(e){var t=e.onRequestClose,n=e.title,r=e.type,s=e.code,c=e.children,l=(0,a.useRef)(null);return(0,a.useEffect)(function(){if(l.current&&window.wp.codeEditor){var e=window.wp.codeEditor.initialize(l.current,{codemirror:w(r)});return e.codemirror.getInputField().setAttribute("aria-label",(0,o.__)("Snippet code preview","code-snippets")),function(){e.codemirror.toTextArea()}}},[r]),(0,b.jsxs)(i.Modal,{className:"code-snippets-preview-modal",onRequestClose:t,title:n,headerActions:(0,b.jsx)("div",{className:"code-snippets-preview-modal__badge",children:(0,b.jsx)(f.E,{name:r})}),children:[(0,b.jsx)("div",{className:"code-snippets-preview-modal__editor",children:(0,b.jsx)("textarea",{ref:l,readOnly:!0,"aria-label":(0,o.__)("Snippet code preview","code-snippets"),defaultValue:"".concat("php"===r?"<?php\n\n":"").concat(s)})}),c]})},S=function(e){var t=e.snippet,n=e.setIsOpen,r=e.onDownloaded;return(0,b.jsx)(A,{code:t.code,type:(0,p.yo)(t),title:t.name,onRequestClose:function(){return n(!1)},children:(0,b.jsx)("div",{className:"code-snippets-preview-modal__footer",children:(0,b.jsxs)("div",{className:"code-snippets-preview-modal__buttons",children:[(0,b.jsx)(m.l,{snippet:t,onDownloaded:r}),j()&&(0,b.jsx)(O,{code:t.code})]})})})},P=function(e){var t=e.snippet,n=e.isWorking,r=e.setIsWorking,s=e.setIsOpen,i=(0,c.q)(),a=(0,l.G)().refreshSnippetsList;return(0,b.jsx)(h.$,{secondary:!0,disabled:n,onClick:function(){r(!0),i.create((0,p.m2)(t)).then(a).then(function(){return s(!1)}).catch(d.fY).finally(function(){return r(!1)})},children:(0,o.__)("Clone","code-snippets")})},N=function(e){var t=e.snippet,n=e.isWorking,r=e.setIsWorking,s=(0,c.q)();return(0,b.jsx)(h.$,{secondary:!0,disabled:n,onClick:function(){r(!0),s.export(t).then(function(e){return(0,u.Mc)(e,t)}).catch(d.fY).finally(function(){return r(!1)})},children:(0,o.__)("Export","code-snippets")})},k=function(e){var t=e.snippet,n=e.setIsOpen,r=e.extraActions,i=(0,l.G)().refreshSnippetsList,c=function(){var e=(0,a.useState)(!1),t=(0,s.A)(e,2),n=t[0],r=t[1],i=(0,a.useRef)(!1),o=function(e){i.current=e,r(e)};return{isWorking:n,beginWorking:function(){return!i.current&&(o(!0),!0)},finishWorking:function(){return o(!1)},setIsWorking:o}}(),u=c.isWorking,f=c.setIsWorking,m=(0,v.S)({snippet:t,setIsWorking:f,onSuccess:function(){return n(!1),i()},onError:d.fY}),g=m.requestDelete,_=m.deleteDialogProps,j=(0,p.yq)(t);return(0,b.jsx)(A,{code:t.code,type:(0,p.yo)(t),title:(0,p.lO)(t),onRequestClose:function(){return n(!1)},children:(0,b.jsxs)("div",{className:"code-snippets-preview-modal__footer",children:[(0,b.jsxs)("div",{className:"code-snippets-preview-modal__buttons",children:[(0,b.jsx)("a",{className:"button button-primary",href:(0,p.l)(t),children:t.locked||!j?(0,o.__)("View","code-snippets"):(0,o.__)("Edit","code-snippets")}),j&&(0,b.jsx)(P,{snippet:t,isWorking:u,setIsWorking:f,setIsOpen:n}),(0,b.jsx)(N,{snippet:t,isWorking:u,setIsWorking:f}),(0,b.jsx)(O,{code:t.code}),!t.locked&&j&&(0,b.jsx)(h.$,{link:!0,className:"code-snippets-preview-modal__trash",disabled:u,onClick:function(){g()},children:(0,o.__)("Trash","code-snippets")})]}),(0,b.jsxs)("div",{className:"code-snippets-preview-modal__priority",children:[(0,b.jsx)("span",{children:(0,o.__)("Priority","code-snippets")}),(0,b.jsx)("span",{className:"code-snippets-preview-modal__priority-value",children:t.priority})]}),null==r?void 0:r(u),(0,b.jsx)(v.K,y({},_))]})})}},6197(e,t,n){"use strict";n.d(t,{u:()=>f});var r=n(4467),s=n(3453),i=n(7723),o=n(1609),a=n(8192),c=n(30),l=n(9595),d=n(790);function u(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){var t=e.snippet,n=(0,o.useState)(t.priority),r=(0,s.A)(n,2),u=r[0],f=r[1],h=(0,a.q)(),m=(0,c.G)().refreshSnippetsList,v=function(){Number.isNaN(u)||u===t.priority?f(t.priority):h.update(p(p({},t),{},{priority:u})).then(function(e){e.id===t.id&&f(e.priority)}).then(m).catch(l.fY)};return(0,d.jsx)("form",{onSubmit:function(e){e.preventDefault(),v()},children:(0,d.jsx)("input",{id:"snippet-".concat(t.id,"-priority"),type:"number",className:"snippet-priority",value:u,step:"1",onBlur:v,"aria-label":(0,i.__)("Snippet priority","code-snippets"),onChange:function(e){return f(Number(e.target.value))},disabled:t.locked||t.trashed})})}},5070(e,t,n){"use strict";var r=n(5896),s=n(2284),i=n(5501),o=n(3662),a=n(6842);function c(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 l(){l=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,s){var i=RegExp(e,r);return t.set(i,s||t.get(e)),(0,o.A)(i,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var s=r[n];if("number"==typeof s)t[n]=e[s];else{for(var i=0;void 0===e[s[i]]&&i+1<s.length;)i++;t[n]=e[s[i]]}return t},Object.create(null))}return(0,i.A)(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var s=n.indices;s&&(s.groups=r(s,this))}return n},n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var o=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(""===n)return e;var r=o[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""}))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=(0,s.A)(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,a)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},l.apply(this,arguments)}var d=n(7723);function u(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}n(1379);var p,f,h,m=n(467),v=n(4756),b=n.n(v),g=window.__code_snippets_i18n,y=function(){var e=(0,m.A)(b().mark(function e(t,n){var r,s;return b().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new URLSearchParams,Object.keys(t).forEach(function(e){return r.append(e,t[e])}),n.ajaxurl){e.next=4;break}throw new Error("ajaxurl not defined in config");case 4:return e.next=6,fetch(n.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:r.toString(),credentials:"same-origin"});case 6:return s=e.sent,e.next=9,s.json();case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();(0,n(9028).o)("code-snippets-toolbar-container",r.M),function(){var e=document.getElementById("settings-sections-tabs");if(e){!function(e){var t,n=e.closest(".snippet-type-nav-wrapper");if(n){var r=function(){var t=e.scrollWidth-e.clientWidth-e.scrollLeft;n.classList.toggle("has-scroll-start",1<e.scrollLeft),n.classList.toggle("has-scroll-end",1<t)};e.addEventListener("scroll",r,{passive:!0});var s=new ResizeObserver(r);s.observe(e),s.observe(null!==(t=e.firstElementChild)&&void 0!==t?t:e),r()}}(e);var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(e.querySelectorAll(".snippet-type-link"));try{var r=function(){var n=t.value;n.addEventListener("click",function(t){var r,s=n.getAttribute("data-section");s&&document.querySelector(".settings-section.".concat(s,"-settings"))&&(t.preventDefault(),function(e,t,n){var r,s,i;null===(r=e.querySelector(".active-type"))||void 0===r||r.classList.remove("active-type"),t.classList.add("active-type"),(0,a.ev)({section:n}),null===(s=e.closest(".wrap"))||void 0===s||s.setAttribute("data-active-tab",n),document.querySelectorAll(".cloud-message").forEach(function(e){e.classList.add("hidden")}),"version-switch"!==n&&(null===(i=document.getElementById("version-switch-warning"))||void 0===i||i.classList.add("hidden"))}(e,n,s),null===(r=window.code_snippets_editor_preview)||void 0===r||r.codemirror.refresh(),function(e){var t=document.querySelector("input[name=_wp_http_referer]");if(t){var n=t.value.replace(l(/([&?]section=)[^&]+/,{base:1}),"$1".concat(e));t.value=n+(n===t.value?"&section=".concat(e):"")}else console.error("could not find http referer")}(s))})};for(n.s();!(t=n.n()).done;)r()}catch(e){n.e(e)}finally{n.f()}}else console.error("Could not find snippets tabs")}(),p=document.getElementById("snippets-screen-meta-slot"),f=document.getElementById("screen-meta"),h=document.getElementById("screen-meta-links"),p&&f&&h&&p.append(f,h),function(){var e,t=function(){var e=window.wp.codeEditor,t=document.getElementById("code_snippets_editor_preview");if(t&&e)return window.code_snippets_editor_preview=e.initialize(t),window.code_snippets_editor_preview.codemirror.getInputField().setAttribute("aria-label",(0,d.__)("Code editor preview","code-snippets")),window.code_snippets_editor_preview.codemirror;console.error("Could not initialise CodeMirror on textarea.",t)}(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}(window.code_snippets_editor_settings);try{var r=function(){var n=e.value,r=document.querySelector('[name="code_snippets_settings[editor]['.concat(n.name,']"]'));null==r||r.addEventListener("change",function(){var e=n.codemirror,s=function(){switch(n.type){case"select":return(e=r).options[e.selectedIndex].value;case"checkbox":return r.checked;case"number":return parseInt(r.value,10);default:return null}var e}();if(null!==s)if("font_size"===n.name){var i=document.querySelector(".CodeMirror-code");i&&i instanceof HTMLElement&&(i.style.fontSize="".concat(s,"px"))}else null==t||t.setOption(e,s)})};for(n.s();!(e=n.n()).done;)r()}catch(e){n.e(e)}finally{n.f()}}(),function(){var e,t,n=(null!==(e=null===(t=document.querySelector(".current-version"))||void 0===t?void 0:t.textContent)&&void 0!==e?e:"").trim(),r=window.code_snippets_version_switch;if(!r)throw Error("version switch config missing");var s,i,o=document.getElementById("switch-version-btn"),a=document.getElementById("target_version"),c=document.getElementById("version-switch-result"),l=document.getElementById("refresh-versions-btn");a&&function(e,t,n){var r=document.getElementById("version-switch-warning");e.addEventListener("change",function(){var s=e.value;t&&(s&&s!==n?(t.disabled=!1,null==r||r.classList.remove("hidden")):(t.disabled=!0,null==r||r.classList.add("hidden")))})}(a,o,n),o&&a&&c&&function(e,t,n,r,s){e.addEventListener("click",function(){(0,m.A)(b().mark(function i(){var o,a,c,l,d,u,p,f,h,m;return b().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if((c=t.value)&&c!==s){i.next=6;break}return n.className="notice notice-warning",n.innerHTML="<p>".concat(null==g?void 0:g.selectDifferent,"</p>"),n.style.display="",i.abrupt("return");case 6:return e.disabled=!0,l=null!==(o=e.textContent)&&void 0!==o?o:"",e.textContent=null!==(a=null==g?void 0:g.switching)&&void 0!==a?a:"",n.className="notice notice-info",n.innerHTML="<p>".concat(null==g?void 0:g.processing,"</p>"),n.style.display="",i.prev=12,i.next=15,y({action:"code_snippets_switch_version",target_version:c,nonce:null!==(d=r.nonce_switch)&&void 0!==d?d:""},r);case 15:if(!(f=i.sent).success){i.next=21;break}return n.className="notice notice-success",n.innerHTML="<p>".concat(null!==(h=null===(m=f.data)||void 0===m?void 0:m.message)&&void 0!==h?h:"","</p>"),setTimeout(function(){return window.location.reload()},3e3),i.abrupt("return");case 21:n.className="notice notice-error",n.innerHTML="<p>".concat(null!==(u=null===(p=f.data)||void 0===p?void 0:p.message)&&void 0!==u?u:null==g?void 0:g.error,"</p>"),e.disabled=!1,e.textContent=l,i.next=33;break;case 27:i.prev=27,i.t0=i.catch(12),n.className="notice notice-error",n.innerHTML="<p>".concat(null==g?void 0:g.errorSwitch,"</p>"),e.disabled=!1,e.textContent=l;case 33:case"end":return i.stop()}},i,null,[[12,27]])}))()})}(o,a,c,r,n),l&&(i=r,(s=l).addEventListener("click",function(){(0,m.A)(b().mark(function e(){var t,n,r,o,a;return b().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=null!==(t=s.textContent)&&void 0!==t?t:"",s.disabled=!0,s.textContent=null!==(n=null==g?void 0:g.error)&&void 0!==n?n:"",e.prev=3,e.next=6,y({action:"code_snippets_refresh_versions",nonce:null!==(o=i.nonce_refresh)&&void 0!==o?o:""},i);case 6:s.textContent=null!==(a=null==g?void 0:g.refreshed)&&void 0!==a?a:"",setTimeout(function(){s.disabled=!1,s.textContent=r,window.location.reload()},1e3),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),s.disabled=!1,s.textContent=r;case 14:case"end":return e.stop()}},e,null,[[3,10]])}))()}))}()},8435(e,t,n){"use strict";n.d(t,{X:()=>c});var r=n(4467),s=n(3453),i=n(1609);function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(){var e=(0,i.useRef)(null),t=(0,i.useState)({atStart:!0,atEnd:!0}),n=(0,s.A)(t,2),r=n[0],o=n[1],c=(0,i.useCallback)(function(){var t=e.current;if(t){var n=t.scrollWidth-t.clientWidth>1,r=!n||t.scrollLeft<=1,s=!n||t.scrollLeft+t.clientWidth>=t.scrollWidth-1;o(function(e){return e.atStart===r&&e.atEnd===s?e:{atStart:r,atEnd:s}})}},[]);return(0,i.useEffect)(function(){var t,n=e.current;if(n){c(),n.addEventListener("scroll",c,{passive:!0});var r=new ResizeObserver(c);return r.observe(n),r.observe(null!==(t=n.firstElementChild)&&void 0!==t?t:n),function(){n.removeEventListener("scroll",c),r.disconnect()}}},[c]),a(a({},r),{},{scrollRef:e})}},1240(e,t,n){"use strict";n.d(t,{_:()=>b,i:()=>g});var r=n(3453),s=n(9394),i=n(467),o=n(4756),a=n.n(o),c=n(1609),l=n(7536),d=n(9028),u=n(2456),p=n(790),f=function(){var e=(0,i.A)(a().mark(function e(t,n,r,i){var o,c,l;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(o=window.CODE_SNIPPETS)||void 0===o||!o.debug){e.next=9;break}return(c=console).debug.apply(c,["".concat(t," ").concat(n)].concat((0,s.A)(i?[i]:[]))),e.next=4,r;case 4:return l=e.sent,console.debug("Response",l),e.abrupt("return",l);case 9:return e.next=11,r;case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}));return function(t,n,r,s){return e.apply(this,arguments)}}(),h=(0,d.h)("useRestAPI"),m=(0,r.A)(h,2),v=m[0],b=m[1],g=function(e){var t=e.children,n=(0,c.useMemo)(function(){var e=l.A.create(u.M9);return e.interceptors.request.use(u.s1),e.interceptors.request.use(u._R),(0,u.r)(),e},[]),r=(0,c.useMemo)(function(){return function(e){return{getResponse:function(t){return f("GET",t,e.get(t))},get:function(t){return f("GET",t,e.get(t)).then(function(e){return e.data})},post:function(t,n,r){return f("POST",t,e.post(t,n,r),n).then(function(e){return e.data})},del:function(t){return f("DELETE",t,e.delete(t)).then(function(e){return e.data})},put:function(t,n){return f("PUT",t,e.put(t,n),n).then(function(e){return e.data})}}}(n)},[n]),s={api:r,axiosInstance:n};return(0,p.jsx)(v.Provider,{value:s,children:t})}},3733(e,t,n){"use strict";n.d(t,{e:()=>l});var r=n(3453),s=n(1609),i=n(3150),o=n(9595),a=n(2456),c=n(1240),l=function(){var e=(0,c._)().api,t=(0,s.useState)(function(){var e,t;return null!==(e=null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.snippetView)&&void 0!==e?e:i.u}),n=(0,r.A)(t,2),l=n[0],d=n[1];return{snippetView:l,setSnippetView:(0,s.useCallback)(function(t){d(t),e.post(a.St.preferences.snippetView,{view:t}).catch(o.fY)},[e])}}},8192(e,t,n){"use strict";n.d(t,{i:()=>b,q:()=>v});var r=n(3453),s=n(1609),i=n(9028),o=n(2456),a=n(7871),c=n(6842),l=n(1240),d=n(790),u=function(e,t){var n=e.id,r=e.network;return(0,c.c$)([o.St.snippets,n,t].filter(Boolean).join("/"),{network:r})},p=function(e){return{name:e.name,desc:e.desc,code:e.code,tags:e.tags,scope:e.scope,priority:e.priority,active:e.active,network:e.network,locked:e.locked,trashed:e.trashed,shared_network:e.shared_network,condition_id:e.conditionId}},f=(0,i.h)("useSnippetsAPI"),h=(0,r.A)(f,2),m=h[0],v=h[1],b=function(e){var t=e.children,n=(0,l._)().api,r=(0,s.useMemo)(function(){return t=(e=n).get,r=e.post,s=e.del,i=e.put,{fetchAll:function(e){return t((0,c.c$)(o.St.snippets,{network:e})).then(function(e){return e.map(a.ZA)})},fetch:function(e,n){return t((0,c.c$)("".concat(o.St.snippets,"/").concat(e),{network:n})).then(a.ZA)},create:function(e){return r(o.St.snippets,p(e)).then(a.ZA)},update:function(e){return r(e.id?u(e):o.St.snippets,p(e)).then(a.ZA)},delete:function(e){return s(u(e))},restore:function(e){return r(u(e,"restore"))},activate:function(e){return r(u(e,"activate")).then(a.ZA)},deactivate:function(e){return r(u(e,"deactivate")).then(a.ZA)},export:function(e){return t(u(e,"export"))},exportCode:function(e){return t(u(e,"export-code"))},attach:function(e){return i(u(e,"attach"),{condition_id:e.conditionId})},detach:function(e){return i(u(e,"detach"))}};var e,t,r,s,i},[n]);return(0,d.jsx)(m.Provider,{value:r,children:t})}},30(e,t,n){"use strict";n.d(t,{G:()=>v,q:()=>b});var r=n(467),s=n(3453),i=n(4756),o=n.n(i),a=n(1609),c=n(9028),l=n(6492),d=n(3561),u=n(8192),p=n(790),f=(0,c.h)("useSnippetsList"),h=(0,s.A)(f,2),m=h[0],v=h[1],b=function(e){var t=e.children,n=(0,u.q)().fetchAll,i=(0,a.useState)(function(){var e;return null===(e=window.CODE_SNIPPETS_MANAGE)||void 0===e||null===(e=e.snippetsList)||void 0===e?void 0:e.map(d.y)}),c=(0,s.A)(i,2),f=c[0],h=c[1],v=(0,a.useCallback)((0,r.A)(o().mark(function e(){var t;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.info("Fetching snippets list"),e.next=4,n((0,l.i_)());case 4:t=e.sent,h(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error("Error fetching snippets list",e.t0);case 11:case"end":return e.stop()}},e,null,[[0,8]])})),[n]);(0,a.useEffect)(function(){v().catch(function(){})},[v]);var b={snippetsList:f,refreshSnippetsList:v};return(0,p.jsx)(m.Provider,{value:b,children:t})}},8975(e,t,n){"use strict";n.d(t,{$:()=>s,W:()=>r});var r=["php","html","css","js","cond"],s={php:["global","admin","front-end","single-use"],html:["content","head-content","body-content","footer-content"],css:["admin-css","site-css"],js:["site-head-js","site-footer-js"],cond:["condition"]}},3150(e,t,n){"use strict";n.d(t,{u:()=>r});var r="table"},4148(e,t,n){"use strict";n.d(t,{i:()=>r});var r=function(e){return e[e.Private=3]="Private",e[e.Public=4]="Public",e[e.Unverified=5]="Unverified",e[e.AI_Verified=6]="AI_Verified",e[e.Pro_Verified=8]="Pro_Verified",e}({})},9028(e,t,n){"use strict";n.d(t,{h:()=>a,o:()=>o});var r=n(1609),s=n(5795),i=n(790),o=function(e,t){var n=document.getElementById(e);n?(0,s.createRoot)(n).render((0,i.jsx)(t,{})):console.error("Could not find element #".concat(e,"."))},a=function(e){var t=(0,r.createContext)(void 0);return[t,function(){var n=(0,r.useContext)(t);if(void 0===n)throw Error("".concat(e," can only be used within a corresponding context provider."));return n}]}},9595(e,t,n){"use strict";n.d(t,{fY:()=>o,tM:()=>c});var r=n(2284),s=n(7723),i=n(3110),o=function(e){console.error(e)},a=function(e){if((0,i.F0)(e)){if(e.response){var t=e.response.data;if(t&&"object"===(0,r.A)(t)&&"message"in t)return String(t.message)}return e.message}return(0,s.__)("An unknown error occurred.","code-snippets")},c=function(e){if(!(0,i.F0)(e))return a(e);if(!e.response)return(0,s.__)("The request did not reach your site. Check your connection, or whether a security plugin is blocking it.","code-snippets");var t=e.response.data,n=t&&"object"===(0,r.A)(t)&&"code"in t?String(t.code):"";return"rest_cookie_invalid_nonce"===n||"rest_not_logged_in"===n?(0,s.__)("You have been signed out, so nothing was saved. Sign in again in another tab, then save. Your changes are still here.","code-snippets"):a(e)}},3661(e,t,n){"use strict";n.d(t,{Mc:()=>a,_j:()=>u});var r=n(3453),s=n(7871),i={php:["php","text/php"],html:["php","text/php"],css:["css","text/css"],js:["js","text/javascript"],cond:["json","application/json"],json:["json","application/json"]},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),r.style.display="none",document.body.appendChild(r),setTimeout(function(){r.click(),r.remove()},0)},a=function(e,t,n){var a=t.id,c=t.name,l=t.scope,d=c.toLowerCase().replace(/[^\w-]+/g,"-").trim(),u=""===d?"snippet-".concat(a):d;if("string"==typeof e){var p=(0,r.A)(i[null!=n?n:(0,s.yo)({scope:l})],2),f=p[0],h=p[1],m="".concat(u,".code-snippets.").concat(f);o(e,m,h)}else{var v="".concat(u,".code-snippets.json");o(JSON.stringify(e,void 0,2),v,"application/json")}},c=function(e){return null==e},l={id:function(e){return 0===e},desc:function(e){return""===e},name:function(e){return""===e},code:function(e){return""===e},tags:function(e){return Array.isArray(e)&&0===e.length},scope:function(e){return"global"===e},condition_id:function(e){return 0===e},active:function(e){return!1===e},locked:function(e){return!1===e},trashed:function(e){return!1===e},priority:function(e){return 10===e},modified:function(e){return""===e||c(e)},last_active:function(e){return 0===e||c(e)},network:function(e){return null===e||!1===e},shared_network:function(e){return null===e||!1===e},code_error:function(e){return null===e||!1===e},code_error_trace:function(e){return null===e||!1===e}},d=function(e){var t=e.id,n=e.name,s=e.desc,i=e.code,o=e.tags,a=e.scope,d=e.active,u=e.locked,p=e.trashed,f=e.network,h=e.shared_network,m=e.modified,v=e.priority,b=e.conditionId,g=e.lastActive,y=e.code_error,_=e.code_error_trace;return Object.fromEntries(Object.entries({id:t,name:n,desc:s,code:i,tags:o,scope:a,active:d,locked:u,trashed:p,network:f,shared_network:h,modified:m,priority:v,condition_id:b,last_active:g,code_error:y,code_error_trace:_}).filter(function(e){var t,n,s,i=(0,r.A)(e,2);return t=i[0],n=i[1],!(null!==(s=l[t])&&void 0!==s?s:c)(n)}))},u=function(e){if(0!==e.length){var t={generator:"Code Snippets",date_created:(new Date).toISOString().slice(0,16).replace("T"," "),snippets:e.map(d)};o(JSON.stringify(t,void 0,2),"".concat("snippets",".code-snippets.json"),"application/json")}}},2456(e,t,n){"use strict";n.d(t,{GE:()=>O,M9:()=>P,St:()=>y,_R:()=>j,r:()=>A,s1:()=>S});var r,s,i,o,a,c,l,d,u,p,f,h,m,v,b=n(7947),g=(n(6842),function(e){return(0,b.Bu)(null!=e?e:"","/")}),y={base:g(null===(r=window.CODE_SNIPPETS)||void 0===r?void 0:r.restAPI.base),snippets:g(null===(s=window.CODE_SNIPPETS)||void 0===s?void 0:s.restAPI.snippets),recentlyActive:g(null===(i=window.CODE_SNIPPETS)||void 0===i?void 0:i.restAPI.recentlyActive),import:{plugins:g(null===(o=window.CODE_SNIPPETS)||void 0===o?void 0:o.restAPI.importPlugins),files:g(null===(a=window.CODE_SNIPPETS)||void 0===a?void 0:a.restAPI.importFiles)},preferences:{snippetView:g(null===(c=window.CODE_SNIPPETS)||void 0===c?void 0:c.restAPI.snippetView),insights:g(null===(l=window.CODE_SNIPPETS)||void 0===l?void 0:l.restAPI.insightsView),demosSeen:g(null===(d=window.CODE_SNIPPETS)||void 0===d?void 0:d.restAPI.demosSeen)},cloud:{snippets:g(null===(u=window.CODE_SNIPPETS)||void 0===u?void 0:u.restAPI.cloud.snippets)}},_=["delete","put","patch"],j=function(e){var t,n=null===(t=e.method)||void 0===t?void 0:t.toLowerCase();return n&&_.includes(n)?(e.headers.set("X-HTTP-Method-Override",n.toUpperCase()),e.method="post",e):e},w=null!==(p=null===(f=window.CODE_SNIPPETS)||void 0===f?void 0:f.restAPI.nonce)&&void 0!==p?p:null===(h=window.CODE_SNIPPETS_FEEDBACK)||void 0===h?void 0:h.nonce,x=null===(m=window.CODE_SNIPPETS_MANAGE)||void 0===m?void 0:m.runOnceNonce,O=function(){var e;return null!==(e=x)&&void 0!==e?e:""},A=function(){var e;null===(e=window.wp.hooks)||void 0===e||e.addAction("heartbeat.tick","code-snippets/refresh-rest-nonce",function(e){e.rest_nonce&&(w=e.rest_nonce),e.code_snippets_run_once_nonce&&(x=e.code_snippets_run_once_nonce)})},S=function(e){return w&&e.headers.set("X-WP-Nonce",w),e},P={headers:{"Access-Control":null===(v=window.CODE_SNIPPETS)||void 0===v?void 0:v.restAPI.cloud.token}}},6492(e,t,n){"use strict";n.d(t,{QX:()=>i,U0:()=>s,W9:()=>o,i_:()=>r});var r=function(){var e;return!0===(null===(e=window.pagenow)||void 0===e?void 0:e.endsWith("-network"))},s=function(){return null!==/mac/i.exec(window.navigator.userAgent)},i=function(){var e;return!(null===(e=window.CODE_SNIPPETS)||void 0===e||!e.isLicensed)},o=function(){var e;return!(i()||null!==(e=window.CODE_SNIPPETS)&&void 0!==e&&e.hideUpsell)}},3561(e,t,n){"use strict";n.d(t,{y:()=>u});var r=n(4467),s=n(2284),i=n(8975);function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c={id:0,name:"",code:"",desc:"",scope:"global",modified:"",active:!1,locked:!1,trashed:!1,network:(0,n(6492).i_)(),shared_network:null,priority:10,conditionId:0,code_error:null,code_error_trace:null},l=function(e){return"number"==typeof e&&0<e},d=function(e){var t;if(!e||"object"!==(0,s.A)(e))return null;var n=e;return{id:Number(null!==(t=n.id)&&void 0!==t?t:0),displayName:"string"==typeof n.display_name?n.display_name:"",avatarUrl:"string"==typeof n.avatar_url?n.avatar_url:""}},u=function(e){var t,n,r,o=a(a({},c),{},{tags:[],conditions:{}});return"object"!==(0,s.A)(e)||null===e?o:a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a({},o),"id"in e&&l(e.id)&&{id:e.id}),"name"in e&&"string"==typeof e.name&&{name:e.name}),"desc"in e&&"string"==typeof e.desc&&{desc:e.desc}),"code"in e&&"string"==typeof e.code&&{code:e.code}),"tags"in e&&{tags:null!==(r=e.tags,t=Array.isArray(r)?r.filter(function(e){return"string"==typeof e}):void 0)&&void 0!==t?t:o.tags}),"scope"in e&&"string"==typeof(n=e.scope)&&Object.values(i.$).some(function(e){return e.some(function(e){return e===n})})&&{scope:e.scope}),"modified"in e&&"string"==typeof e.modified&&{modified:e.modified}),"active"in e&&"boolean"==typeof e.active&&{active:e.active}),"locked"in e&&"boolean"==typeof e.locked&&{locked:e.locked}),"trashed"in e&&"boolean"==typeof e.trashed&&{trashed:e.trashed}),"network"in e&&"boolean"==typeof e.network&&{network:e.network}),"shared_network"in e&&"boolean"==typeof e.shared_network&&{shared_network:e.shared_network}),"priority"in e&&"number"==typeof e.priority&&{priority:e.priority}),"conditionId"in e&&l(e.conditionId)&&{conditionId:e.conditionId}),"condition_id"in e&&l(e.condition_id)&&{conditionId:e.condition_id}),"code_error"in e&&function(e){return Array.isArray(e)&&2===e.length&&"string"==typeof e[0]&&"number"==typeof e[1]}(e.code_error)&&{code_error:e.code_error}),"code_error_trace"in e&&("string"==typeof e.code_error_trace||null===e.code_error_trace)&&{code_error_trace:e.code_error_trace}),"last_active"in e&&{lastActive:Number(e.last_active)}),"created_by"in e&&{createdBy:d(e.created_by)}),"updated_by"in e&&{updatedBy:d(e.updated_by)})}},7871(e,t,n){"use strict";n.d(t,{B6:()=>w,E$:()=>O,G3:()=>j,Hi:()=>u,WW:()=>g,Y1:()=>_,ZA:()=>h,_W:()=>A,fp:()=>f,l:()=>b,lO:()=>y,m2:()=>m,rA:()=>P,sD:()=>x,wH:()=>p,yo:()=>v,yq:()=>S});var r=n(4467),s=n(7723),i=n(6492),o=n(6842),a=n(3561);function c(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 l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=new Set(["css","js","cond"]),u={php:(0,s.__)("Functions","code-snippets"),html:(0,s.__)("Content","code-snippets"),css:(0,s.__)("Styles","code-snippets"),js:(0,s.__)("Scripts","code-snippets"),cond:(0,s.__)("Conditions","code-snippets")},p={global:"admin-site",admin:"admin-tools","front-end":"admin-appearance","single-use":"clock",content:"shortcode","head-content":"editor-code","body-content":"editor-code","footer-content":"editor-code","admin-css":"dashboard","site-css":"admin-customizer","site-head-js":"media-code","site-footer-js":"media-code"},f={global:(0,s.__)("Run everywhere","code-snippets"),admin:(0,s.__)("Only run in administration area","code-snippets"),"front-end":(0,s.__)("Only run on site front-end","code-snippets"),"single-use":(0,s.__)("Only run once","code-snippets"),content:(0,s.__)("Where inserted in editor","code-snippets"),"head-content":(0,s.__)("In site header (<head> section)","code-snippets"),"body-content":(0,s.__)("In site content (start of <body>)","code-snippets"),"footer-content":(0,s.__)("In site footer (end of <body>)","code-snippets"),"site-css":(0,s.__)("Site front-end","code-snippets"),"admin-css":(0,s.__)("Administration area","code-snippets"),"site-head-js":(0,s.__)("In site header (<head> section)","code-snippets"),"site-footer-js":(0,s.__)("In site footer (end of <body>)","code-snippets")},h=function(e){return(0,a.y)(e)},m=function(e){return h(l(l({},e),{},{id:0,active:!1,name:(0,s.sprintf)((0,s.__)("%s [CLONE]","code-snippets"),e.name)}))},v=function(e){var t=e.scope;switch(!0){case t.endsWith("-css"):return"css";case t.endsWith("-js"):return"js";case t.endsWith("content"):return"html";case"condition"===t:return"cond";default:return"php"}},b=function(e){var t,n;return null!=e&&e.id?(0,o.c$)(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.edit,{id:e.id}):null===(n=window.CODE_SNIPPETS)||void 0===n?void 0:n.urls.addNew},g=function(e){var t,n;return!e||!(0,i.QX)()&&x(e)?null===(n=window.CODE_SNIPPETS)||void 0===n?void 0:n.urls.addNew:(0,o.c$)(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.addNew,{type:e})},y=function(e){return""===e.name.trim()?(0,s.sprintf)(j(e)?(0,s.__)("Condition #%d","code-snippets"):(0,s.__)("Snippet #%d","code-snippets"),e.id):e.name},_=function(e){var t=""===e.name.trim(),n=""===e.code.trim();switch(!0){case n&&t:return(0,s.__)("This snippet has no code or title.","code-snippets");case n:return(0,s.__)("This snippet has no snippet code.","code-snippets");case t:return(0,s.__)("This snippet has no title.","code-snippets");default:return}},j=function(e){return"condition"===e.scope},w=function(e){return d.has(v(e))},x=function(e){return d.has(e)},O=function(e,t){var n,r;return"cond"===v(e)?0<(null!==(n=null===(r=t.get(e.id))||void 0===r?void 0:r.length)&&void 0!==n?n:0):e.active},A=function(e){return!(0,i.i_)()&&e.network&&!e.shared_network},S=function(e){var t;return!(A(e)||e.shared_network&&(null===(t=window.CODE_SNIPPETS_MANAGE)||void 0===t||!t.hasNetworkCap))},P=function(e){return!e.local_id&&(!w(e)||(0,i.QX)())}},7947(e,t,n){"use strict";n.d(t,{Bu:()=>s,Kq:()=>o,UT:()=>i});var r=n(7723),s=function(e,t){return t.includes(e.charAt(e.length-1))?e.slice(0,-1):e},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;return e.length>t?"".concat(e.slice(0,t)).concat((0,r._x)("…","truncated text","code-snippets")):e},o=function(e){var t,n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("script,style").forEach(function(e){return e.remove()}),n.body.querySelectorAll("p,div,li,br,h1,h2,h3,h4,h5,h6,tr,td,th,ul,ol,blockquote,table,pre,hr,dl,dt,dd,section,article,header,footer,figure,figcaption,address,aside,nav,main,fieldset,form,details,summary,dialog,hgroup,caption").forEach(function(e){return e.after(n.createTextNode(" "))}),(null!==(t=n.body.textContent)&&void 0!==t?t:"").replace(/\s+/g," ").trim()}},6842(e,t,n){"use strict";n.d(t,{UY:()=>o,c$:()=>d,ev:()=>c,jW:()=>a});var r=n(2284),s=n(3453),i=n(3832),o=function(e){var t;return null!==(t=new URLSearchParams(window.location.search).get(e))&&void 0!==t?t:void 0},a=function(e,t){var n=o(e);return n&&function(e){return t.includes(e)}(n)?n:void 0},c=function(e){if("URLSearchParams"in window){for(var t=new URLSearchParams(window.location.search),n=0,r=Object.entries(e);n<r.length;n++){var i=(0,s.A)(r[n],2),o=i[0],a=i[1];a?t.set(o,String(a)):t.delete(o)}var c=window.location.toString().replace(window.location.search,"?".concat(t.toString()));window.history.replaceState({},document.title,c)}},l=function(e){switch(!0){case null==e:return;case"boolean"==typeof e:return e?"1":"0";case"number"==typeof e:case"string"==typeof e:return String(e);default:throw new Error("Unsupported query arg type: ".concat((0,r.A)(e)))}},d=function(e,t){for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var a=(0,s.A)(o[r],2),c=a[0],d=a[1],u=l(d);void 0!==u&&(n[c]=u)}return(0,i.addQueryArgs)(e,n)}},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM},790(e){"use strict";e.exports=window.ReactJSXRuntime},6427(e){"use strict";e.exports=window.wp.components},8443(e){"use strict";e.exports=window.wp.date},6087(e){"use strict";e.exports=window.wp.element},7723(e){"use strict";e.exports=window.wp.i18n},3832(e){"use strict";e.exports=window.wp.url},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,n){var r=n(5546);function s(){var t,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function c(e,s,i,o){var a=s&&s.prototype instanceof d?s:d,c=Object.create(a.prototype);return r(c,"_invoke",function(e,r,s){var i,o,a,c=0,d=s||[],u=!1,p={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return i=e,o=0,a=t,p.n=n,l}};function f(e,r){for(o=e,a=r,n=0;!u&&c&&!s&&n<d.length;n++){var s,i=d[n],f=p.p,h=i[2];e>3?(s=h===r)&&(a=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=t):i[0]<=f&&((s=e<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<h&&(s=e<3||i[0]>r||r>h)&&(i[4]=e,i[5]=r,p.n=h,o=0))}if(s||e>1)return l;throw u=!0,r}return function(s,d,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&f(d,h),o=d,a=h;(n=o<2?t:a)||!u;){i||(o?o<3?(o>1&&(p.n=-1),f(o,a)):p.n=a:p.v=a);try{if(c=2,i){if(o||(s="next"),n=i[s]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,o<2&&(o=0)}else 1===o&&(n=i.return)&&n.call(i),o<2&&(a=TypeError("The iterator does not provide a '"+s+"' method"),o=1);i=t}else if((n=(u=p.n<0)?a:e.call(r,p))!==l)break}catch(e){i=t,o=1,a=e}finally{c=1}}return{value:n,done:u}}}(e,i,o),!0),c}var l={};function d(){}function u(){}function p(){}n=Object.getPrototypeOf;var f=[][o]?n(n([][o]())):(r(n={},o,function(){return this}),n),h=p.prototype=d.prototype=Object.create(f);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,r(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=p,r(h,"constructor",p),r(p,"constructor",u),u.displayName="GeneratorFunction",r(p,a,"GeneratorFunction"),r(h),r(h,a,"Generator"),r(h,o,function(){return this}),r(h,"toString",function(){return"[object Generator]"}),(e.exports=s=function(){return{w:c,m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,n){var r=n(887);e.exports=function(e,t,n,s,i){var o=r(e,t,n,s,i);return o.next().then(function(e){return e.done?e.value:o.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var r=n(6993),s=n(1791);e.exports=function(e,t,n,i,o){return new s(r().w(e,t,n,i),o||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,n){var r=n(5172),s=n(5546);e.exports=function e(t,n){function i(e,s,o,a){try{var c=t[e](s),l=c.value;return l instanceof r?n.resolve(l.v).then(function(e){i("next",e,o,a)},function(e){i("throw",e,o,a)}):n.resolve(l).then(function(e){c.value=e,o(c)},function(e){return i("throw",e,o,a)})}catch(e){a(e)}}var o;this.next||(s(e.prototype),s(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),s(this,"_invoke",function(e,t,r){function s(){return new n(function(t,n){i(e,r,t,n)})}return o=o?o.then(s,s):s()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(n,r,s,i){var o=Object.defineProperty;try{o({},"",{})}catch(n){o=0}e.exports=t=function(e,n,r,s){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?o?o(e,n,{value:r,enumerable:!s,configurable:!s,writable:!s}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,s,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var r=n(5172),s=n(6993),i=n(5869),o=n(887),a=n(1791),c=n(4373),l=n(579);function d(){"use strict";var t=s(),n=t.m(d),u=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function h(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,s,i){return t.resultName=s,n(r.d,l(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,s){r.p=t.prev,r.n=t.next;try{return e(n,s)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=d=function(){return{wrap:function(e,n,r,s){return t.w(h(e),n,r,s&&s.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:a,async:function(e,t,n,r,s){return(p(t)?o:i)(h(e),t,n,r,s)},keys:c,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,n){var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},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 s(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()},4243(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(3145);function s(e){if(Array.isArray(e))return(0,r.A)(e)}},467(e,t,n){"use strict";function r(e,t,n,r,s,i,o){try{var a=e[i](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,s)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(void 0)})}}n.d(t,{A:()=>s})},4467(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(9922);function s(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},5501(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(3662);function s(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.A)(e,t)}},3893(e,t,n){"use strict";function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,{A:()=>r})},519(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{A:()=>r})},45(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(8587);function s(e,t){if(null==e)return{};var n,s,i=(0,r.A)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},8587(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},3662(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,{A:()=>r})},9394(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(4243),s=n(3893),i=n(7800),o=n(519);function a(e){return(0,r.A)(e)||(0,s.A)(e)||(0,i.A)(e)||(0,o.A)()}},3110(e,t,n){"use strict";n.d(t,{F0:()=>p});var r=n(7536);const{Axios:s,AxiosError:i,CanceledError:o,isCancel:a,CancelToken:c,VERSION:l,all:d,Cancel:u,isAxiosError:p,spread:f,toFormData:h,AxiosHeaders:m,HttpStatusCode:v,formToJSON:b,getAdapter:g,mergeConfig:y}=r.A},6263(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(7275),s=n(3119),i=n(7013),o=n(7960),a=n(4062);const c={http:s.A,xhr:i.A,fetch:{get:o.J}};r.A.forEach(c,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const l=e=>`- ${e}`,d=e=>r.A.isFunction(e)||null===e||!1===e,u={getAdapter:function(e,t){e=r.A.isArray(e)?e:[e];const{length:n}=e;let s,i;const o={};for(let l=0;l<n;l++){let n;if(s=e[l],i=s,!d(s)&&(i=c[(n=String(s)).toLowerCase()],void 0===i))throw new a.A(`Unknown adapter '${n}'`);if(i&&(r.A.isFunction(i)||(i=i.get(t))))break;o[n||"#"+l]=i}if(!i){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 t=n?e.length>1?"since :\n"+e.map(l).join("\n"):" "+l(e[0]):"as no adapter specified";throw new a.A("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:c}},7960(e,t,n){"use strict";n.d(t,{J:()=>y});var r=n(3820),s=n(7275),i=n(4062),o=n(2723),a=n(4172),c=n(7110),l=n(7837),d=n(8382),u=n(3853);const{isFunction:p}=s.A,f=(({Request:e,Response:t})=>({Request:e,Response:t}))(s.A.global),{ReadableStream:h,TextEncoder:m}=s.A.global,v=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},b=e=>{e=s.A.merge.call({skipUndefined:!0},f,e);const{fetch:t,Request:n,Response:b}=e,g=t?p(t):"function"==typeof fetch,y=p(n),_=p(b);if(!g)return!1;const j=g&&p(h),w=g&&("function"==typeof m?(x=new m,e=>x.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var x;const O=y&&j&&v(()=>{let e=!1;const t=new n(r.A.origin,{body:new h,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),A=_&&j&&v(()=>s.A.isReadableStream(new b("").body)),S={stream:A&&(e=>e.body)};g&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!S[e]&&(S[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new i.A(`Response type '${e}' is not supported`,i.A.ERR_NOT_SUPPORT,n)})});return async e=>{let{url:p,method:f,data:h,signal:m,cancelToken:v,timeout:g,onDownloadProgress:_,onUploadProgress:j,responseType:x,headers:P,withCredentials:N="same-origin",fetchOptions:k}=(0,d.A)(e),E=t||fetch;x=x?(x+"").toLowerCase():"text";let C=(0,o.A)([m,v&&v.toAbortSignal()],g),D=null;const T=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let R;try{if(j&&O&&"get"!==f&&"head"!==f&&0!==(R=await(async(e,t)=>{const i=s.A.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(s.A.isBlob(e))return e.size;if(s.A.isSpecCompliantForm(e)){const t=new n(r.A.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return s.A.isArrayBufferView(e)||s.A.isArrayBuffer(e)?e.byteLength:(s.A.isURLSearchParams(e)&&(e+=""),s.A.isString(e)?(await w(e)).byteLength:void 0)})(t):i})(P,h))){let e,t=new n(p,{method:"POST",body:h,duplex:"half"});if(s.A.isFormData(h)&&(e=t.headers.get("content-type"))&&P.setContentType(e),t.body){const[e,n]=(0,l.Vj)(R,(0,l.C1)((0,l.mM)(j)));h=(0,a.E9)(t.body,65536,e,n)}}s.A.isString(N)||(N=N?"include":"omit");const t=y&&"credentials"in n.prototype,i={...k,signal:C,method:f.toUpperCase(),headers:P.normalize().toJSON(),body:h,duplex:"half",credentials:t?N:void 0};D=y&&new n(p,i);let o=await(y?E(D,k):E(p,i));const d=A&&("stream"===x||"response"===x);if(A&&(_||d&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=s.A.toFiniteNumber(o.headers.get("content-length")),[n,r]=_&&(0,l.Vj)(t,(0,l.C1)((0,l.mM)(_),!0))||[];o=new b((0,a.E9)(o.body,65536,n,()=>{r&&r(),T&&T()}),e)}x=x||"text";let m=await S[s.A.findKey(S,x)||"text"](o,e);return!d&&T&&T(),await new Promise((t,n)=>{(0,u.A)(t,n,{data:m,headers:c.A.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:D})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new i.A("Network Error",i.A.ERR_NETWORK,e,D,t&&t.response),{cause:t.cause||t});throw i.A.from(t,t&&t.code,e,D,t&&t.response)}}},g=new Map,y=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o,a,c=i.length,l=g;for(;c--;)o=i[c],a=l.get(o),void 0===a&&l.set(o,a=c?new Map:b(t)),l=a;return a};y()},7013(e,t,n){"use strict";n.d(t,{A:()=>f});var r=n(7275),s=n(3853),i=n(807),o=n(4062),a=n(8458),c=n(5579),l=n(3820),d=n(7110),u=n(7837),p=n(8382);const f="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const f=(0,p.A)(e);let h=f.data;const m=d.A.from(f.headers).normalize();let v,b,g,y,_,{responseType:j,onUploadProgress:w,onDownloadProgress:x}=f;function O(){y&&y(),_&&_(),f.cancelToken&&f.cancelToken.unsubscribe(v),f.signal&&f.signal.removeEventListener("abort",v)}let A=new XMLHttpRequest;function S(){if(!A)return;const r=d.A.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),i={data:j&&"text"!==j&&"json"!==j?A.response:A.responseText,status:A.status,statusText:A.statusText,headers:r,config:e,request:A};(0,s.A)(function(e){t(e),O()},function(e){n(e),O()},i),A=null}A.open(f.method.toUpperCase(),f.url,!0),A.timeout=f.timeout,"onloadend"in A?A.onloadend=S:A.onreadystatechange=function(){A&&4===A.readyState&&(0!==A.status||A.responseURL&&0===A.responseURL.indexOf("file:"))&&setTimeout(S)},A.onabort=function(){A&&(n(new o.A("Request aborted",o.A.ECONNABORTED,e,A)),A=null)},A.onerror=function(t){const r=t&&t.message?t.message:"Network Error",s=new o.A(r,o.A.ERR_NETWORK,e,A);s.event=t||null,n(s),A=null},A.ontimeout=function(){let t=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded";const r=f.transitional||i.A;f.timeoutErrorMessage&&(t=f.timeoutErrorMessage),n(new o.A(t,r.clarifyTimeoutError?o.A.ETIMEDOUT:o.A.ECONNABORTED,e,A)),A=null},void 0===h&&m.setContentType(null),"setRequestHeader"in A&&r.A.forEach(m.toJSON(),function(e,t){A.setRequestHeader(t,e)}),r.A.isUndefined(f.withCredentials)||(A.withCredentials=!!f.withCredentials),j&&"json"!==j&&(A.responseType=f.responseType),x&&([g,_]=(0,u.C1)(x,!0),A.addEventListener("progress",g)),w&&A.upload&&([b,y]=(0,u.C1)(w),A.upload.addEventListener("progress",b),A.upload.addEventListener("loadend",y)),(f.cancelToken||f.signal)&&(v=t=>{A&&(n(!t||t.type?new a.A(null,e,A):t),A.abort(),A=null)},f.cancelToken&&f.cancelToken.subscribe(v),f.signal&&(f.signal.aborted?v():f.signal.addEventListener("abort",v)));const P=(0,c.A)(f.url);P&&-1===l.A.protocols.indexOf(P)?n(new o.A("Unsupported protocol "+P+":",o.A.ERR_BAD_REQUEST,e)):A.send(h||null)})}},7536(e,t,n){"use strict";n.d(t,{A:()=>j});var r=n(7275),s=n(2125),i=n(5978),o=n(4662),a=n(6013),c=n(7887),l=n(8458),d=n(4874),u=n(9575),p=n(9888),f=n(665),h=n(4062),m=n(605),v=n(8562),b=n(7110),g=n(6263),y=n(7693);const _=function e(t){const n=new i.A(t),a=(0,s.A)(i.A.prototype.request,n);return r.A.extend(a,i.A.prototype,n,{allOwnKeys:!0}),r.A.extend(a,n,null,{allOwnKeys:!0}),a.create=function(n){return e((0,o.A)(t,n))},a}(a.A);_.Axios=i.A,_.CanceledError=l.A,_.CancelToken=d.A,_.isCancel=u.A,_.VERSION=p.x,_.toFormData=f.A,_.AxiosError=h.A,_.Cancel=_.CanceledError,_.all=function(e){return Promise.all(e)},_.spread=m.A,_.isAxiosError=v.A,_.mergeConfig=o.A,_.AxiosHeaders=b.A,_.formToJSON=e=>(0,c.A)(r.A.isHTMLForm(e)?new FormData(e):e),_.getAdapter=g.A.getAdapter,_.HttpStatusCode=y.A,_.default=_;const j=_},4874(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(8458);class s{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,s,i){n.reason||(n.reason=new r.A(e,s,i),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 s(function(t){e=t}),cancel:e}}}const i=s},8458(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(4062);class s extends r.A{constructor(e,t,n){super(null==e?"canceled":e,r.A.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}const i=s},9575(e,t,n){"use strict";function r(e){return!(!e||!e.__CANCEL__)}n.d(t,{A:()=>r})},5978(e,t,n){"use strict";n.d(t,{A:()=>h});var r=n(7275),s=n(3967),i=n(7352),o=n(8683),a=n(4662),c=n(8262),l=n(3390),d=n(7110),u=n(807);const p=l.A.validators;class f{constructor(e){this.defaults=e||{},this.interceptors={request:new i.A,response:new i.A}}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=(0,a.A)(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:i}=t;void 0!==n&&l.A.assertOptions(n,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean),legacyInterceptorReqResOrdering:p.transitional(p.boolean)},!1),null!=s&&(r.A.isFunction(s)?t.paramsSerializer={serialize:s}:l.A.assertOptions(s,{encode:p.function,serialize:p.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),l.A.assertOptions(t,{baseUrl:p.spelling("baseURL"),withXsrfToken:p.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let c=i&&r.A.merge(i.common,i[t.method]);i&&r.A.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=d.A.concat(c,i);const f=[];let h=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;h=h&&e.synchronous;const n=t.transitional||u.A;n&&n.legacyInterceptorReqResOrdering?f.unshift(e.fulfilled,e.rejected):f.push(e.fulfilled,e.rejected)});const m=[];let v;this.interceptors.response.forEach(function(e){m.push(e.fulfilled,e.rejected)});let b,g=0;if(!h){const e=[o.A.bind(this),void 0];for(e.unshift(...f),e.push(...m),b=e.length,v=Promise.resolve(t);g<b;)v=v.then(e[g++],e[g++]);return v}b=f.length;let y=t;for(;g<b;){const e=f[g++],t=f[g++];try{y=e(y)}catch(e){t.call(this,e);break}}try{v=o.A.call(this,y)}catch(e){return Promise.reject(e)}for(g=0,b=m.length;g<b;)v=v.then(m[g++],m[g++]);return v}getUri(e){e=(0,a.A)(this.defaults,e);const t=(0,c.A)(e.baseURL,e.url,e.allowAbsoluteUrls);return(0,s.A)(t,e.params,e.paramsSerializer)}}r.A.forEach(["delete","get","head","options"],function(e){f.prototype[e]=function(t,n){return this.request((0,a.A)(n||{},{method:e,url:t,data:(n||{}).data}))}}),r.A.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,s){return this.request((0,a.A)(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)});const h=f},4062(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(7275);class s extends Error{static from(e,t,n,r,i,o){const a=new s(e.message,t||e.code,n,r,i);return a.cause=e,a.name=e.name,o&&Object.assign(a,o),a}constructor(e,t,n,r,s){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.A.toJSONObject(this.config),code:this.code,status:this.status}}}s.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",s.ERR_BAD_OPTION="ERR_BAD_OPTION",s.ECONNABORTED="ECONNABORTED",s.ETIMEDOUT="ETIMEDOUT",s.ERR_NETWORK="ERR_NETWORK",s.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",s.ERR_DEPRECATED="ERR_DEPRECATED",s.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",s.ERR_BAD_REQUEST="ERR_BAD_REQUEST",s.ERR_CANCELED="ERR_CANCELED",s.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",s.ERR_INVALID_URL="ERR_INVALID_URL";const i=s},7110(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(7275),s=n(3325);const i=Symbol("internals");function o(e){return e&&String(e).trim().toLowerCase()}function a(e){return!1===e||null==e?e:r.A.isArray(e)?e.map(a):String(e)}function c(e,t,n,s,i){return r.A.isFunction(s)?s.call(this,t,n):(i&&(t=n),r.A.isString(t)?r.A.isString(s)?-1!==t.indexOf(s):r.A.isRegExp(s)?s.test(t):void 0:void 0)}class l{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function c(e,t,n){const s=o(t);if(!s)throw new Error("header name must be a non-empty string");const c=r.A.findKey(i,s);(!c||void 0===i[c]||!0===n||void 0===n&&!1!==i[c])&&(i[c||t]=a(e))}const l=(e,t)=>r.A.forEach(e,(e,n)=>c(e,n,t));if(r.A.isPlainObject(e)||e instanceof this.constructor)l(e,t);else if(r.A.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))l((0,s.A)(e),t);else if(r.A.isObject(e)&&r.A.isIterable(e)){let n,s,i={};for(const t of e){if(!r.A.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[s=t[0]]=(n=i[s])?r.A.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}l(i,t)}else null!=e&&c(t,e,n);return this}get(e,t){if(e=o(e)){const n=r.A.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(r.A.isFunction(t))return t.call(this,e,n);if(r.A.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=o(e)){const n=r.A.findKey(this,e);return!(!n||void 0===this[n]||t&&!c(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function i(e){if(e=o(e)){const i=r.A.findKey(n,e);!i||t&&!c(0,n[i],i,t)||(delete n[i],s=!0)}}return r.A.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!c(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return r.A.forEach(this,(s,i)=>{const o=r.A.findKey(n,i);if(o)return t[o]=a(s),void delete t[i];const c=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();c!==i&&delete t[i],t[c]=a(s),n[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return r.A.forEach(this,(n,s)=>{null!=n&&!1!==n&&(t[s]=e&&r.A.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[i]=this[i]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=o(e);t[s]||(function(e,t){const n=r.A.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})})}(n,e),t[s]=!0)}return r.A.isArray(e)?e.forEach(s):s(e),this}}l.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),r.A.reduceDescriptors(l.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),r.A.freezeMethods(l);const d=l},7352(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(7275);const s=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){r.A.forEach(this.handlers,function(t){null!==t&&e(t)})}}},8262(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(9034),s=n(6787);function i(e,t,n){let i=!(0,r.A)(t);return e&&(i||0==n)?(0,s.A)(e,t):t}},8683(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(9152),s=n(9575),i=n(6013),o=n(8458),a=n(7110),c=n(6263);function l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o.A(null,e)}function d(e){return l(e),e.headers=a.A.from(e.headers),e.data=r.A.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c.A.getAdapter(e.adapter||i.A.adapter,e)(e).then(function(t){return l(e),t.data=r.A.call(e,e.transformResponse,t),t.headers=a.A.from(t.headers),t},function(t){return(0,s.A)(t)||(l(e),t&&t.response&&(t.response.data=r.A.call(e,e.transformResponse,t.response),t.response.headers=a.A.from(t.response.headers))),Promise.reject(t)})}},4662(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(7275),s=n(7110);const i=e=>e instanceof s.A?{...e}:e;function o(e,t){t=t||{};const n={};function s(e,t,n,s){return r.A.isPlainObject(e)&&r.A.isPlainObject(t)?r.A.merge.call({caseless:s},e,t):r.A.isPlainObject(t)?r.A.merge({},t):r.A.isArray(t)?t.slice():t}function o(e,t,n,i){return r.A.isUndefined(t)?r.A.isUndefined(e)?void 0:s(void 0,e,0,i):s(e,t,0,i)}function a(e,t){if(!r.A.isUndefined(t))return s(void 0,t)}function c(e,t){return r.A.isUndefined(t)?r.A.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function l(n,r,i){return i in t?s(n,r):i in e?s(void 0,n):void 0}const d={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:l,headers:(e,t,n)=>o(i(e),i(t),0,!0)};return r.A.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=r.A.hasOwnProp(d,s)?d[s]:o,a=i(e[s],t[s],s);r.A.isUndefined(a)&&i!==l||(n[s]=a)}),n}},3853(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(4062);function s(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new r.A("Request failed with status code "+n.status,[r.A.ERR_BAD_REQUEST,r.A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},9152(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(7275),s=n(6013),i=n(7110);function o(e,t){const n=this||s.A,o=t||n,a=i.A.from(o.headers);let c=o.data;return r.A.forEach(e,function(e){c=e.call(n,c,a.normalize(),t?t.status:void 0)}),a.normalize(),c}},6013(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(7275),s=n(4062),i=n(807),o=n(665),a=n(1076),c=n(3820),l=n(7887);const d={transitional:i.A,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=r.A.isObject(e);if(i&&r.A.isHTMLForm(e)&&(e=new FormData(e)),r.A.isFormData(e))return s?JSON.stringify((0,l.A)(e)):e;if(r.A.isArrayBuffer(e)||r.A.isBuffer(e)||r.A.isStream(e)||r.A.isFile(e)||r.A.isBlob(e)||r.A.isReadableStream(e))return e;if(r.A.isArrayBufferView(e))return e.buffer;if(r.A.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return(0,a.A)(e,this.formSerializer).toString();if((c=r.A.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return(0,o.A)(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),function(e){if(r.A.isString(e))try{return(0,JSON.parse)(e),r.A.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||d.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(r.A.isResponse(e)||r.A.isReadableStream(e))return e;if(e&&r.A.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw s.A.from(e,s.A.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:c.A.classes.FormData,Blob:c.A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};r.A.forEach(["delete","get","head","post","put","patch"],e=>{d.headers[e]={}});const u=d},807(e,t,n){"use strict";n.d(t,{A:()=>r});const r={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}},9888(e,t,n){"use strict";n.d(t,{x:()=>r});const r="1.13.5"},5267(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(665);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function i(e,t){this._pairs=[],e&&(0,r.A)(e,this,t)}const o=i.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const a=i},7693(e,t,n){"use strict";n.d(t,{A:()=>s});const r={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(r).forEach(([e,t])=>{r[t]=e});const s=r},2125(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,{A:()=>r})},3967(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(7275),s=n(5267);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function o(e,t,n){if(!t)return e;const o=n&&n.encode||i,a=r.A.isFunction(n)?{serialize:n}:n,c=a&&a.serialize;let l;if(l=c?c(t,a):r.A.isURLSearchParams(t)?t.toString():new s.A(t,a).toString(o),l){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+l}return e}},6787(e,t,n){"use strict";function r(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}n.d(t,{A:()=>r})},2723(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(8458),s=n(4062),i=n(7275);const o=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController;const a=function(e){if(!n){n=!0,l();const t=e instanceof Error?e:this.reason;o.abort(t instanceof s.A?t:new r.A(t instanceof Error?t.message:t))}};let c=t&&setTimeout(()=>{c=null,a(new s.A(`timeout of ${t}ms exceeded`,s.A.ETIMEDOUT))},t);const l=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>e.addEventListener("abort",a));const{signal:d}=o;return d.unsubscribe=()=>i.A.asap(l),d}}},9887(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(7275);const s=n(3820).A.hasStandardBrowserEnv?{write(e,t,n,s,i,o,a){if("undefined"==typeof document)return;const c=[`${e}=${encodeURIComponent(t)}`];r.A.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),r.A.isString(s)&&c.push(`path=${s}`),r.A.isString(i)&&c.push(`domain=${i}`),!0===o&&c.push("secure"),r.A.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}}},7887(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(7275);const s=function(e){function t(e,n,s,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),c=i>=e.length;return o=!o&&r.A.isArray(s)?s.length:o,c?(r.A.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!a):(s[o]&&r.A.isObject(s[o])||(s[o]=[]),t(e,n,s[o],i)&&r.A.isArray(s[o])&&(s[o]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}(s[o])),!a)}if(r.A.isFormData(e)&&r.A.isFunction(e.entries)){const n={};return r.A.forEachEntry(e,(e,s)=>{t(function(e){return r.A.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),s,n,0)}),n}return null}},9034(e,t,n){"use strict";function r(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}n.d(t,{A:()=>r})},8562(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(7275);function s(e){return r.A.isObject(e)&&!0===e.isAxiosError}},6305(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(3820);const s=r.A.hasStandardBrowserEnv?(i=new URL(r.A.origin),o=r.A.navigator&&/(msie|trident)/i.test(r.A.navigator.userAgent),e=>(e=new URL(e,r.A.origin),i.protocol===e.protocol&&i.host===e.host&&(o||i.port===e.port))):()=>!0;var i,o},3119(e,t,n){"use strict";n.d(t,{A:()=>r});const r=null},3325(e,t,n){"use strict";n.d(t,{A:()=>s});const r=n(7275).A.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"]),s=e=>{const t={};let n,s,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),s=e.substring(i+1).trim(),!n||t[n]&&r[n]||("set-cookie"===n?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t}},5579(e,t,n){"use strict";function r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}n.d(t,{A:()=>r})},7837(e,t,n){"use strict";n.d(t,{C1:()=>o,Vj:()=>a,mM:()=>c});var r=n(3873),s=n(66),i=n(7275);const o=(e,t,n=3)=>{let i=0;const o=(0,r.A)(50,250);return(0,s.A)(n=>{const r=n.loaded,s=n.lengthComputable?n.total:void 0,a=r-i,c=o(a);i=r,e({loaded:r,total:s,progress:s?r/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&r<=s?(s-r)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},a=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},c=e=>(...t)=>i.A.asap(()=>e(...t))},8382(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(3820),s=n(7275),i=n(6305),o=n(9887),a=n(8262),c=n(4662),l=n(7110),d=n(3967);const u=e=>{const t=(0,c.A)({},e);let{data:n,withXSRFToken:u,xsrfHeaderName:p,xsrfCookieName:f,headers:h,auth:m}=t;if(t.headers=h=l.A.from(h),t.url=(0,d.A)((0,a.A)(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),m&&h.set("Authorization","Basic "+btoa((m.username||"")+":"+(m.password?unescape(encodeURIComponent(m.password)):""))),s.A.isFormData(n))if(r.A.hasStandardBrowserEnv||r.A.hasStandardBrowserWebWorkerEnv)h.setContentType(void 0);else if(s.A.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&h.set(e,n)})}if(r.A.hasStandardBrowserEnv&&(u&&s.A.isFunction(u)&&(u=u(t)),u||!1!==u&&(0,i.A)(t.url))){const e=p&&f&&o.A.read(f);e&&h.set(p,e)}return t}},3873(e,t,n){"use strict";n.d(t,{A:()=>r});const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,i=0,o=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[o];s||(s=c),n[i]=a,r[i]=c;let d=o,u=0;for(;d!==i;)u+=n[d++],d%=e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}}},605(e,t,n){"use strict";function r(e){return function(t){return e.apply(null,t)}}n.d(t,{A:()=>r})},66(e,t,n){"use strict";n.d(t,{A:()=>r});const r=function(e,t){let n,r,s=0,i=1e3/t;const o=(t,i=Date.now())=>{s=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=i?o(e,t):(n=e,r||(r=setTimeout(()=>{r=null,o(n)},i-a)))},()=>n&&o(n)]}},665(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(7275),s=n(4062),i=n(3119);function o(e){return r.A.isPlainObject(e)||r.A.isArray(e)}function a(e){return r.A.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,n){return e?e.concat(t).map(function(e,t){return e=a(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const l=r.A.toFlatObject(r.A,{},null,function(e){return/^is[A-Z]/.test(e)}),d=function(e,t,n){if(!r.A.isObject(e))throw new TypeError("target must be an object");t=t||new(i.A||FormData);const d=(n=r.A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!r.A.isUndefined(t[e])})).metaTokens,u=n.visitor||v,p=n.dots,f=n.indexes,h=(n.Blob||"undefined"!=typeof Blob&&Blob)&&r.A.isSpecCompliantForm(t);if(!r.A.isFunction(u))throw new TypeError("visitor must be a function");function m(e){if(null===e)return"";if(r.A.isDate(e))return e.toISOString();if(r.A.isBoolean(e))return e.toString();if(!h&&r.A.isBlob(e))throw new s.A("Blob is not supported. Use a Buffer instead.");return r.A.isArrayBuffer(e)||r.A.isTypedArray(e)?h&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function v(e,n,s){let i=e;if(e&&!s&&"object"==typeof e)if(r.A.endsWith(n,"{}"))n=d?n:n.slice(0,-2),e=JSON.stringify(e);else if(r.A.isArray(e)&&function(e){return r.A.isArray(e)&&!e.some(o)}(e)||(r.A.isFileList(e)||r.A.endsWith(n,"[]"))&&(i=r.A.toArray(e)))return n=a(n),i.forEach(function(e,s){!r.A.isUndefined(e)&&null!==e&&t.append(!0===f?c([n],s,p):null===f?n:n+"[]",m(e))}),!1;return!!o(e)||(t.append(c(s,n,p),m(e)),!1)}const b=[],g=Object.assign(l,{defaultVisitor:v,convertValue:m,isVisitable:o});if(!r.A.isObject(e))throw new TypeError("data must be an object");return function e(n,s){if(!r.A.isUndefined(n)){if(-1!==b.indexOf(n))throw Error("Circular reference detected in "+s.join("."));b.push(n),r.A.forEach(n,function(n,i){!0===(!(r.A.isUndefined(n)||null===n)&&u.call(t,n,r.A.isString(i)?i.trim():i,s,g))&&e(n,s?s.concat(i):[i])}),b.pop()}}(e),t}},1076(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(7275),s=n(665),i=n(3820);function o(e,t){return(0,s.A)(e,new i.A.classes.URLSearchParams,{visitor:function(e,t,n,s){return i.A.isNode&&r.A.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}},4172(e,t,n){"use strict";n.d(t,{E9:()=>s});const r=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},s=(e,t,n,s)=>{const i=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*r(n,t)}(e,t);let o,a=0,c=e=>{o||(o=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return c(),void e.close();let s=r.byteLength;if(n){let e=a+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw c(e),e}},cancel:e=>(c(e),i.return())},{highWaterMark:2})}},3390(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(9888),s=n(4062);const i={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const o={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r.x+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,a)=>{if(!1===e)throw new s.A(i(r," has been removed"+(t?" in "+t:"")),s.A.ERR_DEPRECATED);return t&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},i.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const a={assertOptions:function(e,t,n){if("object"!=typeof e)throw new s.A("options must be an object",s.A.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new s.A("option "+o+" must be "+n,s.A.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new s.A("Unknown option "+o,s.A.ERR_BAD_OPTION)}},validators:i}},6501(e,t,n){"use strict";n.d(t,{A:()=>r});const r="undefined"!=typeof Blob?Blob:null},8556(e,t,n){"use strict";n.d(t,{A:()=>r});const r="undefined"!=typeof FormData?FormData:null},139(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(5267);const s="undefined"!=typeof URLSearchParams?URLSearchParams:r.A},6847(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(139),s=n(8556),i=n(6501);const o={isBrowser:!0,classes:{URLSearchParams:r.A,FormData:s.A,Blob:i.A},protocols:["http","https","file","blob","url","data"]}},2569(e,t,n){"use strict";n.r(t),n.d(t,{hasBrowserEnv:()=>r,hasStandardBrowserEnv:()=>i,hasStandardBrowserWebWorkerEnv:()=>o,navigator:()=>s,origin:()=>a});const r="undefined"!=typeof window&&"undefined"!=typeof document,s="object"==typeof navigator&&navigator||void 0,i=r&&(!s||["ReactNative","NativeScript","NS"].indexOf(s.product)<0),o="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,a=r&&window.location.href||"http://localhost"},3820(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(6847);const s={...n(2569),...r.A}},7275(e,t,n){"use strict";n.d(t,{A:()=>G});var r=n(2125);const{toString:s}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:o,toStringTag:a}=Symbol,c=(l=Object.create(null),e=>{const t=s.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const d=e=>(e=e.toLowerCase(),t=>c(t)===e),u=e=>t=>typeof t===e,{isArray:p}=Array,f=u("undefined");function h(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=d("ArrayBuffer"),v=u("string"),b=u("function"),g=u("number"),y=e=>null!==e&&"object"==typeof e,_=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||o in e)},j=d("Date"),w=d("File"),x=d("Blob"),O=d("FileList"),A=d("URLSearchParams"),[S,P,N,k]=["ReadableStream","Request","Response","Headers"].map(d);function E(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(h(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let o;for(r=0;r<i;r++)o=s[r],t.call(null,e[o],o,e)}}function C(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,T=e=>!f(e)&&e!==D,R=(I="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>I&&e instanceof I);var I;const L=d("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=d("RegExp"),B=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};E(n,(n,s)=>{let i;!1!==(i=t(n,s,e))&&(r[s]=i||n)}),Object.defineProperties(e,r)},U=d("AsyncFunction"),q=($="function"==typeof setImmediate,V=b(D.postMessage),$?setImmediate:V?(W=`axios@${Math.random()}`,H=[],D.addEventListener("message",({source:e,data:t})=>{e===D&&t===W&&H.length&&H.shift()()},!1),e=>{H.push(e),D.postMessage(W,"*")}):e=>setTimeout(e));var $,V,W,H;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(D):"undefined"!=typeof process&&process.nextTick||q,G={isArray:p,isArrayBuffer:m,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=c(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:v,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:_,isEmptyObject:e=>{if(!y(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:S,isRequest:P,isResponse:N,isHeaders:k,isUndefined:f,isDate:j,isFile:w,isBlob:x,isRegExp:M,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:A,isTypedArray:R,isFileList:O,forEach:E,merge:function e(){const{caseless:t,skipUndefined:n}=T(this)&&this||{},r={},s=(s,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const o=t&&C(r,i)||i;_(r[o])&&_(s)?r[o]=e(r[o],s):_(s)?r[o]=e({},s):p(s)?r[o]=s.slice():n&&f(s)||(r[o]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&E(arguments[e],s);return r},extend:(e,t,n,{allOwnKeys:s}={})=>(E(t,(t,s)=>{n&&b(t)?Object.defineProperty(e,s,{value:(0,r.A)(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),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),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:d,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(p(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[o]).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:L,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:B,freezeMethods:e=>{B(e,(t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(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 p(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:C,global:D,isContextDefined:T,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[a]&&e[o])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const s=p(e)?[]:{};return E(e,(e,t)=>{const i=n(e,r+1);!f(i)&&(s[t]=i)}),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:U,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:q,asap:z,isIterable:e=>null!=e&&b(e[o])}}},e=>{e(e.s=5070)}]);