Plugin Directory

Changeset 3368877


Ignore:
Timestamp:
09/27/2025 12:39:20 PM (5 months ago)
Author:
nurwp
Message:

Release of Versatile 1.0.3 ✅

Location:
versatile-toolkit
Files:
113 added
11 edited

Legend:

Unmodified
Added
Removed
  • versatile-toolkit/trunk/assets/dist/css/style.min.css

    r3349805 r3368877  
    592592  left: 0.5rem;
    593593}
     594.left-3 {
     595  left: 0.75rem;
     596}
    594597.left-\[50\%\] {
    595598  left: 50%;
     
    633636.z-50 {
    634637  z-index: 50;
     638}
     639.z-\[100000\] {
     640  z-index: 100000;
    635641}
    636642.z-\[999999\] {
     
    819825  max-height: 8rem;
    820826}
     827.max-h-60 {
     828  max-height: 15rem;
     829}
    821830.max-h-\[300px\] {
    822831  max-height: 300px;
     
    920929.w-\[300px\] {
    921930  width: 300px;
     931}
     932.w-\[80\%\] {
     933  width: 80%;
    922934}
    923935.w-\[900px\] {
     
    10251037  grid-template-columns: repeat(6, minmax(0, 1fr));
    10261038}
     1039.grid-cols-\[repeat\(auto-fill\2c minmax\(300px\2c 1fr\)\)\] {
     1040  grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
     1041}
    10271042.flex-row {
    10281043  flex-direction: row;
     
    10391054.items-center {
    10401055  align-items: center;
     1056}
     1057.justify-start {
     1058  justify-content: flex-start;
     1059}
     1060.justify-end {
     1061  justify-content: flex-end;
    10411062}
    10421063.justify-center {
     
    10841105  margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
    10851106}
     1107.space-y-1 > :not([hidden]) ~ :not([hidden]) {
     1108  --tw-space-y-reverse: 0;
     1109  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
     1110  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
     1111}
    10861112.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) {
    10871113  --tw-space-y-reverse: 0;
     
    11241150  overflow-x: hidden;
    11251151}
     1152.scroll-auto {
     1153  scroll-behavior: auto;
     1154}
    11261155.whitespace-nowrap {
    11271156  white-space: nowrap;
     
    14371466  padding-bottom: 0.375rem;
    14381467}
    1439 .py-10 {
    1440   padding-top: 2.5rem;
    1441   padding-bottom: 2.5rem;
    1442 }
    14431468.py-12 {
    14441469  padding-top: 3rem;
     
    14671492  padding-bottom: 1.25rem;
    14681493}
     1494.pl-10 {
     1495  padding-left: 2.5rem;
     1496}
    14691497.pl-2\.5 {
    14701498  padding-left: 0.625rem;
     
    14781506.pr-2\.5 {
    14791507  padding-right: 0.625rem;
    1480 }
    1481 .pr-4 {
    1482   padding-right: 1rem;
    14831508}
    14841509.pt-0 {
     
    15271552  line-height: 1rem;
    15281553}
     1554.font-black {
     1555  font-weight: 900;
     1556}
     1557.font-bold {
     1558  font-weight: 700;
     1559}
    15291560.font-medium {
    15301561  font-weight: 500;
     
    15731604  color: hsl(var(--foreground));
    15741605}
     1606.text-gray-400 {
     1607  --tw-text-opacity: 1;
     1608  color: rgb(156 163 175 / var(--tw-text-opacity, 1));
     1609}
    15751610.text-gray-500 {
    15761611  --tw-text-opacity: 1;
     
    16341669  --tw-text-opacity: 1;
    16351670  color: rgb(148 163 184 / var(--tw-text-opacity, 1));
    1636 }
    1637 .text-slate-500 {
    1638   --tw-text-opacity: 1;
    1639   color: rgb(100 116 139 / var(--tw-text-opacity, 1));
    16401671}
    16411672.text-slate-600 {
     
    18471878}
    18481879
     1880#versatile-root {
     1881  margin-right: 20px;
     1882}
     1883
    18491884.file\:border-0::file-selector-button {
    18501885  border-width: 0px;
     
    20142049}
    20152050
     2051.hover\:bg-red-50:hover {
     2052  --tw-bg-opacity: 1;
     2053  background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
     2054}
     2055
    20162056.hover\:bg-secondary\/80:hover {
    20172057  background-color: hsl(var(--secondary) / 0.8);
     
    20542094  --tw-text-opacity: 1;
    20552095  color: rgb(30 64 175 / var(--tw-text-opacity, 1));
     2096}
     2097
     2098.hover\:text-red-700:hover {
     2099  --tw-text-opacity: 1;
     2100  color: rgb(185 28 28 / var(--tw-text-opacity, 1));
    20562101}
    20572102
  • versatile-toolkit/trunk/assets/dist/js/versatile-js.min.js

    r3349805 r3368877  
    1 (()=>{"use strict";var e,t,r={20:(e,t,r)=>{var n=r(594),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,o={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===o[n]&&(o[n]=t[n]);return{$$typeof:a,type:e,key:c,ref:u,props:o,_owner:s.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},206:e=>{e.exports=ReactDOM},338:(e,t,r)=>{var n=r(206);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},594:e=>{e.exports=React},848:(e,t,r)=>{e.exports=r(20)}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,a),o.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,a.d(o,i),o},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var o=a(338),i=a(594),s=a.t(i,2),l="popstate";function c(e={}){return y(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=m(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),h("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:p(t))},function(e,t){d("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function u(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e)try{throw new Error(t)}catch(e){}}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?m(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function p({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function m(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function y(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",c=null,u=d();function d(){return(i.state||{idx:null}).idx}function p(){s="POP";let e=d(),t=null==e?null:e-u;u=e,c&&c({action:s,location:y.location,delta:t})}function m(e){return v(e)}null==u&&(u=0,i.replaceState({...i.state,idx:u},""));let y={get action(){return s},get location(){return e(a,i)},listen(e){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(l,p),c=e,()=>{a.removeEventListener(l,p),c=null}},createHref:e=>t(a,e),createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let n=h(y.location,e,t);r&&r(n,e),u=d()+1;let l=f(n,u),p=y.createHref(n);try{i.pushState(l,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(p)}o&&c&&c({action:s,location:y.location,delta:1})},replace:function(e,t){s="REPLACE";let n=h(y.location,e,t);r&&r(n,e),u=d();let a=f(n,u),l=y.createHref(n);i.replaceState(a,"",l),o&&c&&c({action:s,location:y.location,delta:0})},go:e=>i.go(e)};return y}function v(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),u(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}new WeakMap;function g(e,t,r="/"){return b(e,t,r,!1)}function b(e,t,r,n){let a=D(("string"==typeof t?m(t):t).pathname||"/",r);if(null==a)return null;let o=x(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let i=null;for(let e=0;null==i&&e<o.length;++e){let t=T(a);i=C(o[e],t,n)}return i}function x(e,t=[],r=[],n=""){let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(u(i.relativePath.startsWith(n),`Absolute route path "${i.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(n.length));let s=$([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(u(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),x(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:P(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of w(e.path))a(e,t,r);else a(e,t)}),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=w(n.join("/")),s=[];return s.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&s.push(...i),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var j=/^:[\w-]+$/,_=3,k=2,O=1,S=10,N=-2,E=e=>"*"===e;function P(e,t){let r=e.split("/"),n=r.length;return r.some(E)&&(n+=N),t&&(n+=k),r.filter(e=>!E(e)).reduce((e,t)=>e+(j.test(t)?_:""===t?O:S),n)}function C(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let s=n[e],l=e===n.length-1,c="/"===o?t:t.slice(o.length)||"/",u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},c),d=s.route;if(!u&&l&&r&&!n[n.length-1].route.index&&(u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!u)return null;Object.assign(a,u.params),i.push({params:a,pathname:$([o,u.pathname]),pathnameBase:V($([o,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(o=$([o,u.pathnameBase]))}return i}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=A(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1),l=n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=s[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{});return{params:l,pathname:o,pathnameBase:i,pattern:e}}function A(e,t=!1,r=!0){d("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function T(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function F(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function I(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function M(e){let t=I(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function L(e,t,r,n=!1){let a;"string"==typeof e?a=m(e):(a={...e},u(!a.pathname||!a.pathname.includes("?"),F("?","pathname","search",a)),u(!a.pathname||!a.pathname.includes("#"),F("#","pathname","hash",a)),u(!a.search||!a.search.includes("#"),F("#","search","hash",a)));let o,i=""===e||""===a.pathname,s=i?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:r,search:n="",hash:a=""}="string"==typeof e?m(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:z(n),hash:U(a)}}(a,o),c=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!d||(l.pathname+="/"),l}var $=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function q(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var W=["POST","PUT","PATCH","DELETE"],Z=(new Set(W),["GET",...W]);new Set(Z),Symbol("ResetLoaderData");var B=i.createContext(null);B.displayName="DataRouter";var H=i.createContext(null);H.displayName="DataRouterState";var K=i.createContext(!1);var Q=i.createContext({isTransitioning:!1});Q.displayName="ViewTransition";var G=i.createContext(new Map);G.displayName="Fetchers";var J=i.createContext(null);J.displayName="Await";var Y=i.createContext(null);Y.displayName="Navigation";var X=i.createContext(null);X.displayName="Location";var ee=i.createContext({outlet:null,matches:[],isDataRoute:!1});ee.displayName="Route";var te=i.createContext(null);te.displayName="RouteError";function re(){return null!=i.useContext(X)}function ne(){return u(re(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(X).location}var ae="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oe(e){i.useContext(Y).static||i.useLayoutEffect(e)}function ie(){let{isDataRoute:e}=i.useContext(ee);return e?function(){let{router:e}=me("useNavigate"),t=ve("useNavigate"),r=i.useRef(!1);oe(()=>{r.current=!0});let n=i.useCallback(async(n,a={})=>{d(r.current,ae),r.current&&("number"==typeof n?e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t]);return n}():function(){u(re(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(B),{basename:t,navigator:r}=i.useContext(Y),{matches:n}=i.useContext(ee),{pathname:a}=ne(),o=JSON.stringify(M(n)),s=i.useRef(!1);oe(()=>{s.current=!0});let l=i.useCallback((n,i={})=>{if(d(s.current,ae),!s.current)return;if("number"==typeof n)return void r.go(n);let l=L(n,JSON.parse(o),a,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:$([t,l.pathname])),(i.replace?r.replace:r.push)(l,i.state,i)},[t,r,o,a,e]);return l}()}i.createContext(null);function se(e,{relative:t}={}){let{matches:r}=i.useContext(ee),{pathname:n}=ne(),a=JSON.stringify(M(r));return i.useMemo(()=>L(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}function le(e,t,r,n){u(re(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=i.useContext(Y),{matches:o}=i.useContext(ee),s=o[o.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",h=s&&s.route;{let e=h&&h.path||"";xe(c,!h||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let p,y=ne();if(t){let e="string"==typeof t?m(t):t;u("/"===f||e.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=y;let v=p.pathname||"/",b=v;if("/"!==f){let e=f.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let x=g(e,{pathname:b});d(h||null!=x,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),d(null==x||void 0!==x[x.length-1].route.element||void 0!==x[x.length-1].route.Component||void 0!==x[x.length-1].route.lazy,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=he(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:$([f,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:$([f,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),o,r,n);return t&&w?i.createElement(X.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},w):w}function ce(){let e=ge(),t=q(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},s=null;return s=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,s)}var ue=i.createElement(ce,null),de=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(ee.Provider,{value:this.props.routeContext},i.createElement(te.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function fe({routeContext:e,match:t,children:r}){let n=i.useContext(B);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(ee.Provider,{value:e},r)}function he(e,t=[],r=null,n=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let a=e,o=r?.errors;if(null!=o){let e=a.findIndex(e=>e.route.id&&void 0!==o?.[e.route.id]);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,l=-1;if(r)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:n}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||o){s=!0,a=l>=0?a.slice(0,l+1):[a[0]];break}}}return a.reduceRight((e,n,c)=>{let u,d=!1,f=null,h=null;r&&(u=o&&n.route.id?o[n.route.id]:void 0,f=n.route.errorElement||ue,s&&(l<0&&0===c?(xe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,h=null):l===c&&(d=!0,h=n.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,c+1)),m=()=>{let t;return t=u?f:d?h:n.route.Component?i.createElement(n.route.Component,null):n.route.element?n.route.element:e,i.createElement(fe,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===c)?i.createElement(de,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}function pe(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function me(e){let t=i.useContext(B);return u(t,pe(e)),t}function ye(e){let t=i.useContext(H);return u(t,pe(e)),t}function ve(e){let t=function(e){let t=i.useContext(ee);return u(t,pe(e)),t}(e),r=t.matches[t.matches.length-1];return u(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ge(){let e=i.useContext(te),t=ye("useRouteError"),r=ve("useRouteError");return void 0!==e?e:t.errors?.[r]}var be={};function xe(e,t,r){t||be[e]||(be[e]=!0,d(!1,r))}var we={};function je(e,t){e||we[t]||(we[t]=!0)}i.memo(function({routes:e,future:t,state:r}){return le(e,void 0,r,t)});function _e({to:e,replace:t,state:r,relative:n}){u(re(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=i.useContext(Y);d(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=i.useContext(ee),{pathname:s}=ne(),l=ie(),c=L(e,M(o),s,"path"===n),f=JSON.stringify(c);return i.useEffect(()=>{l(JSON.parse(f),{replace:t,state:r,relative:n})},[l,f,n,t,r]),null}function ke(e){u(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Oe({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1}){u(!re(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=i.useMemo(()=>({basename:s,navigator:a,static:o,future:{}}),[s,a,o]);"string"==typeof r&&(r=m(r));let{pathname:c="/",search:f="",hash:h="",state:p=null,key:y="default"}=r,v=i.useMemo(()=>{let e=D(c,s);return null==e?null:{location:{pathname:e,search:f,hash:h,state:p,key:y},navigationType:n}},[s,c,f,h,p,y,n]);return d(null!=v,`<Router basename="${s}"> is not able to match the URL "${c}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`),null==v?null:i.createElement(Y.Provider,{value:l},i.createElement(X.Provider,{children:t,value:v}))}function Se({children:e,location:t}){return le(Ne(e),t)}i.Component;function Ne(e,t=[]){let r=[];return i.Children.forEach(e,(e,n)=>{if(!i.isValidElement(e))return;let a=[...t,n];if(e.type===i.Fragment)return void r.push.apply(r,Ne(e.props.children,a));u(e.type===ke,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),u(!e.props.index||!e.props.children,"An index route cannot have child routes.");let o={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=Ne(e.props.children,a)),r.push(o)}),r}var Ee="get",Pe="application/x-www-form-urlencoded";function Ce(e){return null!=e&&"string"==typeof e.tagName}function Re(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}var Ae=null;var Te=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function De(e){return null==e||Te.has(e)?e:(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pe}"`),null)}function Fe(e,t){let r,n,a,o,i;if(Ce(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?D(i,t):null,r=e.getAttribute("method")||Ee,a=De(e.getAttribute("enctype"))||Pe,o=new FormData(e)}else if(function(e){return Ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ce(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?D(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Ee,a=De(e.getAttribute("formenctype"))||De(i.getAttribute("enctype"))||Pe,o=new FormData(i,e),!function(){if(null===Ae)try{new FormData(document.createElement("form"),0),Ae=!1}catch(e){Ae=!0}return Ae}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,n)}}else{if(Ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ee,n=null,a=Pe,i=e}var s;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis;function Ie(e){return{__html:e}}function Me(e,t){if(!1===e||null==e)throw new Error(t)}Symbol("SingleFetchRedirect");function Le(e,t,r){let n="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===n.pathname?n.pathname=`_root.${r}`:t&&"/"===D(n.pathname,t)?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function $e(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(e){return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ve(e){return null!=e&&"string"==typeof e.page}function ze(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Ue(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,s=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||s(e,t)):"data"===o?t.filter((t,o)=>{let l=n.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,o)||s(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function qe(e,t,{includeHydrateFallback:r}={}){return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1),[...new Set(n)];var n}function We(e,t){let r=new Set,n=new Set(t);return e.reduce((e,a)=>{if(t&&!Ve(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e},[])}function Ze(e,t){return"lazy"===e.mode&&!0===t}function Be(){let e=i.useContext(B);return Me(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function He(){let e=i.useContext(H);return Me(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ke=i.createContext(void 0);function Qe(){let e=i.useContext(Ke);return Me(e,"You must render this element inside a <HydratedRouter> element"),e}function Ge(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Je(e,t,r){if(r&&!tt)return[e[0]];if(t){let r=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,r+1)}return e}Ke.displayName="FrameworkContext";function Ye({page:e,...t}){let{router:r}=Be(),n=i.useMemo(()=>g(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?i.createElement(et,{page:e,matches:n,...t}):null}function Xe(e){let{manifest:t,routeModules:r}=Qe(),[n,a]=i.useState([]);return i.useEffect(()=>{let n=!1;return async function(e,t,r){return We((await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await $e(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(ze).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}function et({page:e,matches:t,...r}){let n=ne(),{manifest:a,routeModules:o}=Qe(),{basename:s}=Be(),{loaderData:l,matches:c}=He(),u=i.useMemo(()=>Ue(e,t,c,a,n,"data"),[e,t,c,a,n]),d=i.useMemo(()=>Ue(e,t,c,a,n,"assets"),[e,t,c,a,n]),f=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,i=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:r.add(e.route.id))}),0===r.size)return[];let c=Le(e,s,"data");return i&&r.size>0&&c.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[c.pathname+c.search]},[s,l,n,a,u,t,e,o]),h=i.useMemo(()=>qe(d,a),[d,a]),p=Xe(d);return i.createElement(i.Fragment,null,f.map(e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),h.map(e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>i.createElement("link",{key:e,...t})))}var tt=!1;function rt(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:s}=Qe(),{router:l,static:c,staticContext:u}=Be(),{matches:d}=He(),f=i.useContext(K),h=Ze(o,s);a&&(a.didRenderScripts=!0);let p=Je(d,null,n);i.useEffect(()=>{tt=!0},[]);let m=i.useMemo(()=>{if(f)return null;let n=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",a=c?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${h?"":`import ${JSON.stringify(t.url)}`};\n${p.map((e,r)=>{let n=`route${r}`,a=t.routes[e.route.id];Me(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:o,clientLoaderModule:i,clientMiddlewareModule:s,hydrateFallbackModule:l,module:c}=a,u=[...o?[{module:o,varName:`${n}_clientAction`}]:[],...i?[{module:i,varName:`${n}_clientLoader`}]:[],...s?[{module:s,varName:`${n}_clientMiddleware`}]:[],...l?[{module:l,varName:`${n}_HydrateFallback`}]:[],{module:c,varName:`${n}_main`}];return 1===u.length?`import * as ${n} from ${JSON.stringify(c)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${u.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}\n  ${h?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(e=>{let t=g(r.routes,e,r.basename);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(t,l),null,2)};`:""}\n  window.__reactRouterRouteModules = {${p.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return i.createElement(i.Fragment,null,i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ie(n),type:void 0}),i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ie(a),type:"module",async:!0}))},[]),y=tt||f?[]:(v=t.entry.imports.concat(qe(p,t,{includeHydrateFallback:!0})),[...new Set(v)]);var v;let b="object"==typeof t.sri?t.sri:{};return je(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),tt||f?null:i.createElement(i.Fragment,null,"object"==typeof t.sri?i.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,h?null:i.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],suppressHydrationWarning:!0}),i.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],suppressHydrationWarning:!0}),y.map(t=>i.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:b[t],suppressHydrationWarning:!0})),m)}function nt(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}i.Component;function at({error:e,isOutsideRemixApp:t}){let r,n=i.createElement("script",{dangerouslySetInnerHTML:{__html:'\n        console.log(\n          "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n        );\n      '}});if(q(e))return i.createElement(ot,{title:"Unhandled Thrown Response!"},i.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);if(e instanceof Error)r=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);r=new Error(t)}return i.createElement(ot,{title:"Application Error!",isOutsideRemixApp:t},i.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),i.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function ot({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=Qe();return a.root?.Layout&&!r?n:i.createElement("html",{lang:"en"},i.createElement("head",null,i.createElement("meta",{charSet:"utf-8"}),i.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),i.createElement("title",null,e)),i.createElement("body",null,i.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?i.createElement(rt,null):null)))}var it="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{it&&(window.__reactRouterVersion="7.7.0")}catch(vt){}function st({basename:e,children:t,window:r}){let n=i.useRef();null==n.current&&(n.current=c({window:r,v5Compat:!0}));let a=n.current,[o,s]=i.useState({action:a.action,location:a.location}),l=i.useCallback(e=>{i.startTransition(()=>s(e))},[s]);return i.useLayoutEffect(()=>a.listen(l),[a,l]),i.createElement(Oe,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a})}var lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ct=i.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:o,state:s,target:l,to:c,preventScrollReset:f,viewTransition:h,...m},y){let v,{basename:g}=i.useContext(Y),b="string"==typeof c&&lt.test(c),x=!1;if("string"==typeof c&&b&&(v=c,it))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=D(t.pathname,g);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:x=!0}catch(e){d(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=function(e,{relative:t}={}){u(re(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(Y),{hash:a,pathname:o,search:s}=se(e,{relative:t}),l=o;return"/"!==r&&(l="/"===o?r:$([r,o])),n.createHref({pathname:l,search:s,hash:a})}(c,{relative:n}),[j,_,k]=function(e,t){let r=i.useContext(Ke),[n,a]=i.useState(!1),[o,s]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,h=i.useRef(null);i.useEffect(()=>{if("render"===e&&s(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[e]),i.useEffect(()=>{if(n){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{a(!0)},m=()=>{a(!1),s(!1)};return r?"intent"!==e?[o,h,{}]:[o,h,{onFocus:Ge(l,p),onBlur:Ge(c,m),onMouseEnter:Ge(u,p),onMouseLeave:Ge(d,m),onTouchStart:Ge(f,p)}]:[!1,h,{}]}(r,m),O=function(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:s}={}){let l=ie(),c=ne(),u=se(e,{relative:o});return i.useCallback(i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==r?r:p(c)===p(u);l(e,{replace:t,state:n,preventScrollReset:a,relative:o,viewTransition:s})}},[c,l,u,r,n,t,e,a,o,s])}(c,{replace:o,state:s,target:l,preventScrollReset:f,relative:n,viewTransition:h});let S=i.createElement("a",{...m,...k,href:v||w,onClick:x||a?e:function(t){e&&e(t),t.defaultPrevented||O(t)},ref:nt(y,_),target:l,"data-discover":b||"render"!==t?void 0:"true"});return j&&!b?i.createElement(i.Fragment,null,S,i.createElement(Ye,{page:w})):S});ct.displayName="Link",i.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:o,viewTransition:s,children:l,...c},d){let f=se(o,{relative:c.relative}),h=ne(),p=i.useContext(H),{navigator:m,basename:y}=i.useContext(Y),v=null!=p&&function(e,t={}){let r=i.useContext(Q);u(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=ft("useViewTransitionState"),a=se(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=D(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=D(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=R(a.pathname,s)||null!=R(a.pathname,o)}(f)&&!0===s,g=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=h.pathname,x=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(b=b.toLowerCase(),x=x?x.toLowerCase():null,g=g.toLowerCase()),x&&y&&(x=D(x,y)||x);const w="/"!==g&&g.endsWith("/")?g.length-1:g.length;let j,_=b===g||!n&&b.startsWith(g)&&"/"===b.charAt(w),k=null!=x&&(x===g||!n&&x.startsWith(g)&&"/"===x.charAt(g.length)),O={isActive:_,isPending:k,isTransitioning:v},S=_?e:void 0;j="function"==typeof r?r(O):[r,_?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let N="function"==typeof a?a(O):a;return i.createElement(ct,{...c,"aria-current":S,className:j,ref:d,style:N,to:o,viewTransition:s},"function"==typeof l?l(O):l)}).displayName="NavLink";var ut=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:s=Ee,action:l,onSubmit:c,relative:d,preventScrollReset:f,viewTransition:h,...m},y)=>{let v=yt(),g=function(e,{relative:t}={}){let{basename:r}=i.useContext(Y),n=i.useContext(ee);u(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...se(e||".",{relative:t})},s=ne();if(null==e){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();o.search=r?`?${r}`:""}}e&&"."!==e||!a.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(o.pathname="/"===o.pathname?r:$([r,o.pathname]));return p(o)}(l,{relative:d}),b="get"===s.toLowerCase()?"get":"post",x="string"==typeof l&&lt.test(l);return i.createElement("form",{ref:y,method:b,action:g,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,i=n?.getAttribute("formmethod")||s;v(n||e.currentTarget,{fetcherKey:t,method:i,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:h})},...m,"data-discover":x||"render"!==e?void 0:"true"})});function dt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ft(e){let t=i.useContext(B);return u(t,dt(e)),t}function ht(e){d("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(Re(e)),r=i.useRef(!1),n=ne(),a=i.useMemo(()=>function(e,t){let r=Re(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),o=ie(),s=i.useCallback((e,t)=>{const n=Re("function"==typeof e?e(new URLSearchParams(a)):e);r.current=!0,o("?"+n,t)},[o,a]);return[a,s]}ut.displayName="Form";var pt=0,mt=()=>`__${String(++pt)}__`;function yt(){let{router:e}=ft("useSubmit"),{basename:t}=i.useContext(Y),r=ve("useRouteId");return i.useCallback(async(n,a={})=>{let{action:o,method:i,encType:s,formData:l,body:c}=Fe(n,t);if(!1===a.navigate){let t=a.fetcherKey||mt();await e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||i,formEncType:a.encType||s,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}let vt={data:""},gt=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||vt,bt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,xt=/\/\*[^]*?\*\/|  +/g,wt=/\n+/g,jt=(e,t)=>{let r="",n="",a="";for(let o in e){let i=e[o];"@"==o[0]?"i"==o[1]?r=o+" "+i+";":n+="f"==o[1]?jt(i,o):o+"{"+jt(i,"k"==o[1]?"":t)+"}":"object"==typeof i?n+=jt(i,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=i&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=jt.p?jt.p(o,i):o+":"+i+";")}return r+(t&&a?t+"{"+a+"}":a)+n},_t={},kt=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+kt(e[r]);return t}return e},Ot=(e,t,r,n,a)=>{let o=kt(e),i=_t[o]||(_t[o]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(o));if(!_t[i]){let t=o!==e?e:(e=>{let t,r,n=[{}];for(;t=bt.exec(e.replace(xt,""));)t[4]?n.shift():t[3]?(r=t[3].replace(wt," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(wt," ").trim();return n[0]})(e);_t[i]=jt(a?{["@keyframes "+i]:t}:t,r?"":"."+i)}let s=r&&_t.g?_t.g:null;return r&&(_t.g=_t[i]),((e,t,r,n)=>{n?t.data=t.data.replace(n,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(_t[i],t,n,s),i};function St(e){let t=this||{},r=e.call?e(t.p):e;return Ot(r.unshift?r.raw?((e,t,r)=>e.reduce((e,n,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":jt(e,""):!1===e?"":e}return e+n+(null==o?"":o)},""))(r,[].slice.call(arguments,1),t.p):r.reduce((e,r)=>Object.assign(e,r&&r.call?r(t.p):r),{}):r,gt(t.target),t.g,t.o,t.k)}St.bind({g:1});let Nt,Et,Pt,Ct=St.bind({k:1});function Rt(e,t){let r=this||{};return function(){let n=arguments;function a(o,i){let s=Object.assign({},o),l=s.className||a.className;r.p=Object.assign({theme:Et&&Et()},s),r.o=/ *go\d+/.test(l),s.className=St.apply(r,n)+(l?" "+l:""),t&&(s.ref=i);let c=e;return e[0]&&(c=s.as||e,delete s.as),Pt&&c[0]&&Pt(s),Nt(c,s)}return t?t(a):a}}var At=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,Tt=(()=>{let e=0;return()=>(++e).toString()})(),Dt=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Ft=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return Ft(e,{type:e.toasts.find(e=>e.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+a}))}}},It=[],Mt={toasts:[],pausedAt:void 0},Lt=e=>{Mt=Ft(Mt,e),It.forEach(e=>{e(Mt)})},$t={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Vt=e=>(t,r)=>{let n=((e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||Tt()}))(t,e,r);return Lt({type:2,toast:n}),n.id},zt=(e,t)=>Vt("blank")(e,t);zt.error=Vt("error"),zt.success=Vt("success"),zt.loading=Vt("loading"),zt.custom=Vt("custom"),zt.dismiss=e=>{Lt({type:3,toastId:e})},zt.remove=e=>Lt({type:4,toastId:e}),zt.promise=(e,t,r)=>{let n=zt.loading(t.loading,{...r,...null==r?void 0:r.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let a=t.success?At(t.success,e):void 0;return a?zt.success(a,{id:n,...r,...null==r?void 0:r.success}):zt.dismiss(n),e}).catch(e=>{let a=t.error?At(t.error,e):void 0;a?zt.error(a,{id:n,...r,...null==r?void 0:r.error}):zt.dismiss(n)}),e};var Ut=(e,t)=>{Lt({type:1,toast:{id:e,height:t}})},qt=()=>{Lt({type:5,time:Date.now()})},Wt=new Map,Zt=e=>{let{toasts:t,pausedAt:r}=((e={})=>{let[t,r]=(0,i.useState)(Mt),n=(0,i.useRef)(Mt);(0,i.useEffect)(()=>(n.current!==Mt&&r(Mt),It.push(r),()=>{let e=It.indexOf(r);e>-1&&It.splice(e,1)}),[]);let a=t.toasts.map(t=>{var r,n,a;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(r=e[t.type])?void 0:r.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||$t[t.type],style:{...e.style,...null==(a=e[t.type])?void 0:a.style,...t.style}}});return{...t,toasts:a}})(e);(0,i.useEffect)(()=>{if(r)return;let e=Date.now(),n=t.map(t=>{if(t.duration===1/0)return;let r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(r<0))return setTimeout(()=>zt.dismiss(t.id),r);t.visible&&zt.dismiss(t.id)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[t,r]);let n=(0,i.useCallback)(()=>{r&&Lt({type:6,time:Date.now()})},[r]),a=(0,i.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:a=8,defaultPosition:o}=r||{},i=t.filter(t=>(t.position||o)===(e.position||o)&&t.height),s=i.findIndex(t=>t.id===e.id),l=i.filter((e,t)=>t<s&&e.visible).length;return i.filter(e=>e.visible).slice(...n?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+a,0)},[t]);return(0,i.useEffect)(()=>{t.forEach(e=>{if(e.dismissed)((e,t=1e3)=>{if(Wt.has(e))return;let r=setTimeout(()=>{Wt.delete(e),Lt({type:4,toastId:e})},t);Wt.set(e,r)})(e.id,e.removeDelay);else{let t=Wt.get(e.id);t&&(clearTimeout(t),Wt.delete(e.id))}})},[t]),{toasts:t,handlers:{updateHeight:Ut,startPause:qt,endPause:n,calculateOffset:a}}},Bt=Ct`
     1(()=>{"use strict";var e,t,r={20:(e,t,r)=>{var n=r(594),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},206:e=>{e.exports=ReactDOM},338:(e,t,r)=>{var n=r(206);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},594:e=>{e.exports=React},848:(e,t,r)=>{e.exports=r(20)}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);o.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,o.d(a,i),a},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var a=o(338),i=o(594),s=o.t(i,2),l="popstate";function c(e={}){return y(function(e,t){let{pathname:r="/",search:n="",hash:o=""}=m(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),p("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:h(t))},function(e,t){d("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function u(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e)try{throw new Error(t)}catch(e){}}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?m(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function h({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function m(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function y(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,s="POP",c=null,u=d();function d(){return(i.state||{idx:null}).idx}function h(){s="POP";let e=d(),t=null==e?null:e-u;u=e,c&&c({action:s,location:y.location,delta:t})}function m(e){return v(e)}null==u&&(u=0,i.replaceState({...i.state,idx:u},""));let y={get action(){return s},get location(){return e(o,i)},listen(e){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(l,h),c=e,()=>{o.removeEventListener(l,h),c=null}},createHref:e=>t(o,e),createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let n=p(y.location,e,t);r&&r(n,e),u=d()+1;let l=f(n,u),h=y.createHref(n);try{i.pushState(l,"",h)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(h)}a&&c&&c({action:s,location:y.location,delta:1})},replace:function(e,t){s="REPLACE";let n=p(y.location,e,t);r&&r(n,e),u=d();let o=f(n,u),l=y.createHref(n);i.replaceState(o,"",l),a&&c&&c({action:s,location:y.location,delta:0})},go:e=>i.go(e)};return y}function v(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),u(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:h(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}new WeakMap;function g(e,t,r="/"){return b(e,t,r,!1)}function b(e,t,r,n){let o=D(("string"==typeof t?m(t):t).pathname||"/",r);if(null==o)return null;let a=x(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let i=null;for(let e=0;null==i&&e<a.length;++e){let t=A(o);i=C(a[e],t,n)}return i}function x(e,t=[],r=[],n=""){let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(u(i.relativePath.startsWith(n),`Absolute route path "${i.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(n.length));let s=$([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(u(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),x(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:E(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of w(e.path))o(e,t,r);else o(e,t)}),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=w(n.join("/")),s=[];return s.push(...i.map(e=>""===e?a:[a,e].join("/"))),o&&s.push(...i),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var j=/^:[\w-]+$/,_=3,k=2,O=1,S=10,N=-2,P=e=>"*"===e;function E(e,t){let r=e.split("/"),n=r.length;return r.some(P)&&(n+=N),t&&(n+=k),r.filter(e=>!P(e)).reduce((e,t)=>e+(j.test(t)?_:""===t?O:S),n)}function C(e,t,r=!1){let{routesMeta:n}=e,o={},a="/",i=[];for(let e=0;e<n.length;++e){let s=n[e],l=e===n.length-1,c="/"===a?t:t.slice(a.length)||"/",u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},c),d=s.route;if(!u&&l&&r&&!n[n.length-1].route.index&&(u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),i.push({params:o,pathname:$([a,u.pathname]),pathnameBase:V($([a,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(a=$([a,u.pathnameBase]))}return i}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=T(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1),l=n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=s[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const o=s[n];return e[t]=r&&!o?void 0:(o||"").replace(/%2F/g,"/"),e},{});return{params:l,pathname:a,pathnameBase:i,pattern:e}}function T(e,t=!1,r=!0){d("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function A(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function F(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function I(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function M(e){let t=I(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function L(e,t,r,n=!1){let o;"string"==typeof e?o=m(e):(o={...e},u(!o.pathname||!o.pathname.includes("?"),F("?","pathname","search",o)),u(!o.pathname||!o.pathname.includes("#"),F("#","pathname","hash",o)),u(!o.search||!o.search.includes("#"),F("#","search","hash",o)));let a,i=""===e||""===o.pathname,s=i?"/":o.pathname;if(null==s)a=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:r,search:n="",hash:o=""}="string"==typeof e?m(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:z(n),hash:U(o)}}(o,a),c=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!d||(l.pathname+="/"),l}var $=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function q(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var W=["POST","PUT","PATCH","DELETE"],B=(new Set(W),["GET",...W]);new Set(B),Symbol("ResetLoaderData");var H=i.createContext(null);H.displayName="DataRouter";var Z=i.createContext(null);Z.displayName="DataRouterState";var K=i.createContext(!1);var G=i.createContext({isTransitioning:!1});G.displayName="ViewTransition";var Q=i.createContext(new Map);Q.displayName="Fetchers";var Y=i.createContext(null);Y.displayName="Await";var J=i.createContext(null);J.displayName="Navigation";var X=i.createContext(null);X.displayName="Location";var ee=i.createContext({outlet:null,matches:[],isDataRoute:!1});ee.displayName="Route";var te=i.createContext(null);te.displayName="RouteError";function re(){return null!=i.useContext(X)}function ne(){return u(re(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(X).location}var oe="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ae(e){i.useContext(J).static||i.useLayoutEffect(e)}function ie(){let{isDataRoute:e}=i.useContext(ee);return e?function(){let{router:e}=me("useNavigate"),t=ve("useNavigate"),r=i.useRef(!1);ae(()=>{r.current=!0});let n=i.useCallback(async(n,o={})=>{d(r.current,oe),r.current&&("number"==typeof n?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t]);return n}():function(){u(re(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(H),{basename:t,navigator:r}=i.useContext(J),{matches:n}=i.useContext(ee),{pathname:o}=ne(),a=JSON.stringify(M(n)),s=i.useRef(!1);ae(()=>{s.current=!0});let l=i.useCallback((n,i={})=>{if(d(s.current,oe),!s.current)return;if("number"==typeof n)return void r.go(n);let l=L(n,JSON.parse(a),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:$([t,l.pathname])),(i.replace?r.replace:r.push)(l,i.state,i)},[t,r,a,o,e]);return l}()}i.createContext(null);function se(e,{relative:t}={}){let{matches:r}=i.useContext(ee),{pathname:n}=ne(),o=JSON.stringify(M(r));return i.useMemo(()=>L(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}function le(e,t,r,n){u(re(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=i.useContext(J),{matches:a}=i.useContext(ee),s=a[a.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",p=s&&s.route;{let e=p&&p.path||"";xe(c,!p||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let h,y=ne();if(t){let e="string"==typeof t?m(t):t;u("/"===f||e.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${e.pathname}" was given in the \`location\` prop.`),h=e}else h=y;let v=h.pathname||"/",b=v;if("/"!==f){let e=f.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let x=g(e,{pathname:b});d(p||null!=x,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),d(null==x||void 0!==x[x.length-1].route.element||void 0!==x[x.length-1].route.Component||void 0!==x[x.length-1].route.lazy,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=pe(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:$([f,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:$([f,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,r,n);return t&&w?i.createElement(X.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},w):w}function ce(){let e=ge(),t=q(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},s=null;return s=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:a},"ErrorBoundary")," or"," ",i.createElement("code",{style:a},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:o},r):null,s)}var ue=i.createElement(ce,null),de=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(ee.Provider,{value:this.props.routeContext},i.createElement(te.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function fe({routeContext:e,match:t,children:r}){let n=i.useContext(H);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(ee.Provider,{value:e},r)}function pe(e,t=[],r=null,n=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let o=e,a=r?.errors;if(null!=a){let e=o.findIndex(e=>e.route.id&&void 0!==a?.[e.route.id]);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let s=!1,l=-1;if(r)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){s=!0,o=l>=0?o.slice(0,l+1):[o[0]];break}}}return o.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ue,s&&(l<0&&0===c?(xe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):l===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,c+1)),m=()=>{let t;return t=u?f:d?p:n.route.Component?i.createElement(n.route.Component,null):n.route.element?n.route.element:e,i.createElement(fe,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===c)?i.createElement(de,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()},null)}function he(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function me(e){let t=i.useContext(H);return u(t,he(e)),t}function ye(e){let t=i.useContext(Z);return u(t,he(e)),t}function ve(e){let t=function(e){let t=i.useContext(ee);return u(t,he(e)),t}(e),r=t.matches[t.matches.length-1];return u(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ge(){let e=i.useContext(te),t=ye("useRouteError"),r=ve("useRouteError");return void 0!==e?e:t.errors?.[r]}var be={};function xe(e,t,r){t||be[e]||(be[e]=!0,d(!1,r))}var we={};function je(e,t){e||we[t]||(we[t]=!0)}i.memo(function({routes:e,future:t,state:r}){return le(e,void 0,r,t)});function _e({to:e,replace:t,state:r,relative:n}){u(re(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=i.useContext(J);d(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=i.useContext(ee),{pathname:s}=ne(),l=ie(),c=L(e,M(a),s,"path"===n),f=JSON.stringify(c);return i.useEffect(()=>{l(JSON.parse(f),{replace:t,state:r,relative:n})},[l,f,n,t,r]),null}function ke(e){u(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Oe({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:a=!1}){u(!re(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=i.useMemo(()=>({basename:s,navigator:o,static:a,future:{}}),[s,o,a]);"string"==typeof r&&(r=m(r));let{pathname:c="/",search:f="",hash:p="",state:h=null,key:y="default"}=r,v=i.useMemo(()=>{let e=D(c,s);return null==e?null:{location:{pathname:e,search:f,hash:p,state:h,key:y},navigationType:n}},[s,c,f,p,h,y,n]);return d(null!=v,`<Router basename="${s}"> is not able to match the URL "${c}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==v?null:i.createElement(J.Provider,{value:l},i.createElement(X.Provider,{children:t,value:v}))}function Se({children:e,location:t}){return le(Ne(e),t)}i.Component;function Ne(e,t=[]){let r=[];return i.Children.forEach(e,(e,n)=>{if(!i.isValidElement(e))return;let o=[...t,n];if(e.type===i.Fragment)return void r.push.apply(r,Ne(e.props.children,o));u(e.type===ke,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),u(!e.props.index||!e.props.children,"An index route cannot have child routes.");let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ne(e.props.children,o)),r.push(a)}),r}var Pe="get",Ee="application/x-www-form-urlencoded";function Ce(e){return null!=e&&"string"==typeof e.tagName}function Re(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}var Te=null;var Ae=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function De(e){return null==e||Ae.has(e)?e:(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ee}"`),null)}function Fe(e,t){let r,n,o,a,i;if(Ce(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?D(i,t):null,r=e.getAttribute("method")||Pe,o=De(e.getAttribute("enctype"))||Ee,a=new FormData(e)}else if(function(e){return Ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ce(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?D(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Pe,o=De(e.getAttribute("formenctype"))||De(i.getAttribute("enctype"))||Ee,a=new FormData(i,e),!function(){if(null===Te)try{new FormData(document.createElement("form"),0),Te=!1}catch(e){Te=!0}return Te}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,n)}}else{if(Ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Pe,n=null,o=Ee,i=e}var s;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis;function Ie(e){return{__html:e}}function Me(e,t){if(!1===e||null==e)throw new Error(t)}Symbol("SingleFetchRedirect");function Le(e,t,r){let n="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===n.pathname?n.pathname=`_root.${r}`:t&&"/"===D(n.pathname,t)?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function $e(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(e){return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ve(e){return null!=e&&"string"==typeof e.page}function ze(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Ue(e,t,r,n,o,a){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,s=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===a?t.filter((e,t)=>i(e,t)||s(e,t)):"data"===a?t.filter((t,a)=>{let l=n.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function qe(e,t,{includeHydrateFallback:r}={}){return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1),[...new Set(n)];var n}function We(e,t){let r=new Set,n=new Set(t);return e.reduce((e,o)=>{if(t&&!Ve(o)&&"script"===o.as&&o.href&&n.has(o.href))return e;let a=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(o));return r.has(a)||(r.add(a),e.push({key:a,link:o})),e},[])}function Be(e,t){return"lazy"===e.mode&&!0===t}function He(){let e=i.useContext(H);return Me(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ze(){let e=i.useContext(Z);return Me(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ke=i.createContext(void 0);function Ge(){let e=i.useContext(Ke);return Me(e,"You must render this element inside a <HydratedRouter> element"),e}function Qe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ye(e,t,r){if(r&&!tt)return[e[0]];if(t){let r=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,r+1)}return e}Ke.displayName="FrameworkContext";function Je({page:e,...t}){let{router:r}=He(),n=i.useMemo(()=>g(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?i.createElement(et,{page:e,matches:n,...t}):null}function Xe(e){let{manifest:t,routeModules:r}=Ge(),[n,o]=i.useState([]);return i.useEffect(()=>{let n=!1;return async function(e,t,r){return We((await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await $e(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(ze).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),n}function et({page:e,matches:t,...r}){let n=ne(),{manifest:o,routeModules:a}=Ge(),{basename:s}=He(),{loaderData:l,matches:c}=Ze(),u=i.useMemo(()=>Ue(e,t,c,o,n,"data"),[e,t,c,o,n]),d=i.useMemo(()=>Ue(e,t,c,o,n,"assets"),[e,t,c,o,n]),f=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,i=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in l&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:r.add(e.route.id))}),0===r.size)return[];let c=Le(e,s,"data");return i&&r.size>0&&c.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[c.pathname+c.search]},[s,l,n,o,u,t,e,a]),p=i.useMemo(()=>qe(d,o),[d,o]),h=Xe(d);return i.createElement(i.Fragment,null,f.map(e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),p.map(e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),h.map(({key:e,link:t})=>i.createElement("link",{key:e,...t})))}var tt=!1;function rt(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:o,routeDiscovery:a,ssr:s}=Ge(),{router:l,static:c,staticContext:u}=He(),{matches:d}=Ze(),f=i.useContext(K),p=Be(a,s);o&&(o.didRenderScripts=!0);let h=Ye(d,null,n);i.useEffect(()=>{tt=!0},[]);let m=i.useMemo(()=>{if(f)return null;let n=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",o=c?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};\n${h.map((e,r)=>{let n=`route${r}`,o=t.routes[e.route.id];Me(o,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:s,hydrateFallbackModule:l,module:c}=o,u=[...a?[{module:a,varName:`${n}_clientAction`}]:[],...i?[{module:i,varName:`${n}_clientLoader`}]:[],...s?[{module:s,varName:`${n}_clientMiddleware`}]:[],...l?[{module:l,varName:`${n}_HydrateFallback`}]:[],{module:c,varName:`${n}_main`}];return 1===u.length?`import * as ${n} from ${JSON.stringify(c)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${u.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}\n  ${p?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),o=r.state.location.pathname.split("/").filter(Boolean),a=["/"];for(o.pop();o.length>0;)a.push(`/${o.join("/")}`),o.pop();a.forEach(e=>{let t=g(r.routes,e,r.basename);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(t,l),null,2)};`:""}\n  window.__reactRouterRouteModules = {${h.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return i.createElement(i.Fragment,null,i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ie(n),type:void 0}),i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ie(o),type:"module",async:!0}))},[]),y=tt||f?[]:(v=t.entry.imports.concat(qe(h,t,{includeHydrateFallback:!0})),[...new Set(v)]);var v;let b="object"==typeof t.sri?t.sri:{};return je(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),tt||f?null:i.createElement(i.Fragment,null,"object"==typeof t.sri?i.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,p?null:i.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],suppressHydrationWarning:!0}),i.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],suppressHydrationWarning:!0}),y.map(t=>i.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:b[t],suppressHydrationWarning:!0})),m)}function nt(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}i.Component;function ot({error:e,isOutsideRemixApp:t}){let r,n=i.createElement("script",{dangerouslySetInnerHTML:{__html:'\n        console.log(\n          "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n        );\n      '}});if(q(e))return i.createElement(at,{title:"Unhandled Thrown Response!"},i.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);if(e instanceof Error)r=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);r=new Error(t)}return i.createElement(at,{title:"Application Error!",isOutsideRemixApp:t},i.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),i.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function at({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:o}=Ge();return o.root?.Layout&&!r?n:i.createElement("html",{lang:"en"},i.createElement("head",null,i.createElement("meta",{charSet:"utf-8"}),i.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),i.createElement("title",null,e)),i.createElement("body",null,i.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?i.createElement(rt,null):null)))}var it="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{it&&(window.__reactRouterVersion="7.7.0")}catch(vt){}function st({basename:e,children:t,window:r}){let n=i.useRef();null==n.current&&(n.current=c({window:r,v5Compat:!0}));let o=n.current,[a,s]=i.useState({action:o.action,location:o.location}),l=i.useCallback(e=>{i.startTransition(()=>s(e))},[s]);return i.useLayoutEffect(()=>o.listen(l),[o,l]),i.createElement(Oe,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o})}var lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ct=i.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:f,viewTransition:p,...m},y){let v,{basename:g}=i.useContext(J),b="string"==typeof c&&lt.test(c),x=!1;if("string"==typeof c&&b&&(v=c,it))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=D(t.pathname,g);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:x=!0}catch(e){d(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=function(e,{relative:t}={}){u(re(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(J),{hash:o,pathname:a,search:s}=se(e,{relative:t}),l=a;return"/"!==r&&(l="/"===a?r:$([r,a])),n.createHref({pathname:l,search:s,hash:o})}(c,{relative:n}),[j,_,k]=function(e,t){let r=i.useContext(Ke),[n,o]=i.useState(!1),[a,s]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=i.useRef(null);i.useEffect(()=>{if("render"===e&&s(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),i.useEffect(()=>{if(n){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[n]);let h=()=>{o(!0)},m=()=>{o(!1),s(!1)};return r?"intent"!==e?[a,p,{}]:[a,p,{onFocus:Qe(l,h),onBlur:Qe(c,m),onMouseEnter:Qe(u,h),onMouseLeave:Qe(d,m),onTouchStart:Qe(f,h)}]:[!1,p,{}]}(r,m),O=function(e,{target:t,replace:r,state:n,preventScrollReset:o,relative:a,viewTransition:s}={}){let l=ie(),c=ne(),u=se(e,{relative:a});return i.useCallback(i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==r?r:h(c)===h(u);l(e,{replace:t,state:n,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,n,t,e,o,a,s])}(c,{replace:a,state:s,target:l,preventScrollReset:f,relative:n,viewTransition:p});let S=i.createElement("a",{...m,...k,href:v||w,onClick:x||o?e:function(t){e&&e(t),t.defaultPrevented||O(t)},ref:nt(y,_),target:l,"data-discover":b||"render"!==t?void 0:"true"});return j&&!b?i.createElement(i.Fragment,null,S,i.createElement(Je,{page:w})):S});ct.displayName="Link",i.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:o,to:a,viewTransition:s,children:l,...c},d){let f=se(a,{relative:c.relative}),p=ne(),h=i.useContext(Z),{navigator:m,basename:y}=i.useContext(J),v=null!=h&&function(e,t={}){let r=i.useContext(G);u(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=ft("useViewTransitionState"),o=se(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=D(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=D(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=R(o.pathname,s)||null!=R(o.pathname,a)}(f)&&!0===s,g=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=p.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;t||(b=b.toLowerCase(),x=x?x.toLowerCase():null,g=g.toLowerCase()),x&&y&&(x=D(x,y)||x);const w="/"!==g&&g.endsWith("/")?g.length-1:g.length;let j,_=b===g||!n&&b.startsWith(g)&&"/"===b.charAt(w),k=null!=x&&(x===g||!n&&x.startsWith(g)&&"/"===x.charAt(g.length)),O={isActive:_,isPending:k,isTransitioning:v},S=_?e:void 0;j="function"==typeof r?r(O):[r,_?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let N="function"==typeof o?o(O):o;return i.createElement(ct,{...c,"aria-current":S,className:j,ref:d,style:N,to:a,viewTransition:s},"function"==typeof l?l(O):l)}).displayName="NavLink";var ut=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:a,method:s=Pe,action:l,onSubmit:c,relative:d,preventScrollReset:f,viewTransition:p,...m},y)=>{let v=yt(),g=function(e,{relative:t}={}){let{basename:r}=i.useContext(J),n=i.useContext(ee);u(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),a={...se(e||".",{relative:t})},s=ne();if(null==e){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();a.search=r?`?${r}`:""}}e&&"."!==e||!o.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(a.pathname="/"===a.pathname?r:$([r,a.pathname]));return h(a)}(l,{relative:d}),b="get"===s.toLowerCase()?"get":"post",x="string"==typeof l&&lt.test(l);return i.createElement("form",{ref:y,method:b,action:g,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,i=n?.getAttribute("formmethod")||s;v(n||e.currentTarget,{fetcherKey:t,method:i,navigate:r,replace:o,state:a,relative:d,preventScrollReset:f,viewTransition:p})},...m,"data-discover":x||"render"!==e?void 0:"true"})});function dt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ft(e){let t=i.useContext(H);return u(t,dt(e)),t}function pt(e){d("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(Re(e)),r=i.useRef(!1),n=ne(),o=i.useMemo(()=>function(e,t){let r=Re(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),a=ie(),s=i.useCallback((e,t)=>{const n=Re("function"==typeof e?e(new URLSearchParams(o)):e);r.current=!0,a("?"+n,t)},[a,o]);return[o,s]}ut.displayName="Form";var ht=0,mt=()=>`__${String(++ht)}__`;function yt(){let{router:e}=ft("useSubmit"),{basename:t}=i.useContext(J),r=ve("useRouteId");return i.useCallback(async(n,o={})=>{let{action:a,method:i,encType:s,formData:l,body:c}=Fe(n,t);if(!1===o.navigate){let t=o.fetcherKey||mt();await e.fetch(t,r,o.action||a,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||i,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||i,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,r])}let vt={data:""},gt=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||vt,bt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,xt=/\/\*[^]*?\*\/|  +/g,wt=/\n+/g,jt=(e,t)=>{let r="",n="",o="";for(let a in e){let i=e[a];"@"==a[0]?"i"==a[1]?r=a+" "+i+";":n+="f"==a[1]?jt(i,a):a+"{"+jt(i,"k"==a[1]?"":t)+"}":"object"==typeof i?n+=jt(i,t?t.replace(/([^,])+/g,e=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):a):null!=i&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=jt.p?jt.p(a,i):a+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},_t={},kt=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+kt(e[r]);return t}return e},Ot=(e,t,r,n,o)=>{let a=kt(e),i=_t[a]||(_t[a]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(a));if(!_t[i]){let t=a!==e?e:(e=>{let t,r,n=[{}];for(;t=bt.exec(e.replace(xt,""));)t[4]?n.shift():t[3]?(r=t[3].replace(wt," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(wt," ").trim();return n[0]})(e);_t[i]=jt(o?{["@keyframes "+i]:t}:t,r?"":"."+i)}let s=r&&_t.g?_t.g:null;return r&&(_t.g=_t[i]),((e,t,r,n)=>{n?t.data=t.data.replace(n,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(_t[i],t,n,s),i};function St(e){let t=this||{},r=e.call?e(t.p):e;return Ot(r.unshift?r.raw?((e,t,r)=>e.reduce((e,n,o)=>{let a=t[o];if(a&&a.call){let e=a(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?"."+t:e&&"object"==typeof e?e.props?"":jt(e,""):!1===e?"":e}return e+n+(null==a?"":a)},""))(r,[].slice.call(arguments,1),t.p):r.reduce((e,r)=>Object.assign(e,r&&r.call?r(t.p):r),{}):r,gt(t.target),t.g,t.o,t.k)}St.bind({g:1});let Nt,Pt,Et,Ct=St.bind({k:1});function Rt(e,t){let r=this||{};return function(){let n=arguments;function o(a,i){let s=Object.assign({},a),l=s.className||o.className;r.p=Object.assign({theme:Pt&&Pt()},s),r.o=/ *go\d+/.test(l),s.className=St.apply(r,n)+(l?" "+l:""),t&&(s.ref=i);let c=e;return e[0]&&(c=s.as||e,delete s.as),Et&&c[0]&&Et(s),Nt(c,s)}return t?t(o):o}}var Tt=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,At=(()=>{let e=0;return()=>(++e).toString()})(),Dt=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Ft=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return Ft(e,{type:e.toasts.find(e=>e.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,dismissed:!0,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+o}))}}},It=[],Mt={toasts:[],pausedAt:void 0},Lt=e=>{Mt=Ft(Mt,e),It.forEach(e=>{e(Mt)})},$t={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Vt=e=>(t,r)=>{let n=((e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||At()}))(t,e,r);return Lt({type:2,toast:n}),n.id},zt=(e,t)=>Vt("blank")(e,t);zt.error=Vt("error"),zt.success=Vt("success"),zt.loading=Vt("loading"),zt.custom=Vt("custom"),zt.dismiss=e=>{Lt({type:3,toastId:e})},zt.remove=e=>Lt({type:4,toastId:e}),zt.promise=(e,t,r)=>{let n=zt.loading(t.loading,{...r,...null==r?void 0:r.loading});return"function"==typeof e&&(e=e()),e.then(e=>{let o=t.success?Tt(t.success,e):void 0;return o?zt.success(o,{id:n,...r,...null==r?void 0:r.success}):zt.dismiss(n),e}).catch(e=>{let o=t.error?Tt(t.error,e):void 0;o?zt.error(o,{id:n,...r,...null==r?void 0:r.error}):zt.dismiss(n)}),e};var Ut=(e,t)=>{Lt({type:1,toast:{id:e,height:t}})},qt=()=>{Lt({type:5,time:Date.now()})},Wt=new Map,Bt=e=>{let{toasts:t,pausedAt:r}=((e={})=>{let[t,r]=(0,i.useState)(Mt),n=(0,i.useRef)(Mt);(0,i.useEffect)(()=>(n.current!==Mt&&r(Mt),It.push(r),()=>{let e=It.indexOf(r);e>-1&&It.splice(e,1)}),[]);let o=t.toasts.map(t=>{var r,n,o;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(r=e[t.type])?void 0:r.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||$t[t.type],style:{...e.style,...null==(o=e[t.type])?void 0:o.style,...t.style}}});return{...t,toasts:o}})(e);(0,i.useEffect)(()=>{if(r)return;let e=Date.now(),n=t.map(t=>{if(t.duration===1/0)return;let r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(r<0))return setTimeout(()=>zt.dismiss(t.id),r);t.visible&&zt.dismiss(t.id)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[t,r]);let n=(0,i.useCallback)(()=>{r&&Lt({type:6,time:Date.now()})},[r]),o=(0,i.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:o=8,defaultPosition:a}=r||{},i=t.filter(t=>(t.position||a)===(e.position||a)&&t.height),s=i.findIndex(t=>t.id===e.id),l=i.filter((e,t)=>t<s&&e.visible).length;return i.filter(e=>e.visible).slice(...n?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+o,0)},[t]);return(0,i.useEffect)(()=>{t.forEach(e=>{if(e.dismissed)((e,t=1e3)=>{if(Wt.has(e))return;let r=setTimeout(()=>{Wt.delete(e),Lt({type:4,toastId:e})},t);Wt.set(e,r)})(e.id,e.removeDelay);else{let t=Wt.get(e.id);t&&(clearTimeout(t),Wt.delete(e.id))}})},[t]),{toasts:t,handlers:{updateHeight:Ut,startPause:qt,endPause:n,calculateOffset:o}}},Ht=Ct`
    22from {
    33  transform: scale(0) rotate(45deg);
     
    77 transform: scale(1) rotate(45deg);
    88  opacity: 1;
    9 }`,Ht=Ct`
     9}`,Zt=Ct`
    1010from {
    1111  transform: scale(0);
     
    2323  transform: scale(1) rotate(90deg);
    2424    opacity: 1;
    25 }`,Qt=Rt("div")`
     25}`,Gt=Rt("div")`
    2626  width: 20px;
    2727  opacity: 0;
     
    3232  transform: rotate(45deg);
    3333
    34   animation: ${Bt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     34  animation: ${Ht} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    3535    forwards;
    3636  animation-delay: 100ms;
     
    3939  &:before {
    4040    content: '';
    41     animation: ${Ht} 0.15s ease-out forwards;
     41    animation: ${Zt} 0.15s ease-out forwards;
    4242    animation-delay: 150ms;
    4343    position: absolute;
     
    5656    transform: rotate(90deg);
    5757  }
    58 `,Gt=Ct`
     58`,Qt=Ct`
    5959  from {
    6060    transform: rotate(0deg);
     
    6363    transform: rotate(360deg);
    6464  }
    65 `,Jt=Rt("div")`
     65`,Yt=Rt("div")`
    6666  width: 12px;
    6767  height: 12px;
     
    7171  border-color: ${e=>e.secondary||"#e0e0e0"};
    7272  border-right-color: ${e=>e.primary||"#616161"};
    73   animation: ${Gt} 1s linear infinite;
    74 `,Yt=Ct`
     73  animation: ${Qt} 1s linear infinite;
     74`,Jt=Ct`
    7575from {
    7676  transform: scale(0) rotate(45deg);
     
    103103  transform: rotate(45deg);
    104104
    105   animation: ${Yt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     105  animation: ${Jt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    106106    forwards;
    107107  animation-delay: 100ms;
     
    138138  transform: scale(1);
    139139  opacity: 1;
    140 }`,ar=Rt("div")`
     140}`,or=Rt("div")`
    141141  position: relative;
    142142  transform: scale(0.6);
     
    145145  animation: ${nr} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    146146    forwards;
    147 `,or=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return void 0!==t?"string"==typeof t?i.createElement(ar,null,t):t:"blank"===r?null:i.createElement(rr,null,i.createElement(Jt,{...n}),"loading"!==r&&i.createElement(tr,null,"error"===r?i.createElement(Qt,{...n}):i.createElement(er,{...n})))},ir=e=>`\n0% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n`,sr=e=>`\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;}\n`,lr=Rt("div")`
     147`,ar=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return void 0!==t?"string"==typeof t?i.createElement(or,null,t):t:"blank"===r?null:i.createElement(rr,null,i.createElement(Yt,{...n}),"loading"!==r&&i.createElement(tr,null,"error"===r?i.createElement(Gt,{...n}):i.createElement(er,{...n})))},ir=e=>`\n0% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n`,sr=e=>`\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;}\n`,lr=Rt("div")`
    148148  display: flex;
    149149  align-items: center;
     
    164164  flex: 1 1 auto;
    165165  white-space: pre-line;
    166 `,ur=i.memo(({toast:e,position:t,style:r,children:n})=>{let a=e.height?((e,t)=>{let r=e.includes("top")?1:-1,[n,a]=Dt()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[ir(r),sr(r)];return{animation:t?`${Ct(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ct(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},o=i.createElement(or,{toast:e}),s=i.createElement(cr,{...e.ariaProps},At(e.message,e));return i.createElement(lr,{className:e.className,style:{...a,...r,...e.style}},"function"==typeof n?n({icon:o,message:s}):i.createElement(i.Fragment,null,o,s))});!function(e,t,r,n){jt.p=t,Nt=e,Et=r,Pt=n}(i.createElement);var dr=({id:e,className:t,style:r,onHeightUpdate:n,children:a})=>{let o=i.useCallback(t=>{if(t){let r=()=>{let r=t.getBoundingClientRect().height;n(e,r)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return i.createElement("div",{ref:o,className:t,style:r},a)},fr=St`
     166`,ur=i.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?((e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Dt()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[ir(r),sr(r)];return{animation:t?`${Ct(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ct(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}})(e.position||t||"top-center",e.visible):{opacity:0},a=i.createElement(ar,{toast:e}),s=i.createElement(cr,{...e.ariaProps},Tt(e.message,e));return i.createElement(lr,{className:e.className,style:{...o,...r,...e.style}},"function"==typeof n?n({icon:a,message:s}):i.createElement(i.Fragment,null,a,s))});!function(e,t,r,n){jt.p=t,Nt=e,Pt=r,Et=n}(i.createElement);var dr=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let a=i.useCallback(t=>{if(t){let r=()=>{let r=t.getBoundingClientRect().height;n(e,r)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return i.createElement("div",{ref:a,className:t,style:r},o)},fr=St`
    167167  z-index: 9999;
    168168  > * {
    169169    pointer-events: auto;
    170170  }
    171 `,hr=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:a,containerStyle:o,containerClassName:s})=>{let{toasts:l,handlers:c}=Zt(r);return i.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(r=>{let o=r.position||t,s=((e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Dt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...a}})(o,c.calculateOffset(r,{reverseOrder:e,gutter:n,defaultPosition:t}));return i.createElement(dr,{id:r.id,key:r.id,onHeightUpdate:c.updateHeight,className:r.visible?fr:"",style:s},"custom"===r.type?At(r.message,r):a?a(r):i.createElement(ur,{toast:r,position:o}))}))},pr=zt,mr="undefined"==typeof window||"Deno"in globalThis;function yr(){}function vr(e){return"number"==typeof e&&e>=0&&e!==1/0}function gr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function br(e,t){return"function"==typeof e?e(t):e}function xr(e,t){return"function"==typeof e?e(t):e}function wr(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:o,queryKey:i,stale:s}=e;if(i)if(n){if(t.queryHash!==_r(i,t.options))return!1}else if(!Or(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&((!a||a===t.state.fetchStatus)&&!(o&&!o(t)))}function jr(e,t){const{exact:r,status:n,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(kr(t.options.mutationKey)!==kr(o))return!1}else if(!Or(t.options.mutationKey,o))return!1}return(!n||t.state.status===n)&&!(a&&!a(t))}function _r(e,t){return(t?.queryKeyHashFn||kr)(e)}function kr(e){return JSON.stringify(e,(e,t)=>Pr(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function Or(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>Or(e[r],t[r])))}function Sr(e,t){if(e===t)return e;const r=Er(e)&&Er(t);if(r||Pr(e)&&Pr(t)){const n=r?e:Object.keys(e),a=n.length,o=r?t:Object.keys(t),i=o.length,s=r?[]:{},l=new Set(n);let c=0;for(let n=0;n<i;n++){const a=r?n:o[n];(!r&&l.has(a)||r)&&void 0===e[a]&&void 0===t[a]?(s[a]=void 0,c++):(s[a]=Sr(e[a],t[a]),s[a]===e[a]&&void 0!==e[a]&&c++)}return a===i&&c===a?e:s}return t}function Nr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Er(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pr(e){if(!Cr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Cr(r)&&(!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function Cr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rr(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?Sr(e,t):t}function Ar(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Tr(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dr=Symbol();function Fr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Dr?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function Ir(e,t){return"function"==typeof e?e(...t):!!e}var Mr=e=>setTimeout(e,0);var Lr=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},a=Mr;const o=n=>{t?e.push(n):a(()=>{r(n)})};return{batch:o=>{let i;t++;try{i=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&a(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{a=e}}}(),$r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vr=new class extends $r{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!mr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},zr=new class extends $r{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!mr&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function Ur(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function qr(e){return Math.min(1e3*2**e,3e4)}function Wr(e){return"online"!==(e??"online")||zr.isOnline()}var Zr=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Br(e){return e instanceof Zr}function Hr(e){let t,r=!1,n=0,a=!1;const o=Ur(),i=()=>Vr.isFocused()&&("always"===e.networkMode||zr.isOnline())&&e.canRun(),s=()=>Wr(e.networkMode)&&e.canRun(),l=r=>{a||(a=!0,e.onSuccess?.(r),t?.(),o.resolve(r))},c=r=>{a||(a=!0,e.onError?.(r),t?.(),o.reject(r))},u=()=>new Promise(r=>{t=e=>{(a||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,a||e.onContinue?.()}),d=()=>{if(a)return;let t;const o=0===n?e.initialPromise:void 0;try{t=o??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(l).catch(t=>{if(a)return;const o=e.retry??(mr?0:3),s=e.retryDelay??qr,l="function"==typeof s?s(n,t):s,f=!0===o||"number"==typeof o&&n<o||"function"==typeof o&&o(n,t);var h;!r&&f?(n++,e.onFail?.(n,t),(h=l,new Promise(e=>{setTimeout(e,h)})).then(()=>i()?void 0:u()).then(()=>{r?c(t):d()})):c(t)})};return{promise:o,cancel:t=>{a||(c(new Zr(t)),e.abort?.())},continue:()=>(t?.(),o),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:s,start:()=>(s()?d():u().then(d),o)}}var Kr=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vr(this.gcTime)&&(this.#a=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mr?1/0:3e5))}clearGcTimeout(){this.#a&&(clearTimeout(this.#a),this.#a=void 0)}},Qr=class extends Kr{#o;#i;#s;#l;#c;#u;#d;constructor(e){super(),this.#d=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.client,this.#s=this.#l.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#c?.promise}setOptions(e){this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#s.remove(this)}setData(e,t){const r=Rr(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#c?.promise;return this.#c?.cancel(e),t?t.then(yr).catch(yr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==xr(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===br(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!gr(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#c?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#c?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#c&&(this.#d?this.#c.cancel({revert:!0}):this.#c.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#c)return this.#c.continueRetry(),this.#c.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,r.signal)})},a=()=>{const e=Fr(this.options,t),r=(()=>{const e={client:this.#l,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#d=!1,this.options.persister?this.options.persister(e,r,this):e(r)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:a};return n(e),e})();this.options.behavior?.onFetch(o,this),this.#i=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#f({type:"fetch",meta:o.fetchOptions?.meta});const i=e=>{Br(e)&&e.silent||this.#f({type:"error",error:e}),Br(e)||(this.#s.config.onError?.(e,this),this.#s.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#c=Hr({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0!==e){try{this.setData(e)}catch(e){return void i(e)}this.#s.config.onSuccess?.(e,this),this.#s.config.onSettled?.(e,this.state.error,this),this.scheduleGc()}else i(new Error(`${this.queryHash} data is undefined`))},onError:i,onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#c.start()}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Gr(t.data,this.options),fetchMeta:e.meta??null};case"success":return this.#i=void 0,{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Br(r)&&r.revert&&this.#i?{...this.#i,fetchStatus:"idle"}:{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Lr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Gr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wr(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var Jr=class extends $r{constructor(e={}){super(),this.config=e,this.#h=new Map}#h;build(e,t,r){const n=t.queryKey,a=t.queryHash??_r(n,t);let o=this.get(a);return o||(o=new Qr({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){this.#h.has(e.queryHash)||(this.#h.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#h.get(e.queryHash);t&&(e.destroy(),t===e&&this.#h.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Lr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#h.get(e)}getAll(){return[...this.#h.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>wr(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>wr(e,t)):t}notify(e){Lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Yr=class extends Kr{#p;#m;#c;constructor(e){super(),this.mutationId=e.mutationId,this.#m=e.mutationCache,this.#p=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#p.includes(e)||(this.#p.push(e),this.clearGcTimeout(),this.#m.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#p=this.#p.filter(t=>t!==e),this.scheduleGc(),this.#m.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#p.length||("pending"===this.state.status?this.scheduleGc():this.#m.remove(this))}continue(){return this.#c?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})};this.#c=Hr({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#m.canRun(this)});const r="pending"===this.state.status,n=!this.#c.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:n}),await(this.#m.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:n})}const a=await this.#c.start();return await(this.#m.config.onSuccess?.(a,e,this.state.context,this)),await(this.options.onSuccess?.(a,e,this.state.context)),await(this.#m.config.onSettled?.(a,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(a,null,e,this.state.context)),this.#f({type:"success",data:a}),a}catch(t){try{throw await(this.#m.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#m.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#f({type:"error",error:t})}}finally{this.#m.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),Lr.batch(()=>{this.#p.forEach(t=>{t.onMutationUpdate(e)}),this.#m.notify({mutation:this,type:"updated",action:e})})}};var Xr=class extends $r{constructor(e={}){super(),this.config=e,this.#y=new Set,this.#v=new Map,this.#g=0}#y;#v;#g;build(e,t,r){const n=new Yr({mutationCache:this,mutationId:++this.#g,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#y.add(e);const t=en(e);if("string"==typeof t){const r=this.#v.get(t);r?r.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#y.delete(e)){const t=en(e);if("string"==typeof t){const r=this.#v.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=en(e);if("string"==typeof t){const r=this.#v.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=en(e);if("string"==typeof t){const r=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Lr.batch(()=>{this.#y.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#y.clear(),this.#v.clear()})}getAll(){return Array.from(this.#y)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>jr(t,e))}findAll(e={}){return this.getAll().filter(t=>jr(e,t))}notify(e){Lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Lr.batch(()=>Promise.all(e.map(e=>e.continue().catch(yr))))}};function en(e){return e.options.scope?.id}function tn(e){return{onFetch:(t,r)=>{const n=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let r=!1;const c=Fr(t.options,t.fetchOptions),u=async(e,n,a)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const o=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:a?"backward":"forward",meta:t.options.meta};var o;return o=e,Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),e})(),i=await c(o),{maxPages:s}=t.options,l=a?Tr:Ar;return{pages:l(e.pages,i,s),pageParams:l(e.pageParams,n,s)}};if(a&&o.length){const e="backward"===a,t={pages:o,pageParams:i},r=(e?nn:rn)(n,t);s=await u(t,r,e)}else{const t=e??o.length;do{const e=0===l?i[0]??n.initialPageParam:rn(n,s);if(l>0&&null==e)break;s=await u(s,e),l++}while(l<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function rn(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function nn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var an=a(848),on=i.createContext(void 0),sn=e=>{const t=i.useContext(on);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ln=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,an.jsx)(on.Provider,{value:e,children:t}));function cn(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=cn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function un(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=cn(e))&&(n&&(n+=" "),n+=t);return n}const dn=e=>{const t=mn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),fn(r,t)||pn(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},fn=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?fn(e.slice(1),n):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},hn=/^\[(.+)\]$/,pn=e=>{if(hn.test(e)){const t=hn.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},mn=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)yn(r[e],n,e,t);return n},yn=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:vn(t,e)).classGroupId=r)}if("function"==typeof e)return gn(e)?void yn(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{yn(a,vn(t,e),r,n)})})},vn=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},gn=e=>e.isThemeGetter,bn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}},xn=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===n&&0===a){if(":"===s){t.push(e.slice(o,i)),o=i+1;continue}if("/"===s){r=i;continue}}"["===s?n++:"]"===s?n--:"("===s?a++:")"===s&&a--}const i=0===t.length?e:e.substring(o),s=wn(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:r&&r>o?r-o:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},wn=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,jn=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},_n=/\s+/;function kn(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=On(e))&&(n&&(n+=" "),n+=t);return n}const On=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=On(e[n]))&&(r&&(r+=" "),r+=t);return r};function Sn(e,...t){let r,n,a,o=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:bn(e.cacheSize),parseClassName:xn(e),sortModifiers:jn(e),...dn(e)}))(l),n=r.cache.get,a=r.cache.set,o=i,i(s)};function i(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,i=[],s=e.trim().split(_n);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!h,m=n(p?f.substring(0,h):f);if(!m){if(!p){l=t+(l.length>0?" "+l:l);continue}if(m=n(f),!m){l=t+(l.length>0?" "+l:l);continue}p=!1}const y=o(u).join(":"),v=d?y+"!":y,g=v+m;if(i.includes(g))continue;i.push(g);const b=a(m,p);for(let e=0;e<b.length;++e){const t=b[e];i.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(kn.apply(null,arguments))}}const Nn=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},En=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cn=/^\d+\/\d+$/,Rn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,An=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Dn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,In=e=>Cn.test(e),Mn=e=>!!e&&!Number.isNaN(Number(e)),Ln=e=>!!e&&Number.isInteger(Number(e)),$n=e=>e.endsWith("%")&&Mn(e.slice(0,-1)),Vn=e=>Rn.test(e),zn=()=>!0,Un=e=>An.test(e)&&!Tn.test(e),qn=()=>!1,Wn=e=>Dn.test(e),Zn=e=>Fn.test(e),Bn=e=>!Kn(e)&&!ea(e),Hn=e=>sa(e,da,qn),Kn=e=>En.test(e),Qn=e=>sa(e,fa,Un),Gn=e=>sa(e,ha,Mn),Jn=e=>sa(e,ca,qn),Yn=e=>sa(e,ua,Zn),Xn=e=>sa(e,ma,Wn),ea=e=>Pn.test(e),ta=e=>la(e,fa),ra=e=>la(e,pa),na=e=>la(e,ca),aa=e=>la(e,da),oa=e=>la(e,ua),ia=e=>la(e,ma,!0),sa=(e,t,r)=>{const n=En.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},la=(e,t,r=!1)=>{const n=Pn.exec(e);return!!n&&(n[1]?t(n[1]):r)},ca=e=>"position"===e||"percentage"===e,ua=e=>"image"===e||"url"===e,da=e=>"length"===e||"size"===e||"bg-size"===e,fa=e=>"length"===e,ha=e=>"number"===e,pa=e=>"family-name"===e,ma=e=>"shadow"===e,ya=(Symbol.toStringTag,()=>{const e=Nn("color"),t=Nn("font"),r=Nn("text"),n=Nn("font-weight"),a=Nn("tracking"),o=Nn("leading"),i=Nn("breakpoint"),s=Nn("container"),l=Nn("spacing"),c=Nn("radius"),u=Nn("shadow"),d=Nn("inset-shadow"),f=Nn("text-shadow"),h=Nn("drop-shadow"),p=Nn("blur"),m=Nn("perspective"),y=Nn("aspect"),v=Nn("ease"),g=Nn("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ea,Kn],x=()=>[ea,Kn,l],w=()=>[In,"full","auto",...x()],j=()=>[Ln,"none","subgrid",ea,Kn],_=()=>["auto",{span:["full",Ln,ea,Kn]},Ln,ea,Kn],k=()=>[Ln,"auto",ea,Kn],O=()=>["auto","min","max","fr",ea,Kn],S=()=>["auto",...x()],N=()=>[In,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],E=()=>[e,ea,Kn],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",na,Jn,{position:[ea,Kn]}],C=()=>["auto","cover","contain",aa,Hn,{size:[ea,Kn]}],R=()=>[$n,ta,Qn],A=()=>["","none","full",c,ea,Kn],T=()=>["",Mn,ta,Qn],D=()=>[Mn,$n,na,Jn],F=()=>["","none",p,ea,Kn],I=()=>["none",Mn,ea,Kn],M=()=>["none",Mn,ea,Kn],L=()=>[Mn,ea,Kn],$=()=>[In,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vn],breakpoint:[Vn],color:[zn],container:[Vn],"drop-shadow":[Vn],ease:["in","out","in-out"],font:[Bn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vn],shadow:[Vn],spacing:["px",Mn],text:[Vn],"text-shadow":[Vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",In,Kn,ea,y]}],container:["container"],columns:[{columns:[Mn,Kn,ea,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Ln,"auto",ea,Kn]}],basis:[{basis:[In,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Mn,In,"auto","initial","none",Kn]}],grow:[{grow:["",Mn,ea,Kn]}],shrink:[{shrink:["",Mn,ea,Kn]}],order:[{order:[Ln,"first","last","none",ea,Kn]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",r,ta,Qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ea,Gn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$n,Kn]}],"font-family":[{font:[ra,Kn,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ea,Kn]}],"line-clamp":[{"line-clamp":[Mn,"none",ea,Gn]}],leading:[{leading:[o,...x()]}],"list-image":[{"list-image":["none",ea,Kn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ea,Kn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Mn,"from-font","auto",ea,Qn]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Mn,"auto",ea,Kn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ea,Kn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ea,Kn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ln,ea,Kn],radial:["",ea,Kn],conic:[Ln,ea,Kn]},oa,Yn]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":T()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Mn,ea,Kn]}],"outline-w":[{outline:["",Mn,ta,Qn]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,ia,Xn]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,ia,Xn]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Mn,Qn]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",f,ia,Xn]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Mn,ea,Kn]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Mn]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[ea,Kn]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Mn]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ea,Kn]}],filter:[{filter:["","none",ea,Kn]}],blur:[{blur:F()}],brightness:[{brightness:[Mn,ea,Kn]}],contrast:[{contrast:[Mn,ea,Kn]}],"drop-shadow":[{"drop-shadow":["","none",h,ia,Xn]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Mn,ea,Kn]}],"hue-rotate":[{"hue-rotate":[Mn,ea,Kn]}],invert:[{invert:["",Mn,ea,Kn]}],saturate:[{saturate:[Mn,ea,Kn]}],sepia:[{sepia:["",Mn,ea,Kn]}],"backdrop-filter":[{"backdrop-filter":["","none",ea,Kn]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[Mn,ea,Kn]}],"backdrop-contrast":[{"backdrop-contrast":[Mn,ea,Kn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Mn,ea,Kn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Mn,ea,Kn]}],"backdrop-invert":[{"backdrop-invert":["",Mn,ea,Kn]}],"backdrop-opacity":[{"backdrop-opacity":[Mn,ea,Kn]}],"backdrop-saturate":[{"backdrop-saturate":[Mn,ea,Kn]}],"backdrop-sepia":[{"backdrop-sepia":["",Mn,ea,Kn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ea,Kn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Mn,"initial",ea,Kn]}],ease:[{ease:["linear","initial",v,ea,Kn]}],delay:[{delay:[Mn,ea,Kn]}],animate:[{animate:["none",g,ea,Kn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ea,Kn]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:I()}],"rotate-x":[{"rotate-x":I()}],"rotate-y":[{"rotate-y":I()}],"rotate-z":[{"rotate-z":I()}],scale:[{scale:M()}],"scale-x":[{"scale-x":M()}],"scale-y":[{"scale-y":M()}],"scale-z":[{"scale-z":M()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[ea,Kn,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ea,Kn]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ea,Kn]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Mn,ta,Qn,Gn]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),va=Sn(ya);function ga(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return va(un(t))}function ba(e){return ba="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},ba(e)}var xa=["className"],wa=["className"],ja=["className"],_a=["className"],ka=["className"],Oa=["className"];function Sa(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 Na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sa(Object(r),!0).forEach(function(t){Ea(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ea(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=ba(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ba(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pa(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var Ca=i.forwardRef(function(e,t){var r=e.className,n=Pa(e,xa);return(0,an.jsx)("div",Na({ref:t,className:ga("rounded-xl border bg-card text-card-foreground shadow",r)},n))});Ca.displayName="Card";var Ra=i.forwardRef(function(e,t){var r=e.className,n=Pa(e,wa);return(0,an.jsx)("div",Na({ref:t,className:ga("flex flex-col space-y-1.5 p-6",r)},n))});Ra.displayName="CardHeader";var Aa=i.forwardRef(function(e,t){var r=e.className,n=Pa(e,ja);return(0,an.jsx)("div",Na({ref:t,className:ga("font-semibold leading-none tracking-tight",r)},n))});Aa.displayName="CardTitle",i.forwardRef(function(e,t){var r=e.className,n=Pa(e,_a);return(0,an.jsx)("div",Na({ref:t,className:ga("text-sm text-muted-foreground",r)},n))}).displayName="CardDescription";var Ta=i.forwardRef(function(e,t){var r=e.className,n=Pa(e,ka);return(0,an.jsx)("div",Na({ref:t,className:ga("p-6 pt-0",r)},n))});function Da(e){return Da="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},Da(e)}function Fa(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 Ia(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Da(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Da(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Ta.displayName="CardContent",i.forwardRef(function(e,t){var r=e.className,n=Pa(e,Oa);return(0,an.jsx)("div",Na({ref:t,className:ga("flex items-center p-6 pt-0",r)},n))}).displayName="CardFooter";var Ma=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(t){Ia(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},window._versatileObject);const La=Ma;var $a=class extends $r{constructor(e,t){super(),this.options=t,this.#l=e,this.#b=null,this.#x=Ur(),this.options.experimental_prefetchInRender||this.#x.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#l;#w=void 0;#j=void 0;#_=void 0;#k;#O;#x;#b;#S;#N;#E;#P;#C;#R;#A=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),Va(this.#w,this.options)?this.#T():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return za(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return za(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#I(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#l.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof xr(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#w.setOptions(this.options),t._defaulted&&!Nr(this.options,t)&&this.#l.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const n=this.hasListeners();n&&Ua(this.#w,r,this.options,t)&&this.#T(),this.updateResult(),!n||this.#w===r&&xr(this.options.enabled,this.#w)===xr(t.enabled,this.#w)&&br(this.options.staleTime,this.#w)===br(t.staleTime,this.#w)||this.#L();const a=this.#$();!n||this.#w===r&&xr(this.options.enabled,this.#w)===xr(t.enabled,this.#w)&&a===this.#R||this.#V(a)}getOptimisticResult(e){const t=this.#l.getQueryCache().build(this.#l,e),r=this.createResult(t,e);return function(e,t){if(!Nr(e.getCurrentResult(),t))return!0;return!1}(this,r)&&(this.#_=r,this.#O=this.options,this.#k=this.#w.state),r}getCurrentResult(){return this.#_}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),Reflect.get(e,r))})}trackProp(e){this.#A.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#l.defaultQueryOptions(e),r=this.#l.getQueryCache().build(this.#l,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#T({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#_))}#T(e){this.#M();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(yr)),t}#L(){this.#F();const e=br(this.options.staleTime,this.#w);if(mr||this.#_.isStale||!vr(e))return;const t=gr(this.#_.dataUpdatedAt,e)+1;this.#P=setTimeout(()=>{this.#_.isStale||this.updateResult()},t)}#$(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#V(e){this.#I(),this.#R=e,!mr&&!1!==xr(this.options.enabled,this.#w)&&vr(this.#R)&&0!==this.#R&&(this.#C=setInterval(()=>{(this.options.refetchIntervalInBackground||Vr.isFocused())&&this.#T()},this.#R))}#D(){this.#L(),this.#V(this.#$())}#F(){this.#P&&(clearTimeout(this.#P),this.#P=void 0)}#I(){this.#C&&(clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#w,n=this.options,a=this.#_,o=this.#k,i=this.#O,s=e!==r?e.state:this.#j,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const a=this.hasListeners(),o=!a&&Va(e,t),i=a&&Ua(e,r,t,n);(o||i)&&(u={...u,...Gr(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:p}=u;c=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===p){let e;a?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=a.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#E?.state.data,this.#E):t.placeholderData,void 0!==e&&(p="success",c=Rr(a?.data,e,t),d=!0)}if(t.select&&void 0!==c&&!m)if(a&&c===o?.data&&t.select===this.#S)c=this.#N;else try{this.#S=t.select,c=t.select(c),c=Rr(a?.data,c,t),this.#N=c,this.#b=null}catch(e){this.#b=e}this.#b&&(f=this.#b,c=this.#N,h=Date.now(),p="error");const y="fetching"===u.fetchStatus,v="pending"===p,g="error"===p,b=v&&y,x=void 0!==c,w={status:p,fetchStatus:u.fetchStatus,isPending:v,isSuccess:"success"===p,isError:g,isInitialLoading:b,isLoading:b,data:c,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>s.dataUpdateCount||u.errorUpdateCount>s.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:g&&!x,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:g&&x,isStale:qa(e,t),refetch:this.refetch,promise:this.#x,isEnabled:!1!==xr(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===w.status?e.reject(w.error):void 0!==w.data&&e.resolve(w.data)},n=()=>{const e=this.#x=w.promise=Ur();t(e)},a=this.#x;switch(a.status){case"pending":e.queryHash===r.queryHash&&t(a);break;case"fulfilled":"error"!==w.status&&w.data===a.value||n();break;case"rejected":"error"===w.status&&w.error===a.reason||n()}}return w}updateResult(){const e=this.#_,t=this.createResult(this.#w,this.options);if(this.#k=this.#w.state,this.#O=this.options,void 0!==this.#k.data&&(this.#E=this.#w),Nr(t,e))return;this.#_=t;this.#z({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#A.size)return!0;const n=new Set(r??this.#A);return this.options.throwOnError&&n.add("error"),Object.keys(this.#_).some(t=>{const r=t;return this.#_[r]!==e[r]&&n.has(r)})})()})}#M(){const e=this.#l.getQueryCache().build(this.#l,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#j=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#z(e){Lr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#_)}),this.#l.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function Va(e,t){return function(e,t){return!1!==xr(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&za(e,t,t.refetchOnMount)}function za(e,t,r){if(!1!==xr(t.enabled,e)&&"static"!==br(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&qa(e,t)}return!1}function Ua(e,t,r,n){return(e!==t||!1===xr(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&qa(e,r)}function qa(e,t){return!1!==xr(t.enabled,e)&&e.isStaleByTime(br(t.staleTime,e))}function Wa(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Za=i.createContext(Wa()),Ba=i.createContext(!1),Ha=(Ba.Provider,(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()}));function Ka(e,t,r){const n=i.useContext(Ba),a=i.useContext(Za),o=sn(r),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=n?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}})(s),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(s,a),(e=>{i.useEffect(()=>{e.clearReset()},[e])})(a);const l=!o.getQueryCache().get(s.queryHash),[c]=i.useState(()=>new t(o,s)),u=c.getOptimisticResult(s),d=!n&&!1!==e.subscribed;if(i.useSyncExternalStore(i.useCallback(e=>{const t=d?c.subscribe(Lr.batchCalls(e)):yr;return c.updateResult(),t},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),i.useEffect(()=>{c.setOptions(s)},[s,c]),((e,t)=>e?.suspense&&t.isPending)(s,u))throw Ha(s,c,a);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&void 0===e.data||Ir(r,[e.error,n])))({result:u,errorResetBoundary:a,throwOnError:s.throwOnError,query:o.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if(o.getDefaultOptions().queries?._experimental_afterQuery?.(s,u),s.experimental_prefetchInRender&&!mr&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,n)){const e=l?Ha(s,c,a):o.getQueryCache().get(s.queryHash)?.promise;e?.catch(yr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function Qa(e,t){return Ka(e,$a,t)}var Ga=class extends $r{#l;#_=void 0;#U;#q;constructor(e,t){super(),this.#l=e,this.setOptions(t),this.bindMethods(),this.#W()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#l.defaultMutationOptions(e),Nr(this.options,t)||this.#l.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#U,observer:this}),t?.mutationKey&&this.options.mutationKey&&kr(t.mutationKey)!==kr(this.options.mutationKey)?this.reset():"pending"===this.#U?.state.status&&this.#U.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#U?.removeObserver(this)}onMutationUpdate(e){this.#W(),this.#z(e)}getCurrentResult(){return this.#_}reset(){this.#U?.removeObserver(this),this.#U=void 0,this.#W(),this.#z()}mutate(e,t){return this.#q=t,this.#U?.removeObserver(this),this.#U=this.#l.getMutationCache().build(this.#l,this.options),this.#U.addObserver(this),this.#U.execute(e)}#W(){const e=this.#U?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#_={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#z(e){Lr.batch(()=>{if(this.#q&&this.hasListeners()){const t=this.#_.variables,r=this.#_.context;"success"===e?.type?(this.#q.onSuccess?.(e.data,t,r),this.#q.onSettled?.(e.data,null,t,r)):"error"===e?.type&&(this.#q.onError?.(e.error,t,r),this.#q.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#_)})})}};function Ja(e,t){const r=sn(t),[n]=i.useState(()=>new Ga(r,e));i.useEffect(()=>{n.setOptions(e)},[n,e]);const a=i.useSyncExternalStore(i.useCallback(e=>n.subscribe(Lr.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=i.useCallback((e,t)=>{n.mutate(e,t).catch(yr)},[n]);if(a.error&&Ir(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function Ya(e){return Ya="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},Ya(e)}var Xa=function(e){return e instanceof File||e instanceof Blob},eo=function(e){return"string"==typeof e},to=function(e){return"boolean"==typeof e},ro=function(e){return"number"==typeof e},no=function(e){for(var t=new FormData,r=function(){var r=a[n],o=e[r];Array.isArray(o)?o.forEach(function(e,n){Xa(e)||eo(e)?t.append("".concat(r,"[").concat(n,"]"),e):to(e)||ro(e)?t.append("".concat(r,"[").concat(n,"]"),e.toString()):"object"===Ya(e)&&null!==e?t.append("".concat(r,"[").concat(n,"]"),JSON.stringify(e)):t.append("".concat(r,"[").concat(n,"]"),e)}):Xa(o)||eo(o)?t.append(r,o):to(o)?t.append(r,o.toString()):ro(o)?t.append(r,"".concat(o)):"object"===Ya(o)&&null!==o?t.append(r,JSON.stringify(o)):t.append(r,o)},n=0,a=Object.keys(e);n<a.length;n++)r();return t};function ao(e){return ao="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},ao(e)}function oo(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return io(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(io(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,io(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,io(d,"constructor",c),io(c,"constructor",l),l.displayName="GeneratorFunction",io(c,a,"GeneratorFunction"),io(d),io(d,a,"Generator"),io(d,n,function(){return this}),io(d,"toString",function(){return"[object Generator]"}),(oo=function(){return{w:o,m:f}})()}function io(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}io=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){io(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},io(e,t,r,n)}function so(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 lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?so(Object(r),!0).forEach(function(t){co(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):so(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function co(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=ao(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ao(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uo(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function fo(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){uo(o,n,a,i,s,"next",e)}function s(e){uo(o,n,a,i,s,"throw",e)}i(void 0)})}}function ho(e,t){return po.apply(this,arguments)}function po(){return po=fo(oo().m(function e(t,r){var n,a,o,i,s,l,c,u,d,f,h,p,m;return oo().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=La.wp_rest_nonce,o=La.nonce_key,i=La.nonce_value,s="".concat(t),l=(null===(n=r.method)||void 0===n?void 0:n.toUpperCase())||"POST",c=lo({"X-WP-Nonce":a},r.headers||{}),u={method:l,headers:c},["GET","DELETE"].includes(l)?((d=new URLSearchParams(null==r?void 0:r.body)).append(o,i),s+="?".concat(d.toString())):r.body&&((f=no(r.body)).append(o,i),u.body=f),e.p=1,e.n=2,fetch(s,u);case 2:return h=e.v,e.n=3,h.json();case 3:if(200!==(p=e.v).status_code){e.n=4;break}return e.a(2,p);case 4:throw new Error(p.message);case 5:e.n=7;break;case 6:throw e.p=6,m=e.v,new Error((null==m?void 0:m.message)||"fetch request error!!");case 7:return e.a(2)}},e,null,[[1,6]])})),po.apply(this,arguments)}function mo(e,t){return yo.apply(this,arguments)}function yo(){return yo=fo(oo().m(function e(t,r){var n,a,o,i,s,l,c,u,d;return oo().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=La.wp_rest_nonce,a=La.nonce_key,o=La.nonce_value,i="".concat(t),s={method:r.method||"POST",headers:lo({"X-WP-Nonce":n},r.headers||{}),body:r.body},r.body&&((l=no(r.body)).append(a,o),s.body=l),e.p=1,e.n=2,fetch(i,s);case 2:return c=e.v,e.n=3,c.json();case 3:if(200!==(u=e.v).status_code){e.n=4;break}return e.a(2,u);case 4:throw new Error(u.message);case 5:e.n=7;break;case 6:throw e.p=6,d=e.v,new Error((null==d?void 0:d.message)||"fetch request error!!");case 7:return e.a(2)}},e,null,[[1,6]])})),yo.apply(this,arguments)}const vo=wp.i18n;function go(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return bo(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(bo(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,bo(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,bo(d,"constructor",c),bo(c,"constructor",l),l.displayName="GeneratorFunction",bo(c,a,"GeneratorFunction"),bo(d),bo(d,a,"Generator"),bo(d,n,function(){return this}),bo(d,"toString",function(){return"[object Generator]"}),(go=function(){return{w:o,m:f}})()}function bo(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}bo=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){bo(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},bo(e,t,r,n)}function xo(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function wo(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){xo(o,n,a,i,s,"next",e)}function s(e){xo(o,n,a,i,s,"throw",e)}i(void 0)})}}var jo=function(){return Qa({queryKey:["getMoodInfo"],queryFn:(e=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_mood_info",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3});var e},_o=function(){return Qa({queryKey:["getEnableServiceList"],queryFn:(e=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_enable_service_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3});var e};const ko=function(e){var t=e.lines,r=void 0===t?1:t,n=e.rows,a=void 0===n?1:n,o=e.height,i=void 0===o?"h-4":o,s=e.width,l=void 0===s?"w-[100px]":s,c=e.className,u=e.animate,d=void 0===u||u;return(0,an.jsx)("div",{className:ga("flex flex-col gap-2",c),children:Array.from({length:a}).map(function(e,t){return(0,an.jsx)("div",{className:ga("flex gap-2",l),children:Array.from({length:r}).map(function(e,t){return(0,an.jsx)("div",{className:ga("bg-muted rounded",i,d&&"animate-pulse",t===r-1&&r>1?"w-3/4":"w-full")},t)})},t)})})};var Oo={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-6 h-6"};const So=function(e){var t=e.isLoading,r=e.loadingText,n=e.children,a=e.size,o=void 0===a?"sm":a,i=e.className;if(!t)return(0,an.jsx)(an.Fragment,{children:n});var s=(0,vo.__)("Loading","versatile-toolkit"),l=r||"".concat(s,"...");return(0,an.jsxs)("div",{className:ga("flex items-center gap-2",i),children:[(0,an.jsx)("div",{className:ga(Oo[o],"animate-spin"),children:(0,an.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,an.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",className:"opacity-25"}),(0,an.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"23.562",className:"opacity-75"})]})}),(0,an.jsx)("span",{children:l})]})};var No={xs:"w-3 h-3 text-xs",sm:"w-4 h-4 text-sm",md:"w-5 h-5 text-base",lg:"w-6 h-6 text-lg",xl:"w-8 h-8 text-xl"},Eo={default:"text-foreground",primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"};const Po=function(e){var t=e.size,r=void 0===t?"sm":t,n=e.variant,a=void 0===n?"muted":n,o=e.className,i=e.text,s=e.showText,l=void 0===s||s,c=i||(0,vo.__)("Loading","versatile-toolkit");return(0,an.jsxs)("div",{className:ga("flex items-center gap-2 py-2",Eo[a],o),children:[(0,an.jsx)("div",{className:ga(No[r],"animate-spin"),children:(0,an.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,an.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",className:"opacity-25"}),(0,an.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"23.562",className:"opacity-75"})]})}),l&&(0,an.jsxs)("span",{className:No[r].split(" ")[2],children:[c,"..."]})]})};const Co=function(e){var t=e.className,r=e.animate,n=void 0===r||r;return(0,an.jsxs)("div",{className:ga("space-y-6",t),children:[(0,an.jsxs)("div",{className:"flex justify-between items-center pb-5",children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(ko,{width:"w-6",height:"h-6",animate:n}),(0,an.jsx)(ko,{width:"w-48",height:"h-8",animate:n})]}),(0,an.jsxs)("div",{className:"flex gap-5",children:[(0,an.jsx)(ko,{width:"w-32",height:"h-10",animate:n}),(0,an.jsx)(ko,{width:"w-24",height:"h-10",animate:n})]})]}),(0,an.jsxs)("div",{className:"space-y-4",children:[(0,an.jsx)(ko,{width:"w-32",height:"h-5",animate:n}),(0,an.jsx)("div",{className:"grid grid-cols-6 gap-4",children:Array.from({length:6}).map(function(e,t){return(0,an.jsxs)("div",{className:"space-y-3",children:[(0,an.jsx)("div",{className:ga("aspect-[4/3] bg-muted rounded-lg border-2",n&&"animate-pulse")}),(0,an.jsx)(ko,{width:"w-16",height:"h-4",animate:n}),(0,an.jsx)(ko,{rows:2,lines:1,width:"w-full",height:"h-3",animate:n}),(0,an.jsxs)("div",{className:"flex gap-2",children:[(0,an.jsx)(ko,{width:"w-12",height:"h-6",animate:n}),(0,an.jsx)(ko,{width:"w-14",height:"h-6",animate:n})]})]},t)})}),(0,an.jsx)(ko,{width:"w-80",height:"h-4",animate:n})]}),(0,an.jsxs)("div",{className:"flex gap-10",children:[(0,an.jsxs)("div",{className:"w-1/2 space-y-6",children:[(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(ko,{width:"w-40",height:"h-5",animate:n}),(0,an.jsx)(ko,{width:"w-12",height:"h-6",animate:n})]}),(0,an.jsx)(ko,{width:"w-64",height:"h-4",animate:n})]}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(ko,{width:"w-12",height:"h-5",animate:n}),(0,an.jsx)(ko,{width:"w-full",height:"h-10",animate:n}),(0,an.jsx)(ko,{width:"w-72",height:"h-4",animate:n})]}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(ko,{width:"w-16",height:"h-5",animate:n}),(0,an.jsx)(ko,{width:"w-full",height:"h-10",animate:n}),(0,an.jsx)(ko,{width:"w-48",height:"h-4",animate:n})]}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(ko,{width:"w-20",height:"h-5",animate:n}),(0,an.jsx)(ko,{width:"w-full",height:"h-24",animate:n}),(0,an.jsx)(ko,{width:"w-64",height:"h-4",animate:n})]})]}),(0,an.jsxs)("div",{className:"w-1/2 space-y-6",children:[(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(ko,{width:"w-32",height:"h-5",animate:n}),(0,an.jsxs)("div",{className:"space-y-3",children:[(0,an.jsx)(ko,{width:"w-48",height:"h-10",animate:n}),(0,an.jsx)("div",{className:ga("w-40 h-32 bg-muted rounded-lg",n&&"animate-pulse")}),(0,an.jsx)(ko,{width:"w-24",height:"h-4",animate:n}),(0,an.jsx)(ko,{width:"w-80",height:"h-4",animate:n})]}),(0,an.jsx)(ko,{width:"w-72",height:"h-4",animate:n})]}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(ko,{width:"w-12",height:"h-5",animate:n}),(0,an.jsxs)("div",{className:"space-y-3",children:[(0,an.jsx)(ko,{width:"w-32",height:"h-10",animate:n}),(0,an.jsx)(ko,{width:"w-16",height:"h-4",animate:n})]}),(0,an.jsx)(ko,{width:"w-68",height:"h-4",animate:n})]})]})]})]})};const Ro=function(){return(0,an.jsx)("div",{className:"flex items-center justify-center h-full bg-gray-50 rounded-lg border border-gray-200 p-6",children:(0,an.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 w-72 text-center",children:[(0,an.jsx)("div",{className:"w-16 h-16 bg-gray-200 rounded-full mx-auto mb-4 animate-pulse"}),(0,an.jsx)("div",{className:"h-5 bg-gray-300 rounded w-32 mx-auto mb-2 animate-pulse"}),(0,an.jsx)("div",{className:"h-4 bg-gray-200 rounded w-40 mx-auto mb-1 animate-pulse"}),(0,an.jsx)("div",{className:"h-4 bg-gray-100 rounded w-36 mx-auto animate-pulse"})]})})};function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return To(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)?To(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function To(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}const Do=function(){var e=_o(),t=e.data,r=e.isLoading,n=null==t?void 0:t.data;return(0,an.jsx)(an.Fragment,{children:(0,an.jsx)("div",{className:"mt-10 flex flex-wrap gap-3",children:r?(0,an.jsx)(ko,{lines:3,height:"h-[100px]",width:"w-[900px]"}):Object.entries(n).filter(function(e){var t=Ao(e,2);t[0];return t[1].enable}).map(function(e){var t=Ao(e,2),r=t[0],n=t[1];return(0,an.jsx)(Ca,{className:"w-[300px] hover:bg-gray-100 rounded-sm",children:(0,an.jsxs)(ct,{to:"/".concat(n.path),className:"block p-3",children:[(0,an.jsx)(Ra,{className:"p-0",children:(0,an.jsx)(Aa,{className:"text-xl",children:n.label})}),(0,an.jsx)(Ta,{className:"p-0 pt-2",children:(0,an.jsx)("p",{children:n.description})})]})},r)})})})};function Fo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Io(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Fo(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():Fo(e[t],null)}}}}function Mo(...e){return i.useCallback(Io(...e),e)}function Lo(e){const t=Vo(e),r=i.forwardRef((e,r)=>{const{children:n,...a}=e,o=i.Children.toArray(n),s=o.find(Uo);if(s){const e=s.props.children,n=o.map(t=>t===s?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t);return(0,an.jsx)(t,{...a,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,n):null})}return(0,an.jsx)(t,{...a,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}var $o=Lo("Slot");function Vo(e){const t=i.forwardRef((e,t)=>{const{children:r,...n}=e;if(i.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==i.Fragment&&(a.ref=t?Io(t,e):e),i.cloneElement(r,a)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zo=Symbol("radix.slottable");function Uo(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===zo}const qo=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Wo=un,Zo=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Wo(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;const i=qo(t)||qo(n);return a[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...s}[t]):{...o,...s}[t]===r})?[...e,r,n]:e},[]);return Wo(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)};function Bo(e){return Bo="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},Bo(e)}var Ho=["className","variant","size","asChild"];function Ko(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 Qo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Bo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bo(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Go=Zo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Jo=i.forwardRef(function(e,t){var r=e.className,n=e.variant,a=e.size,o=e.asChild,i=void 0!==o&&o,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,Ho),l=i?$o:"button";return(0,an.jsx)(l,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach(function(t){Qo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:ga(Go({variant:n,size:a,className:r})),ref:t},s))});Jo.displayName="Button";const Yo=(...e)=>e.filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t).join(" ");var Xo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ei=(0,i.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:s,...l},c)=>(0,i.createElement)("svg",{ref:c,...Xo,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:Yo("lucide",a),...l},[...s.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(o)?o:[o]])),ti=(e,t)=>{const r=(0,i.forwardRef)(({className:r,...n},a)=>{return(0,i.createElement)(ei,{ref:a,iconNode:t,className:Yo(`lucide-${o=e,o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n});var o});return r.displayName=`${e}`,r},ri=ti("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ni=ti("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ai=ti("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function oi(e){return oi="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},oi(e)}var ii=["className","variant"];function si(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 li(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=oi(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oi(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ci=Zo("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",success:"bg-green-100 text-green-800 hover:bg-green-200/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input bg-background hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ui(e){var t=e.className,r=e.variant,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,ii);return(0,an.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?si(Object(r),!0).forEach(function(t){li(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):si(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:ga(ci({variant:r}),t)},n))}var di=.999,fi=/[\\\/_+.#"@\[\(\{&]/,hi=/[\\\/_+.#"@\[\(\{&]/g,pi=/[\s-]/,mi=/[\s-]/g;function yi(e,t,r,n,a,o,i){if(o===t.length)return a===e.length?1:.99;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,f=n.charAt(o),h=r.indexOf(f,a),p=0;h>=0;)(l=yi(e,t,r,n,h+1,o+1,i))>p&&(h===a?l*=1:fi.test(e.charAt(h-1))?(l*=.8,(u=e.slice(a,h-1).match(hi))&&a>0&&(l*=Math.pow(di,u.length))):pi.test(e.charAt(h-1))?(l*=.9,(d=e.slice(a,h-1).match(mi))&&a>0&&(l*=Math.pow(di,d.length))):(l*=.17,a>0&&(l*=Math.pow(di,h-a))),e.charAt(h)!==t.charAt(o)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(h-1)!==n.charAt(o))&&(.1*(c=yi(e,t,r,n,h+1,o+2,i))>l&&(l=.1*c)),l>p&&(p=l),h=r.indexOf(f,h+1);return i[s]=p,p}function vi(e){return e.toLowerCase().replace(mi," ")}function gi(e,t,r){return yi(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,vi(e),vi(t),0,0,{})}function bi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function xi(e,t=[]){let r=[];const n=()=>{const t=r.map(e=>i.createContext(e));return function(r){const n=r?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){const a=i.createContext(n),o=r.length;r=[...r,n];const s=t=>{const{scope:r,children:n,...s}=t,l=r?.[e]?.[o]||a,c=i.useMemo(()=>s,Object.values(s));return(0,an.jsx)(l.Provider,{value:c,children:n})};return s.displayName=t+"Provider",[s,function(r,s){const l=s?.[e]?.[o]||a,c=i.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},wi(n,...t)]}function wi(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var ji=globalThis?.document?i.useLayoutEffect:()=>{},_i=s[" useId ".trim().toString()]||(()=>{}),ki=0;function Oi(e){const[t,r]=i.useState(_i());return ji(()=>{e||r(e=>e??String(ki++))},[e]),e||(t?`radix-${t}`:"")}var Si=s[" useInsertionEffect ".trim().toString()]||ji;function Ni({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,o,s]=function({defaultProp:e,onChange:t}){const[r,n]=i.useState(e),a=i.useRef(r),o=i.useRef(t);return Si(()=>{o.current=t},[t]),i.useEffect(()=>{a.current!==r&&(o.current?.(r),a.current=r)},[r,a]),[r,n,o]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:a;{const t=i.useRef(void 0!==e);i.useEffect(()=>{const e=t.current;if(e!==l){}t.current=l},[l,n])}const u=i.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else o(t)},[l,e,o,s]);return[c,u]}Symbol("RADIX:SYNC_STATE");var Ei=a(206),Pi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Lo(`Primitive.${t}`),n=i.forwardRef((e,n)=>{const{asChild:a,...o}=e,i=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,an.jsx)(i,{...o,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Ci(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var Ri,Ai="dismissableLayer.update",Ti="dismissableLayer.pointerDownOutside",Di="dismissableLayer.focusOutside",Fi=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ii=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...c}=e,u=i.useContext(Fi),[d,f]=i.useState(null),h=d?.ownerDocument??globalThis?.document,[,p]=i.useState({}),m=Mo(t,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(v),b=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,w=b>=g,j=function(e,t=globalThis?.document){const r=Ci(e),n=i.useRef(!1),a=i.useRef(()=>{});return i.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){$i(Ti,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));w&&!r&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},h),_=function(e,t=globalThis?.document){const r=Ci(e),n=i.useRef(!1);return i.useEffect(()=>{const e=e=>{if(e.target&&!n.current){$i(Di,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=Ci(e);i.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),i.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ri=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Li(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ri)}},[d,h,r,u]),i.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Li())},[d,u]),i.useEffect(()=>{const e=()=>p({});return document.addEventListener(Ai,e),()=>document.removeEventListener(Ai,e)},[]),(0,an.jsx)(Pi.div,{...c,ref:m,style:{pointerEvents:x?w?"auto":"none":void 0,...e.style},onFocusCapture:bi(e.onFocusCapture,_.onFocusCapture),onBlurCapture:bi(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:bi(e.onPointerDownCapture,j.onPointerDownCapture)})});Ii.displayName="DismissableLayer";var Mi=i.forwardRef((e,t)=>{const r=i.useContext(Fi),n=i.useRef(null),a=Mo(t,n);return i.useEffect(()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,an.jsx)(Pi.div,{...e,ref:a})});function Li(){const e=new CustomEvent(Ai);document.dispatchEvent(e)}function $i(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&Ei.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}Mi.displayName="DismissableLayerBranch";var Vi="focusScope.autoFocusOnMount",zi="focusScope.autoFocusOnUnmount",Ui={bubbles:!1,cancelable:!0},qi=i.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,c]=i.useState(null),u=Ci(a),d=Ci(o),f=i.useRef(null),h=Mo(t,e=>c(e)),p=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(n){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:Hi(f.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Hi(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Hi(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[n,l,p.paused]),i.useEffect(()=>{if(l){Ki.add(p);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Vi,Ui);l.addEventListener(Vi,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Hi(n,{select:t}),document.activeElement!==r)return}((e=Wi(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Hi(l))}return()=>{l.removeEventListener(Vi,u),setTimeout(()=>{const e=new CustomEvent(zi,Ui);l.addEventListener(zi,d),l.dispatchEvent(e),e.defaultPrevented||Hi(t??document.body,{select:!0}),l.removeEventListener(zi,d),Ki.remove(p)},0)}}var e},[l,u,d,p]);const m=i.useCallback(e=>{if(!r&&!n)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[n,o]=function(e){const t=Wi(e),r=Zi(t,e),n=Zi(t.reverse(),e);return[r,n]}(t);n&&o?e.shiftKey||a!==o?e.shiftKey&&a===n&&(e.preventDefault(),r&&Hi(o,{select:!0})):(e.preventDefault(),r&&Hi(n,{select:!0})):a===t&&e.preventDefault()}},[r,n,p.paused]);return(0,an.jsx)(Pi.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});function Wi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Zi(e,t){for(const r of e)if(!Bi(r,{upTo:t}))return r}function Bi(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Hi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}qi.displayName="FocusScope";var Ki=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Qi(e,t),e.unshift(t)},remove(t){e=Qi(e,t),e[0]?.resume()}}}();function Qi(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Gi=i.forwardRef((e,t)=>{const{container:r,...n}=e,[a,o]=i.useState(!1);ji(()=>o(!0),[]);const s=r||a&&globalThis?.document?.body;return s?Ei.createPortal((0,an.jsx)(Pi.div,{...n,ref:t}),s):null});Gi.displayName="Portal";var Ji=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=i.useState(),n=i.useRef(null),a=i.useRef(e),o=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const e=Yi(n.current);o.current="mounted"===l?e:"none"},[l]),ji(()=>{const t=n.current,r=a.current;if(r!==e){const n=o.current,i=Yi(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),ji(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=o=>{const i=Yi(n.current).includes(o.animationName);if(o.target===t&&i&&(c("ANIMATION_END"),!a.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(o.current=Yi(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),a="function"==typeof r?r({present:n.isPresent}):i.Children.only(r),o=Mo(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||n.isPresent?i.cloneElement(a,{ref:o}):null};function Yi(e){return e?.animationName||"none"}Ji.displayName="Presence";var Xi=0;function es(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ts()),document.body.insertAdjacentElement("beforeend",e[1]??ts()),Xi++,()=>{1===Xi&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Xi--}},[])}function ts(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var rs=function(){return rs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},rs.apply(this,arguments)};function ns(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}Object.create;function as(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var os="right-scroll-bar-position",is="width-before-scroll-bar";function ss(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ls="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,cs=new WeakMap;function us(e,t){var r,n,a,o=(r=t||null,n=function(t){return e.forEach(function(e){return ss(e,t)})},(a=(0,i.useState)(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return ls(function(){var t=cs.get(o);if(t){var r=new Set(t),n=new Set(e),a=o.current;r.forEach(function(e){n.has(e)||ss(e,null)}),n.forEach(function(e){r.has(e)||ss(e,a)})}cs.set(o,e)},[e]),o}function ds(e){return e}function fs(e,t){void 0===t&&(t=ds);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var o=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(o)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return a}var hs=function(e){void 0===e&&(e={});var t=fs(null);return t.options=rs({async:!0,ssr:!1},e),t}(),ps=function(){},ms=i.forwardRef(function(e,t){var r=i.useRef(null),n=i.useState({onScrollCapture:ps,onWheelCapture:ps,onTouchMoveCapture:ps}),a=n[0],o=n[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,y=e.inert,v=e.allowPinchZoom,g=e.as,b=void 0===g?"div":g,x=e.gapMode,w=ns(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=h,_=us([r,t]),k=rs(rs({},w),a);return i.createElement(i.Fragment,null,d&&i.createElement(j,{sideCar:hs,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:y,setCallbacks:o,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?i.cloneElement(i.Children.only(l),rs(rs({},k),{ref:_})):i.createElement(b,rs({},k,{className:c,ref:_}),l))});ms.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ms.classNames={fullWidth:is,zeroRight:os};var ys,vs=function(e){var t=e.sideCar,r=ns(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return i.createElement(n,rs({},r))};vs.isSideCarExport=!0;function gs(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ys||a.nc;return t&&e.setAttribute("nonce",t),e}var bs=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=gs())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xs=function(){var e,t=(e=bs(),function(t,r){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},ws={left:0,top:0,right:0,gap:0},js=function(e){return parseInt(e||"",10)||0},_s=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ws;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[js(r),js(n),js(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ks=xs(),Os="data-scroll-locked",Ss=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(n,";\n   padding-right: ").concat(s,"px ").concat(n,";\n  }\n  body[").concat(Os,"] {\n    overflow: hidden ").concat(n,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n    padding-left: ".concat(a,"px;\n    padding-top: ").concat(o,"px;\n    padding-right: ").concat(i,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(s,"px ").concat(n,";\n    "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(os," {\n    right: ").concat(s,"px ").concat(n,";\n  }\n  \n  .").concat(is," {\n    margin-right: ").concat(s,"px ").concat(n,";\n  }\n  \n  .").concat(os," .").concat(os," {\n    right: 0 ").concat(n,";\n  }\n  \n  .").concat(is," .").concat(is," {\n    margin-right: 0 ").concat(n,";\n  }\n  \n  body[").concat(Os,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n  }\n")},Ns=function(){var e=parseInt(document.body.getAttribute(Os)||"0",10);return isFinite(e)?e:0},Es=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;i.useEffect(function(){return document.body.setAttribute(Os,(Ns()+1).toString()),function(){var e=Ns()-1;e<=0?document.body.removeAttribute(Os):document.body.setAttribute(Os,e.toString())}},[]);var o=i.useMemo(function(){return _s(a)},[a]);return i.createElement(ks,{styles:Ss(o,!t,a,r?"":"!important")})},Ps=!1;if("undefined"!=typeof window)try{var Cs=Object.defineProperty({},"passive",{get:function(){return Ps=!0,!0}});window.addEventListener("test",Cs,Cs),window.removeEventListener("test",Cs,Cs)}catch(e){Ps=!1}var Rs=!!Ps&&{passive:!1},As=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Ts=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Ds(e,n)){var a=Fs(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Ds=function(e,t){return"v"===e?function(e){return As(e,"overflowY")}(t):function(e){return As(e,"overflowX")}(t)},Fs=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},Is=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ms=function(e){return[e.deltaX,e.deltaY]},Ls=function(e){return e&&"current"in e?e.current:e},$s=function(e){return"\n  .block-interactivity-".concat(e," {pointer-events: none;}\n  .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Vs=0,zs=[];function Us(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qs=(Ws=function(e){var t=i.useRef([]),r=i.useRef([0,0]),n=i.useRef(),a=i.useState(Vs++)[0],o=i.useState(xs)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=as([e.lockRef.current],(e.shards||[]).map(Ls),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var a,o=Is(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-o[0],c="deltaY"in e?e.deltaY:i[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Ts(d,u);if(!f)return!0;if(f?a=d:(a="v"===d?"h":"v",f=Ts(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var h=n.current||a;return function(e,t,r,n,a){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*n,s=r.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var h=Fs(e,s),p=h[0],m=h[1]-h[2]-o*p;(p||m)&&Ds(e,s)&&(d+=m,f+=p);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(a&&Math.abs(d)<1||!a&&i>d)||!u&&(a&&Math.abs(f)<1||!a&&-i>f))&&(c=!0),c}(h,t,e,"h"===h?l:c,!0)},[]),c=i.useCallback(function(e){var r=e;if(zs.length&&zs[zs.length-1]===o){var n="deltaY"in r?Ms(r):Is(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var i=(s.current.shards||[]).map(Ls).filter(Boolean).filter(function(e){return e.contains(r.target)});(i.length>0?l(r,i[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=i.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:Us(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=i.useCallback(function(e){r.current=Is(e),n.current=void 0},[]),f=i.useCallback(function(t){u(t.type,Ms(t),t.target,l(t,e.lockRef.current))},[]),h=i.useCallback(function(t){u(t.type,Is(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return zs.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Rs),document.addEventListener("touchmove",c,Rs),document.addEventListener("touchstart",d,Rs),function(){zs=zs.filter(function(e){return e!==o}),document.removeEventListener("wheel",c,Rs),document.removeEventListener("touchmove",c,Rs),document.removeEventListener("touchstart",d,Rs)}},[]);var p=e.removeScrollBar,m=e.inert;return i.createElement(i.Fragment,null,m?i.createElement(o,{styles:$s(a)}):null,p?i.createElement(Es,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},hs.useMedium(Ws),vs);var Ws,Zs=i.forwardRef(function(e,t){return i.createElement(ms,rs({},e,{ref:t,sideCar:qs}))});Zs.classNames=ms.classNames;const Bs=Zs;var Hs=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ks=new WeakMap,Qs=new WeakMap,Gs={},Js=0,Ys=function(e){return e&&(e.host||Ys(e.parentNode))},Xs=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Ys(t);return r&&e.contains(r)?r:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Gs[r]||(Gs[r]=new WeakMap);var o=Gs[r],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(Ks.get(e)||0)+1,c=(o.get(e)||0)+1;Ks.set(e,l),o.set(e,c),i.push(e),1===l&&a&&Qs.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(e){}})};return u(t),s.clear(),Js++,function(){i.forEach(function(e){var t=Ks.get(e)-1,a=o.get(e)-1;Ks.set(e,t),o.set(e,a),t||(Qs.has(e)||e.removeAttribute(n),Qs.delete(e)),a||e.removeAttribute(r)}),--Js||(Ks=new WeakMap,Ks=new WeakMap,Qs=new WeakMap,Gs={})}},el=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||Hs(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),Xs(n,a,r,"aria-hidden")):function(){return null}},tl="Dialog",[rl,nl]=xi(tl),[al,ol]=rl(tl),il=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=i.useRef(null),c=i.useRef(null),[u,d]=Ni({prop:n,defaultProp:a??!1,onChange:o,caller:tl});return(0,an.jsx)(al,{scope:t,triggerRef:l,contentRef:c,contentId:Oi(),titleId:Oi(),descriptionId:Oi(),open:u,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};il.displayName=tl;var sl="DialogTrigger",ll=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ol(sl,r),o=Mo(t,a.triggerRef);return(0,an.jsx)(Pi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":El(a.open),...n,ref:o,onClick:bi(e.onClick,a.onOpenToggle)})});ll.displayName=sl;var cl="DialogPortal",[ul,dl]=rl(cl,{forceMount:void 0}),fl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=ol(cl,t);return(0,an.jsx)(ul,{scope:t,forceMount:r,children:i.Children.map(n,e=>(0,an.jsx)(Ji,{present:r||o.open,children:(0,an.jsx)(Gi,{asChild:!0,container:a,children:e})}))})};fl.displayName=cl;var hl="DialogOverlay",pl=i.forwardRef((e,t)=>{const r=dl(hl,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=ol(hl,e.__scopeDialog);return o.modal?(0,an.jsx)(Ji,{present:n||o.open,children:(0,an.jsx)(yl,{...a,ref:t})}):null});pl.displayName=hl;var ml=Lo("DialogOverlay.RemoveScroll"),yl=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ol(hl,r);return(0,an.jsx)(Bs,{as:ml,allowPinchZoom:!0,shards:[a.contentRef],children:(0,an.jsx)(Pi.div,{"data-state":El(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),vl="DialogContent",gl=i.forwardRef((e,t)=>{const r=dl(vl,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=ol(vl,e.__scopeDialog);return(0,an.jsx)(Ji,{present:n||o.open,children:o.modal?(0,an.jsx)(bl,{...a,ref:t}):(0,an.jsx)(xl,{...a,ref:t})})});gl.displayName=vl;var bl=i.forwardRef((e,t)=>{const r=ol(vl,e.__scopeDialog),n=i.useRef(null),a=Mo(t,r.contentRef,n);return i.useEffect(()=>{const e=n.current;if(e)return el(e)},[]),(0,an.jsx)(wl,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bi(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:bi(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:bi(e.onFocusOutside,e=>e.preventDefault())})}),xl=i.forwardRef((e,t)=>{const r=ol(vl,e.__scopeDialog),n=i.useRef(!1),a=i.useRef(!1);return(0,an.jsx)(wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const o=t.target,i=r.triggerRef.current?.contains(o);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),wl=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=e,l=ol(vl,r),c=i.useRef(null),u=Mo(t,c);return es(),(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(qi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,an.jsx)(Ii,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":El(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(Al,{titleId:l.titleId}),(0,an.jsx)(Tl,{contentRef:c,descriptionId:l.descriptionId})]})]})}),jl="DialogTitle",_l=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ol(jl,r);return(0,an.jsx)(Pi.h2,{id:a.titleId,...n,ref:t})});_l.displayName=jl;var kl="DialogDescription",Ol=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ol(kl,r);return(0,an.jsx)(Pi.p,{id:a.descriptionId,...n,ref:t})});Ol.displayName=kl;var Sl="DialogClose",Nl=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ol(Sl,r);return(0,an.jsx)(Pi.button,{type:"button",...n,ref:t,onClick:bi(e.onClick,()=>a.onOpenChange(!1))})});function El(e){return e?"open":"closed"}Nl.displayName=Sl;var Pl="DialogTitleWarning",[Cl,Rl]=function(e,t){const r=i.createContext(t),n=e=>{const{children:t,...n}=e,a=i.useMemo(()=>n,Object.values(n));return(0,an.jsx)(r.Provider,{value:a,children:t})};return n.displayName=e+"Provider",[n,function(n){const a=i.useContext(r);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(Pl,{contentName:vl,titleName:jl,docsSlug:"dialog"}),Al=({titleId:e})=>{const t=Rl(Pl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{if(e){document.getElementById(e)}},[r,e]),null},Tl=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rl("DialogDescriptionWarning").contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)}},[r,e,t]),null},Dl=il,Fl=ll,Il=fl,Ml=pl,Ll=gl,$l=_l,Vl=Ol,zl=Nl,Ul='[cmdk-group=""]',ql='[cmdk-group-items=""]',Wl='[cmdk-item=""]',Zl=`${Wl}:not([aria-disabled="true"])`,Bl="cmdk-item-select",Hl="data-value",Kl=(e,t,r)=>gi(e,t,r),Ql=i.createContext(void 0),Gl=()=>i.useContext(Ql),Jl=i.createContext(void 0),Yl=()=>i.useContext(Jl),Xl=i.createContext(void 0),ec=i.forwardRef((e,t)=>{let r=pc(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=pc(()=>new Set),a=pc(()=>new Map),o=pc(()=>new Map),s=pc(()=>new Set),l=fc(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,loop:m,disablePointerSelection:y=!1,vimBindings:v=!0,...g}=e,b=Oi(),x=Oi(),w=Oi(),j=i.useRef(null),_=vc();hc(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,k.emit()}},[d]),hc(()=>{_(6,C)},[]);let k=i.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i,s;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),N(),_(1,E);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(_(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,k.emit()}),n||_(5,C),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}k.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),O=i.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=o.current.get(e))?void 0:a.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),_(2,()=>{N(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),_(3,()=>{P(),N(),r.current.value||E(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=R();_(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&E(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:j}),[]);function S(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:Kl;return e?o(e,r.current.search,t):0}function N(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),o=0;n.forEach(t=>{let r=e.get(t);o=Math.max(r,o)}),t.push([r,o])});let n=j.current;A().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(ql);t?t.appendChild(e.parentElement===t?e:e.closest(`${ql} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ql} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=j.current)?void 0:t.querySelector(`${Ul}[${Hl}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function E(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Hl);k.setState("value",t||void 0)}function P(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=S(null!=(t=null==(e=o.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(i=o.current.get(a))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function C(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Ul))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=j.current)?void 0:e.querySelector(`${Wl}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=j.current)?void 0:e.querySelectorAll(Zl))||[])}function T(e){let t=A()[e];t&&k.setState("value",t.getAttribute(Hl))}function D(e){var t;let r=R(),n=A(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&k.setState("value",o.getAttribute(Hl))}function F(e){let t,r=R(),n=null==r?void 0:r.closest(Ul);for(;n&&!t;)n=e>0?uc(n,Ul):dc(n,Ul),t=null==n?void 0:n.querySelector(Zl);t?k.setState("value",t.getAttribute(Hl)):D(e)}let I=()=>T(A().length-1),M=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):D(1)},L=e=>{e.preventDefault(),e.metaKey?T(0):e.altKey?F(-1):D(-1)};return i.createElement(Pi.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=g.onKeyDown)||t.call(g,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":v&&e.ctrlKey&&M(e);break;case"ArrowDown":M(e);break;case"p":case"k":v&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),T(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Bl);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:bc},c),gc(e,e=>i.createElement(Jl.Provider,{value:k},i.createElement(Ql.Provider,{value:O},e))))}),tc=i.forwardRef((e,t)=>{var r,n;let a=Oi(),o=i.useRef(null),s=i.useContext(Xl),l=Gl(),c=fc(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==s?void 0:s.forceMount;hc(()=>{if(!u)return l.item(a,null==s?void 0:s.id)},[u]);let d=yc(a,o,[e.value,e.children,o],e.keywords),f=Yl(),h=mc(e=>e.value&&e.value===d.current),p=mc(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(a)>0));function m(){var e,t;y(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function y(){f.setState("value",d.current,!0)}if(i.useEffect(()=>{let t=o.current;if(t&&!e.disabled)return t.addEventListener(Bl,m),()=>t.removeEventListener(Bl,m)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:g,onSelect:b,forceMount:x,keywords:w,...j}=e;return i.createElement(Pi.div,{ref:Io(o,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||l.getDisablePointerSelection()?void 0:y,onClick:v?void 0:m},e.children)}),rc=i.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,s=Oi(),l=i.useRef(null),c=i.useRef(null),u=Oi(),d=Gl(),f=mc(e=>!(!a&&!1!==d.filter())||(!e.search||e.filtered.groups.has(s)));hc(()=>d.group(s),[]),yc(s,l,[e.value,e.heading,c]);let h=i.useMemo(()=>({id:s,forceMount:a}),[a]);return i.createElement(Pi.div,{ref:Io(l,t),...o,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),gc(e,e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(Xl.Provider,{value:h},e))))}),nc=i.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=i.useRef(null),o=mc(e=>!e.search);return r||o?i.createElement(Pi.div,{ref:Io(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),ac=i.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,o=Yl(),s=mc(e=>e.search),l=mc(e=>e.selectedItemId),c=Gl();return i.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),i.createElement(Pi.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),oc=i.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=i.useRef(null),s=i.useRef(null),l=mc(e=>e.selectedItemId),c=Gl();return i.useEffect(()=>{if(s.current&&o.current){let e,t=s.current,r=o.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),i.createElement(Pi.div,{ref:Io(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},gc(e,e=>i.createElement("div",{ref:Io(s,c.listInnerRef),"cmdk-list-sizer":""},e)))}),ic=i.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:s,...l}=e;return i.createElement(Dl,{open:r,onOpenChange:n},i.createElement(Il,{container:s},i.createElement(Ml,{"cmdk-overlay":"",className:a}),i.createElement(Ll,{"aria-label":e.label,"cmdk-dialog":"",className:o},i.createElement(ec,{ref:t,...l}))))}),sc=i.forwardRef((e,t)=>mc(e=>0===e.filtered.count)?i.createElement(Pi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),lc=i.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return i.createElement(Pi.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},gc(e,e=>i.createElement("div",{"aria-hidden":!0},e)))}),cc=Object.assign(ec,{List:oc,Item:tc,Input:ac,Group:rc,Separator:nc,Dialog:ic,Empty:sc,Loading:lc});function uc(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function dc(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function fc(e){let t=i.useRef(e);return hc(()=>{t.current=e}),t}var hc="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function pc(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function mc(e){let t=Yl(),r=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,r,r)}function yc(e,t,r,n=[]){let a=i.useRef(),o=Gl();return hc(()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=n.map(e=>e.trim());o.value(e,s,l),null==(i=t.current)||i.setAttribute(Hl,s),a.current=s}),a}var vc=()=>{let[e,t]=i.useState(),r=pc(()=>new Map);return hc(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function gc({asChild:e,children:t},r){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var bc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const xc=ti("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function wc(e){return wc="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},wc(e)}var jc=["className"],_c=["className","children"],kc=["className"],Oc=["className"],Sc=["className"],Nc=["className"];function Ec(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 Pc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ec(Object(r),!0).forEach(function(t){Cc(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ec(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Cc(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=wc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=wc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rc(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var Ac=Dl,Tc=Fl,Dc=Il,Fc=zl,Ic=i.forwardRef(function(e,t){var r=e.className,n=Rc(e,jc);return(0,an.jsx)(Ml,Pc({ref:t,className:ga("fixed inset-0 z-[99999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n))});Ic.displayName=Ml.displayName;var Mc=i.forwardRef(function(e,t){var r=e.className,n=e.children,a=Rc(e,_c);return(0,an.jsxs)(Dc,{children:[(0,an.jsx)(Ic,{}),(0,an.jsxs)(Ll,Pc(Pc({ref:t,className:ga("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg","max-w-4xl z-[99999]",r)},a),{},{children:[n,(0,an.jsxs)(zl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,an.jsx)(ri,{className:"h-4 w-4"}),(0,an.jsx)("span",{className:"sr-only",children:(0,vo.__)("Close","trigger")})]})]}))]})});Mc.displayName=Ll.displayName;var Lc=function(e){var t=e.className,r=Rc(e,kc);return(0,an.jsx)("div",Pc({className:ga("flex flex-col space-y-1.5 text-center sm:text-left",t)},r))};Lc.displayName="DialogHeader";var $c=function(e){var t=e.className,r=Rc(e,Oc);return(0,an.jsx)("div",Pc({className:ga("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},r))};$c.displayName="DialogFooter";var Vc=i.forwardRef(function(e,t){var r=e.className,n=Rc(e,Sc);return(0,an.jsx)($l,Pc({ref:t,className:ga("text-lg font-semibold leading-none tracking-tight",r)},n))});Vc.displayName=$l.displayName;var zc=i.forwardRef(function(e,t){var r=e.className,n=Rc(e,Nc);return(0,an.jsx)(Vl,Pc({ref:t,className:ga("text-sm text-muted-foreground",r)},n))});function Uc(e){return Uc="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},Uc(e)}zc.displayName=Vl.displayName;var qc=["className"],Wc=["className"],Zc=["className"],Bc=["className"],Hc=["className"],Kc=["className"];function Qc(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 Gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach(function(t){Jc(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Jc(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Uc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Uc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yc(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var Xc=i.forwardRef(function(e,t){var r=e.className,n=Yc(e,qc);return(0,an.jsx)(cc,Gc({ref:t,className:ga("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r)},n))});Xc.displayName=cc.displayName;var eu=i.forwardRef(function(e,t){var r=e.className,n=Yc(e,Wc);return(0,an.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,an.jsx)(xc,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,an.jsx)(cc.Input,Gc({ref:t,className:ga("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r)},n))]})});eu.displayName=cc.Input.displayName;var tu=i.forwardRef(function(e,t){var r=e.className,n=Yc(e,Zc);return(0,an.jsx)(cc.List,Gc({ref:t,className:ga("max-h-[300px] overflow-y-auto overflow-x-hidden",r)},n))});tu.displayName=cc.List.displayName;var ru=i.forwardRef(function(e,t){return(0,an.jsx)(cc.Empty,Gc({ref:t,className:"py-6 text-center text-sm"},e))});ru.displayName=cc.Empty.displayName;var nu=i.forwardRef(function(e,t){var r=e.className,n=Yc(e,Bc);return(0,an.jsx)(cc.Group,Gc({ref:t,className:ga("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r)},n))});nu.displayName=cc.Group.displayName,i.forwardRef(function(e,t){var r=e.className,n=Yc(e,Hc);return(0,an.jsx)(cc.Separator,Gc({ref:t,className:ga("-mx-1 h-px bg-border",r)},n))}).displayName=cc.Separator.displayName;var au=i.forwardRef(function(e,t){var r=e.className,n=Yc(e,Kc);return(0,an.jsx)(cc.Item,Gc({ref:t,className:ga("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r)},n))});au.displayName=cc.Item.displayName;const ou=["top","right","bottom","left"],iu=Math.min,su=Math.max,lu=Math.round,cu=Math.floor,uu=e=>({x:e,y:e}),du={left:"right",right:"left",bottom:"top",top:"bottom"},fu={start:"end",end:"start"};function hu(e,t,r){return su(e,iu(t,r))}function pu(e,t){return"function"==typeof e?e(t):e}function mu(e){return e.split("-")[0]}function yu(e){return e.split("-")[1]}function vu(e){return"x"===e?"y":"x"}function gu(e){return"y"===e?"height":"width"}const bu=new Set(["top","bottom"]);function xu(e){return bu.has(mu(e))?"y":"x"}function wu(e){return vu(xu(e))}function ju(e){return e.replace(/start|end/g,e=>fu[e])}const _u=["left","right"],ku=["right","left"],Ou=["top","bottom"],Su=["bottom","top"];function Nu(e,t,r,n){const a=yu(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ku:_u:t?_u:ku;case"left":case"right":return t?Ou:Su;default:return[]}}(mu(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(ju)))),o}function Eu(e){return e.replace(/left|right|bottom|top/g,e=>du[e])}function Pu(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Cu(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Ru(e,t,r){let{reference:n,floating:a}=e;const o=xu(t),i=wu(t),s=gu(i),l=mu(t),c="y"===o,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,f=n[s]/2-a[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-a.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-a.width,y:d};break;default:h={x:n.x,y:n.y}}switch(yu(t)){case"start":h[i]-=f*(r&&c?-1:1);break;case"end":h[i]+=f*(r&&c?-1:1)}return h}async function Au(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=pu(t,e),p=Pu(h),m=s[f?"floating"===d?"reference":"floating":d],y=Cu(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(m)))||r?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(g))&&await(null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},x=Cu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:g,strategy:l}):v);return{top:(y.top-x.top+p.top)/b.y,bottom:(x.bottom-y.bottom+p.bottom)/b.y,left:(y.left-x.left+p.left)/b.x,right:(x.right-y.right+p.right)/b.x}}function Tu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Du(e){return ou.some(t=>e[t]>=0)}const Fu=new Set(["left","top"]);function Iu(){return"undefined"!=typeof window}function Mu(e){return Vu(e)?(e.nodeName||"").toLowerCase():"#document"}function Lu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $u(e){var t;return null==(t=(Vu(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Vu(e){return!!Iu()&&(e instanceof Node||e instanceof Lu(e).Node)}function zu(e){return!!Iu()&&(e instanceof Element||e instanceof Lu(e).Element)}function Uu(e){return!!Iu()&&(e instanceof HTMLElement||e instanceof Lu(e).HTMLElement)}function qu(e){return!(!Iu()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Lu(e).ShadowRoot)}const Wu=new Set(["inline","contents"]);function Zu(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=nd(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Wu.has(a)}const Bu=new Set(["table","td","th"]);function Hu(e){return Bu.has(Mu(e))}const Ku=[":popover-open",":modal"];function Qu(e){return Ku.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Gu=["transform","translate","scale","rotate","perspective"],Ju=["transform","translate","scale","rotate","perspective","filter"],Yu=["paint","layout","strict","content"];function Xu(e){const t=ed(),r=zu(e)?nd(e):e;return Gu.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Ju.some(e=>(r.willChange||"").includes(e))||Yu.some(e=>(r.contain||"").includes(e))}function ed(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const td=new Set(["html","body","#document"]);function rd(e){return td.has(Mu(e))}function nd(e){return Lu(e).getComputedStyle(e)}function ad(e){return zu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function od(e){if("html"===Mu(e))return e;const t=e.assignedSlot||e.parentNode||qu(e)&&e.host||$u(e);return qu(t)?t.host:t}function id(e){const t=od(e);return rd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uu(t)&&Zu(t)?t:id(t)}function sd(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=id(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),i=Lu(a);if(o){const e=ld(i);return t.concat(i,i.visualViewport||[],Zu(a)?a:[],e&&r?sd(e):[])}return t.concat(a,sd(a,[],r))}function ld(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cd(e){const t=nd(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Uu(e),o=a?e.offsetWidth:r,i=a?e.offsetHeight:n,s=lu(r)!==o||lu(n)!==i;return s&&(r=o,n=i),{width:r,height:n,$:s}}function ud(e){return zu(e)?e:e.contextElement}function dd(e){const t=ud(e);if(!Uu(t))return uu(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=cd(t);let i=(o?lu(r.width):r.width)/n,s=(o?lu(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const fd=uu(0);function hd(e){const t=Lu(e);return ed()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fd}function pd(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=ud(e);let i=uu(1);t&&(n?zu(n)&&(i=dd(n)):i=dd(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Lu(e))&&t}(o,r,n)?hd(o):uu(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=Lu(o),t=n&&zu(n)?Lu(n):n;let r=e,a=ld(r);for(;a&&n&&t!==r;){const e=dd(a),t=a.getBoundingClientRect(),n=nd(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,r=Lu(a),a=ld(r)}}return Cu({width:u,height:d,x:l,y:c})}function md(e,t){const r=ad(e).scrollLeft;return t?t.left+r:pd($u(e)).left+r}function yd(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:md(e,n)),y:n.top+t.scrollTop}}const vd=new Set(["absolute","fixed"]);function gd(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=Lu(e),n=$u(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=ed();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=$u(e),r=ad(e),n=e.ownerDocument.body,a=su(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=su(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+md(e);const s=-r.scrollTop;return"rtl"===nd(n).direction&&(i+=su(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:i,y:s}}($u(e));else if(zu(t))n=function(e,t){const r=pd(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=Uu(e)?dd(e):uu(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}(t,r);else{const r=hd(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Cu(n)}function bd(e,t){const r=od(e);return!(r===t||!zu(r)||rd(r))&&("fixed"===nd(r).position||bd(r,t))}function xd(e,t,r){const n=Uu(t),a=$u(t),o="fixed"===r,i=pd(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=uu(0);function c(){l.x=md(a)}if(n||!n&&!o)if(("body"!==Mu(t)||Zu(a))&&(s=ad(t)),n){const e=pd(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!n&&a&&c();const u=!a||n||o?uu(0):yd(a,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function wd(e){return"static"===nd(e).position}function jd(e,t){if(!Uu(e)||"fixed"===nd(e).position)return null;if(t)return t(e);let r=e.offsetParent;return $u(e)===r&&(r=r.ownerDocument.body),r}function _d(e,t){const r=Lu(e);if(Qu(e))return r;if(!Uu(e)){let t=od(e);for(;t&&!rd(t);){if(zu(t)&&!wd(t))return t;t=od(t)}return r}let n=jd(e,t);for(;n&&Hu(n)&&wd(n);)n=jd(n,t);return n&&rd(n)&&wd(n)&&!Xu(n)?r:n||function(e){let t=od(e);for(;Uu(t)&&!rd(t);){if(Xu(t))return t;if(Qu(t))return null;t=od(t)}return null}(e)||r}const kd={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,i=$u(n),s=!!t&&Qu(t.floating);if(n===i||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=uu(1);const u=uu(0),d=Uu(n);if((d||!d&&!o)&&(("body"!==Mu(n)||Zu(i))&&(l=ad(n)),Uu(n))){const e=pd(n);c=dd(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!i||d||o?uu(0):yd(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:$u,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[..."clippingAncestors"===r?Qu(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=sd(e,[],!1).filter(e=>zu(e)&&"body"!==Mu(e)),a=null;const o="fixed"===nd(e).position;let i=o?od(e):e;for(;zu(i)&&!rd(i);){const t=nd(i),r=Xu(i);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&vd.has(a.position)||Zu(i)&&!r&&bd(e,i))?n=n.filter(e=>e!==i):a=t,i=od(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=o[0],s=o.reduce((e,r)=>{const n=gd(t,r,a);return e.top=su(n.top,e.top),e.right=iu(n.right,e.right),e.bottom=iu(n.bottom,e.bottom),e.left=su(n.left,e.left),e},gd(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:_d,getElementRects:async function(e){const t=this.getOffsetParent||_d,r=this.getDimensions,n=await r(e.floating);return{reference:xd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=cd(e);return{width:t,height:r}},getScale:dd,isElement:zu,isRTL:function(e){return"rtl"===nd(e).direction}};function Od(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sd(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=ud(e),u=a||o?[...c?sd(c):[],...sd(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const a=$u(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(s||t(),!f||!h)return;const p={rootMargin:-cu(d)+"px "+-cu(a.clientWidth-(u+f))+"px "+-cu(a.clientHeight-(d+h))+"px "+-cu(u)+"px",threshold:su(0,iu(1,l))||1};let m=!0;function y(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Od(c,e.getBoundingClientRect())||i(),m=!1}try{n=new IntersectionObserver(y,{...p,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(y,p)}n.observe(e)}(!0),o}(c,r):null;let f,h=-1,p=null;i&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let m=l?pd(e):null;return l&&function t(){const n=pd(e);m&&!Od(m,n)&&r();m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Nd=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=mu(r),s=yu(r),l="y"===xu(r),c=Fu.has(i)?-1:1,u=o&&l?-1:1,d=pu(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},Ed=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=pu(e,t),c={x:r,y:n},u=await Au(t,l),d=xu(mu(a)),f=vu(d);let h=c[f],p=c[d];if(o){const e="y"===f?"bottom":"right";h=hu(h+u["y"===f?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";p=hu(p+u["y"===d?"top":"left"],p,p-u[e])}const m=s.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:o,[d]:i}}}}}},Pd=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=pu(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=mu(a),g=xu(s),b=mu(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[Eu(s)]:function(e){const t=Eu(e);return[ju(e),t,ju(t)]}(s)),j="none"!==p;!f&&j&&w.push(...Nu(s,m,p,x));const _=[s,...w],k=await Au(t,y),O=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&O.push(k[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=yu(e),a=wu(e),o=gu(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Eu(i)),[i,Eu(i)]}(a,i,x);O.push(k[e[0]],k[e[1]])}if(S=[...S,{placement:a,overflows:O}],!O.every(e=>e<=0)){var N,E;const e=((null==(N=o.flip)?void 0:N.index)||0)+1,t=_[e];if(t){if(!("alignment"===d&&g!==xu(t))||S.every(e=>e.overflows[0]>0&&xu(e.placement)===g))return{data:{index:e,overflows:S},reset:{placement:t}}}let r=null==(E=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:E.placement;if(!r)switch(h){case"bestFit":{var P;const e=null==(P=S.filter(e=>{if(j){const t=xu(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=s}if(a!==r)return{reset:{placement:r}}}return{}}}},Cd=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=pu(e,t),u=await Au(t,c),d=mu(a),f=yu(a),h="y"===xu(a),{width:p,height:m}=o.floating;let y,v;"top"===d||"bottom"===d?(y=d,v=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,y="end"===f?"top":"bottom");const g=m-u.top-u.bottom,b=p-u.left-u.right,x=iu(m-u[y],g),w=iu(p-u[v],b),j=!t.middlewareData.shift;let _=x,k=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(k=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(_=g),j&&!f){const e=su(u.left,0),t=su(u.right,0),r=su(u.top,0),n=su(u.bottom,0);h?k=p-2*(0!==e||0!==t?e+t:su(u.left,u.right)):_=m-2*(0!==r||0!==n?r+n:su(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:_});const O=await i.getDimensions(s.floating);return p!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}},Rd=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=pu(e,t);switch(n){case"referenceHidden":{const e=Tu(await Au(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Du(e)}}}case"escaped":{const e=Tu(await Au(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Du(e)}}}default:return{}}}}},Ad=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=pu(e,t)||{};if(null==c)return{};const d=Pu(u),f={x:r,y:n},h=wu(a),p=gu(h),m=await i.getDimensions(c),y="y"===h,v=y?"top":"left",g=y?"bottom":"right",b=y?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-f[h]-o.floating[p],w=f[h]-o.reference[h],j=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let _=j?j[b]:0;_&&await(null==i.isElement?void 0:i.isElement(j))||(_=s.floating[b]||o.floating[p]);const k=x/2-w/2,O=_/2-m[p]/2-1,S=iu(d[v],O),N=iu(d[g],O),E=S,P=_-m[p]-N,C=_/2-m[p]/2+k,R=hu(E,C,P),A=!l.arrow&&null!=yu(a)&&C!==R&&o.reference[p]/2-(C<E?S:N)-m[p]/2<0,T=A?C<E?C-E:C-P:0;return{[h]:f[h]+T,data:{[h]:R,centerOffset:C-R-T,...A&&{alignmentOffset:T}},reset:A}}}),Td=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=pu(e,t),u={x:r,y:n},d=xu(a),f=vu(d);let h=u[f],p=u[d];const m=pu(s,t),y="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+y.mainAxis,r=o.reference[f]+o.reference[e]-y.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var v,g;const e="y"===f?"width":"height",t=Fu.has(mu(a)),r=o.reference[d]-o.floating[e]+(t&&(null==(v=i.offset)?void 0:v[d])||0)+(t?0:y.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?y.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:h,[d]:p}}}},Dd=(e,t,r)=>{const n=new Map,a={platform:kd,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Ru(c,n,l),f=n,h={},p=0;for(let r=0;r<s.length;r++){const{name:o,fn:m}=s[r],{x:y,y:v,data:g,reset:b}=await m({x:u,y:d,initialPlacement:n,placement:f,strategy:a,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=v?v:d,h={...h,[o]:{...h[o],...g}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:d}=Ru(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:h}})(e,t,{...a,platform:o})};var Fd="undefined"!=typeof document?i.useLayoutEffect:function(){};function Id(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Id(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Id(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Md(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ld(e,t){const r=Md(e);return Math.round(t*r)/r}function $d(e){const t=i.useRef(e);return Fd(()=>{t.current=e}),t}const Vd=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?Ad({element:r.current,padding:n}).fn(t):{}:r?Ad({element:r,padding:n}).fn(t):{};var a}}),zd=(e,t)=>({...Nd(e),options:[e,t]}),Ud=(e,t)=>({...Ed(e),options:[e,t]}),qd=(e,t)=>({...Td(e),options:[e,t]}),Wd=(e,t)=>({...Pd(e),options:[e,t]}),Zd=(e,t)=>({...Cd(e),options:[e,t]}),Bd=(e,t)=>({...Rd(e),options:[e,t]}),Hd=(e,t)=>({...Vd(e),options:[e,t]});var Kd=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...o}=e;return(0,an.jsx)(Pi.svg,{...o,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,an.jsx)("polygon",{points:"0,0 30,0 15,10"})})});Kd.displayName="Arrow";var Qd=Kd;function Gd(e){const[t,r]=i.useState(void 0);return ji(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var Jd="Popper",[Yd,Xd]=xi(Jd),[ef,tf]=Yd(Jd),rf=e=>{const{__scopePopper:t,children:r}=e,[n,a]=i.useState(null);return(0,an.jsx)(ef,{scope:t,anchor:n,onAnchorChange:a,children:r})};rf.displayName=Jd;var nf="PopperAnchor",af=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,o=tf(nf,r),s=i.useRef(null),l=Mo(t,s);return i.useEffect(()=>{o.onAnchorChange(n?.current||s.current)}),n?null:(0,an.jsx)(Pi.div,{...a,ref:l})});af.displayName=nf;var of="PopperContent",[sf,lf]=Yd(of),cf=i.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...y}=e,v=tf(of,r),[g,b]=i.useState(null),x=Mo(t,e=>b(e)),[w,j]=i.useState(null),_=Gd(w),k=_?.width??0,O=_?.height??0,S=n+("center"!==o?"-"+o:""),N="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},E=Array.isArray(u)?u:[u],P=E.length>0,C={padding:N,boundary:E.filter(hf),altBoundary:P},{refs:R,floatingStyles:A,placement:T,isPositioned:D,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=i.useState(n);Id(h,n)||p(n);const[m,y]=i.useState(null),[v,g]=i.useState(null),b=i.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=i.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),w=o||m,j=s||v,_=i.useRef(null),k=i.useRef(null),O=i.useRef(d),S=null!=c,N=$d(c),E=$d(a),P=$d(u),C=i.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:r,middleware:h};E.current&&(e.platform=E.current),Dd(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!Id(O.current,t)&&(O.current=t,Ei.flushSync(()=>{f(t)}))})},[h,t,r,E,P]);Fd(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=i.useRef(!1);Fd(()=>(R.current=!0,()=>{R.current=!1}),[]),Fd(()=>{if(w&&(_.current=w),j&&(k.current=j),w&&j){if(N.current)return N.current(w,j,C);C()}},[w,j,C,N,S]);const A=i.useMemo(()=>({reference:_,floating:k,setReference:b,setFloating:x}),[b,x]),T=i.useMemo(()=>({reference:w,floating:j}),[w,j]),D=i.useMemo(()=>{const e={position:r,left:0,top:0};if(!T.floating)return e;const t=Ld(T.floating,d.x),n=Ld(T.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Md(T.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,T.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:C,refs:A,elements:T,floatingStyles:D}),[d,C,A,T,D])}({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>Sd(...e,{animationFrame:"always"===p}),elements:{reference:v.anchor},middleware:[zd({mainAxis:a+O,alignmentAxis:s}),c&&Ud({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?qd():void 0,...C}),c&&Wd({...C}),Zd({...C,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),w&&Hd({element:w,padding:l}),pf({arrowWidth:k,arrowHeight:O}),h&&Bd({strategy:"referenceHidden",...C})]}),[I,M]=mf(T),L=Ci(m);ji(()=>{D&&L?.()},[D,L]);const $=F.arrow?.x,V=F.arrow?.y,z=0!==F.arrow?.centerOffset,[U,q]=i.useState();return ji(()=>{g&&q(window.getComputedStyle(g).zIndex)},[g]),(0,an.jsx)("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:D?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,an.jsx)(sf,{scope:r,placedSide:I,onArrowChange:j,arrowX:$,arrowY:V,shouldHideArrow:z,children:(0,an.jsx)(Pi.div,{"data-side":I,"data-align":M,...y,ref:x,style:{...y.style,animation:D?void 0:"none"}})})})});cf.displayName=of;var uf="PopperArrow",df={top:"bottom",right:"left",bottom:"top",left:"right"},ff=i.forwardRef(function(e,t){const{__scopePopper:r,...n}=e,a=lf(uf,r),o=df[a.placedSide];return(0,an.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,an.jsx)(Qd,{...n,ref:t,style:{...n.style,display:"block"}})})});function hf(e){return null!==e}ff.displayName=uf;var pf=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,i=o?0:e.arrowWidth,s=o?0:e.arrowHeight,[l,c]=mf(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+s/2;let h="",p="";return"bottom"===l?(h=o?u:`${d}px`,p=-s+"px"):"top"===l?(h=o?u:`${d}px`,p=`${n.floating.height+s}px`):"right"===l?(h=-s+"px",p=o?u:`${f}px`):"left"===l&&(h=`${n.floating.width+s}px`,p=o?u:`${f}px`),{data:{x:h,y:p}}}});function mf(e){const[t,r="center"]=e.split("-");return[t,r]}var yf=rf,vf=af,gf=cf,bf=ff,xf="Popover",[wf,jf]=xi(xf,[Xd]),_f=Xd(),[kf,Of]=wf(xf),Sf=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,l=_f(t),c=i.useRef(null),[u,d]=i.useState(!1),[f,h]=Ni({prop:n,defaultProp:a??!1,onChange:o,caller:xf});return(0,an.jsx)(yf,{...l,children:(0,an.jsx)(kf,{scope:t,contentId:Oi(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:i.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:s,children:r})})};Sf.displayName=xf;var Nf="PopoverAnchor",Ef=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Of(Nf,r),o=_f(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return i.useEffect(()=>(s(),()=>l()),[s,l]),(0,an.jsx)(vf,{...o,...n,ref:t})});Ef.displayName=Nf;var Pf="PopoverTrigger",Cf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Of(Pf,r),o=_f(r),i=Mo(t,a.triggerRef),s=(0,an.jsx)(Pi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Wf(a.open),...n,ref:i,onClick:bi(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:(0,an.jsx)(vf,{asChild:!0,...o,children:s})});Cf.displayName=Pf;var Rf="PopoverPortal",[Af,Tf]=wf(Rf,{forceMount:void 0}),Df=e=>{const{__scopePopover:t,forceMount:r,children:n,container:a}=e,o=Of(Rf,t);return(0,an.jsx)(Af,{scope:t,forceMount:r,children:(0,an.jsx)(Ji,{present:r||o.open,children:(0,an.jsx)(Gi,{asChild:!0,container:a,children:n})})})};Df.displayName=Rf;var Ff="PopoverContent",If=i.forwardRef((e,t)=>{const r=Tf(Ff,e.__scopePopover),{forceMount:n=r.forceMount,...a}=e,o=Of(Ff,e.__scopePopover);return(0,an.jsx)(Ji,{present:n||o.open,children:o.modal?(0,an.jsx)(Lf,{...a,ref:t}):(0,an.jsx)($f,{...a,ref:t})})});If.displayName=Ff;var Mf=Lo("PopoverContent.RemoveScroll"),Lf=i.forwardRef((e,t)=>{const r=Of(Ff,e.__scopePopover),n=i.useRef(null),a=Mo(t,n),o=i.useRef(!1);return i.useEffect(()=>{const e=n.current;if(e)return el(e)},[]),(0,an.jsx)(Bs,{as:Mf,allowPinchZoom:!0,children:(0,an.jsx)(Vf,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bi(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:bi(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:bi(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),$f=i.forwardRef((e,t)=>{const r=Of(Ff,e.__scopePopover),n=i.useRef(!1),a=i.useRef(!1);return(0,an.jsx)(Vf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const o=t.target,i=r.triggerRef.current?.contains(o);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Vf=i.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=Of(Ff,r),h=_f(r);return es(),(0,an.jsx)(qi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,an.jsx)(Ii,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,an.jsx)(gf,{"data-state":Wf(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),zf="PopoverClose",Uf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Of(zf,r);return(0,an.jsx)(Pi.button,{type:"button",...n,ref:t,onClick:bi(e.onClick,()=>a.onOpenChange(!1))})});Uf.displayName=zf;var qf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=_f(r);return(0,an.jsx)(bf,{...a,...n,ref:t})});function Wf(e){return e?"open":"closed"}qf.displayName="PopoverArrow";var Zf=Df,Bf=If;function Hf(e){return Hf="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},Hf(e)}var Kf=["className","align","sideOffset"];function Qf(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 Gf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qf(Object(r),!0).forEach(function(t){Jf(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qf(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Jf(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Hf(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Hf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Hf(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Yf=Sf,Xf=Cf,eh=i.forwardRef(function(e,t){var r=e.className,n=e.align,a=void 0===n?"center":n,o=e.sideOffset,i=void 0===o?4:o,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,Kf);return(0,an.jsx)(Zf,{children:(0,an.jsx)(Bf,Gf({ref:t,align:a,sideOffset:i,className:ga("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",r)},s))})});function th(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return rh(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(rh(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,rh(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,rh(d,"constructor",c),rh(c,"constructor",l),l.displayName="GeneratorFunction",rh(c,a,"GeneratorFunction"),rh(d),rh(d,a,"Generator"),rh(d,n,function(){return this}),rh(d,"toString",function(){return"[object Generator]"}),(th=function(){return{w:o,m:f}})()}function rh(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}rh=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){rh(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},rh(e,t,r,n)}function nh(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function ah(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){nh(o,n,a,i,s,"next",e)}function s(e){nh(o,n,a,i,s,"throw",e)}i(void 0)})}}eh.displayName=Bf.displayName;function oh(e){return function(e){if(Array.isArray(e))return lh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||sh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ih(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||sh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sh(e,t){if(e){if("string"==typeof e)return lh(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)?lh(e,t):void 0}}function lh(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 ch(e){var t,r=e.selectedPlugin,n=e.onChange,a=ih((0,i.useState)([]),2),o=a[0],s=a[1],l=ih((0,i.useState)(!1),2),c=l[0],u=l[1],d=Qa({queryKey:["getPluginList"],queryFn:(t=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_plugin_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),staleTime:5e3}),f=d.data;(0,i.useEffect)(function(){f&&s(f.data)},[f]);var h=o.filter(function(e){return r.includes(e.slug)}),p=o.filter(function(e){return!r.includes(e.slug)});return(0,an.jsx)("div",{children:(0,an.jsxs)(Yf,{open:c,onOpenChange:u,children:[(0,an.jsx)(Xf,{asChild:!0,children:(0,an.jsxs)(Jo,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between min-h-[2.5rem] h-auto p-2 bg-transparent",children:[(0,an.jsxs)("div",{className:"flex flex-wrap gap-1 flex-1",children:[h.map(function(e){return(0,an.jsxs)(ui,{variant:"default",className:"mr-1 mb-1",children:[e.label,(0,an.jsx)(Jo,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:function(t){var a;t.preventDefault(),t.stopPropagation(),a=e.slug,n(r.filter(function(e){return e!==a}))},children:(0,an.jsx)(ri,{className:"h-3 w-3"})})]},e.slug)}),0===h.length&&(0,an.jsx)("span",{className:"text-muted-foreground",children:(0,vo.__)("Select plugins you like...","versatile-toolkit")})]}),(0,an.jsx)(ni,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),(0,an.jsx)(eh,{className:"w-full p-0",align:"start",children:(0,an.jsxs)(Xc,{children:[(0,an.jsx)(eu,{placeholder:"Search plugin..."}),(0,an.jsxs)(tu,{children:[(0,an.jsx)(ru,{children:"No plugin found."}),(0,an.jsx)(nu,{children:[].concat(oh(p),oh(h)).map(function(e){return(0,an.jsxs)(au,{value:e.label,onSelect:function(){return t=e.slug,void(r.includes(t)?n(r.filter(function(e){return e!==t})):n([].concat(oh(r),[t])));var t},children:[(0,an.jsx)(ai,{className:ga("mr-2 h-4 w-4",r.includes(e.slug)?"opacity-100":"opacity-0")}),e.label]},e.slug)})})]})]})})]})})}function uh(e){return uh="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},uh(e)}var dh=["className","type"];function fh(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 hh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=uh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uh(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ph,mh,yh=i.forwardRef(function(e,t){var r=e.className,n=e.type,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,dh);return(0,an.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(r),!0).forEach(function(t){hh(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fh(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({type:n,className:ga("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t},a))});yh.displayName="Input",function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(ph||(ph={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(mh||(mh={}));const vh=ph.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gh=e=>{switch(typeof e){case"undefined":return vh.undefined;case"string":return vh.string;case"number":return Number.isNaN(e)?vh.nan:vh.number;case"boolean":return vh.boolean;case"function":return vh.function;case"bigint":return vh.bigint;case"symbol":return vh.symbol;case"object":return Array.isArray(e)?vh.array:null===e?vh.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?vh.promise:"undefined"!=typeof Map&&e instanceof Map?vh.map:"undefined"!=typeof Set&&e instanceof Set?vh.set:"undefined"!=typeof Date&&e instanceof Date?vh.date:vh.object;default:return vh.unknown}},bh=ph.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xh extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof xh))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ph.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}xh.create=e=>new xh(e);const wh=(e,t)=>{let r;switch(e.code){case bh.invalid_type:r=e.received===vh.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case bh.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ph.jsonStringifyReplacer)}`;break;case bh.unrecognized_keys:r=`Unrecognized key(s) in object: ${ph.joinValues(e.keys,", ")}`;break;case bh.invalid_union:r="Invalid input";break;case bh.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ph.joinValues(e.options)}`;break;case bh.invalid_enum_value:r=`Invalid enum value. Expected ${ph.joinValues(e.options)}, received '${e.received}'`;break;case bh.invalid_arguments:r="Invalid function arguments";break;case bh.invalid_return_type:r="Invalid function return type";break;case bh.invalid_date:r="Invalid date";break;case bh.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ph.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case bh.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case bh.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case bh.custom:r="Invalid input";break;case bh.invalid_intersection_types:r="Intersection results could not be merged";break;case bh.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case bh.not_finite:r="Number must be finite";break;default:r=t.defaultError,ph.assertNever(e)}return{message:r}};let jh=wh;function _h(){return jh}var kh;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(kh||(kh={}));const Oh=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,o=[...r,...a.path||[]],i={...a,path:o};if(void 0!==a.message)return{...a,path:o,message:a.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...a,path:o,message:s}};function Sh(e,t){const r=_h(),n=Oh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wh?void 0:wh].filter(e=>!!e)});e.common.issues.push(n)}class Nh{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return Eh;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return Nh.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return Eh;if("aborted"===a.status)return Eh;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const Eh=Object.freeze({status:"aborted"}),Ph=e=>({status:"dirty",value:e}),Ch=e=>({status:"valid",value:e}),Rh=e=>"aborted"===e.status,Ah=e=>"dirty"===e.status,Th=e=>"valid"===e.status,Dh=e=>"undefined"!=typeof Promise&&e instanceof Promise;class Fh{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ih=(e,t)=>{if(Th(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new xh(e.common.issues);return this._error=t,this._error}}};function Mh(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{const{message:o}=e;return"invalid_enum_value"===t.code?{message:o??a.defaultError}:void 0===a.data?{message:o??n??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:o??r??a.defaultError}},description:a}}class Lh{get description(){return this._def.description}_getType(e){return gh(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:gh(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Nh,ctx:{common:e.parent.common,data:e.data,parsedType:gh(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Dh(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gh(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Ih(r,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gh(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return Th(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Th(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gh(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Dh(n)?n:Promise.resolve(n));return Ih(r,a)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const a=e(t),o=()=>n.addIssue({code:bh.custom,...r(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(o(),!1)):!!a||(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new Mp({schema:this,typeName:Bp.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Lp.create(this,this._def)}nullable(){return $p.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jp.create(this)}promise(){return Ip.create(this,this._def)}or(e){return Op.create([this,e],this._def)}and(e){return Np.create(this,e,this._def)}transform(e){return new Mp({...Mh(this._def),schema:this,typeName:Bp.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Vp({...Mh(this._def),innerType:this,defaultValue:t,typeName:Bp.ZodDefault})}brand(){return new qp({typeName:Bp.ZodBranded,type:this,...Mh(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new zp({...Mh(this._def),innerType:this,catchValue:t,typeName:Bp.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Wp.create(this,e)}readonly(){return Zp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $h=/^c[^\s-]{8,}$/i,Vh=/^[0-9a-z]+$/,zh=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Uh=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qh=/^[a-z0-9_-]{21}$/i,Wh=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Zh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Bh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Hh;const Kh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Gh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yh=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xh=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ep="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",tp=new RegExp(`^${ep}$`);function rp(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function np(e){return new RegExp(`^${rp(e)}$`)}function ap(e){let t=`${ep}T${rp(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function op(e,t){return!("v4"!==t&&t||!Kh.test(e))||!("v6"!==t&&t||!Gh.test(e))}function ip(e,t){if(!Wh.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return"object"==typeof a&&null!==a&&((!("typ"in a)||"JWT"===a?.typ)&&(!!a.alg&&(!t||a.alg===t)))}catch{return!1}}function sp(e,t){return!("v4"!==t&&t||!Qh.test(e))||!("v6"!==t&&t||!Jh.test(e))}class lp extends Lh{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==vh.string){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.string,received:t.parsedType}),Eh}const t=new Nh;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(r=this._getOrReturnCtx(e,r),a?Sh(r,{code:bh.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&Sh(r,{code:bh.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)Bh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"email",code:bh.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)Hh||(Hh=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Hh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"emoji",code:bh.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)Uh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"uuid",code:bh.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)qh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"nanoid",code:bh.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)$h.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"cuid",code:bh.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)Vh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"cuid2",code:bh.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)zh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"ulid",code:bh.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Sh(r,{validation:"url",code:bh.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"regex",code:bh.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){ap(n).test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){tp.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){np(n).test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?Zh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"duration",code:bh.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?op(e.data,n.version)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"ip",code:bh.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?ip(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"jwt",code:bh.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?sp(e.data,n.version)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"cidr",code:bh.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?Yh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"base64",code:bh.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?Xh.test(e.data)||(r=this._getOrReturnCtx(e,r),Sh(r,{validation:"base64url",code:bh.invalid_string,message:n.message}),t.dirty()):ph.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:bh.invalid_string,...kh.errToObj(r)})}_addCheck(e){return new lp({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...kh.errToObj(e)})}url(e){return this._addCheck({kind:"url",...kh.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...kh.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...kh.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...kh.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...kh.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...kh.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...kh.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...kh.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...kh.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...kh.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...kh.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...kh.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...kh.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...kh.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...kh.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...kh.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...kh.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...kh.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...kh.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...kh.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...kh.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...kh.errToObj(t)})}nonempty(e){return this.min(1,kh.errToObj(e))}trim(){return new lp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lp({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function cp(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}lp.create=e=>new lp({checks:[],typeName:Bp.ZodString,coerce:e?.coerce??!1,...Mh(e)});class up extends Lh{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==vh.number){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.number,received:t.parsedType}),Eh}let t;const r=new Nh;for(const n of this._def.checks)if("int"===n.kind)ph.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==cp(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.not_finite,message:n.message}),r.dirty()):ph.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,kh.toString(t))}gt(e,t){return this.setLimit("min",e,!1,kh.toString(t))}lte(e,t){return this.setLimit("max",e,!0,kh.toString(t))}lt(e,t){return this.setLimit("max",e,!1,kh.toString(t))}setLimit(e,t,r,n){return new up({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:kh.toString(n)}]})}_addCheck(e){return new up({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:kh.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:kh.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:kh.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:kh.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:kh.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:kh.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:kh.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:kh.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:kh.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&ph.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}up.create=e=>new up({checks:[],typeName:Bp.ZodNumber,coerce:e?.coerce||!1,...Mh(e)});class dp extends Lh{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==vh.bigint)return this._getInvalidInput(e);let t;const r=new Nh;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Sh(t,{code:bh.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):ph.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.bigint,received:t.parsedType}),Eh}gte(e,t){return this.setLimit("min",e,!0,kh.toString(t))}gt(e,t){return this.setLimit("min",e,!1,kh.toString(t))}lte(e,t){return this.setLimit("max",e,!0,kh.toString(t))}lt(e,t){return this.setLimit("max",e,!1,kh.toString(t))}setLimit(e,t,r,n){return new dp({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:kh.toString(n)}]})}_addCheck(e){return new dp({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:kh.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:kh.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:kh.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:kh.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:kh.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}dp.create=e=>new dp({checks:[],typeName:Bp.ZodBigInt,coerce:e?.coerce??!1,...Mh(e)});class fp extends Lh{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==vh.boolean){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.boolean,received:t.parsedType}),Eh}return Ch(e.data)}}fp.create=e=>new fp({typeName:Bp.ZodBoolean,coerce:e?.coerce||!1,...Mh(e)});class hp extends Lh{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==vh.date){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.date,received:t.parsedType}),Eh}if(Number.isNaN(e.data.getTime())){return Sh(this._getOrReturnCtx(e),{code:bh.invalid_date}),Eh}const t=new Nh;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),Sh(r,{code:bh.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):ph.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new hp({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:kh.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:kh.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}hp.create=e=>new hp({checks:[],coerce:e?.coerce||!1,typeName:Bp.ZodDate,...Mh(e)});class pp extends Lh{_parse(e){if(this._getType(e)!==vh.symbol){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.symbol,received:t.parsedType}),Eh}return Ch(e.data)}}pp.create=e=>new pp({typeName:Bp.ZodSymbol,...Mh(e)});class mp extends Lh{_parse(e){if(this._getType(e)!==vh.undefined){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.undefined,received:t.parsedType}),Eh}return Ch(e.data)}}mp.create=e=>new mp({typeName:Bp.ZodUndefined,...Mh(e)});class yp extends Lh{_parse(e){if(this._getType(e)!==vh.null){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.null,received:t.parsedType}),Eh}return Ch(e.data)}}yp.create=e=>new yp({typeName:Bp.ZodNull,...Mh(e)});class vp extends Lh{constructor(){super(...arguments),this._any=!0}_parse(e){return Ch(e.data)}}vp.create=e=>new vp({typeName:Bp.ZodAny,...Mh(e)});class gp extends Lh{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ch(e.data)}}gp.create=e=>new gp({typeName:Bp.ZodUnknown,...Mh(e)});class bp extends Lh{_parse(e){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.never,received:t.parsedType}),Eh}}bp.create=e=>new bp({typeName:Bp.ZodNever,...Mh(e)});class xp extends Lh{_parse(e){if(this._getType(e)!==vh.undefined){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.void,received:t.parsedType}),Eh}return Ch(e.data)}}xp.create=e=>new xp({typeName:Bp.ZodVoid,...Mh(e)});class jp extends Lh{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==vh.array)return Sh(t,{code:bh.invalid_type,expected:vh.array,received:t.parsedType}),Eh;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(Sh(t,{code:e?bh.too_big:bh.too_small,minimum:a?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(Sh(t,{code:bh.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(Sh(t,{code:bh.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new Fh(t,e,t.path,r)))).then(e=>Nh.mergeArray(r,e));const a=[...t.data].map((e,r)=>n.type._parseSync(new Fh(t,e,t.path,r)));return Nh.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new jp({...this._def,minLength:{value:e,message:kh.toString(t)}})}max(e,t){return new jp({...this._def,maxLength:{value:e,message:kh.toString(t)}})}length(e,t){return new jp({...this._def,exactLength:{value:e,message:kh.toString(t)}})}nonempty(e){return this.min(1,e)}}function _p(e){if(e instanceof kp){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Lp.create(_p(n))}return new kp({...e._def,shape:()=>t})}return e instanceof jp?new jp({...e._def,type:_p(e.element)}):e instanceof Lp?Lp.create(_p(e.unwrap())):e instanceof $p?$p.create(_p(e.unwrap())):e instanceof Ep?Ep.create(e.items.map(e=>_p(e))):e}jp.create=(e,t)=>new jp({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Bp.ZodArray,...Mh(t)});class kp extends Lh{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=ph.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==vh.object){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.object,received:t.parsedType}),Eh}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof bp&&"strip"===this._def.unknownKeys))for(const e in r.data)a.includes(e)||o.push(e);const i=[];for(const e of a){const t=n[e],a=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new Fh(r,a,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof bp){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&(Sh(r,{code:bh.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new Fh(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>Nh.mergeObjectSync(t,e)):Nh.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return kh.errToObj,new kp({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{const n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:kh.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new kp({...this._def,unknownKeys:"strip"})}passthrough(){return new kp({...this._def,unknownKeys:"passthrough"})}extend(e){return new kp({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new kp({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Bp.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new kp({...this._def,catchall:e})}pick(e){const t={};for(const r of ph.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new kp({...this._def,shape:()=>t})}omit(e){const t={};for(const r of ph.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new kp({...this._def,shape:()=>t})}deepPartial(){return _p(this)}partial(e){const t={};for(const r of ph.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new kp({...this._def,shape:()=>t})}required(e){const t={};for(const r of ph.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Lp;)e=e._def.innerType;t[r]=e}return new kp({...this._def,shape:()=>t})}keyof(){return Tp(ph.objectKeys(this.shape))}}kp.create=(e,t)=>new kp({shape:()=>e,unknownKeys:"strip",catchall:bp.create(),typeName:Bp.ZodObject,...Mh(t)}),kp.strictCreate=(e,t)=>new kp({shape:()=>e,unknownKeys:"strict",catchall:bp.create(),typeName:Bp.ZodObject,...Mh(t)}),kp.lazycreate=(e,t)=>new kp({shape:e,unknownKeys:"strip",catchall:bp.create(),typeName:Bp.ZodObject,...Mh(t)});class Op extends Lh{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new xh(e.ctx.common.issues));return Sh(t,{code:bh.invalid_union,unionErrors:r}),Eh});{let e;const n=[];for(const a of r){const r={...t,common:{...t.common,issues:[]},parent:null},o=a._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map(e=>new xh(e));return Sh(t,{code:bh.invalid_union,unionErrors:a}),Eh}}get options(){return this._def.options}}Op.create=(e,t)=>new Op({options:e,typeName:Bp.ZodUnion,...Mh(t)});function Sp(e,t){const r=gh(e),n=gh(t);if(e===t)return{valid:!0,data:e};if(r===vh.object&&n===vh.object){const r=ph.objectKeys(t),n=ph.objectKeys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=Sp(e[r],t[r]);if(!n.valid)return{valid:!1};a[r]=n.data}return{valid:!0,data:a}}if(r===vh.array&&n===vh.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const a=Sp(e[n],t[n]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}return r===vh.date&&n===vh.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Np extends Lh{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(Rh(e)||Rh(n))return Eh;const a=Sp(e.value,n.value);return a.valid?((Ah(e)||Ah(n))&&t.dirty(),{status:t.value,value:a.data}):(Sh(r,{code:bh.invalid_intersection_types}),Eh)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Np.create=(e,t,r)=>new Np({left:e,right:t,typeName:Bp.ZodIntersection,...Mh(r)});class Ep extends Lh{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==vh.array)return Sh(r,{code:bh.invalid_type,expected:vh.array,received:r.parsedType}),Eh;if(r.data.length<this._def.items.length)return Sh(r,{code:bh.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Eh;!this._def.rest&&r.data.length>this._def.items.length&&(Sh(r,{code:bh.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new Fh(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>Nh.mergeArray(t,e)):Nh.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Ep({...this._def,rest:e})}}Ep.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ep({items:e,typeName:Bp.ZodTuple,rest:null,...Mh(t)})};class Pp extends Lh{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==vh.map)return Sh(r,{code:bh.invalid_type,expected:vh.map,received:r.parsedType}),Eh;const n=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([e,t],o)=>({key:n._parse(new Fh(r,e,r.path,[o,"key"])),value:a._parse(new Fh(r,t,r.path,[o,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of o){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return Eh;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of o){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return Eh;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}Pp.create=(e,t,r)=>new Pp({valueType:t,keyType:e,typeName:Bp.ZodMap,...Mh(r)});class Cp extends Lh{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==vh.set)return Sh(r,{code:bh.invalid_type,expected:vh.set,received:r.parsedType}),Eh;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(Sh(r,{code:bh.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(Sh(r,{code:bh.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function o(e){const r=new Set;for(const n of e){if("aborted"===n.status)return Eh;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>a._parse(new Fh(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>o(e)):o(i)}min(e,t){return new Cp({...this._def,minSize:{value:e,message:kh.toString(t)}})}max(e,t){return new Cp({...this._def,maxSize:{value:e,message:kh.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Cp.create=(e,t)=>new Cp({valueType:e,minSize:null,maxSize:null,typeName:Bp.ZodSet,...Mh(t)});class Rp extends Lh{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Rp.create=(e,t)=>new Rp({getter:e,typeName:Bp.ZodLazy,...Mh(t)});class Ap extends Lh{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Sh(t,{received:t.data,code:bh.invalid_literal,expected:this._def.value}),Eh}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Tp(e,t){return new Dp({values:e,typeName:Bp.ZodEnum,...Mh(t)})}Ap.create=(e,t)=>new Ap({value:e,typeName:Bp.ZodLiteral,...Mh(t)});class Dp extends Lh{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return Sh(t,{expected:ph.joinValues(r),received:t.parsedType,code:bh.invalid_type}),Eh}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return Sh(t,{received:t.data,code:bh.invalid_enum_value,options:r}),Eh}return Ch(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Dp.create(e,{...this._def,...t})}exclude(e,t=this._def){return Dp.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Dp.create=Tp;class Fp extends Lh{_parse(e){const t=ph.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==vh.string&&r.parsedType!==vh.number){const e=ph.objectValues(t);return Sh(r,{expected:ph.joinValues(e),received:r.parsedType,code:bh.invalid_type}),Eh}if(this._cache||(this._cache=new Set(ph.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=ph.objectValues(t);return Sh(r,{received:r.data,code:bh.invalid_enum_value,options:e}),Eh}return Ch(e.data)}get enum(){return this._def.values}}Fp.create=(e,t)=>new Fp({values:e,typeName:Bp.ZodNativeEnum,...Mh(t)});class Ip extends Lh{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==vh.promise&&!1===t.common.async)return Sh(t,{code:bh.invalid_type,expected:vh.promise,received:t.parsedType}),Eh;const r=t.parsedType===vh.promise?t.data:Promise.resolve(t.data);return Ch(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ip.create=(e,t)=>new Ip({type:e,typeName:Bp.ZodPromise,...Mh(t)});class Mp extends Lh{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Bp.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{Sh(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(r.data,a);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return Eh;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?Eh:"dirty"===n.status||"dirty"===t.value?Ph(n.value):n});{if("aborted"===t.value)return Eh;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?Eh:"dirty"===n.status||"dirty"===t.value?Ph(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?Eh:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?Eh:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Th(e))return Eh;const o=n.transform(e.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>Th(e)?Promise.resolve(n.transform(e.value,a)).then(e=>({status:t.value,value:e})):Eh)}ph.assertNever(n)}}Mp.create=(e,t,r)=>new Mp({schema:e,typeName:Bp.ZodEffects,effect:t,...Mh(r)}),Mp.createWithPreprocess=(e,t,r)=>new Mp({schema:t,effect:{type:"preprocess",transform:e},typeName:Bp.ZodEffects,...Mh(r)});class Lp extends Lh{_parse(e){return this._getType(e)===vh.undefined?Ch(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lp.create=(e,t)=>new Lp({innerType:e,typeName:Bp.ZodOptional,...Mh(t)});class $p extends Lh{_parse(e){return this._getType(e)===vh.null?Ch(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$p.create=(e,t)=>new $p({innerType:e,typeName:Bp.ZodNullable,...Mh(t)});class Vp extends Lh{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===vh.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vp.create=(e,t)=>new Vp({innerType:e,typeName:Bp.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Mh(t)});class zp extends Lh{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Dh(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new xh(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new xh(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}zp.create=(e,t)=>new zp({innerType:e,typeName:Bp.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Mh(t)});class Up extends Lh{_parse(e){if(this._getType(e)!==vh.nan){const t=this._getOrReturnCtx(e);return Sh(t,{code:bh.invalid_type,expected:vh.nan,received:t.parsedType}),Eh}return{status:"valid",value:e.data}}}Up.create=e=>new Up({typeName:Bp.ZodNaN,...Mh(e)});Symbol("zod_brand");class qp extends Lh{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Wp extends Lh{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Eh:"dirty"===e.status?(t.dirty(),Ph(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Eh:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Wp({in:e,out:t,typeName:Bp.ZodPipeline})}}class Zp extends Lh{_parse(e){const t=this._def.innerType._parse(e),r=e=>(Th(e)&&(e.value=Object.freeze(e.value)),e);return Dh(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}Zp.create=(e,t)=>new Zp({innerType:e,typeName:Bp.ZodReadonly,...Mh(t)});kp.lazycreate;var Bp;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Bp||(Bp={}));const Hp=lp.create,Kp=(up.create,Up.create,dp.create,fp.create),Qp=(hp.create,pp.create,mp.create,yp.create,vp.create,gp.create,bp.create,xp.create,jp.create),Gp=kp.create,Jp=(kp.strictCreate,Op.create,Np.create,Ep.create,Pp.create,Cp.create,Rp.create,Ap.create,Dp.create,Fp.create,Ip.create,Mp.create,Lp.create,$p.create,Mp.createWithPreprocess,Wp.create,e=>up.create({...e,coerce:!0}));var Yp=/^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/,Xp=Gp({chosen_plugins:Qp(Hp()),ip_tags:Qp(Hp().refine(function(e){return Yp.test(e)},{message:"Invalid IP address"})).min(1,{message:"At least one IP address is required"})}),em=Gp({enable_maintenance:Kp(),show_subscribers_only:Kp(),title:Hp().min(1,{message:"Title is required"}).min(3,{message:"Title must be at least 3 characters"}),description:Hp().min(1,{message:"Description is required"}).min(10,{message:"Description must be at least 10 characters"}),subtitle:Hp().min(1,{message:"Subtitle is required"}).min(3,{message:"Subtitle must be at least 3 characters"}),background_image:Hp().optional(),background_image_id:Jp().optional(),logo:Hp().optional(),logo_id:Jp().optional(),template:Hp().optional()}),tm=Gp({enable_comingsoon:Kp(),show_subscribers_only:Kp(),title:Hp().min(1,{message:"Title is required"}).min(3,{message:"Title must be at least 3 characters"}),description:Hp().min(1,{message:"Description is required"}).min(10,{message:"Description must be at least 10 characters"}),subtitle:Hp().min(1,{message:"Subtitle is required"}).min(3,{message:"Subtitle must be at least 3 characters"}),background_image:Hp().optional(),background_image_id:Jp().optional(),logo:Hp().optional(),logo_id:Jp().optional(),template:Hp().optional()}),rm=Gp({activeTheme:Hp().min(1,{message:"Please select a theme"})});function nm(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return am(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(am(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,am(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,am(d,"constructor",c),am(c,"constructor",l),l.displayName="GeneratorFunction",am(c,a,"GeneratorFunction"),am(d),am(d,a,"Generator"),am(d,n,function(){return this}),am(d,"toString",function(){return"[object Generator]"}),(nm=function(){return{w:o,m:f}})()}function am(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}am=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){am(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},am(e,t,r,n)}function om(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function im(e){return function(e){if(Array.isArray(e))return cm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||lm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||lm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lm(e,t){if(e){if("string"==typeof e)return cm(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)?cm(e,t):void 0}}function cm(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 um(e){var t,r=e.tags,n=e.onChange,a=sm((0,i.useState)(""),2),o=a[0],s=a[1],l=sm((0,i.useState)(null),2),c=l[0],u=l[1],d=function(){var e=o.trim();e&&(Yp.test(e)?r.includes(e)||(n([].concat(im(r),[e])),s(""),u(null)):u("Invalid IP address"))},f=Ja({mutationFn:(t=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_add_my_ip",e.n=1,mo(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),onSuccess:function(e){},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed to add IP","versatile-toolkit"))}}),h=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){om(o,n,a,i,s,"next",e)}function s(e){om(o,n,a,i,s,"throw",e)}i(void 0)})}}(nm().m(function e(){var t,a,o;return nm().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.mutateAsync({});case 1:if(t=e.v,a=t.data,o=null==a?void 0:a.ip,!r.includes(o)){e.n=2;break}return pr.success((0,vo.__)("System Ip already added!","trigger")),e.a(2);case 2:!r.includes(o)&&o&&(n([].concat(im(r),[o])),pr.success((0,vo.__)("System Ip address added","trigger")));case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return(0,an.jsxs)("div",{children:[(0,an.jsxs)("div",{className:"relative",children:[(0,an.jsx)(yh,{type:"text",placeholder:"Type a tag and press Enter or click outside...",value:o,onChange:function(e){s(e.target.value),c&&u(null)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),d())},onBlur:function(e){d()}}),(0,an.jsx)(Jo,{type:"button",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 px-2 py-1 h-5",onClick:h,children:(0,vo.__)("Add My IP","versatile-toolkit")})]}),c&&(0,an.jsx)("p",{className:"text-red-500 text-sm mt-1",children:c}),(0,an.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:r.map(function(e){return(0,an.jsxs)(ui,{variant:"default",className:"flex items-center gap-1",children:[e,(0,an.jsx)(Jo,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:function(){return t=e,void n(r.filter(function(e){return e!==t}));var t},children:(0,an.jsx)(ri,{className:"h-3 w-3"})})]},e)})})]})}function dm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fm(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)?fm(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fm(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 hm(e){var t,r=e.selectedTheme,n=e.onChange,a=dm((0,i.useState)([]),2),o=a[0],s=a[1],l=dm((0,i.useState)(!1),2),c=l[0],u=l[1],d=Qa({queryKey:["getThemeList"],queryFn:(t=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_theme_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),staleTime:5e3}),f=d.data;(0,i.useEffect)(function(){f&&s(f.data)},[f]);var h=o.find(function(e){return e.slug===r});return(0,an.jsx)("div",{children:(0,an.jsxs)(Yf,{open:c,onOpenChange:u,children:[(0,an.jsx)(Xf,{asChild:!0,children:(0,an.jsxs)(Jo,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between min-h-[2.5rem] h-auto p-3 bg-transparent",children:[(0,an.jsx)("div",{className:"flex flex-wrap gap-1 flex-1 text-left",children:h?(0,an.jsx)("span",{className:"font-medium",children:h.label}):(0,an.jsx)("span",{className:"text-muted-foreground",children:(0,vo.__)("Select a theme...","versatile-toolkit")})}),(0,an.jsx)(ni,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),(0,an.jsx)(eh,{className:"w-full p-0",align:"start",children:(0,an.jsxs)(Xc,{children:[(0,an.jsx)(eu,{placeholder:"Search theme..."}),(0,an.jsxs)(tu,{children:[(0,an.jsx)(ru,{children:"No theme found."}),(0,an.jsx)(nu,{children:o.map(function(e){return(0,an.jsxs)(au,{value:e.label,onSelect:function(){return t=e.slug,n(t),void u(!1);var t},children:[(0,an.jsx)(ai,{className:ga("mr-2 h-4 w-4",r===e.slug?"opacity-100":"opacity-0")}),e.label]},e.slug)})})]})]})})]})})}var pm=e=>"checkbox"===e.type,mm=e=>e instanceof Date,ym=e=>null==e;const vm=e=>"object"==typeof e;var gm=e=>!ym(e)&&!Array.isArray(e)&&vm(e)&&!mm(e),bm=e=>gm(e)&&e.target?pm(e.target)?e.target.checked:e.target.value:e,xm=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),wm="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function jm(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(wm&&(e instanceof Blob||n)||!r&&!gm(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return gm(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=jm(e[r]));else t=e}return t}var _m=e=>/^\w*$/.test(e),km=e=>void 0===e,Om=e=>Array.isArray(e)?e.filter(Boolean):[],Sm=e=>Om(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Nm=(e,t,r)=>{if(!t||!gm(e))return r;const n=(_m(t)?[t]:Sm(t)).reduce((e,t)=>ym(e)?e:e[t],e);return km(n)||n===e?km(e[t])?r:e[t]:n},Em=e=>"boolean"==typeof e,Pm=(e,t,r)=>{let n=-1;const a=_m(t)?[t]:Sm(t),o=a.length,i=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==i){const r=e[t];o=gm(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const Cm="blur",Rm="focusout",Am="change",Tm="onBlur",Dm="onChange",Fm="onSubmit",Im="onTouched",Mm="all",Lm="max",$m="min",Vm="maxLength",zm="minLength",Um="pattern",qm="required",Wm="validate",Zm=i.createContext(null);Zm.displayName="HookFormContext";const Bm=()=>i.useContext(Zm);var Hm=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Mm&&(t._proxyFormState[a]=!n||Mm),r&&(r[a]=!0),e[a]}});return a};const Km="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;var Qm=e=>"string"==typeof e,Gm=(e,t,r,n,a)=>Qm(e)?(n&&t.watch.add(e),Nm(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Nm(r,e))):(n&&(t.watchAll=!0),r);function Jm(e){const t=Bm(),{name:r,disabled:n,control:a=t.control,shouldUnregister:o}=e,s=xm(a._names.array,r),l=function(e){const t=Bm(),{control:r=t.control,name:n,defaultValue:a,disabled:o,exact:s}=e||{},l=i.useRef(a),[c,u]=i.useState(r._getWatch(n,l.current));return Km(()=>r._subscribe({name:n,formState:{values:!0},exact:s,callback:e=>!o&&u(Gm(n,r._names,e.values||r._formValues,!1,l.current))}),[n,r,o,s]),i.useEffect(()=>r._removeUnmounted()),c}({control:a,name:r,defaultValue:Nm(a._formValues,r,Nm(a._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=Bm(),{control:r=t.control,disabled:n,name:a,exact:o}=e||{},[s,l]=i.useState(r._formState),c=i.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Km(()=>r._subscribe({name:a,formState:c.current,exact:o,callback:e=>{!n&&l({...r._formState,...e})}}),[a,n,o]),i.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),i.useMemo(()=>Hm(s,r,c.current,!1),[s,r])}({control:a,name:r,exact:!0}),u=i.useRef(e),d=i.useRef(a.register(r,{...e.rules,value:l,...Em(e.disabled)?{disabled:e.disabled}:{}})),f=i.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Nm(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!Nm(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Nm(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Nm(c.validatingFields,r)},error:{enumerable:!0,get:()=>Nm(c.errors,r)}}),[c,r]),h=i.useCallback(e=>d.current.onChange({target:{value:bm(e),name:r},type:Am}),[r]),p=i.useCallback(()=>d.current.onBlur({target:{value:Nm(a._formValues,r),name:r},type:Cm}),[r,a._formValues]),m=i.useCallback(e=>{const t=Nm(a._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[a._fields,r]),y=i.useMemo(()=>({name:r,value:l,...Em(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:h,onBlur:p,ref:m}),[r,n,c.disabled,h,p,m,l]);return i.useEffect(()=>{const e=a._options.shouldUnregister||o;a.register(r,{...u.current.rules,...Em(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=Nm(a._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=jm(Nm(a._options.defaultValues,r));Pm(a._defaultValues,r,e),km(Nm(a._formValues,r))&&Pm(a._formValues,r,e)}return!s&&a.register(r),()=>{(s?e&&!a._state.action:e)?a.unregister(r):t(r,!1)}},[r,a,s,o]),i.useEffect(()=>{a._setDisabledField({disabled:n,name:r})},[n,r,a]),i.useMemo(()=>({field:y,formState:c,fieldState:f}),[y,c,f])}const Ym=e=>e.render(Jm(e));var Xm=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},ey=e=>Array.isArray(e)?e:[e],ty=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},ry=e=>ym(e)||!vm(e);function ny(e,t,r=new WeakSet){if(ry(e)||ry(t))return e===t;if(mm(e)&&mm(t))return e.getTime()===t.getTime();const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!a.includes(o))return!1;if("ref"!==o){const e=t[o];if(mm(n)&&mm(e)||gm(n)&&gm(e)||Array.isArray(n)&&Array.isArray(e)?!ny(n,e,r):n!==e)return!1}}return!0}var ay=e=>gm(e)&&!Object.keys(e).length,oy=e=>"file"===e.type,iy=e=>"function"==typeof e,sy=e=>{if(!wm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ly=e=>"select-multiple"===e.type,cy=e=>"radio"===e.type,uy=e=>sy(e)&&e.isConnected;function dy(e,t){const r=Array.isArray(t)?t:_m(t)?[t]:Sm(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=km(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(gm(n)&&ay(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!km(e[t]))return!1;return!0}(n))&&dy(e,r.slice(0,-1)),e}var fy=e=>{for(const t in e)if(iy(e[t]))return!0;return!1};function hy(e,t={}){const r=Array.isArray(e);if(gm(e)||r)for(const r in e)Array.isArray(e[r])||gm(e[r])&&!fy(e[r])?(t[r]=Array.isArray(e[r])?[]:{},hy(e[r],t[r])):ym(e[r])||(t[r]=!0);return t}function py(e,t,r){const n=Array.isArray(e);if(gm(e)||n)for(const n in e)Array.isArray(e[n])||gm(e[n])&&!fy(e[n])?km(t)||ry(r[n])?r[n]=Array.isArray(e[n])?hy(e[n],[]):{...hy(e[n])}:py(e[n],ym(t)?{}:t[n],r[n]):r[n]=!ny(e[n],t[n]);return r}var my=(e,t)=>py(e,t,hy(t));const yy={value:!1,isValid:!1},vy={value:!0,isValid:!0};var gy=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!km(e[0].attributes.value)?km(e[0].value)||""===e[0].value?vy:{value:e[0].value,isValid:!0}:vy:yy}return yy},by=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>km(e)?e:t?""===e?NaN:e?+e:e:r&&Qm(e)?new Date(e):n?n(e):e;const xy={isValid:!1,value:null};var wy=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,xy):xy;function jy(e){const t=e.ref;return oy(t)?t.files:cy(t)?wy(e.refs).value:ly(t)?[...t.selectedOptions].map(({value:e})=>e):pm(t)?gy(e.refs).value:by(km(t.value)?e.ref.value:t.value,e)}var _y=e=>e instanceof RegExp,ky=e=>km(e)?e:_y(e)?e.source:gm(e)?_y(e.value)?e.value.source:e.value:e,Oy=e=>({isOnSubmit:!e||e===Fm,isOnBlur:e===Tm,isOnChange:e===Dm,isOnAll:e===Mm,isOnTouch:e===Im});const Sy="AsyncFunction";var Ny=e=>!!e&&!!e.validate&&!!(iy(e.validate)&&e.validate.constructor.name===Sy||gm(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Sy)),Ey=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Py=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Nm(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Py(o,t))break}else if(gm(o)&&Py(o,t))break}}};function Cy(e,t,r){const n=Nm(e,r);if(n||_m(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=Nm(t,n),i=Nm(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var Ry=(e,t,r)=>{const n=ey(Nm(e,r));return Pm(n,"root",t[r]),Pm(e,r,n),e},Ay=e=>Qm(e);function Ty(e,t,r="validate"){if(Ay(e)||Array.isArray(e)&&e.every(Ay)||Em(e)&&!e)return{type:r,message:Ay(e)?e:"",ref:t}}var Dy=e=>gm(e)&&!_y(e)?e:{value:e,message:""},Fy=async(e,t,r,n,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:y,mount:v}=e._f,g=Nm(r,m);if(!v||t.has(m))return{};const b=s?s[0]:i,x=e=>{a&&b.reportValidity&&(b.setCustomValidity(Em(e)?"":e||""),b.reportValidity())},w={},j=cy(i),_=pm(i),k=j||_,O=(y||oy(i))&&km(i.value)&&km(g)||sy(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,S=Xm.bind(null,m,n,w),N=(e,t,r,n=Vm,a=zm)=>{const o=e?t:r;w[m]={type:e?n:a,message:o,ref:i,...S(e?n:a,o)}};if(o?!Array.isArray(g)||!g.length:l&&(!k&&(O||ym(g))||Em(g)&&!g||_&&!gy(s).isValid||j&&!wy(s).isValid)){const{value:e,message:t}=Ay(l)?{value:!!l,message:l}:Dy(l);if(e&&(w[m]={type:qm,message:t,ref:b,...S(qm,t)},!n))return x(t),w}if(!(O||ym(d)&&ym(f))){let e,t;const r=Dy(f),a=Dy(d);if(ym(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;Qm(r.value)&&g&&(e=s?o(g)>o(r.value):l?g>r.value:n>new Date(r.value)),Qm(a.value)&&g&&(t=s?o(g)<o(a.value):l?g<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(g?+g:g);ym(r.value)||(e=n>r.value),ym(a.value)||(t=n<a.value)}if((e||t)&&(N(!!e,r.message,a.message,Lm,$m),!n))return x(w[m].message),w}if((c||u)&&!O&&(Qm(g)||o&&Array.isArray(g))){const e=Dy(c),t=Dy(u),r=!ym(e.value)&&g.length>+e.value,a=!ym(t.value)&&g.length<+t.value;if((r||a)&&(N(r,e.message,t.message),!n))return x(w[m].message),w}if(h&&!O&&Qm(g)){const{value:e,message:t}=Dy(h);if(_y(e)&&!g.match(e)&&(w[m]={type:Um,message:t,ref:i,...S(Um,t)},!n))return x(t),w}if(p)if(iy(p)){const e=Ty(await p(g,r),b);if(e&&(w[m]={...e,...S(Wm,e.message)},!n))return x(e.message),w}else if(gm(p)){let e={};for(const t in p){if(!ay(e)&&!n)break;const a=Ty(await p[t](g,r),b,t);a&&(e={...a,...S(t,a.message)},x(a.message),n&&(w[m]=e))}if(!ay(e)&&(w[m]={ref:b,...e},!n))return w}return x(!0),w};const Iy={mode:Fm,reValidateMode:Dm,shouldFocusError:!0};function My(e={}){let t,r={...Iy,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:iy(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(gm(r.defaultValues)||gm(r.values))&&jm(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:jm(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:ty(),state:ty()},h=r.criteriaMode===Mm,p=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?ay((await b()).errors):await x(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Pm(n.validatingFields,e,t):dy(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ay(n.validatingFields)}))},y=(e,t,r,n)=>{const l=Nm(a,e);if(l){const a=Nm(i,e,km(r)?Nm(o,e):r);km(a)||n&&n.defaultChecked||t?Pm(i,e,t?a:jy(l._f)):_(e,a),s.mount&&p()}},v=(e,t,a,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!a||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=w(),l=c!==h.isDirty);const r=ny(Nm(o,e),t);c=!!Nm(n.dirtyFields,e),r?dy(n.dirtyFields,e):Pm(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(a){const t=Nm(n.touchedFields,e);t||(Pm(n.touchedFields,e,a),h.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&s&&f.state.next(h)}return l?h:{}},g=(e,a,o,i)=>{const s=Nm(n.errors,e),l=(u.isValid||d.isValid)&&Em(a)&&n.isValid!==a;var h;if(r.delayError&&o?(h=()=>((e,t)=>{Pm(n.errors,e,t),f.state.next({errors:n.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(h,e)},t(r.delayError)):(clearTimeout(c),t=null,o?Pm(n.errors,e,o):dy(n.errors,e)),(o?!ny(s,o):s)||!ay(i)||l){const t={...i,...l&&Em(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},b=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Nm(t,r);e&&Pm(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},x=async(e,t,a={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&Ny(s._f);d&&u.validatingFields&&m([o],!0);const f=await Fy(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(Nm(f,e.name)?c?Ry(n.errors,f,e.name):Pm(n.errors,e.name,f[e.name]):dy(n.errors,e.name))}!ay(c)&&await x(c,t,a)}}return a.valid},w=(e,t)=>!r.disabled&&(e&&t&&Pm(i,e,t),!ny(P(),o)),j=(e,t,r)=>Gm(e,l,{...s.mount?i:km(t)?o:Qm(e)?{[e]:t}:t},r,t),_=(e,t,r={})=>{const n=Nm(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&Pm(i,e,by(t,r)),o=sy(r.ref)&&ym(t)?"":t,ly(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?pm(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):r.refs.forEach(e=>e.checked=e.value===o):oy(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:jm(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&E(e)},k=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],i=e+"."+n,s=Nm(a,i);(l.array.has(e)||gm(o)||s&&!s._f)&&!mm(o)?k(i,o,r):_(i,o,r)}},O=(e,t,r={})=>{const c=Nm(a,e),h=l.array.has(e),p=jm(t);Pm(i,e,p),h?(f.array.next({name:e,values:jm(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:my(o,i),isDirty:w(e,p)})):!c||c._f||ym(p)?_(e,p,r):k(e,p,r),Ey(e,l)&&f.state.next({...n}),f.state.next({name:s.mount?e:void 0,values:jm(i)})},S=async e=>{s.mount=!0;const o=e.target;let c=o.name,y=!0;const w=Nm(a,c),j=e=>{y=Number.isNaN(e)||mm(e)&&isNaN(e.getTime())||ny(e,Nm(i,c,e))},_=Oy(r.mode),k=Oy(r.reValidateMode);if(w){let s,O;const S=o.type?jy(w._f):bm(e),N=e.type===Cm||e.type===Rm,P=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(w._f)&&!r.resolver&&!Nm(n.errors,c)&&!w._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(N,Nm(n.touchedFields,c),n.isSubmitted,k,_),C=Ey(c,l,N);Pm(i,c,S),N?(w._f.onBlur&&w._f.onBlur(e),t&&t(0)):w._f.onChange&&w._f.onChange(e);const R=v(c,S,N),A=!ay(R)||C;if(!N&&f.state.next({name:c,type:e.type,values:jm(i)}),P)return(u.isValid||d.isValid)&&("onBlur"===r.mode?N&&p():N||p()),A&&f.state.next({name:c,...C?{}:R});if(!N&&C&&f.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(j(S),y){const t=Cy(n.errors,a,c),r=Cy(e,a,t.name||c);s=r.error,c=r.name,O=ay(e)}}else m([c],!0),s=(await Fy(w,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),j(S),y&&(s?O=!1:(u.isValid||d.isValid)&&(O=await x(a,!0)));y&&(w._f.deps&&E(w._f.deps),g(c,O,s,R))}},N=(e,t)=>{if(Nm(n.errors,t)&&e.focus)return e.focus(),1},E=async(e,t={})=>{let o,i;const s=ey(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=Nm(t,r);e?Pm(n.errors,r,e):dy(n.errors,r)}else n.errors=t;return t})(km(e)?e:s);o=ay(t),i=e?!s.some(e=>Nm(t,e)):o}else e?(i=(await Promise.all(s.map(async e=>{const t=Nm(a,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&p()):i=o=await x(a);return f.state.next({...!Qm(e)||(u.isValid||d.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!i&&Py(a,N,e?s:l.mount),i},P=e=>{const t={...s.mount?i:o};return km(e)?t:Qm(e)?Nm(t,e):e.map(e=>Nm(t,e))},C=(e,t)=>({invalid:!!Nm((t||n).errors,e),isDirty:!!Nm((t||n).dirtyFields,e),error:Nm((t||n).errors,e),isValidating:!!Nm(n.validatingFields,e),isTouched:!!Nm((t||n).touchedFields,e)}),R=(e,t,r)=>{const o=(Nm(a,e,{_f:{}})._f||{}).ref,i=Nm(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Pm(n.errors,e,{...u,...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},A=e=>f.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!ey(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return ay(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||Mm))})(t,e.formState||u,V,e.reRenderRoot)||e.callback({values:{...i},...n,...t})}}).unsubscribe,T=(e,t={})=>{for(const s of e?ey(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(dy(a,s),dy(i,s)),!t.keepError&&dy(n.errors,s),!t.keepDirty&&dy(n.dirtyFields,s),!t.keepTouched&&dy(n.touchedFields,s),!t.keepIsValidating&&dy(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&dy(o,s);f.state.next({values:jm(i)}),f.state.next({...n,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&p()},D=({disabled:e,name:t})=>{(Em(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},F=(e,t={})=>{let n=Nm(a,e);const i=Em(t.disabled)||Em(r.disabled);return Pm(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?D({disabled:Em(t.disabled)?t.disabled:r.disabled,name:e}):y(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:ky(t.min),max:ky(t.max),minLength:ky(t.minLength),maxLength:ky(t.maxLength),pattern:ky(t.pattern)}:{},name:e,onChange:S,onBlur:S,ref:i=>{if(i){F(e,t),n=Nm(a,e);const r=km(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>cy(e)||pm(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Pm(a,e,{_f:{...n._f,...s?{refs:[...l.filter(uy),r,...Array.isArray(Nm(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),y(e,!1,void 0,r)}else n=Nm(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!xm(l.array,e)||!s.action)&&l.unMount.add(e)}}},I=()=>r.shouldFocusError&&Py(a,N,l.mount),M=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=jm(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=jm(t)}else await x(a);if(l.disabled.size)for(const e of l.disabled)dy(c,e);if(dy(n.errors,"root"),ay(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else t&&await t({...n.errors},o),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ay(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?jm(e):o,d=jm(c),h=ay(e),p=h?o:d;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(my(o,i))]);for(const t of Array.from(e))Nm(n.dirtyFields,t)?Pm(p,t,Nm(i,t)):O(t,Nm(p,t))}else{if(wm&&km(e))for(const e of l.mount){const t=Nm(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(sy(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)O(e,Nm(p,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?jm(o):{}:jm(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||ny(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?my(o,i):n.dirtyFields:t.keepDefaultValues&&e?my(o,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},$=(e,t)=>L(iy(e)?e(i):e,t),V=e=>{n={...n,...e}},z={control:{register:F,unregister:T,getFieldState:C,handleSubmit:M,setError:R,_subscribe:A,_runSchema:b,_focusError:I,_getWatch:j,_getDirty:w,_setValid:p,_setFieldArray:(e,t=[],l,c,h=!0,p=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,p&&Array.isArray(Nm(a,e))){const t=l(Nm(a,e),c.argA,c.argB);h&&Pm(a,e,t)}if(p&&Array.isArray(Nm(n.errors,e))){const t=l(Nm(n.errors,e),c.argA,c.argB);h&&Pm(n.errors,e,t),((e,t)=>{!Om(Nm(e,t)).length&&dy(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&p&&Array.isArray(Nm(n.touchedFields,e))){const t=l(Nm(n.touchedFields,e),c.argA,c.argB);h&&Pm(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=my(o,i)),f.state.next({name:e,isDirty:w(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Pm(i,e,t)},_setDisabledField:D,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Om(Nm(s.mount?i:o,e,r.shouldUnregister?Nm(o,e,[]):[])),_reset:L,_resetDefaultValues:()=>iy(r.defaultValues)&&r.defaultValues().then(e=>{$(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=Nm(a,e);t&&(t._f.refs?t._f.refs.every(e=>!uy(e)):!uy(t._f.ref))&&T(e)}l.unMount=new Set},_disableForm:e=>{Em(e)&&(f.state.next({disabled:e}),Py(a,(t,r)=>{const n=Nm(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},A({...e,formState:d})),trigger:E,register:F,handleSubmit:M,watch:(e,t)=>iy(e)?f.state.subscribe({next:r=>e(j(void 0,t),r)}):j(e,t,!0),setValue:O,getValues:P,reset:$,resetField:(e,t={})=>{Nm(a,e)&&(km(t.defaultValue)?O(e,jm(Nm(o,e))):(O(e,t.defaultValue),Pm(o,e,jm(t.defaultValue))),t.keepTouched||dy(n.touchedFields,e),t.keepDirty||(dy(n.dirtyFields,e),n.isDirty=t.defaultValue?w(e,jm(Nm(o,e))):w()),t.keepError||(dy(n.errors,e),u.isValid&&p()),f.state.next({...n}))},clearErrors:e=>{e&&ey(e).forEach(e=>dy(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:T,setError:R,setFocus:(e,t={})=>{const r=Nm(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&iy(e.select)&&e.select())}},getFieldState:C};return{...z,formControl:z}}function Ly(e={}){const t=i.useRef(void 0),r=i.useRef(void 0),[n,a]=i.useState({isDirty:!1,isValidating:!1,isLoading:iy(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:iy(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!iy(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...a}=My(e);t.current={...a,formState:n}}const o=t.current.control;return o._options=e,Km(()=>{const e=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,e},[o]),i.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),i.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),i.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),i.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),i.useEffect(()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==n.isDirty&&o._subjects.state.next({isDirty:e})}},[o,n.isDirty]),i.useEffect(()=>{e.values&&!ny(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),i.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Hm(n,o),t.current}const $y=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Nm(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Vy=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?$y(n.ref,r,e):n.refs&&n.refs.forEach(t=>$y(t,r,e))}},zy=(e,t)=>{t.shouldUseNativeValidation&&Vy(e,t);const r={};for(const n in e){const a=Nm(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(Uy(t.names||Object.keys(e),n)){const e=Object.assign({},Nm(r,n));Pm(e,"root",o),Pm(r,n,e)}else Pm(r,n,o)}return r},Uy=(e,t)=>e.some(e=>e.startsWith(t+"."));var qy=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:o,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=Xm(i,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r},Wy=function(e,t,r){return void 0===r&&(r={}),function(n,a,o){try{return Promise.resolve(function(a,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&Vy({},o),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:zy(qy(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}}};const Zy=ti("MoveLeft",[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);const By=function(e){var t=e.link,r=void 0===t?"/":t;return(0,an.jsx)(an.Fragment,{children:(0,an.jsx)(ct,{to:r,className:"flex items-center justify-center text-slate-700 bg-slate-200 hover:bg-slate-300 px-2 rounded-sm transition-colors",children:(0,an.jsx)(Zy,{className:"w-4"})})})};function Hy(e){return Hy="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},Hy(e)}function Ky(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Qy(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Qy(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Qy(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Qy(d,"constructor",c),Qy(c,"constructor",l),l.displayName="GeneratorFunction",Qy(c,a,"GeneratorFunction"),Qy(d),Qy(d,a,"Generator"),Qy(d,n,function(){return this}),Qy(d,"toString",function(){return"[object Generator]"}),(Ky=function(){return{w:o,m:f}})()}function Qy(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Qy=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){Qy(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},Qy(e,t,r,n)}function Gy(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 Jy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gy(Object(r),!0).forEach(function(t){Yy(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gy(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Yy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Hy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Hy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Hy(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xy(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function ev(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){Xy(o,n,a,i,s,"next",e)}function s(e){Xy(o,n,a,i,s,"throw",e)}i(void 0)})}}const tv=function(){var e,t,r,n,a,o=Ly({resolver:Wy(Xp),defaultValues:{chosen_plugins:[],ip_tags:[]}}),s=o.handleSubmit,l=o.control,c=o.formState.errors,u=Ja({mutationFn:(n=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_save_disable_plugin_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return n.apply(this,arguments)}),onSuccess:function(e){var t;pr.success(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Plugin disabled successfully!","versatile-toolkit"))},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed to disable plugin","versatile-toolkit"))}}),d=function(){var e=ev(Ky().m(function e(t){return Ky().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.mutateAsync(Jy({},t));case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),f=Qa({queryKey:["getDisablePluginList"],queryFn:(a=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_disable_plugin_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return a.apply(this,arguments)}),staleTime:5e3}),h=f.data,p=f.isFetching,m=(f.isLoading,f.isError,null==h?void 0:h.data.chosen_plugins),y=null==h?void 0:h.data.ip_tags;(0,i.useEffect)(function(){(m||y)&&l._reset({chosen_plugins:m||[],ip_tags:y||[]})},[m,y,l]);var v,g,b=Ly({resolver:Wy(rm),defaultValues:{activeTheme:""}}),x=b.handleSubmit,w=b.control,j=b.formState.errors,_=Ja({mutationFn:(v=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_save_active_theme",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return v.apply(this,arguments)}),onSuccess:function(e){var t;pr.success(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Theme activated successfully!","versatile-toolkit"))},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed to activate theme","versatile-toolkit"))}}),k=function(){var e=ev(Ky().m(function e(t){return Ky().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,_.mutateAsync(Jy({},t));case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),O=Qa({queryKey:["getActiveTheme"],queryFn:(g=ah(th().m(function e(t){var r;return th().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_active_theme",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return g.apply(this,arguments)}),staleTime:5e3}),S=O.data,N=O.isFetching,E=null==S?void 0:S.data.activeTheme;return(0,i.useEffect)(function(){E&&w._reset({activeTheme:E})},[E,w]),(0,an.jsxs)("div",{className:"p-4 space-y-6 max-w-[800px]",children:[(0,an.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,an.jsx)(By,{link:"/"}),(0,vo.__)("Deactivate Plugins","versatile-toolkit")]}),(0,an.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,an.jsx)("h3",{className:"text-lg font-semibold mb-2",children:(0,vo.__)("Disable Plugin by IP address","versatile-toolkit")}),(0,an.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:(0,vo.__)("Select plugins to disable for specific IP addresses. This is useful for troubleshooting plugin conflicts.","versatile-toolkit")}),(0,an.jsxs)("form",{onSubmit:s(d),children:[(0,an.jsxs)("div",{className:"min-h-[42px]",children:[p?(0,an.jsx)(Po,{size:"md",text:(0,vo.__)("Loading plugins","versatile-toolkit")}):(0,an.jsx)(Ym,{name:"chosen_plugins",control:l,render:function(e){var t=e.field;return(0,an.jsx)(ch,{selectedPlugin:t.value,onChange:t.onChange})}}),c.chosen_plugins&&(0,an.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==c||null===(e=c.chosen_plugins)||void 0===e?void 0:e.message})]}),(0,an.jsxs)("div",{className:"min-h-[64px] mt-2",children:[p?(0,an.jsx)(Po,{size:"md",text:(0,vo.__)("Loading settings","versatile-toolkit")}):(0,an.jsx)(Ym,{name:"ip_tags",control:l,render:function(e){var t=e.field;return(0,an.jsx)(um,{tags:t.value,onChange:t.onChange})}}),c.ip_tags&&(0,an.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==c||null===(t=c.ip_tags)||void 0===t?void 0:t.message})]}),(0,an.jsx)(Jo,{type:"submit",className:"mt-6",disabled:u.isPending,children:u.isPending?(0,vo.__)("Saving...","versatile-toolkit"):(0,vo.__)("Save List","versatile-toolkit")})]})]}),(0,an.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,an.jsx)("h3",{className:"text-lg font-semibold mb-2",children:(0,vo.__)("Switch Theme","versatile-toolkit")}),(0,an.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:(0,vo.__)("Select and activate a theme.","versatile-toolkit")}),(0,an.jsxs)("form",{onSubmit:x(k),children:[(0,an.jsxs)("div",{className:"min-h-[42px]",children:[N?(0,an.jsx)(Po,{size:"md",text:(0,vo.__)("Loading themes","versatile-toolkit")}):(0,an.jsx)(Ym,{name:"activeTheme",control:w,render:function(e){var t=e.field;return(0,an.jsx)(hm,{selectedTheme:t.value,onChange:t.onChange})}}),j.activeTheme&&(0,an.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==j||null===(r=j.activeTheme)||void 0===r?void 0:r.message})]}),(0,an.jsx)(Jo,{type:"submit",className:"mt-6",disabled:_.isPending,children:(0,an.jsx)(So,{isLoading:_.isPending,loadingText:(0,vo.__)("Activating","versatile-toolkit"),children:(0,vo.__)("Activate Theme","versatile-toolkit")})})]})]})]})};var rv=i.forwardRef((e,t)=>(0,an.jsx)(Pi.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));rv.displayName="Label";var nv=rv;function av(e){return av="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},av(e)}var ov=["className"];function iv(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 sv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=av(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=av(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==av(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lv=Zo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),cv=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,ov);return(0,an.jsx)(nv,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iv(Object(r),!0).forEach(function(t){sv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({ref:t,className:ga(lv(),r)},n))});function uv(e){return uv="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},uv(e)}cv.displayName=nv.displayName;var dv=["className"],fv=["className"],hv=["className"],pv=["className","children"];function mv(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function yv(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 vv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yv(Object(r),!0).forEach(function(t){gv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function gv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=uv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bv(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function xv(){return xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xv.apply(null,arguments)}var wv=e=>{const{children:t,...r}=e;return i.createElement(Zm.Provider,{value:r},t)},jv=i.createContext({}),_v=function(e){var t=xv({},(bv(e),e));return(0,an.jsx)(jv.Provider,{value:{name:t.name},children:(0,an.jsx)(Ym,vv({},t))})},kv=function(){var e=i.useContext(jv),t=i.useContext(Ov),r=Bm(),n=r.getFieldState,a=r.formState,o=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");var s=t.id;return vv({id:s,name:e.name,formItemId:"".concat(s,"-form-item"),formDescriptionId:"".concat(s,"-form-item-description"),formMessageId:"".concat(s,"-form-item-message")},o)},Ov=i.createContext({}),Sv=i.forwardRef(function(e,t){var r=e.className,n=mv(e,dv),a=i.useId();return(0,an.jsx)(Ov.Provider,{value:{id:a},children:(0,an.jsx)("div",vv({ref:t,className:ga("space-y-2",r)},n))})});Sv.displayName="FormItem";var Nv=i.forwardRef(function(e,t){var r=e.className,n=mv(e,fv),a=kv(),o=a.error,i=a.formItemId;return(0,an.jsx)(cv,vv({ref:t,className:ga(o&&"text-destructive",r),htmlFor:i},n))});Nv.displayName="FormLabel";var Ev=i.forwardRef(function(e,t){var r=xv({},(bv(e),e)),n=kv(),a=n.error,o=n.formItemId,i=n.formDescriptionId,s=n.formMessageId;return(0,an.jsx)($o,vv({ref:t,id:o,"aria-describedby":a?"".concat(i," ").concat(s):"".concat(i),"aria-invalid":!!a},r))});Ev.displayName="FormControl";var Pv=i.forwardRef(function(e,t){var r=e.className,n=mv(e,hv),a=kv().formDescriptionId;return(0,an.jsx)("p",vv({ref:t,id:a,className:ga("text-[0.8rem] text-muted-foreground",r)},n))});Pv.displayName="FormDescription";var Cv=i.forwardRef(function(e,t){var r,n=e.className,a=e.children,o=mv(e,pv),i=kv(),s=i.error,l=i.formMessageId,c=s?String(null!==(r=null==s?void 0:s.message)&&void 0!==r?r:""):a;return c?(0,an.jsx)("p",vv(vv({ref:t,id:l,className:ga("text-[0.8rem] font-medium text-destructive",n)},o),{},{children:c})):null});function Rv(e){return Rv="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},Rv(e)}Cv.displayName="FormMessage";var Av=["className"];function Tv(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 Dv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Rv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Fv=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,Av);return(0,an.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(r),!0).forEach(function(t){Dv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:ga("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t},n))});Fv.displayName="Textarea";var Iv="Switch",[Mv,Lv]=xi(Iv),[$v,Vv]=Mv(Iv),zv=i.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:o,required:s,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=i.useState(null),m=Mo(t,e=>p(e)),y=i.useRef(!1),v=!h||(d||!!h.closest("form")),[g,b]=Ni({prop:a,defaultProp:o??!1,onChange:u,caller:Iv});return(0,an.jsxs)($v,{scope:r,checked:g,disabled:l,children:[(0,an.jsx)(Pi.button,{type:"button",role:"switch","aria-checked":g,"aria-required":s,"data-state":Zv(g),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:m,onClick:bi(e.onClick,e=>{b(e=>!e),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&(0,an.jsx)(Wv,{control:h,bubbles:!y.current,name:n,value:c,checked:g,required:s,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});zv.displayName=Iv;var Uv="SwitchThumb",qv=i.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=Vv(Uv,r);return(0,an.jsx)(Pi.span,{"data-state":Zv(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});qv.displayName=Uv;var Wv=i.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},o)=>{const s=i.useRef(null),l=Mo(s,o),c=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(r),u=Gd(t);return i.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==r&&a){const t=new Event("click",{bubbles:n});a.call(e,r),e.dispatchEvent(t)}},[c,r,n]),(0,an.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Zv(e){return e?"checked":"unchecked"}Wv.displayName="SwitchBubbleInput";var Bv=zv,Hv=qv;function Kv(e){return Kv="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},Kv(e)}var Qv=["className"];function Gv(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 Jv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gv(Object(r),!0).forEach(function(t){Yv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Yv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Kv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Kv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xv=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,Qv);return(0,an.jsx)(Bv,Jv(Jv({className:ga("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r)},n),{},{ref:t,children:(0,an.jsx)(Hv,{className:ga("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});function eg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tg(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)?tg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tg(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}Xv.displayName=Bv.displayName;const rg=function(e){var t=e.value,r=void 0===t?"":t,n=e.onChange,a=e.buttonText,o=void 0===a?(0,vo.__)("Upload Image","versatile-toolkit"):a,s=e.allowedTypes,l=void 0===s?["image"]:s,c=e.multiple,u=void 0!==c&&c,d=eg((0,i.useState)(r),2),f=d[0],h=d[1],p=eg((0,i.useState)(0),2),m=(p[0],p[1]);(0,i.useEffect)(function(){h(r)},[r]);return(0,an.jsxs)("div",{className:"space-y-4",children:[(0,an.jsxs)("div",{className:"flex gap-2",children:[(0,an.jsx)(Jo,{type:"button",variant:"outline",onClick:function(){if(void 0!==window.wp&&window.wp.media){var e=window.wp.media({title:(0,vo.__)("Select Image","versatile-toolkit"),button:{text:(0,vo.__)("Use this image","versatile-toolkit")},multiple:u,library:{type:l}});e.on("select",function(){var t=e.state().get("selection").first().toJSON();h(t.url),m(t.id),n(t.url,t.id)}),e.open()}},children:o}),f&&(0,an.jsx)(Jo,{type:"button",variant:"destructive",size:"sm",onClick:function(){h(""),m(0),n("",0)},children:(0,vo.__)("Remove","versatile-toolkit")})]}),f&&(0,an.jsxs)("div",{className:"mt-4",children:[(0,an.jsx)("div",{className:"border rounded-lg p-2 inline-block bg-gray-50",children:(0,an.jsx)("img",{src:f,alt:(0,vo.__)("Preview","versatile-toolkit"),className:"max-w-xs max-h-32 object-cover rounded"})}),(0,an.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:(0,vo.__)("Image selected","versatile-toolkit")})]})]})},ng=ti("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var ag=function(e){var t=e.isOpen,r=e.onClose;(0,i.useEffect)(function(){var e=function(e){"Escape"===e.key&&t&&r()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[t,r]);return{handleBackdropClick:function(e){e.target===e.currentTarget&&r()}}};function og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ig(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)?ig(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ig(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}const sg=function(e){var t,r,n,a,o=e.type,s=e.disabled,l=void 0!==s&&s,c=e.getFormData,u=og((0,i.useState)(!1),2),d=u[0],f=u[1],h=og((0,i.useState)(!1),2),p=h[0],m=h[1],y=function(){f(!1),m(!1)},v=ag({isOpen:d,onClose:y}).handleBackdropClick;return(0,an.jsxs)(an.Fragment,{children:[(0,an.jsxs)(Jo,{type:"button",variant:"outline",onClick:function(){f(!0),m(!0)},disabled:l,className:"flex items-center gap-2 border-gray-400",children:[(0,an.jsx)(ng,{size:16}),(0,vo.__)("Preview","versatile-toolkit")]}),d&&(0,an.jsx)("div",{className:"fixed inset-x-0 bottom-0 -top-[15px] z-[999999] flex items-center justify-center bg-black bg-opacity-85",onClick:v,children:(0,an.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-11/12 h-5/6 max-w-6xl flex flex-col",children:[(0,an.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,an.jsx)("h3",{className:"text-lg font-semibold",children:"maintenance"===o?(0,vo.__)("Maintenance Page Preview","versatile-toolkit"):(0,vo.__)("Coming Soon Page Preview","versatile-toolkit")}),(0,an.jsx)(Jo,{variant:"ghost",size:"sm",onClick:y,className:"h-8 w-8 p-0",children:(0,an.jsx)(ri,{size:16})})]}),(0,an.jsx)("div",{className:"flex-1 p-4",children:(0,an.jsxs)("div",{className:"w-full h-full border rounded-lg overflow-hidden bg-gray-50",children:[p&&(0,an.jsx)(Ro,{}),(0,an.jsx)("iframe",{src:(t=null==La?void 0:La.ajax_url,r=null==La?void 0:La.nonce_value,n="maintenance"===o?"versatile_preview_maintenance":"versatile_preview_comingsoon",a=JSON.stringify(c()),"".concat(t,"?action=").concat(n,"&versatile_nonce=").concat(r,"&type=").concat(o,"&preview_data=").concat(encodeURIComponent(a))),className:"w-full h-full border-0",title:"maintenance"===o?(0,vo.__)("Maintenance Preview","versatile-toolkit"):(0,vo.__)("Coming Soon Preview","versatile-toolkit"),onLoad:function(){return m(!1)},style:{display:p?"none":"block"}})]})}),(0,an.jsx)("div",{className:"p-4 border-t bg-gray-50 rounded-b-lg",children:(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("p",{className:"text-sm text-gray-600",children:(0,vo.__)("This is how your page will look to visitors.","versatile-toolkit")}),(0,an.jsx)(Jo,{onClick:y,variant:"outline",children:(0,vo.__)("Close Preview","versatile-toolkit")})]})})]})})]})};function lg(e){return lg="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},lg(e)}var cg=["className"];function ug(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 dg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=lg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fg(e){var t=e.className,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,cg);return(0,an.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ug(Object(r),!0).forEach(function(t){dg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ug(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:ga("animate-pulse rounded-md bg-primary/10",t)},r))}function hg(){return(0,an.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,an.jsx)(fg,{className:"h-[45px] w-[200px] rounded-xl"}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)(fg,{className:"h-4 w-[200px]"}),(0,an.jsx)(fg,{className:"h-4 w-[200px]"})]})]})}const pg=ti("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),mg=ti("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),yg=ti("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function vg(e){return vg="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},vg(e)}function gg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kg(n.key),n)}}function bg(e,t,r){return t=wg(t),function(e,t){if(t&&("object"==vg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xg()?Reflect.construct(t,r||[],wg(e).constructor):t.apply(e,r))}function xg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xg=function(){return!!e})()}function wg(e){return wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wg(e)}function jg(e,t){return jg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jg(e,t)}function _g(e,t,r){return(t=kg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kg(e){var t=function(e,t){if("object"!=vg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vg(t)?t:t+""}var Og=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_g(r=bg(this,t,[e]),"handleRetry",function(){r.setState({hasError:!1,error:null,errorInfo:null,showErrorDetails:!1})}),_g(r,"toggleErrorDetails",function(){r.setState(function(e){return{showErrorDetails:!e.showErrorDetails}})}),r.state={hasError:!1,error:null,errorInfo:null,showErrorDetails:!1},r}return function(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&&jg(e,t)}(t,e),function(e,t,r){return t&&gg(e.prototype,t),r&&gg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,errorInfo:t}),this.props.onError&&this.props.onError(e,t),window.console&&window.console.error&&window.console.error("Versatile Plugin Error:",{error:e.message,stack:e.stack,componentStack:t.componentStack})}},{key:"render",value:function(){var e;return this.state.hasError?this.props.fallback?this.props.fallback:(0,an.jsxs)(Ca,{className:"max-w-2xl mx-auto mt-8 border-red-200 bg-red-50",children:[(0,an.jsxs)(Ra,{className:"text-center",children:[(0,an.jsx)("div",{className:"flex justify-center mb-4",children:(0,an.jsx)(pg,{className:"h-12 w-12 text-red-500"})}),(0,an.jsx)(Aa,{className:"text-red-700",children:(0,vo.__)("Something went wrong","versatile-toolkit")})]}),(0,an.jsxs)(Ta,{className:"space-y-4",children:[(0,an.jsx)("p",{className:"text-center text-gray-600",children:(0,vo.__)("We encountered an unexpected error. Please try refreshing the page or contact support if the problem persists.","versatile-toolkit")}),(0,an.jsxs)("div",{className:"flex justify-center gap-3",children:[(0,an.jsxs)(Jo,{onClick:this.handleRetry,className:"flex items-center gap-2",children:[(0,an.jsx)(mg,{className:"h-4 w-4"}),(0,vo.__)("Try Again","versatile-toolkit")]}),!1!==this.props.showDetails&&(0,an.jsxs)(Jo,{variant:"outline",onClick:this.toggleErrorDetails,className:"flex items-center gap-2",children:[(0,an.jsx)(yg,{className:"h-4 w-4"}),this.state.showErrorDetails?(0,vo.__)("Hide Details","versatile-toolkit"):(0,vo.__)("Show Details","versatile-toolkit")]})]}),this.state.showErrorDetails&&this.state.error&&(0,an.jsxs)("div",{className:"mt-6 p-4 bg-gray-100 rounded-lg border",children:[(0,an.jsx)("h4",{className:"font-semibold text-sm mb-2 text-gray-700",children:(0,vo.__)("Error Details:","versatile-toolkit")}),(0,an.jsxs)("div",{className:"text-xs font-mono text-gray-600 space-y-2",children:[(0,an.jsxs)("div",{children:[(0,an.jsx)("strong",{children:(0,vo.__)("Message:","versatile-toolkit")}),(0,an.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words",children:this.state.error.message})]}),this.state.error.stack&&(0,an.jsxs)("div",{children:[(0,an.jsx)("strong",{children:(0,vo.__)("Stack Trace:","versatile-toolkit")}),(0,an.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:this.state.error.stack})]}),(null===(e=this.state.errorInfo)||void 0===e?void 0:e.componentStack)&&(0,an.jsxs)("div",{children:[(0,an.jsx)("strong",{children:(0,vo.__)("Component Stack:","versatile-toolkit")}),(0,an.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:this.state.errorInfo.componentStack})]})]})]})]})]}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0,error:e}}}])}(i.Component);const Sg=Og;function Ng(e){return function(e){if(Array.isArray(e))return Cg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||Pg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pg(e,t){if(e){if("string"==typeof e)return Cg(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)?Cg(e,t):void 0}}function Cg(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}var Rg=[{id:"classic",name:(0,vo.__)("Classic","versatile-toolkit"),description:(0,vo.__)("Clean and professional design with centered content","versatile-toolkit")},{id:"modern",name:(0,vo.__)("Modern","versatile-toolkit"),description:(0,vo.__)("Sleek design with gradient backgrounds and modern typography","versatile-toolkit")},{id:"minimal",name:(0,vo.__)("Minimal","versatile-toolkit"),description:(0,vo.__)("Simple and elegant with focus on content","versatile-toolkit")},{id:"creative",name:(0,vo.__)("Creative","versatile-toolkit"),description:(0,vo.__)("Bold design with creative layouts and animations","versatile-toolkit")},{id:"corporate",name:(0,vo.__)("Corporate","versatile-toolkit"),description:(0,vo.__)("Professional business design with elegant typography","versatile-toolkit")},{id:"neon",name:(0,vo.__)("Neon","versatile-toolkit"),description:(0,vo.__)("Cyberpunk-inspired design with glowing neon effects","versatile-toolkit")}],Ag=function(e){return"maintenance"===e?"versatile_maintenance_template_preview":"versatile_comingsoon_template_preview"};const Tg=function(e){var t,r,n=e.selectedTemplate,a=e.onTemplateSelect,o=e.type,s=e.formData,l=e.getFormData,c=Eg((0,i.useState)(null),2),u=c[0],d=c[1],f=Eg((0,i.useState)(!1),2),h=f[0],p=f[1],m=(0,i.useState)(function(){var e=Rg.findIndex(function(e){return e.id===n});if(-1===e)return Rg;var t=Rg[e],r=Rg.filter(function(t,r){return r!==e});return[t].concat(Ng(r))}),y=Eg(m,1)[0],v=function(e){a(e)},g=function(){d(null),p(!1)},b=(0,i.useMemo)(function(){var e=l();return e?JSON.stringify(e):""},[s]);(0,i.useEffect)(function(){var e=setTimeout(function(){document.querySelectorAll(".iframe-loading").forEach(function(e){var t=e;"none"!==t.style.display&&(t.style.display="none")})},3e3);return function(){return clearTimeout(e)}},[b]);var x=ag({isOpen:!!u,onClose:g}).handleBackdropClick;return(0,an.jsxs)("div",{className:"space-y-4",children:[(0,an.jsx)("div",{className:"flex gap-4 overflow-x-auto p-2 scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:y.map(function(e){return(0,an.jsx)(Sg,{fallback:(0,an.jsx)(Ca,{className:"cursor-pointer flex-shrink-0 w-64 border-red-200 bg-red-50",children:(0,an.jsxs)(Ta,{className:"p-4",children:[(0,an.jsx)("div",{className:"w-full h-32 rounded-md bg-red-100 flex items-center justify-center",children:(0,an.jsx)("p",{className:"text-red-600 text-sm",children:(0,vo.__)("Template Error","versatile-toolkit")})}),(0,an.jsx)("h3",{className:"font-medium mt-2 text-red-700",children:e.name}),(0,an.jsx)("p",{className:"text-sm text-red-600",children:(0,vo.__)("Failed to load template","versatile-toolkit")})]})}),children:(0,an.jsx)(Ca,{className:"cursor-pointer transition-all duration-200 hover:shadow-lg flex-shrink-0 w-64 ".concat(n===e.id?"ring-2 ring-blue-500 shadow-lg":"hover:ring-1 hover:ring-gray-300"),onClick:function(){return v(e.id)},children:(0,an.jsxs)(Ta,{className:"p-4",children:[(0,an.jsxs)("div",{className:"relative mb-3",children:[(0,an.jsxs)("div",{className:"w-full h-32 rounded-md bg-gray-100 overflow-hidden border relative",children:[(0,an.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100",children:(0,an.jsxs)("div",{className:"text-center p-4",children:[(0,an.jsxs)("div",{className:"text-2xl mb-2",children:["classic"===e.id&&"📄","modern"===e.id&&"🎨","minimal"===e.id&&"✨","creative"===e.id&&"🎭","corporate"===e.id&&"🏢","neon"===e.id&&"⚡"]}),(0,an.jsx)("p",{className:"text-xs font-medium text-gray-700",children:e.name}),(0,an.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:(null==s?void 0:s.title)||"Preview"}),(null==s?void 0:s.background_image)&&(0,an.jsx)("div",{className:"absolute inset-0 opacity-20",children:(0,an.jsx)("img",{src:s.background_image,alt:"",className:"w-full h-full object-cover"})})]})}),(0,an.jsx)(Sg,{fallback:null,onError:function(t){var r=document.querySelector(".template-".concat(e.id," .iframe-loading"));r&&(r.style.display="none")},children:(0,an.jsx)("iframe",{src:"".concat(La.ajax_url,"?action=").concat(Ag(o),"&versatile_nonce=").concat(La.nonce_value,"&template_id=").concat(e.id,"&type=").concat(o,"&preview_mode=thumbnail").concat(s?"&preview_data=".concat(encodeURIComponent(b)):""),className:"w-full h-full border-0 pointer-events-none absolute top-0 left-0 hidden",title:"".concat(e.name," Preview"),style:{transform:"scale(0.25)",transformOrigin:"top left",width:"400%",height:"400%"},onLoad:function(e){var t,r,n=e.currentTarget,a=null===(t=n.parentElement)||void 0===t?void 0:t.querySelector("div:not(.iframe-loading)");a&&n&&(a.style.display="none",n.classList.remove("hidden"));var o=null===(r=n.parentElement)||void 0===r?void 0:r.querySelector(".iframe-loading");o&&(o.style.display="none")},onError:function(e){var t,r=null===(t=e.currentTarget.parentElement)||void 0===t?void 0:t.querySelector(".iframe-loading");r&&(r.style.display="none")}},"".concat(e.id,"-").concat(b))})]}),n===e.id&&(0,an.jsx)("div",{className:"absolute top-2 right-2 bg-blue-500 text-white rounded-full p-1 z-10",children:(0,an.jsx)(ai,{size:16})}),(0,an.jsx)("div",{className:"absolute inset-0 bg-gray-100 flex items-center justify-center rounded-md iframe-loading",children:(0,an.jsx)(hg,{})})]}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsx)("h4",{className:"font-semibold text-sm",children:e.name}),(0,an.jsx)("p",{className:"text-xs text-gray-600 line-clamp-2",children:e.description}),(0,an.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,an.jsx)(Jo,{type:"button",size:"sm",variant:n===e.id?"default":"outline",onClick:function(t){t.stopPropagation(),v(e.id)},className:"flex-1 text-xs",children:n===e.id?(0,vo.__)("Selected","versatile-toolkit"):(0,vo.__)("Select","versatile-toolkit")}),(0,an.jsx)(Jo,{type:"button",size:"sm",variant:"ghost",onClick:function(t){var r;t.stopPropagation(),r=e.id,d(r),p(!0)},className:"text-xs",children:(0,vo.__)("Preview","versatile-toolkit")})]})]})]})})},e.id)})}),u&&(0,an.jsx)("div",{className:"template-preview-wrapper fixed inset-x-0 -top-[15px] bottom-0 z-[99999] flex items-center justify-center bg-black bg-opacity-85",onClick:x,children:(0,an.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-11/12 h-5/6 max-w-6xl flex flex-col",children:[(0,an.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,an.jsxs)("h3",{className:"text-lg font-semibold",children:[null===(t=Rg.find(function(e){return e.id===u}))||void 0===t?void 0:t.name," - ",(0,vo.__)(" Template Preview","versatile-toolkit")]}),(0,an.jsx)(Jo,{type:"button",variant:"ghost",size:"sm",onClick:g,children:(0,an.jsx)(ri,{size:16})})]}),(0,an.jsx)("div",{className:"flex-1 p-4",children:(0,an.jsxs)("div",{className:"w-full h-full border rounded-lg overflow-hidden bg-gray-50 relative",children:[h&&(0,an.jsx)(Ro,{}),(0,an.jsx)("iframe",{src:"".concat(La.ajax_url,"?action=").concat(Ag(o),"&versatile_nonce=").concat(La.nonce_value,"&template_id=").concat(u,"&type=").concat(o,"&preview_mode=thumbnail&preview_data=").concat(encodeURIComponent(JSON.stringify(l()))),className:"w-full h-full border-0",title:(0,vo.__)("Template Preview","versatile-toolkit"),onLoad:function(){return p(!1)},style:{display:h?"none":"block"}})]})}),(0,an.jsxs)("div",{className:"p-4 border-t bg-gray-50 flex justify-between items-center",children:[(0,an.jsx)("p",{className:"text-sm text-gray-600",children:null===(r=Rg.find(function(e){return e.id===u}))||void 0===r?void 0:r.description}),(0,an.jsxs)("div",{className:"flex gap-2",children:[(0,an.jsx)(Jo,{type:"button",onClick:function(){u&&(v(u),g())},children:(0,vo.__)("Use This Template","versatile-toolkit")}),(0,an.jsx)(Jo,{type:"button",variant:"outline",onClick:g,children:(0,vo.__)("Close","versatile-toolkit")})]})]})]})})]})};function Dg(e){return Dg="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},Dg(e)}function Fg(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 Ig(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fg(Object(r),!0).forEach(function(t){Mg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Mg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Dg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Dg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Dg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lg(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return $g(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):($g(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$g(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,$g(d,"constructor",c),$g(c,"constructor",l),l.displayName="GeneratorFunction",$g(c,a,"GeneratorFunction"),$g(d),$g(d,a,"Generator"),$g(d,n,function(){return this}),$g(d,"toString",function(){return"[object Generator]"}),(Lg=function(){return{w:o,m:f}})()}function $g(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}$g=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){$g(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},$g(e,t,r,n)}function Vg(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ug(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)?Ug(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ug(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}const qg=function(){var e=zg((0,i.useState)(!1),2),t=e[0],r=e[1],n=zg((0,i.useState)(void 0),2),a=n[0],o=n[1],s=function(){return l.getValues()},l=Ly({resolver:Wy(em),defaultValues:{enable_maintenance:!0,show_subscribers_only:!1,title:"",description:"",subtitle:"",template:"classic",background_image:"",background_image_id:0,logo:"",logo_id:0}}),c=l.handleSubmit,u=function(){var e,t=sn();return Ja({mutationFn:(e=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_maintenance_mood",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var r;pr.success(null!==(r=e.message)&&void 0!==r?r:(0,vo.__)("Maintenance Mood info updated!","versatile-toolkit")),t.invalidateQueries({queryKey:["getMoodInfo"]})},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed while updating maintenance mood","versatile-toolkit"))}})}(),d=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){Vg(o,n,a,i,s,"next",e)}function s(e){Vg(o,n,a,i,s,"throw",e)}i(void 0)})}}(Lg().m(function e(t){return Lg().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,u.mutateAsync(t);case 1:e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),f=jo(),h=f.data,p=f.isLoading,m=null==h?void 0:h.data.maintenance;return(0,i.useEffect)(function(){m&&(l.reset({enable_maintenance:null==h?void 0:h.data.enable_maintenance,show_subscribers_only:m.show_subscribers_only||!1,title:m.title||"",description:m.description||"",subtitle:m.subtitle||"",template:m.template||"classic",background_image:m.background_image||"",background_image_id:m.background_image_id||0,logo:m.logo||"",logo_id:m.logo_id||0}),r(!0))},[m]),(0,an.jsx)("div",{className:"",children:p||!t?(0,an.jsx)(Co,{}):(0,an.jsx)(Sg,{onError:function(e,t){},fallback:(0,an.jsxs)("div",{className:"p-6 border border-red-200 bg-red-50 rounded-md",children:[(0,an.jsx)("h3",{className:"text-lg font-medium text-red-700 mb-2",children:(0,vo.__)("Form Error","versatile-toolkit")}),(0,an.jsx)("p",{className:"text-red-600",children:(0,vo.__)("There was a problem loading the maintenance settings form. Please try refreshing the page or contact support.","versatile-toolkit")}),(0,an.jsx)(Jo,{className:"mt-4",onClick:function(){return window.location.reload()},children:(0,vo.__)("Refresh Page","versatile-toolkit")})]}),children:(0,an.jsx)(wv,Ig(Ig({},l),{},{children:(0,an.jsxs)("form",{onSubmit:c(d,function(e){}),children:[(0,an.jsxs)("div",{className:"flex justify-between pb-5",children:[(0,an.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,an.jsx)(By,{}),(0,vo.__)("Maintenance Mood","versatile-toolkit")]}),(0,an.jsxs)("div",{className:"flex gap-5",children:[(0,an.jsx)(Jo,{type:"submit",disabled:u.isPending,children:u.isPending?(0,vo.__)("Saving...","versatile-toolkit"):(0,vo.__)("Save Settings","versatile-toolkit")}),(0,an.jsx)(Sg,{fallback:(0,an.jsx)(Jo,{variant:"outline",disabled:!0,children:(0,vo.__)("Preview Unavailable","versatile-toolkit")}),children:(0,an.jsx)(sg,{type:"maintenance",disabled:u.isPending,getFormData:s})})]})]}),(0,an.jsx)("div",{children:(0,an.jsx)(_v,{control:l.control,name:"template",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Choose Template","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Sg,{fallback:(0,an.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,an.jsx)("p",{className:"text-red-700 text-sm",children:(0,vo.__)("Template selector failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,an.jsx)(Tg,{selectedTemplate:t.value||"classic",onTemplateSelect:t.onChange,type:"maintenance",formData:a,getFormData:s})})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Select a design template for your maintenance page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})}),(0,an.jsxs)("div",{className:"flex gap-10 mt-5",children:[(0,an.jsxs)("div",{className:"w-1/2",children:[(0,an.jsx)(_v,{control:l.control,name:"enable_maintenance",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(Nv,{className:"text-foreground",htmlFor:"enable_maintenance",children:(0,vo.__)("Enable Maintenance Mood","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Xv,{id:"enable_maintenance",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Enable or disable maintenance mode for your site.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:l.control,name:"show_subscribers_only",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(Nv,{className:"text-foreground",htmlFor:"show_subscribers_only",children:(0,vo.__)("Show Only for Users","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Xv,{id:"show_subscribers_only",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("When enabled, maintenance mode will only be shown to subscribers. Other users will see the normal site.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:l.control,name:"title",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Title","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(yh,Ig({placeholder:(0,vo.__)("Enter maintenance title","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("This will be displayed as the main heading.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:l.control,name:"subtitle",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Subtitle","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(yh,Ig({placeholder:(0,vo.__)("Enter subtitle","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Optional subtitle under the title.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:l.control,name:"description",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Description","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Fv,Ig({placeholder:(0,vo.__)("Describe what is happening...","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Provide more details about the maintenance.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})]}),(0,an.jsxs)("div",{className:"w-1/2",children:[(0,an.jsx)(_v,{control:l.control,name:"background_image",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Background Image","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Sg,{fallback:(0,an.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,an.jsx)("p",{className:"text-red-700 text-sm",children:(0,vo.__)("Media uploader failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,an.jsx)(rg,{value:t.value||"",onChange:function(e,r){t.onChange(e),o(l.getValues())},buttonText:(0,vo.__)("Upload Background Image","versatile-toolkit"),allowedTypes:["image"]})})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Upload a background image for the maintenance page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:l.control,name:"logo",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Logo","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Sg,{fallback:(0,an.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,an.jsx)("p",{className:"text-red-700 text-sm",children:(0,vo.__)("Media uploader failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,an.jsx)(rg,{value:t.value||"",onChange:function(e,r){t.onChange(e),o(l.getValues())},buttonText:(0,vo.__)("Upload Logo","versatile-toolkit"),allowedTypes:["image"]})})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Upload a logo to display on the maintenance page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})]})]})]})}))})})};const Wg=function(){return(0,an.jsx)("div",{className:"p-4 space-y-6",children:(0,an.jsx)(qg,{})})};function Zg(e){return Zg="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},Zg(e)}function Bg(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 Hg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bg(Object(r),!0).forEach(function(t){Kg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Kg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Zg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Zg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qg(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Gg(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Gg(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Gg(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Gg(d,"constructor",c),Gg(c,"constructor",l),l.displayName="GeneratorFunction",Gg(c,a,"GeneratorFunction"),Gg(d),Gg(d,a,"Generator"),Gg(d,n,function(){return this}),Gg(d,"toString",function(){return"[object Generator]"}),(Qg=function(){return{w:o,m:f}})()}function Gg(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Gg=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){Gg(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},Gg(e,t,r,n)}function Jg(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xg(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)?Xg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xg(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}const eb=function(){var e=Yg((0,i.useState)(!1),2),t=e[0],r=e[1],n=Yg((0,i.useState)(void 0),2),a=n[0],o=n[1],s=Ly({resolver:Wy(tm),defaultValues:{enable_comingsoon:!0,show_subscribers_only:!1,title:"",description:"",subtitle:"",template:"classic",background_image:"",background_image_id:0,logo:"",logo_id:0}}),l=s.handleSubmit,c=function(){return s.getValues()},u=function(){var e,t=sn();return Ja({mutationFn:(e=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_comingsoon_mood",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var r;pr.success(null!==(r=e.message)&&void 0!==r?r:(0,vo.__)("Comingsoon Mood info updated!","versatile-toolkit")),t.invalidateQueries({queryKey:["getMoodInfo"]})},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed while updating Comingsoon mood","versatile-toolkit"))}})}(),d=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){Jg(o,n,a,i,s,"next",e)}function s(e){Jg(o,n,a,i,s,"throw",e)}i(void 0)})}}(Qg().m(function e(t){return Qg().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,u.mutateAsync(t);case 1:e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),f=jo(),h=f.data,p=f.isLoading,m=null==h?void 0:h.data.comingsoon;return(0,i.useEffect)(function(){m&&(s.reset({enable_comingsoon:null==h?void 0:h.data.enable_comingsoon,show_subscribers_only:m.show_subscribers_only||!1,title:m.title||"",description:m.description||"",subtitle:m.subtitle||"",template:m.template||"classic",background_image:m.background_image||"",background_image_id:m.background_image_id||0,logo:m.logo||"",logo_id:m.logo_id||0}),r(!0))},[m]),(0,an.jsx)("div",{className:"",children:p||!t?(0,an.jsx)(Co,{}):(0,an.jsx)(wv,Hg(Hg({},s),{},{children:(0,an.jsxs)("form",{onSubmit:l(d,function(e){}),children:[(0,an.jsxs)("div",{className:"flex justify-between pb-5",children:[(0,an.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,an.jsx)(By,{}),(0,vo.__)("Comingsoon Mood","versatile-toolkit")]}),(0,an.jsxs)("div",{className:"flex gap-5",children:[(0,an.jsx)(Jo,{type:"submit",disabled:u.isPending,children:(0,an.jsx)(So,{isLoading:u.isPending,loadingText:(0,vo.__)("Saving","versatile-toolkit"),children:(0,vo.__)("Save Settings","versatile-toolkit")})}),(0,an.jsx)(sg,{type:"comingsoon",disabled:u.isPending,getFormData:c})]})]}),(0,an.jsx)("div",{children:(0,an.jsx)(_v,{control:s.control,name:"template",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Choose Template","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Tg,{selectedTemplate:t.value||"classic",onTemplateSelect:t.onChange,type:"comingsoon",formData:a,getFormData:c})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Select a design template for your coming soon page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})}),(0,an.jsxs)("div",{className:"flex gap-10 mt-5",children:[(0,an.jsxs)("div",{className:"w-1/2",children:[(0,an.jsx)(_v,{control:s.control,name:"enable_comingsoon",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(Nv,{className:"text-foreground",htmlFor:"enable_comingsoon",children:(0,vo.__)("Enable Comingsoon Mood","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Xv,{id:"enable_comingsoon",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,an.jsxs)(Pv,{children:[(0,vo.__)("This will be displayed as the main heading.","versatile-toolkit"),(0,vo.__)("Enable the coming soon page for your website.","versatile-toolkit")]}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:s.control,name:"show_subscribers_only",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)(Nv,{className:"text-foreground",htmlFor:"show_subscribers_only",children:(0,vo.__)("Show Only for Users","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Xv,{id:"show_subscribers_only",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("When enabled, coming soon mode will only be shown to subscribers. Other users will see the normal site.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:s.control,name:"title",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Title","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(yh,Hg({placeholder:(0,vo.__)("Enter coming soon title","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("This will be displayed as the main heading.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:s.control,name:"subtitle",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Subtitle","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(yh,Hg({placeholder:(0,vo.__)("Enter subtitle","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Optional subtitle under the title.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:s.control,name:"description",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Description","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(Fv,Hg({placeholder:(0,vo.__)("Describe what is happening...","versatile-toolkit")},t))}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Provide more details about the coming soon.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})]}),(0,an.jsxs)("div",{className:"w-1/2",children:[(0,an.jsx)(_v,{control:s.control,name:"background_image",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Background Image","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(rg,{value:t.value||"",onChange:function(e,r){t.onChange(e),o(s.getValues())},buttonText:(0,vo.__)("Upload Background Image","versatile-toolkit"),allowedTypes:["image"]})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Upload a background image for the coming soon page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}}),(0,an.jsx)(_v,{control:s.control,name:"logo",render:function(e){var t=e.field,r=e.fieldState;return(0,an.jsxs)(Sv,{className:"mt-6",children:[(0,an.jsx)(Nv,{className:"text-foreground",children:(0,vo.__)("Logo","versatile-toolkit")}),(0,an.jsx)(Ev,{children:(0,an.jsx)(rg,{value:t.value||"",onChange:function(e,r){t.onChange(e),o(s.getValues())},buttonText:(0,vo.__)("Upload Logo","versatile-toolkit"),allowedTypes:["image"]})}),!r.error&&(0,an.jsx)(Pv,{children:(0,vo.__)("Upload a logo to display on the coming soon page.","versatile-toolkit")}),(0,an.jsx)(Cv,{})]})}})]})]})]})}))})};const tb=function(){return(0,an.jsx)("div",{className:"p-4 space-y-6",children:(0,an.jsx)(eb,{})})};function rb(e){return rb="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},rb(e)}var nb=["className"],ab=["side","className","children"],ob=["className"],ib=["className"],sb=["className"];function lb(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 cb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lb(Object(r),!0).forEach(function(t){ub(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ub(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=rb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function db(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var fb=Dl,hb=Fl,pb=Il,mb=i.forwardRef(function(e,t){var r=e.className,n=db(e,nb);return(0,an.jsx)(Ml,cb(cb({className:ga("fixed inset-0 z-[99999] bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n),{},{ref:t}))});mb.displayName=Ml.displayName;var yb=Zo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),vb=i.forwardRef(function(e,t){var r=e.side,n=void 0===r?"right":r,a=e.className,o=e.children,i=db(e,ab);return(0,an.jsxs)(pb,{children:[(0,an.jsx)(mb,{}),(0,an.jsxs)(Ll,cb(cb({ref:t,className:ga(yb({side:n}),"z-[99999] sm:max-w-[540px]",a)},i),{},{children:[(0,an.jsxs)(zl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,an.jsx)(ri,{className:"h-4 w-4"}),(0,an.jsx)("span",{className:"sr-only",children:"Close"})]}),o]}))]})});vb.displayName=Ll.displayName;var gb=function(e){var t=e.className,r=db(e,ob);return(0,an.jsx)("div",cb({className:ga("flex flex-col space-y-2 text-center sm:text-left",t)},r))};gb.displayName="SheetHeader";var bb=i.forwardRef(function(e,t){var r=e.className,n=db(e,ib);return(0,an.jsx)($l,cb({ref:t,className:ga("text-lg font-semibold text-foreground",r)},n))});function xb(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return wb(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(wb(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,wb(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,wb(d,"constructor",c),wb(c,"constructor",l),l.displayName="GeneratorFunction",wb(c,a,"GeneratorFunction"),wb(d),wb(d,a,"Generator"),wb(d,n,function(){return this}),wb(d,"toString",function(){return"[object Generator]"}),(xb=function(){return{w:o,m:f}})()}function wb(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}wb=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){wb(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},wb(e,t,r,n)}function jb(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function _b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return kb(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)?kb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kb(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}bb.displayName=$l.displayName,i.forwardRef(function(e,t){var r=e.className,n=db(e,sb);return(0,an.jsx)(Vl,cb({ref:t,className:ga("text-sm text-muted-foreground",r)},n))}).displayName=Vl.displayName;const Ob=function(){var e,t,r=_b((0,i.useState)(!1),2),n=r[0],a=r[1],o=sn(),s=ne(),l=Qa({queryKey:["getServiceList"],queryFn:(e=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_service_list",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3}),c=l.data,u=l.isLoading,d=null==c?void 0:c.data,f=function(){if(!d||"/"===s.pathname)return null;var e=s.pathname.split("/").filter(Boolean)[0],t=Object.entries(d).find(function(t){var r=_b(t,2);r[0];return r[1].path===e});return t?t[1]:null}(),h=Ja({mutationFn:(t=wo(go().m(function e(t){var r;return go().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_service_status",e.n=1,ho(La.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),onSuccess:function(e){var t;pr.success(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Service status updated!","versatile-toolkit"))},onError:function(e){var t;pr.error(null!==(t=e.message)&&void 0!==t?t:(0,vo.__)("Failed to update service status","versatile-toolkit"))}}),p=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){jb(o,n,a,i,s,"next",e)}function s(e){jb(o,n,a,i,s,"throw",e)}i(void 0)})}}(xb().m(function e(t,r){return xb().w(function(e){for(;;)switch(e.n){case 0:h.mutateAsync({service_key:t,enable:!r.enable},{onSuccess:function(){o.invalidateQueries({queryKey:["getServiceList"]}),o.invalidateQueries({queryKey:["getEnableServiceList"]})}});case 1:return e.a(2)}},e)}));return function(t,r){return e.apply(this,arguments)}}();ag({isOpen:n,onClose:function(){a(!n)}}).handleBackdropClick;return(0,an.jsx)(an.Fragment,{children:(0,an.jsxs)("header",{className:"bg-white border-b border-gray-200 py-4 pr-4 flex items-center justify-between relative",children:[(0,an.jsx)(ct,{to:"/",className:"flex items-center text-blue-600 text-lg font-semibold",children:(0,vo.__)("Versatile Toolkit","versatile-toolkit")}),(0,an.jsxs)("div",{className:"flex items-center gap-3",children:[f&&(0,an.jsx)(an.Fragment,{children:Object.keys((null==f?void 0:f.menus)||{}).map(function(e){var t,r,n="/".concat(null==f?void 0:f.path,"/").concat(null==f||null===(t=f.menus)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.slug);return n.endsWith("/")&&(n=n.slice(0,-1)),(0,an.jsx)(ct,{to:n,onClick:function(){},className:"text-sm font-medium rounded-md px-3 py-1 transition-colors duration-200 ".concat(s.pathname===n?"bg-blue-600 text-white border border-blue-700 hover:text-white focus:!text-white":" bg-blue-50 border border-blue-200"),children:null==f||null===(r=f.menus)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.label},e)})}),!u&&(null==d?void 0:d.troubleshoot.enable)&&!f&&(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(ct,{to:"/troubleshoot",className:"text-sm font-medium rounded-md px-3 py-1 text-blue-700 bg-blue-50 border border-blue-200",children:"Deactivate Plugins"}),(0,an.jsx)(ct,{to:"/troubleshoot/debug-log",className:"text-sm font-medium rounded-md px-3 py-1 text-blue-700 bg-blue-50 border border-blue-200",children:"Debug Log"})]}),(0,an.jsxs)(fb,{children:[(0,an.jsx)(hb,{asChild:!0,children:(0,an.jsx)("button",{className:"p-1 rounded-md bg-blue-100 hover:bg-blue-200 transition-colors duration-200","aria-label":"Toggle menu",children:(0,an.jsx)("svg",{className:"w-5 h-5 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),(0,an.jsxs)(vb,{children:[(0,an.jsx)(gb,{children:(0,an.jsx)(bb,{children:(0,vo.__)("Services","versatile-toolkit")})}),(0,an.jsx)("div",{className:"space-y-3 mt-6",children:Object.entries(d||{}).map(function(e){var t=_b(e,2),r=t[0],n=t[1];return(0,an.jsxs)("div",{onClick:function(){return p(r,n)},className:"flex items-center justify-between p-3 rounded-md border border-gray-200 bg-gray-50 hover:bg-blue-100 hover:border-blue-300 hover:shadow-md transition-all duration-300 cursor-pointer",children:[(0,an.jsx)("span",{className:"text-blue-500 font-medium hover:text-blue-800 transition-colors duration-300",children:n.label}),(0,an.jsxs)("div",{className:"relative inline-flex items-center cursor-pointer",children:[(0,an.jsx)("input",{type:"checkbox",checked:n.enable,onChange:function(){},className:"sr-only peer"}),(0,an.jsx)("div",{className:"relative w-11 h-6 bg-[#c7c6c6] peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]},n.label)})})]})]})]})]})})};var Sb=function(e){var t=e.children,r=_o(),n=r.data,a=(r.isLoading,null==n?void 0:n.data),o=ne().pathname.split("/").filter(Boolean)[0];if(!a)return(0,an.jsx)(an.Fragment,{children:t});var i=Object.values(a).find(function(e){return e.path===o});return i&&i.enable?(0,an.jsx)(an.Fragment,{children:t}):(0,an.jsx)(_e,{to:"/",replace:!0})};const Nb=ti("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),Eb=ti("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),Pb=ti("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Cb=ti("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function Rb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ab(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)?Ab(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ab(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}var Tb=function(e,t,r,n,a){return{pathname:"/troubleshoot/debug-log",search:"?".concat(Db(e,t,r,n,a))}},Db=function(e,t,r,n,a){var o=new URLSearchParams;return o.append("paged",e.toString()),o.append("per_page",null==t?void 0:t.toString()),r&&o.append("search",r),n&&o.append("sort_key",n),a&&o.append("sort_dir",a),o.toString()};function Fb(e){var t=e.order;return(0,an.jsxs)("span",{"aria-hidden":!0,className:"inline-flex flex-col leading-none ml-1",children:[""===t&&(0,an.jsx)(Nb,{className:"h-3 w-3"}),"asc"===t&&(0,an.jsx)(Nb,{className:"h-3 w-3"}),"desc"===t&&(0,an.jsx)(Eb,{className:"h-3 w-3"})]})}var Ib=function(e){return{page:parseInt(e.get("paged")||"1"),perPage:parseInt(e.get("per_page")||"10"),search:e.get("search")||"",sortKey:e.get("sort_key")||"",order:e.get("order")||""}};function Mb(e){var t=e.columns,r=e.fetchData,n=e.searchParams,a=ie(),o=n,s=Ib(o),l=Rb((0,i.useState)(s.search),2),c=l[0],u=l[1],d=Rb((0,i.useState)(s.page),2),f=d[0],h=d[1],p=Rb((0,i.useState)(s.perPage||10),2),m=p[0],y=p[1],v=Rb((0,i.useState)({key:s.sortKey,order:s.order}),2),g=v[0],b=v[1],x=Rb((0,i.useState)(0),2),w=x[0],j=x[1];(0,i.useEffect)(function(){var e=Ib(o);h(e.page),y(e.perPage||10),u(e.search),b({key:e.sortKey,order:e.order})},[n]);var _=Rb((0,i.useState)([]),2),k=_[0],O=_[1],S=Rb((0,i.useState)(0),2),N=S[0],E=S[1],P=Rb((0,i.useState)(!1),2),C=P[0],R=P[1];return(0,i.useEffect)(function(){R(!0),r({page:f,perPage:m,search:c,sortKey:g.key,order:g.order}).then(function(e){O(e.data),E(e.total||0),j(e.totalPages||0)}).finally(function(){return R(!1)})},[f,m,c,g]),(0,an.jsxs)("div",{className:"w-full",children:[(0,an.jsxs)("div",{className:"mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,an.jsx)("div",{className:"relative max-w-md"}),(0,an.jsx)("div",{className:"flex items-center gap-2"})]}),(0,an.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm",children:[(0,an.jsx)("div",{className:"overflow-x-auto",children:(0,an.jsxs)("table",{className:"min-w-full text-left text-sm",children:[(0,an.jsx)("thead",{className:"sticky top-0 bg-slate-50",children:(0,an.jsx)("tr",{className:"text-slate-600",children:t.map(function(e){var t=g.key===e.key,r=t?"asc"===g.order?"ascending":"descending":"none",n="px-4 py-3 font-semibold";return e.sortable?(0,an.jsx)("th",{scope:"col","aria-sort":r,className:n,children:(0,an.jsxs)("button",{className:"group inline-flex items-center rounded-lg px-1 py-0.5 hover:bg-slate-200 focus:outline-none focus:ring-2 focus:ring-slate-300",onClick:function(){return t=String(e.key),void b(function(e){return e.key!==t?{key:t,order:"asc"}:"asc"===e.order?{key:t,order:"desc"}:{key:t,order:"asc"}});var t},"aria-label":"Sort by ".concat(e.header),children:[(0,an.jsx)("span",{children:e.header}),(0,an.jsx)(Fb,{order:t?g.order:""})]})},String(e.key)):(0,an.jsx)("th",{scope:"col",className:n,children:e.header},String(e.key))})})}),(0,an.jsx)("tbody",{children:C?(0,an.jsx)("tr",{children:(0,an.jsx)("td",{colSpan:t.length,className:"px-4 py-10 text-center text-slate-500",children:(0,vo.__)("Loading...","versatile-toolkit")})}):0===k.length?(0,an.jsx)("tr",{children:(0,an.jsx)("td",{colSpan:t.length,className:"px-4 py-10 text-center text-slate-500",children:(0,vo.__)("No results found.","versatile-toolkit")})}):k.map(function(e,r){return(0,an.jsx)("tr",{className:"border-t border-slate-100 hover:bg-slate-50/60",children:t.map(function(t){var n;return(0,an.jsx)("td",{className:"px-4 py-3 text-slate-700",children:t.render?t.render(e,t.key):e[t.key]===e.id?(f-1)*m+r+1:String(null!==(n=e[t.key])&&void 0!==n?n:"")},String(t.key))})},e.id)})})]})}),(0,an.jsxs)("div",{className:"flex flex-col gap-3 border-t border-slate-200 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsxs)("div",{className:"text-xs text-slate-600",children:["Showing ",(0,an.jsx)("span",{className:"font-semibold",children:k.length?(f-1)*m+1:0}),"–",(0,an.jsx)("span",{className:"font-semibold",children:(f-1)*m+k.length})," of",(0,an.jsxs)("span",{className:"font-semibold",children:[" ",N]})]}),(0,an.jsxs)("div",{className:"flex items-center gap-2",children:[(0,an.jsx)("label",{className:"text-sm text-slate-600",children:(0,vo.__)("Per page","versatile-toolkit")}),(0,an.jsx)("select",{value:m,onChange:function(e){y(Number(e.target.value)),a(Tb(f,Number(e.target.value),c,g.key,g.order))},className:"rounded-xl border !border-slate-200 bg-white px-2 py-1.5 text-sm shadow-sm",children:[5,10,20,50,100].map(function(e){return(0,an.jsx)("option",{value:e,children:e},e)})})]})]}),(0,an.jsxs)("div",{className:"flex items-center gap-1",children:[(0,an.jsxs)("button",{className:"flex items-center gap-1 rounded-lg px-3 py-2 text-sm text-slate-600 hover:bg-slate-100 disabled:opacity-40 disabled:cursor-not-allowed",onClick:function(){var e=Math.max(1,f-1);h(e),a(Tb(e,m,c,g.key,g.order))},disabled:1===f,children:[(0,an.jsx)(Pb,{className:"h-4 w-4"}),"Previous"]}),(0,an.jsx)("div",{className:"flex items-center gap-1 mx-2",children:function(){var e=[],t=Math.max(1,f-Math.floor(1.5)),r=Math.min(w,t+3-1);r-t+1<3&&(t=Math.max(1,r-3+1)),t>1&&(e.push((0,an.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(1===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){h(1),a(Tb(1,m,c,g.key,g.order))},children:"1"},1)),t>2&&e.push((0,an.jsx)("span",{className:"px-2 text-slate-400",children:"..."},"ellipsis1")));for(var n=function(t){e.push((0,an.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(t===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){h(t),a(Tb(t,m,c,g.key,g.order))},children:t},t))},o=t;o<=r;o++)n(o);return r<w&&(r<w-1&&e.push((0,an.jsx)("span",{className:"px-2 text-slate-400",children:"..."},"ellipsis2")),e.push((0,an.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(w===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){h(w),a(Tb(w,m,c,g.key,g.order))},children:w},w))),e}()}),(0,an.jsxs)("button",{className:"flex items-center gap-1 rounded-lg px-3 py-2 text-sm text-slate-600 hover:bg-slate-100 disabled:opacity-40 disabled:cursor-not-allowed",onClick:function(){var e=Math.min(w,f+1);h(e),a(Tb(e,m,c,g.key,g.order))},disabled:f===w,children:["Next",(0,an.jsx)(Cb,{className:"h-4 w-4"})]})]})]})]})]})}var Lb=function(e){var t=e.row,r=(t.type,t.message,t.raw_line);t.severity,t.timestamp;return(0,an.jsx)("div",{className:"flex gap-1",children:(0,an.jsxs)(Ac,{children:[(0,an.jsx)(Tc,{asChild:!0,children:(0,an.jsx)(Jo,{size:"sm",variant:"ghost","aria-label":"View ".concat(t.type,"'s log"),className:"h-8 w-8 p-0 text-blue-600 hover:bg-blue-50",children:(0,an.jsx)(ng,{className:"h-4 w-4"})})}),(0,an.jsxs)(Mc,{children:[(0,an.jsxs)(Lc,{children:[(0,an.jsxs)(Vc,{children:["Warning Type: ",t.type]}),(0,an.jsx)(zc,{className:"mt-2 hidden",children:t.timestamp})]}),(0,an.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-[#e5e5e5] p-3 my-2",children:(0,an.jsx)("span",{children:r})}),(0,an.jsx)($c,{className:"sm:justify-end",children:(0,an.jsx)(Fc,{asChild:!0,children:(0,an.jsx)(Jo,{type:"button",variant:"secondary",children:(0,vo.__)("Close","versatile-toolkit")})})})]})]})})};const $b=function(e){var t=e.debugStatus,r=e.logFileInfo,n=e.isAutoRefresh,a=e.isLoading,o=e.statusLoading,i=e.onToggleDebugLog,s=e.onToggleAutoRefresh,l=e.onStopAutoRefresh;return(0,an.jsxs)("div",{className:"space-y-6",children:[(0,an.jsxs)("div",{className:"space-y-3 relative",children:[o?(0,an.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg border animate-pulse",children:[(0,an.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,an.jsx)("div",{className:"w-3 h-3 rounded-full bg-slate-300 animate-pulse"}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,an.jsx)("div",{className:"h-4 bg-slate-300 rounded w-32 animate-pulse"}),(0,an.jsx)("div",{className:"h-6 bg-slate-300 rounded-full w-16 animate-pulse"})]}),(0,an.jsx)("div",{className:"h-3 bg-slate-300 rounded w-48 animate-pulse"})]})]}),(0,an.jsx)("div",{className:"w-11 h-6 bg-slate-300 rounded-full animate-pulse"})]}):(0,an.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg border",children:[(0,an.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,an.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(t?"bg-green-500":"bg-red-500")}),(0,an.jsxs)("div",{children:[(0,an.jsxs)("div",{className:"flex gap-2",children:[(0,an.jsx)("h3",{className:"font-medium text-slate-800",children:(0,vo.__)("Debug Logging Status","versatile-toolkit")}),(0,an.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-medium ".concat(t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:t?(0,vo.__)("Enabled","versatile-toolkit"):(0,vo.__)("Disabled","versatile-toolkit")})]}),(0,an.jsx)("p",{className:"text-sm text-slate-600",children:t?(0,vo.__)("Debug logging is currently enabled","versatile-toolkit"):(0,vo.__)("Debug logging is currently disabled","versatile-toolkit")})]})]}),(0,an.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,an.jsx)("input",{type:"checkbox",checked:t,onClick:function(e){return i(e.target.checked)},className:"sr-only peer"}),(0,an.jsx)("div",{className:"w-11 h-6 bg-slate-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]}),a?(0,an.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-200 animate-pulse",children:[(0,an.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,an.jsx)("div",{className:"w-4 h-4 bg-blue-300 rounded animate-pulse"}),(0,an.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,an.jsx)("div",{className:"h-4 bg-blue-300 rounded w-20 animate-pulse"}),(0,an.jsx)("div",{className:"h-3 bg-blue-300 rounded w-12 animate-pulse"})]})]}),(0,an.jsx)("div",{className:"w-11 h-6 bg-blue-300 rounded-full animate-pulse"})]}):(0,an.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-200",children:[(0,an.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,an.jsx)("svg",{className:"w-4 h-4 text-blue-600 ".concat(n?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,an.jsxs)("span",{className:"text-sm font-medium text-blue-800",children:[(0,vo.__)("Auto Refresh","versatile-toolkit"),n&&(0,an.jsxs)("span",{className:"ml-1 text-xs",children:["(",(0,vo.__)("Active","versatile-toolkit"),")"]})]})]}),(0,an.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,an.jsx)("input",{type:"checkbox",checked:n,onChange:function(e){s(e.target.checked),e.target.checked||l()},className:"sr-only peer"}),(0,an.jsx)("div",{className:"w-11 h-6 bg-slate-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]})]}),(0,an.jsx)("div",{className:"space-y-3",children:a?(0,an.jsxs)("div",{className:"p-3 bg-slate-50 rounded-lg border",children:[(0,an.jsx)("div",{className:"h-9 bg-slate-200 rounded animate-pulse mb-3"}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-20"}),(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-16"})]}),(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-16"}),(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-12"})]}),(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-24"}),(0,an.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-32"})]})]})]}):(0,an.jsxs)("div",{className:"p-4 bg-slate-50 rounded-lg border",children:[(0,an.jsx)("h3",{className:"font-medium text-slate-800 mb-3",children:(0,vo.__)("Log File Information","versatile-toolkit")}),(0,an.jsxs)("div",{className:"space-y-2",children:[(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("span",{className:"text-sm text-slate-600",children:(0,vo.__)("File Status:","versatile-toolkit")}),(0,an.jsx)("span",{className:"text-sm font-medium ".concat(r.exists?"text-green-600":"text-red-600"),children:r.exists?(0,vo.__)("Exists","versatile-toolkit"):(0,vo.__)("Not Found","versatile-toolkit")})]}),(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("span",{className:"text-sm text-slate-600",children:(0,vo.__)("File Size:","versatile-toolkit")}),(0,an.jsx)("span",{className:"text-sm font-medium text-slate-800",children:r.size})]}),(0,an.jsxs)("div",{className:"flex justify-between items-center",children:[(0,an.jsx)("span",{className:"text-sm text-slate-600",children:(0,vo.__)("Last Modified:","versatile-toolkit")}),(0,an.jsx)("span",{className:"text-sm font-medium text-slate-800",children:r.lastModified})]})]})]})})]})};function Vb(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return zb(c,"_invoke",function(r,n,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,s=0,l=e,f.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],h=f.p,p=o[2];r>3?(a=p===n)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=r<2&&h<o[1])?(s=0,f.v=n,f.n=o[1]):h<p&&(a=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,f.n=p,s=0))}if(a||r>1)return i;throw d=!0,n}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(zb(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,zb(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,zb(d,"constructor",c),zb(c,"constructor",l),l.displayName="GeneratorFunction",zb(c,a,"GeneratorFunction"),zb(d),zb(d,a,"Generator"),zb(d,n,function(){return this}),zb(d,"toString",function(){return"[object Generator]"}),(Vb=function(){return{w:o,m:f}})()}function zb(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}zb=function(e,t,r,n){if(t)a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var o=function(t,r){zb(e,t,function(e){return this._invoke(t,r,e)})};o("next",0),o("throw",1),o("return",2)}},zb(e,t,r,n)}function Ub(e,t,r,n,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function qb(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){Ub(o,n,a,i,s,"next",e)}function s(e){Ub(o,n,a,i,s,"throw",e)}i(void 0)})}}var Wb,Zb,Bb,Hb,Kb,Qb,Gb={getStatus:(Qb=qb(Vb().m(function e(){var t,r,n;return Vb().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_get_debug_log_status",versatile_nonce:La.nonce_value}),e.n=1,fetch(La.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to get debug log status");case 3:return e.a(2,n.data)}},e)})),function(){return Qb.apply(this,arguments)}),toggleDebugLog:(Kb=qb(Vb().m(function e(t){var r,n,a;return Vb().w(function(e){for(;;)switch(e.n){case 0:return r=new URLSearchParams({action:"versatile_toggle_debug_log",versatile_nonce:La.nonce_value,enable:t.toString()}),e.n=1,fetch(La.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r});case 1:return n=e.v,e.n=2,n.json();case 2:if(200===(a=e.v).status_code){e.n=3;break}throw new Error(a.message||"Failed to toggle debug log");case 3:return e.a(2,a.data)}},e)})),function(e){return Kb.apply(this,arguments)}),clearLog:(Hb=qb(Vb().m(function e(){var t,r,n;return Vb().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_clear_debug_log",versatile_nonce:La.nonce_value}),e.n=1,fetch(La.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to clear debug log");case 3:return e.a(2)}},e)})),function(){return Hb.apply(this,arguments)}),downloadLog:(Bb=qb(Vb().m(function e(){var t,r;return Vb().w(function(e){for(;;)if(0===e.n)return t=new URLSearchParams({action:"versatile_download_debug_log",versatile_nonce:La.nonce_value}),r="".concat(La.ajax_url,"?").concat(t),window.open(r,"_blank"),e.a(2,Promise.resolve())},e)})),function(){return Bb.apply(this,arguments)}),refreshStatus:(Zb=qb(Vb().m(function e(){var t,r,n;return Vb().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_refresh_debug_log",versatile_nonce:La.nonce_value}),e.n=1,fetch(La.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to refresh debug log status");case 3:return e.a(2,n.data)}},e)})),function(){return Zb.apply(this,arguments)}),loadLogContent:(Wb=qb(Vb().m(function e(t){var r,n,a,o,i,s,l,c,u,d,f;return Vb().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.page,n=t.perPage,a=t.search,o=t.sortKey,i=t.order,e.p=1,l=new URLSearchParams({action:"versatile_get_debug_log_content",versatile_nonce:La.nonce_value,page:String(r),per_page:String(n),search:String(a||"").trim(),sortKey:String(o||"").trim(),order:String((null==i||null===(s=i.trim())||void 0===s?void 0:s.toLowerCase())||"")}),e.n=2,fetch("".concat(La.ajax_url,"?").concat(l));case 2:return c=e.v,e.n=3,c.json();case 3:if(200!==(u=e.v).status_code){e.n=4;break}return d=u.data,e.a(2,{data:d.entries,total:null==d?void 0:d.total_entries,totalPages:null==d?void 0:d.total_pages});case 4:throw new Error(u.message||"Error fetching debug log content");case 5:e.n=7;break;case 6:throw e.p=6,f=e.v,new Error((null==f?void 0:f.message)||"Unknown error fetching debug log content");case 7:return e.a(2)}},e,null,[[1,6]])})),function(e){return Wb.apply(this,arguments)})};function Jb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yb(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)?Yb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yb(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}const Xb=function(){var e,t,r=Jb(ht(),1)[0],n=Jb((0,i.useState)(!1),2),a=n[0],o=n[1],s=Jb((0,i.useState)(0),2),l=s[0],c=s[1],u=Qa({queryKey:["debugLogStatus"],queryFn:Gb.getStatus,refetchInterval:3e4,staleTime:1e4}),d=u.data,f=u.isLoading,h=u.refetch,p=function(){var e=sn();return Ja({mutationFn:Gb.toggleDebugLog,onSuccess:function(t,r){e.invalidateQueries({queryKey:["debugLogStatus"]});var n=r?"enabled":"disabled";pr.success((0,vo.__)("Debug logging ".concat(n," successfully"),"versatile-toolkit"))},onError:function(e){pr.error(e.message||(0,vo.__)("Failed to toggle debug logging","versatile-toolkit"))}})}(),m=function(){var e=sn();return Ja({mutationFn:Gb.clearLog,onSuccess:function(){e.invalidateQueries({queryKey:["debugLogStatus"]}),pr.success((0,vo.__)("Debug log cleared successfully","versatile-toolkit"))},onError:function(e){pr.error(e.message||(0,vo.__)("Failed to clear debug log","versatile-toolkit"))}})}(),y=(null==d?void 0:d.enabled)||!1,v=d?(t=(e=d).file_exists&&e.last_modified>0?new Date(1e3*e.last_modified).toLocaleString():"Never",{exists:e.file_exists,size:e.file_size_formatted,lastModified:t}):{size:"0 KB",lastModified:"Never",exists:!1},g=f||p.isPending||m.isPending;(0,i.useEffect)(function(){var e;return a&&(e=setInterval(function(){c(function(e){return e+1})},5e3)),function(){e&&clearInterval(e)}},[a]);var b=[{key:"id",header:"No"},{key:"type",header:"Type",render:function(e,t){return function(e){switch(e){case"PHP Fatal error":case"PHP Error":case"PHP Parse error":return(0,an.jsx)("span",{className:"text-red-500",children:"Error"});case"PHP Warning":return(0,an.jsx)("span",{className:"text-yellow-500",children:"Warning"});case"PHP Notice":return(0,an.jsx)("span",{className:"text-blue-500",children:"Info"});case"debug":return(0,an.jsx)("span",{className:"text-gray-500",children:"Debug"});default:return(0,an.jsx)("span",{className:"text-gray-500",children:e})}}(e.type)}},{key:"message",header:"Description",render:function(e,t){return(0,an.jsxs)(an.Fragment,{children:[e.raw_line.substring(0,200),"..."]})}},{key:"timestamp",header:"Timestamp",render:function(e){var t=e.timestamp;if(!t)return"Invalid Date";try{var r=t.replace(" UTC","");return new Date(r+" UTC").toLocaleString()}catch(e){return"Invalid Date"}}},{key:"actions",header:"Actions",render:function(e,t){return(0,an.jsx)(Lb,{row:e},t)}}];return(0,an.jsxs)("div",{className:"mx-auto max-w-6xl p-6",children:[(0,an.jsx)("div",{className:"bg-white p-6 rounded-lg border border-slate-200 mt-3",children:(0,an.jsxs)("div",{className:"flex items-center justify-between",children:[(0,an.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,an.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(y?"bg-green-500":"bg-red-500")}),(0,an.jsxs)("div",{children:[(0,an.jsx)("h3",{className:"font-medium text-slate-800",children:(0,vo.__)("Debug Logging","versatile-toolkit")}),(0,an.jsxs)("p",{className:"text-sm text-slate-600",children:[y?(0,vo.__)("Currently enabled","versatile-toolkit"):(0,vo.__)("Currently disabled","versatile-toolkit"),a&&(0,an.jsxs)("span",{className:"ml-2 text-blue-600",children:["• ",(0,vo.__)("Auto refresh active","versatile-toolkit")]})]})]})]}),(0,an.jsxs)(fb,{children:[(0,an.jsx)(hb,{asChild:!0,children:(0,an.jsxs)("button",{className:"flex items-center space-x-2 px-3 py-2 bg-slate-100 text-slate-700 rounded-lg hover:bg-slate-200 transition-colors",children:[(0,an.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,an.jsx)("span",{className:"text-sm",children:(0,vo.__)("Settings","versatile-toolkit")})]})}),(0,an.jsxs)(vb,{children:[(0,an.jsx)(gb,{children:(0,an.jsx)(bb,{children:(0,vo.__)("Debug Log Settings","versatile-toolkit")})}),(0,an.jsx)("div",{className:"mt-6",children:(0,an.jsx)($b,{debugStatus:y,logFileInfo:v,isAutoRefresh:a,isLoading:g,statusLoading:f,onToggleDebugLog:function(e){p.mutate(e)},onToggleAutoRefresh:function(e){o(e)},onStopAutoRefresh:function(){o(!1),pr.success((0,vo.__)("Auto refresh stopped","versatile-toolkit"))}})})]})]})]})}),(0,an.jsxs)("div",{className:"my-8",children:[(0,an.jsxs)("div",{className:" bg-white rounded-lg border p-2 flex items-center justify-between",children:[(0,an.jsx)("h3",{className:"font-medium text-slate-800 text-lg",children:(0,vo.__)("Debug Log","versatile-toolkit")}),(0,an.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,an.jsx)("button",{title:(0,vo.__)("Refresh Log","versatile-toolkit"),onClick:function(){h(),c(function(e){return e+1}),pr.success((0,vo.__)("Debug log status and content refreshed","versatile-toolkit"))},disabled:g,className:"flex items-center justify-center space-x-3 px-2 py-1 bg-blue-500 text-white rounded-lg hover:bg-blue-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,an.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,an.jsx)("button",{title:(0,vo.__)("Download Log","versatile-toolkit"),onClick:function(){v.exists?Gb.downloadLog():pr.error((0,vo.__)("No log file to download","versatile-toolkit"))},disabled:!v.exists||g,className:"flex items-center justify-center space-x-2 px-2 py-1 bg-green-600 text-white rounded-lg hover:bg-green-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,an.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,an.jsx)("button",{title:(0,vo.__)("Clear Log","versatile-toolkit"),onClick:function(){v.exists?window.confirm((0,vo.__)("Are you sure you want to clear the debug log? This action cannot be undone.","versatile-toolkit"))&&m.mutate(void 0,{onSuccess:function(){h(),c(function(e){return e+1})}}):pr.error((0,vo.__)("No log file to clear","versatile-toolkit"))},disabled:!v.exists||g,className:"flex items-center justify-center space-x-2 px-2 py-1 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,an.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,an.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),(0,an.jsx)(Mb,{columns:b,fetchData:Gb.loadLogContent,searchParams:r},l)]})]})};var ex=o.createRoot(document.getElementById("versatile-root")),tx=new class{#Z;#m;#u;#B;#H;#K;#Q;#G;constructor(e={}){this.#Z=e.queryCache||new Jr,this.#m=e.mutationCache||new Xr,this.#u=e.defaultOptions||{},this.#B=new Map,this.#H=new Map,this.#K=0}mount(){this.#K++,1===this.#K&&(this.#Q=Vr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#Z.onFocus())}),this.#G=zr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#Z.onOnline())}))}unmount(){this.#K--,0===this.#K&&(this.#Q?.(),this.#Q=void 0,this.#G?.(),this.#G=void 0)}isFetching(e){return this.#Z.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#m.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#Z.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#Z.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(br(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#Z.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#Z.get(n.queryHash),o=a?.state.data,i=function(e,t){return"function"==typeof e?e(t):e}(t,o);if(void 0!==i)return this.#Z.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Lr.batch(()=>this.#Z.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#Z.get(t.queryHash)?.state}removeQueries(e){const t=this.#Z;Lr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=this.#Z;return Lr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Lr.batch(()=>this.#Z.findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(yr).catch(yr)}invalidateQueries(e,t={}){return Lr.batch(()=>(this.#Z.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Lr.batch(()=>this.#Z.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(yr)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(n).then(yr)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#Z.build(this,t);return r.isStaleByTime(br(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yr).catch(yr)}fetchInfiniteQuery(e){return e.behavior=tn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yr).catch(yr)}ensureInfiniteQueryData(e){return e.behavior=tn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zr.isOnline()?this.#m.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#Z}getMutationCache(){return this.#m}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#B.set(kr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#B.values()],r={};return t.forEach(t=>{Or(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#H.set(kr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()],r={};return t.forEach(t=>{Or(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_r(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#Z.clear(),this.#m.clear()}}({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});ex.render((0,an.jsx)(Sg,{onError:function(e,t){},children:(0,an.jsx)(ln,{client:tx,children:(0,an.jsx)(Sg,{onError:function(e,t){},children:(0,an.jsx)(st,{children:(0,an.jsxs)(Sg,{onError:function(e,t){},children:[(0,an.jsx)(Ob,{}),(0,an.jsxs)(Se,{children:[(0,an.jsx)(ke,{path:"/",element:(0,an.jsx)(Sg,{children:(0,an.jsx)(Do,{})})}),(0,an.jsx)(ke,{path:"/troubleshoot",element:(0,an.jsx)(Sb,{children:(0,an.jsx)(Sg,{children:(0,an.jsx)(tv,{})})})}),(0,an.jsx)(ke,{path:"/maintenance",element:(0,an.jsx)(Sb,{children:(0,an.jsx)(Sg,{children:(0,an.jsx)(Wg,{})})})}),(0,an.jsx)(ke,{path:"/comingsoon",element:(0,an.jsx)(Sb,{children:(0,an.jsx)(Sg,{children:(0,an.jsx)(tb,{})})})}),(0,an.jsx)(ke,{path:"/troubleshoot/debug-log",element:(0,an.jsx)(Sb,{children:(0,an.jsx)(Sg,{children:(0,an.jsx)(Xb,{})})})})]}),(0,an.jsx)(hr,{position:"bottom-right",containerClassName:"!z-[9999999]",toastOptions:{duration:5e3,style:{background:"#fff",color:"#333",border:"1px solid #e5e7eb",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},success:{style:{background:"#f0fdf4",borderColor:"#86efac"}},error:{style:{background:"#fef2f2",borderColor:"#fecaca"}}}})]})})})})}))})();
     171`,pr=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,containerStyle:a,containerClassName:s})=>{let{toasts:l,handlers:c}=Bt(r);return i.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(r=>{let a=r.position||t,s=((e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Dt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}})(a,c.calculateOffset(r,{reverseOrder:e,gutter:n,defaultPosition:t}));return i.createElement(dr,{id:r.id,key:r.id,onHeightUpdate:c.updateHeight,className:r.visible?fr:"",style:s},"custom"===r.type?Tt(r.message,r):o?o(r):i.createElement(ur,{toast:r,position:a}))}))},hr=zt,mr="undefined"==typeof window||"Deno"in globalThis;function yr(){}function vr(e){return"number"==typeof e&&e>=0&&e!==1/0}function gr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function br(e,t){return"function"==typeof e?e(t):e}function xr(e,t){return"function"==typeof e?e(t):e}function wr(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:i,stale:s}=e;if(i)if(n){if(t.queryHash!==_r(i,t.options))return!1}else if(!Or(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&((!o||o===t.state.fetchStatus)&&!(a&&!a(t)))}function jr(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(kr(t.options.mutationKey)!==kr(a))return!1}else if(!Or(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&!(o&&!o(t))}function _r(e,t){return(t?.queryKeyHashFn||kr)(e)}function kr(e){return JSON.stringify(e,(e,t)=>Er(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function Or(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>Or(e[r],t[r])))}function Sr(e,t){if(e===t)return e;const r=Pr(e)&&Pr(t);if(r||Er(e)&&Er(t)){const n=r?e:Object.keys(e),o=n.length,a=r?t:Object.keys(t),i=a.length,s=r?[]:{},l=new Set(n);let c=0;for(let n=0;n<i;n++){const o=r?n:a[n];(!r&&l.has(o)||r)&&void 0===e[o]&&void 0===t[o]?(s[o]=void 0,c++):(s[o]=Sr(e[o],t[o]),s[o]===e[o]&&void 0!==e[o]&&c++)}return o===i&&c===o?e:s}return t}function Nr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Pr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Er(e){if(!Cr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Cr(r)&&(!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function Cr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rr(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?Sr(e,t):t}function Tr(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Ar(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dr=Symbol();function Fr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Dr?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function Ir(e,t){return"function"==typeof e?e(...t):!!e}var Mr=e=>setTimeout(e,0);var Lr=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},o=Mr;const a=n=>{t?e.push(n):o(()=>{r(n)})};return{batch:a=>{let i;t++;try{i=a()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{o=e}}}(),$r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vr=new class extends $r{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!mr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},zr=new class extends $r{#n=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!mr&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function Ur(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function qr(e){return Math.min(1e3*2**e,3e4)}function Wr(e){return"online"!==(e??"online")||zr.isOnline()}var Br=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Hr(e){return e instanceof Br}function Zr(e){let t,r=!1,n=0,o=!1;const a=Ur(),i=()=>Vr.isFocused()&&("always"===e.networkMode||zr.isOnline())&&e.canRun(),s=()=>Wr(e.networkMode)&&e.canRun(),l=r=>{o||(o=!0,e.onSuccess?.(r),t?.(),a.resolve(r))},c=r=>{o||(o=!0,e.onError?.(r),t?.(),a.reject(r))},u=()=>new Promise(r=>{t=e=>{(o||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,o||e.onContinue?.()}),d=()=>{if(o)return;let t;const a=0===n?e.initialPromise:void 0;try{t=a??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(l).catch(t=>{if(o)return;const a=e.retry??(mr?0:3),s=e.retryDelay??qr,l="function"==typeof s?s(n,t):s,f=!0===a||"number"==typeof a&&n<a||"function"==typeof a&&a(n,t);var p;!r&&f?(n++,e.onFail?.(n,t),(p=l,new Promise(e=>{setTimeout(e,p)})).then(()=>i()?void 0:u()).then(()=>{r?c(t):d()})):c(t)})};return{promise:a,cancel:t=>{o||(c(new Br(t)),e.abort?.())},continue:()=>(t?.(),a),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:s,start:()=>(s()?d():u().then(d),a)}}var Kr=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vr(this.gcTime)&&(this.#o=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mr?1/0:3e5))}clearGcTimeout(){this.#o&&(clearTimeout(this.#o),this.#o=void 0)}},Gr=class extends Kr{#a;#i;#s;#l;#c;#u;#d;constructor(e){super(),this.#d=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.client,this.#s=this.#l.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#c?.promise}setOptions(e){this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#s.remove(this)}setData(e,t){const r=Rr(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#c?.promise;return this.#c?.cancel(e),t?t.then(yr).catch(yr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==xr(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===br(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!gr(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#c?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#c?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#c&&(this.#d?this.#c.cancel({revert:!0}):this.#c.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#c)return this.#c.continueRetry(),this.#c.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,r.signal)})},o=()=>{const e=Fr(this.options,t),r=(()=>{const e={client:this.#l,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#d=!1,this.options.persister?this.options.persister(e,r,this):e(r)},a=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:o};return n(e),e})();this.options.behavior?.onFetch(a,this),this.#i=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===a.fetchOptions?.meta||this.#f({type:"fetch",meta:a.fetchOptions?.meta});const i=e=>{Hr(e)&&e.silent||this.#f({type:"error",error:e}),Hr(e)||(this.#s.config.onError?.(e,this),this.#s.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#c=Zr({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{if(void 0!==e){try{this.setData(e)}catch(e){return void i(e)}this.#s.config.onSuccess?.(e,this),this.#s.config.onSettled?.(e,this.state.error,this),this.scheduleGc()}else i(new Error(`${this.queryHash} data is undefined`))},onError:i,onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#c.start()}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Qr(t.data,this.options),fetchMeta:e.meta??null};case"success":return this.#i=void 0,{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Hr(r)&&r.revert&&this.#i?{...this.#i,fetchStatus:"idle"}:{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Lr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Qr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wr(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var Yr=class extends $r{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,r){const n=t.queryKey,o=t.queryHash??_r(n,t);let a=this.get(o);return a||(a=new Gr({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Lr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>wr(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>wr(e,t)):t}notify(e){Lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Lr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jr=class extends Kr{#h;#m;#c;constructor(e){super(),this.mutationId=e.mutationId,this.#m=e.mutationCache,this.#h=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#h.includes(e)||(this.#h.push(e),this.clearGcTimeout(),this.#m.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#h=this.#h.filter(t=>t!==e),this.scheduleGc(),this.#m.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#h.length||("pending"===this.state.status?this.scheduleGc():this.#m.remove(this))}continue(){return this.#c?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})};this.#c=Zr({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#m.canRun(this)});const r="pending"===this.state.status,n=!this.#c.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:n}),await(this.#m.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:n})}const o=await this.#c.start();return await(this.#m.config.onSuccess?.(o,e,this.state.context,this)),await(this.options.onSuccess?.(o,e,this.state.context)),await(this.#m.config.onSettled?.(o,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(o,null,e,this.state.context)),this.#f({type:"success",data:o}),o}catch(t){try{throw await(this.#m.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#m.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#f({type:"error",error:t})}}finally{this.#m.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),Lr.batch(()=>{this.#h.forEach(t=>{t.onMutationUpdate(e)}),this.#m.notify({mutation:this,type:"updated",action:e})})}};var Xr=class extends $r{constructor(e={}){super(),this.config=e,this.#y=new Set,this.#v=new Map,this.#g=0}#y;#v;#g;build(e,t,r){const n=new Jr({mutationCache:this,mutationId:++this.#g,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#y.add(e);const t=en(e);if("string"==typeof t){const r=this.#v.get(t);r?r.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#y.delete(e)){const t=en(e);if("string"==typeof t){const r=this.#v.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=en(e);if("string"==typeof t){const r=this.#v.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=en(e);if("string"==typeof t){const r=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Lr.batch(()=>{this.#y.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#y.clear(),this.#v.clear()})}getAll(){return Array.from(this.#y)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>jr(t,e))}findAll(e={}){return this.getAll().filter(t=>jr(e,t))}notify(e){Lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Lr.batch(()=>Promise.all(e.map(e=>e.continue().catch(yr))))}};function en(e){return e.options.scope?.id}function tn(e){return{onFetch:(t,r)=>{const n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let r=!1;const c=Fr(t.options,t.fetchOptions),u=async(e,n,o)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const a=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:o?"backward":"forward",meta:t.options.meta};var a;return a=e,Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),e})(),i=await c(a),{maxPages:s}=t.options,l=o?Ar:Tr;return{pages:l(e.pages,i,s),pageParams:l(e.pageParams,n,s)}};if(o&&a.length){const e="backward"===o,t={pages:a,pageParams:i},r=(e?nn:rn)(n,t);s=await u(t,r,e)}else{const t=e??a.length;do{const e=0===l?i[0]??n.initialPageParam:rn(n,s);if(l>0&&null==e)break;s=await u(s,e),l++}while(l<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function rn(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function nn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var on=o(848),an=i.createContext(void 0),sn=e=>{const t=i.useContext(an);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ln=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,on.jsx)(an.Provider,{value:e,children:t}));function cn(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=cn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function un(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=cn(e))&&(n&&(n+=" "),n+=t);return n}const dn=e=>{const t=mn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),fn(r,t)||hn(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},fn=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?fn(e.slice(1),n):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},pn=/^\[(.+)\]$/,hn=e=>{if(pn.test(e)){const t=pn.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},mn=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)yn(r[e],n,e,t);return n},yn=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:vn(t,e)).classGroupId=r)}if("function"==typeof e)return gn(e)?void yn(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{yn(o,vn(t,e),r,n)})})},vn=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},gn=e=>e.isThemeGetter,bn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},xn=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===n&&0===o){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){r=i;continue}}"["===s?n++:"]"===s?n--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.substring(a),s=wn(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:r&&r>a?r-a:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},wn=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,jn=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},_n=/\s+/;function kn(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=On(e))&&(n&&(n+=" "),n+=t);return n}const On=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=On(e[n]))&&(r&&(r+=" "),r+=t);return r};function Sn(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:bn(e.cacheSize),parseClassName:xn(e),sortModifiers:jn(e),...dn(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(_n);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=n(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=n(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const y=a(u).join(":"),v=d?y+"!":y,g=v+m;if(i.includes(g))continue;i.push(g);const b=o(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return o(e,a),a}return function(){return a(kn.apply(null,arguments))}}const Nn=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Pn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,En=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cn=/^\d+\/\d+$/,Rn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,An=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Dn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,In=e=>Cn.test(e),Mn=e=>!!e&&!Number.isNaN(Number(e)),Ln=e=>!!e&&Number.isInteger(Number(e)),$n=e=>e.endsWith("%")&&Mn(e.slice(0,-1)),Vn=e=>Rn.test(e),zn=()=>!0,Un=e=>Tn.test(e)&&!An.test(e),qn=()=>!1,Wn=e=>Dn.test(e),Bn=e=>Fn.test(e),Hn=e=>!Kn(e)&&!eo(e),Zn=e=>so(e,fo,qn),Kn=e=>Pn.test(e),Gn=e=>so(e,po,Un),Qn=e=>so(e,ho,Mn),Yn=e=>so(e,co,qn),Jn=e=>so(e,uo,Bn),Xn=e=>so(e,yo,Wn),eo=e=>En.test(e),to=e=>lo(e,po),ro=e=>lo(e,mo),no=e=>lo(e,co),oo=e=>lo(e,fo),ao=e=>lo(e,uo),io=e=>lo(e,yo,!0),so=(e,t,r)=>{const n=Pn.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},lo=(e,t,r=!1)=>{const n=En.exec(e);return!!n&&(n[1]?t(n[1]):r)},co=e=>"position"===e||"percentage"===e,uo=e=>"image"===e||"url"===e,fo=e=>"length"===e||"size"===e||"bg-size"===e,po=e=>"length"===e,ho=e=>"number"===e,mo=e=>"family-name"===e,yo=e=>"shadow"===e,vo=(Symbol.toStringTag,()=>{const e=Nn("color"),t=Nn("font"),r=Nn("text"),n=Nn("font-weight"),o=Nn("tracking"),a=Nn("leading"),i=Nn("breakpoint"),s=Nn("container"),l=Nn("spacing"),c=Nn("radius"),u=Nn("shadow"),d=Nn("inset-shadow"),f=Nn("text-shadow"),p=Nn("drop-shadow"),h=Nn("blur"),m=Nn("perspective"),y=Nn("aspect"),v=Nn("ease"),g=Nn("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",eo,Kn],x=()=>[eo,Kn,l],w=()=>[In,"full","auto",...x()],j=()=>[Ln,"none","subgrid",eo,Kn],_=()=>["auto",{span:["full",Ln,eo,Kn]},Ln,eo,Kn],k=()=>[Ln,"auto",eo,Kn],O=()=>["auto","min","max","fr",eo,Kn],S=()=>["auto",...x()],N=()=>[In,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],P=()=>[e,eo,Kn],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",no,Yn,{position:[eo,Kn]}],C=()=>["auto","cover","contain",oo,Zn,{size:[eo,Kn]}],R=()=>[$n,to,Gn],T=()=>["","none","full",c,eo,Kn],A=()=>["",Mn,to,Gn],D=()=>[Mn,$n,no,Yn],F=()=>["","none",h,eo,Kn],I=()=>["none",Mn,eo,Kn],M=()=>["none",Mn,eo,Kn],L=()=>[Mn,eo,Kn],$=()=>[In,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vn],breakpoint:[Vn],color:[zn],container:[Vn],"drop-shadow":[Vn],ease:["in","out","in-out"],font:[Hn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vn],shadow:[Vn],spacing:["px",Mn],text:[Vn],"text-shadow":[Vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",In,Kn,eo,y]}],container:["container"],columns:[{columns:[Mn,Kn,eo,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Ln,"auto",eo,Kn]}],basis:[{basis:[In,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Mn,In,"auto","initial","none",Kn]}],grow:[{grow:["",Mn,eo,Kn]}],shrink:[{shrink:["",Mn,eo,Kn]}],order:[{order:[Ln,"first","last","none",eo,Kn]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",r,to,Gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,eo,Qn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$n,Kn]}],"font-family":[{font:[ro,Kn,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,eo,Kn]}],"line-clamp":[{"line-clamp":[Mn,"none",eo,Qn]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",eo,Kn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eo,Kn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Mn,"from-font","auto",eo,Gn]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Mn,"auto",eo,Kn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eo,Kn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",eo,Kn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:E()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ln,eo,Kn],radial:["",eo,Kn],conic:[Ln,eo,Kn]},ao,Jn]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Mn,eo,Kn]}],"outline-w":[{outline:["",Mn,to,Gn]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,io,Xn]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,io,Xn]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Mn,Gn]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,io,Xn]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Mn,eo,Kn]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Mn]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[eo,Kn]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Mn]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:E()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eo,Kn]}],filter:[{filter:["","none",eo,Kn]}],blur:[{blur:F()}],brightness:[{brightness:[Mn,eo,Kn]}],contrast:[{contrast:[Mn,eo,Kn]}],"drop-shadow":[{"drop-shadow":["","none",p,io,Xn]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Mn,eo,Kn]}],"hue-rotate":[{"hue-rotate":[Mn,eo,Kn]}],invert:[{invert:["",Mn,eo,Kn]}],saturate:[{saturate:[Mn,eo,Kn]}],sepia:[{sepia:["",Mn,eo,Kn]}],"backdrop-filter":[{"backdrop-filter":["","none",eo,Kn]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[Mn,eo,Kn]}],"backdrop-contrast":[{"backdrop-contrast":[Mn,eo,Kn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Mn,eo,Kn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Mn,eo,Kn]}],"backdrop-invert":[{"backdrop-invert":["",Mn,eo,Kn]}],"backdrop-opacity":[{"backdrop-opacity":[Mn,eo,Kn]}],"backdrop-saturate":[{"backdrop-saturate":[Mn,eo,Kn]}],"backdrop-sepia":[{"backdrop-sepia":["",Mn,eo,Kn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eo,Kn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Mn,"initial",eo,Kn]}],ease:[{ease:["linear","initial",v,eo,Kn]}],delay:[{delay:[Mn,eo,Kn]}],animate:[{animate:["none",g,eo,Kn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,eo,Kn]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:I()}],"rotate-x":[{"rotate-x":I()}],"rotate-y":[{"rotate-y":I()}],"rotate-z":[{"rotate-z":I()}],scale:[{scale:M()}],"scale-x":[{"scale-x":M()}],"scale-y":[{"scale-y":M()}],"scale-z":[{"scale-z":M()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[eo,Kn,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",eo,Kn]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",eo,Kn]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Mn,to,Gn,Qn]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),go=Sn(vo);function bo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return go(un(t))}function xo(e){return xo="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},xo(e)}var wo=["className"],jo=["className"],_o=["className"],ko=["className"],Oo=["className"],So=["className"];function No(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 Po(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?No(Object(r),!0).forEach(function(t){Eo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Eo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=xo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xo(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Co(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ro=i.forwardRef(function(e,t){var r=e.className,n=Co(e,wo);return(0,on.jsx)("div",Po({ref:t,className:bo("rounded-xl border bg-card text-card-foreground shadow",r)},n))});Ro.displayName="Card";var To=i.forwardRef(function(e,t){var r=e.className,n=Co(e,jo);return(0,on.jsx)("div",Po({ref:t,className:bo("flex flex-col space-y-1.5 p-6",r)},n))});To.displayName="CardHeader";var Ao=i.forwardRef(function(e,t){var r=e.className,n=Co(e,_o);return(0,on.jsx)("div",Po({ref:t,className:bo("font-semibold leading-none tracking-tight",r)},n))});Ao.displayName="CardTitle",i.forwardRef(function(e,t){var r=e.className,n=Co(e,ko);return(0,on.jsx)("div",Po({ref:t,className:bo("text-sm text-muted-foreground",r)},n))}).displayName="CardDescription";var Do=i.forwardRef(function(e,t){var r=e.className,n=Co(e,Oo);return(0,on.jsx)("div",Po({ref:t,className:bo("p-6 pt-0",r)},n))});function Fo(e){return Fo="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},Fo(e)}function Io(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 Mo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Fo(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fo(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Do.displayName="CardContent",i.forwardRef(function(e,t){var r=e.className,n=Co(e,So);return(0,on.jsx)("div",Po({ref:t,className:bo("flex items-center p-6 pt-0",r)},n))}).displayName="CardFooter";var Lo=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(r),!0).forEach(function(t){Mo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Io(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},window._versatileObject);const $o=Lo;var Vo=class extends $r{constructor(e,t){super(),this.options=t,this.#l=e,this.#b=null,this.#x=Ur(),this.options.experimental_prefetchInRender||this.#x.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#l;#w=void 0;#j=void 0;#_=void 0;#k;#O;#x;#b;#S;#N;#P;#E;#C;#R;#T=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),zo(this.#w,this.options)?this.#A():this.updateResult(),this.#D())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Uo(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Uo(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#I(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#l.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof xr(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#w.setOptions(this.options),t._defaulted&&!Nr(this.options,t)&&this.#l.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const n=this.hasListeners();n&&qo(this.#w,r,this.options,t)&&this.#A(),this.updateResult(),!n||this.#w===r&&xr(this.options.enabled,this.#w)===xr(t.enabled,this.#w)&&br(this.options.staleTime,this.#w)===br(t.staleTime,this.#w)||this.#L();const o=this.#$();!n||this.#w===r&&xr(this.options.enabled,this.#w)===xr(t.enabled,this.#w)&&o===this.#R||this.#V(o)}getOptimisticResult(e){const t=this.#l.getQueryCache().build(this.#l,e),r=this.createResult(t,e);return function(e,t){if(!Nr(e.getCurrentResult(),t))return!0;return!1}(this,r)&&(this.#_=r,this.#O=this.options,this.#k=this.#w.state),r}getCurrentResult(){return this.#_}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),Reflect.get(e,r))})}trackProp(e){this.#T.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#l.defaultQueryOptions(e),r=this.#l.getQueryCache().build(this.#l,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#_))}#A(e){this.#M();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(yr)),t}#L(){this.#F();const e=br(this.options.staleTime,this.#w);if(mr||this.#_.isStale||!vr(e))return;const t=gr(this.#_.dataUpdatedAt,e)+1;this.#E=setTimeout(()=>{this.#_.isStale||this.updateResult()},t)}#$(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#V(e){this.#I(),this.#R=e,!mr&&!1!==xr(this.options.enabled,this.#w)&&vr(this.#R)&&0!==this.#R&&(this.#C=setInterval(()=>{(this.options.refetchIntervalInBackground||Vr.isFocused())&&this.#A()},this.#R))}#D(){this.#L(),this.#V(this.#$())}#F(){this.#E&&(clearTimeout(this.#E),this.#E=void 0)}#I(){this.#C&&(clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#w,n=this.options,o=this.#_,a=this.#k,i=this.#O,s=e!==r?e.state:this.#j,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),a=!o&&zo(e,t),i=o&&qo(e,r,t,n);(a||i)&&(u={...u,...Qr(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:h}=u;c=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===h){let e;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=o.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#P?.state.data,this.#P):t.placeholderData,void 0!==e&&(h="success",c=Rr(o?.data,e,t),d=!0)}if(t.select&&void 0!==c&&!m)if(o&&c===a?.data&&t.select===this.#S)c=this.#N;else try{this.#S=t.select,c=t.select(c),c=Rr(o?.data,c,t),this.#N=c,this.#b=null}catch(e){this.#b=e}this.#b&&(f=this.#b,c=this.#N,p=Date.now(),h="error");const y="fetching"===u.fetchStatus,v="pending"===h,g="error"===h,b=v&&y,x=void 0!==c,w={status:h,fetchStatus:u.fetchStatus,isPending:v,isSuccess:"success"===h,isError:g,isInitialLoading:b,isLoading:b,data:c,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>s.dataUpdateCount||u.errorUpdateCount>s.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:g&&!x,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:g&&x,isStale:Wo(e,t),refetch:this.refetch,promise:this.#x,isEnabled:!1!==xr(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===w.status?e.reject(w.error):void 0!==w.data&&e.resolve(w.data)},n=()=>{const e=this.#x=w.promise=Ur();t(e)},o=this.#x;switch(o.status){case"pending":e.queryHash===r.queryHash&&t(o);break;case"fulfilled":"error"!==w.status&&w.data===o.value||n();break;case"rejected":"error"===w.status&&w.error===o.reason||n()}}return w}updateResult(){const e=this.#_,t=this.createResult(this.#w,this.options);if(this.#k=this.#w.state,this.#O=this.options,void 0!==this.#k.data&&(this.#P=this.#w),Nr(t,e))return;this.#_=t;this.#z({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#T.size)return!0;const n=new Set(r??this.#T);return this.options.throwOnError&&n.add("error"),Object.keys(this.#_).some(t=>{const r=t;return this.#_[r]!==e[r]&&n.has(r)})})()})}#M(){const e=this.#l.getQueryCache().build(this.#l,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#j=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#D()}#z(e){Lr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#_)}),this.#l.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function zo(e,t){return function(e,t){return!1!==xr(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&Uo(e,t,t.refetchOnMount)}function Uo(e,t,r){if(!1!==xr(t.enabled,e)&&"static"!==br(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&Wo(e,t)}return!1}function qo(e,t,r,n){return(e!==t||!1===xr(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&Wo(e,r)}function Wo(e,t){return!1!==xr(t.enabled,e)&&e.isStaleByTime(br(t.staleTime,e))}function Bo(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ho=i.createContext(Bo()),Zo=i.createContext(!1),Ko=(Zo.Provider,(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()}));function Go(e,t,r){const n=i.useContext(Zo),o=i.useContext(Ho),a=sn(r),s=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=n?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}})(s),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(s,o),(e=>{i.useEffect(()=>{e.clearReset()},[e])})(o);const l=!a.getQueryCache().get(s.queryHash),[c]=i.useState(()=>new t(a,s)),u=c.getOptimisticResult(s),d=!n&&!1!==e.subscribed;if(i.useSyncExternalStore(i.useCallback(e=>{const t=d?c.subscribe(Lr.batchCalls(e)):yr;return c.updateResult(),t},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),i.useEffect(()=>{c.setOptions(s)},[s,c]),((e,t)=>e?.suspense&&t.isPending)(s,u))throw Ko(s,c,o);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&void 0===e.data||Ir(r,[e.error,n])))({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:a.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if(a.getDefaultOptions().queries?._experimental_afterQuery?.(s,u),s.experimental_prefetchInRender&&!mr&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,n)){const e=l?Ko(s,c,o):a.getQueryCache().get(s.queryHash)?.promise;e?.catch(yr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function Qo(e,t){return Go(e,Vo,t)}var Yo=class extends $r{#l;#_=void 0;#U;#q;constructor(e,t){super(),this.#l=e,this.setOptions(t),this.bindMethods(),this.#W()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#l.defaultMutationOptions(e),Nr(this.options,t)||this.#l.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#U,observer:this}),t?.mutationKey&&this.options.mutationKey&&kr(t.mutationKey)!==kr(this.options.mutationKey)?this.reset():"pending"===this.#U?.state.status&&this.#U.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#U?.removeObserver(this)}onMutationUpdate(e){this.#W(),this.#z(e)}getCurrentResult(){return this.#_}reset(){this.#U?.removeObserver(this),this.#U=void 0,this.#W(),this.#z()}mutate(e,t){return this.#q=t,this.#U?.removeObserver(this),this.#U=this.#l.getMutationCache().build(this.#l,this.options),this.#U.addObserver(this),this.#U.execute(e)}#W(){const e=this.#U?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#_={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#z(e){Lr.batch(()=>{if(this.#q&&this.hasListeners()){const t=this.#_.variables,r=this.#_.context;"success"===e?.type?(this.#q.onSuccess?.(e.data,t,r),this.#q.onSettled?.(e.data,null,t,r)):"error"===e?.type&&(this.#q.onError?.(e.error,t,r),this.#q.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#_)})})}};function Jo(e,t){const r=sn(t),[n]=i.useState(()=>new Yo(r,e));i.useEffect(()=>{n.setOptions(e)},[n,e]);const o=i.useSyncExternalStore(i.useCallback(e=>n.subscribe(Lr.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=i.useCallback((e,t)=>{n.mutate(e,t).catch(yr)},[n]);if(o.error&&Ir(n.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}const Xo=wp.i18n;function ea(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return ta(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ta(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ta(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ta(d,"constructor",c),ta(c,"constructor",l),l.displayName="GeneratorFunction",ta(c,o,"GeneratorFunction"),ta(d),ta(d,o,"Generator"),ta(d,n,function(){return this}),ta(d,"toString",function(){return"[object Generator]"}),(ea=function(){return{w:a,m:f}})()}function ta(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ta=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){ta(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},ta(e,t,r,n)}function ra(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function na(e){return na="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},na(e)}var oa=function(e){return e instanceof File||e instanceof Blob},aa=function(e){return"string"==typeof e},ia=function(e){return"boolean"==typeof e},sa=function(e){return"number"==typeof e},la=function(e){for(var t=new FormData,r=function(){var r=o[n],a=e[r];Array.isArray(a)?a.forEach(function(e,n){oa(e)||aa(e)?t.append("".concat(r,"[").concat(n,"]"),e):ia(e)||sa(e)?t.append("".concat(r,"[").concat(n,"]"),e.toString()):"object"===na(e)&&null!==e?t.append("".concat(r,"[").concat(n,"]"),JSON.stringify(e)):t.append("".concat(r,"[").concat(n,"]"),e)}):oa(a)||aa(a)?t.append(r,a):ia(a)?t.append(r,a.toString()):sa(a)?t.append(r,"".concat(a)):"object"===na(a)&&null!==a?t.append(r,JSON.stringify(a)):t.append(r,a)},n=0,o=Object.keys(e);n<o.length;n++)r();return t},ca=function(e){return new Promise(function(t,r){if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(e).then(function(){return t()}).catch(function(e){return r(e)});else{var n=document.createElement("textarea");n.value=e,document.body.appendChild(n),n.select();try{document.execCommand("copy"),t()}catch(e){r(e)}finally{document.body.removeChild(n)}}})},ua=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){ra(a,n,o,i,s,"next",e)}function s(e){ra(a,n,o,i,s,"throw",e)}i(void 0)})}}(ea().m(function e(t){return ea().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ca(t);case 1:hr.success((0,Xo.__)("URL copied to clipboard!","versatile-toolkit")),e.n=3;break;case 2:e.p=2,e.v,hr.error((0,Xo.__)("Failed to copy URL","versatile-toolkit"));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}();function da(e){return da="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},da(e)}function fa(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return pa(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(pa(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,pa(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,pa(d,"constructor",c),pa(c,"constructor",l),l.displayName="GeneratorFunction",pa(c,o,"GeneratorFunction"),pa(d),pa(d,o,"Generator"),pa(d,n,function(){return this}),pa(d,"toString",function(){return"[object Generator]"}),(fa=function(){return{w:a,m:f}})()}function pa(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pa=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){pa(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},pa(e,t,r,n)}function ha(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 ma(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(r),!0).forEach(function(t){ya(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ha(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ya(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=da(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==da(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function va(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function ga(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){va(a,n,o,i,s,"next",e)}function s(e){va(a,n,o,i,s,"throw",e)}i(void 0)})}}function ba(e,t){return xa.apply(this,arguments)}function xa(){return xa=ga(fa().m(function e(t,r){var n,o,a,i,s,l,c,u,d,f,p,h,m;return fa().w(function(e){for(;;)switch(e.p=e.n){case 0:return o=$o.wp_rest_nonce,a=$o.nonce_key,i=$o.nonce_value,s="".concat(t),l=(null===(n=r.method)||void 0===n?void 0:n.toUpperCase())||"POST",c=ma({"X-WP-Nonce":o},r.headers||{}),u={method:l,headers:c},["GET","DELETE"].includes(l)?((d=new URLSearchParams(null==r?void 0:r.body)).append(a,i),s+="?".concat(d.toString())):r.body&&((f=la(r.body)).append(a,i),u.body=f),e.p=1,e.n=2,fetch(s,u);case 2:return p=e.v,e.n=3,p.json();case 3:if(200!==(h=e.v).status_code){e.n=4;break}return e.a(2,h);case 4:throw new Error(h.message);case 5:e.n=7;break;case 6:throw e.p=6,m=e.v,new Error((null==m?void 0:m.message)||"fetch request error!!");case 7:return e.a(2)}},e,null,[[1,6]])})),xa.apply(this,arguments)}function wa(e,t){return ja.apply(this,arguments)}function ja(){return ja=ga(fa().m(function e(t,r){var n,o,a,i,s,l,c,u,d;return fa().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=$o.wp_rest_nonce,o=$o.nonce_key,a=$o.nonce_value,i="".concat(t),s={method:r.method||"POST",headers:ma({"X-WP-Nonce":n},r.headers||{}),body:r.body},r.body&&((l=la(r.body)).append(o,a),s.body=l),e.p=1,e.n=2,fetch(i,s);case 2:return c=e.v,e.n=3,c.json();case 3:if(200!==(u=e.v).status_code){e.n=4;break}return e.a(2,u);case 4:throw new Error(u.message);case 5:e.n=7;break;case 6:throw e.p=6,d=e.v,new Error((null==d?void 0:d.message)||"fetch request error!!");case 7:return e.a(2)}},e,null,[[1,6]])})),ja.apply(this,arguments)}function _a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return ka(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ka(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ka(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ka(d,"constructor",c),ka(c,"constructor",l),l.displayName="GeneratorFunction",ka(c,o,"GeneratorFunction"),ka(d),ka(d,o,"Generator"),ka(d,n,function(){return this}),ka(d,"toString",function(){return"[object Generator]"}),(_a=function(){return{w:a,m:f}})()}function ka(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ka=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){ka(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},ka(e,t,r,n)}function Oa(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Sa(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Oa(a,n,o,i,s,"next",e)}function s(e){Oa(a,n,o,i,s,"throw",e)}i(void 0)})}}var Na=function(){return Qo({queryKey:["getMoodInfo"],queryFn:(e=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_mood_info",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3});var e},Pa=function(){return Qo({queryKey:["getEnableServiceList"],queryFn:(e=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_enable_service_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3});var e};const Ea=function(e){var t=e.lines,r=void 0===t?1:t,n=e.rows,o=void 0===n?1:n,a=e.height,i=void 0===a?"h-4":a,s=e.width,l=void 0===s?"w-[100px]":s,c=e.className,u=e.animate,d=void 0===u||u;return(0,on.jsx)("div",{className:bo("flex flex-col gap-2",c),children:Array.from({length:o}).map(function(e,t){return(0,on.jsx)("div",{className:bo("flex gap-2",l),children:Array.from({length:r}).map(function(e,t){return(0,on.jsx)("div",{className:bo("bg-muted rounded",i,d&&"animate-pulse",t===r-1&&r>1?"w-3/4":"w-full")},t)})},t)})})};var Ca={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-4 h-4",lg:"w-5 h-5",xl:"w-6 h-6"};const Ra=function(e){var t=e.isLoading,r=e.loadingText,n=e.children,o=e.size,a=void 0===o?"sm":o,i=e.className;if(!t)return(0,on.jsx)(on.Fragment,{children:n});var s=(0,Xo.__)("Loading","versatile-toolkit"),l=r||"".concat(s,"...");return(0,on.jsxs)("div",{className:bo("flex items-center gap-2",i),children:[(0,on.jsx)("div",{className:bo(Ca[a],"animate-spin"),children:(0,on.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,on.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",className:"opacity-25"}),(0,on.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"23.562",className:"opacity-75"})]})}),(0,on.jsx)("span",{children:l})]})};var Ta={xs:"w-3 h-3 text-xs",sm:"w-4 h-4 text-sm",md:"w-5 h-5 text-base",lg:"w-6 h-6 text-lg",xl:"w-8 h-8 text-xl"},Aa={default:"text-foreground",primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"};const Da=function(e){var t=e.size,r=void 0===t?"sm":t,n=e.variant,o=void 0===n?"muted":n,a=e.className,i=e.text,s=e.showText,l=void 0===s||s,c=i||(0,Xo.__)("Loading","versatile-toolkit");return(0,on.jsxs)("div",{className:bo("flex items-center gap-2 py-2",Aa[o],a),children:[(0,on.jsx)("div",{className:bo(Ta[r],"animate-spin"),children:(0,on.jsxs)("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,on.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",className:"opacity-25"}),(0,on.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"23.562",className:"opacity-75"})]})}),l&&(0,on.jsxs)("span",{className:Ta[r].split(" ")[2],children:[c,"..."]})]})};const Fa=function(e){var t=e.className,r=e.animate,n=void 0===r||r;return(0,on.jsxs)("div",{className:bo("space-y-6",t),children:[(0,on.jsxs)("div",{className:"flex justify-between items-center pb-5",children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Ea,{width:"w-6",height:"h-6",animate:n}),(0,on.jsx)(Ea,{width:"w-48",height:"h-8",animate:n})]}),(0,on.jsxs)("div",{className:"flex gap-5",children:[(0,on.jsx)(Ea,{width:"w-32",height:"h-10",animate:n}),(0,on.jsx)(Ea,{width:"w-24",height:"h-10",animate:n})]})]}),(0,on.jsxs)("div",{className:"space-y-4",children:[(0,on.jsx)(Ea,{width:"w-32",height:"h-5",animate:n}),(0,on.jsx)("div",{className:"grid grid-cols-6 gap-4",children:Array.from({length:6}).map(function(e,t){return(0,on.jsxs)("div",{className:"space-y-3",children:[(0,on.jsx)("div",{className:bo("aspect-[4/3] bg-muted rounded-lg border-2",n&&"animate-pulse")}),(0,on.jsx)(Ea,{width:"w-16",height:"h-4",animate:n}),(0,on.jsx)(Ea,{rows:2,lines:1,width:"w-full",height:"h-3",animate:n}),(0,on.jsxs)("div",{className:"flex gap-2",children:[(0,on.jsx)(Ea,{width:"w-12",height:"h-6",animate:n}),(0,on.jsx)(Ea,{width:"w-14",height:"h-6",animate:n})]})]},t)})}),(0,on.jsx)(Ea,{width:"w-80",height:"h-4",animate:n})]}),(0,on.jsxs)("div",{className:"flex gap-10",children:[(0,on.jsxs)("div",{className:"w-1/2 space-y-6",children:[(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Ea,{width:"w-40",height:"h-5",animate:n}),(0,on.jsx)(Ea,{width:"w-12",height:"h-6",animate:n})]}),(0,on.jsx)(Ea,{width:"w-64",height:"h-4",animate:n})]}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(Ea,{width:"w-12",height:"h-5",animate:n}),(0,on.jsx)(Ea,{width:"w-full",height:"h-10",animate:n}),(0,on.jsx)(Ea,{width:"w-72",height:"h-4",animate:n})]}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(Ea,{width:"w-16",height:"h-5",animate:n}),(0,on.jsx)(Ea,{width:"w-full",height:"h-10",animate:n}),(0,on.jsx)(Ea,{width:"w-48",height:"h-4",animate:n})]}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(Ea,{width:"w-20",height:"h-5",animate:n}),(0,on.jsx)(Ea,{width:"w-full",height:"h-24",animate:n}),(0,on.jsx)(Ea,{width:"w-64",height:"h-4",animate:n})]})]}),(0,on.jsxs)("div",{className:"w-1/2 space-y-6",children:[(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(Ea,{width:"w-32",height:"h-5",animate:n}),(0,on.jsxs)("div",{className:"space-y-3",children:[(0,on.jsx)(Ea,{width:"w-48",height:"h-10",animate:n}),(0,on.jsx)("div",{className:bo("w-40 h-32 bg-muted rounded-lg",n&&"animate-pulse")}),(0,on.jsx)(Ea,{width:"w-24",height:"h-4",animate:n}),(0,on.jsx)(Ea,{width:"w-80",height:"h-4",animate:n})]}),(0,on.jsx)(Ea,{width:"w-72",height:"h-4",animate:n})]}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(Ea,{width:"w-12",height:"h-5",animate:n}),(0,on.jsxs)("div",{className:"space-y-3",children:[(0,on.jsx)(Ea,{width:"w-32",height:"h-10",animate:n}),(0,on.jsx)(Ea,{width:"w-16",height:"h-4",animate:n})]}),(0,on.jsx)(Ea,{width:"w-68",height:"h-4",animate:n})]})]})]})]})};const Ia=function(){return(0,on.jsx)("div",{className:"flex items-center justify-center h-full bg-gray-50 rounded-lg border border-gray-200 p-6",children:(0,on.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 w-72 text-center",children:[(0,on.jsx)("div",{className:"w-16 h-16 bg-gray-200 rounded-full mx-auto mb-4 animate-pulse"}),(0,on.jsx)("div",{className:"h-5 bg-gray-300 rounded w-32 mx-auto mb-2 animate-pulse"}),(0,on.jsx)("div",{className:"h-4 bg-gray-200 rounded w-40 mx-auto mb-1 animate-pulse"}),(0,on.jsx)("div",{className:"h-4 bg-gray-100 rounded w-36 mx-auto animate-pulse"})]})})};var Ma=Array.from({length:10},function(e,t){return{key:"column-".concat(t),label:"Column ".concat(t+1)}});function La(e){var t=e.columns,r=void 0===t?Ma:t,n=e.rows,o=void 0===n?10:n,a=e.className,i=void 0===a?"":a,s=e.animate,l=void 0===s||s,c=function(e){switch(e){case"id":return(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded w-6"});case"type":return(0,on.jsx)("div",{className:"h-6 bg-slate-200 rounded-full w-16"});case"message":return(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded w-full"}),(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded w-3/4"})]});case"timestamp":return(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded w-32"});case"actions":return(0,on.jsx)("div",{className:"h-6 bg-slate-200 rounded-lg w-[80%]"});default:return(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded w-24"})}};return(0,on.jsx)(on.Fragment,{children:Array.from({length:o}).map(function(e,t){return(0,on.jsx)("tr",{className:"border-t border-slate-100 ".concat(l?"animate-pulse":""," ").concat(i),children:r.map(function(e,r){return(0,on.jsx)("td",{className:"px-4 py-3",children:c(e.label||e.key)},"skeleton-".concat(t,"-").concat(r))})},"skeleton-".concat(t))})})}function $a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Va(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)?Va(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Va(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}const za=function(){var e=Pa(),t=e.data,r=e.isLoading,n=null==t?void 0:t.data;return(0,on.jsx)(on.Fragment,{children:(0,on.jsx)("div",{className:"mt-10 grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-3",children:r?(0,on.jsx)(Ea,{lines:3,height:"h-[100px]",width:"w-[900px]"}):n&&Object.entries(n).filter(function(e){var t=$a(e,2);t[0];return t[1].enable}).map(function(e){var t=$a(e,2),r=t[0],n=t[1];return(0,on.jsx)(Ro,{className:"hover:bg-gray-100 rounded-sm",children:(0,on.jsxs)(ct,{to:"/".concat(n.path),className:"block p-3",children:[(0,on.jsx)(To,{className:"p-0",children:(0,on.jsx)(Ao,{className:"text-xl",children:n.label})}),(0,on.jsx)(Do,{className:"p-0 pt-2",children:(0,on.jsx)("p",{children:n.description})})]})},r)})})})};function Ua(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function qa(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Ua(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():Ua(e[t],null)}}}}function Wa(...e){return i.useCallback(qa(...e),e)}function Ba(e){const t=Za(e),r=i.forwardRef((e,r)=>{const{children:n,...o}=e,a=i.Children.toArray(n),s=a.find(Ga);if(s){const e=s.props.children,n=a.map(t=>t===s?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t);return(0,on.jsx)(t,{...o,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,n):null})}return(0,on.jsx)(t,{...o,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}var Ha=Ba("Slot");function Za(e){const t=i.forwardRef((e,t)=>{const{children:r,...n}=e;if(i.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==i.Fragment&&(o.ref=t?qa(t,e):e),i.cloneElement(r,o)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ka=Symbol("radix.slottable");function Ga(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ka}const Qa=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ya=un,Ja=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ya(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Qa(t)||Qa(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Ya(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)};function Xa(e){return Xa="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},Xa(e)}var ei=["className","variant","size","asChild"];function ti(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 ri(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Xa(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Xa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xa(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ni=Ja("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),oi=i.forwardRef(function(e,t){var r=e.className,n=e.variant,o=e.size,a=e.asChild,i=void 0!==a&&a,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ei),l=i?Ha:"button";return(0,on.jsx)(l,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(r),!0).forEach(function(t){ri(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:bo(ni({variant:n,size:o,className:r})),ref:t},s))});oi.displayName="Button";const ai=(...e)=>e.filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t).join(" ");var ii={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const si=(0,i.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:s,...l},c)=>(0,i.createElement)("svg",{ref:c,...ii,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:ai("lucide",o),...l},[...s.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(a)?a:[a]])),li=(e,t)=>{const r=(0,i.forwardRef)(({className:r,...n},o)=>{return(0,i.createElement)(si,{ref:o,iconNode:t,className:ai(`lucide-${a=e,a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n});var a});return r.displayName=`${e}`,r},ci=li("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ui=li("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),di=li("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function fi(e){return fi="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},fi(e)}var pi=["className","variant"];function hi(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 mi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=fi(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fi(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yi=Ja("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",success:"bg-green-100 text-green-800 hover:bg-green-200/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input bg-background hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function vi(e){var t=e.className,r=e.variant,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,pi);return(0,on.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hi(Object(r),!0).forEach(function(t){mi(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:bo(yi({variant:r}),t)},n))}var gi=.999,bi=/[\\\/_+.#"@\[\(\{&]/,xi=/[\\\/_+.#"@\[\(\{&]/g,wi=/[\s-]/,ji=/[\s-]/g;function _i(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,f=n.charAt(a),p=r.indexOf(f,o),h=0;p>=0;)(l=_i(e,t,r,n,p+1,a+1,i))>h&&(p===o?l*=1:bi.test(e.charAt(p-1))?(l*=.8,(u=e.slice(o,p-1).match(xi))&&o>0&&(l*=Math.pow(gi,u.length))):wi.test(e.charAt(p-1))?(l*=.9,(d=e.slice(o,p-1).match(ji))&&o>0&&(l*=Math.pow(gi,d.length))):(l*=.17,o>0&&(l*=Math.pow(gi,p-o))),e.charAt(p)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(p-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(p-1)!==n.charAt(a))&&(.1*(c=_i(e,t,r,n,p+1,a+2,i))>l&&(l=.1*c)),l>h&&(h=l),p=r.indexOf(f,p+1);return i[s]=h,h}function ki(e){return e.toLowerCase().replace(ji," ")}function Oi(e,t,r){return _i(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,ki(e),ki(t),0,0,{})}function Si(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Ni(e,t=[]){let r=[];const n=()=>{const t=r.map(e=>i.createContext(e));return function(r){const n=r?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){const o=i.createContext(n),a=r.length;r=[...r,n];const s=t=>{const{scope:r,children:n,...s}=t,l=r?.[e]?.[a]||o,c=i.useMemo(()=>s,Object.values(s));return(0,on.jsx)(l.Provider,{value:c,children:n})};return s.displayName=t+"Provider",[s,function(r,s){const l=s?.[e]?.[a]||o,c=i.useContext(l);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Pi(n,...t)]}function Pi(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var Ei=globalThis?.document?i.useLayoutEffect:()=>{},Ci=s[" useId ".trim().toString()]||(()=>{}),Ri=0;function Ti(e){const[t,r]=i.useState(Ci());return Ei(()=>{e||r(e=>e??String(Ri++))},[e]),e||(t?`radix-${t}`:"")}var Ai=s[" useInsertionEffect ".trim().toString()]||Ei;function Di({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,s]=function({defaultProp:e,onChange:t}){const[r,n]=i.useState(e),o=i.useRef(r),a=i.useRef(t);return Ai(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==r&&(a.current?.(r),o.current=r)},[r,o]),[r,n,a]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=i.useRef(void 0!==e);i.useEffect(()=>{const e=t.current;if(e!==l){}t.current=l},[l,n])}const u=i.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else a(t)},[l,e,a,s]);return[c,u]}Symbol("RADIX:SYNC_STATE");var Fi=o(206),Ii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Ba(`Primitive.${t}`),n=i.forwardRef((e,n)=>{const{asChild:o,...a}=e,i=o?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,on.jsx)(i,{...a,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Mi(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var Li,$i="dismissableLayer.update",Vi="dismissableLayer.pointerDownOutside",zi="dismissableLayer.focusOutside",Ui=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qi=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=i.useContext(Ui),[d,f]=i.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=i.useState({}),m=Wa(t,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(v),b=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,w=b>=g,j=function(e,t=globalThis?.document){const r=Mi(e),n=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Hi(Vi,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));w&&!r&&(o?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(e,t=globalThis?.document){const r=Mi(e),n=i.useRef(!1);return i.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Hi(zi,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(a?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(e,t=globalThis?.document){const r=Mi(e);i.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),i.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Li=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Bi(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Li)}},[d,p,r,u]),i.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Bi())},[d,u]),i.useEffect(()=>{const e=()=>h({});return document.addEventListener($i,e),()=>document.removeEventListener($i,e)},[]),(0,on.jsx)(Ii.div,{...c,ref:m,style:{pointerEvents:x?w?"auto":"none":void 0,...e.style},onFocusCapture:Si(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Si(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Si(e.onPointerDownCapture,j.onPointerDownCapture)})});qi.displayName="DismissableLayer";var Wi=i.forwardRef((e,t)=>{const r=i.useContext(Ui),n=i.useRef(null),o=Wa(t,n);return i.useEffect(()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,on.jsx)(Ii.div,{...e,ref:o})});function Bi(){const e=new CustomEvent($i);document.dispatchEvent(e)}function Hi(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?function(e,t){e&&Fi.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}Wi.displayName="DismissableLayerBranch";var Zi="focusScope.autoFocusOnMount",Ki="focusScope.autoFocusOnUnmount",Gi={bubbles:!1,cancelable:!0},Qi=i.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[l,c]=i.useState(null),u=Mi(o),d=Mi(a),f=i.useRef(null),p=Wa(t,e=>c(e)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(n){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:es(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||es(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&es(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[n,l,h.paused]),i.useEffect(()=>{if(l){ts.add(h);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Zi,Gi);l.addEventListener(Zi,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(es(n,{select:t}),document.activeElement!==r)return}((e=Yi(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&es(l))}return()=>{l.removeEventListener(Zi,u),setTimeout(()=>{const e=new CustomEvent(Ki,Gi);l.addEventListener(Ki,d),l.dispatchEvent(e),e.defaultPrevented||es(t??document.body,{select:!0}),l.removeEventListener(Ki,d),ts.remove(h)},0)}}var e},[l,u,d,h]);const m=i.useCallback(e=>{if(!r&&!n)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[n,a]=function(e){const t=Yi(e),r=Ji(t,e),n=Ji(t.reverse(),e);return[r,n]}(t);n&&a?e.shiftKey||o!==a?e.shiftKey&&o===n&&(e.preventDefault(),r&&es(a,{select:!0})):(e.preventDefault(),r&&es(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,h.paused]);return(0,on.jsx)(Ii.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});function Yi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ji(e,t){for(const r of e)if(!Xi(r,{upTo:t}))return r}function Xi(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function es(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Qi.displayName="FocusScope";var ts=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=rs(e,t),e.unshift(t)},remove(t){e=rs(e,t),e[0]?.resume()}}}();function rs(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ns=i.forwardRef((e,t)=>{const{container:r,...n}=e,[o,a]=i.useState(!1);Ei(()=>a(!0),[]);const s=r||o&&globalThis?.document?.body;return s?Fi.createPortal((0,on.jsx)(Ii.div,{...n,ref:t}),s):null});ns.displayName="Portal";var os=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=i.useState(),n=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const e=as(n.current);a.current="mounted"===l?e:"none"},[l]),Ei(()=>{const t=n.current,r=o.current;if(r!==e){const n=a.current,i=as(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),Ei(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=a=>{const i=as(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(a.current=as(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):i.Children.only(r),a=Wa(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof r||n.isPresent?i.cloneElement(o,{ref:a}):null};function as(e){return e?.animationName||"none"}os.displayName="Presence";var is=0;function ss(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ls()),document.body.insertAdjacentElement("beforeend",e[1]??ls()),is++,()=>{1===is&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),is--}},[])}function ls(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var cs=function(){return cs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cs.apply(this,arguments)};function us(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}Object.create;function ds(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var fs="right-scroll-bar-position",ps="width-before-scroll-bar";function hs(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ms="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,ys=new WeakMap;function vs(e,t){var r,n,o,a=(r=t||null,n=function(t){return e.forEach(function(e){return hs(e,t)})},(o=(0,i.useState)(function(){return{value:r,callback:n,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=n,o.facade);return ms(function(){var t=ys.get(a);if(t){var r=new Set(t),n=new Set(e),o=a.current;r.forEach(function(e){n.has(e)||hs(e,null)}),n.forEach(function(e){r.has(e)||hs(e,o)})}ys.set(a,e)},[e]),a}function gs(e){return e}function bs(e,t){void 0===t&&(t=gs);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}var xs=function(e){void 0===e&&(e={});var t=bs(null);return t.options=cs({async:!0,ssr:!1},e),t}(),ws=function(){},js=i.forwardRef(function(e,t){var r=i.useRef(null),n=i.useState({onScrollCapture:ws,onWheelCapture:ws,onTouchMoveCapture:ws}),o=n[0],a=n[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,y=e.inert,v=e.allowPinchZoom,g=e.as,b=void 0===g?"div":g,x=e.gapMode,w=us(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,_=vs([r,t]),k=cs(cs({},w),o);return i.createElement(i.Fragment,null,d&&i.createElement(j,{sideCar:xs,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:y,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?i.cloneElement(i.Children.only(l),cs(cs({},k),{ref:_})):i.createElement(b,cs({},k,{className:c,ref:_}),l))});js.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},js.classNames={fullWidth:ps,zeroRight:fs};var _s,ks=function(e){var t=e.sideCar,r=us(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return i.createElement(n,cs({},r))};ks.isSideCarExport=!0;function Os(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_s||o.nc;return t&&e.setAttribute("nonce",t),e}var Ss=function(){var e=0,t=null;return{add:function(r){var n,o;0==e&&(t=Os())&&(o=r,(n=t).styleSheet?n.styleSheet.cssText=o:n.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ns=function(){var e,t=(e=Ss(),function(t,r){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Ps={left:0,top:0,right:0,gap:0},Es=function(e){return parseInt(e||"",10)||0},Cs=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ps;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Es(r),Es(n),Es(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Rs=Ns(),Ts="data-scroll-locked",As=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(n,";\n   padding-right: ").concat(s,"px ").concat(n,";\n  }\n  body[").concat(Ts,"] {\n    overflow: hidden ").concat(n,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n    padding-left: ".concat(o,"px;\n    padding-top: ").concat(a,"px;\n    padding-right: ").concat(i,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(s,"px ").concat(n,";\n    "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(fs," {\n    right: ").concat(s,"px ").concat(n,";\n  }\n  \n  .").concat(ps," {\n    margin-right: ").concat(s,"px ").concat(n,";\n  }\n  \n  .").concat(fs," .").concat(fs," {\n    right: 0 ").concat(n,";\n  }\n  \n  .").concat(ps," .").concat(ps," {\n    margin-right: 0 ").concat(n,";\n  }\n  \n  body[").concat(Ts,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n  }\n")},Ds=function(){var e=parseInt(document.body.getAttribute(Ts)||"0",10);return isFinite(e)?e:0},Fs=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;i.useEffect(function(){return document.body.setAttribute(Ts,(Ds()+1).toString()),function(){var e=Ds()-1;e<=0?document.body.removeAttribute(Ts):document.body.setAttribute(Ts,e.toString())}},[]);var a=i.useMemo(function(){return Cs(o)},[o]);return i.createElement(Rs,{styles:As(a,!t,o,r?"":"!important")})},Is=!1;if("undefined"!=typeof window)try{var Ms=Object.defineProperty({},"passive",{get:function(){return Is=!0,!0}});window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch(e){Is=!1}var Ls=!!Is&&{passive:!1},$s=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Vs=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),zs(e,n)){var o=Us(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zs=function(e,t){return"v"===e?function(e){return $s(e,"overflowY")}(t):function(e){return $s(e,"overflowX")}(t)},Us=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},qs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ws=function(e){return[e.deltaX,e.deltaY]},Bs=function(e){return e&&"current"in e?e.current:e},Hs=function(e){return"\n  .block-interactivity-".concat(e," {pointer-events: none;}\n  .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Zs=0,Ks=[];function Gs(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Qs=(Ys=function(e){var t=i.useRef([]),r=i.useRef([0,0]),n=i.useRef(),o=i.useState(Zs++)[0],a=i.useState(Ns)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=ds([e.lockRef.current],(e.shards||[]).map(Bs),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=qs(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Vs(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Vs(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var p=n.current||o;return function(e,t,r,n,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*n,s=r.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=Us(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&zs(e,s)&&(d+=m,f+=h);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&Math.abs(d)<1||!o&&i>d)||!u&&(o&&Math.abs(f)<1||!o&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=i.useCallback(function(e){var r=e;if(Ks.length&&Ks[Ks.length-1]===a){var n="deltaY"in r?Ws(r):qs(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)r.cancelable&&r.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Bs).filter(Boolean).filter(function(e){return e.contains(r.target)});(i.length>0?l(r,i[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=i.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:Gs(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=i.useCallback(function(e){r.current=qs(e),n.current=void 0},[]),f=i.useCallback(function(t){u(t.type,Ws(t),t.target,l(t,e.lockRef.current))},[]),p=i.useCallback(function(t){u(t.type,qs(t),t.target,l(t,e.lockRef.current))},[]);i.useEffect(function(){return Ks.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Ls),document.addEventListener("touchmove",c,Ls),document.addEventListener("touchstart",d,Ls),function(){Ks=Ks.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Ls),document.removeEventListener("touchmove",c,Ls),document.removeEventListener("touchstart",d,Ls)}},[]);var h=e.removeScrollBar,m=e.inert;return i.createElement(i.Fragment,null,m?i.createElement(a,{styles:Hs(o)}):null,h?i.createElement(Fs,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},xs.useMedium(Ys),ks);var Ys,Js=i.forwardRef(function(e,t){return i.createElement(js,cs({},e,{ref:t,sideCar:Qs}))});Js.classNames=js.classNames;const Xs=Js;var el=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tl=new WeakMap,rl=new WeakMap,nl={},ol=0,al=function(e){return e&&(e.host||al(e.parentNode))},il=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=al(t);return r&&e.contains(r)?r:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);nl[r]||(nl[r]=new WeakMap);var a=nl[r],i=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(tl.get(e)||0)+1,c=(a.get(e)||0)+1;tl.set(e,l),a.set(e,c),i.push(e),1===l&&o&&rl.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(e){}})};return u(t),s.clear(),ol++,function(){i.forEach(function(e){var t=tl.get(e)-1,o=a.get(e)-1;tl.set(e,t),a.set(e,o),t||(rl.has(e)||e.removeAttribute(n),rl.delete(e)),o||e.removeAttribute(r)}),--ol||(tl=new WeakMap,tl=new WeakMap,rl=new WeakMap,nl={})}},sl=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||el(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),il(n,o,r,"aria-hidden")):function(){return null}},ll="Dialog",[cl,ul]=Ni(ll),[dl,fl]=cl(ll),pl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=i.useRef(null),c=i.useRef(null),[u,d]=Di({prop:n,defaultProp:o??!1,onChange:a,caller:ll});return(0,on.jsx)(dl,{scope:t,triggerRef:l,contentRef:c,contentId:Ti(),titleId:Ti(),descriptionId:Ti(),open:u,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};pl.displayName=ll;var hl="DialogTrigger",ml=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=fl(hl,r),a=Wa(t,o.triggerRef);return(0,on.jsx)(Ii.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fl(o.open),...n,ref:a,onClick:Si(e.onClick,o.onOpenToggle)})});ml.displayName=hl;var yl="DialogPortal",[vl,gl]=cl(yl,{forceMount:void 0}),bl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,a=fl(yl,t);return(0,on.jsx)(vl,{scope:t,forceMount:r,children:i.Children.map(n,e=>(0,on.jsx)(os,{present:r||a.open,children:(0,on.jsx)(ns,{asChild:!0,container:o,children:e})}))})};bl.displayName=yl;var xl="DialogOverlay",wl=i.forwardRef((e,t)=>{const r=gl(xl,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=fl(xl,e.__scopeDialog);return a.modal?(0,on.jsx)(os,{present:n||a.open,children:(0,on.jsx)(_l,{...o,ref:t})}):null});wl.displayName=xl;var jl=Ba("DialogOverlay.RemoveScroll"),_l=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=fl(xl,r);return(0,on.jsx)(Xs,{as:jl,allowPinchZoom:!0,shards:[o.contentRef],children:(0,on.jsx)(Ii.div,{"data-state":Fl(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),kl="DialogContent",Ol=i.forwardRef((e,t)=>{const r=gl(kl,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=fl(kl,e.__scopeDialog);return(0,on.jsx)(os,{present:n||a.open,children:a.modal?(0,on.jsx)(Sl,{...o,ref:t}):(0,on.jsx)(Nl,{...o,ref:t})})});Ol.displayName=kl;var Sl=i.forwardRef((e,t)=>{const r=fl(kl,e.__scopeDialog),n=i.useRef(null),o=Wa(t,r.contentRef,n);return i.useEffect(()=>{const e=n.current;if(e)return sl(e)},[]),(0,on.jsx)(Pl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Si(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Si(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Si(e.onFocusOutside,e=>e.preventDefault())})}),Nl=i.forwardRef((e,t)=>{const r=fl(kl,e.__scopeDialog),n=i.useRef(!1),o=i.useRef(!1);return(0,on.jsx)(Pl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const a=t.target,i=r.triggerRef.current?.contains(a);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),Pl=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,l=fl(kl,r),c=i.useRef(null),u=Wa(t,c);return ss(),(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)(Qi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,on.jsx)(qi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Fl(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)($l,{titleId:l.titleId}),(0,on.jsx)(Vl,{contentRef:c,descriptionId:l.descriptionId})]})]})}),El="DialogTitle",Cl=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=fl(El,r);return(0,on.jsx)(Ii.h2,{id:o.titleId,...n,ref:t})});Cl.displayName=El;var Rl="DialogDescription",Tl=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=fl(Rl,r);return(0,on.jsx)(Ii.p,{id:o.descriptionId,...n,ref:t})});Tl.displayName=Rl;var Al="DialogClose",Dl=i.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=fl(Al,r);return(0,on.jsx)(Ii.button,{type:"button",...n,ref:t,onClick:Si(e.onClick,()=>o.onOpenChange(!1))})});function Fl(e){return e?"open":"closed"}Dl.displayName=Al;var Il="DialogTitleWarning",[Ml,Ll]=function(e,t){const r=i.createContext(t),n=e=>{const{children:t,...n}=e,o=i.useMemo(()=>n,Object.values(n));return(0,on.jsx)(r.Provider,{value:o,children:t})};return n.displayName=e+"Provider",[n,function(n){const o=i.useContext(r);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(Il,{contentName:kl,titleName:El,docsSlug:"dialog"}),$l=({titleId:e})=>{const t=Ll(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{if(e){document.getElementById(e)}},[r,e]),null},Vl=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ll("DialogDescriptionWarning").contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)}},[r,e,t]),null},zl=pl,Ul=ml,ql=bl,Wl=wl,Bl=Ol,Hl=Cl,Zl=Tl,Kl=Dl,Gl='[cmdk-group=""]',Ql='[cmdk-group-items=""]',Yl='[cmdk-item=""]',Jl=`${Yl}:not([aria-disabled="true"])`,Xl="cmdk-item-select",ec="data-value",tc=(e,t,r)=>Oi(e,t,r),rc=i.createContext(void 0),nc=()=>i.useContext(rc),oc=i.createContext(void 0),ac=()=>i.useContext(oc),ic=i.createContext(void 0),sc=i.forwardRef((e,t)=>{let r=wc(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=wc(()=>new Set),o=wc(()=>new Map),a=wc(()=>new Map),s=wc(()=>new Set),l=bc(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:y=!1,vimBindings:v=!0,...g}=e,b=Ti(),x=Ti(),w=Ti(),j=i.useRef(null),_=kc();xc(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,k.emit()}},[d]),xc(()=>{_(6,C)},[]);let k=i.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i,s;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)E(),N(),_(1,P);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(o=document.getElementById(b))||o.focus()}if(_(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,k.emit()}),n||_(5,C),void 0!==(null==(a=l.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}k.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),O=i.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),_(2,()=>{N(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),_(3,()=>{E(),N(),r.current.value||P(),k.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=R();_(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&P(),k.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:j}),[]);function S(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:tc;return e?a(e,r.current.search,t):0}function N(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=j.current;T().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(Ql);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ql} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Ql} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=j.current)?void 0:t.querySelector(`${Gl}[${ec}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function P(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ec);k.setState("value",t||void 0)}function E(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=S(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function C(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Gl))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=j.current)?void 0:e.querySelector(`${Yl}[aria-selected="true"]`)}function T(){var e;return Array.from((null==(e=j.current)?void 0:e.querySelectorAll(Jl))||[])}function A(e){let t=T()[e];t&&k.setState("value",t.getAttribute(ec))}function D(e){var t;let r=R(),n=T(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&k.setState("value",a.getAttribute(ec))}function F(e){let t,r=R(),n=null==r?void 0:r.closest(Gl);for(;n&&!t;)n=e>0?vc(n,Gl):gc(n,Gl),t=null==n?void 0:n.querySelector(Jl);t?k.setState("value",t.getAttribute(ec)):D(e)}let I=()=>A(T().length-1),M=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):D(1)},L=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?F(-1):D(-1)};return i.createElement(Ii.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=g.onKeyDown)||t.call(g,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":v&&e.ctrlKey&&M(e);break;case"ArrowDown":M(e);break;case"p":case"k":v&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),A(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Xl);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:Sc},c),Oc(e,e=>i.createElement(oc.Provider,{value:k},i.createElement(rc.Provider,{value:O},e))))}),lc=i.forwardRef((e,t)=>{var r,n;let o=Ti(),a=i.useRef(null),s=i.useContext(ic),l=nc(),c=bc(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==s?void 0:s.forceMount;xc(()=>{if(!u)return l.item(o,null==s?void 0:s.id)},[u]);let d=_c(o,a,[e.value,e.children,a],e.keywords),f=ac(),p=jc(e=>e.value&&e.value===d.current),h=jc(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;y(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function y(){f.setState("value",d.current,!0)}if(i.useEffect(()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(Xl,m),()=>t.removeEventListener(Xl,m)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:v,value:g,onSelect:b,forceMount:x,keywords:w,...j}=e;return i.createElement(Ii.div,{ref:qa(a,t),...j,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||l.getDisablePointerSelection()?void 0:y,onClick:v?void 0:m},e.children)}),cc=i.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,s=Ti(),l=i.useRef(null),c=i.useRef(null),u=Ti(),d=nc(),f=jc(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(s)));xc(()=>d.group(s),[]),_c(s,l,[e.value,e.heading,c]);let p=i.useMemo(()=>({id:s,forceMount:o}),[o]);return i.createElement(Ii.div,{ref:qa(l,t),...a,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Oc(e,e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(ic.Provider,{value:p},e))))}),uc=i.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=i.useRef(null),a=jc(e=>!e.search);return r||a?i.createElement(Ii.div,{ref:qa(o,t),...n,"cmdk-separator":"",role:"separator"}):null}),dc=i.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,a=ac(),s=jc(e=>e.search),l=jc(e=>e.selectedItemId),c=nc();return i.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),i.createElement(Ii.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:s,onChange:e=>{o||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),fc=i.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=i.useRef(null),s=i.useRef(null),l=jc(e=>e.selectedItemId),c=nc();return i.useEffect(()=>{if(s.current&&a.current){let e,t=s.current,r=a.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),i.createElement(Ii.div,{ref:qa(a,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},Oc(e,e=>i.createElement("div",{ref:qa(s,c.listInnerRef),"cmdk-list-sizer":""},e)))}),pc=i.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:s,...l}=e;return i.createElement(zl,{open:r,onOpenChange:n},i.createElement(ql,{container:s},i.createElement(Wl,{"cmdk-overlay":"",className:o}),i.createElement(Bl,{"aria-label":e.label,"cmdk-dialog":"",className:a},i.createElement(sc,{ref:t,...l}))))}),hc=i.forwardRef((e,t)=>jc(e=>0===e.filtered.count)?i.createElement(Ii.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mc=i.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return i.createElement(Ii.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Oc(e,e=>i.createElement("div",{"aria-hidden":!0},e)))}),yc=Object.assign(sc,{List:fc,Item:lc,Input:dc,Group:cc,Separator:uc,Dialog:pc,Empty:hc,Loading:mc});function vc(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function gc(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function bc(e){let t=i.useRef(e);return xc(()=>{t.current=e}),t}var xc="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function wc(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function jc(e){let t=ac(),r=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,r,r)}function _c(e,t,r,n=[]){let o=i.useRef(),a=nc();return xc(()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());a.value(e,s,l),null==(i=t.current)||i.setAttribute(ec,s),o.current=s}),o}var kc=()=>{let[e,t]=i.useState(),r=wc(()=>new Map);return xc(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Oc({asChild:e,children:t},r){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var Sc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Nc=li("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function Pc(e){return Pc="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},Pc(e)}var Ec=["className"],Cc=["className","children"],Rc=["className"],Tc=["className"],Ac=["className"],Dc=["className"];function Fc(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 Ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fc(Object(r),!0).forEach(function(t){Mc(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fc(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Mc(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Pc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Pc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lc(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var $c=zl,Vc=Ul,zc=ql,Uc=Kl,qc=i.forwardRef(function(e,t){var r=e.className,n=Lc(e,Ec);return(0,on.jsx)(Wl,Ic({ref:t,className:bo("fixed inset-0 z-[99999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n))});qc.displayName=Wl.displayName;var Wc=i.forwardRef(function(e,t){var r=e.className,n=e.children,o=Lc(e,Cc);return(0,on.jsxs)(zc,{children:[(0,on.jsx)(qc,{}),(0,on.jsxs)(Bl,Ic(Ic({ref:t,className:bo("fixed left-[50%] top-[50%] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg","max-w-4xl z-[99999]",r)},o),{},{children:[n,(0,on.jsxs)(Kl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,on.jsx)(ci,{className:"h-4 w-4"}),(0,on.jsx)("span",{className:"sr-only",children:(0,Xo.__)("Close","trigger")})]})]}))]})});Wc.displayName=Bl.displayName;var Bc=function(e){var t=e.className,r=Lc(e,Rc);return(0,on.jsx)("div",Ic({className:bo("flex flex-col space-y-1.5 text-center sm:text-left",t)},r))};Bc.displayName="DialogHeader";var Hc=function(e){var t=e.className,r=Lc(e,Tc);return(0,on.jsx)("div",Ic({className:bo("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},r))};Hc.displayName="DialogFooter";var Zc=i.forwardRef(function(e,t){var r=e.className,n=Lc(e,Ac);return(0,on.jsx)(Hl,Ic({ref:t,className:bo("text-lg font-semibold leading-none tracking-tight",r)},n))});Zc.displayName=Hl.displayName;var Kc=i.forwardRef(function(e,t){var r=e.className,n=Lc(e,Dc);return(0,on.jsx)(Zl,Ic({ref:t,className:bo("text-sm text-muted-foreground",r)},n))});function Gc(e){return Gc="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},Gc(e)}Kc.displayName=Zl.displayName;var Qc=["className"],Yc=["className"],Jc=["className"],Xc=["className"],eu=["className"],tu=["className"];function ru(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 nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ru(Object(r),!0).forEach(function(t){ou(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ru(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ou(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Gc(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Gc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Gc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function au(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var iu=i.forwardRef(function(e,t){var r=e.className,n=au(e,Qc);return(0,on.jsx)(yc,nu({ref:t,className:bo("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r)},n))});iu.displayName=yc.displayName;var su=i.forwardRef(function(e,t){var r=e.className,n=au(e,Yc);return(0,on.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,on.jsx)(Nc,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,on.jsx)(yc.Input,nu({ref:t,className:bo("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r)},n))]})});su.displayName=yc.Input.displayName;var lu=i.forwardRef(function(e,t){var r=e.className,n=au(e,Jc);return(0,on.jsx)(yc.List,nu({ref:t,className:bo("max-h-[300px] overflow-y-auto overflow-x-hidden",r)},n))});lu.displayName=yc.List.displayName;var cu=i.forwardRef(function(e,t){return(0,on.jsx)(yc.Empty,nu({ref:t,className:"py-6 text-center text-sm"},e))});cu.displayName=yc.Empty.displayName;var uu=i.forwardRef(function(e,t){var r=e.className,n=au(e,Xc);return(0,on.jsx)(yc.Group,nu({ref:t,className:bo("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r)},n))});uu.displayName=yc.Group.displayName,i.forwardRef(function(e,t){var r=e.className,n=au(e,eu);return(0,on.jsx)(yc.Separator,nu({ref:t,className:bo("-mx-1 h-px bg-border",r)},n))}).displayName=yc.Separator.displayName;var du=i.forwardRef(function(e,t){var r=e.className,n=au(e,tu);return(0,on.jsx)(yc.Item,nu({ref:t,className:bo("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r)},n))});du.displayName=yc.Item.displayName;const fu=["top","right","bottom","left"],pu=Math.min,hu=Math.max,mu=Math.round,yu=Math.floor,vu=e=>({x:e,y:e}),gu={left:"right",right:"left",bottom:"top",top:"bottom"},bu={start:"end",end:"start"};function xu(e,t,r){return hu(e,pu(t,r))}function wu(e,t){return"function"==typeof e?e(t):e}function ju(e){return e.split("-")[0]}function _u(e){return e.split("-")[1]}function ku(e){return"x"===e?"y":"x"}function Ou(e){return"y"===e?"height":"width"}const Su=new Set(["top","bottom"]);function Nu(e){return Su.has(ju(e))?"y":"x"}function Pu(e){return ku(Nu(e))}function Eu(e){return e.replace(/start|end/g,e=>bu[e])}const Cu=["left","right"],Ru=["right","left"],Tu=["top","bottom"],Au=["bottom","top"];function Du(e,t,r,n){const o=_u(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Ru:Cu:t?Cu:Ru;case"left":case"right":return t?Tu:Au;default:return[]}}(ju(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Eu)))),a}function Fu(e){return e.replace(/left|right|bottom|top/g,e=>gu[e])}function Iu(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Mu(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Lu(e,t,r){let{reference:n,floating:o}=e;const a=Nu(t),i=Pu(t),s=Ou(i),l=ju(t),c="y"===a,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(_u(t)){case"start":p[i]-=f*(r&&c?-1:1);break;case"end":p[i]+=f*(r&&c?-1:1)}return p}async function $u(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=wu(t,e),h=Iu(p),m=s[f?"floating"===d?"reference":"floating":d],y=Mu(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},x=Mu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:g,strategy:l}):v);return{top:(y.top-x.top+h.top)/b.y,bottom:(x.bottom-y.bottom+h.bottom)/b.y,left:(y.left-x.left+h.left)/b.x,right:(x.right-y.right+h.right)/b.x}}function Vu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zu(e){return fu.some(t=>e[t]>=0)}const Uu=new Set(["left","top"]);function qu(){return"undefined"!=typeof window}function Wu(e){return Zu(e)?(e.nodeName||"").toLowerCase():"#document"}function Bu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Hu(e){var t;return null==(t=(Zu(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Zu(e){return!!qu()&&(e instanceof Node||e instanceof Bu(e).Node)}function Ku(e){return!!qu()&&(e instanceof Element||e instanceof Bu(e).Element)}function Gu(e){return!!qu()&&(e instanceof HTMLElement||e instanceof Bu(e).HTMLElement)}function Qu(e){return!(!qu()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Bu(e).ShadowRoot)}const Yu=new Set(["inline","contents"]);function Ju(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ud(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Yu.has(o)}const Xu=new Set(["table","td","th"]);function ed(e){return Xu.has(Wu(e))}const td=[":popover-open",":modal"];function rd(e){return td.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const nd=["transform","translate","scale","rotate","perspective"],od=["transform","translate","scale","rotate","perspective","filter"],ad=["paint","layout","strict","content"];function id(e){const t=sd(),r=Ku(e)?ud(e):e;return nd.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||od.some(e=>(r.willChange||"").includes(e))||ad.some(e=>(r.contain||"").includes(e))}function sd(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ld=new Set(["html","body","#document"]);function cd(e){return ld.has(Wu(e))}function ud(e){return Bu(e).getComputedStyle(e)}function dd(e){return Ku(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fd(e){if("html"===Wu(e))return e;const t=e.assignedSlot||e.parentNode||Qu(e)&&e.host||Hu(e);return Qu(t)?t.host:t}function pd(e){const t=fd(e);return cd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gu(t)&&Ju(t)?t:pd(t)}function hd(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=pd(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=Bu(o);if(a){const e=md(i);return t.concat(i,i.visualViewport||[],Ju(o)?o:[],e&&r?hd(e):[])}return t.concat(o,hd(o,[],r))}function md(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yd(e){const t=ud(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Gu(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=mu(r)!==a||mu(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function vd(e){return Ku(e)?e:e.contextElement}function gd(e){const t=vd(e);if(!Gu(t))return vu(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=yd(t);let i=(a?mu(r.width):r.width)/n,s=(a?mu(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const bd=vu(0);function xd(e){const t=Bu(e);return sd()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:bd}function wd(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=vd(e);let i=vu(1);t&&(n?Ku(n)&&(i=gd(n)):i=gd(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Bu(e))&&t}(a,r,n)?xd(a):vu(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=Bu(a),t=n&&Ku(n)?Bu(n):n;let r=e,o=md(r);for(;o&&n&&t!==r;){const e=gd(o),t=o.getBoundingClientRect(),n=ud(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,r=Bu(o),o=md(r)}}return Mu({width:u,height:d,x:l,y:c})}function jd(e,t){const r=dd(e).scrollLeft;return t?t.left+r:wd(Hu(e)).left+r}function _d(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:jd(e,n)),y:n.top+t.scrollTop}}const kd=new Set(["absolute","fixed"]);function Od(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=Bu(e),n=Hu(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=sd();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=Hu(e),r=dd(e),n=e.ownerDocument.body,o=hu(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=hu(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+jd(e);const s=-r.scrollTop;return"rtl"===ud(n).direction&&(i+=hu(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(Hu(e));else if(Ku(t))n=function(e,t){const r=wd(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Gu(e)?gd(e):vu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=xd(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Mu(n)}function Sd(e,t){const r=fd(e);return!(r===t||!Ku(r)||cd(r))&&("fixed"===ud(r).position||Sd(r,t))}function Nd(e,t,r){const n=Gu(t),o=Hu(t),a="fixed"===r,i=wd(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=vu(0);function c(){l.x=jd(o)}if(n||!n&&!a)if(("body"!==Wu(t)||Ju(o))&&(s=dd(t)),n){const e=wd(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const u=!o||n||a?vu(0):_d(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Pd(e){return"static"===ud(e).position}function Ed(e,t){if(!Gu(e)||"fixed"===ud(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Hu(e)===r&&(r=r.ownerDocument.body),r}function Cd(e,t){const r=Bu(e);if(rd(e))return r;if(!Gu(e)){let t=fd(e);for(;t&&!cd(t);){if(Ku(t)&&!Pd(t))return t;t=fd(t)}return r}let n=Ed(e,t);for(;n&&ed(n)&&Pd(n);)n=Ed(n,t);return n&&cd(n)&&Pd(n)&&!id(n)?r:n||function(e){let t=fd(e);for(;Gu(t)&&!cd(t);){if(id(t))return t;if(rd(t))return null;t=fd(t)}return null}(e)||r}const Rd={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=Hu(n),s=!!t&&rd(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=vu(1);const u=vu(0),d=Gu(n);if((d||!d&&!a)&&(("body"!==Wu(n)||Ju(i))&&(l=dd(n)),Gu(n))){const e=wd(n);c=gd(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!i||d||a?vu(0):_d(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Hu,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?rd(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=hd(e,[],!1).filter(e=>Ku(e)&&"body"!==Wu(e)),o=null;const a="fixed"===ud(e).position;let i=a?fd(e):e;for(;Ku(i)&&!cd(i);){const t=ud(i),r=id(i);r||"fixed"!==t.position||(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&kd.has(o.position)||Ju(i)&&!r&&Sd(e,i))?n=n.filter(e=>e!==i):o=t,i=fd(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=Od(t,r,o);return e.top=hu(n.top,e.top),e.right=pu(n.right,e.right),e.bottom=pu(n.bottom,e.bottom),e.left=hu(n.left,e.left),e},Od(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Cd,getElementRects:async function(e){const t=this.getOffsetParent||Cd,r=this.getDimensions,n=await r(e.floating);return{reference:Nd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=yd(e);return{width:t,height:r}},getScale:gd,isElement:Ku,isRTL:function(e){return"rtl"===ud(e).direction}};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ad(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=vd(e),u=o||a?[...c?hd(c):[],...hd(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const o=Hu(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-yu(d)+"px "+-yu(o.clientWidth-(u+f))+"px "+-yu(o.clientHeight-(d+p))+"px "+-yu(u)+"px",threshold:hu(0,pu(1,l))||1};let m=!0;function y(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Td(c,e.getBoundingClientRect())||i(),m=!1}try{n=new IntersectionObserver(y,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(y,h)}n.observe(e)}(!0),a}(c,r):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let m=l?wd(e):null;return l&&function t(){const n=wd(e);m&&!Td(m,n)&&r();m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Dd=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=ju(r),s=_u(r),l="y"===Nu(r),c=Uu.has(i)?-1:1,u=a&&l?-1:1,d=wu(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Fd=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=wu(e,t),c={x:r,y:n},u=await $u(t,l),d=Nu(ju(o)),f=ku(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=xu(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=xu(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:a,[d]:i}}}}}},Id=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...y}=wu(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const v=ju(o),g=Nu(s),b=ju(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[Fu(s)]:function(e){const t=Fu(e);return[Eu(e),t,Eu(t)]}(s)),j="none"!==h;!f&&j&&w.push(...Du(s,m,h,x));const _=[s,...w],k=await $u(t,y),O=[];let S=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&O.push(k[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=_u(e),o=Pu(e),a=Ou(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Fu(i)),[i,Fu(i)]}(o,i,x);O.push(k[e[0]],k[e[1]])}if(S=[...S,{placement:o,overflows:O}],!O.every(e=>e<=0)){var N,P;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=_[e];if(t){if(!("alignment"===d&&g!==Nu(t))||S.every(e=>e.overflows[0]>0&&Nu(e.placement)===g))return{data:{index:e,overflows:S},reset:{placement:t}}}let r=null==(P=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!r)switch(p){case"bestFit":{var E;const e=null==(E=S.filter(e=>{if(j){const t=Nu(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Md=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=wu(e,t),u=await $u(t,c),d=ju(o),f=_u(o),p="y"===Nu(o),{width:h,height:m}=a.floating;let y,v;"top"===d||"bottom"===d?(y=d,v=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,y="end"===f?"top":"bottom");const g=m-u.top-u.bottom,b=h-u.left-u.right,x=pu(m-u[y],g),w=pu(h-u[v],b),j=!t.middlewareData.shift;let _=x,k=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(k=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(_=g),j&&!f){const e=hu(u.left,0),t=hu(u.right,0),r=hu(u.top,0),n=hu(u.bottom,0);p?k=h-2*(0!==e||0!==t?e+t:hu(u.left,u.right)):_=m-2*(0!==r||0!==n?r+n:hu(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:_});const O=await i.getDimensions(s.floating);return h!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}},Ld=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=wu(e,t);switch(n){case"referenceHidden":{const e=Vu(await $u(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zu(e)}}}case"escaped":{const e=Vu(await $u(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:zu(e)}}}default:return{}}}}},$d=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=wu(e,t)||{};if(null==c)return{};const d=Iu(u),f={x:r,y:n},p=Pu(o),h=Ou(p),m=await i.getDimensions(c),y="y"===p,v=y?"top":"left",g=y?"bottom":"right",b=y?"clientHeight":"clientWidth",x=a.reference[h]+a.reference[p]-f[p]-a.floating[h],w=f[p]-a.reference[p],j=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let _=j?j[b]:0;_&&await(null==i.isElement?void 0:i.isElement(j))||(_=s.floating[b]||a.floating[h]);const k=x/2-w/2,O=_/2-m[h]/2-1,S=pu(d[v],O),N=pu(d[g],O),P=S,E=_-m[h]-N,C=_/2-m[h]/2+k,R=xu(P,C,E),T=!l.arrow&&null!=_u(o)&&C!==R&&a.reference[h]/2-(C<P?S:N)-m[h]/2<0,A=T?C<P?C-P:C-E:0;return{[p]:f[p]+A,data:{[p]:R,centerOffset:C-R-A,...T&&{alignmentOffset:A}},reset:T}}}),Vd=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=wu(e,t),u={x:r,y:n},d=Nu(o),f=ku(d);let p=u[f],h=u[d];const m=wu(s,t),y="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+y.mainAxis,r=a.reference[f]+a.reference[e]-y.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var v,g;const e="y"===f?"width":"height",t=Uu.has(ju(o)),r=a.reference[d]-a.floating[e]+(t&&(null==(v=i.offset)?void 0:v[d])||0)+(t?0:y.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?y.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[f]:p,[d]:h}}}},zd=(e,t,r)=>{const n=new Map,o={platform:Rd,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Lu(c,n,l),f=n,p={},h=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:y,y:v,data:g,reset:b}=await m({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=v?v:d,p={...p,[a]:{...p[a],...g}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Lu(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};var Ud="undefined"!=typeof document?i.useLayoutEffect:function(){};function qd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!qd(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!qd(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Wd(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bd(e,t){const r=Wd(e);return Math.round(t*r)/r}function Hd(e){const t=i.useRef(e);return Ud(()=>{t.current=e}),t}const Zd=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(o=r,{}.hasOwnProperty.call(o,"current"))?null!=r.current?$d({element:r.current,padding:n}).fn(t):{}:r?$d({element:r,padding:n}).fn(t):{};var o}}),Kd=(e,t)=>({...Dd(e),options:[e,t]}),Gd=(e,t)=>({...Fd(e),options:[e,t]}),Qd=(e,t)=>({...Vd(e),options:[e,t]}),Yd=(e,t)=>({...Id(e),options:[e,t]}),Jd=(e,t)=>({...Md(e),options:[e,t]}),Xd=(e,t)=>({...Ld(e),options:[e,t]}),ef=(e,t)=>({...Zd(e),options:[e,t]});var tf=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return(0,on.jsx)(Ii.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,on.jsx)("polygon",{points:"0,0 30,0 15,10"})})});tf.displayName="Arrow";var rf=tf;function nf(e){const[t,r]=i.useState(void 0);return Ei(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var of="Popper",[af,sf]=Ni(of),[lf,cf]=af(of),uf=e=>{const{__scopePopper:t,children:r}=e,[n,o]=i.useState(null);return(0,on.jsx)(lf,{scope:t,anchor:n,onAnchorChange:o,children:r})};uf.displayName=of;var df="PopperAnchor",ff=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=cf(df,r),s=i.useRef(null),l=Wa(t,s);return i.useEffect(()=>{a.onAnchorChange(n?.current||s.current)}),n?null:(0,on.jsx)(Ii.div,{...o,ref:l})});ff.displayName=df;var pf="PopperContent",[hf,mf]=af(pf),yf=i.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...y}=e,v=cf(pf,r),[g,b]=i.useState(null),x=Wa(t,e=>b(e)),[w,j]=i.useState(null),_=nf(w),k=_?.width??0,O=_?.height??0,S=n+("center"!==a?"-"+a:""),N="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],E=P.length>0,C={padding:N,boundary:P.filter(xf),altBoundary:E},{refs:R,floatingStyles:T,placement:A,isPositioned:D,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=i.useState(n);qd(p,n)||h(n);const[m,y]=i.useState(null),[v,g]=i.useState(null),b=i.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=i.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),w=a||m,j=s||v,_=i.useRef(null),k=i.useRef(null),O=i.useRef(d),S=null!=c,N=Hd(c),P=Hd(o),E=Hd(u),C=i.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:r,middleware:p};P.current&&(e.platform=P.current),zd(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};R.current&&!qd(O.current,t)&&(O.current=t,Fi.flushSync(()=>{f(t)}))})},[p,t,r,P,E]);Ud(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=i.useRef(!1);Ud(()=>(R.current=!0,()=>{R.current=!1}),[]),Ud(()=>{if(w&&(_.current=w),j&&(k.current=j),w&&j){if(N.current)return N.current(w,j,C);C()}},[w,j,C,N,S]);const T=i.useMemo(()=>({reference:_,floating:k,setReference:b,setFloating:x}),[b,x]),A=i.useMemo(()=>({reference:w,floating:j}),[w,j]),D=i.useMemo(()=>{const e={position:r,left:0,top:0};if(!A.floating)return e;const t=Bd(A.floating,d.x),n=Bd(A.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Wd(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,A.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:C,refs:T,elements:A,floatingStyles:D}),[d,C,T,A,D])}({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>Ad(...e,{animationFrame:"always"===h}),elements:{reference:v.anchor},middleware:[Kd({mainAxis:o+O,alignmentAxis:s}),c&&Gd({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Qd():void 0,...C}),c&&Yd({...C}),Jd({...C,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),w&&ef({element:w,padding:l}),wf({arrowWidth:k,arrowHeight:O}),p&&Xd({strategy:"referenceHidden",...C})]}),[I,M]=jf(A),L=Mi(m);Ei(()=>{D&&L?.()},[D,L]);const $=F.arrow?.x,V=F.arrow?.y,z=0!==F.arrow?.centerOffset,[U,q]=i.useState();return Ei(()=>{g&&q(window.getComputedStyle(g).zIndex)},[g]),(0,on.jsx)("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:D?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,on.jsx)(hf,{scope:r,placedSide:I,onArrowChange:j,arrowX:$,arrowY:V,shouldHideArrow:z,children:(0,on.jsx)(Ii.div,{"data-side":I,"data-align":M,...y,ref:x,style:{...y.style,animation:D?void 0:"none"}})})})});yf.displayName=pf;var vf="PopperArrow",gf={top:"bottom",right:"left",bottom:"top",left:"right"},bf=i.forwardRef(function(e,t){const{__scopePopper:r,...n}=e,o=mf(vf,r),a=gf[o.placedSide];return(0,on.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,on.jsx)(rf,{...n,ref:t,style:{...n.style,display:"block"}})})});function xf(e){return null!==e}bf.displayName=vf;var wf=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=jf(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${n.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${n.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function jf(e){const[t,r="center"]=e.split("-");return[t,r]}var _f=uf,kf=ff,Of=yf,Sf=bf,Nf="Popover",[Pf,Ef]=Ni(Nf,[sf]),Cf=sf(),[Rf,Tf]=Pf(Nf),Af=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:s=!1}=e,l=Cf(t),c=i.useRef(null),[u,d]=i.useState(!1),[f,p]=Di({prop:n,defaultProp:o??!1,onChange:a,caller:Nf});return(0,on.jsx)(_f,{...l,children:(0,on.jsx)(Rf,{scope:t,contentId:Ti(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:s,children:r})})};Af.displayName=Nf;var Df="PopoverAnchor",Ff=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Tf(Df,r),a=Cf(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return i.useEffect(()=>(s(),()=>l()),[s,l]),(0,on.jsx)(kf,{...a,...n,ref:t})});Ff.displayName=Df;var If="PopoverTrigger",Mf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Tf(If,r),a=Cf(r),i=Wa(t,o.triggerRef),s=(0,on.jsx)(Ii.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yf(o.open),...n,ref:i,onClick:Si(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:(0,on.jsx)(kf,{asChild:!0,...a,children:s})});Mf.displayName=If;var Lf="PopoverPortal",[$f,Vf]=Pf(Lf,{forceMount:void 0}),zf=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=Tf(Lf,t);return(0,on.jsx)($f,{scope:t,forceMount:r,children:(0,on.jsx)(os,{present:r||a.open,children:(0,on.jsx)(ns,{asChild:!0,container:o,children:n})})})};zf.displayName=Lf;var Uf="PopoverContent",qf=i.forwardRef((e,t)=>{const r=Vf(Uf,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=Tf(Uf,e.__scopePopover);return(0,on.jsx)(os,{present:n||a.open,children:a.modal?(0,on.jsx)(Bf,{...o,ref:t}):(0,on.jsx)(Hf,{...o,ref:t})})});qf.displayName=Uf;var Wf=Ba("PopoverContent.RemoveScroll"),Bf=i.forwardRef((e,t)=>{const r=Tf(Uf,e.__scopePopover),n=i.useRef(null),o=Wa(t,n),a=i.useRef(!1);return i.useEffect(()=>{const e=n.current;if(e)return sl(e)},[]),(0,on.jsx)(Xs,{as:Wf,allowPinchZoom:!0,children:(0,on.jsx)(Zf,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Si(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Si(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;a.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Si(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Hf=i.forwardRef((e,t)=>{const r=Tf(Uf,e.__scopePopover),n=i.useRef(!1),o=i.useRef(!1);return(0,on.jsx)(Zf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const a=t.target,i=r.triggerRef.current?.contains(a);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),Zf=i.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=Tf(Uf,r),p=Cf(r);return ss(),(0,on.jsx)(Qi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:(0,on.jsx)(qi,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:(0,on.jsx)(Of,{"data-state":Yf(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Kf="PopoverClose",Gf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Tf(Kf,r);return(0,on.jsx)(Ii.button,{type:"button",...n,ref:t,onClick:Si(e.onClick,()=>o.onOpenChange(!1))})});Gf.displayName=Kf;var Qf=i.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Cf(r);return(0,on.jsx)(Sf,{...o,...n,ref:t})});function Yf(e){return e?"open":"closed"}Qf.displayName="PopoverArrow";var Jf=zf,Xf=qf;function ep(e){return ep="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},ep(e)}var tp=["className","align","sideOffset"];function rp(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 np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rp(Object(r),!0).forEach(function(t){op(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rp(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function op(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=ep(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ep(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ep(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ap=Af,ip=Mf,sp=i.forwardRef(function(e,t){var r=e.className,n=e.align,o=void 0===n?"center":n,a=e.sideOffset,i=void 0===a?4:a,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,tp);return(0,on.jsx)(Jf,{children:(0,on.jsx)(Xf,np({ref:t,align:o,sideOffset:i,className:bo("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",r)},s))})});function lp(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return cp(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(cp(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,cp(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,cp(d,"constructor",c),cp(c,"constructor",l),l.displayName="GeneratorFunction",cp(c,o,"GeneratorFunction"),cp(d),cp(d,o,"Generator"),cp(d,n,function(){return this}),cp(d,"toString",function(){return"[object Generator]"}),(lp=function(){return{w:a,m:f}})()}function cp(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}cp=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){cp(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},cp(e,t,r,n)}function up(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function dp(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){up(a,n,o,i,s,"next",e)}function s(e){up(a,n,o,i,s,"throw",e)}i(void 0)})}}sp.displayName=Xf.displayName;function fp(e){return function(e){if(Array.isArray(e))return mp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||hp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hp(e,t){if(e){if("string"==typeof e)return mp(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)?mp(e,t):void 0}}function mp(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 yp(e){var t,r=e.selectedPlugin,n=e.onChange,o=pp((0,i.useState)([]),2),a=o[0],s=o[1],l=pp((0,i.useState)(!1),2),c=l[0],u=l[1],d=Qo({queryKey:["getPluginList"],queryFn:(t=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_plugin_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),staleTime:5e3}),f=d.data;(0,i.useEffect)(function(){f&&s(f.data)},[f]);var p=a.filter(function(e){return r.includes(e.slug)}),h=a.filter(function(e){return!r.includes(e.slug)});return(0,on.jsx)("div",{children:(0,on.jsxs)(ap,{open:c,onOpenChange:u,children:[(0,on.jsx)(ip,{asChild:!0,children:(0,on.jsxs)(oi,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between min-h-[2.5rem] h-auto p-2 bg-transparent",children:[(0,on.jsxs)("div",{className:"flex flex-wrap gap-1 flex-1",children:[p.map(function(e){return(0,on.jsxs)(vi,{variant:"default",className:"mr-1 mb-1",children:[e.label,(0,on.jsx)(oi,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:function(t){var o;t.preventDefault(),t.stopPropagation(),o=e.slug,n(r.filter(function(e){return e!==o}))},children:(0,on.jsx)(ci,{className:"h-3 w-3"})})]},e.slug)}),0===p.length&&(0,on.jsx)("span",{className:"text-muted-foreground",children:(0,Xo.__)("Select plugins you like...","versatile-toolkit")})]}),(0,on.jsx)(ui,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),(0,on.jsx)(sp,{className:"w-full p-0",align:"start",children:(0,on.jsxs)(iu,{children:[(0,on.jsx)(su,{placeholder:"Search plugin..."}),(0,on.jsxs)(lu,{children:[(0,on.jsx)(cu,{children:"No plugin found."}),(0,on.jsx)(uu,{children:[].concat(fp(h),fp(p)).map(function(e){return(0,on.jsxs)(du,{value:e.label,onSelect:function(){return t=e.slug,void(r.includes(t)?n(r.filter(function(e){return e!==t})):n([].concat(fp(r),[t])));var t},children:[(0,on.jsx)(di,{className:bo("mr-2 h-4 w-4",r.includes(e.slug)?"opacity-100":"opacity-0")}),e.label]},e.slug)})})]})]})})]})})}function vp(e){return vp="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},vp(e)}var gp=["className","type"];function bp(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 xp(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=vp(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vp(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jp,_p,kp=i.forwardRef(function(e,t){var r=e.className,n=e.type,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,gp);return(0,on.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bp(Object(r),!0).forEach(function(t){xp(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bp(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({type:n,className:bo("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t},o))});kp.displayName="Input",function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(jp||(jp={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(_p||(_p={}));const Op=jp.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sp=e=>{switch(typeof e){case"undefined":return Op.undefined;case"string":return Op.string;case"number":return Number.isNaN(e)?Op.nan:Op.number;case"boolean":return Op.boolean;case"function":return Op.function;case"bigint":return Op.bigint;case"symbol":return Op.symbol;case"object":return Array.isArray(e)?Op.array:null===e?Op.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Op.promise:"undefined"!=typeof Map&&e instanceof Map?Op.map:"undefined"!=typeof Set&&e instanceof Set?Op.set:"undefined"!=typeof Date&&e instanceof Date?Op.date:Op.object;default:return Op.unknown}},Np=jp.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Pp extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof Pp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,jp.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Pp.create=e=>new Pp(e);const Ep=(e,t)=>{let r;switch(e.code){case Np.invalid_type:r=e.received===Op.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Np.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,jp.jsonStringifyReplacer)}`;break;case Np.unrecognized_keys:r=`Unrecognized key(s) in object: ${jp.joinValues(e.keys,", ")}`;break;case Np.invalid_union:r="Invalid input";break;case Np.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${jp.joinValues(e.options)}`;break;case Np.invalid_enum_value:r=`Invalid enum value. Expected ${jp.joinValues(e.options)}, received '${e.received}'`;break;case Np.invalid_arguments:r="Invalid function arguments";break;case Np.invalid_return_type:r="Invalid function return type";break;case Np.invalid_date:r="Invalid date";break;case Np.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:jp.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Np.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Np.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Np.custom:r="Invalid input";break;case Np.invalid_intersection_types:r="Intersection results could not be merged";break;case Np.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Np.not_finite:r="Number must be finite";break;default:r=t.defaultError,jp.assertNever(e)}return{message:r}};let Cp=Ep;function Rp(){return Cp}var Tp;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(Tp||(Tp={}));const Ap=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}};function Dp(e,t){const r=Rp(),n=Ap({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ep?void 0:Ep].filter(e=>!!e)});e.common.issues.push(n)}class Fp{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return Ip;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return Fp.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status)return Ip;if("aborted"===o.status)return Ip;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===t.value||void 0===o.value&&!n.alwaysSet||(r[t.value]=o.value)}return{status:e.value,value:r}}}const Ip=Object.freeze({status:"aborted"}),Mp=e=>({status:"dirty",value:e}),Lp=e=>({status:"valid",value:e}),$p=e=>"aborted"===e.status,Vp=e=>"dirty"===e.status,zp=e=>"valid"===e.status,Up=e=>"undefined"!=typeof Promise&&e instanceof Promise;class qp{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Wp=(e,t)=>{if(zp(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Pp(e.common.issues);return this._error=t,this._error}}};function Bp(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:void 0===o.data?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class Hp{get description(){return this._def.description}_getType(e){return Sp(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sp(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fp,ctx:{common:e.parent.common,data:e.data,parsedType:Sp(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Up(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sp(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Wp(r,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sp(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return zp(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>zp(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sp(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(Up(n)?n:Promise.resolve(n));return Wp(r,o)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:Np.custom,...r(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new Wh({schema:this,typeName:Xh.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Bh.create(this,this._def)}nullable(){return Hh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Eh.create(this)}promise(){return qh.create(this,this._def)}or(e){return Th.create([this,e],this._def)}and(e){return Dh.create(this,e,this._def)}transform(e){return new Wh({...Bp(this._def),schema:this,typeName:Xh.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Zh({...Bp(this._def),innerType:this,defaultValue:t,typeName:Xh.ZodDefault})}brand(){return new Qh({typeName:Xh.ZodBranded,type:this,...Bp(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Kh({...Bp(this._def),innerType:this,catchValue:t,typeName:Xh.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Yh.create(this,e)}readonly(){return Jh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zp=/^c[^\s-]{8,}$/i,Kp=/^[0-9a-z]+$/,Gp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Yp=/^[a-z0-9_-]{21}$/i,Jp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let th;const rh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,oh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ah=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ih=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sh=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ch=new RegExp(`^${lh}$`);function uh(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function dh(e){return new RegExp(`^${uh(e)}$`)}function fh(e){let t=`${lh}T${uh(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function ph(e,t){return!("v4"!==t&&t||!rh.test(e))||!("v6"!==t&&t||!oh.test(e))}function hh(e,t){if(!Jp.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return"object"==typeof o&&null!==o&&((!("typ"in o)||"JWT"===o?.typ)&&(!!o.alg&&(!t||o.alg===t)))}catch{return!1}}function mh(e,t){return!("v4"!==t&&t||!nh.test(e))||!("v6"!==t&&t||!ah.test(e))}class yh extends Hp{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Op.string){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.string,received:t.parsedType}),Ip}const t=new Fp;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?Dp(r,{code:Np.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&Dp(r,{code:Np.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)eh.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"email",code:Np.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)th||(th=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),th.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"emoji",code:Np.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)Qp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"uuid",code:Np.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)Yp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"nanoid",code:Np.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Zp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"cuid",code:Np.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)Kp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"cuid2",code:Np.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)Gp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"ulid",code:Np.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Dp(r,{validation:"url",code:Np.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"regex",code:Np.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){fh(n).test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){ch.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){dh(n).test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?Xp.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"duration",code:Np.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?ph(e.data,n.version)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"ip",code:Np.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?hh(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"jwt",code:Np.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?mh(e.data,n.version)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"cidr",code:Np.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?ih.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"base64",code:Np.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?sh.test(e.data)||(r=this._getOrReturnCtx(e,r),Dp(r,{validation:"base64url",code:Np.invalid_string,message:n.message}),t.dirty()):jp.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:Np.invalid_string,...Tp.errToObj(r)})}_addCheck(e){return new yh({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Tp.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Tp.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Tp.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Tp.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Tp.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Tp.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Tp.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Tp.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Tp.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Tp.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Tp.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Tp.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Tp.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Tp.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Tp.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Tp.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Tp.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Tp.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Tp.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Tp.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Tp.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Tp.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Tp.errToObj(t)})}nonempty(e){return this.min(1,Tp.errToObj(e))}trim(){return new yh({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new yh({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new yh({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function vh(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}yh.create=e=>new yh({checks:[],typeName:Xh.ZodString,coerce:e?.coerce??!1,...Bp(e)});class gh extends Hp{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Op.number){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.number,received:t.parsedType}),Ip}let t;const r=new Fp;for(const n of this._def.checks)if("int"===n.kind)jp.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==vh(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.not_finite,message:n.message}),r.dirty()):jp.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Tp.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Tp.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Tp.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Tp.toString(t))}setLimit(e,t,r,n){return new gh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Tp.toString(n)}]})}_addCheck(e){return new gh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Tp.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Tp.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Tp.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Tp.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Tp.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Tp.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Tp.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Tp.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Tp.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&jp.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}gh.create=e=>new gh({checks:[],typeName:Xh.ZodNumber,coerce:e?.coerce||!1,...Bp(e)});class bh extends Hp{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Op.bigint)return this._getInvalidInput(e);let t;const r=new Fp;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Dp(t,{code:Np.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):jp.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.bigint,received:t.parsedType}),Ip}gte(e,t){return this.setLimit("min",e,!0,Tp.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Tp.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Tp.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Tp.toString(t))}setLimit(e,t,r,n){return new bh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Tp.toString(n)}]})}_addCheck(e){return new bh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Tp.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Tp.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Tp.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Tp.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Tp.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}bh.create=e=>new bh({checks:[],typeName:Xh.ZodBigInt,coerce:e?.coerce??!1,...Bp(e)});class xh extends Hp{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Op.boolean){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.boolean,received:t.parsedType}),Ip}return Lp(e.data)}}xh.create=e=>new xh({typeName:Xh.ZodBoolean,coerce:e?.coerce||!1,...Bp(e)});class wh extends Hp{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Op.date){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.date,received:t.parsedType}),Ip}if(Number.isNaN(e.data.getTime())){return Dp(this._getOrReturnCtx(e),{code:Np.invalid_date}),Ip}const t=new Fp;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),Dp(r,{code:Np.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):jp.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wh({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Tp.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Tp.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}wh.create=e=>new wh({checks:[],coerce:e?.coerce||!1,typeName:Xh.ZodDate,...Bp(e)});class jh extends Hp{_parse(e){if(this._getType(e)!==Op.symbol){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.symbol,received:t.parsedType}),Ip}return Lp(e.data)}}jh.create=e=>new jh({typeName:Xh.ZodSymbol,...Bp(e)});class _h extends Hp{_parse(e){if(this._getType(e)!==Op.undefined){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.undefined,received:t.parsedType}),Ip}return Lp(e.data)}}_h.create=e=>new _h({typeName:Xh.ZodUndefined,...Bp(e)});class kh extends Hp{_parse(e){if(this._getType(e)!==Op.null){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.null,received:t.parsedType}),Ip}return Lp(e.data)}}kh.create=e=>new kh({typeName:Xh.ZodNull,...Bp(e)});class Oh extends Hp{constructor(){super(...arguments),this._any=!0}_parse(e){return Lp(e.data)}}Oh.create=e=>new Oh({typeName:Xh.ZodAny,...Bp(e)});class Sh extends Hp{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lp(e.data)}}Sh.create=e=>new Sh({typeName:Xh.ZodUnknown,...Bp(e)});class Nh extends Hp{_parse(e){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.never,received:t.parsedType}),Ip}}Nh.create=e=>new Nh({typeName:Xh.ZodNever,...Bp(e)});class Ph extends Hp{_parse(e){if(this._getType(e)!==Op.undefined){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.void,received:t.parsedType}),Ip}return Lp(e.data)}}Ph.create=e=>new Ph({typeName:Xh.ZodVoid,...Bp(e)});class Eh extends Hp{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==Op.array)return Dp(t,{code:Np.invalid_type,expected:Op.array,received:t.parsedType}),Ip;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(Dp(t,{code:e?Np.too_big:Np.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(Dp(t,{code:Np.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(Dp(t,{code:Np.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new qp(t,e,t.path,r)))).then(e=>Fp.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new qp(t,e,t.path,r)));return Fp.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Eh({...this._def,minLength:{value:e,message:Tp.toString(t)}})}max(e,t){return new Eh({...this._def,maxLength:{value:e,message:Tp.toString(t)}})}length(e,t){return new Eh({...this._def,exactLength:{value:e,message:Tp.toString(t)}})}nonempty(e){return this.min(1,e)}}function Ch(e){if(e instanceof Rh){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Bh.create(Ch(n))}return new Rh({...e._def,shape:()=>t})}return e instanceof Eh?new Eh({...e._def,type:Ch(e.element)}):e instanceof Bh?Bh.create(Ch(e.unwrap())):e instanceof Hh?Hh.create(Ch(e.unwrap())):e instanceof Fh?Fh.create(e.items.map(e=>Ch(e))):e}Eh.create=(e,t)=>new Eh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xh.ZodArray,...Bp(t)});class Rh extends Hp{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=jp.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Op.object){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.object,received:t.parsedType}),Ip}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Nh&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new qp(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Nh){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(Dp(r,{code:Np.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new qp(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>Fp.mergeObjectSync(t,e)):Fp.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return Tp.errToObj,new Rh({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{const n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:Tp.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new Rh({...this._def,unknownKeys:"strip"})}passthrough(){return new Rh({...this._def,unknownKeys:"passthrough"})}extend(e){return new Rh({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Rh({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xh.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Rh({...this._def,catchall:e})}pick(e){const t={};for(const r of jp.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new Rh({...this._def,shape:()=>t})}omit(e){const t={};for(const r of jp.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new Rh({...this._def,shape:()=>t})}deepPartial(){return Ch(this)}partial(e){const t={};for(const r of jp.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new Rh({...this._def,shape:()=>t})}required(e){const t={};for(const r of jp.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Bh;)e=e._def.innerType;t[r]=e}return new Rh({...this._def,shape:()=>t})}keyof(){return Vh(jp.objectKeys(this.shape))}}Rh.create=(e,t)=>new Rh({shape:()=>e,unknownKeys:"strip",catchall:Nh.create(),typeName:Xh.ZodObject,...Bp(t)}),Rh.strictCreate=(e,t)=>new Rh({shape:()=>e,unknownKeys:"strict",catchall:Nh.create(),typeName:Xh.ZodObject,...Bp(t)}),Rh.lazycreate=(e,t)=>new Rh({shape:e,unknownKeys:"strip",catchall:Nh.create(),typeName:Xh.ZodObject,...Bp(t)});class Th extends Hp{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new Pp(e.ctx.common.issues));return Dp(t,{code:Np.invalid_union,unionErrors:r}),Ip});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new Pp(e));return Dp(t,{code:Np.invalid_union,unionErrors:o}),Ip}}get options(){return this._def.options}}Th.create=(e,t)=>new Th({options:e,typeName:Xh.ZodUnion,...Bp(t)});function Ah(e,t){const r=Sp(e),n=Sp(t);if(e===t)return{valid:!0,data:e};if(r===Op.object&&n===Op.object){const r=jp.objectKeys(t),n=jp.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=Ah(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===Op.array&&n===Op.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=Ah(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===Op.date&&n===Op.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Dh extends Hp{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if($p(e)||$p(n))return Ip;const o=Ah(e.value,n.value);return o.valid?((Vp(e)||Vp(n))&&t.dirty(),{status:t.value,value:o.data}):(Dp(r,{code:Np.invalid_intersection_types}),Ip)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Dh.create=(e,t,r)=>new Dh({left:e,right:t,typeName:Xh.ZodIntersection,...Bp(r)});class Fh extends Hp{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Op.array)return Dp(r,{code:Np.invalid_type,expected:Op.array,received:r.parsedType}),Ip;if(r.data.length<this._def.items.length)return Dp(r,{code:Np.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ip;!this._def.rest&&r.data.length>this._def.items.length&&(Dp(r,{code:Np.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new qp(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>Fp.mergeArray(t,e)):Fp.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Fh({...this._def,rest:e})}}Fh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fh({items:e,typeName:Xh.ZodTuple,rest:null,...Bp(t)})};class Ih extends Hp{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Op.map)return Dp(r,{code:Np.invalid_type,expected:Op.map,received:r.parsedType}),Ip;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new qp(r,e,r.path,[a,"key"])),value:o._parse(new qp(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return Ip;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return Ip;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}Ih.create=(e,t,r)=>new Ih({valueType:t,keyType:e,typeName:Xh.ZodMap,...Bp(r)});class Mh extends Hp{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Op.set)return Dp(r,{code:Np.invalid_type,expected:Op.set,received:r.parsedType}),Ip;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(Dp(r,{code:Np.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(Dp(r,{code:Np.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return Ip;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new qp(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new Mh({...this._def,minSize:{value:e,message:Tp.toString(t)}})}max(e,t){return new Mh({...this._def,maxSize:{value:e,message:Tp.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Mh.create=(e,t)=>new Mh({valueType:e,minSize:null,maxSize:null,typeName:Xh.ZodSet,...Bp(t)});class Lh extends Hp{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Lh.create=(e,t)=>new Lh({getter:e,typeName:Xh.ZodLazy,...Bp(t)});class $h extends Hp{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Dp(t,{received:t.data,code:Np.invalid_literal,expected:this._def.value}),Ip}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Vh(e,t){return new zh({values:e,typeName:Xh.ZodEnum,...Bp(t)})}$h.create=(e,t)=>new $h({value:e,typeName:Xh.ZodLiteral,...Bp(t)});class zh extends Hp{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return Dp(t,{expected:jp.joinValues(r),received:t.parsedType,code:Np.invalid_type}),Ip}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return Dp(t,{received:t.data,code:Np.invalid_enum_value,options:r}),Ip}return Lp(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return zh.create(e,{...this._def,...t})}exclude(e,t=this._def){return zh.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}zh.create=Vh;class Uh extends Hp{_parse(e){const t=jp.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Op.string&&r.parsedType!==Op.number){const e=jp.objectValues(t);return Dp(r,{expected:jp.joinValues(e),received:r.parsedType,code:Np.invalid_type}),Ip}if(this._cache||(this._cache=new Set(jp.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=jp.objectValues(t);return Dp(r,{received:r.data,code:Np.invalid_enum_value,options:e}),Ip}return Lp(e.data)}get enum(){return this._def.values}}Uh.create=(e,t)=>new Uh({values:e,typeName:Xh.ZodNativeEnum,...Bp(t)});class qh extends Hp{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Op.promise&&!1===t.common.async)return Dp(t,{code:Np.invalid_type,expected:Op.promise,received:t.parsedType}),Ip;const r=t.parsedType===Op.promise?t.data:Promise.resolve(t.data);return Lp(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}qh.create=(e,t)=>new qh({type:e,typeName:Xh.ZodPromise,...Bp(t)});class Wh extends Hp{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xh.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{Dp(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return Ip;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?Ip:"dirty"===n.status||"dirty"===t.value?Mp(n.value):n});{if("aborted"===t.value)return Ip;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?Ip:"dirty"===n.status||"dirty"===t.value?Mp(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?Ip:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?Ip:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!zp(e))return Ip;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>zp(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):Ip)}jp.assertNever(n)}}Wh.create=(e,t,r)=>new Wh({schema:e,typeName:Xh.ZodEffects,effect:t,...Bp(r)}),Wh.createWithPreprocess=(e,t,r)=>new Wh({schema:t,effect:{type:"preprocess",transform:e},typeName:Xh.ZodEffects,...Bp(r)});class Bh extends Hp{_parse(e){return this._getType(e)===Op.undefined?Lp(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bh.create=(e,t)=>new Bh({innerType:e,typeName:Xh.ZodOptional,...Bp(t)});class Hh extends Hp{_parse(e){return this._getType(e)===Op.null?Lp(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hh.create=(e,t)=>new Hh({innerType:e,typeName:Xh.ZodNullable,...Bp(t)});class Zh extends Hp{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Op.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Zh.create=(e,t)=>new Zh({innerType:e,typeName:Xh.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Bp(t)});class Kh extends Hp{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Up(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Pp(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new Pp(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Kh.create=(e,t)=>new Kh({innerType:e,typeName:Xh.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Bp(t)});class Gh extends Hp{_parse(e){if(this._getType(e)!==Op.nan){const t=this._getOrReturnCtx(e);return Dp(t,{code:Np.invalid_type,expected:Op.nan,received:t.parsedType}),Ip}return{status:"valid",value:e.data}}}Gh.create=e=>new Gh({typeName:Xh.ZodNaN,...Bp(e)});Symbol("zod_brand");class Qh extends Hp{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Yh extends Hp{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Ip:"dirty"===e.status?(t.dirty(),Mp(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?Ip:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Yh({in:e,out:t,typeName:Xh.ZodPipeline})}}class Jh extends Hp{_parse(e){const t=this._def.innerType._parse(e),r=e=>(zp(e)&&(e.value=Object.freeze(e.value)),e);return Up(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}Jh.create=(e,t)=>new Jh({innerType:e,typeName:Xh.ZodReadonly,...Bp(t)});Rh.lazycreate;var Xh;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Xh||(Xh={}));const em=yh.create,tm=(gh.create,Gh.create,bh.create,xh.create),rm=(wh.create,jh.create,_h.create,kh.create,Oh.create,Sh.create,Nh.create,Ph.create,Eh.create),nm=Rh.create,om=(Rh.strictCreate,Th.create,Dh.create,Fh.create,Ih.create,Mh.create,Lh.create,$h.create,zh.create),am=(Uh.create,qh.create,Wh.create,Bh.create,Hh.create,Wh.createWithPreprocess,Yh.create,e=>gh.create({...e,coerce:!0}));var im=/^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/,sm=nm({chosen_plugins:rm(em()),ip_tags:rm(em().refine(function(e){return im.test(e)},{message:"Invalid IP address"})).min(1,{message:"At least one IP address is required"})}),lm=nm({enable_maintenance:tm(),show_subscribers_only:tm(),title:em().min(1,{message:"Title is required"}).min(3,{message:"Title must be at least 3 characters"}),description:em().min(1,{message:"Description is required"}).min(10,{message:"Description must be at least 10 characters"}),subtitle:em().min(1,{message:"Subtitle is required"}).min(3,{message:"Subtitle must be at least 3 characters"}),background_image:em().optional(),background_image_id:am().optional(),logo:em().optional(),logo_id:am().optional(),template:em().optional()}),cm=nm({enable_comingsoon:tm(),show_subscribers_only:tm(),title:em().min(1,{message:"Title is required"}).min(3,{message:"Title must be at least 3 characters"}),description:em().min(1,{message:"Description is required"}).min(10,{message:"Description must be at least 10 characters"}),subtitle:em().min(1,{message:"Subtitle is required"}).min(3,{message:"Subtitle must be at least 3 characters"}),background_image:em().optional(),background_image_id:am().optional(),logo:em().optional(),logo_id:am().optional(),template:em().optional()}),um=nm({activeTheme:em().min(1,{message:"Please select a theme"})}),dm=nm({display_name:em().min(1,{message:"Display name is required"}),email:em().email({message:"Invalid email address"}),role:em().min(1,{message:"Please select a role"}),expires_at:om(["1_hour","3_hours","6_hours","12_hours","1_day","3_days","1_week","2_weeks","1_month","3_months","6_months","1_year","custom"],{message:"Please select an expiration time"}),redirect_url:em().url({message:"Invalid URL format"}),ip_address:em().optional().refine(function(e){return!e||im.test(e)},{message:"Invalid IP address"})});function fm(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return pm(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(pm(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,pm(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,pm(d,"constructor",c),pm(c,"constructor",l),l.displayName="GeneratorFunction",pm(c,o,"GeneratorFunction"),pm(d),pm(d,o,"Generator"),pm(d,n,function(){return this}),pm(d,"toString",function(){return"[object Generator]"}),(fm=function(){return{w:a,m:f}})()}function pm(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pm=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){pm(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},pm(e,t,r,n)}function hm(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function mm(e){return function(e){if(Array.isArray(e))return gm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||vm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ym(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||vm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vm(e,t){if(e){if("string"==typeof e)return gm(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)?gm(e,t):void 0}}function gm(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 bm(e){var t,r=e.tags,n=e.onChange,o=ym((0,i.useState)(""),2),a=o[0],s=o[1],l=ym((0,i.useState)(null),2),c=l[0],u=l[1],d=function(){var e=a.trim();e&&(im.test(e)?r.includes(e)||(n([].concat(mm(r),[e])),s(""),u(null)):u("Invalid IP address"))},f=Jo({mutationFn:(t=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_add_my_ip",e.n=1,wa($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),onSuccess:function(e){},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed to add IP","versatile-toolkit"))}}),p=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){hm(a,n,o,i,s,"next",e)}function s(e){hm(a,n,o,i,s,"throw",e)}i(void 0)})}}(fm().m(function e(){var t,o,a;return fm().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.mutateAsync({});case 1:if(t=e.v,o=t.data,a=null==o?void 0:o.ip,!r.includes(a)){e.n=2;break}return hr.success((0,Xo.__)("System Ip already added!","trigger")),e.a(2);case 2:!r.includes(a)&&a&&(n([].concat(mm(r),[a])),hr.success((0,Xo.__)("System Ip address added","trigger")));case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return(0,on.jsxs)("div",{children:[(0,on.jsxs)("div",{className:"relative",children:[(0,on.jsx)(kp,{type:"text",placeholder:"Type a tag and press Enter or click outside...",value:a,onChange:function(e){s(e.target.value),c&&u(null)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),d())},onBlur:function(e){d()}}),(0,on.jsx)(oi,{type:"button",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 px-2 py-1 h-5",onClick:p,children:(0,Xo.__)("Add My IP","versatile-toolkit")})]}),c&&(0,on.jsx)("p",{className:"text-red-500 text-sm mt-1",children:c}),(0,on.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:r.map(function(e){return(0,on.jsxs)(vi,{variant:"default",className:"flex items-center gap-1",children:[e,(0,on.jsx)(oi,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:function(){return t=e,void n(r.filter(function(e){return e!==t}));var t},children:(0,on.jsx)(ci,{className:"h-3 w-3"})})]},e)})})]})}function xm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wm(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)?wm(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wm(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 jm(e){var t,r=e.selectedTheme,n=e.onChange,o=xm((0,i.useState)([]),2),a=o[0],s=o[1],l=xm((0,i.useState)(!1),2),c=l[0],u=l[1],d=Qo({queryKey:["getThemeList"],queryFn:(t=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_theme_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),staleTime:5e3}),f=d.data;(0,i.useEffect)(function(){f&&s(f.data)},[f]);var p=a.find(function(e){return e.slug===r});return(0,on.jsx)("div",{children:(0,on.jsxs)(ap,{open:c,onOpenChange:u,children:[(0,on.jsx)(ip,{asChild:!0,children:(0,on.jsxs)(oi,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between min-h-[2.5rem] h-auto p-3 bg-transparent",children:[(0,on.jsx)("div",{className:"flex flex-wrap gap-1 flex-1 text-left",children:p?(0,on.jsx)("span",{className:"font-medium",children:p.label}):(0,on.jsx)("span",{className:"text-muted-foreground",children:(0,Xo.__)("Select a theme...","versatile-toolkit")})}),(0,on.jsx)(ui,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),(0,on.jsx)(sp,{className:"w-full p-0",align:"start",children:(0,on.jsxs)(iu,{children:[(0,on.jsx)(su,{placeholder:"Search theme..."}),(0,on.jsxs)(lu,{children:[(0,on.jsx)(cu,{children:"No theme found."}),(0,on.jsx)(uu,{children:a.map(function(e){return(0,on.jsxs)(du,{value:e.label,onSelect:function(){return t=e.slug,n(t),void u(!1);var t},children:[(0,on.jsx)(di,{className:bo("mr-2 h-4 w-4",r===e.slug?"opacity-100":"opacity-0")}),e.label]},e.slug)})})]})]})})]})})}var _m=e=>"checkbox"===e.type,km=e=>e instanceof Date,Om=e=>null==e;const Sm=e=>"object"==typeof e;var Nm=e=>!Om(e)&&!Array.isArray(e)&&Sm(e)&&!km(e),Pm=e=>Nm(e)&&e.target?_m(e.target)?e.target.checked:e.target.value:e,Em=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Cm="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Rm(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(Cm&&(e instanceof Blob||n)||!r&&!Nm(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return Nm(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Rm(e[r]));else t=e}return t}var Tm=e=>/^\w*$/.test(e),Am=e=>void 0===e,Dm=e=>Array.isArray(e)?e.filter(Boolean):[],Fm=e=>Dm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Im=(e,t,r)=>{if(!t||!Nm(e))return r;const n=(Tm(t)?[t]:Fm(t)).reduce((e,t)=>Om(e)?e:e[t],e);return Am(n)||n===e?Am(e[t])?r:e[t]:n},Mm=e=>"boolean"==typeof e,Lm=(e,t,r)=>{let n=-1;const o=Tm(t)?[t]:Fm(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=Nm(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const $m="blur",Vm="focusout",zm="change",Um="onBlur",qm="onChange",Wm="onSubmit",Bm="onTouched",Hm="all",Zm="max",Km="min",Gm="maxLength",Qm="minLength",Ym="pattern",Jm="required",Xm="validate",ey=i.createContext(null);ey.displayName="HookFormContext";const ty=()=>i.useContext(ey);var ry=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hm&&(t._proxyFormState[o]=!n||Hm),r&&(r[o]=!0),e[o]}});return o};const ny="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;var oy=e=>"string"==typeof e,ay=(e,t,r,n,o)=>oy(e)?(n&&t.watch.add(e),Im(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Im(r,e))):(n&&(t.watchAll=!0),r);function iy(e){const t=ty(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a}=e,s=Em(o._names.array,r),l=function(e){const t=ty(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:s}=e||{},l=i.useRef(o),[c,u]=i.useState(r._getWatch(n,l.current));return ny(()=>r._subscribe({name:n,formState:{values:!0},exact:s,callback:e=>!a&&u(ay(n,r._names,e.values||r._formValues,!1,l.current))}),[n,r,a,s]),i.useEffect(()=>r._removeUnmounted()),c}({control:o,name:r,defaultValue:Im(o._formValues,r,Im(o._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=ty(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[s,l]=i.useState(r._formState),c=i.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ny(()=>r._subscribe({name:o,formState:c.current,exact:a,callback:e=>{!n&&l({...r._formState,...e})}}),[o,n,a]),i.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),i.useMemo(()=>ry(s,r,c.current,!1),[s,r])}({control:o,name:r,exact:!0}),u=i.useRef(e),d=i.useRef(o.register(r,{...e.rules,value:l,...Mm(e.disabled)?{disabled:e.disabled}:{}})),f=i.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Im(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!Im(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Im(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Im(c.validatingFields,r)},error:{enumerable:!0,get:()=>Im(c.errors,r)}}),[c,r]),p=i.useCallback(e=>d.current.onChange({target:{value:Pm(e),name:r},type:zm}),[r]),h=i.useCallback(()=>d.current.onBlur({target:{value:Im(o._formValues,r),name:r},type:$m}),[r,o._formValues]),m=i.useCallback(e=>{const t=Im(o._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,r]),y=i.useMemo(()=>({name:r,value:l,...Mm(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:p,onBlur:h,ref:m}),[r,n,c.disabled,p,h,m,l]);return i.useEffect(()=>{const e=o._options.shouldUnregister||a;o.register(r,{...u.current.rules,...Mm(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=Im(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=Rm(Im(o._options.defaultValues,r));Lm(o._defaultValues,r,e),Am(Im(o._formValues,r))&&Lm(o._formValues,r,e)}return!s&&o.register(r),()=>{(s?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,s,a]),i.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),i.useMemo(()=>({field:y,formState:c,fieldState:f}),[y,c,f])}const sy=e=>e.render(iy(e));var ly=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},cy=e=>Array.isArray(e)?e:[e],uy=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},dy=e=>Om(e)||!Sm(e);function fy(e,t,r=new WeakSet){if(dy(e)||dy(t))return e===t;if(km(e)&&km(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(km(n)&&km(e)||Nm(n)&&Nm(e)||Array.isArray(n)&&Array.isArray(e)?!fy(n,e,r):n!==e)return!1}}return!0}var py=e=>Nm(e)&&!Object.keys(e).length,hy=e=>"file"===e.type,my=e=>"function"==typeof e,yy=e=>{if(!Cm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vy=e=>"select-multiple"===e.type,gy=e=>"radio"===e.type,by=e=>yy(e)&&e.isConnected;function xy(e,t){const r=Array.isArray(t)?t:Tm(t)?[t]:Fm(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Am(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(Nm(n)&&py(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Am(e[t]))return!1;return!0}(n))&&xy(e,r.slice(0,-1)),e}var wy=e=>{for(const t in e)if(my(e[t]))return!0;return!1};function jy(e,t={}){const r=Array.isArray(e);if(Nm(e)||r)for(const r in e)Array.isArray(e[r])||Nm(e[r])&&!wy(e[r])?(t[r]=Array.isArray(e[r])?[]:{},jy(e[r],t[r])):Om(e[r])||(t[r]=!0);return t}function _y(e,t,r){const n=Array.isArray(e);if(Nm(e)||n)for(const n in e)Array.isArray(e[n])||Nm(e[n])&&!wy(e[n])?Am(t)||dy(r[n])?r[n]=Array.isArray(e[n])?jy(e[n],[]):{...jy(e[n])}:_y(e[n],Om(t)?{}:t[n],r[n]):r[n]=!fy(e[n],t[n]);return r}var ky=(e,t)=>_y(e,t,jy(t));const Oy={value:!1,isValid:!1},Sy={value:!0,isValid:!0};var Ny=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Am(e[0].attributes.value)?Am(e[0].value)||""===e[0].value?Sy:{value:e[0].value,isValid:!0}:Sy:Oy}return Oy},Py=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Am(e)?e:t?""===e?NaN:e?+e:e:r&&oy(e)?new Date(e):n?n(e):e;const Ey={isValid:!1,value:null};var Cy=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Ey):Ey;function Ry(e){const t=e.ref;return hy(t)?t.files:gy(t)?Cy(e.refs).value:vy(t)?[...t.selectedOptions].map(({value:e})=>e):_m(t)?Ny(e.refs).value:Py(Am(t.value)?e.ref.value:t.value,e)}var Ty=e=>e instanceof RegExp,Ay=e=>Am(e)?e:Ty(e)?e.source:Nm(e)?Ty(e.value)?e.value.source:e.value:e,Dy=e=>({isOnSubmit:!e||e===Wm,isOnBlur:e===Um,isOnChange:e===qm,isOnAll:e===Hm,isOnTouch:e===Bm});const Fy="AsyncFunction";var Iy=e=>!!e&&!!e.validate&&!!(my(e.validate)&&e.validate.constructor.name===Fy||Nm(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Fy)),My=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Ly=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=Im(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Ly(a,t))break}else if(Nm(a)&&Ly(a,t))break}}};function $y(e,t,r){const n=Im(e,r);if(n||Tm(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=Im(t,n),i=Im(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};o.pop()}return{name:r}}var Vy=(e,t,r)=>{const n=cy(Im(e,r));return Lm(n,"root",t[r]),Lm(e,r,n),e},zy=e=>oy(e);function Uy(e,t,r="validate"){if(zy(e)||Array.isArray(e)&&e.every(zy)||Mm(e)&&!e)return{type:r,message:zy(e)?e:"",ref:t}}var qy=e=>Nm(e)&&!Ty(e)?e:{value:e,message:""},Wy=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:p,validate:h,name:m,valueAsNumber:y,mount:v}=e._f,g=Im(r,m);if(!v||t.has(m))return{};const b=s?s[0]:i,x=e=>{o&&b.reportValidity&&(b.setCustomValidity(Mm(e)?"":e||""),b.reportValidity())},w={},j=gy(i),_=_m(i),k=j||_,O=(y||hy(i))&&Am(i.value)&&Am(g)||yy(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,S=ly.bind(null,m,n,w),N=(e,t,r,n=Gm,o=Qm)=>{const a=e?t:r;w[m]={type:e?n:o,message:a,ref:i,...S(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!k&&(O||Om(g))||Mm(g)&&!g||_&&!Ny(s).isValid||j&&!Cy(s).isValid)){const{value:e,message:t}=zy(l)?{value:!!l,message:l}:qy(l);if(e&&(w[m]={type:Jm,message:t,ref:b,...S(Jm,t)},!n))return x(t),w}if(!(O||Om(d)&&Om(f))){let e,t;const r=qy(f),o=qy(d);if(Om(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;oy(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),oy(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||(g?+g:g);Om(r.value)||(e=n>r.value),Om(o.value)||(t=n<o.value)}if((e||t)&&(N(!!e,r.message,o.message,Zm,Km),!n))return x(w[m].message),w}if((c||u)&&!O&&(oy(g)||a&&Array.isArray(g))){const e=qy(c),t=qy(u),r=!Om(e.value)&&g.length>+e.value,o=!Om(t.value)&&g.length<+t.value;if((r||o)&&(N(r,e.message,t.message),!n))return x(w[m].message),w}if(p&&!O&&oy(g)){const{value:e,message:t}=qy(p);if(Ty(e)&&!g.match(e)&&(w[m]={type:Ym,message:t,ref:i,...S(Ym,t)},!n))return x(t),w}if(h)if(my(h)){const e=Uy(await h(g,r),b);if(e&&(w[m]={...e,...S(Xm,e.message)},!n))return x(e.message),w}else if(Nm(h)){let e={};for(const t in h){if(!py(e)&&!n)break;const o=Uy(await h[t](g,r),b,t);o&&(e={...o,...S(t,o.message)},x(o.message),n&&(w[m]=e))}if(!py(e)&&(w[m]={ref:b,...e},!n))return w}return x(!0),w};const By={mode:Wm,reValidateMode:qm,shouldFocusError:!0};function Hy(e={}){let t,r={...By,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:my(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(Nm(r.defaultValues)||Nm(r.values))&&Rm(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Rm(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:uy(),state:uy()},p=r.criteriaMode===Hm,h=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?py((await b()).errors):await x(o,!0);e!==n.isValid&&f.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Lm(n.validatingFields,e,t):xy(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!py(n.validatingFields)}))},y=(e,t,r,n)=>{const l=Im(o,e);if(l){const o=Im(i,e,Am(r)?Im(a,e):r);Am(o)||n&&n.defaultChecked||t?Lm(i,e,t?o:Ry(l._f)):_(e,o),s.mount&&h()}},v=(e,t,o,i,s)=>{let l=!1,c=!1;const p={name:e};if(!r.disabled){if(!o||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=p.isDirty=w(),l=c!==p.isDirty);const r=fy(Im(a,e),t);c=!!Im(n.dirtyFields,e),r?xy(n.dirtyFields,e):Lm(n.dirtyFields,e,!0),p.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(o){const t=Im(n.touchedFields,e);t||(Lm(n.touchedFields,e,o),p.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==o)}l&&s&&f.state.next(p)}return l?p:{}},g=(e,o,a,i)=>{const s=Im(n.errors,e),l=(u.isValid||d.isValid)&&Mm(o)&&n.isValid!==o;var p;if(r.delayError&&a?(p=()=>((e,t)=>{Lm(n.errors,e,t),f.state.next({errors:n.errors})})(e,a),t=e=>{clearTimeout(c),c=setTimeout(p,e)},t(r.delayError)):(clearTimeout(c),t=null,a?Lm(n.errors,e,a):xy(n.errors,e)),(a?!fy(s,a):s)||!py(i)||l){const t={...i,...l&&Mm(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},b=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=Im(t,r);e&&Lm(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},x=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&Iy(s._f);d&&u.validatingFields&&m([a],!0);const f=await Wy(s,l.disabled,i,p,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([a]),f[e.name]&&(o.valid=!1,t))break;!t&&(Im(f,e.name)?c?Vy(n.errors,f,e.name):Lm(n.errors,e.name,f[e.name]):xy(n.errors,e.name))}!py(c)&&await x(c,t,o)}}return o.valid},w=(e,t)=>!r.disabled&&(e&&t&&Lm(i,e,t),!fy(E(),a)),j=(e,t,r)=>ay(e,l,{...s.mount?i:Am(t)?a:oy(e)?{[e]:t}:t},r,t),_=(e,t,r={})=>{const n=Im(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&Lm(i,e,Py(t,r)),a=yy(r.ref)&&Om(t)?"":t,vy(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?_m(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):hy(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||f.state.next({name:e,values:Rm(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&P(e)},k=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=Im(o,i);(l.array.has(e)||Nm(a)||s&&!s._f)&&!km(a)?k(i,a,r):_(i,a,r)}},O=(e,t,r={})=>{const c=Im(o,e),p=l.array.has(e),h=Rm(t);Lm(i,e,h),p?(f.array.next({name:e,values:Rm(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:ky(a,i),isDirty:w(e,h)})):!c||c._f||Om(h)?_(e,h,r):k(e,h,r),My(e,l)&&f.state.next({...n}),f.state.next({name:s.mount?e:void 0,values:Rm(i)})},S=async e=>{s.mount=!0;const a=e.target;let c=a.name,y=!0;const w=Im(o,c),j=e=>{y=Number.isNaN(e)||km(e)&&isNaN(e.getTime())||fy(e,Im(i,c,e))},_=Dy(r.mode),k=Dy(r.reValidateMode);if(w){let s,O;const S=a.type?Ry(w._f):Pm(e),N=e.type===$m||e.type===Vm,E=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(w._f)&&!r.resolver&&!Im(n.errors,c)&&!w._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(N,Im(n.touchedFields,c),n.isSubmitted,k,_),C=My(c,l,N);Lm(i,c,S),N?(w._f.onBlur&&w._f.onBlur(e),t&&t(0)):w._f.onChange&&w._f.onChange(e);const R=v(c,S,N),T=!py(R)||C;if(!N&&f.state.next({name:c,type:e.type,values:Rm(i)}),E)return(u.isValid||d.isValid)&&("onBlur"===r.mode?N&&h():N||h()),T&&f.state.next({name:c,...C?{}:R});if(!N&&C&&f.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(j(S),y){const t=$y(n.errors,o,c),r=$y(e,o,t.name||c);s=r.error,c=r.name,O=py(e)}}else m([c],!0),s=(await Wy(w,l.disabled,i,p,r.shouldUseNativeValidation))[c],m([c]),j(S),y&&(s?O=!1:(u.isValid||d.isValid)&&(O=await x(o,!0)));y&&(w._f.deps&&P(w._f.deps),g(c,O,s,R))}},N=(e,t)=>{if(Im(n.errors,t)&&e.focus)return e.focus(),1},P=async(e,t={})=>{let a,i;const s=cy(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=Im(t,r);e?Lm(n.errors,r,e):xy(n.errors,r)}else n.errors=t;return t})(Am(e)?e:s);a=py(t),i=e?!s.some(e=>Im(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=Im(o,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&h()):i=a=await x(o);return f.state.next({...!oy(e)||(u.isValid||d.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Ly(o,N,e?s:l.mount),i},E=e=>{const t={...s.mount?i:a};return Am(e)?t:oy(e)?Im(t,e):e.map(e=>Im(t,e))},C=(e,t)=>({invalid:!!Im((t||n).errors,e),isDirty:!!Im((t||n).dirtyFields,e),error:Im((t||n).errors,e),isValidating:!!Im(n.validatingFields,e),isTouched:!!Im((t||n).touchedFields,e)}),R=(e,t,r)=>{const a=(Im(o,e,{_f:{}})._f||{}).ref,i=Im(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Lm(n.errors,e,{...u,...t,ref:a}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},T=e=>f.state.subscribe({next:t=>{var r,o,a;r=e.name,o=t.name,a=e.exact,r&&o&&r!==o&&!cy(r).some(e=>e&&(a?e===o:e.startsWith(o)||o.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:o,...a}=e;return py(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||Hm))})(t,e.formState||u,V,e.reRenderRoot)||e.callback({values:{...i},...n,...t})}}).unsubscribe,A=(e,t={})=>{for(const s of e?cy(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(xy(o,s),xy(i,s)),!t.keepError&&xy(n.errors,s),!t.keepDirty&&xy(n.dirtyFields,s),!t.keepTouched&&xy(n.touchedFields,s),!t.keepIsValidating&&xy(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&xy(a,s);f.state.next({values:Rm(i)}),f.state.next({...n,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&h()},D=({disabled:e,name:t})=>{(Mm(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},F=(e,t={})=>{let n=Im(o,e);const i=Mm(t.disabled)||Mm(r.disabled);return Lm(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?D({disabled:Mm(t.disabled)?t.disabled:r.disabled,name:e}):y(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Ay(t.min),max:Ay(t.max),minLength:Ay(t.minLength),maxLength:Ay(t.maxLength),pattern:Ay(t.pattern)}:{},name:e,onChange:S,onBlur:S,ref:i=>{if(i){F(e,t),n=Im(o,e);const r=Am(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>gy(e)||_m(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Lm(o,e,{_f:{...n._f,...s?{refs:[...l.filter(by),r,...Array.isArray(Im(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),y(e,!1,void 0,r)}else n=Im(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Em(l.array,e)||!s.action)&&l.unMount.add(e)}}},I=()=>r.shouldFocusError&&Ly(o,N,l.mount),M=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=Rm(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=Rm(t)}else await x(o);if(l.disabled.size)for(const e of l.disabled)xy(c,e);if(xy(n.errors,"root"),py(n.errors)){f.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:py(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?Rm(e):a,d=Rm(c),p=py(e),h=p?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(ky(a,i))]);for(const t of Array.from(e))Im(n.dirtyFields,t)?Lm(h,t,Im(i,t)):O(t,Im(h,t))}else{if(Cm&&Am(e))for(const e of l.mount){const t=Im(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(yy(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)O(e,Im(h,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?Rm(a):{}:Rm(h),f.array.next({values:{...h}}),f.state.next({values:{...h}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||fy(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?ky(a,i):n.dirtyFields:t.keepDefaultValues&&e?ky(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},$=(e,t)=>L(my(e)?e(i):e,t),V=e=>{n={...n,...e}},z={control:{register:F,unregister:A,getFieldState:C,handleSubmit:M,setError:R,_subscribe:T,_runSchema:b,_focusError:I,_getWatch:j,_getDirty:w,_setValid:h,_setFieldArray:(e,t=[],l,c,p=!0,h=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,h&&Array.isArray(Im(o,e))){const t=l(Im(o,e),c.argA,c.argB);p&&Lm(o,e,t)}if(h&&Array.isArray(Im(n.errors,e))){const t=l(Im(n.errors,e),c.argA,c.argB);p&&Lm(n.errors,e,t),((e,t)=>{!Dm(Im(e,t)).length&&xy(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&h&&Array.isArray(Im(n.touchedFields,e))){const t=l(Im(n.touchedFields,e),c.argA,c.argB);p&&Lm(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=ky(a,i)),f.state.next({name:e,isDirty:w(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Lm(i,e,t)},_setDisabledField:D,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Dm(Im(s.mount?i:a,e,r.shouldUnregister?Im(a,e,[]):[])),_reset:L,_resetDefaultValues:()=>my(r.defaultValues)&&r.defaultValues().then(e=>{$(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=Im(o,e);t&&(t._f.refs?t._f.refs.every(e=>!by(e)):!by(t._f.ref))&&A(e)}l.unMount=new Set},_disableForm:e=>{Mm(e)&&(f.state.next({disabled:e}),Ly(o,(t,r)=>{const n=Im(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},T({...e,formState:d})),trigger:P,register:F,handleSubmit:M,watch:(e,t)=>my(e)?f.state.subscribe({next:r=>e(j(void 0,t),r)}):j(e,t,!0),setValue:O,getValues:E,reset:$,resetField:(e,t={})=>{Im(o,e)&&(Am(t.defaultValue)?O(e,Rm(Im(a,e))):(O(e,t.defaultValue),Lm(a,e,Rm(t.defaultValue))),t.keepTouched||xy(n.touchedFields,e),t.keepDirty||(xy(n.dirtyFields,e),n.isDirty=t.defaultValue?w(e,Rm(Im(a,e))):w()),t.keepError||(xy(n.errors,e),u.isValid&&h()),f.state.next({...n}))},clearErrors:e=>{e&&cy(e).forEach(e=>xy(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:A,setError:R,setFocus:(e,t={})=>{const r=Im(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&my(e.select)&&e.select())}},getFieldState:C};return{...z,formControl:z}}function Zy(e={}){const t=i.useRef(void 0),r=i.useRef(void 0),[n,o]=i.useState({isDirty:!1,isValidating:!1,isLoading:my(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:my(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!my(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...o}=Hy(e);t.current={...o,formState:n}}const a=t.current.control;return a._options=e,ny(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),i.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),i.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),i.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),i.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),i.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),i.useEffect(()=>{e.values&&!fy(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,o(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),i.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=ry(n,a),t.current}const Ky=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Im(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Gy=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Ky(n.ref,r,e):n.refs&&n.refs.forEach(t=>Ky(t,r,e))}},Qy=(e,t)=>{t.shouldUseNativeValidation&&Gy(e,t);const r={};for(const n in e){const o=Im(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(Yy(t.names||Object.keys(e),n)){const e=Object.assign({},Im(r,n));Lm(e,"root",a),Lm(r,n,e)}else Lm(r,n,a)}return r},Yy=(e,t)=>e.some(e=>e.startsWith(t+"."));var Jy=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=ly(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},Xy=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&Gy({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:Qy(Jy(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}};const ev=li("MoveLeft",[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);const tv=function(e){var t=e.link,r=void 0===t?"/":t;return(0,on.jsx)(on.Fragment,{children:(0,on.jsx)(ct,{to:r,className:"flex items-center justify-center text-slate-700 bg-slate-200 hover:bg-slate-300 px-2 rounded-sm transition-colors",children:(0,on.jsx)(ev,{className:"w-4"})})})};function rv(e){return rv="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},rv(e)}function nv(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return ov(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ov(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ov(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ov(d,"constructor",c),ov(c,"constructor",l),l.displayName="GeneratorFunction",ov(c,o,"GeneratorFunction"),ov(d),ov(d,o,"Generator"),ov(d,n,function(){return this}),ov(d,"toString",function(){return"[object Generator]"}),(nv=function(){return{w:a,m:f}})()}function ov(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ov=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){ov(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},ov(e,t,r,n)}function av(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 iv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?av(Object(r),!0).forEach(function(t){sv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):av(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function sv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=rv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lv(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function cv(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){lv(a,n,o,i,s,"next",e)}function s(e){lv(a,n,o,i,s,"throw",e)}i(void 0)})}}const uv=function(){var e,t,r,n,o,a=Zy({resolver:Xy(sm),defaultValues:{chosen_plugins:[],ip_tags:[]}}),s=a.handleSubmit,l=a.control,c=a.formState.errors,u=Jo({mutationFn:(n=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_save_disable_plugin_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return n.apply(this,arguments)}),onSuccess:function(e){var t;hr.success(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Plugin disabled successfully!","versatile-toolkit"))},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed to disable plugin","versatile-toolkit"))}}),d=function(){var e=cv(nv().m(function e(t){return nv().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.mutateAsync(iv({},t));case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),f=Qo({queryKey:["getDisablePluginList"],queryFn:(o=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_disable_plugin_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return o.apply(this,arguments)}),staleTime:5e3}),p=f.data,h=f.isFetching,m=(f.isLoading,f.isError,null==p?void 0:p.data.chosen_plugins),y=null==p?void 0:p.data.ip_tags;(0,i.useEffect)(function(){(m||y)&&l._reset({chosen_plugins:m||[],ip_tags:y||[]})},[m,y,l]);var v,g,b=Zy({resolver:Xy(um),defaultValues:{activeTheme:""}}),x=b.handleSubmit,w=b.control,j=b.formState.errors,_=Jo({mutationFn:(v=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_save_active_theme",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return v.apply(this,arguments)}),onSuccess:function(e){var t;hr.success(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Theme activated successfully!","versatile-toolkit"))},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed to activate theme","versatile-toolkit"))}}),k=function(){var e=cv(nv().m(function e(t){return nv().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,_.mutateAsync(iv({},t));case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),O=Qo({queryKey:["getActiveTheme"],queryFn:(g=dp(lp().m(function e(t){var r;return lp().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_active_theme",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return g.apply(this,arguments)}),staleTime:5e3}),S=O.data,N=O.isFetching,P=null==S?void 0:S.data.activeTheme;return(0,i.useEffect)(function(){P&&w._reset({activeTheme:P})},[P,w]),(0,on.jsxs)("div",{className:"p-4 space-y-6 max-w-[800px]",children:[(0,on.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,on.jsx)(tv,{link:"/"}),(0,Xo.__)("Deactivate Plugins","versatile-toolkit")]}),(0,on.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,on.jsx)("h3",{className:"text-lg font-semibold mb-2",children:(0,Xo.__)("Disable Plugin by IP address","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:(0,Xo.__)("Select plugins to disable for specific IP addresses. This is useful for troubleshooting plugin conflicts.","versatile-toolkit")}),(0,on.jsxs)("form",{onSubmit:s(d),children:[(0,on.jsxs)("div",{className:"min-h-[42px]",children:[h?(0,on.jsx)(Da,{size:"md",text:(0,Xo.__)("Loading plugins","versatile-toolkit")}):(0,on.jsx)(sy,{name:"chosen_plugins",control:l,render:function(e){var t=e.field;return(0,on.jsx)(yp,{selectedPlugin:t.value,onChange:t.onChange})}}),c.chosen_plugins&&(0,on.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==c||null===(e=c.chosen_plugins)||void 0===e?void 0:e.message})]}),(0,on.jsxs)("div",{className:"min-h-[64px] mt-2",children:[h?(0,on.jsx)(Da,{size:"md",text:(0,Xo.__)("Loading settings","versatile-toolkit")}):(0,on.jsx)(sy,{name:"ip_tags",control:l,render:function(e){var t=e.field;return(0,on.jsx)(bm,{tags:t.value,onChange:t.onChange})}}),c.ip_tags&&(0,on.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==c||null===(t=c.ip_tags)||void 0===t?void 0:t.message})]}),(0,on.jsx)(oi,{type:"submit",className:"mt-6",disabled:u.isPending,children:u.isPending?(0,Xo.__)("Saving...","versatile-toolkit"):(0,Xo.__)("Save List","versatile-toolkit")})]})]}),(0,on.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,on.jsx)("h3",{className:"text-lg font-semibold mb-2",children:(0,Xo.__)("Switch Theme","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:(0,Xo.__)("Select and activate a theme.","versatile-toolkit")}),(0,on.jsxs)("form",{onSubmit:x(k),children:[(0,on.jsxs)("div",{className:"min-h-[42px]",children:[N?(0,on.jsx)(Da,{size:"md",text:(0,Xo.__)("Loading themes","versatile-toolkit")}):(0,on.jsx)(sy,{name:"activeTheme",control:w,render:function(e){var t=e.field;return(0,on.jsx)(jm,{selectedTheme:t.value,onChange:t.onChange})}}),j.activeTheme&&(0,on.jsx)("p",{className:"text-red-500 text-sm mt-1",children:null==j||null===(r=j.activeTheme)||void 0===r?void 0:r.message})]}),(0,on.jsx)(oi,{type:"submit",className:"mt-6",disabled:_.isPending,children:(0,on.jsx)(Ra,{isLoading:_.isPending,loadingText:(0,Xo.__)("Activating","versatile-toolkit"),children:(0,Xo.__)("Activate Theme","versatile-toolkit")})})]})]})]})};var dv=i.forwardRef((e,t)=>(0,on.jsx)(Ii.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));dv.displayName="Label";var fv=dv;function pv(e){return pv="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},pv(e)}var hv=["className"];function mv(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 yv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=pv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=pv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vv=Ja("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gv=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,hv);return(0,on.jsx)(fv,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mv(Object(r),!0).forEach(function(t){yv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({ref:t,className:bo(vv(),r)},n))});function bv(e){return bv="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},bv(e)}gv.displayName=fv.displayName;var xv=["className"],wv=["className"],jv=["className"],_v=["className","children"];function kv(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ov(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 Sv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ov(Object(r),!0).forEach(function(t){Nv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ov(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Nv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=bv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=bv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pv(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ev.apply(null,arguments)}var Cv=e=>{const{children:t,...r}=e;return i.createElement(ey.Provider,{value:r},t)},Rv=i.createContext({}),Tv=function(e){var t=Ev({},(Pv(e),e));return(0,on.jsx)(Rv.Provider,{value:{name:t.name},children:(0,on.jsx)(sy,Sv({},t))})},Av=function(){var e=i.useContext(Rv),t=i.useContext(Dv),r=ty(),n=r.getFieldState,o=r.formState,a=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");var s=t.id;return Sv({id:s,name:e.name,formItemId:"".concat(s,"-form-item"),formDescriptionId:"".concat(s,"-form-item-description"),formMessageId:"".concat(s,"-form-item-message")},a)},Dv=i.createContext({}),Fv=i.forwardRef(function(e,t){var r=e.className,n=kv(e,xv),o=i.useId();return(0,on.jsx)(Dv.Provider,{value:{id:o},children:(0,on.jsx)("div",Sv({ref:t,className:bo("space-y-2",r)},n))})});Fv.displayName="FormItem";var Iv=i.forwardRef(function(e,t){var r=e.className,n=kv(e,wv),o=Av(),a=o.error,i=o.formItemId;return(0,on.jsx)(gv,Sv({ref:t,className:bo(a&&"text-destructive",r),htmlFor:i},n))});Iv.displayName="FormLabel";var Mv=i.forwardRef(function(e,t){var r=Ev({},(Pv(e),e)),n=Av(),o=n.error,a=n.formItemId,i=n.formDescriptionId,s=n.formMessageId;return(0,on.jsx)(Ha,Sv({ref:t,id:a,"aria-describedby":o?"".concat(i," ").concat(s):"".concat(i),"aria-invalid":!!o},r))});Mv.displayName="FormControl";var Lv=i.forwardRef(function(e,t){var r=e.className,n=kv(e,jv),o=Av().formDescriptionId;return(0,on.jsx)("p",Sv({ref:t,id:o,className:bo("text-[0.8rem] text-muted-foreground",r)},n))});Lv.displayName="FormDescription";var $v=i.forwardRef(function(e,t){var r,n=e.className,o=e.children,a=kv(e,_v),i=Av(),s=i.error,l=i.formMessageId,c=s?String(null!==(r=null==s?void 0:s.message)&&void 0!==r?r:""):o;return c?(0,on.jsx)("p",Sv(Sv({ref:t,id:l,className:bo("text-[0.8rem] font-medium text-destructive",n)},a),{},{children:c})):null});function Vv(e){return Vv="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},Vv(e)}$v.displayName="FormMessage";var zv=["className"];function Uv(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 qv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Vv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Vv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vv(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Wv=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,zv);return(0,on.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uv(Object(r),!0).forEach(function(t){qv(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:bo("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t},n))});function Bv(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Wv.displayName="Textarea";var Hv="Switch",[Zv,Kv]=Ni(Hv),[Gv,Qv]=Zv(Hv),Yv=i.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:s,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[p,h]=i.useState(null),m=Wa(t,e=>h(e)),y=i.useRef(!1),v=!p||(d||!!p.closest("form")),[g,b]=Di({prop:o,defaultProp:a??!1,onChange:u,caller:Hv});return(0,on.jsxs)(Gv,{scope:r,checked:g,disabled:l,children:[(0,on.jsx)(Ii.button,{type:"button",role:"switch","aria-checked":g,"aria-required":s,"data-state":tg(g),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:m,onClick:Si(e.onClick,e=>{b(e=>!e),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&(0,on.jsx)(eg,{control:p,bubbles:!y.current,name:n,value:c,checked:g,required:s,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});Yv.displayName=Hv;var Jv="SwitchThumb",Xv=i.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=Qv(Jv,r);return(0,on.jsx)(Ii.span,{"data-state":tg(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});Xv.displayName=Jv;var eg=i.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},a)=>{const s=i.useRef(null),l=Wa(s,a),c=Bv(r),u=nf(t);return i.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==r&&o){const t=new Event("click",{bubbles:n});o.call(e,r),e.dispatchEvent(t)}},[c,r,n]),(0,on.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:l,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function tg(e){return e?"checked":"unchecked"}eg.displayName="SwitchBubbleInput";var rg=Yv,ng=Xv;function og(e){return og="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},og(e)}var ag=["className"];function ig(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 sg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ig(Object(r),!0).forEach(function(t){lg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ig(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function lg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=og(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=og(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==og(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cg=i.forwardRef(function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ag);return(0,on.jsx)(rg,sg(sg({className:bo("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r)},n),{},{ref:t,children:(0,on.jsx)(ng,{className:bo("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});function ug(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dg(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)?dg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dg(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}cg.displayName=rg.displayName;const fg=function(e){var t=e.value,r=void 0===t?"":t,n=e.onChange,o=e.buttonText,a=void 0===o?(0,Xo.__)("Upload Image","versatile-toolkit"):o,s=e.allowedTypes,l=void 0===s?["image"]:s,c=e.multiple,u=void 0!==c&&c,d=ug((0,i.useState)(r),2),f=d[0],p=d[1],h=ug((0,i.useState)(0),2),m=(h[0],h[1]);(0,i.useEffect)(function(){p(r)},[r]);return(0,on.jsxs)("div",{className:"space-y-4",children:[(0,on.jsxs)("div",{className:"flex gap-2",children:[(0,on.jsx)(oi,{type:"button",variant:"outline",onClick:function(){if(void 0!==window.wp&&window.wp.media){var e=window.wp.media({title:(0,Xo.__)("Select Image","versatile-toolkit"),button:{text:(0,Xo.__)("Use this image","versatile-toolkit")},multiple:u,library:{type:l}});e.on("select",function(){var t=e.state().get("selection").first().toJSON();p(t.url),m(t.id),n(t.url,t.id)}),e.open()}},children:a}),f&&(0,on.jsx)(oi,{type:"button",variant:"destructive",size:"sm",onClick:function(){p(""),m(0),n("",0)},children:(0,Xo.__)("Remove","versatile-toolkit")})]}),f&&(0,on.jsxs)("div",{className:"mt-4",children:[(0,on.jsx)("div",{className:"border rounded-lg p-2 inline-block bg-gray-50",children:(0,on.jsx)("img",{src:f,alt:(0,Xo.__)("Preview","versatile-toolkit"),className:"max-w-xs max-h-32 object-cover rounded"})}),(0,on.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:(0,Xo.__)("Image selected","versatile-toolkit")})]})]})},pg=li("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var hg=function(e){var t=e.isOpen,r=e.onClose;(0,i.useEffect)(function(){var e=function(e){"Escape"===e.key&&t&&r()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[t,r]);return{handleBackdropClick:function(e){e.target===e.currentTarget&&r()}}};function mg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return yg(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)?yg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yg(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}const vg=function(e){var t,r,n,o,a=e.type,s=e.disabled,l=void 0!==s&&s,c=e.getFormData,u=mg((0,i.useState)(!1),2),d=u[0],f=u[1],p=mg((0,i.useState)(!1),2),h=p[0],m=p[1],y=function(){f(!1),m(!1)},v=hg({isOpen:d,onClose:y}).handleBackdropClick;return(0,on.jsxs)(on.Fragment,{children:[(0,on.jsxs)(oi,{type:"button",variant:"outline",onClick:function(){f(!0),m(!0)},disabled:l,className:"flex items-center gap-2 border-gray-400",children:[(0,on.jsx)(pg,{size:16}),(0,Xo.__)("Preview","versatile-toolkit")]}),d&&(0,on.jsx)("div",{className:"fixed inset-x-0 bottom-0 -top-[15px] z-[999999] flex items-center justify-center bg-black bg-opacity-85",onClick:v,children:(0,on.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-11/12 h-5/6 max-w-6xl flex flex-col",children:[(0,on.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,on.jsx)("h3",{className:"text-lg font-semibold",children:"maintenance"===a?(0,Xo.__)("Maintenance Page Preview","versatile-toolkit"):(0,Xo.__)("Coming Soon Page Preview","versatile-toolkit")}),(0,on.jsx)(oi,{variant:"ghost",size:"sm",onClick:y,className:"h-8 w-8 p-0",children:(0,on.jsx)(ci,{size:16})})]}),(0,on.jsx)("div",{className:"flex-1 p-4",children:(0,on.jsxs)("div",{className:"w-full h-full border rounded-lg overflow-hidden bg-gray-50",children:[h&&(0,on.jsx)(Ia,{}),(0,on.jsx)("iframe",{src:(t=null==$o?void 0:$o.ajax_url,r=null==$o?void 0:$o.nonce_value,n="maintenance"===a?"versatile_preview_maintenance":"versatile_preview_comingsoon",o=JSON.stringify(c()),"".concat(t,"?action=").concat(n,"&versatile_nonce=").concat(r,"&type=").concat(a,"&preview_data=").concat(encodeURIComponent(o))),className:"w-full h-full border-0",title:"maintenance"===a?(0,Xo.__)("Maintenance Preview","versatile-toolkit"):(0,Xo.__)("Coming Soon Preview","versatile-toolkit"),onLoad:function(){return m(!1)},style:{display:h?"none":"block"}})]})}),(0,on.jsx)("div",{className:"p-4 border-t bg-gray-50 rounded-b-lg",children:(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("p",{className:"text-sm text-gray-600",children:(0,Xo.__)("This is how your page will look to visitors.","versatile-toolkit")}),(0,on.jsx)(oi,{onClick:y,variant:"outline",children:(0,Xo.__)("Close Preview","versatile-toolkit")})]})})]})})]})};function gg(e){return gg="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},gg(e)}var bg=["className"];function xg(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 wg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=gg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=gg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jg(e){var t=e.className,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,bg);return(0,on.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xg(Object(r),!0).forEach(function(t){wg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({className:bo("animate-pulse rounded-md bg-primary/10",t)},r))}function _g(){return(0,on.jsxs)("div",{className:"flex flex-col space-y-3",children:[(0,on.jsx)(jg,{className:"h-[45px] w-[200px] rounded-xl"}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)(jg,{className:"h-4 w-[200px]"}),(0,on.jsx)(jg,{className:"h-4 w-[200px]"})]})]})}const kg=li("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Og=li("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Sg=li("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function Ng(e){return Ng="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},Ng(e)}function Pg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dg(n.key),n)}}function Eg(e,t,r){return t=Rg(t),function(e,t){if(t&&("object"==Ng(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cg()?Reflect.construct(t,r||[],Rg(e).constructor):t.apply(e,r))}function Cg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Cg=function(){return!!e})()}function Rg(e){return Rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rg(e)}function Tg(e,t){return Tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tg(e,t)}function Ag(e,t,r){return(t=Dg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dg(e){var t=function(e,t){if("object"!=Ng(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ng(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ng(t)?t:t+""}var Fg=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ag(r=Eg(this,t,[e]),"handleRetry",function(){r.setState({hasError:!1,error:null,errorInfo:null,showErrorDetails:!1})}),Ag(r,"toggleErrorDetails",function(){r.setState(function(e){return{showErrorDetails:!e.showErrorDetails}})}),r.state={hasError:!1,error:null,errorInfo:null,showErrorDetails:!1},r}return function(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&&Tg(e,t)}(t,e),function(e,t,r){return t&&Pg(e.prototype,t),r&&Pg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,errorInfo:t}),this.props.onError&&this.props.onError(e,t),window.console&&window.console.error&&window.console.error("Versatile Plugin Error:",{error:e.message,stack:e.stack,componentStack:t.componentStack})}},{key:"render",value:function(){var e;return this.state.hasError?this.props.fallback?this.props.fallback:(0,on.jsxs)(Ro,{className:"max-w-2xl mx-auto mt-8 border-red-200 bg-red-50",children:[(0,on.jsxs)(To,{className:"text-center",children:[(0,on.jsx)("div",{className:"flex justify-center mb-4",children:(0,on.jsx)(kg,{className:"h-12 w-12 text-red-500"})}),(0,on.jsx)(Ao,{className:"text-red-700",children:(0,Xo.__)("Something went wrong","versatile-toolkit")})]}),(0,on.jsxs)(Do,{className:"space-y-4",children:[(0,on.jsx)("p",{className:"text-center text-gray-600",children:(0,Xo.__)("We encountered an unexpected error. Please try refreshing the page or contact support if the problem persists.","versatile-toolkit")}),(0,on.jsxs)("div",{className:"flex justify-center gap-3",children:[(0,on.jsxs)(oi,{onClick:this.handleRetry,className:"flex items-center gap-2",children:[(0,on.jsx)(Og,{className:"h-4 w-4"}),(0,Xo.__)("Try Again","versatile-toolkit")]}),!1!==this.props.showDetails&&(0,on.jsxs)(oi,{variant:"outline",onClick:this.toggleErrorDetails,className:"flex items-center gap-2",children:[(0,on.jsx)(Sg,{className:"h-4 w-4"}),this.state.showErrorDetails?(0,Xo.__)("Hide Details","versatile-toolkit"):(0,Xo.__)("Show Details","versatile-toolkit")]})]}),this.state.showErrorDetails&&this.state.error&&(0,on.jsxs)("div",{className:"mt-6 p-4 bg-gray-100 rounded-lg border",children:[(0,on.jsx)("h4",{className:"font-semibold text-sm mb-2 text-gray-700",children:(0,Xo.__)("Error Details:","versatile-toolkit")}),(0,on.jsxs)("div",{className:"text-xs font-mono text-gray-600 space-y-2",children:[(0,on.jsxs)("div",{children:[(0,on.jsx)("strong",{children:(0,Xo.__)("Message:","versatile-toolkit")}),(0,on.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words",children:this.state.error.message})]}),this.state.error.stack&&(0,on.jsxs)("div",{children:[(0,on.jsx)("strong",{children:(0,Xo.__)("Stack Trace:","versatile-toolkit")}),(0,on.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:this.state.error.stack})]}),(null===(e=this.state.errorInfo)||void 0===e?void 0:e.componentStack)&&(0,on.jsxs)("div",{children:[(0,on.jsx)("strong",{children:(0,Xo.__)("Component Stack:","versatile-toolkit")}),(0,on.jsx)("pre",{className:"mt-1 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:this.state.errorInfo.componentStack})]})]})]})]})]}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0,error:e}}}])}(i.Component);const Ig=Fg;function Mg(e){return function(e){if(Array.isArray(e))return Vg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||$g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $g(e,t){if(e){if("string"==typeof e)return Vg(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)?Vg(e,t):void 0}}function Vg(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}var zg=[{id:"classic",name:(0,Xo.__)("Classic","versatile-toolkit"),description:(0,Xo.__)("Clean and professional design with centered content","versatile-toolkit")},{id:"modern",name:(0,Xo.__)("Modern","versatile-toolkit"),description:(0,Xo.__)("Sleek design with gradient backgrounds and modern typography","versatile-toolkit")},{id:"minimal",name:(0,Xo.__)("Minimal","versatile-toolkit"),description:(0,Xo.__)("Simple and elegant with focus on content","versatile-toolkit")},{id:"creative",name:(0,Xo.__)("Creative","versatile-toolkit"),description:(0,Xo.__)("Bold design with creative layouts and animations","versatile-toolkit")},{id:"corporate",name:(0,Xo.__)("Corporate","versatile-toolkit"),description:(0,Xo.__)("Professional business design with elegant typography","versatile-toolkit")},{id:"neon",name:(0,Xo.__)("Neon","versatile-toolkit"),description:(0,Xo.__)("Cyberpunk-inspired design with glowing neon effects","versatile-toolkit")}],Ug=function(e){return"maintenance"===e?"versatile_maintenance_template_preview":"versatile_comingsoon_template_preview"};const qg=function(e){var t,r,n=e.selectedTemplate,o=e.onTemplateSelect,a=e.type,s=e.formData,l=e.getFormData,c=Lg((0,i.useState)(null),2),u=c[0],d=c[1],f=Lg((0,i.useState)(!1),2),p=f[0],h=f[1],m=(0,i.useState)(function(){var e=zg.findIndex(function(e){return e.id===n});if(-1===e)return zg;var t=zg[e],r=zg.filter(function(t,r){return r!==e});return[t].concat(Mg(r))}),y=Lg(m,1)[0],v=function(e){o(e)},g=function(){d(null),h(!1)},b=(0,i.useMemo)(function(){var e=l();return e?JSON.stringify(e):""},[s]);(0,i.useEffect)(function(){var e=setTimeout(function(){document.querySelectorAll(".iframe-loading").forEach(function(e){var t=e;"none"!==t.style.display&&(t.style.display="none")})},3e3);return function(){return clearTimeout(e)}},[b]);var x=hg({isOpen:!!u,onClose:g}).handleBackdropClick;return(0,on.jsxs)("div",{className:"space-y-4",children:[(0,on.jsx)("div",{className:"flex gap-4 overflow-x-auto p-2 scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:y.map(function(e){return(0,on.jsx)(Ig,{fallback:(0,on.jsx)(Ro,{className:"cursor-pointer flex-shrink-0 w-64 border-red-200 bg-red-50",children:(0,on.jsxs)(Do,{className:"p-4",children:[(0,on.jsx)("div",{className:"w-full h-32 rounded-md bg-red-100 flex items-center justify-center",children:(0,on.jsx)("p",{className:"text-red-600 text-sm",children:(0,Xo.__)("Template Error","versatile-toolkit")})}),(0,on.jsx)("h3",{className:"font-medium mt-2 text-red-700",children:e.name}),(0,on.jsx)("p",{className:"text-sm text-red-600",children:(0,Xo.__)("Failed to load template","versatile-toolkit")})]})}),children:(0,on.jsx)(Ro,{className:"cursor-pointer transition-all duration-200 hover:shadow-lg flex-shrink-0 w-64 ".concat(n===e.id?"ring-2 ring-blue-500 shadow-lg":"hover:ring-1 hover:ring-gray-300"),onClick:function(){return v(e.id)},children:(0,on.jsxs)(Do,{className:"p-4",children:[(0,on.jsxs)("div",{className:"relative mb-3",children:[(0,on.jsxs)("div",{className:"w-full h-32 rounded-md bg-gray-100 overflow-hidden border relative",children:[(0,on.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100",children:(0,on.jsxs)("div",{className:"text-center p-4",children:[(0,on.jsxs)("div",{className:"text-2xl mb-2",children:["classic"===e.id&&"📄","modern"===e.id&&"🎨","minimal"===e.id&&"✨","creative"===e.id&&"🎭","corporate"===e.id&&"🏢","neon"===e.id&&"⚡"]}),(0,on.jsx)("p",{className:"text-xs font-medium text-gray-700",children:e.name}),(0,on.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:(null==s?void 0:s.title)||"Preview"}),(null==s?void 0:s.background_image)&&(0,on.jsx)("div",{className:"absolute inset-0 opacity-20",children:(0,on.jsx)("img",{src:s.background_image,alt:"",className:"w-full h-full object-cover"})})]})}),(0,on.jsx)(Ig,{fallback:null,onError:function(t){var r=document.querySelector(".template-".concat(e.id," .iframe-loading"));r&&(r.style.display="none")},children:(0,on.jsx)("iframe",{src:"".concat($o.ajax_url,"?action=").concat(Ug(a),"&versatile_nonce=").concat($o.nonce_value,"&template_id=").concat(e.id,"&type=").concat(a,"&preview_mode=thumbnail").concat(s?"&preview_data=".concat(encodeURIComponent(b)):""),className:"w-full h-full border-0 pointer-events-none absolute top-0 left-0 hidden",title:"".concat(e.name," Preview"),style:{transform:"scale(0.25)",transformOrigin:"top left",width:"400%",height:"400%"},onLoad:function(e){var t,r,n=e.currentTarget,o=null===(t=n.parentElement)||void 0===t?void 0:t.querySelector("div:not(.iframe-loading)");o&&n&&(o.style.display="none",n.classList.remove("hidden"));var a=null===(r=n.parentElement)||void 0===r?void 0:r.querySelector(".iframe-loading");a&&(a.style.display="none")},onError:function(e){var t,r=null===(t=e.currentTarget.parentElement)||void 0===t?void 0:t.querySelector(".iframe-loading");r&&(r.style.display="none")}},"".concat(e.id,"-").concat(b))})]}),n===e.id&&(0,on.jsx)("div",{className:"absolute top-2 right-2 bg-blue-500 text-white rounded-full p-1 z-10",children:(0,on.jsx)(di,{size:16})}),(0,on.jsx)("div",{className:"absolute inset-0 bg-gray-100 flex items-center justify-center rounded-md iframe-loading",children:(0,on.jsx)(_g,{})})]}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsx)("h4",{className:"font-semibold text-sm",children:e.name}),(0,on.jsx)("p",{className:"text-xs text-gray-600 line-clamp-2",children:e.description}),(0,on.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,on.jsx)(oi,{type:"button",size:"sm",variant:n===e.id?"default":"outline",onClick:function(t){t.stopPropagation(),v(e.id)},className:"flex-1 text-xs",children:n===e.id?(0,Xo.__)("Selected","versatile-toolkit"):(0,Xo.__)("Select","versatile-toolkit")}),(0,on.jsx)(oi,{type:"button",size:"sm",variant:"ghost",onClick:function(t){var r;t.stopPropagation(),r=e.id,d(r),h(!0)},className:"text-xs",children:(0,Xo.__)("Preview","versatile-toolkit")})]})]})]})})},e.id)})}),u&&(0,on.jsx)("div",{className:"template-preview-wrapper fixed inset-x-0 -top-[15px] bottom-0 z-[99999] flex items-center justify-center bg-black bg-opacity-85",onClick:x,children:(0,on.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-11/12 h-5/6 max-w-6xl flex flex-col",children:[(0,on.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,on.jsxs)("h3",{className:"text-lg font-semibold",children:[null===(t=zg.find(function(e){return e.id===u}))||void 0===t?void 0:t.name," - ",(0,Xo.__)(" Template Preview","versatile-toolkit")]}),(0,on.jsx)(oi,{type:"button",variant:"ghost",size:"sm",onClick:g,children:(0,on.jsx)(ci,{size:16})})]}),(0,on.jsx)("div",{className:"flex-1 p-4",children:(0,on.jsxs)("div",{className:"w-full h-full border rounded-lg overflow-hidden bg-gray-50 relative",children:[p&&(0,on.jsx)(Ia,{}),(0,on.jsx)("iframe",{src:"".concat($o.ajax_url,"?action=").concat(Ug(a),"&versatile_nonce=").concat($o.nonce_value,"&template_id=").concat(u,"&type=").concat(a,"&preview_mode=thumbnail&preview_data=").concat(encodeURIComponent(JSON.stringify(l()))),className:"w-full h-full border-0",title:(0,Xo.__)("Template Preview","versatile-toolkit"),onLoad:function(){return h(!1)},style:{display:p?"none":"block"}})]})}),(0,on.jsxs)("div",{className:"p-4 border-t bg-gray-50 flex justify-between items-center",children:[(0,on.jsx)("p",{className:"text-sm text-gray-600",children:null===(r=zg.find(function(e){return e.id===u}))||void 0===r?void 0:r.description}),(0,on.jsxs)("div",{className:"flex gap-2",children:[(0,on.jsx)(oi,{type:"button",onClick:function(){u&&(v(u),g())},children:(0,Xo.__)("Use This Template","versatile-toolkit")}),(0,on.jsx)(oi,{type:"button",variant:"outline",onClick:g,children:(0,Xo.__)("Close","versatile-toolkit")})]})]})]})})]})};function Wg(e){return Wg="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},Wg(e)}function Bg(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 Hg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bg(Object(r),!0).forEach(function(t){Zg(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Zg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Wg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Wg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kg(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Gg(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Gg(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Gg(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Gg(d,"constructor",c),Gg(c,"constructor",l),l.displayName="GeneratorFunction",Gg(c,o,"GeneratorFunction"),Gg(d),Gg(d,o,"Generator"),Gg(d,n,function(){return this}),Gg(d,"toString",function(){return"[object Generator]"}),(Kg=function(){return{w:a,m:f}})()}function Gg(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Gg=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){Gg(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},Gg(e,t,r,n)}function Qg(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Jg(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)?Jg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jg(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}const Xg=function(){var e=Yg((0,i.useState)(!1),2),t=e[0],r=e[1],n=Yg((0,i.useState)(void 0),2),o=n[0],a=n[1],s=function(){return l.getValues()},l=Zy({resolver:Xy(lm),defaultValues:{enable_maintenance:!0,show_subscribers_only:!1,title:"",description:"",subtitle:"",template:"classic",background_image:"",background_image_id:0,logo:"",logo_id:0}}),c=l.handleSubmit,u=function(){var e,t=sn();return Jo({mutationFn:(e=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_maintenance_mood",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var r;hr.success(null!==(r=e.message)&&void 0!==r?r:(0,Xo.__)("Maintenance Mood info updated!","versatile-toolkit")),t.invalidateQueries({queryKey:["getMoodInfo"]})},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed while updating maintenance mood","versatile-toolkit"))}})}(),d=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Qg(a,n,o,i,s,"next",e)}function s(e){Qg(a,n,o,i,s,"throw",e)}i(void 0)})}}(Kg().m(function e(t){return Kg().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,u.mutateAsync(t);case 1:e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),f=Na(),p=f.data,h=f.isLoading,m=null==p?void 0:p.data.maintenance;return(0,i.useEffect)(function(){m&&(l.reset({enable_maintenance:null==p?void 0:p.data.enable_maintenance,show_subscribers_only:m.show_subscribers_only||!1,title:m.title||"",description:m.description||"",subtitle:m.subtitle||"",template:m.template||"classic",background_image:m.background_image||"",background_image_id:m.background_image_id||0,logo:m.logo||"",logo_id:m.logo_id||0}),r(!0))},[m]),(0,on.jsx)("div",{className:"",children:h||!t?(0,on.jsx)(Fa,{}):(0,on.jsx)(Ig,{onError:function(e,t){},fallback:(0,on.jsxs)("div",{className:"p-6 border border-red-200 bg-red-50 rounded-md",children:[(0,on.jsx)("h3",{className:"text-lg font-medium text-red-700 mb-2",children:(0,Xo.__)("Form Error","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-red-600",children:(0,Xo.__)("There was a problem loading the maintenance settings form. Please try refreshing the page or contact support.","versatile-toolkit")}),(0,on.jsx)(oi,{className:"mt-4",onClick:function(){return window.location.reload()},children:(0,Xo.__)("Refresh Page","versatile-toolkit")})]}),children:(0,on.jsx)(Cv,Hg(Hg({},l),{},{children:(0,on.jsxs)("form",{onSubmit:c(d,function(e){}),children:[(0,on.jsxs)("div",{className:"flex justify-between pb-5",children:[(0,on.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,on.jsx)(tv,{}),(0,Xo.__)("Maintenance Mood","versatile-toolkit")]}),(0,on.jsxs)("div",{className:"flex gap-5",children:[(0,on.jsx)(oi,{type:"submit",disabled:u.isPending,children:u.isPending?(0,Xo.__)("Saving...","versatile-toolkit"):(0,Xo.__)("Save Settings","versatile-toolkit")}),(0,on.jsx)(Ig,{fallback:(0,on.jsx)(oi,{variant:"outline",disabled:!0,children:(0,Xo.__)("Preview Unavailable","versatile-toolkit")}),children:(0,on.jsx)(vg,{type:"maintenance",disabled:u.isPending,getFormData:s})})]})]}),(0,on.jsx)("div",{children:(0,on.jsx)(Tv,{control:l.control,name:"template",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Choose Template","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(Ig,{fallback:(0,on.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,on.jsx)("p",{className:"text-red-700 text-sm",children:(0,Xo.__)("Template selector failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,on.jsx)(qg,{selectedTemplate:t.value||"classic",onTemplateSelect:t.onChange,type:"maintenance",formData:o,getFormData:s})})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Select a design template for your maintenance page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})}),(0,on.jsxs)("div",{className:"flex gap-10 mt-5",children:[(0,on.jsxs)("div",{className:"w-1/2",children:[(0,on.jsx)(Tv,{control:l.control,name:"enable_maintenance",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Iv,{className:"text-foreground",htmlFor:"enable_maintenance",children:(0,Xo.__)("Enable Maintenance Mood","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(cg,{id:"enable_maintenance",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Enable or disable maintenance mode for your site.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:l.control,name:"show_subscribers_only",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Iv,{className:"text-foreground",htmlFor:"show_subscribers_only",children:(0,Xo.__)("Show Only for Users","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(cg,{id:"show_subscribers_only",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("When enabled, maintenance mode will only be shown to subscribers. Other users will see the normal site.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:l.control,name:"title",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Title","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,Hg({placeholder:(0,Xo.__)("Enter maintenance title","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("This will be displayed as the main heading.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:l.control,name:"subtitle",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Subtitle","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,Hg({placeholder:(0,Xo.__)("Enter subtitle","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Optional subtitle under the title.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:l.control,name:"description",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Description","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(Wv,Hg({placeholder:(0,Xo.__)("Describe what is happening...","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Provide more details about the maintenance.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})]}),(0,on.jsxs)("div",{className:"w-1/2",children:[(0,on.jsx)(Tv,{control:l.control,name:"background_image",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Background Image","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(Ig,{fallback:(0,on.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,on.jsx)("p",{className:"text-red-700 text-sm",children:(0,Xo.__)("Media uploader failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,on.jsx)(fg,{value:t.value||"",onChange:function(e,r){t.onChange(e),a(l.getValues())},buttonText:(0,Xo.__)("Upload Background Image","versatile-toolkit"),allowedTypes:["image"]})})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Upload a background image for the maintenance page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:l.control,name:"logo",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Logo","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(Ig,{fallback:(0,on.jsx)("div",{className:"p-4 border border-red-200 bg-red-50 rounded-md",children:(0,on.jsx)("p",{className:"text-red-700 text-sm",children:(0,Xo.__)("Media uploader failed to load. Please try refreshing the page.","versatile-toolkit")})}),children:(0,on.jsx)(fg,{value:t.value||"",onChange:function(e,r){t.onChange(e),a(l.getValues())},buttonText:(0,Xo.__)("Upload Logo","versatile-toolkit"),allowedTypes:["image"]})})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Upload a logo to display on the maintenance page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})]})]})]})}))})})};const eb=function(){return(0,on.jsx)("div",{className:"p-4 space-y-6",children:(0,on.jsx)(Xg,{})})};function tb(e){return tb="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},tb(e)}function rb(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 nb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rb(Object(r),!0).forEach(function(t){ob(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ob(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=tb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=tb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ab(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return ib(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(ib(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ib(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ib(d,"constructor",c),ib(c,"constructor",l),l.displayName="GeneratorFunction",ib(c,o,"GeneratorFunction"),ib(d),ib(d,o,"Generator"),ib(d,n,function(){return this}),ib(d,"toString",function(){return"[object Generator]"}),(ab=function(){return{w:a,m:f}})()}function ib(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ib=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){ib(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},ib(e,t,r,n)}function sb(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function lb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cb(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)?cb(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cb(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}const ub=function(){var e=lb((0,i.useState)(!1),2),t=e[0],r=e[1],n=lb((0,i.useState)(void 0),2),o=n[0],a=n[1],s=Zy({resolver:Xy(cm),defaultValues:{enable_comingsoon:!0,show_subscribers_only:!1,title:"",description:"",subtitle:"",template:"classic",background_image:"",background_image_id:0,logo:"",logo_id:0}}),l=s.handleSubmit,c=function(){return s.getValues()},u=function(){var e,t=sn();return Jo({mutationFn:(e=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_comingsoon_mood",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var r;hr.success(null!==(r=e.message)&&void 0!==r?r:(0,Xo.__)("Comingsoon Mood info updated!","versatile-toolkit")),t.invalidateQueries({queryKey:["getMoodInfo"]})},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed while updating Comingsoon mood","versatile-toolkit"))}})}(),d=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){sb(a,n,o,i,s,"next",e)}function s(e){sb(a,n,o,i,s,"throw",e)}i(void 0)})}}(ab().m(function e(t){return ab().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,u.mutateAsync(t);case 1:e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),f=Na(),p=f.data,h=f.isLoading,m=null==p?void 0:p.data.comingsoon;return(0,i.useEffect)(function(){m&&(s.reset({enable_comingsoon:null==p?void 0:p.data.enable_comingsoon,show_subscribers_only:m.show_subscribers_only||!1,title:m.title||"",description:m.description||"",subtitle:m.subtitle||"",template:m.template||"classic",background_image:m.background_image||"",background_image_id:m.background_image_id||0,logo:m.logo||"",logo_id:m.logo_id||0}),r(!0))},[m]),(0,on.jsx)("div",{className:"",children:h||!t?(0,on.jsx)(Fa,{}):(0,on.jsx)(Cv,nb(nb({},s),{},{children:(0,on.jsxs)("form",{onSubmit:l(d,function(e){}),children:[(0,on.jsxs)("div",{className:"flex justify-between pb-5",children:[(0,on.jsxs)("h2",{className:"flex items-center gap-2 text-2xl",children:[(0,on.jsx)(tv,{}),(0,Xo.__)("Comingsoon Mood","versatile-toolkit")]}),(0,on.jsxs)("div",{className:"flex gap-5",children:[(0,on.jsx)(oi,{type:"submit",disabled:u.isPending,children:(0,on.jsx)(Ra,{isLoading:u.isPending,loadingText:(0,Xo.__)("Saving","versatile-toolkit"),children:(0,Xo.__)("Save Settings","versatile-toolkit")})}),(0,on.jsx)(vg,{type:"comingsoon",disabled:u.isPending,getFormData:c})]})]}),(0,on.jsx)("div",{children:(0,on.jsx)(Tv,{control:s.control,name:"template",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Choose Template","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(qg,{selectedTemplate:t.value||"classic",onTemplateSelect:t.onChange,type:"comingsoon",formData:o,getFormData:c})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Select a design template for your coming soon page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})}),(0,on.jsxs)("div",{className:"flex gap-10 mt-5",children:[(0,on.jsxs)("div",{className:"w-1/2",children:[(0,on.jsx)(Tv,{control:s.control,name:"enable_comingsoon",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Iv,{className:"text-foreground",htmlFor:"enable_comingsoon",children:(0,Xo.__)("Enable Comingsoon Mood","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(cg,{id:"enable_comingsoon",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,on.jsxs)(Lv,{children:[(0,Xo.__)("This will be displayed as the main heading.","versatile-toolkit"),(0,Xo.__)("Enable the coming soon page for your website.","versatile-toolkit")]}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:s.control,name:"show_subscribers_only",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)(Iv,{className:"text-foreground",htmlFor:"show_subscribers_only",children:(0,Xo.__)("Show Only for Users","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(cg,{id:"show_subscribers_only",checked:t.value,onCheckedChange:t.onChange})})]}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("When enabled, coming soon mode will only be shown to subscribers. Other users will see the normal site.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:s.control,name:"title",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Title","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,nb({placeholder:(0,Xo.__)("Enter coming soon title","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("This will be displayed as the main heading.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:s.control,name:"subtitle",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Subtitle","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,nb({placeholder:(0,Xo.__)("Enter subtitle","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Optional subtitle under the title.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:s.control,name:"description",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Description","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(Wv,nb({placeholder:(0,Xo.__)("Describe what is happening...","versatile-toolkit")},t))}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Provide more details about the coming soon.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})]}),(0,on.jsxs)("div",{className:"w-1/2",children:[(0,on.jsx)(Tv,{control:s.control,name:"background_image",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Background Image","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(fg,{value:t.value||"",onChange:function(e,r){t.onChange(e),a(s.getValues())},buttonText:(0,Xo.__)("Upload Background Image","versatile-toolkit"),allowedTypes:["image"]})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Upload a background image for the coming soon page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:s.control,name:"logo",render:function(e){var t=e.field,r=e.fieldState;return(0,on.jsxs)(Fv,{className:"mt-6",children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Logo","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(fg,{value:t.value||"",onChange:function(e,r){t.onChange(e),a(s.getValues())},buttonText:(0,Xo.__)("Upload Logo","versatile-toolkit"),allowedTypes:["image"]})}),!r.error&&(0,on.jsx)(Lv,{children:(0,Xo.__)("Upload a logo to display on the coming soon page.","versatile-toolkit")}),(0,on.jsx)($v,{})]})}})]})]})]})}))})};const db=function(){return(0,on.jsx)("div",{className:"p-4 space-y-6",children:(0,on.jsx)(ub,{})})};function fb(e){return fb="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},fb(e)}var pb=["className"],hb=["className"],mb=["className"],yb=["className"],vb=["className"],gb=["className"],bb=["className"],xb=["className"];function wb(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 jb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wb(Object(r),!0).forEach(function(t){_b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=fb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=fb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kb(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ob=i.forwardRef(function(e,t){var r=e.className,n=kb(e,pb);return(0,on.jsx)("div",{className:"relative w-full overflow-auto",children:(0,on.jsx)("table",jb({ref:t,className:bo("w-full caption-bottom text-sm",r)},n))})});Ob.displayName="Table";var Sb=i.forwardRef(function(e,t){var r=e.className,n=kb(e,hb);return(0,on.jsx)("thead",jb({ref:t,className:bo("[&_tr]:border-b",r)},n))});Sb.displayName="TableHeader";var Nb=i.forwardRef(function(e,t){var r=e.className,n=kb(e,mb);return(0,on.jsx)("tbody",jb({ref:t,className:bo("[&_tr:last-child]:border-0",r)},n))});Nb.displayName="TableBody",i.forwardRef(function(e,t){var r=e.className,n=kb(e,yb);return(0,on.jsx)("tfoot",jb({ref:t,className:bo("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",r)},n))}).displayName="TableFooter";var Pb=i.forwardRef(function(e,t){var r=e.className,n=kb(e,vb);return(0,on.jsx)("tr",jb({ref:t,className:bo("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r)},n))});Pb.displayName="TableRow";var Eb=i.forwardRef(function(e,t){var r=e.className,n=kb(e,gb);return(0,on.jsx)("th",jb({ref:t,className:bo("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",r)},n))});Eb.displayName="TableHead";var Cb=i.forwardRef(function(e,t){var r=e.className,n=kb(e,bb);return(0,on.jsx)("td",jb({ref:t,className:bo("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",r)},n))});Cb.displayName="TableCell",i.forwardRef(function(e,t){var r=e.className,n=kb(e,xb);return(0,on.jsx)("caption",jb({ref:t,className:bo("mt-4 text-sm text-muted-foreground",r)},n))}).displayName="TableCaption";const Rb=li("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),Tb=li("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Ab=li("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),Db=li("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),Fb=li("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Ib=li("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Mb=function(e){return new Date(e)<new Date},Lb=function(e){var t=new Date(e);return t<new Date?(0,Xo.__)("Expired","versatile-toolkit"):t.toLocaleString()},$b=function(e){var t=new Date,r={"1_hour":36e5,"3_hours":108e5,"6_hours":216e5,"12_hours":432e5,"1_day":864e5,"3_days":2592e5,"1_week":6048e5,"2_weeks":12096e5,"1_month":2592e6,"3_months":7776e6,"6_months":15552e6,"1_year":31536e6}[e]||0;return new Date(t.getTime()+r).toString()},Vb=function(e){var t=new Date(e),r=new Date,n=t.getTime()-r.getTime();if(n<=0)return(0,Xo.__)("Expired","versatile-toolkit");var o=Math.floor(n/864e5),a=Math.floor(n%864e5/36e5),i=Math.floor(n%36e5/6e4);return o>0?"".concat(o,"d ").concat(a,"h ").concat(i,"m remaining"):a>0?"".concat(a,"h ").concat(i,"m remaining"):"".concat(i,"m remaining")};function zb(e){return zb="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},zb(e)}function Ub(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 qb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ub(Object(r),!0).forEach(function(t){Wb(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ub(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Wb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=zb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=zb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bb(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Hb(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Hb(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Hb(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Hb(d,"constructor",c),Hb(c,"constructor",l),l.displayName="GeneratorFunction",Hb(c,o,"GeneratorFunction"),Hb(d),Hb(d,o,"Generator"),Hb(d,n,function(){return this}),Hb(d,"toString",function(){return"[object Generator]"}),(Bb=function(){return{w:a,m:f}})()}function Hb(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Hb=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){Hb(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},Hb(e,t,r,n)}function Zb(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Kb(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Zb(a,n,o,i,s,"next",e)}function s(e){Zb(a,n,o,i,s,"throw",e)}i(void 0)})}}var Gb,Qb,Yb,Jb,Xb,ex,tx,rx=[{value:"1_hour",label:(0,Xo.__)("1 Hour","versatile-toolkit")},{value:"3_hours",label:(0,Xo.__)("3 Hours","versatile-toolkit")},{value:"6_hours",label:(0,Xo.__)("6 Hours","versatile-toolkit")},{value:"12_hours",label:(0,Xo.__)("12 Hours","versatile-toolkit")},{value:"1_day",label:(0,Xo.__)("1 Day","versatile-toolkit")},{value:"3_days",label:(0,Xo.__)("3 Days","versatile-toolkit")},{value:"1_week",label:(0,Xo.__)("1 Week","versatile-toolkit")},{value:"2_weeks",label:(0,Xo.__)("2 Weeks","versatile-toolkit")},{value:"1_month",label:(0,Xo.__)("1 Month","versatile-toolkit")},{value:"3_months",label:(0,Xo.__)("3 Months","versatile-toolkit")},{value:"6_months",label:(0,Xo.__)("6 Months","versatile-toolkit")},{value:"1_year",label:(0,Xo.__)("1 Year","versatile-toolkit")}],nx={getAvailableRoles:(tx=Kb(Bb().m(function e(){var t,r;return Bb().w(function(e){for(;;)switch(e.n){case 0:return t={action:"versatile_get_available_roles"},e.n=1,ba($o.ajax_url,{body:t});case 1:if(200===(r=e.v).status_code){e.n=2;break}throw new Error(r.message||(0,Xo.__)("Failed to get available roles","versatile-toolkit"));case 2:return e.a(2,r.data)}},e)})),function(){return tx.apply(this,arguments)}),createTempLogin:(ex=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb(qb({action:"versatile_create_temp_login"},t),{},{expires_at:Lb($b(t.expires_at))}),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to create temporary login","versatile-toolkit"));case 2:return e.a(2,n)}},e)})),function(e){return ex.apply(this,arguments)}),getTempLoginList:(Xb=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb({action:"versatile_get_temp_login_list"},t),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to get temporary login list","versatile-toolkit"));case 2:return e.a(2,n.data)}},e)})),function(e){return Xb.apply(this,arguments)}),toggleTempLoginStatus:(Jb=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb({action:"versatile_toggle_temp_login_status"},t),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to toggle temporary login status","versatile-toolkit"));case 2:return e.a(2,n)}},e)})),function(e){return Jb.apply(this,arguments)}),deleteTempLogin:(Yb=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb({action:"versatile_delete_temp_login"},t),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to delete temporary login","versatile-toolkit"));case 2:return e.a(2,n)}},e)})),function(e){return Yb.apply(this,arguments)}),updateTempLogin:(Qb=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb({action:"versatile_update_temp_login"},t),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to update temporary login","versatile-toolkit"));case 2:return e.a(2,n)}},e)})),function(e){return Qb.apply(this,arguments)}),extendTempLoginTime:(Gb=Kb(Bb().m(function e(t){var r,n;return Bb().w(function(e){for(;;)switch(e.n){case 0:return r=qb(qb({action:"versatile_extend_temp_login_time"},t),{},{extend_by:Lb($b(t.extend_by))}),e.n=1,ba($o.ajax_url,{body:r});case 1:if(200===(n=e.v).status_code){e.n=2;break}throw new Error(n.message||(0,Xo.__)("Failed to extend temporary login time","versatile-toolkit"));case 2:return e.a(2,n)}},e)})),function(e){return Gb.apply(this,arguments)})},ox=function(){return Qo({queryKey:["available-roles"],queryFn:nx.getAvailableRoles,refetchOnWindowFocus:!1})};function ax(e,[t,r]){return Math.min(r,Math.max(t,e))}var ix=new WeakMap;Map;function sx(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const r=function(e,t){const r=e.length,n=lx(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}(e,t);return-1===r?void 0:e[r]}function lx(e){return e!=e||0===e?0:Math.trunc(e)}var cx=i.createContext(void 0);var ux=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dx=i.forwardRef((e,t)=>(0,on.jsx)(Ii.span,{...e,ref:t,style:{...ux,...e.style}}));dx.displayName="VisuallyHidden";var fx=[" ","Enter","ArrowUp","ArrowDown"],px=[" ","Enter"],hx="Select",[mx,yx,vx]=function(e){const t=e+"CollectionProvider",[r,n]=Ni(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:r}=e,n=i.useRef(null),a=i.useRef(new Map).current;return(0,on.jsx)(o,{scope:t,itemMap:a,collectionRef:n,children:r})};s.displayName=t;const l=e+"CollectionSlot",c=Ba(l),u=i.forwardRef((e,t)=>{const{scope:r,children:n}=e,o=Wa(t,a(l,r).collectionRef);return(0,on.jsx)(c,{ref:o,children:n})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Ba(d),h=i.forwardRef((e,t)=>{const{scope:r,children:n,...o}=e,s=i.useRef(null),l=Wa(t,s),c=a(d,r);return i.useEffect(()=>(c.itemMap.set(s,{ref:s,...o}),()=>{c.itemMap.delete(s)})),(0,on.jsx)(p,{[f]:"",ref:l,children:n})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(t){const r=a(e+"CollectionConsumer",t),n=i.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},n]}(hx),[gx,bx]=Ni(hx,[vx,sf]),xx=sf(),[wx,jx]=gx(hx),[_x,kx]=gx(hx),Ox=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:m}=e,y=xx(t),[v,g]=i.useState(null),[b,x]=i.useState(null),[w,j]=i.useState(!1),_=function(e){const t=i.useContext(cx);return e||t||"ltr"}(u),[k,O]=Di({prop:n,defaultProp:o??!1,onChange:a,caller:hx}),[S,N]=Di({prop:s,defaultProp:l,onChange:c,caller:hx}),P=i.useRef(null),E=!v||(m||!!v.closest("form")),[C,R]=i.useState(new Set),T=Array.from(C).map(e=>e.props.value).join(";");return(0,on.jsx)(_f,{...y,children:(0,on.jsxs)(wx,{required:h,scope:t,trigger:v,onTriggerChange:g,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:j,contentId:Ti(),value:S,onValueChange:N,open:k,onOpenChange:O,dir:_,triggerPointerDownPosRef:P,disabled:p,children:[(0,on.jsx)(mx.Provider,{scope:t,children:(0,on.jsx)(_x,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:i.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:r})}),E?(0,on.jsxs)(pw,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:S,onChange:e=>N(e.target.value),disabled:p,form:m,children:[void 0===S?(0,on.jsx)("option",{value:""}):null,Array.from(C)]},T):null]})})};Ox.displayName=hx;var Sx="SelectTrigger",Nx=i.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,a=xx(r),s=jx(Sx,r),l=s.disabled||n,c=Wa(t,s.onTriggerChange),u=yx(r),d=i.useRef("touch"),[f,p,h]=mw(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===s.value),n=yw(t,e,r);void 0!==n&&s.onValueChange(n.value)}),m=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,on.jsx)(kf,{asChild:!0,...a,children:(0,on.jsx)(Ii.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":hw(s.value)?"":void 0,...o,ref:c,onClick:Si(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&m(e)}),onPointerDown:Si(o.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(m(e),e.preventDefault())}),onKeyDown:Si(o.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||fx.includes(e.key)&&(m(),e.preventDefault())})})})});Nx.displayName=Sx;var Px="SelectValue",Ex=i.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:a,placeholder:i="",...s}=e,l=jx(Px,r),{onValueNodeHasChildrenChange:c}=l,u=void 0!==a,d=Wa(t,l.onValueNodeChange);return Ei(()=>{c(u)},[c,u]),(0,on.jsx)(Ii.span,{...s,ref:d,style:{pointerEvents:"none"},children:hw(l.value)?(0,on.jsx)(on.Fragment,{children:i}):a})});Ex.displayName=Px;var Cx=i.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return(0,on.jsx)(Ii.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Cx.displayName="SelectIcon";var Rx=e=>(0,on.jsx)(ns,{asChild:!0,...e});Rx.displayName="SelectPortal";var Tx="SelectContent",Ax=i.forwardRef((e,t)=>{const r=jx(Tx,e.__scopeSelect),[n,o]=i.useState();if(Ei(()=>{o(new DocumentFragment)},[]),!r.open){const t=n;return t?Fi.createPortal((0,on.jsx)(Fx,{scope:e.__scopeSelect,children:(0,on.jsx)(mx.Slot,{scope:e.__scopeSelect,children:(0,on.jsx)("div",{children:e.children})})}),t):null}return(0,on.jsx)(Lx,{...e,ref:t})});Ax.displayName=Tx;var Dx=10,[Fx,Ix]=gx(Tx),Mx=Ba("SelectContent.RemoveScroll"),Lx=i.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v,...g}=e,b=jx(Tx,r),[x,w]=i.useState(null),[j,_]=i.useState(null),k=Wa(t,e=>w(e)),[O,S]=i.useState(null),[N,P]=i.useState(null),E=yx(r),[C,R]=i.useState(!1),T=i.useRef(!1);i.useEffect(()=>{if(x)return sl(x)},[x]),ss();const A=i.useCallback(e=>{const[t,...r]=E().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e){if(r===o)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&j&&(j.scrollTop=0),r===n&&j&&(j.scrollTop=j.scrollHeight),r?.focus(),document.activeElement!==o)return}},[E,j]),D=i.useCallback(()=>A([O,x]),[A,O,x]);i.useEffect(()=>{C&&D()},[C,D]);const{onOpenChange:F,triggerPointerDownPosRef:I}=b;i.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||F(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,F,I]),i.useEffect(()=>{const e=()=>F(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);const[M,L]=mw(e=>{const t=E().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=yw(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),$=i.useCallback((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&(S(e),n&&(T.current=!0))},[b.value]),V=i.useCallback(()=>x?.focus(),[x]),z=i.useCallback((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&P(e)},[b.value]),U="popper"===n?Vx:$x,q=U===Vx?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v}:{};return(0,on.jsx)(Fx,{scope:r,content:x,viewport:j,onViewportChange:_,itemRefCallback:$,selectedItem:O,onItemLeave:V,itemTextRefCallback:z,focusSelectedItem:D,selectedItemText:N,position:n,isPositioned:C,searchRef:M,children:(0,on.jsx)(Xs,{as:Mx,allowPinchZoom:!0,children:(0,on.jsx)(Qi,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Si(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,on.jsx)(qi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,on.jsx)(U,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...g,...q,onPlaced:()=>R(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Si(g.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=E().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>A(t)),e.preventDefault()}})})})})})})});Lx.displayName="SelectContentImpl";var $x=i.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,a=jx(Tx,r),s=Ix(Tx,r),[l,c]=i.useState(null),[u,d]=i.useState(null),f=Wa(t,e=>d(e)),p=yx(r),h=i.useRef(!1),m=i.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:g,focusSelectedItem:b}=s,x=i.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&y&&v&&g){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=a.valueNode.getBoundingClientRect(),o=g.getBoundingClientRect();if("rtl"!==a.dir){const n=o.left-t.left,a=r.left-n,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-Dx,d=ax(a,[Dx,Math.max(Dx,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const n=t.right-o.right,a=window.innerWidth-r.right-n,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-Dx,d=ax(a,[Dx,Math.max(Dx,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const i=p(),s=window.innerHeight-2*Dx,c=y.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),x=f+m+c+parseInt(d.paddingBottom,10)+b,w=Math.min(5*v.offsetHeight,x),j=window.getComputedStyle(y),_=parseInt(j.paddingTop,10),k=parseInt(j.paddingBottom,10),O=e.top+e.height/2-Dx,S=s-O,N=v.offsetHeight/2,P=f+m+(v.offsetTop+N),E=x-P;if(P<=O){const e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,r=P+Math.max(S,N+(e?k:0)+t+b);l.style.height=r+"px"}else{const e=i.length>0&&v===i[0].ref.current;l.style.top="0px";const t=Math.max(O,f+y.offsetTop+(e?_:0)+N)+E;l.style.height=t+"px",y.scrollTop=P-O+y.offsetTop}l.style.margin=`${Dx}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=s+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,l,u,y,v,g,a.dir,n]);Ei(()=>x(),[x]);const[w,j]=i.useState();Ei(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const _=i.useCallback(e=>{e&&!0===m.current&&(x(),b?.(),m.current=!1)},[x,b]);return(0,on.jsx)(zx,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:(0,on.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,on.jsx)(Ii.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$x.displayName="SelectItemAlignedPosition";var Vx=i.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Dx,...a}=e,i=xx(r);return(0,on.jsx)(Of,{...i,...a,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vx.displayName="SelectPopperPosition";var[zx,Ux]=gx(Tx,{}),qx="SelectViewport",Wx=i.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,a=Ix(qx,r),s=Ux(qx,r),l=Wa(t,a.onViewportChange),c=i.useRef(0);return(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,on.jsx)(mx.Slot,{scope:r,children:(0,on.jsx)(Ii.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Si(o.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=s;if(n?.current&&r){const e=Math.abs(c.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*Dx,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});Wx.displayName=qx;var Bx="SelectGroup",[Hx,Zx]=gx(Bx),Kx=i.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ti();return(0,on.jsx)(Hx,{scope:r,id:o,children:(0,on.jsx)(Ii.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Kx.displayName=Bx;var Gx="SelectLabel",Qx=i.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Zx(Gx,r);return(0,on.jsx)(Ii.div,{id:o.id,...n,ref:t})});Qx.displayName=Gx;var Yx="SelectItem",[Jx,Xx]=gx(Yx),ew=i.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:a,...s}=e,l=jx(Yx,r),c=Ix(Yx,r),u=l.value===n,[d,f]=i.useState(a??""),[p,h]=i.useState(!1),m=Wa(t,e=>c.itemRefCallback?.(e,n,o)),y=Ti(),v=i.useRef("touch"),g=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(""===n)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,on.jsx)(Jx,{scope:r,value:n,disabled:o,textId:y,isSelected:u,onItemTextChange:i.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:(0,on.jsx)(mx.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:(0,on.jsx)(Ii.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:Si(s.onFocus,()=>h(!0)),onBlur:Si(s.onBlur,()=>h(!1)),onClick:Si(s.onClick,()=>{"mouse"!==v.current&&g()}),onPointerUp:Si(s.onPointerUp,()=>{"mouse"===v.current&&g()}),onPointerDown:Si(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Si(s.onPointerMove,e=>{v.current=e.pointerType,o?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Si(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Si(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(px.includes(e.key)&&g()," "===e.key&&e.preventDefault())})})})})});ew.displayName=Yx;var tw="SelectItemText",rw=i.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...a}=e,s=jx(tw,r),l=Ix(tw,r),c=Xx(tw,r),u=kx(tw,r),[d,f]=i.useState(null),p=Wa(t,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),h=d?.textContent,m=i.useMemo(()=>(0,on.jsx)("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:y,onNativeOptionRemove:v}=u;return Ei(()=>(y(m),()=>v(m)),[y,v,m]),(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)(Ii.span,{id:c.textId,...a,ref:p}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Fi.createPortal(a.children,s.valueNode):null]})});rw.displayName=tw;var nw="SelectItemIndicator",ow=i.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Xx(nw,r).isSelected?(0,on.jsx)(Ii.span,{"aria-hidden":!0,...n,ref:t}):null});ow.displayName=nw;var aw="SelectScrollUpButton",iw=i.forwardRef((e,t)=>{const r=Ix(aw,e.__scopeSelect),n=Ux(aw,e.__scopeSelect),[o,a]=i.useState(!1),s=Wa(t,n.onScrollButtonChange);return Ei(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,on.jsx)(cw,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});iw.displayName=aw;var sw="SelectScrollDownButton",lw=i.forwardRef((e,t)=>{const r=Ix(sw,e.__scopeSelect),n=Ux(sw,e.__scopeSelect),[o,a]=i.useState(!1),s=Wa(t,n.onScrollButtonChange);return Ei(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;a(r)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,on.jsx)(cw,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});lw.displayName=sw;var cw=i.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,a=Ix("SelectScrollButton",r),s=i.useRef(null),l=yx(r),c=i.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>c(),[c]),Ei(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,on.jsx)(Ii.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Si(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(n,50))}),onPointerMove:Si(o.onPointerMove,()=>{a.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(n,50))}),onPointerLeave:Si(o.onPointerLeave,()=>{c()})})}),uw=i.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return(0,on.jsx)(Ii.div,{"aria-hidden":!0,...n,ref:t})});uw.displayName="SelectSeparator";var dw="SelectArrow",fw=i.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=xx(r),a=jx(dw,r),i=Ix(dw,r);return a.open&&"popper"===i.position?(0,on.jsx)(Sf,{...o,...n,ref:t}):null});fw.displayName=dw;var pw=i.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=i.useRef(null),a=Wa(n,o),s=Bv(t);return i.useEffect(()=>{const e=o.current;if(!e)return;const r=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(r,"value").set;if(s!==t&&n){const r=new Event("change",{bubbles:!0});n.call(e,t),e.dispatchEvent(r)}},[s,t]),(0,on.jsx)(Ii.select,{...r,style:{...ux,...r.style},ref:a,defaultValue:t})});function hw(e){return""===e||void 0===e}function mw(e){const t=Mi(e),r=i.useRef(""),n=i.useRef(0),o=i.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=i.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function yw(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=(i=e,s=Math.max(o,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===n.length&&(a=a.filter(e=>e!==r));const l=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return l!==r?l:void 0}pw.displayName="SelectBubbleInput";var vw=Ox,gw=Nx,bw=Ex,xw=Cx,ww=Rx,jw=Ax,_w=Wx,kw=ew,Ow=rw,Sw=ow;const Nw=li("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function Pw(e){return Pw="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},Pw(e)}var Ew=["className","children"],Cw=["className","children","position"],Rw=["className","children"];function Tw(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 Aw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tw(Object(r),!0).forEach(function(t){Dw(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Dw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Pw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Pw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pw(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fw(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Iw=vw,Mw=bw,Lw=i.forwardRef(function(e,t){var r=e.className,n=e.children,o=Fw(e,Ew);return(0,on.jsxs)(gw,Aw(Aw({ref:t,className:bo("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r)},o),{},{children:[n,(0,on.jsx)(xw,{asChild:!0,children:(0,on.jsx)(Nw,{className:"h-4 w-4 opacity-50"})})]}))});Lw.displayName=gw.displayName;var $w=i.forwardRef(function(e,t){var r=e.className,n=e.children,o=e.position,a=void 0===o?"popper":o,i=Fw(e,Cw);return(0,on.jsx)(ww,{children:(0,on.jsx)(jw,Aw(Aw({ref:t,className:bo("relative z-[100000] min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:a},i),{},{children:(0,on.jsx)(_w,{className:bo("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})}))})});$w.displayName=jw.displayName;var Vw=i.forwardRef(function(e,t){var r=e.className,n=e.children,o=Fw(e,Rw);return(0,on.jsxs)(kw,Aw(Aw({ref:t,className:bo("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},o),{},{children:[(0,on.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,on.jsx)(Sw,{children:(0,on.jsx)(di,{className:"h-4 w-4"})})}),(0,on.jsx)(Ow,{children:n})]}))});function zw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Uw(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)?Uw(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Uw(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}Vw.displayName=kw.displayName;var qw=function(e){var t=e.className;return(0,on.jsx)("svg",{className:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,on.jsxs)("g",{opacity:"0.6",children:[(0,on.jsx)("path",{d:"M8 12C8 10.8954 8.89543 10 10 10H18L22 14H38C39.1046 14 40 14.8954 40 16V34C40 35.1046 39.1046 36 38 36H10C8.89543 36 8 35.1046 8 34V12Z",stroke:"currentColor",strokeWidth:"2",fill:"none"}),(0,on.jsx)("path",{d:"M14 22H20M14 26H24M14 30H18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.4"}),(0,on.jsx)("circle",{cx:"32",cy:"24",r:"4",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:"0.5"}),(0,on.jsx)("path",{d:"M35 27L37 29",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})]})})};const Ww=function(e){var t=e.colSpan,r=void 0===t?9:t,n=e.title,o=void 0===n?"":n,a=e.description,i=void 0===a?"":a;return(0,on.jsx)(Pb,{children:(0,on.jsx)(Cb,{colSpan:r,className:"text-center py-12",children:(0,on.jsxs)("div",{className:"flex flex-col items-center space-y-3 text-muted-foreground",children:[(0,on.jsx)(qw,{className:"w-12 h-12"}),(0,on.jsxs)("div",{className:"space-y-1",children:[(0,on.jsx)("p",{className:"text-lg font-medium",children:o||(0,Xo.__)("Empty!! No data found","versatile-toolkit")}),i&&(0,on.jsx)("p",{className:"text-sm",children:i})]})]})})})};function Bw(e){return Bw="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},Bw(e)}function Hw(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 Zw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hw(Object(r),!0).forEach(function(t){Kw(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hw(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Kw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Bw(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Bw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bw(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gw(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Qw(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Qw(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Qw(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Qw(d,"constructor",c),Qw(c,"constructor",l),l.displayName="GeneratorFunction",Qw(c,o,"GeneratorFunction"),Qw(d),Qw(d,o,"Generator"),Qw(d,n,function(){return this}),Qw(d,"toString",function(){return"[object Generator]"}),(Gw=function(){return{w:a,m:f}})()}function Qw(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Qw=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){Qw(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},Qw(e,t,r,n)}function Yw(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Jw(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Yw(a,n,o,i,s,"next",e)}function s(e){Yw(a,n,o,i,s,"throw",e)}i(void 0)})}}function Xw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ej(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)?ej(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(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}var tj=[{key:"name",label:"Name"},{key:"email",label:"Email"},{key:"role",label:"Role"},{key:"status",label:"Status"},{key:"expires_at",label:"Expires At"},{key:"login_count",label:"Login Count"},{key:"last_login",label:"Last Login"},{key:"actions",label:"Actions"}];const rj=function(){var e,t,r=Xw((0,i.useState)({page:1,per_page:10,order:"desc",orderby:"created_at",role:"",status:"all"}),2),n=r[0],o=r[1],a=Xw((0,i.useState)(""),2),s=a[0],l=a[1],c=function(e,t){var r=zw((0,i.useState)(e),2),n=r[0],o=r[1];return(0,i.useEffect)(function(){var r=setTimeout(function(){o(e)},t);return function(){clearTimeout(r)}},[e,t]),n}(s,500),u=Xw((0,i.useState)(null),2),d=u[0],f=u[1],p=Xw((0,i.useState)(null),2),h=p[0],m=p[1],y=Xw((0,i.useState)({}),2),v=y[0],g=y[1],b=Xw((0,i.useState)(null),2),x=b[0],w=b[1],j=Xw((0,i.useState)(null),2),_=j[0],k=j[1],O=Xw((0,i.useState)("1_hour"),2),S=O[0],N=O[1],P=Qo({queryKey:["get-temp-logins",t=n],queryFn:function(){return nx.getTempLoginList(t)},refetchOnWindowFocus:!1}),E=P.data,C=P.isLoading,R=function(){var e=Jw(Gw().m(function e(t){return Gw().w(function(e){for(;;)switch(e.n){case 0:return f(t.id),e.n=1,ua(t.login_url);case 1:setTimeout(function(){f(null)},2e3);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),T=function(e){return e.is_active?Mb(e.expires_at)?(0,on.jsx)(vi,{variant:"destructive",children:(0,Xo.__)("Expired","versatile-toolkit")}):(0,on.jsx)(vi,{variant:"default",children:(0,Xo.__)("Active","versatile-toolkit")}):(0,on.jsx)(vi,{variant:"outline",children:(0,Xo.__)("Inactive","versatile-toolkit")})},A=function(){var e=sn();return Jo({mutationFn:function(e){return nx.toggleTempLoginStatus(e)},onSuccess:function(t){e.invalidateQueries({queryKey:["get-temp-logins"]}),hr.success(t.message||(0,Xo.__)("Temporary login status updated successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Error: while updating temporary login status","versatile-toolkit"))}})}(),D=A.mutateAsync,F=function(){var e=Jw(Gw().m(function e(t,r){return Gw().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,D({id:t,is_active:!r});case 1:return e.a(2)}},e)}));return function(t,r){return e.apply(this,arguments)}}(),I=function(){var e=sn();return Jo({mutationFn:function(e){return nx.deleteTempLogin(e)},onSuccess:function(t){e.invalidateQueries({queryKey:["get-temp-logins"]}),hr.success(t.message||(0,Xo.__)("Temporary login deleted successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Error: while deleting temporary login","versatile-toolkit"))}})}(),M=I.mutateAsync,L=function(){var e=Jw(Gw().m(function e(){return Gw().w(function(e){for(;;)switch(e.p=e.n){case 0:if(x){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,M({id:x.id});case 2:w(null),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),$=function(){w(null)},V=function(){var e=sn();return Jo({mutationFn:function(e){return nx.updateTempLogin(e)},onSuccess:function(t){e.invalidateQueries({queryKey:["get-temp-logins"]}),hr.success(t.message||(0,Xo.__)("Temporary login updated successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Error: while updating temporary login","versatile-toolkit"))}})}(),z=V.mutateAsync,U=V.isPending,q=function(){var e=Jw(Gw().m(function e(){var t,r;return Gw().w(function(e){for(;;)switch(e.p=e.n){case 0:if(h){e.n=1;break}return e.a(2);case 1:if(null!==(t=v.display_name)&&void 0!==t&&t.trim()){e.n=2;break}return hr.error((0,Xo.__)("Display name is required","versatile-toolkit")),e.a(2);case 2:if(null!==(r=v.email)&&void 0!==r&&r.trim()){e.n=3;break}return hr.error((0,Xo.__)("Email is required","versatile-toolkit")),e.a(2);case 3:return e.p=3,e.n=4,z(Zw({id:h.id},v));case 4:m(null),g({}),e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2)}},e,null,[[3,5]])}));return function(){return e.apply(this,arguments)}}(),W=function(){m(null),g({})},B=function(){var e=sn();return Jo({mutationFn:function(e){return nx.extendTempLoginTime(e)},onSuccess:function(t){e.invalidateQueries({queryKey:["get-temp-logins"]}),hr.success(t.message||(0,Xo.__)("Temporary login time extended successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Error: while extending temporary login time","versatile-toolkit"))}})}(),H=B.mutateAsync,Z=B.isPending,K=function(){var e=Jw(Gw().m(function e(){return Gw().w(function(e){for(;;)switch(e.p=e.n){case 0:if(_){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,H({id:_.id,extend_by:S});case 2:k(null),N("1_hour"),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),G=function(){k(null),N("1_hour")},Q=ox().data;(0,i.useEffect)(function(){o(function(e){return Zw(Zw({},e),{},{search:c,page:1})})},[c]);var Y=function(e,t){o(function(r){return Zw(Zw({},r),{},Kw({},e,t))})},J=function(e){o(function(t){return Zw(Zw({},t),{},{page:e})})};return(0,on.jsxs)(on.Fragment,{children:[(0,on.jsxs)(Ro,{children:[(0,on.jsx)(To,{children:(0,on.jsxs)("div",{className:"flex flex-wrap gap-4 justify-end",children:[(0,on.jsx)("div",{className:"w-[300px]",children:(0,on.jsxs)("div",{className:"relative",children:[(0,on.jsx)(Nc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),(0,on.jsx)(kp,{placeholder:(0,Xo.__)("Search by name or email...","versatile-toolkit"),value:s,onChange:function(e){return t=e.target.value,void l(t);var t},className:"pl-10"})]})}),(0,on.jsxs)(Iw,{value:n.role||"all_roles",onValueChange:function(e){return Y("role","all_roles"===e?"":e)},children:[(0,on.jsx)(Lw,{className:"w-48",children:(0,on.jsx)(Mw,{placeholder:(0,Xo.__)("All Roles","versatile-toolkit")})}),(0,on.jsxs)($w,{children:[(0,on.jsx)(Vw,{value:"all_roles",children:(0,Xo.__)("All Roles","versatile-toolkit")}),Object.entries(null!=Q?Q:{}).map(function(e){var t=Xw(e,2),r=t[0],n=t[1];return(0,on.jsx)(Vw,{value:r,children:String(n)},r)})]})]}),(0,on.jsxs)(Iw,{value:n.status,onValueChange:function(e){return Y("status",e)},children:[(0,on.jsx)(Lw,{className:"w-48",children:(0,on.jsx)(Mw,{})}),(0,on.jsxs)($w,{children:[(0,on.jsx)(Vw,{value:"all",children:(0,Xo.__)("All Status","versatile-toolkit")}),(0,on.jsx)(Vw,{value:"active",children:(0,Xo.__)("Active","versatile-toolkit")}),(0,on.jsx)(Vw,{value:"inactive",children:(0,Xo.__)("Inactive","versatile-toolkit")}),(0,on.jsx)(Vw,{value:"expired",children:(0,Xo.__)("Expired","versatile-toolkit")})]})]})]})}),(0,on.jsx)(Do,{children:(0,on.jsxs)(Ob,{children:[(0,on.jsx)(Sb,{children:(0,on.jsx)(Pb,{children:tj.map(function(e){return(0,on.jsx)(Eb,{children:e.label},e.key)})})}),(0,on.jsx)(Nb,{children:C?(0,on.jsx)(La,{columns:tj.map(function(e){return{key:String(e.key),label:String(e.key)}}),rows:5}):E&&(null==E||null===(e=E.temp_logins)||void 0===e?void 0:e.length)>0?E.temp_logins.map(function(e){return(0,on.jsxs)(Pb,{children:[(0,on.jsx)(Cb,{children:e.display_name}),(0,on.jsx)(Cb,{children:e.email}),(0,on.jsx)(Cb,{children:(0,on.jsx)(vi,{children:e.role})}),(0,on.jsx)(Cb,{children:T(e)}),(0,on.jsx)(Cb,{children:(0,on.jsx)("span",{className:"".concat(Mb(e.expires_at)?"text-red-500 font-semibold":""),children:Vb(e.expires_at)})}),(0,on.jsx)(Cb,{children:e.login_count}),(0,on.jsx)(Cb,{children:e.last_login?(t=e.last_login,r=new Date,n=new Date(t),o=r.getTime()-n.getTime(),a=Math.floor(o/864e5),i=Math.floor(o%864e5/36e5),s=Math.floor(o%36e5/6e4),a>0?"".concat(a,"d ").concat(i,"h ").concat(s,"m ago"):i>0?"".concat(i,"h ").concat(s,"m ago"):"".concat(s,"m ago")):"-"}),(0,on.jsx)(Cb,{children:(0,on.jsxs)(ap,{children:[(0,on.jsx)(ip,{asChild:!0,children:(0,on.jsxs)(oi,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0",children:[(0,on.jsx)(Rb,{className:"h-4 w-4"}),(0,on.jsx)("span",{className:"sr-only",children:(0,Xo.__)("Open menu","versatile-toolkit")})]})}),(0,on.jsx)(sp,{className:"w-48 p-1",align:"end",children:(0,on.jsxs)("div",{className:"space-y-1",children:[(0,on.jsxs)(oi,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:function(){return R(e)},children:[d===e.id?(0,on.jsx)(di,{className:"mr-2 h-4 w-4 text-green-600"}):(0,on.jsx)(Tb,{className:"mr-2 h-4 w-4"}),(0,Xo.__)("Copy Login URL","versatile-toolkit")]}),(0,on.jsxs)(oi,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:function(){return function(e){m(e),g({display_name:e.display_name,email:e.email,role:e.role,redirect_url:e.redirect_url,expires_at:e.expires_at})}(e)},children:[(0,on.jsx)(Ab,{className:"mr-2 h-4 w-4"}),(0,Xo.__)("Edit","versatile-toolkit")]}),(0,on.jsxs)(oi,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:function(){return function(e){k(e),N("1_hour")}(e)},children:[(0,on.jsx)(Db,{className:"mr-2 h-4 w-4"}),(0,Xo.__)("Extend Time","versatile-toolkit")]}),(0,on.jsxs)(oi,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:function(){return F(e.id,e.is_active)},children:[e.is_active?(0,on.jsx)(Fb,{className:"mr-2 h-4 w-4"}):(0,on.jsx)(pg,{className:"mr-2 h-4 w-4"}),e.is_active?(0,Xo.__)("Deactivate","versatile-toolkit"):(0,Xo.__)("Activate","versatile-toolkit")]}),(0,on.jsxs)(oi,{variant:"ghost",size:"sm",className:"w-full justify-start text-red-600 hover:text-red-700 hover:bg-red-50",onClick:function(){return function(e){w(e)}(e)},children:[(0,on.jsx)(Ib,{className:"mr-2 h-4 w-4"}),(0,Xo.__)("Delete","versatile-toolkit")]})]})})]})})]},e.id);var t,r,n,o,a,i,s}):(0,on.jsx)(Ww,{title:"No temporary logins found",description:"Try adjusting your search or filters"})})]})}),E&&E.total_pages>1&&(0,on.jsx)(Do,{className:"pt-0",children:(0,on.jsxs)("div",{className:"flex justify-center space-x-2",children:[(0,on.jsx)(oi,{variant:"outline",disabled:1===E.page,onClick:function(){return J(E.page-1)},children:(0,Xo.__)("Previous","versatile-toolkit")}),(0,on.jsxs)("span",{className:"flex items-center px-4",children:[(0,Xo.__)("Page","versatile-toolkit")," ",E.page," ",(0,Xo.__)("of","versatile-toolkit")," ",E.total_pages]}),(0,on.jsx)(oi,{variant:"outline",disabled:E.page===E.total_pages,onClick:function(){return J(E.page+1)},children:(0,Xo.__)("Next","versatile-toolkit")})]})})]}),(0,on.jsx)($c,{open:!!h,onOpenChange:function(e){return!e&&W()},children:(0,on.jsxs)(Wc,{className:"max-w-md",children:[(0,on.jsxs)(Bc,{children:[(0,on.jsx)(Zc,{children:(0,Xo.__)("Edit Temporary Login","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-sm text-muted-foreground",children:(0,Xo.__)("Note: Expiration date cannot be modified after creation.","versatile-toolkit")})]}),(0,on.jsxs)("div",{className:"space-y-4",children:[(0,on.jsxs)("div",{className:"d-flex flex-col gap-3",children:[(0,on.jsx)(gv,{htmlFor:"edit-display-name",children:(0,Xo.__)("Display Name","versatile-toolkit")}),(0,on.jsx)(kp,{id:"edit-display-name",value:v.display_name||"",onChange:function(e){return g(function(t){return Zw(Zw({},t),{},{display_name:e.target.value})})},placeholder:(0,Xo.__)("Enter display name","versatile-toolkit")})]}),(0,on.jsxs)("div",{className:"d-flex flex-col gap-3",children:[(0,on.jsx)(gv,{htmlFor:"edit-email",children:(0,Xo.__)("Email","versatile-toolkit")}),(0,on.jsx)(kp,{id:"edit-email",type:"email",value:v.email||"",onChange:function(e){return g(function(t){return Zw(Zw({},t),{},{email:e.target.value})})},placeholder:(0,Xo.__)("Enter email address","versatile-toolkit")})]}),(0,on.jsxs)("div",{className:"d-flex flex-col gap-3",children:[(0,on.jsx)(gv,{htmlFor:"edit-role",children:(0,Xo.__)("Role","versatile-toolkit")}),(0,on.jsxs)(Iw,{value:v.role||"",onValueChange:function(e){return g(function(t){return Zw(Zw({},t),{},{role:e})})},children:[(0,on.jsx)(Lw,{children:(0,on.jsx)(Mw,{placeholder:(0,Xo.__)("Select role","versatile-toolkit")})}),(0,on.jsx)($w,{children:Object.entries(null!=Q?Q:{}).map(function(e){var t=Xw(e,2),r=t[0],n=t[1];return(0,on.jsx)(Vw,{value:r,children:String(n)},r)})})]})]}),(0,on.jsxs)("div",{className:"d-flex flex-col gap-3",children:[(0,on.jsx)(gv,{htmlFor:"edit-redirect-url",children:(0,Xo.__)("Redirect URL","versatile-toolkit")}),(0,on.jsx)(kp,{id:"edit-redirect-url",type:"url",value:v.redirect_url||"",onChange:function(e){return g(function(t){return Zw(Zw({},t),{},{redirect_url:e.target.value})})},placeholder:(0,Xo.__)("Enter redirect URL","versatile-toolkit")})]})]}),(0,on.jsxs)(Hc,{children:[(0,on.jsx)(oi,{variant:"outline",onClick:W,children:(0,Xo.__)("Cancel","versatile-toolkit")}),(0,on.jsx)(oi,{onClick:q,disabled:U,children:U?(0,Xo.__)("Updating...","versatile-toolkit"):(0,Xo.__)("Update","versatile-toolkit")})]})]})}),(0,on.jsx)($c,{open:!!x,onOpenChange:function(e){return!e&&$()},children:(0,on.jsxs)(Wc,{className:"max-w-md",children:[(0,on.jsx)(Bc,{children:(0,on.jsx)(Zc,{className:"text-red-600",children:(0,Xo.__)("Delete Temporary Login","versatile-toolkit")})}),(0,on.jsxs)("div",{className:"space-y-4",children:[(0,on.jsx)("p",{className:"text-sm text-muted-foreground",children:(0,Xo.__)("Are you sure you want to delete this temporary login? This action cannot be undone.","versatile-toolkit")}),x&&(0,on.jsxs)("div",{className:"bg-gray-50 p-3 rounded-md",children:[(0,on.jsx)("p",{className:"font-medium",children:x.display_name}),(0,on.jsx)("p",{className:"text-sm text-gray-600",children:x.email}),(0,on.jsx)("p",{className:"text-sm text-gray-600",children:x.role})]})]}),(0,on.jsxs)(Hc,{children:[(0,on.jsx)(oi,{variant:"outline",onClick:$,children:(0,Xo.__)("Cancel","versatile-toolkit")}),(0,on.jsx)(oi,{variant:"destructive",onClick:L,children:(0,Xo.__)("Delete","versatile-toolkit")})]})]})}),(0,on.jsx)($c,{open:!!_,onOpenChange:function(e){return!e&&G()},children:(0,on.jsxs)(Wc,{className:"max-w-md",children:[(0,on.jsxs)(Bc,{children:[(0,on.jsx)(Zc,{children:(0,Xo.__)("Extend Expiration Time","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-sm text-muted-foreground",children:(0,Xo.__)("Select how much time to add to the current expiration date.","versatile-toolkit")})]}),(0,on.jsxs)("div",{className:"space-y-4",children:[_&&(0,on.jsxs)("div",{className:"bg-gray-100 p-3 rounded-md",children:[(0,on.jsx)("p",{className:"font-medium",children:_.display_name}),(0,on.jsx)("p",{className:"text-sm text-gray-600",children:_.email}),(0,on.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,Xo.__)("Current expiration:","versatile-toolkit")," ",new Date(_.expires_at).toLocaleString()]})]}),(0,on.jsxs)("div",{children:[(0,on.jsx)(gv,{htmlFor:"extend-time-select",className:"d-block mb-4",children:(0,Xo.__)("Extend by","versatile-toolkit")}),(0,on.jsxs)(Iw,{value:S,onValueChange:N,children:[(0,on.jsx)(Lw,{className:"w-full d-block",children:(0,on.jsx)(Mw,{placeholder:(0,Xo.__)("Select expires at","versatile-toolkit")})}),(0,on.jsx)($w,{className:"w-full max-h-60 scroll",children:rx.map(function(e){return(0,on.jsx)(Vw,{value:e.value,children:e.label},e.value)})})]})]})]}),(0,on.jsxs)(Hc,{className:"mt-4",children:[(0,on.jsx)(oi,{variant:"outline",onClick:G,children:(0,Xo.__)("Cancel","versatile-toolkit")}),(0,on.jsx)(oi,{onClick:K,disabled:Z,children:Z?(0,Xo.__)("Extending...","versatile-toolkit"):(0,Xo.__)("Extend Time","versatile-toolkit")})]})]})})]})},nj=li("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);function oj(e){return oj="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},oj(e)}function aj(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 ij(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aj(Object(r),!0).forEach(function(t){sj(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aj(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function sj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=oj(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=oj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lj(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return cj(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(cj(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,cj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,cj(d,"constructor",c),cj(c,"constructor",l),l.displayName="GeneratorFunction",cj(c,o,"GeneratorFunction"),cj(d),cj(d,o,"Generator"),cj(d,n,function(){return this}),cj(d,"toString",function(){return"[object Generator]"}),(lj=function(){return{w:a,m:f}})()}function cj(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}cj=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){cj(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},cj(e,t,r,n)}function uj(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function dj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fj(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)?fj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fj(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}(0,Xo.__)("Administrator","versatile-toolkit"),(0,Xo.__)("Editor","versatile-toolkit"),(0,Xo.__)("Author","versatile-toolkit"),(0,Xo.__)("Contributor","versatile-toolkit"),(0,Xo.__)("Subscriber","versatile-toolkit");const pj=function(){var e=dj((0,i.useState)(!1),2),t=e[0],r=e[1],n=Zy({resolver:Xy(dm),defaultValues:{display_name:"",email:"",role:"",expires_at:"3_hours",redirect_url:$o.admin_url}}),o=n.handleSubmit,a=(n.formState.errors,ox()),s=a.data,l=a.isLoading,c=function(){var e=sn();return Jo({mutationFn:nx.createTempLogin,onSuccess:function(t){e.invalidateQueries({queryKey:["get-temp-logins"]}),hr.success(t.message||(0,Xo.__)("Temporary login created successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Error: while creating temporary login","versatile-toolkit"))}})}(),u=c.mutateAsync,d=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){uj(a,n,o,i,s,"next",e)}function s(e){uj(a,n,o,i,s,"throw",e)}i(void 0)})}}(lj().m(function e(t){return lj().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u(t,{onSuccess:function(){r(!1)}});case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();return(0,on.jsx)(on.Fragment,{children:(0,on.jsxs)($c,{open:t,onOpenChange:r,children:[(0,on.jsx)(Vc,{asChild:!0,children:(0,on.jsxs)(oi,{children:[(0,on.jsx)(nj,{className:"w-4 h-4 mr-2"}),(0,Xo.__)("Create Temp Login","versatile-toolkit")]})}),(0,on.jsxs)(Wc,{className:"max-w-lg",children:[(0,on.jsx)(Bc,{children:(0,on.jsx)(Zc,{children:(0,Xo.__)("Create Temporary Login","versatile-toolkit")})}),(0,on.jsx)(Cv,ij(ij({},n),{},{children:(0,on.jsxs)("form",{onSubmit:o(d,function(e){}),className:"flex flex-col gap-5",children:[(0,on.jsx)(Tv,{control:n.control,name:"display_name",render:function(e){var t=e.field;return(0,on.jsxs)(Fv,{children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Display Name","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,ij({placeholder:(0,Xo.__)("Display Name","versatile-toolkit")},t))}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:n.control,name:"email",render:function(e){var t=e.field;return(0,on.jsxs)(Fv,{children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Email","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,ij({placeholder:(0,Xo.__)("Email","versatile-toolkit")},t))}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:n.control,name:"role",render:function(e){var t=e.field;return(0,on.jsxs)(Fv,{children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Role","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsxs)(Iw,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,on.jsx)(Lw,{className:"w-full",children:(0,on.jsx)(Mw,{placeholder:(0,Xo.__)("Select role","versatile-toolkit")})}),(0,on.jsx)($w,{className:"w-full max-h-60 scroll-auto",children:l?(0,on.jsx)(Da,{size:"md",className:"ml-2",text:(0,Xo.__)("Loading roles","versatile-toolkit")}):Object.entries(null!=s?s:{}).map(function(e){var t=dj(e,2),r=t[0],n=t[1];return(0,on.jsx)(Vw,{value:r,children:String(n)},r)})})]})}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:n.control,name:"expires_at",render:function(e){var t=e.field;return(0,on.jsxs)(Fv,{children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Expires At","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsxs)(Iw,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,on.jsx)(Lw,{className:"w-full",children:(0,on.jsx)(Mw,{placeholder:(0,Xo.__)("Select expires at","versatile-toolkit")})}),(0,on.jsx)($w,{className:"w-full max-h-60 scroll",children:rx.map(function(e){return(0,on.jsx)(Vw,{value:e.value,children:e.label},e.value)})})]})}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)(Tv,{control:n.control,name:"redirect_url",render:function(e){var t=e.field;return(0,on.jsxs)(Fv,{children:[(0,on.jsx)(Iv,{className:"text-foreground",children:(0,Xo.__)("Redirect URL","versatile-toolkit")}),(0,on.jsx)(Mv,{children:(0,on.jsx)(kp,ij({placeholder:(0,Xo.__)("Redirect URL","versatile-toolkit")},t))}),(0,on.jsx)($v,{})]})}}),(0,on.jsx)("div",{className:"flex justify-end",children:(0,on.jsx)(oi,{type:"submit",children:(0,Xo.__)("Create Temporary Login","versatile-toolkit")})})]})}))]})]})})};const hj=function(){return(0,on.jsxs)("div",{className:"p-6 space-y-6",children:[(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsxs)("div",{children:[(0,on.jsx)("h2",{className:"text-2xl font-bold",children:(0,Xo.__)("Temporary Logins","versatile-toolkit")}),(0,on.jsx)("p",{className:"text-gray-600 mt-2",children:(0,Xo.__)("Create and manage temporary login access for users","versatile-toolkit")})]}),(0,on.jsx)("div",{children:(0,on.jsx)(pj,{})})]}),(0,on.jsx)(rj,{})]})};function mj(e){return mj="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},mj(e)}var yj=["className"],vj=["side","className","children"],gj=["className"],bj=["className"],xj=["className"];function wj(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 jj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wj(Object(r),!0).forEach(function(t){_j(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wj(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _j(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=mj(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=mj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==mj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kj(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Oj=zl,Sj=Ul,Nj=ql,Pj=i.forwardRef(function(e,t){var r=e.className,n=kj(e,yj);return(0,on.jsx)(Wl,jj(jj({className:bo("fixed inset-0 z-[99999] bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n),{},{ref:t}))});Pj.displayName=Wl.displayName;var Ej=Ja("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Cj=i.forwardRef(function(e,t){var r=e.side,n=void 0===r?"right":r,o=e.className,a=e.children,i=kj(e,vj);return(0,on.jsxs)(Nj,{children:[(0,on.jsx)(Pj,{}),(0,on.jsxs)(Bl,jj(jj({ref:t,className:bo(Ej({side:n}),"z-[99999] sm:max-w-[540px]",o)},i),{},{children:[(0,on.jsxs)(Kl,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,on.jsx)(ci,{className:"h-4 w-4"}),(0,on.jsx)("span",{className:"sr-only",children:"Close"})]}),a]}))]})});Cj.displayName=Bl.displayName;var Rj=function(e){var t=e.className,r=kj(e,gj);return(0,on.jsx)("div",jj({className:bo("flex flex-col space-y-2 text-center sm:text-left",t)},r))};Rj.displayName="SheetHeader";var Tj=i.forwardRef(function(e,t){var r=e.className,n=kj(e,bj);return(0,on.jsx)(Hl,jj({ref:t,className:bo("text-lg font-semibold text-foreground",r)},n))});function Aj(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return Dj(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(Dj(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Dj(d,"constructor",c),Dj(c,"constructor",l),l.displayName="GeneratorFunction",Dj(c,o,"GeneratorFunction"),Dj(d),Dj(d,o,"Generator"),Dj(d,n,function(){return this}),Dj(d,"toString",function(){return"[object Generator]"}),(Aj=function(){return{w:a,m:f}})()}function Dj(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dj=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){Dj(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},Dj(e,t,r,n)}function Fj(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Ij(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Mj(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)?Mj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mj(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}Tj.displayName=Hl.displayName,i.forwardRef(function(e,t){var r=e.className,n=kj(e,xj);return(0,on.jsx)(Zl,jj({ref:t,className:bo("text-sm text-muted-foreground",r)},n))}).displayName=Zl.displayName;const Lj=function(){var e,t,r=Ij((0,i.useState)(!1),2),n=r[0],o=r[1],a=sn(),s=ne(),l=Qo({queryKey:["getServiceList"],queryFn:(e=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_get_service_list",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(t){return e.apply(this,arguments)}),staleTime:5e3}),c=l.data,u=l.isLoading,d=null==c?void 0:c.data,f=function(){if(!d||"/"===s.pathname)return null;var e=s.pathname.split("/").filter(Boolean)[0],t=Object.entries(d).find(function(t){var r=Ij(t,2);r[0];return r[1].path===e});return t?t[1]:null}(),p=Jo({mutationFn:(t=Sa(_a().m(function e(t){var r;return _a().w(function(e){for(;;)switch(e.n){case 0:return t.action="versatile_update_service_status",e.n=1,ba($o.ajax_url,{body:t});case 1:return r=e.v,e.a(2,r)}},e)})),function(e){return t.apply(this,arguments)}),onSuccess:function(e){var t;hr.success(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Service status updated!","versatile-toolkit"))},onError:function(e){var t;hr.error(null!==(t=e.message)&&void 0!==t?t:(0,Xo.__)("Failed to update service status","versatile-toolkit"))}}),h=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Fj(a,n,o,i,s,"next",e)}function s(e){Fj(a,n,o,i,s,"throw",e)}i(void 0)})}}(Aj().m(function e(t,r){return Aj().w(function(e){for(;;)switch(e.n){case 0:p.mutateAsync({service_key:t,enable:!r.enable},{onSuccess:function(){a.invalidateQueries({queryKey:["getServiceList"]}),a.invalidateQueries({queryKey:["getEnableServiceList"]})}});case 1:return e.a(2)}},e)}));return function(t,r){return e.apply(this,arguments)}}();hg({isOpen:n,onClose:function(){o(!n)}}).handleBackdropClick;return(0,on.jsx)(on.Fragment,{children:(0,on.jsxs)("header",{className:"bg-white border-b border-gray-200 py-4 flex items-center justify-between relative",children:[(0,on.jsx)(ct,{to:"/",className:"flex items-center text-blue-600 text-lg font-semibold",children:(0,Xo.__)("Versatile Toolkit","versatile-toolkit")}),(0,on.jsxs)("div",{className:"flex items-center gap-3",children:[f&&(0,on.jsx)(on.Fragment,{children:Object.keys((null==f?void 0:f.menus)||{}).map(function(e){var t,r,n="/".concat(null==f?void 0:f.path,"/").concat(null==f||null===(t=f.menus)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.slug);return n.endsWith("/")&&(n=n.slice(0,-1)),(0,on.jsx)(ct,{to:n,onClick:function(){},className:"text-sm font-medium rounded-md px-3 py-1 transition-colors duration-200 ".concat(s.pathname===n?"bg-blue-600 text-white border border-blue-700 hover:text-white focus:!text-white":" bg-blue-50 border border-blue-200"),children:null==f||null===(r=f.menus)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.label},e)})}),!u&&(null==d?void 0:d.troubleshoot.enable)&&!f&&(0,on.jsxs)(on.Fragment,{children:[(0,on.jsx)(ct,{to:"/troubleshoot",className:"text-sm font-medium rounded-md px-3 py-1 text-blue-700 bg-blue-50 border border-blue-200",children:"Deactivate Plugins"}),(0,on.jsx)(ct,{to:"/troubleshoot/debug-log",className:"text-sm font-medium rounded-md px-3 py-1 text-blue-700 bg-blue-50 border border-blue-200",children:"Debug Log"})]}),(0,on.jsxs)(Oj,{children:[(0,on.jsx)(Sj,{asChild:!0,children:(0,on.jsx)("button",{className:"p-1 rounded-md bg-blue-100 hover:bg-blue-200 transition-colors duration-200","aria-label":"Toggle menu",children:(0,on.jsx)("svg",{className:"w-5 h-5 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),(0,on.jsxs)(Cj,{children:[(0,on.jsx)(Rj,{children:(0,on.jsx)(Tj,{children:(0,Xo.__)("Services","versatile-toolkit")})}),(0,on.jsx)("div",{className:"space-y-3 mt-6",children:Object.entries(d||{}).map(function(e){var t=Ij(e,2),r=t[0],n=t[1];return(0,on.jsxs)("div",{onClick:function(){return h(r,n)},className:"flex items-center justify-between p-3 rounded-md border border-gray-200 bg-gray-50 hover:bg-blue-100 hover:border-blue-300 hover:shadow-md transition-all duration-300 cursor-pointer",children:[(0,on.jsx)("span",{className:"text-blue-500 font-medium hover:text-blue-800 transition-colors duration-300",children:n.label}),(0,on.jsxs)("div",{className:"relative inline-flex items-center cursor-pointer",children:[(0,on.jsx)("input",{type:"checkbox",checked:n.enable,onChange:function(){},className:"sr-only peer"}),(0,on.jsx)("div",{className:"relative w-11 h-6 bg-[#c7c6c6] peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]},n.label)})})]})]})]})]})})};var $j=function(e){var t=e.children,r=Pa(),n=r.data,o=(r.isLoading,null==n?void 0:n.data),a=ne().pathname.split("/").filter(Boolean)[0];if(!o)return(0,on.jsx)(on.Fragment,{children:t});var i=Object.values(o).find(function(e){return e.path===a});return i&&i.enable?(0,on.jsx)(on.Fragment,{children:t}):(0,on.jsx)(_e,{to:"/",replace:!0})};const Vj=li("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),zj=li("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),Uj=li("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),qj=li("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function Wj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Bj(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)?Bj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bj(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}var Hj=function(e,t,r,n,o){return{pathname:"/troubleshoot/debug-log",search:"?".concat(Zj(e,t,r,n,o))}},Zj=function(e,t,r,n,o){var a=new URLSearchParams;return a.append("paged",e.toString()),a.append("per_page",null==t?void 0:t.toString()),r&&a.append("search",r),n&&a.append("sort_key",n),o&&a.append("sort_dir",o),a.toString()};function Kj(e){var t=e.order;return(0,on.jsxs)("span",{"aria-hidden":!0,className:"inline-flex flex-col leading-none ml-1",children:[""===t&&(0,on.jsx)(Vj,{className:"h-3 w-3"}),"asc"===t&&(0,on.jsx)(Vj,{className:"h-3 w-3"}),"desc"===t&&(0,on.jsx)(zj,{className:"h-3 w-3"})]})}var Gj=function(e){return{page:parseInt(e.get("paged")||"1"),perPage:parseInt(e.get("per_page")||"10"),search:e.get("search")||"",sortKey:e.get("sort_key")||"",order:e.get("order")||""}};function Qj(e){var t=e.columns,r=e.fetchData,n=e.searchParams,o=ie(),a=n,s=Gj(a),l=Wj((0,i.useState)(s.search),2),c=l[0],u=l[1],d=Wj((0,i.useState)(s.page),2),f=d[0],p=d[1],h=Wj((0,i.useState)(s.perPage||10),2),m=h[0],y=h[1],v=Wj((0,i.useState)({key:s.sortKey,order:s.order}),2),g=v[0],b=v[1],x=Wj((0,i.useState)(0),2),w=x[0],j=x[1];(0,i.useEffect)(function(){var e=Gj(a);p(e.page),y(e.perPage||10),u(e.search),b({key:e.sortKey,order:e.order})},[n]);var _=Wj((0,i.useState)([]),2),k=_[0],O=_[1],S=Wj((0,i.useState)(0),2),N=S[0],P=S[1],E=Wj((0,i.useState)(!1),2),C=E[0],R=E[1];return(0,i.useEffect)(function(){R(!0),r({page:f,perPage:m,search:c,sortKey:g.key,order:g.order}).then(function(e){O(e.data),P(e.total||0),j(e.totalPages||0)}).finally(function(){return R(!1)})},[f,m,c,g]),(0,on.jsxs)("div",{className:"w-full",children:[(0,on.jsxs)("div",{className:"mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,on.jsx)("div",{className:"relative max-w-md"}),(0,on.jsx)("div",{className:"flex items-center gap-2"})]}),(0,on.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm",children:[(0,on.jsx)("div",{className:"overflow-x-auto",children:(0,on.jsxs)("table",{className:"min-w-full text-left text-sm",children:[(0,on.jsx)("thead",{className:"sticky top-0 bg-slate-50",children:(0,on.jsx)("tr",{className:"text-slate-600",children:t.map(function(e){var t=g.key===e.key,r=t?"asc"===g.order?"ascending":"descending":"none",n="px-4 py-3 font-semibold";return e.sortable?(0,on.jsx)("th",{scope:"col","aria-sort":r,className:n,children:(0,on.jsxs)("button",{className:"group inline-flex items-center rounded-lg px-1 py-0.5 hover:bg-slate-200 focus:outline-none focus:ring-2 focus:ring-slate-300",onClick:function(){return t=String(e.key),void b(function(e){return e.key!==t?{key:t,order:"asc"}:"asc"===e.order?{key:t,order:"desc"}:{key:t,order:"asc"}});var t},"aria-label":"Sort by ".concat(e.header),children:[(0,on.jsx)("span",{children:e.header}),(0,on.jsx)(Kj,{order:t?g.order:""})]})},String(e.key)):(0,on.jsx)("th",{scope:"col",className:n,children:e.header},String(e.key))})})}),(0,on.jsx)("tbody",{children:C?(0,on.jsx)(La,{columns:t.map(function(e){return{key:String(e.key),label:String(e.key)}}),rows:m}):0===k.length?(0,on.jsx)(Ww,{}):k.map(function(e,r){return(0,on.jsx)("tr",{className:"border-t border-slate-100 hover:bg-slate-50/60",children:t.map(function(t){var n;return(0,on.jsx)("td",{className:"px-4 py-3 text-slate-700",children:t.render?t.render(e,t.key):e[t.key]===e.id?(f-1)*m+r+1:String(null!==(n=e[t.key])&&void 0!==n?n:"")},String(t.key))})},e.id)})})]})}),(0,on.jsxs)("div",{className:"flex flex-col gap-3 border-t border-slate-200 p-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsxs)("div",{className:"text-xs text-slate-600",children:["Showing ",(0,on.jsx)("span",{className:"font-semibold",children:k.length?(f-1)*m+1:0}),"–",(0,on.jsx)("span",{className:"font-semibold",children:(f-1)*m+k.length})," of",(0,on.jsxs)("span",{className:"font-semibold",children:[" ",N]})]}),(0,on.jsxs)("div",{className:"flex items-center gap-2",children:[(0,on.jsx)("label",{className:"text-sm text-slate-600",children:(0,Xo.__)("Per page","versatile-toolkit")}),(0,on.jsx)("select",{value:m,onChange:function(e){y(Number(e.target.value)),o(Hj(f,Number(e.target.value),c,g.key,g.order))},className:"rounded-xl border !border-slate-200 bg-white px-2 py-1.5 text-sm shadow-sm",children:[5,10,20,50,100].map(function(e){return(0,on.jsx)("option",{value:e,children:e},e)})})]})]}),(0,on.jsxs)("div",{className:"flex items-center gap-1",children:[(0,on.jsxs)("button",{className:"flex items-center gap-1 rounded-lg px-3 py-2 text-sm text-slate-600 hover:bg-slate-100 disabled:opacity-40 disabled:cursor-not-allowed",onClick:function(){var e=Math.max(1,f-1);p(e),o(Hj(e,m,c,g.key,g.order))},disabled:1===f,children:[(0,on.jsx)(Uj,{className:"h-4 w-4"}),"Previous"]}),(0,on.jsx)("div",{className:"flex items-center gap-1 mx-2",children:function(){var e=[],t=Math.max(1,f-Math.floor(1.5)),r=Math.min(w,t+3-1);r-t+1<3&&(t=Math.max(1,r-3+1)),t>1&&(e.push((0,on.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(1===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){p(1),o(Hj(1,m,c,g.key,g.order))},children:"1"},1)),t>2&&e.push((0,on.jsx)("span",{className:"px-2 text-slate-400",children:"..."},"ellipsis1")));for(var n=function(t){e.push((0,on.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(t===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){p(t),o(Hj(t,m,c,g.key,g.order))},children:t},t))},a=t;a<=r;a++)n(a);return r<w&&(r<w-1&&e.push((0,on.jsx)("span",{className:"px-2 text-slate-400",children:"..."},"ellipsis2")),e.push((0,on.jsx)("button",{className:"min-w-[40px] h-10 rounded-lg text-sm font-medium ".concat(w===f?"bg-blue-600 text-white shadow-sm":"text-slate-600 hover:bg-slate-100"),onClick:function(){p(w),o(Hj(w,m,c,g.key,g.order))},children:w},w))),e}()}),(0,on.jsxs)("button",{className:"flex items-center gap-1 rounded-lg px-3 py-2 text-sm text-slate-600 hover:bg-slate-100 disabled:opacity-40 disabled:cursor-not-allowed",onClick:function(){var e=Math.min(w,f+1);p(e),o(Hj(e,m,c,g.key,g.order))},disabled:f===w,children:["Next",(0,on.jsx)(qj,{className:"h-4 w-4"})]})]})]})]})]})}var Yj=function(e){switch(e){case"PHP Fatal error":case"PHP Error":case"PHP Parse error":return"text-red-500";case"PHP Warning":return"text-yellow-500";case"PHP Notice":return"text-blue-500";default:return"text-gray-500"}},Jj=function(e){var t=e.type,r=Yj(t),n=function(e){switch(e){case"PHP Fatal error":case"PHP Error":case"PHP Parse error":return"Error";case"PHP Warning":return"Warning";case"PHP Notice":return"Info";case"debug":return"Debug";default:return e}}(t);return(0,on.jsx)("span",{className:r,children:n})},Xj=function(e){var t=e.row,r=t.raw_line;return(0,on.jsx)("div",{className:"flex gap-1",children:(0,on.jsxs)($c,{children:[(0,on.jsx)(Vc,{asChild:!0,children:(0,on.jsx)(oi,{size:"sm",variant:"ghost","aria-label":"View ".concat(t.type,"'s log"),className:"h-8 w-8 p-0 text-blue-600 hover:bg-blue-50",children:(0,on.jsx)(pg,{className:"h-4 w-4"})})}),(0,on.jsxs)(Wc,{children:[(0,on.jsxs)(Bc,{children:[(0,on.jsxs)(Zc,{children:["Warning Type: ",(0,on.jsx)("span",{className:Yj(t.type),children:t.type})]}),(0,on.jsx)(Kc,{className:"mt-2 hidden",children:t.timestamp})]}),(0,on.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-[#e5e5e5] p-3 my-2",children:(0,on.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-base",children:r})}),(0,on.jsx)(Hc,{className:"sm:justify-end",children:(0,on.jsx)(Uc,{asChild:!0,children:(0,on.jsx)(oi,{type:"button",variant:"secondary",children:(0,Xo.__)("Close","versatile-toolkit")})})})]})]})})};const e_=function(e){var t=e.debugStatus,r=e.logFileInfo,n=e.isAutoRefresh,o=e.isLoading,a=e.statusLoading,i=e.onToggleDebugLog,s=e.onToggleAutoRefresh,l=e.onStopAutoRefresh;return(0,on.jsxs)("div",{className:"space-y-6",children:[(0,on.jsxs)("div",{className:"space-y-3 relative",children:[a?(0,on.jsxs)("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-lg border animate-pulse",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,on.jsx)("div",{className:"w-3 h-3 rounded-full bg-slate-300 animate-pulse"}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,on.jsx)("div",{className:"h-4 bg-slate-300 rounded w-32 animate-pulse"}),(0,on.jsx)("div",{className:"h-6 bg-slate-300 rounded-full w-16 animate-pulse"})]}),(0,on.jsx)("div",{className:"h-3 bg-slate-300 rounded w-48 animate-pulse"})]})]}),(0,on.jsx)("div",{className:"w-11 h-6 bg-slate-300 rounded-full animate-pulse"})]}):(0,on.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg border",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,on.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(t?"bg-green-500":"bg-red-500")}),(0,on.jsxs)("div",{children:[(0,on.jsxs)("div",{className:"flex gap-2",children:[(0,on.jsx)("h3",{className:"font-medium text-slate-800",children:(0,Xo.__)("Debug Logging Status","versatile-toolkit")}),(0,on.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-medium ".concat(t?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:t?(0,Xo.__)("Enabled","versatile-toolkit"):(0,Xo.__)("Disabled","versatile-toolkit")})]}),(0,on.jsx)("p",{className:"text-sm text-slate-600",children:t?(0,Xo.__)("Debug logging is currently enabled","versatile-toolkit"):(0,Xo.__)("Debug logging is currently disabled","versatile-toolkit")})]})]}),(0,on.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,on.jsx)("input",{type:"checkbox",checked:t,onClick:function(e){return i(e.target.checked)},className:"sr-only peer"}),(0,on.jsx)("div",{className:"w-11 h-6 bg-slate-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]}),o?(0,on.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-200 animate-pulse",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,on.jsx)("div",{className:"w-4 h-4 bg-blue-300 rounded animate-pulse"}),(0,on.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,on.jsx)("div",{className:"h-4 bg-blue-300 rounded w-20 animate-pulse"}),(0,on.jsx)("div",{className:"h-3 bg-blue-300 rounded w-12 animate-pulse"})]})]}),(0,on.jsx)("div",{className:"w-11 h-6 bg-blue-300 rounded-full animate-pulse"})]}):(0,on.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-200",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,on.jsx)("svg",{className:"w-4 h-4 text-blue-600 ".concat(n?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,on.jsxs)("span",{className:"text-sm font-medium text-blue-800",children:[(0,Xo.__)("Auto Refresh","versatile-toolkit"),n&&(0,on.jsxs)("span",{className:"ml-1 text-xs",children:["(",(0,Xo.__)("Active","versatile-toolkit"),")"]})]})]}),(0,on.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,on.jsx)("input",{type:"checkbox",checked:n,onChange:function(e){s(e.target.checked),e.target.checked||l()},className:"sr-only peer"}),(0,on.jsx)("div",{className:"w-11 h-6 bg-slate-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]})]}),(0,on.jsx)("div",{className:"space-y-3",children:o?(0,on.jsxs)("div",{className:"p-3 bg-slate-50 rounded-lg border",children:[(0,on.jsx)("div",{className:"h-9 bg-slate-200 rounded animate-pulse mb-3"}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-20"}),(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-16"})]}),(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-16"}),(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-12"})]}),(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-24"}),(0,on.jsx)("div",{className:"h-4 bg-slate-200 rounded animate-pulse w-32"})]})]})]}):(0,on.jsxs)("div",{className:"p-4 bg-slate-50 rounded-lg border",children:[(0,on.jsx)("h3",{className:"font-medium text-slate-800 mb-3",children:(0,Xo.__)("Log File Information","versatile-toolkit")}),(0,on.jsxs)("div",{className:"space-y-2",children:[(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("span",{className:"text-sm text-slate-600",children:(0,Xo.__)("File Status:","versatile-toolkit")}),(0,on.jsx)("span",{className:"text-sm font-medium ".concat(r.exists?"text-green-600":"text-red-600"),children:r.exists?(0,Xo.__)("Exists","versatile-toolkit"):(0,Xo.__)("Not Found","versatile-toolkit")})]}),(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("span",{className:"text-sm text-slate-600",children:(0,Xo.__)("File Size:","versatile-toolkit")}),(0,on.jsx)("span",{className:"text-sm font-medium text-slate-800",children:r.size})]}),(0,on.jsxs)("div",{className:"flex justify-between items-center",children:[(0,on.jsx)("span",{className:"text-sm text-slate-600",children:(0,Xo.__)("Last Modified:","versatile-toolkit")}),(0,on.jsx)("span",{className:"text-sm font-medium text-slate-800",children:r.lastModified})]})]})]})})]})};function t_(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return r_(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return a=t,s=0,l=e,f.n=r,i}};function p(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],p=f.p,h=a[2];r>3?(o=h===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=r<2&&p<a[1])?(s=0,f.v=n,f.n=a[1]):p<h&&(o=r<3||a[0]>n||n>h)&&(a[4]=r,a[5]=n,f.n=h,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:r.call(n,f))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(r_(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,r_(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,r_(d,"constructor",c),r_(c,"constructor",l),l.displayName="GeneratorFunction",r_(c,o,"GeneratorFunction"),r_(d),r_(d,o,"Generator"),r_(d,n,function(){return this}),r_(d,"toString",function(){return"[object Generator]"}),(t_=function(){return{w:a,m:f}})()}function r_(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}r_=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){r_(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},r_(e,t,r,n)}function n_(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function o_(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){n_(a,n,o,i,s,"next",e)}function s(e){n_(a,n,o,i,s,"throw",e)}i(void 0)})}}var a_,i_,s_,l_,c_,u_,d_={getStatus:(u_=o_(t_().m(function e(){var t,r,n;return t_().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_get_debug_log_status",versatile_nonce:$o.nonce_value}),e.n=1,fetch($o.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to get debug log status");case 3:return e.a(2,n.data)}},e)})),function(){return u_.apply(this,arguments)}),toggleDebugLog:(c_=o_(t_().m(function e(t){var r,n,o;return t_().w(function(e){for(;;)switch(e.n){case 0:return r=new URLSearchParams({action:"versatile_toggle_debug_log",versatile_nonce:$o.nonce_value,enable:t.toString()}),e.n=1,fetch($o.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r});case 1:return n=e.v,e.n=2,n.json();case 2:if(200===(o=e.v).status_code){e.n=3;break}throw new Error(o.message||"Failed to toggle debug log");case 3:return e.a(2,o.data)}},e)})),function(e){return c_.apply(this,arguments)}),clearLog:(l_=o_(t_().m(function e(){var t,r,n;return t_().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_clear_debug_log",versatile_nonce:$o.nonce_value}),e.n=1,fetch($o.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to clear debug log");case 3:return e.a(2)}},e)})),function(){return l_.apply(this,arguments)}),downloadLog:(s_=o_(t_().m(function e(){var t,r;return t_().w(function(e){for(;;)if(0===e.n)return t=new URLSearchParams({action:"versatile_download_debug_log",versatile_nonce:$o.nonce_value}),r="".concat($o.ajax_url,"?").concat(t),window.open(r,"_blank"),e.a(2,Promise.resolve())},e)})),function(){return s_.apply(this,arguments)}),refreshStatus:(i_=o_(t_().m(function e(){var t,r,n;return t_().w(function(e){for(;;)switch(e.n){case 0:return t=new URLSearchParams({action:"versatile_refresh_debug_log",versatile_nonce:$o.nonce_value}),e.n=1,fetch($o.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});case 1:return r=e.v,e.n=2,r.json();case 2:if(200===(n=e.v).status_code){e.n=3;break}throw new Error(n.message||"Failed to refresh debug log status");case 3:return e.a(2,n.data)}},e)})),function(){return i_.apply(this,arguments)}),loadLogContent:(a_=o_(t_().m(function e(t){var r,n,o,a,i,s,l,c,u,d,f;return t_().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.page,n=t.perPage,o=t.search,a=t.sortKey,i=t.order,e.p=1,l=new URLSearchParams({action:"versatile_get_debug_log_content",versatile_nonce:$o.nonce_value,page:String(r),per_page:String(n),search:String(o||"").trim(),sortKey:String(a||"").trim(),order:String((null==i||null===(s=i.trim())||void 0===s?void 0:s.toLowerCase())||"")}),e.n=2,fetch("".concat($o.ajax_url,"?").concat(l));case 2:return c=e.v,e.n=3,c.json();case 3:if(200!==(u=e.v).status_code){e.n=4;break}return d=u.data,e.a(2,{data:d.entries,total:null==d?void 0:d.total_entries,totalPages:null==d?void 0:d.total_pages});case 4:throw new Error(u.message||"Error fetching debug log content");case 5:e.n=7;break;case 6:throw e.p=6,f=e.v,new Error((null==f?void 0:f.message)||"Unknown error fetching debug log content");case 7:return e.a(2)}},e,null,[[1,6]])})),function(e){return a_.apply(this,arguments)})};function f_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p_(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)?p_(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p_(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}const h_=function(){var e,t,r=f_(pt(),1)[0],n=f_((0,i.useState)(!1),2),o=n[0],a=n[1],s=f_((0,i.useState)(0),2),l=s[0],c=s[1],u=Qo({queryKey:["debugLogStatus"],queryFn:d_.getStatus,refetchInterval:3e4,staleTime:1e4}),d=u.data,f=u.isLoading,p=u.refetch,h=function(){var e=sn();return Jo({mutationFn:d_.toggleDebugLog,onSuccess:function(t,r){e.invalidateQueries({queryKey:["debugLogStatus"]});var n=r?"enabled":"disabled";hr.success((0,Xo.__)("Debug logging ".concat(n," successfully"),"versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Failed to toggle debug logging","versatile-toolkit"))}})}(),m=function(){var e=sn();return Jo({mutationFn:d_.clearLog,onSuccess:function(){e.invalidateQueries({queryKey:["debugLogStatus"]}),hr.success((0,Xo.__)("Debug log cleared successfully","versatile-toolkit"))},onError:function(e){hr.error(e.message||(0,Xo.__)("Failed to clear debug log","versatile-toolkit"))}})}(),y=(null==d?void 0:d.enabled)||!1,v=d?(t=(e=d).file_exists&&e.last_modified>0?new Date(1e3*e.last_modified).toLocaleString():"Never",{exists:e.file_exists,size:e.file_size_formatted,lastModified:t}):{size:"0 KB",lastModified:"Never",exists:!1},g=f||h.isPending||m.isPending;(0,i.useEffect)(function(){var e;return o&&(e=setInterval(function(){c(function(e){return e+1})},5e3)),function(){e&&clearInterval(e)}},[o]);var b=[{key:"id",header:"No"},{key:"type",header:"Type",render:function(e){return(0,on.jsx)(Jj,{type:e.type})}},{key:"message",header:"Description",render:function(e,t){return(0,on.jsxs)(on.Fragment,{children:[e.raw_line.substring(0,200),"..."]})}},{key:"timestamp",header:"Timestamp",render:function(e){var t=e.timestamp;if(!t)return"Invalid Date";try{var r=t.replace(" UTC","");return new Date(r+" UTC").toLocaleString()}catch(e){return"Invalid Date"}}},{key:"actions",header:"Actions",render:function(e,t){return(0,on.jsx)(Xj,{row:e},t)}}];return(0,on.jsxs)("div",{className:"mx-auto max-w-6xl p-6",children:[f?(0,on.jsx)("div",{className:"bg-white p-6 rounded-lg border border-slate-200 mt-3",children:(0,on.jsxs)("div",{className:"flex items-center justify-between animate-pulse",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,on.jsx)("div",{className:"w-3 h-3 rounded-full bg-slate-300"}),(0,on.jsxs)("div",{children:[(0,on.jsx)("div",{className:"h-5 bg-slate-300 rounded w-32 mb-2"}),(0,on.jsx)("div",{className:"h-3 bg-slate-200 rounded w-24"})]})]}),(0,on.jsx)("div",{className:"h-9 bg-slate-300 rounded-lg w-20"})]})}):(0,on.jsx)("div",{className:"bg-white p-6 rounded-lg border border-slate-200 mt-3",children:(0,on.jsxs)("div",{className:"flex items-center justify-between",children:[(0,on.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,on.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(y?"bg-green-500":"bg-red-500")}),(0,on.jsxs)("div",{children:[(0,on.jsx)("h3",{className:"font-medium text-slate-800",children:(0,Xo.__)("Debug Logging","versatile-toolkit")}),(0,on.jsxs)("p",{className:"text-sm text-slate-600",children:[y?(0,Xo.__)("Currently enabled","versatile-toolkit"):(0,Xo.__)("Currently disabled","versatile-toolkit"),o&&(0,on.jsxs)("span",{className:"ml-2 text-blue-600",children:["• ",(0,Xo.__)("Auto refresh active","versatile-toolkit")]})]})]})]}),(0,on.jsxs)(Oj,{children:[(0,on.jsx)(Sj,{asChild:!0,children:(0,on.jsxs)("button",{className:"flex items-center space-x-2 px-3 py-2 bg-slate-100 text-slate-700 rounded-lg hover:bg-slate-200 transition-colors",children:[(0,on.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,on.jsx)("span",{className:"text-sm",children:(0,Xo.__)("Settings","versatile-toolkit")})]})}),(0,on.jsxs)(Cj,{children:[(0,on.jsx)(Rj,{children:(0,on.jsx)(Tj,{children:(0,Xo.__)("Debug Log Settings","versatile-toolkit")})}),(0,on.jsx)("div",{className:"mt-6",children:(0,on.jsx)(e_,{debugStatus:y,logFileInfo:v,isAutoRefresh:o,isLoading:g,statusLoading:f,onToggleDebugLog:function(e){h.mutate(e)},onToggleAutoRefresh:function(e){a(e)},onStopAutoRefresh:function(){a(!1),hr.success((0,Xo.__)("Auto refresh stopped","versatile-toolkit"))}})})]})]})]})}),(0,on.jsxs)("div",{className:"my-8",children:[(0,on.jsxs)("div",{className:" bg-white rounded-lg border p-2 flex items-center justify-between",children:[(0,on.jsx)("h3",{className:"font-medium text-slate-800 text-lg",children:(0,Xo.__)("Debug Log","versatile-toolkit")}),(0,on.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,on.jsx)("button",{title:(0,Xo.__)("Refresh Log","versatile-toolkit"),onClick:function(){p(),c(function(e){return e+1}),hr.success((0,Xo.__)("Debug log status and content refreshed","versatile-toolkit"))},disabled:g,className:"flex items-center justify-center space-x-3 px-2 py-1 bg-blue-500 text-white rounded-lg hover:bg-blue-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,on.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,on.jsx)("button",{title:(0,Xo.__)("Download Log","versatile-toolkit"),onClick:function(){v.exists?d_.downloadLog():hr.error((0,Xo.__)("No log file to download","versatile-toolkit"))},disabled:!v.exists||g,className:"flex items-center justify-center space-x-2 px-2 py-1 bg-green-600 text-white rounded-lg hover:bg-green-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,on.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,on.jsx)("button",{title:(0,Xo.__)("Clear Log","versatile-toolkit"),onClick:function(){v.exists?window.confirm((0,Xo.__)("Are you sure you want to clear the debug log? This action cannot be undone.","versatile-toolkit"))&&m.mutate(void 0,{onSuccess:function(){p(),c(function(e){return e+1})}}):hr.error((0,Xo.__)("No log file to clear","versatile-toolkit"))},disabled:!v.exists||g,className:"flex items-center justify-center space-x-2 px-2 py-1 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 disabled:bg-slate-300 disabled:cursor-not-allowed transition-colors",children:(0,on.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,on.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),(0,on.jsx)(Qj,{columns:b,fetchData:d_.loadLogContent,searchParams:r},l)]})]})};var m_=a.createRoot(document.getElementById("versatile-root")),y_=new class{#B;#m;#u;#H;#Z;#K;#G;#Q;constructor(e={}){this.#B=e.queryCache||new Yr,this.#m=e.mutationCache||new Xr,this.#u=e.defaultOptions||{},this.#H=new Map,this.#Z=new Map,this.#K=0}mount(){this.#K++,1===this.#K&&(this.#G=Vr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#B.onFocus())}),this.#Q=zr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#B.onOnline())}))}unmount(){this.#K--,0===this.#K&&(this.#G?.(),this.#G=void 0,this.#Q?.(),this.#Q=void 0)}isFetching(e){return this.#B.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#m.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#B.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#B.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(br(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#B.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#B.get(n.queryHash),a=o?.state.data,i=function(e,t){return"function"==typeof e?e(t):e}(t,a);if(void 0!==i)return this.#B.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Lr.batch(()=>this.#B.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#B.get(t.queryHash)?.state}removeQueries(e){const t=this.#B;Lr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=this.#B;return Lr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Lr.batch(()=>this.#B.findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(yr).catch(yr)}invalidateQueries(e,t={}){return Lr.batch(()=>(this.#B.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Lr.batch(()=>this.#B.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(yr)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(n).then(yr)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#B.build(this,t);return r.isStaleByTime(br(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yr).catch(yr)}fetchInfiniteQuery(e){return e.behavior=tn(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yr).catch(yr)}ensureInfiniteQueryData(e){return e.behavior=tn(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zr.isOnline()?this.#m.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#B}getMutationCache(){return this.#m}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#H.set(kr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#H.values()],r={};return t.forEach(t=>{Or(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#Z.set(kr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#Z.values()],r={};return t.forEach(t=>{Or(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_r(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#B.clear(),this.#m.clear()}}({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});m_.render((0,on.jsx)(Ig,{onError:function(e,t){},children:(0,on.jsx)(ln,{client:y_,children:(0,on.jsx)(Ig,{onError:function(e,t){},children:(0,on.jsx)(st,{children:(0,on.jsxs)(Ig,{onError:function(e,t){},children:[(0,on.jsx)(Lj,{}),(0,on.jsxs)(Se,{children:[(0,on.jsx)(ke,{path:"/",element:(0,on.jsx)(Ig,{children:(0,on.jsx)(za,{})})}),(0,on.jsx)(ke,{path:"/troubleshoot",element:(0,on.jsx)($j,{children:(0,on.jsx)(Ig,{children:(0,on.jsx)(uv,{})})})}),(0,on.jsx)(ke,{path:"/maintenance",element:(0,on.jsx)($j,{children:(0,on.jsx)(Ig,{children:(0,on.jsx)(eb,{})})})}),(0,on.jsx)(ke,{path:"/comingsoon",element:(0,on.jsx)($j,{children:(0,on.jsx)(Ig,{children:(0,on.jsx)(db,{})})})}),(0,on.jsx)(ke,{path:"/templogin",element:(0,on.jsx)($j,{children:(0,on.jsx)(Ig,{children:(0,on.jsx)(hj,{})})})}),(0,on.jsx)(ke,{path:"/troubleshoot/debug-log",element:(0,on.jsx)($j,{children:(0,on.jsx)(Ig,{children:(0,on.jsx)(h_,{})})})})]}),(0,on.jsx)(pr,{position:"bottom-right",containerClassName:"!z-[9999999]",toastOptions:{duration:5e3,style:{background:"#fff",color:"#333",border:"1px solid #e5e7eb",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},success:{style:{background:"#f0fdf4",borderColor:"#86efac"}},error:{style:{background:"#fef2f2",borderColor:"#fecaca"}}}})]})})})})}))})();
  • versatile-toolkit/trunk/constants.php

    r3349303 r3368877  
    4242            'subtitle'              => 'Our site is currently undergoing scheduled maintenance.',
    4343            'description'           => 'Thank you for your patience. We&rsquo;re working hard to bring everything back online better than ever.',
    44             'template'              => 'default',
     44            'template'              => 'classic',
    4545            'background_image'      => '',
    4646            'background_image_id'   => 0,
     
    5858            'subtitle'              => 'We&rsquo;re working on something amazing.',
    5959            'description'           => 'Stay tuned for our exciting launch. Something great is coming your way!',
    60             'template'              => 'default',
     60            'template'              => 'classic',
    6161            'background_image'      => '',
    6262            'background_image_id'   => 0,
     
    8181            'enable'      => true,
    8282            'path'        => 'troubleshoot',
    83             'description' => 'Disable plugin byIP specific, plugin conflicts, and view debug logs.',
     83            'description' => 'Disable plugin by IP specific, plugin conflicts, and view debug logs.',
    8484            'menus'       => array(
    8585                'troubleshoot' => array(
     
    112112            'icon'        => 'dashicons-admin-tools',
    113113        ),
     114        'templogin'    => array(
     115            'label'       => 'Temporary Login',
     116            'enable'      => true,
     117            'path'        => 'templogin',
     118            'description' => 'Create and manage temporary login access for users without sharing permanent credentials.',
     119            'icon'        => 'dashicons-admin-users',
     120        ),
    114121    )
    115122);
  • versatile-toolkit/trunk/inc/Database/Migration.php

    r3342118 r3368877  
    11<?php
    22/**
    3  * The Migration class creates and drops tables of products
     3 * Database Migration
    44 *
    55 * @package Versatile\Database
    66 * @subpackage Versatile\Database\Migration
    7  * @author  Versatile<v[email protected]>
     7 * @author  Versatile<V[email protected]>
    88 * @since 1.0.0
    99 */
     
    1616
    1717/**
    18  * The Migrate class creates and drops tables for a database
     18 * Migration description
    1919 */
    2020class Migration {
    2121
    2222    /**
    23      * The function returns an array of tables
     23     * Get tables
    2424     *
    2525     * @since 1.0.0
    2626     *
    27      * @return array of tables
     27     * @return array
    2828     */
    2929    public static function tables() {
    3030        $tables = array(
    31             // new DemoTable(),
     31            new TempLoginTable(),
    3232        );
    33 
    3433        return $tables;
    3534    }
    3635
    3736    /**
    38      * Create all the tables
     37     * Run migration
    3938     *
    4039     * @since 1.0.0
    4140     *
    42      * @throws \Throwable If there is an error while creating the tables.
    43      *
    44      * @return void
     41     * @return void | Throwable
     42     * @throws \Throwable When table creation fails.
    4543     */
    4644    public static function migrate() {
    4745        $tables = self::tables();
    48 
    4946        foreach ( $tables as $table ) {
    5047            try {
     
    5754
    5855    /**
    59      * Drop all the tables
     56     * Drop all tables
    6057     *
    6158     * @since 1.0.0
    6259     *
    63      * @return void
     60     * @return void | Throwable
     61     * @throws \Throwable When table creation fails.
    6462     */
    6563    public static function drop_tables() {
    6664        // Command: Versatile\Database\Migration::drop_tables();
    6765        global $wpdb;
    68 
    6966        $wpdb->query( 'SET foreign_key_checks = 0' );
    70 
    71         // Reorganized tables to prevent parent child issue.
    7267        $tables = self::tables();
    73 
    7468        foreach ( $tables as $table ) {
    75             $table->drop_table();
     69            try {
     70                $table->drop_table();
     71            } catch ( \Throwable $th ) {
     72                throw $th;
     73            }
    7674        }
    77 
    7875        $wpdb->query( 'SET foreign_key_checks = 1' );
    7976    }
    8077
    8178    /**
    82      * Delete all data from database
     79     * Clear all data
    8380     *
    8481     * @since 1.0.0
    8582     *
    86      * @return void
     83     * @return void | Throwable
     84     * @throws \Throwable When table creation fails.
    8785     */
    88     public static function clear_data() {
     86    public function clear_data() {
     87        // Command: Versatile\Database\Migration::clear_data();
    8988        global $wpdb;
    90 
    9189        $wpdb->query( 'SET foreign_key_checks = 0' );
    92 
    93         // Reorganized tables to prevent parent child issue.
    9490        $tables = self::tables();
    95 
    9691        foreach ( $tables as $table ) {
    97             // $wpdb->query( "DELETE FROM {$table->get_table_name()}" );
    98             $wpdb->query( $wpdb->prepare( 'DELETE FROM %s', $table->get_table_name() ) );
     92            $wpdb->query( 'DELETE FROM %s', $table->get_table_name() );
    9993        }
    100 
    10194        $wpdb->query( 'SET foreign_key_checks = 1' );
    10295    }
  • versatile-toolkit/trunk/inc/Helpers/ValidationHelper.php

    r3349303 r3368877  
    145145                            }
    146146                            break;
     147                        case 'in_array':
     148                            $values = explode( ':', $rule, 2 )[1];
     149                            if ( empty( $data[ $key ] ) ) {
     150                                break;
     151                            }
     152                            if ( ! self::in_array( $data[ $key ], explode( ',', $values ) ) ) {
     153                                $validation_pass             = false;
     154                                $validation_errors[ $key ][] = versatile_readable_key( $key ) . __( ' is not valid', 'versatile-toolkit' );
     155                            }
     156                            break;
    147157                        case 'date_format':
    148158                            $format = explode( ':', $rule, 2 )[1];
  • versatile-toolkit/trunk/inc/Services/MaintenanceMode/MaintenanceMode.php

    r3349303 r3368877  
    125125            $verified_data = (object) $verify_request['data'];
    126126
    127             $verified_data->enable_maintenance      = filter_var( $verified_data->enable_maintenance, FILTER_VALIDATE_BOOLEAN );
    128             $verified_data->show_subscribers_only   = filter_var( $verified_data->show_subscribers_only, FILTER_VALIDATE_BOOLEAN );
    129             $current_mood_info                       = get_option( VERSATILE_MOOD_LIST, VERSATILE_DEFAULT_MOOD_LIST );
    130             $current_mood_info['enable_maintenance'] = $verified_data->enable_maintenance ?? false;
     127            $verified_data->enable_maintenance          = filter_var( $verified_data->enable_maintenance, FILTER_VALIDATE_BOOLEAN );
     128            $verified_data->show_subscribers_only       = filter_var( $verified_data->show_subscribers_only, FILTER_VALIDATE_BOOLEAN );
     129            $current_mood_info                          = get_option( VERSATILE_MOOD_LIST, VERSATILE_DEFAULT_MOOD_LIST );
     130            $current_mood_info['enable_maintenance']    = $verified_data->enable_maintenance ?? false;
    131131            $current_mood_info['show_subscribers_only'] = $verified_data->show_subscribers_only ?? false;
    132132            if ( $current_mood_info['enable_maintenance'] ) {
  • versatile-toolkit/trunk/inc/Services/ServiceInit.php

    r3349303 r3368877  
    1919use Versatile\Services\Comingsoon\ComingsoonMood;
    2020use Versatile\Services\QuickPick\QuickPick;
     21use Versatile\Services\Templogin\Templogin;
     22use Versatile\Database\TempLoginTable;
    2123use Versatile\Traits\JsonResponse;
    2224
     
    3537     */
    3638    public function __construct() {
     39        // new TempLoginTable();
     40        $new_table = new TempLoginTable();
     41        $new_table->create_table();
    3742
    3843        $versatile_service_list = get_option( VERSATILE_SERVICE_LIST, VERSATILE_DEFAULT_SERVICE_LIST );
     
    4954        if ( $versatile_service_list['comingsoon']['enable'] ) {
    5055            new ComingsoonMood();
     56        }
     57
     58        // Templogin service
     59        if ( $versatile_service_list['templogin']['enable'] ) {
     60            new Templogin();
    5161        }
    5262
  • versatile-toolkit/trunk/inc/VersatileGlobals.php

    r3349303 r3368877  
    9797            'value'    => $_REQUEST['versatile_nonce'], //phpcs:ignore
    9898            'sanitize' => 'sanitize_text_field',
    99             'rules'    => 'required|alphanumeric',
     99            'rules'    => 'required',
    100100        ),
    101101    );
  • versatile-toolkit/trunk/languages/versatile-toolkit.pot

    r3349805 r3368877  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Versatile Toolkit 1.0.2\n"
     5"Project-Id-Version: Versatile Toolkit 1.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/versatile-toolkit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-08-25T14:26:41+00:00\n"
     12"POT-Creation-Date: 2025-09-27T12:19:14+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    9898msgstr ""
    9999
    100 #: inc/Helpers/ValidationHelper.php:151
     100#: inc/Helpers/ValidationHelper.php:154
     101msgid " is not valid"
     102msgstr ""
     103
     104#: inc/Helpers/ValidationHelper.php:161
    101105msgid " invalid date format"
    102106msgstr ""
    103107
    104 #: inc/Helpers/ValidationHelper.php:160
     108#: inc/Helpers/ValidationHelper.php:170
    105109msgid " user does not exist"
    106110msgstr ""
     
    119123msgstr ""
    120124
    121 #: inc/Services/ServiceInit.php:80
     125#: inc/Services/ServiceInit.php:90
    122126msgid "Service list retrieved successfully!"
    123127msgstr ""
    124128
    125 #: inc/Services/ServiceInit.php:82
     129#: inc/Services/ServiceInit.php:92
    126130msgid "Error: while retrieving service list"
    127131msgstr ""
    128132
    129 #: inc/Services/ServiceInit.php:116
     133#: inc/Services/ServiceInit.php:126
    130134msgid "Enabled services retrieved successfully!"
    131135msgstr ""
    132136
    133 #: inc/Services/ServiceInit.php:118
     137#: inc/Services/ServiceInit.php:128
    134138msgid "Error: while retrieving enabled services"
    135139msgstr ""
    136140
    137 #: inc/Services/ServiceInit.php:166
     141#: inc/Services/ServiceInit.php:176
    138142msgid "Error: Service not found"
    139143msgstr ""
    140144
    141 #: inc/Services/ServiceInit.php:185
     145#: inc/Services/ServiceInit.php:195
    142146msgid "Error: Failed to update service status"
    143147msgstr ""
    144148
    145 #: inc/Services/ServiceInit.php:213
     149#: inc/Services/ServiceInit.php:223
    146150msgid "Maintenance Mood info retrieved successfully!"
    147151msgstr ""
    148152
    149 #: inc/Services/ServiceInit.php:215
     153#: inc/Services/ServiceInit.php:225
    150154msgid "Error: while retrieving maintenance mood info"
     155msgstr ""
     156
     157#: inc/Services/Templogin/Templogin.php:200
     158msgid "Temporary logins retrieved successfully"
     159msgstr ""
     160
     161#: inc/Services/Templogin/Templogin.php:202
     162msgid "Error: Failed to retrieve temporary logins"
     163msgstr ""
     164
     165#: inc/Services/Templogin/Templogin.php:270
     166#: inc/Services/Templogin/Templogin.php:379
     167msgid "Error: Email already exists"
     168msgstr ""
     169
     170#: inc/Services/Templogin/Templogin.php:276
     171#: inc/Services/Templogin/Templogin.php:387
     172msgid "Error: Invalid role specified"
     173msgstr ""
     174
     175#: inc/Services/Templogin/Templogin.php:285
     176#: inc/Services/Templogin/Templogin.php:471
     177msgid "Error: Invalid expiration date format"
     178msgstr ""
     179
     180#: inc/Services/Templogin/Templogin.php:302
     181#: inc/Services/Templogin/Templogin.php:309
     182msgid "Error: Failed to create temporary login"
     183msgstr ""
     184
     185#: inc/Services/Templogin/Templogin.php:307
     186msgid "Temporary login created successfully"
     187msgstr ""
     188
     189#: inc/Services/Templogin/Templogin.php:369
     190#: inc/Services/Templogin/Templogin.php:465
     191#: inc/Services/Templogin/Templogin.php:525
     192msgid "Error: Temporary login not found"
     193msgstr ""
     194
     195#: inc/Services/Templogin/Templogin.php:418
     196#: inc/Services/Templogin/Templogin.php:423
     197msgid "Error: Failed to update temporary login"
     198msgstr ""
     199
     200#: inc/Services/Templogin/Templogin.php:421
     201msgid "Temporary login updated successfully"
     202msgstr ""
     203
     204#: inc/Services/Templogin/Templogin.php:480
     205#: inc/Services/Templogin/Templogin.php:487
     206msgid "Error: Failed to extend temporary login time"
     207msgstr ""
     208
     209#: inc/Services/Templogin/Templogin.php:485
     210msgid "Temporary login time extended successfully"
     211msgstr ""
     212
     213#: inc/Services/Templogin/Templogin.php:530
     214#: inc/Services/Templogin/Templogin.php:537
     215msgid "Error: Failed to delete temporary login"
     216msgstr ""
     217
     218#: inc/Services/Templogin/Templogin.php:535
     219msgid "Temporary login deleted successfully"
     220msgstr ""
     221
     222#: inc/Services/Templogin/Templogin.php:585
     223#: inc/Services/Templogin/Templogin.php:602
     224msgid "Error: Failed to update temporary login status"
     225msgstr ""
     226
     227#: inc/Services/Templogin/Templogin.php:600
     228msgid "Temporary login status updated successfully"
     229msgstr ""
     230
     231#: inc/Services/Templogin/Templogin.php:613
     232#: inc/Services/Templogin/Templogin.php:916
     233msgid "Security check failed"
     234msgstr ""
     235
     236#: inc/Services/Templogin/Templogin.php:617
     237#: inc/Services/Templogin/Templogin.php:920
     238#: inc/VersatileGlobals.php:50
     239msgid "You do not have permission to access this feature."
     240msgstr ""
     241
     242#: inc/Services/Templogin/Templogin.php:627
     243msgid "Available roles retrieved successfully"
     244msgstr ""
     245
     246#: inc/Services/Templogin/Templogin.php:629
     247msgid "Error: Failed to retrieve available roles"
     248msgstr ""
     249
     250#: inc/Services/Templogin/Templogin.php:826
     251msgid "Error: Failed to run cleanup"
     252msgstr ""
     253
     254#: inc/Services/Templogin/Templogin.php:926
     255msgid "Manual cleanup completed successfully"
     256msgstr ""
     257
     258#: inc/Services/Templogin/Templogin.php:929
     259msgid "Error: Failed to run manual cleanup"
    151260msgstr ""
    152261
     
    194303msgstr ""
    195304
    196 #: inc/VersatileGlobals.php:50
    197 msgid "You do not have permission to access this feature."
    198 msgstr ""
    199 
    200305#: inc/VersatileGlobals.php:63
    201306msgid "Invalid security token!"
  • versatile-toolkit/trunk/readme.txt

    r3349805 r3368877  
    1 === Versatile - Troubleshoot, Maintenance & Comingsoon Mode  ===
     1=== Versatile - Troubleshoot, Temporary Login, Maintenance & Comingsoon Mode  ===
    22Contributors: nurwp
    3 Tags: troubleshooting, maintenance mode, coming soon, IP control, WordPress toolkit
     3Tags: troubleshooting, temporary login, maintenance mode, coming soon, IP control, WordPress toolkit
    44Requires at least: 5.3
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    9292== Changelog ==
    9393
     94= 1.0.3 =
     95* Added temporary login feature for secure remote access
     96* Implemented time-limited access tokens for remote login
     97* Added role-based access control
     98
    9499= 1.0.2 =
    95100= Debug log pagination numbering issue fixed
  • versatile-toolkit/trunk/versatile-toolkit.php

    r3349805 r3368877  
    22/**
    33 * Plugin Name: Versatile Toolkit
    4  * Version: 1.0.2
     4 * Version: 1.0.3
    55 * Requires at least: 5.3
    66 * Requires PHP: 7.4
     
    5050         * @return void
    5151         */
    52         public function __construct() {
     52        private function __construct() {
    5353            require_once 'constants.php';
    5454
Note: See TracChangeset for help on using the changeset viewer.