meyi-backup-ui 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +653 -30
- package/dist/index.mjs +3380 -3075
- package/dist/lib/restoreScript.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),Be=require("@tanstack/react-router"),Ha=require("react-redux"),Ce=require("@reduxjs/toolkit"),Za=require("react-dom"),Re=require("@tanstack/react-query");function uu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=uu(k),us=uu(Za);var go={exports:{}},gr={};var cc;function Wp(){if(cc)return gr;cc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return gr.Fragment=t,gr.jsx=n,gr.jsxs=n,gr}var yr={};var lc;function Hp(){return lc||(lc=1,process.env.NODE_ENV!=="production"&&(function(){function e(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===ne?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case b:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case $:return"Suspense";case O:return"SuspenseList";case H:return"Activity"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case y:return"Portal";case _:return R.displayName||"Context";case S:return(R._context.displayName||"Context")+".Consumer";case N:var J=R.render;return R=R.displayName,R||(R=J.displayName||J.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case T:return J=R.displayName||null,J!==null?J:e(R.type)||"Memo";case W:J=R._payload,R=R._init;try{return e(R(J))}catch{}}return null}function t(R){return""+R}function n(R){try{t(R);var J=!1}catch{J=!0}if(J){J=console;var G=J.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return G.call(J,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(R)}}function r(R){if(R===b)return"<>";if(typeof R=="object"&&R!==null&&R.$$typeof===W)return"<...>";try{var J=e(R);return J?"<"+J+">":"<...>"}catch{return"<...>"}}function o(){var R=C.A;return R===null?null:R.getOwner()}function s(){return Error("react-stack-top-frame")}function a(R){if(P.call(R,"key")){var J=Object.getOwnPropertyDescriptor(R,"key").get;if(J&&J.isReactWarning)return!1}return R.key!==void 0}function c(R,J){function G(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",J))}G.isReactWarning=!0,Object.defineProperty(R,"key",{get:G,configurable:!0})}function u(){var R=e(this.type);return q[R]||(q[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function l(R,J,G,X,re,ce){var I=G.ref;return R={$$typeof:g,type:R,key:J,props:G,_owner:X},(I!==void 0?I:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:u}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function f(R,J,G,X,re,ce){var I=J.children;if(I!==void 0)if(X)if(z(I)){for(X=0;X<I.length;X++)d(I[X]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(I);if(P.call(J,"key")){I=e(R);var Q=Object.keys(J).filter(function(me){return me!=="key"});X=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",F[I+X]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,X,$,Q,$),F[$+X]=!0)}if($=null,Y!==void 0&&(n(Y),$=""+Y),a(J)&&(n(J.key),$=""+J.key),"key"in J){Y={};for(var le in J)le!=="key"&&(Y[le]=J[le])}else Y=J;return $&&c(Y,typeof R=="function"?R.displayName||R.name||"Unknown":R),l(R,$,Y,o(),re,ce)}function d(R){h(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===H&&(R._payload.status==="fulfilled"?h(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function h(R){return typeof R=="object"&&R!==null&&R.$$typeof===g}var p=E,g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),N=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,z=Array.isArray,G=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(R){return R()}};var D,W={},V=p.react_stack_bottom_frame.bind(p,s)(),B=G(r(s)),F={};yr.Fragment=b,yr.jsx=function(R,J,Y){var X=1e4>N.recentlyCreatedOwnerStacks++;return f(R,J,Y,!1,X?Error("react-stack-top-frame"):V,X?G(r(R)):B)},yr.jsxs=function(R,J,Y){var X=1e4>N.recentlyCreatedOwnerStacks++;return f(R,J,Y,!0,X?Error("react-stack-top-frame"):V,X?G(r(R)):B)}})()),yr}var uc;function qp(){return uc||(uc=1,process.env.NODE_ENV==="production"?go.exports=Hp():go.exports=Zp()),go.exports}var i=qp();const Yp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),dc=e=>{const t=Gp(e);return t.charAt(0).toUpperCase()+t.slice(1)},du=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Kp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Jp={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 Xp=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},u)=>E.createElement("svg",{ref:u,...Jp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:du("lucide",o),...!s&&!Kp(c)&&{"aria-hidden":"true"},...c},[...a.map(([l,f])=>E.createElement(l,f)),...Array.isArray(s)?s:[s]]));const ye=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(Xp,{ref:s,iconNode:t,className:du(`lucide-${Yp(dc(e))}`,`lucide-${e}`,r),...o}));return n.displayName=dc(e),n};const Qp=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ya=ye("arrow-left",Qp);const eh=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],th=ye("briefcase",eh);const nh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fu=ye("check",nh);const rh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mu=ye("chevron-down",rh);const oh=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sh=ye("chevron-right",oh);const ah=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ih=ye("chevron-up",ah);const ch=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lh=ye("circle-alert",ch);const uh=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],dh=ye("clipboard-list",uh);const fh=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mh=ye("clock",fh);const ph=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],kr=ye("cloud",ph);const hh=[["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"}]],gh=ye("copy",hh);const yh=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jt=ye("database",yh);const bh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],vh=ye("download",bh);const xh=[["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"}]],Ga=ye("ellipsis-vertical",xh);const wh=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],_h=ye("folder-open",wh);const Sh=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Ka=ye("folder-tree",Sh);const kh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ds=ye("globe",kh);const Eh=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],fs=ye("hard-drive",Eh);const Ch=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Nh=ye("history",Ch);const jh=[["path",{d:"M2 20h20",key:"owomy5"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}],["rect",{x:"3",y:"4",width:"18",height:"12",rx:"2",key:"8ur36m"}]],Rh=ye("laptop-minimal-check",jh);const Ah=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Th=ye("layout-dashboard",Ah);const Oh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],rt=ye("loader-circle",Oh);const Ph=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Dh=ye("lock",Ph);const Ih=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Mh=ye("moon",Ih);const $h=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Tr=ye("package",$h);const Fh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Lr=ye("pencil",Fh);const zh=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ja=ye("play",zh);const Lh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rt=ye("plus",Lh);const Bh=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Xa=ye("rotate-cw",Bh);const Vh=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Tn=ye("server",Vh);const Uh=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wh=ye("settings",Uh);const Hh=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],pu=ye("shield",Hh);const Zh=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],qh=ye("sun",Zh);const Yh=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Gh=ye("terminal",Yh);const Kh=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Br=ye("trash-2",Kh);const Jh=[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]],hu=ye("waypoints",Jh);const Xh=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ms=ye("x",Xh);function gu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=gu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=gu(e))&&(r&&(r+=" "),r+=t);return r}const Qh=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},eg=(e,t)=>({classGroupId:e,validator:t}),bu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bo="-",fc=[],tg="arbitrary..",ng=e=>{const t=og(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return rg(a);const c=a.split(Bo),u=c[0]===""&&c.length>1?1:0;return vu(c,u,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const u=r[a],l=n[a];return u?l?Qh(l,u):u:l||fc}return n[a]||fc}}},vu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const l=vu(e,t+1,s);if(l)return l}const a=n.validators;if(a===null)return;const c=t===0?e.join(Bo):e.slice(t).join(Bo),u=a.length;for(let l=0;l<u;l++){const f=a[l];if(f.validator(c))return f.classGroupId}},rg=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?tg+r:void 0})(),og=e=>{const{theme:t,classGroups:n}=e;return sg(n,t)},sg=(e,t)=>{const n=bu();for(const r in e){const o=e[r];Qa(o,n,r,t)}return n},Qa=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];ag(a,t,n,r)}},ag=(e,t,n,r)=>{if(typeof e=="string"){ig(e,t,n);return}if(typeof e=="function"){cg(e,t,n,r);return}lg(e,t,n,r)},ig=(e,t,n)=>{const r=e===""?t:xu(t,e);r.classGroupId=n},cg=(e,t,n,r)=>{if(ug(e)){Qa(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(eg(n,e))},lg=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[c,u]=o[a];Qa(u,xu(t,c),n,r)}},xu=(e,t)=>{let n=e;const r=t.split(Bo),o=r.length;for(let s=0;s<o;s++){const a=r[s];let c=n.nextPart.get(a);c||(c=bu(),n.nextPart.set(a,c)),n=c}return n},ug=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},pa="!",mc=":",fg=[],pc=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),mg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,c=0,u=0,l;const f=o.length;for(let y=0;y<f;y++){const b=o[y];if(a===0&&c===0){if(b===mc){s.push(o.slice(u,y)),u=y+1;continue}if(b==="/"){l=y;continue}}b==="["?a++:b==="]"?a--:b==="("?c++:b===")"&&c--}const d=s.length===0?o:o.slice(u);let h=d,p=!1;d.endsWith(pa)?(h=d.slice(0,-1),p=!0):d.startsWith(pa)&&(h=d.slice(1),p=!0);const g=l&&l>u?l-u:void 0;return pc(s,p,h,g)};if(t){const o=t+mc,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):pc(fg,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},pg=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],c=a[0]==="[",u=t.has(a);c||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},hg=e=>({cache:dg(e.cacheSize),parseClassName:mg(e),sortModifiers:pg(e),...ng(e)}),gg=/\s+/,yg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],c=e.trim().split(gg);let u="";for(let l=c.length-1;l>=0;l-=1){const f=c[l],{isExternal:d,modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=n(f);if(d){u=f+(u.length>0?" "+u:u);continue}let b=!!y,v=r(b?g.substring(0,y):g);if(!v){if(!b){u=f+(u.length>0?" "+u:u);continue}if(v=r(g),!v){u=f+(u.length>0?" "+u:u);continue}b=!1}const w=h.length===0?"":h.length===1?h[0]:s(h).join(":"),S=p?w+pa:w,_=S+v;if(a.indexOf(_)>-1)continue;a.push(_);const C=o(v,b);for(let I=0;I<C.length;++I){const O=C[I];a.push(S+O)}u=f+(u.length>0?" "+u:u)}return u},bg=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=wu(n))&&(o&&(o+=" "),o+=r);return o},wu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wu(e[r]))&&(n&&(n+=" "),n+=t);return n},vg=(e,...t)=>{let n,r,o,s;const a=u=>{const l=t.reduce((f,d)=>d(f),e());return n=hg(l),r=n.cache.get,o=n.cache.set,s=c,c(u)},c=u=>{const l=r(u);if(l)return l;const f=yg(u,n);return o(u,f),f};return s=a,(...u)=>s(bg(...u))},xg=[],Ue=e=>{const t=n=>n[e]||xg;return t.isThemeGetter=!0,t},_u=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Su=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sg=/\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$/,kg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Eg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Cg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,an=e=>wg.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),cn=e=>!!e&&Number.isInteger(Number(e)),qs=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Ht=e=>_g.test(e),ku=()=>!0,Ng=e=>Sg.test(e)&&!kg.test(e),ei=()=>!1,jg=e=>Eg.test(e),Rg=e=>Cg.test(e),Ag=e=>!ee(e)&&!te(e),Tg=e=>gn(e,Nu,ei),ee=e=>_u.test(e),kn=e=>gn(e,ju,Ng),hc=e=>gn(e,zg,pe),Og=e=>gn(e,Au,ku),Pg=e=>gn(e,Ru,ei),gc=e=>gn(e,Eu,ei),Dg=e=>gn(e,Cu,Rg),yo=e=>gn(e,Tu,jg),te=e=>Su.test(e),br=e=>Ln(e,ju),Ig=e=>Ln(e,Ru),yc=e=>Ln(e,Eu),Mg=e=>Ln(e,Nu),$g=e=>Ln(e,Cu),bo=e=>Ln(e,Tu,!0),Fg=e=>Ln(e,Au,!0),gn=(e,t,n)=>{const r=_u.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ln=(e,t,n=!1)=>{const r=Su.exec(e);return r?r[1]?t(r[1]):n:!1},Eu=e=>e==="position"||e==="percentage",Cu=e=>e==="image"||e==="url",Nu=e=>e==="length"||e==="size"||e==="bg-size",ju=e=>e==="length",zg=e=>e==="number",Ru=e=>e==="family-name",Au=e=>e==="number"||e==="weight",Tu=e=>e==="shadow",Lg=()=>{const e=Ue("color"),t=Ue("font"),n=Ue("text"),r=Ue("font-weight"),o=Ue("tracking"),s=Ue("leading"),a=Ue("breakpoint"),c=Ue("container"),u=Ue("spacing"),l=Ue("radius"),f=Ue("shadow"),d=Ue("inset-shadow"),h=Ue("text-shadow"),p=Ue("drop-shadow"),g=Ue("blur"),y=Ue("perspective"),b=Ue("aspect"),v=Ue("ease"),w=Ue("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),te,ee],I=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[te,ee,u],H=()=>[an,"full","auto",...T()],Z=()=>[cn,"none","subgrid",te,ee],ne=()=>["auto",{span:["full",cn,te,ee]},cn,te,ee],N=()=>[cn,"auto",te,ee],P=()=>["auto","min","max","fr",te,ee],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],W=()=>[an,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],V=()=>[an,"screen","full","dvw","lvw","svw","min","max","fit",...T()],B=()=>[an,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],F=()=>[e,te,ee],R=()=>[..._(),yc,gc,{position:[te,ee]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",Mg,Tg,{size:[te,ee]}],X=()=>[qs,br,kn],re=()=>["","none","full",l,te,ee],ce=()=>["",pe,br,kn],$=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[pe,qs,yc,gc],me=()=>["","none",g,te,ee],he=()=>["none",pe,te,ee],be=()=>["none",pe,te,ee],De=()=>[pe,te,ee],We=()=>[an,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ht],breakpoint:[Ht],color:[ku],container:[Ht],"drop-shadow":[Ht],ease:["in","out","in-out"],font:[Ag],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ht],shadow:[Ht],spacing:["px",pe],text:[Ht],"text-shadow":[Ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",an,ee,te,b]}],container:["container"],columns:[{columns:[pe,ee,te,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:C()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[cn,"auto",te,ee]}],basis:[{basis:[an,"full","auto",c,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,an,"auto","initial","none",ee]}],grow:[{grow:["",pe,te,ee]}],shrink:[{shrink:["",pe,te,ee]}],order:[{order:[cn,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,br,kn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Fg,Og]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qs,ee]}],"font-family":[{font:[Ig,Pg,t]}],"font-features":[{"font-features":[ee]}],"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,te,ee]}],"line-clamp":[{"line-clamp":[pe,"none",te,hc]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",te,kn]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pe,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],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",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cn,te,ee],radial:["",te,ee],conic:[cn,te,ee]},$g,Dg]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$(),"hidden","none"]}],"divide-style":[{divide:[...$(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,te,ee]}],"outline-w":[{outline:["",pe,br,kn]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",f,bo,yo]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,bo,yo]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pe,kn]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",h,bo,yo]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pe,te,ee]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:me()}],brightness:[{brightness:[pe,te,ee]}],contrast:[{contrast:[pe,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",p,bo,yo]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",pe,te,ee]}],"hue-rotate":[{"hue-rotate":[pe,te,ee]}],invert:[{invert:["",pe,te,ee]}],saturate:[{saturate:[pe,te,ee]}],sepia:[{sepia:["",pe,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[pe,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[pe,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",pe,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[pe,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[pe,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",te,ee]}],ease:[{ease:["linear","initial",v,te,ee]}],delay:[{delay:[pe,te,ee]}],animate:[{animate:["none",w,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,te,ee]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",te,ee]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",te,ee]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[pe,br,kn,hc]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},Bg=vg(Lg);function ae(...e){return Bg(yu(e))}const bc=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>u,subscribe:l=>(n.add(l),()=>n.delete(l))},u=t=e(r,o,c);return c},Vg=(e=>e?bc(e):bc),Ug=e=>e;function Wg(e,t=Ug){const n=E.useSyncExternalStore(e.subscribe,E.useCallback(()=>t(e.getState()),[e,t]),E.useCallback(()=>t(e.getInitialState()),[e,t]));return E.useDebugValue(n),n}const vc=e=>{const t=Vg(e),n=r=>Wg(t,r);return Object.assign(n,t),n},Hg=(e=>e?vc(e):vc),Zg="backupcore.theme";function xc(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(Zg,e)}const qg=Hg((e,t)=>({mode:"light",setMode:n=>{xc(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";xc(n),e({mode:n})}})),Yg=[{to:"/",label:"Dashboard",icon:Th,end:!0},{to:"/jobs",label:"Backup Jobs",icon:th},{to:"/settings",label:"Settings",icon:Wh}];function Ou(){const e=Ve.useLocation(),{mode:t,toggle:n}=qg();return i.jsxs("aside",{className:"sticky top-0 flex h-screen w-56 shrink-0 flex-col border-r border-border bg-sidebar px-3 py-5",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2.5 px-2 py-2",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border bg-background/80 shadow-sm",children:i.jsx(pu,{size:15,color:"currentColor",strokeWidth:2.2,className:"text-primary"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold leading-tight text-foreground",children:"Meyi Backup"}),i.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Backup Manager"})]})]}),i.jsx("nav",{className:"flex flex-1 flex-col gap-0.5",children:Yg.map(({to:r,label:o,icon:s,end:a})=>{const c=a?e.pathname===r||e.pathname==="":e.pathname===r||e.pathname.startsWith(r+"/");return i.jsxs(Pe,{to:r,className:ae("flex items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm transition-all",c?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[i.jsx(s,{size:16,strokeWidth:1.9}),i.jsx("span",{className:"flex-1",children:o})]},r)})}),i.jsxs("div",{className:"border-t border-border/50 pt-3 space-y-1",children:[i.jsxs("button",{onClick:n,className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm text-muted-foreground transition-all hover:bg-accent hover:text-accent-foreground",title:t==="dark"?"Switch to light mode":"Switch to dark mode",children:[t==="dark"?i.jsx(qh,{size:15,strokeWidth:1.8}):i.jsx(Mh,{size:15,strokeWidth:1.8}),i.jsx("span",{children:t==="dark"?"Light Mode":"Dark Mode"})]}),i.jsxs("div",{className:"px-3 pb-1 text-[11px] text-muted-foreground",children:["Powered by ",i.jsx("span",{className:"text-primary",children:"Meyi Connect"})]})]})]})}function Gg(){return i.jsxs("div",{className:"flex min-h-screen bg-background",children:[i.jsx(Ou,{}),i.jsx("main",{className:"flex-1 min-w-0 overflow-auto px-1 py-1",children:i.jsx(Ve.Outlet,{})})]})}const ti=()=>Za.useDispatch(),ni=Za.useSelector;function Pu(e,t){return function(){return e.apply(t,arguments)}}const{toString:Kg}=Object.prototype,{getPrototypeOf:ri}=Object,{iterator:ps,toStringTag:Du}=Symbol,hs=(e=>t=>{const n=Kg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=e=>(e=e.toLowerCase(),t=>hs(t)===e),gs=e=>t=>typeof t===e,{isArray:ir}=Array,or=gs("undefined");function Vr(e){return e!==null&&!or(e)&&e.constructor!==null&&!or(e.constructor)&&it(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Iu=Dt("ArrayBuffer");function Jg(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Iu(e.buffer),t}const Xg=gs("string"),it=gs("function"),Mu=gs("number"),Ur=e=>e!==null&&typeof e=="object",Qg=e=>e===!0||e===!1,Oo=e=>{if(hs(e)!=="object")return!1;const t=ri(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Du in e)&&!(ps in e)},ey=e=>{if(!Ur(e)||Vr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ty=Dt("Date"),ny=Dt("File"),ry=e=>!!(e&&typeof e.uri<"u"),oy=e=>e&&typeof e.getParts<"u",sy=Dt("Blob"),ay=Dt("FileList"),iy=e=>Ur(e)&&it(e.pipe);function cy(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const wc=cy(),_c=typeof wc.FormData<"u"?wc.FormData:void 0,ly=e=>{let t;return e&&(_c&&e instanceof _c||it(e.append)&&((t=hs(e))==="formdata"||t==="object"&&it(e.toString)&&e.toString()==="[object FormData]"))},uy=Dt("URLSearchParams"),[dy,fy,my,py]=["ReadableStream","Request","Response","Headers"].map(Dt),hy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Wr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),ir(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Vr(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let c;for(r=0;r<a;r++)c=s[r],t.call(null,e[c],c,e)}}function $u(e,t){if(Vr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Rn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fu=e=>!or(e)&&e!==Rn;function ha(){const{caseless:e,skipUndefined:t}=Fu(this)&&this||{},n={},r=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=e&&$u(n,s)||s;Oo(n[a])&&Oo(o)?n[a]=ha(n[a],o):Oo(o)?n[a]=ha({},o):ir(o)?n[a]=o.slice():(!t||!or(o))&&(n[a]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Wr(arguments[o],r);return n}const gy=(e,t,n,{allOwnKeys:r}={})=>(Wr(t,(o,s)=>{n&&it(o)?Object.defineProperty(e,s,{value:Pu(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),yy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),by=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},vy=(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&ri(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wy=e=>{if(!e)return null;if(ir(e))return e;let t=e.length;if(!Mu(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_y=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ri(Uint8Array)),Sy=(e,t)=>{const r=(e&&e[ps]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},ky=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ey=Dt("HTMLFormElement"),Cy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Sc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ny=Dt("RegExp"),zu=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Wr(n,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(r[s]=a||o)}),Object.defineProperties(e,r)},jy=e=>{zu(e,(t,n)=>{if(it(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(it(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ry=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return ir(e)?r(e):r(String(e).split(t)),n},Ay=()=>{},Ty=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Oy(e){return!!(e&&it(e.append)&&e[Du]==="FormData"&&e[ps])}const Py=e=>{const t=new Array(10),n=(r,o)=>{if(Ur(r)){if(t.indexOf(r)>=0)return;if(Vr(r))return r;if(!("toJSON"in r)){t[o]=r;const s=ir(r)?[]:{};return Wr(r,(a,c)=>{const u=n(a,o+1);!or(u)&&(s[c]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Dy=Dt("AsyncFunction"),Iy=e=>e&&(Ur(e)||it(e))&&it(e.then)&&it(e.catch),Lu=((e,t)=>e?setImmediate:t?((n,r)=>(Rn.addEventListener("message",({source:o,data:s})=>{o===Rn&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Rn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",it(Rn.postMessage)),My=typeof queueMicrotask<"u"?queueMicrotask.bind(Rn):typeof process<"u"&&process.nextTick||Lu,$y=e=>e!=null&&it(e[ps]),j={isArray:ir,isArrayBuffer:Iu,isBuffer:Vr,isFormData:ly,isArrayBufferView:Jg,isString:Xg,isNumber:Mu,isBoolean:Qg,isObject:Ur,isPlainObject:Oo,isEmptyObject:ey,isReadableStream:dy,isRequest:fy,isResponse:my,isHeaders:py,isUndefined:or,isDate:ty,isFile:ny,isReactNativeBlob:ry,isReactNative:oy,isBlob:sy,isRegExp:Ny,isFunction:it,isStream:iy,isURLSearchParams:uy,isTypedArray:_y,isFileList:ay,forEach:Wr,merge:ha,extend:gy,trim:hy,stripBOM:yy,inherits:by,toFlatObject:vy,kindOf:hs,kindOfTest:Dt,endsWith:xy,toArray:wy,forEachEntry:Sy,matchAll:ky,isHTMLForm:Ey,hasOwnProperty:Sc,hasOwnProp:Sc,reduceDescriptors:zu,freezeMethods:jy,toObjectSet:Ry,toCamelCase:Cy,noop:Ay,toFiniteNumber:Ty,findKey:$u,global:Rn,isContextDefined:Fu,isSpecCompliantForm:Oy,toJSONObject:Py,isAsyncFn:Dy,isThenable:Iy,setImmediate:Lu,asap:My,isIterable:$y};let ue=class Bu extends Error{static from(t,n,r,o,s,a){const c=new Bu(t.message,n||t.code,r,o,s);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),a&&Object.assign(c,a),c}constructor(t,n,r,o,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}};ue.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ue.ERR_BAD_OPTION="ERR_BAD_OPTION";ue.ECONNABORTED="ECONNABORTED";ue.ETIMEDOUT="ETIMEDOUT";ue.ERR_NETWORK="ERR_NETWORK";ue.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ue.ERR_DEPRECATED="ERR_DEPRECATED";ue.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ue.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ue.ERR_CANCELED="ERR_CANCELED";ue.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ue.ERR_INVALID_URL="ERR_INVALID_URL";const Fy=null;function ga(e){return j.isPlainObject(e)||j.isArray(e)}function Vu(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function Ys(e,t,n){return e?e.concat(t).map(function(o,s){return o=Vu(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function zy(e){return j.isArray(e)&&!e.some(ga)}const Ly=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function ys(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!j.isUndefined(b[y])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(j.isDate(g))return g.toISOString();if(j.isBoolean(g))return g.toString();if(!u&&j.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(g)||j.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,y,b){let v=g;if(j.isReactNative(t)&&j.isReactNativeBlob(g))return t.append(Ys(b,y,s),l(g)),!1;if(g&&!b&&typeof g=="object"){if(j.endsWith(y,"{}"))y=r?y:y.slice(0,-2),g=JSON.stringify(g);else if(j.isArray(g)&&zy(g)||(j.isFileList(g)||j.endsWith(y,"[]"))&&(v=j.toArray(g)))return y=Vu(y),v.forEach(function(S,_){!(j.isUndefined(S)||S===null)&&t.append(a===!0?Ys([y],_,s):a===null?y:y+"[]",l(S))}),!1}return ga(g)?!0:(t.append(Ys(b,y,s),l(g)),!1)}const d=[],h=Object.assign(Ly,{defaultVisitor:f,convertValue:l,isVisitable:ga});function p(g,y){if(!j.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(g),j.forEach(g,function(v,w){(!(j.isUndefined(v)||v===null)&&o.call(t,v,j.isString(w)?w.trim():w,y,h))===!0&&p(v,y?y.concat(w):[w])}),d.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return p(e),t}function kc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oi(e,t){this._pairs=[],e&&ys(e,this,t)}const Uu=oi.prototype;Uu.append=function(t,n){this._pairs.push([t,n])};Uu.toString=function(t){const n=t?function(r){return t.call(this,r,kc)}:kc;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function By(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Wu(e,t,n){if(!t)return e;const r=n&&n.encode||By,o=j.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let a;if(s?a=s(t,o):a=j.isURLSearchParams(t)?t.toString():new oi(t,o).toString(r),a){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Ec{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const si={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Vy=typeof URLSearchParams<"u"?URLSearchParams:oi,Uy=typeof FormData<"u"?FormData:null,Wy=typeof Blob<"u"?Blob:null,Hy={isBrowser:!0,classes:{URLSearchParams:Vy,FormData:Uy,Blob:Wy},protocols:["http","https","file","blob","url","data"]},ai=typeof window<"u"&&typeof document<"u",ya=typeof navigator=="object"&&navigator||void 0,Zy=ai&&(!ya||["ReactNative","NativeScript","NS"].indexOf(ya.product)<0),qy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yy=ai&&window.location.href||"http://localhost",Gy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ai,hasStandardBrowserEnv:Zy,hasStandardBrowserWebWorkerEnv:qy,navigator:ya,origin:Yy},Symbol.toStringTag,{value:"Module"})),Je={...Gy,...Hy};function Ky(e,t){return ys(e,new Je.classes.URLSearchParams,{visitor:function(n,r,o,s){return Je.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Jy(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xy(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Hu(e){function t(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),u=s>=n.length;return a=!a&&j.isArray(o)?o.length:a,u?(j.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!c):((!o[a]||!j.isObject(o[a]))&&(o[a]=[]),t(n,r,o[a],s)&&j.isArray(o[a])&&(o[a]=Xy(o[a])),!c)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,o)=>{t(Jy(r),o,n,0)}),n}return null}function Qy(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Hr={transitional:si,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=j.isObject(t);if(s&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(Hu(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ky(t,this.formSerializer).toString();if((c=j.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ys(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Qy(t)):t}],transformResponse:[function(t){const n=this.transitional||Hr.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?ue.from(c,ue.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Hr.headers[e]={}});const eb=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tb=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
7
|
-
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&eb[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},
|
|
8
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Cc]=this[Cc]={accessors:{}}).accessors,o=this.prototype;function s(a){const c=vr(a);r[c]||(sb(o,a),r[c]=!0)}return j.isArray(t)?t.forEach(s):s(t),this}};ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);j.reduceDescriptors(ct.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});j.freezeMethods(ct);function Ks(e,t){const n=this||Hr,r=t||n,o=ct.from(r.headers);let s=r.data;return j.forEach(e,function(c){s=c.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Zu(e){return!!(e&&e.__CANCEL__)}let Zr=class extends ue{constructor(t,n,r){super(t??"canceled",ue.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function qu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ab(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ib(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=r[s];a||(a=l),n[o]=u,r[o]=l;let d=s,h=0;for(;d!==o;)h+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const p=f&&l-f;return p?Math.round(h*1e3/p):void 0}}function cb(e,t){let n=0,r=1e3/t,o,s;const a=(l,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const f=Date.now(),d=f-n;d>=r?a(l,f):(o=l,s||(s=setTimeout(()=>{s=null,a(o)},r-d)))},()=>o&&a(o)]}const Vo=(e,t,n=3)=>{let r=0;const o=ib(50,250);return cb(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,u=a-r,l=o(u),f=a<=c;r=a;const d={loaded:a,total:c,progress:c?a/c:void 0,bytes:u,rate:l||void 0,estimated:l&&c&&f?(c-a)/l:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Nc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jc=e=>(...t)=>j.asap(()=>e(...t)),lb=Je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,ub=Je.hasStandardBrowserEnv?{write(e,t,n,r,o,s,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];j.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),j.isString(r)&&c.push(`path=${r}`),j.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),j.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function db(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yu(e,t,n){let r=!db(t);return e&&(r||n==!1)?fb(e,t):t}const Rc=e=>e instanceof ct?{...e}:e;function Pn(e,t){t=t||{};const n={};function r(l,f,d,h){return j.isPlainObject(l)&&j.isPlainObject(f)?j.merge.call({caseless:h},l,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function o(l,f,d,h){if(j.isUndefined(f)){if(!j.isUndefined(l))return r(void 0,l,d,h)}else return r(l,f,d,h)}function s(l,f){if(!j.isUndefined(f))return r(void 0,f)}function a(l,f){if(j.isUndefined(f)){if(!j.isUndefined(l))return r(void 0,l)}else return r(void 0,f)}function c(l,f,d){if(d in t)return r(l,f);if(d in e)return r(void 0,l)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(l,f,d)=>o(Rc(l),Rc(f),d,!0)};return j.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const d=j.hasOwnProp(u,f)?u[f]:o,h=d(e[f],t[f],f);j.isUndefined(h)&&d!==c||(n[f]=h)}),n}const Gu=e=>{const t=Pn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=ct.from(a),t.url=Wu(Yu(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),j.isFormData(n)){if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(j.isFunction(n.getHeaders)){const u=n.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,d])=>{l.includes(f.toLowerCase())&&a.set(f,d)})}}if(Je.hasStandardBrowserEnv&&(r&&j.isFunction(r)&&(r=r(t)),r||r!==!1&&lb(t.url))){const u=o&&s&&ub.read(s);u&&a.set(o,u)}return t},mb=typeof XMLHttpRequest<"u",pb=mb&&function(e){return new Promise(function(n,r){const o=Gu(e);let s=o.data;const a=ct.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:l}=o,f,d,h,p,g;function y(){p&&p(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function v(){if(!b)return;const S=ct.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};qu(function(O){n(O),y()},function(O){r(O),y()},C),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(r(new ue("Request aborted",ue.ECONNABORTED,e,b)),b=null)},b.onerror=function(_){const C=_&&_.message?_.message:"Network Error",I=new ue(C,ue.ERR_NETWORK,e,b);I.event=_||null,r(I),b=null},b.ontimeout=function(){let _=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||si;o.timeoutErrorMessage&&(_=o.timeoutErrorMessage),r(new ue(_,C.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,b)),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&j.forEach(a.toJSON(),function(_,C){b.setRequestHeader(C,_)}),j.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),c&&c!=="json"&&(b.responseType=o.responseType),l&&([h,g]=Vo(l,!0),b.addEventListener("progress",h)),u&&b.upload&&([d,p]=Vo(u),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(f=S=>{b&&(r(!S||S.type?new Zr(null,e,b):S),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const w=ab(o.url);if(w&&Je.protocols.indexOf(w)===-1){r(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,e));return}b.send(s||null)})},hb=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(l){if(!o){o=!0,c();const f=l instanceof Error?l:this.reason;r.abort(f instanceof ue?f:new Zr(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,s(new ue(`timeout of ${t}ms exceeded`,ue.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>j.asap(c),u}},gb=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},yb=async function*(e,t){for await(const n of bb(e))yield*gb(n,t)},bb=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ac=(e,t,n,r)=>{const o=yb(e,t);let s=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){c(),u.close();return}let d=f.byteLength;if(n){let h=s+=d;n(h)}u.enqueue(new Uint8Array(f))}catch(l){throw c(l),l}},cancel(u){return c(u),o.return()}},{highWaterMark:2})},Tc=64*1024,{isFunction:vo}=j,vb=(({Request:e,Response:t})=>({Request:e,Response:t}))(j.global),{ReadableStream:Oc,TextEncoder:Pc}=j.global,Dc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xb=e=>{e=j.merge.call({skipUndefined:!0},vb,e);const{fetch:t,Request:n,Response:r}=e,o=t?vo(t):typeof fetch=="function",s=vo(n),a=vo(r);if(!o)return!1;const c=o&&vo(Oc),u=o&&(typeof Pc=="function"?(g=>y=>g.encode(y))(new Pc):async g=>new Uint8Array(await new n(g).arrayBuffer())),l=s&&c&&Dc(()=>{let g=!1;const y=new n(Je.origin,{body:new Oc,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!y}),f=a&&c&&Dc(()=>j.isReadableStream(new r("").body)),d={stream:f&&(g=>g.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!d[g]&&(d[g]=(y,b)=>{let v=y&&y[g];if(v)return v.call(y);throw new ue(`Response type '${g}' is not supported`,ue.ERR_NOT_SUPPORT,b)})});const h=async g=>{if(g==null)return 0;if(j.isBlob(g))return g.size;if(j.isSpecCompliantForm(g))return(await new n(Je.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(j.isArrayBufferView(g)||j.isArrayBuffer(g))return g.byteLength;if(j.isURLSearchParams(g)&&(g=g+""),j.isString(g))return(await u(g)).byteLength},p=async(g,y)=>{const b=j.toFiniteNumber(g.getContentLength());return b??h(y)};return async g=>{let{url:y,method:b,data:v,signal:w,cancelToken:S,timeout:_,onDownloadProgress:C,onUploadProgress:I,responseType:O,headers:T,withCredentials:H="same-origin",fetchOptions:Z}=Gu(g),ne=t||fetch;O=O?(O+"").toLowerCase():"text";let N=hb([w,S&&S.toAbortSignal()],_),P=null;const z=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let G;try{if(I&&l&&b!=="get"&&b!=="head"&&(G=await p(T,v))!==0){let R=new n(y,{method:"POST",body:v,duplex:"half"}),J;if(j.isFormData(v)&&(J=R.headers.get("content-type"))&&T.setContentType(J),R.body){const[Y,X]=Nc(G,Vo(jc(I)));v=Ac(R.body,Tc,Y,X)}}j.isString(H)||(H=H?"include":"omit");const D=s&&"credentials"in n.prototype,W={...Z,signal:N,method:b.toUpperCase(),headers:T.normalize().toJSON(),body:v,duplex:"half",credentials:D?H:void 0};P=s&&new n(y,W);let V=await(s?ne(P,Z):ne(y,W));const B=f&&(O==="stream"||O==="response");if(f&&(C||B&&z)){const R={};["status","statusText","headers"].forEach(re=>{R[re]=V[re]});const J=j.toFiniteNumber(V.headers.get("content-length")),[Y,X]=C&&Nc(J,Vo(jc(C),!0))||[];V=new r(Ac(V.body,Tc,Y,()=>{X&&X(),z&&z()}),R)}O=O||"text";let F=await d[j.findKey(d,O)||"text"](V,g);return!B&&z&&z(),await new Promise((R,J)=>{qu(R,J,{data:F,headers:ct.from(V.headers),status:V.status,statusText:V.statusText,config:g,request:P})})}catch(D){throw z&&z(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,g,P,D&&D.response),{cause:D.cause||D}):ue.from(D,D&&D.code,g,P,D&&D.response)}}},wb=new Map,Ku=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let a=s.length,c=a,u,l,f=wb;for(;c--;)u=s[c],l=f.get(u),l===void 0&&f.set(u,l=c?new Map:xb(t)),f=l;return l};Ku();const ii={http:Fy,xhr:pb,fetch:{get:Ku}};j.forEach(ii,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ic=e=>`- ${e}`,_b=e=>j.isFunction(e)||e===null||e===!1;function Sb(e,t){e=j.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let a=0;a<n;a++){r=e[a];let c;if(o=r,!_b(r)&&(o=ii[(c=String(r)).toLowerCase()],o===void 0))throw new ue(`Unknown adapter '${c}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;s[c||"#"+a]=o}if(!o){const a=Object.entries(s).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
9
|
-
`+a.map(
|
|
10
|
-
`):" "
|
|
11
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Do.assertOptions(r,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean),legacyInterceptorReqResOrdering:gt.transitional(gt.boolean)},!1),o!=null&&(j.isFunction(o)?n.paramsSerializer={serialize:o}:Do.assertOptions(o,{encode:gt.function,serialize:gt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Do.assertOptions(n,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&j.merge(s.common,s[n.method]);s&&j.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=ct.concat(a,s);const c=[];let u=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(n)===!1)return;u=u&&y.synchronous;const b=n.transitional||si;b&&b.legacyInterceptorReqResOrdering?c.unshift(y.fulfilled,y.rejected):c.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let f,d=0,h;if(!u){const g=[Mc.bind(this),void 0];for(g.unshift(...c),g.push(...l),h=g.length,f=Promise.resolve(n);d<h;)f=f.then(g[d++],g[d++]);return f}h=c.length;let p=n;for(;d<h;){const g=c[d++],y=c[d++];try{p=g(p)}catch(b){y.call(this,b);break}}try{f=Mc.call(this,p)}catch(g){return Promise.reject(g)}for(d=0,h=l.length;d<h;)f=f.then(l[d++],l[d++]);return f}getUri(t){t=Pn(this.defaults,t);const n=Yu(t.baseURL,t.url,t.allowAbsoluteUrls);return Wu(n,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){On.prototype[t]=function(n,r){return this.request(Pn(r||{},{method:t,url:n,data:(r||{}).data}))}});j.forEach(["post","put","patch"],function(t){function n(r){return function(s,a,c){return this.request(Pn(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}On.prototype[t]=n(),On.prototype[t+"Form"]=n(!0)});let Eb=class Qu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,c){r.reason||(r.reason=new Zr(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Qu(function(o){t=o}),cancel:t}}};function Cb(e){return function(n){return e.apply(null,n)}}function Nb(e){return j.isObject(e)&&e.isAxiosError===!0}const ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ba).forEach(([e,t])=>{ba[t]=e});function ed(e){const t=new On(e),n=Pu(On.prototype.request,t);return j.extend(n,On.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ed(Pn(e,o))},n}const Me=ed(Hr);Me.Axios=On;Me.CanceledError=Zr;Me.CancelToken=Eb;Me.isCancel=Zu;Me.VERSION=Xu;Me.toFormData=ys;Me.AxiosError=ue;Me.Cancel=Me.CanceledError;Me.all=function(t){return Promise.all(t)};Me.spread=Cb;Me.isAxiosError=Nb;Me.mergeConfig=Pn;Me.AxiosHeaders=ct;Me.formToJSON=e=>Hu(j.isHTMLForm(e)?new FormData(e):e);Me.getAdapter=Ju.getAdapter;Me.HttpStatusCode=ba;Me.default=Me;const{Axios:WR,AxiosError:HR,CanceledError:ZR,isCancel:qR,CancelToken:YR,VERSION:GR,all:KR,Cancel:JR,isAxiosError:XR,spread:QR,toFormData:eA,AxiosHeaders:tA,HttpStatusCode:nA,formToJSON:rA,getAdapter:oA,mergeConfig:sA}=Me,jb={apiBase:"/api"},fe=Me.create({baseURL:jb.apiBase,headers:{"Content-Type":"application/json"}});fe.interceptors.request.use(e=>{const t=localStorage.getItem("access_token");return t&&(e.headers.Authorization=`Bearer ${t}`),e});fe.interceptors.response.use(e=>e.data,e=>Promise.reject(e.response?.data||e));function td(e){e?fe.defaults.headers.common.Authorization=`Bearer ${e}`:delete fe.defaults.headers.common.Authorization}const Ze={getAll:()=>fe.get("/jobs"),get:e=>fe.get(`/jobs/${e}`),create:e=>fe.post("/jobs",e),update:(e,t)=>fe.put(`/jobs/${e}`,t),delete:e=>fe.delete(`/jobs/${e}`),run:e=>fe.post(`/jobs/${e}/run`),getRuns:e=>fe.get(`/jobs/${e}/runs`),getSnapshots:e=>fe.get(`/jobs/${e}/snapshots`)},Rb={getAll:()=>fe.get("/runs")},Ab={get:()=>fe.get("/dashboard")},Tb={list:[],current:null,runs:[],loading:!1,error:null},Xn=Ne.createAsyncThunk("jobs/fetchAll",async()=>await Ze.getAll()),Ob=Ne.createAsyncThunk("jobs/fetchOne",async e=>await Ze.get(e)),Pb=Ne.createAsyncThunk("jobs/create",async e=>await Ze.create(e)),Db=Ne.createAsyncThunk("jobs/update",async({id:e,data:t})=>await Ze.update(e,t)),nd=Ne.createAsyncThunk("jobs/delete",async e=>(await Ze.delete(e),e)),Ib=Ne.createAsyncThunk("jobs/run",async e=>await Ze.run(e)),Mb=Ne.createAsyncThunk("jobs/fetchRuns",async e=>await Ze.getRuns(e)),$b=Ne.createSlice({name:"jobs",initialState:Tb,reducers:{},extraReducers:e=>{e.addCase(Xn.pending,t=>{t.loading=!0,t.error=null}).addCase(Xn.fulfilled,(t,n)=>{t.loading=!1,t.list=Array.isArray(n.payload)?n.payload:[]}).addCase(Xn.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch jobs"}).addCase(Ob.fulfilled,(t,n)=>{t.current=n.payload}).addCase(Pb.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(Db.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(nd.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}).addCase(Mb.fulfilled,(t,n)=>{t.runs=n.payload})}}),Fb=$b.reducer,rd=6048e5,zb=864e5,xo=43200,Fc=1440,zc=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&zc in e?e[zc](t):e instanceof Date?new e.constructor(t):new Date(t)}function qe(e,t){return Jt(t||e,e)}let Lb={};function qr(){return Lb}function Or(e,t){const n=qr(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=qe(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Uo(e,t){return Or(e,{...t,weekStartsOn:1})}function od(e,t){const n=qe(e,t?.in),r=n.getFullYear(),o=Jt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Uo(o),a=Jt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const c=Uo(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Wo(e){const t=qe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function vs(e,...t){const n=Jt.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Lc(e,t){const n=qe(e,t?.in);return n.setHours(0,0,0,0),n}function Bb(e,t,n){const[r,o]=vs(n?.in,e,t),s=Lc(r),a=Lc(o),c=+s-Wo(s),u=+a-Wo(a);return Math.round((c-u)/zb)}function Vb(e,t){const n=od(e,t),r=Jt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Uo(r)}function Io(e,t){const n=+qe(e)-+qe(t);return n<0?-1:n>0?1:n}function Ub(e){return Jt(e,Date.now())}function Wb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hb(e){return!(!Wb(e)&&typeof e!="number"||isNaN(+qe(e)))}function Zb(e,t,n){const[r,o]=vs(n?.in,e,t),s=r.getFullYear()-o.getFullYear(),a=r.getMonth()-o.getMonth();return s*12+a}function qb(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Yb(e,t){return+qe(e)-+qe(t)}function Gb(e,t){const n=qe(e,t?.in);return n.setHours(23,59,59,999),n}function Kb(e,t){const n=qe(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Jb(e,t){const n=qe(e,t?.in);return+Gb(n,t)==+Kb(n,t)}function Xb(e,t,n){const[r,o,s]=vs(n?.in,e,e,t),a=Io(o,s),c=Math.abs(Zb(o,s));if(c<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-a*c);let u=Io(o,s)===-a;Jb(r)&&c===1&&Io(r,s)===1&&(u=!1);const l=a*(c-+u);return l===0?0:l}function Qb(e,t,n){const r=Yb(e,t)/1e3;return qb(n?.roundingMethod)(r)}function ev(e,t){const n=qe(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const tv={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nv=(e,t,n)=>{let r;const o=tv[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Xs(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ov={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},av={date:Xs({formats:rv,defaultWidth:"full"}),time:Xs({formats:ov,defaultWidth:"full"}),dateTime:Xs({formats:sv,defaultWidth:"full"})},iv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cv=(e,t,n,r)=>iv[e];function xr(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;o=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const lv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dv={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fv={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hv=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gv={ordinalNumber:hv,era:xr({values:lv,defaultWidth:"wide"}),quarter:xr({values:uv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xr({values:dv,defaultWidth:"wide"}),day:xr({values:fv,defaultWidth:"wide"}),dayPeriod:xr({values:mv,defaultWidth:"wide",formattingValues:pv,defaultFormattingWidth:"wide"})};function wr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?bv(c,d=>d.test(a)):yv(c,d=>d.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(a.length);return{value:l,rest:f}}}function yv(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bv(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vv(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(o.length);return{value:a,rest:c}}}const xv=/^(\d+)(th|st|nd|rd)?/i,wv=/\d+/i,_v={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sv={any:[/^b/i,/^(a|c)/i]},kv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ev={any:[/1/i,/2/i,/3/i,/4/i]},Cv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Rv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Av={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Tv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ov={ordinalNumber:vv({matchPattern:xv,parsePattern:wv,valueCallback:e=>parseInt(e,10)}),era:wr({matchPatterns:_v,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any"}),quarter:wr({matchPatterns:kv,defaultMatchWidth:"wide",parsePatterns:Ev,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wr({matchPatterns:Cv,defaultMatchWidth:"wide",parsePatterns:Nv,defaultParseWidth:"any"}),day:wr({matchPatterns:jv,defaultMatchWidth:"wide",parsePatterns:Rv,defaultParseWidth:"any"}),dayPeriod:wr({matchPatterns:Av,defaultMatchWidth:"any",parsePatterns:Tv,defaultParseWidth:"any"})},sd={code:"en-US",formatDistance:nv,formatLong:av,formatRelative:cv,localize:gv,match:Ov,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pv(e,t){const n=qe(e,t?.in);return Bb(n,ev(n))+1}function Dv(e,t){const n=qe(e,t?.in),r=+Uo(n)-+Vb(n);return Math.round(r/rd)+1}function ad(e,t){const n=qe(e,t?.in),r=n.getFullYear(),o=qr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=Jt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const c=Or(a,t),u=Jt(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const l=Or(u,t);return+n>=+c?r+1:+n>=+l?r:r-1}function Iv(e,t){const n=qr(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=ad(e,t),s=Jt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Or(s,t)}function Mv(e,t){const n=qe(e,t?.in),r=+Or(n,t)-+Iv(n,t);return Math.round(r/rd)+1}function Se(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ln={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Se(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Se(n+1,2)},d(e,t){return Se(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Se(e.getHours()%12||12,t.length)},H(e,t){return Se(e.getHours(),t.length)},m(e,t){return Se(e.getMinutes(),t.length)},s(e,t){return Se(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Se(o,t.length)}},Hn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ln.y(e,t)},Y:function(e,t,n,r){const o=ad(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return Se(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Se(s,t.length)},R:function(e,t){const n=od(e);return Se(n,t.length)},u:function(e,t){const n=e.getFullYear();return Se(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Se(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Se(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ln.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Se(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Mv(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Se(o,t.length)},I:function(e,t,n){const r=Dv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Se(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ln.d(e,t)},D:function(e,t,n){const r=Pv(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Se(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Se(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Se(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Se(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Hn.noon:r===0?o=Hn.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Hn.evening:r>=12?o=Hn.afternoon:r>=4?o=Hn.morning:o=Hn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ln.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ln.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ln.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ln.s(e,t)},S:function(e,t){return ln.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Uc(r);case"XXXX":case"XX":return jn(r);default:return jn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Uc(r);case"xxxx":case"xx":return jn(r);default:return jn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vc(r,":");default:return"GMT"+jn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vc(r,":");default:return"GMT"+jn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Se(r,t.length)},T:function(e,t,n){return Se(+e,t.length)}};function Vc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Se(s,2)}function Uc(e,t){return e%60===0?(e>0?"-":"+")+Se(Math.abs(e)/60,2):jn(e,t)}function jn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Se(Math.trunc(r/60),2),s=Se(r%60,2);return n+o+t+s}const Wc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},id=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},$v=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Wc(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Wc(r,t)).replace("{{time}}",id(o,t))},Fv={p:id,P:$v},zv=/^D+$/,Lv=/^Y+$/,Bv=["D","DD","YY","YYYY"];function Vv(e){return zv.test(e)}function Uv(e){return Lv.test(e)}function Wv(e,t,n){const r=Hv(e,t,n);if(console.warn(r),Bv.includes(e))throw new RangeError(r)}function Hv(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Zv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yv=/^'([^]*?)'?$/,Gv=/''/g,Kv=/[a-zA-Z]/;function Jv(e,t,n){const r=qr(),o=r.locale??sd,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=qe(e,n?.in);if(!Hb(c))throw new RangeError("Invalid time value");let u=t.match(qv).map(f=>{const d=f[0];if(d==="p"||d==="P"){const h=Fv[d];return h(f,o.formatLong)}return f}).join("").match(Zv).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const d=f[0];if(d==="'")return{isToken:!1,value:Xv(f)};if(Bc[d])return{isToken:!0,value:f};if(d.match(Kv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:f}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return u.map(f=>{if(!f.isToken)return f.value;const d=f.value;(Uv(d)||Vv(d))&&Wv(d,t,String(e));const h=Bc[d[0]];return h(c,d,o.localize,l)}).join("")}function Xv(e){const t=e.match(Yv);return t?t[1].replace(Gv,"'"):e}function Qv(e,t,n){const r=qr(),o=n?.locale??r.locale??sd,s=2520,a=Io(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const c=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[u,l]=vs(n?.in,...a>0?[t,e]:[e,t]),f=Qb(l,u),d=(Wo(l)-Wo(u))/1e3,h=Math.round((f-d)/60);let p;if(h<2)return n?.includeSeconds?f<5?o.formatDistance("lessThanXSeconds",5,c):f<10?o.formatDistance("lessThanXSeconds",10,c):f<20?o.formatDistance("lessThanXSeconds",20,c):f<40?o.formatDistance("halfAMinute",0,c):f<60?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",1,c):h===0?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",h,c);if(h<45)return o.formatDistance("xMinutes",h,c);if(h<90)return o.formatDistance("aboutXHours",1,c);if(h<Fc){const g=Math.round(h/60);return o.formatDistance("aboutXHours",g,c)}else{if(h<s)return o.formatDistance("xDays",1,c);if(h<xo){const g=Math.round(h/Fc);return o.formatDistance("xDays",g,c)}else if(h<xo*2)return p=Math.round(h/xo),o.formatDistance("aboutXMonths",p,c)}if(p=Xb(l,u),p<12){const g=Math.round(h/xo);return o.formatDistance("xMonths",g,c)}else{const g=p%12,y=Math.trunc(p/12);return g<3?o.formatDistance("aboutXYears",y,c):g<9?o.formatDistance("overXYears",y,c):o.formatDistance("almostXYears",y+1,c)}}function ex(e,t){return Qv(e,Ub(e),t)}function Ho({className:e,...t}){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:ae(e),...t,children:i.jsx("path",{fill:"#FF9900",d:"M 20.455 5.412 C 20.104 5.412 19.769 5.453 19.449 5.549 C 19.13 5.645 18.858 5.781 18.619 5.965 C 18.38 6.141 18.189 6.363 18.045 6.619 C 17.901 6.874 17.828 7.171 17.828 7.506 C 17.828 7.921 17.964 8.311 18.227 8.662 C 18.49 9.021 18.921 9.294 19.504 9.477 L 20.66 9.836 C 21.051 9.964 21.323 10.098 21.467 10.25 C 21.611 10.402 21.682 10.585 21.682 10.809 C 21.682 11.136 21.539 11.391 21.268 11.566 C 20.997 11.742 20.604 11.83 20.102 11.83 C 19.783 11.83 19.471 11.798 19.152 11.734 C 18.841 11.67 18.544 11.574 18.273 11.455 C 18.193 11.423 18.122 11.391 18.074 11.375 C 18.026 11.359 17.978 11.352 17.93 11.352 C 17.81 11.352 17.746 11.431 17.746 11.598 L 17.746 12.006 C 17.746 12.078 17.763 12.158 17.795 12.229 C 17.828 12.304 17.916 12.381 18.043 12.453 C 18.251 12.573 18.562 12.677 18.961 12.773 C 19.36 12.869 19.774 12.918 20.189 12.918 C 20.596 12.918 20.971 12.86 21.33 12.748 C 21.673 12.644 21.97 12.503 22.217 12.303 C 22.464 12.111 22.655 11.871 22.799 11.6 C 22.935 11.329 23.008 11.017 23.008 10.674 C 23.008 10.259 22.888 9.884 22.641 9.557 C 22.394 9.23 21.977 8.974 21.402 8.791 L 20.27 8.432 C 19.847 8.296 19.553 8.144 19.393 7.992 C 19.233 7.84 19.152 7.65 19.152 7.426 C 19.152 7.099 19.28 6.868 19.527 6.717 C 19.774 6.565 20.135 6.492 20.59 6.492 C 21.157 6.492 21.668 6.598 22.123 6.805 C 22.259 6.869 22.362 6.9 22.426 6.9 C 22.546 6.9 22.609 6.812 22.609 6.645 L 22.609 6.268 C 22.609 6.156 22.585 6.069 22.537 6.006 C 22.489 5.934 22.41 5.869 22.299 5.805 C 22.219 5.757 22.108 5.708 21.965 5.66 C 21.821 5.612 21.67 5.573 21.51 5.533 C 21.342 5.501 21.174 5.469 20.99 5.445 C 20.814 5.421 20.631 5.412 20.455 5.412 Z M 3.994 5.43 C 3.555 5.43 3.139 5.478 2.748 5.582 C 2.356 5.677 2.021 5.797 1.742 5.941 C 1.63 5.997 1.56 6.052 1.52 6.107 C 1.48 6.163 1.463 6.261 1.463 6.389 L 1.463 6.779 C 1.463 6.947 1.519 7.025 1.631 7.025 C 1.663 7.025 1.704 7.018 1.76 7.002 C 1.815 6.986 1.909 6.954 2.037 6.898 C 2.316 6.786 2.605 6.7 2.9 6.629 C 3.195 6.557 3.483 6.523 3.762 6.523 C 4.377 6.523 4.808 6.644 5.063 6.891 C 5.31 7.138 5.438 7.561 5.438 8.168 L 5.438 8.752 C 5.119 8.68 4.816 8.614 4.52 8.574 C 4.225 8.534 3.945 8.512 3.674 8.512 C 2.852 8.512 2.206 8.72 1.719 9.135 C 1.233 9.55 0.992 10.099 0.992 10.777 C 0.992 11.416 1.191 11.927 1.582 12.311 C 1.973 12.694 2.51 12.887 3.18 12.887 C 4.122 12.887 4.902 12.518 5.525 11.783 C 5.613 11.967 5.694 12.12 5.773 12.256 C 5.853 12.384 5.95 12.511 6.061 12.631 C 6.141 12.703 6.22 12.742 6.299 12.742 C 6.363 12.742 6.436 12.718 6.508 12.67 L 7.01 12.336 C 7.114 12.256 7.162 12.175 7.162 12.096 C 7.162 12.04 7.145 11.976 7.105 11.912 C 6.993 11.704 6.915 11.514 6.852 11.338 C 6.796 11.162 6.764 10.922 6.764 10.627 L 6.746 10.627 L 6.746 8.039 C 6.746 7.161 6.524 6.507 6.084 6.076 C 5.638 5.646 4.944 5.43 3.994 5.43 Z M 7.705 5.621 C 7.577 5.621 7.514 5.694 7.514 5.822 C 7.514 5.878 7.538 5.982 7.586 6.141 L 9.461 12.311 C 9.509 12.463 9.565 12.573 9.629 12.621 C 9.693 12.677 9.789 12.701 9.932 12.701 L 10.617 12.701 C 10.761 12.701 10.874 12.677 10.938 12.621 C 11.002 12.565 11.05 12.462 11.09 12.303 L 12.318 7.162 L 13.555 12.311 C 13.587 12.471 13.643 12.575 13.707 12.631 C 13.771 12.687 13.874 12.711 14.025 12.711 L 14.713 12.711 C 14.849 12.711 14.952 12.679 15.016 12.631 C 15.08 12.583 15.136 12.477 15.184 12.318 L 17.107 6.148 C 17.139 6.06 17.154 5.997 17.162 5.949 C 17.17 5.901 17.18 5.86 17.18 5.82 C 17.18 5.684 17.107 5.621 16.979 5.621 L 16.236 5.621 C 16.092 5.621 15.99 5.653 15.926 5.701 C 15.87 5.749 15.814 5.853 15.766 6.012 L 14.385 11.359 L 13.123 6.012 C 13.091 5.86 13.037 5.749 12.973 5.701 C 12.909 5.645 12.803 5.621 12.652 5.621 L 12.014 5.621 C 11.87 5.621 11.759 5.653 11.695 5.701 C 11.631 5.749 11.583 5.853 11.543 6.012 L 10.301 11.297 L 8.959 6.014 C 8.911 5.862 8.863 5.749 8.799 5.701 C 8.743 5.645 8.639 5.621 8.488 5.621 L 7.705 5.621 Z M 3.971 9.461 C 4.218 9.461 4.466 9.478 4.721 9.51 C 4.976 9.542 5.222 9.589 5.453 9.645 L 5.453 9.98 C 5.453 10.251 5.421 10.483 5.373 10.674 C 5.325 10.866 5.231 11.034 5.104 11.186 C 4.888 11.425 4.633 11.599 4.346 11.695 C 4.059 11.791 3.786 11.84 3.523 11.84 C 3.156 11.84 2.877 11.744 2.686 11.545 C 2.486 11.353 2.391 11.074 2.391 10.699 C 2.391 10.3 2.518 9.997 2.781 9.781 C 3.044 9.565 3.436 9.461 3.971 9.461 Z M 22.236 14.361 C 21.396 14.373 20.404 14.561 19.654 15.088 C 19.423 15.256 19.463 15.479 19.719 15.447 C 20.573 15.343 22.458 15.12 22.793 15.551 C 23.128 15.974 22.417 17.755 22.098 18.545 C 22.002 18.784 22.211 18.878 22.426 18.695 C 23.83 17.514 24.195 15.048 24.032 14.689 C 23.888 14.514 23.076 14.349 22.236 14.361 Z M 0.176 14.838 C 0 14.86 0 15.073 0.107 15.24 C 3.236 18.066 7.38 19.766 11.977 19.766 C 15.258 19.766 19.071 18.736 21.697 16.797 C 22.128 16.477 21.753 15.989 21.314 16.189 C 18.369 17.434 15.17 18.043 12.256 18.043 C 7.938 18.043 3.763 16.853 0.379 14.889 C 0.305 14.845 0.234 14.831 0.176 14.838 Z"})})}function cd({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 48 48",className:ae(e),...t,children:[i.jsx("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),i.jsx("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),i.jsx("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),i.jsx("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"})]})}function ld({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 48 48",className:ae(e),...t,children:[i.jsx("path",{fill:"#ff5722",d:"M6 6H22V22H6z",transform:"rotate(-180 14 14)"}),i.jsx("path",{fill:"#4caf50",d:"M26 6H42V22H26z",transform:"rotate(-180 34 14)"}),i.jsx("path",{fill:"#ffc107",d:"M26 26H42V42H26z",transform:"rotate(-180 34 34)"}),i.jsx("path",{fill:"#03a9f4",d:"M6 26H22V42H6z",transform:"rotate(-180 14 34)"})]})}function ud({className:e,...t}){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:ae(e),...t,children:i.jsx("path",{fill:"#F01F26",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 7h2v10h-2V7zM7 11h10v2H7v-2z"})})}function dd({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ae(e),...t,children:[i.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",ry:"2"}),i.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",ry:"2"}),i.jsx("line",{x1:"6",y1:"6",x2:"6.01",y2:"6"}),i.jsx("line",{x1:"6",y1:"18",x2:"6.01",y2:"18"})]})}function cr(e){if(!e||e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${n[r]}`}function ci(e){return e?ex(new Date(e),{addSuffix:!0}):"-"}function li(e){return e?Jv(new Date(e),"MMM d, yyyy HH:mm"):"-"}function ui(e,t){if(!e)return"-";const n=new Date(e),r=t?new Date(t):new Date,o=Math.round((r.getTime()-n.getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m ${o%60}s`:`${Math.floor(o/3600)}h ${Math.floor(o%3600/60)}m`}const fd={postgresql:{label:"PostgreSQL",color:"badge-info",icon:jt},mysql:{label:"MySQL",color:"badge-orange",icon:jt},mongodb:{label:"MongoDB",color:"badge-success",icon:jt},filesystem:{label:"Filesystem",color:"badge-muted",icon:Ka},s3:{label:"S3 / Object",color:"badge-warning",icon:Ho},ec2:{label:"AWS EC2",color:"badge-orange",icon:Ho},ssh_host:{label:"SSH / Linux Host",color:"badge-purple",icon:Tn}},md={local:{label:"Local",color:"badge-muted",icon:fs},s3:{label:"S3",color:"badge-warning",icon:Ho},b2:{label:"Backblaze B2",color:"badge-orange",icon:ud},sftp:{label:"SFTP",color:"badge-purple",icon:dd},rest:{label:"REST Server",color:"badge-info",icon:hu},azure:{label:"Azure",color:"badge-info",icon:ld},gs:{label:"GCS",color:"badge-success",icon:cd}},pd={success:{label:"Success",badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",dot:"#3fb950"},failed:{label:"Failed",badge:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",dot:"#f85149"},running:{label:"Running",badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",dot:"#58a6ff"},pending:{label:"Pending",badge:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",dot:"#d29922"},cancelled:{label:"Cancelled",badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"},connecting:{label:"Connecting...",badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"},error:{label:"Error",badge:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",dot:"#f85149"}};function Yr(e){return pd[e]||{label:e.charAt(0).toUpperCase()+e.slice(1),badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"}}function Qs(e){if(!e)return"";const t=e.toLowerCase();return t.includes("error")||t.includes("fatal")||t.includes("failed")?"error":t.includes("success")||t.includes("snapshot")||t.includes("done")?"success":t.includes("[dump]")||t.includes("[retention]")||t.startsWith("{")?"info":""}function Hc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Hc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Hc(e[o],null)}}}}function Ee(...e){return m.useCallback(tn(...e),e)}var tx=Symbol.for("react.lazy"),Zo=m[" use ".trim().toString()];function nx(e){return typeof e=="object"&&e!==null&&"then"in e}function hd(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tx&&"_payload"in e&&nx(e._payload)}function gd(e){const t=rx(e),n=m.forwardRef((r,o)=>{let{children:s,...a}=r;hd(s)&&typeof Zo=="function"&&(s=Zo(s._payload));const c=m.Children.toArray(s),u=c.find(sx);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var di=gd("Slot");function rx(e){const t=m.forwardRef((n,r)=>{let{children:o,...s}=n;if(hd(o)&&typeof Zo=="function"&&(o=Zo(o._payload)),m.isValidElement(o)){const a=ix(o),c=ax(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ox=Symbol("radix.slottable");function sx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ox}function ax(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ix(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Zc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qc=yu,yd=(e,t)=>n=>{var r;if(t?.variants==null)return qc(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(l=>{const f=n?.[l],d=s?.[l];if(f===null)return null;const h=Zc(f)||Zc(d);return o[l][h]}),c=n&&Object.entries(n).reduce((l,f)=>{let[d,h]=f;return h===void 0||(l[d]=h),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(g=>{let[y,b]=g;return Array.isArray(b)?b.includes({...s,...c}[y]):{...s,...c}[y]===b})?[...l,d,h]:l},[]);return qc(e,a,u,n?.class,n?.className)},fi=yd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ge({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?di:"button";return i.jsx(s,{"data-slot":"button",className:ae(fi({variant:t,size:n,className:e})),...o})}const cx=yd("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{success:"bg-green-500 text-white",default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ie({className:e,variant:t,asChild:n=!1,...r}){const o=n?di:"span";return i.jsx(o,{"data-slot":"badge",className:ae(cx({variant:t}),e),...r})}function At({className:e,...t}){return i.jsx("div",{"data-slot":"card",className:ae("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function lx({className:e,...t}){return i.jsx("div",{"data-slot":"card-header",className:ae("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ux({className:e,...t}){return i.jsx("div",{"data-slot":"card-title",className:ae("leading-none font-semibold",e),...t})}function Tt({className:e,...t}){return i.jsx("div",{"data-slot":"card-content",className:ae("px-6",e),...t})}function oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function dx(e,t){const n=m.createContext(t),r=s=>{const{children:a,...c}=s,u=m.useMemo(()=>c,Object.values(c));return i.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(s){const a=m.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function yn(e,t=[]){let n=[];function r(s,a){const c=m.createContext(a),u=n.length;n=[...n,a];const l=d=>{const{scope:h,children:p,...g}=d,y=h?.[e]?.[u]||c,b=m.useMemo(()=>g,Object.values(g));return i.jsx(y.Provider,{value:b,children:p})};l.displayName=s+"Provider";function f(d,h){const p=h?.[e]?.[u]||c,g=m.useContext(p);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>m.createContext(a));return function(c){const u=c?.[e]||s;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,fx(o,...t)]}function fx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:u,scopeName:l})=>{const d=u(s)[`__scope${l}`];return{...c,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Xe=globalThis?.document?m.useLayoutEffect:()=>{},mx=m[" useInsertionEffect ".trim().toString()]||Xe;function Pr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=px({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=m.useRef(e!==void 0);m.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=m.useCallback(f=>{if(c){const d=hx(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[c,e,s,a]);return[u,l]}function px({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return mx(()=>{s.current=t},[t]),m.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function hx(e){return typeof e=="function"}function gx(e){const t=yx(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(vx);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function yx(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=wx(o),c=xx(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bx=Symbol("radix.slottable");function vx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bx}function xx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _x=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=_x.reduce((e,t)=>{const n=gx(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:a,...c}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bd(e,t){e&&us.flushSync(()=>e.dispatchEvent(t))}function Yc(e){const t=Sx(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(Ex);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Sx(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=Nx(o),c=Cx(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kx=Symbol("radix.slottable");function Ex(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kx}function Cx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Nx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mi(e){const t=e+"CollectionProvider",[n,r]=yn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:v}=y,w=E.useRef(null),S=E.useRef(new Map).current;return i.jsx(o,{scope:b,itemMap:S,collectionRef:w,children:v})};a.displayName=t;const c=e+"CollectionSlot",u=Yc(c),l=E.forwardRef((y,b)=>{const{scope:v,children:w}=y,S=s(c,v),_=Ee(b,S.collectionRef);return i.jsx(u,{ref:_,children:w})});l.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=Yc(f),p=E.forwardRef((y,b)=>{const{scope:v,children:w,...S}=y,_=E.useRef(null),C=Ee(b,_),I=s(f,v);return E.useEffect(()=>(I.itemMap.set(_,{ref:_,...S}),()=>{I.itemMap.delete(_)})),i.jsx(h,{[d]:"",ref:C,children:w})});p.displayName=f;function g(y){const b=s(e+"CollectionConsumer",y);return E.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((I,O)=>S.indexOf(I.ref.current)-S.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},g,r]}var jx=m.createContext(void 0);function pi(e){const t=m.useContext(jx);return e||t||"ltr"}function Vt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rx(e,t=globalThis?.document){const n=Vt(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ax="DismissableLayer",va="dismissableLayer.update",Tx="dismissableLayer.pointerDownOutside",Ox="dismissableLayer.focusOutside",Gc,vd=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xs=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,l=m.useContext(vd),[f,d]=m.useState(null),h=f?.ownerDocument??globalThis?.document,[,p]=m.useState({}),g=Ee(t,O=>d(O)),y=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(b),w=f?y.indexOf(f):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,_=w>=v,C=Ix(O=>{const T=O.target,H=[...l.branches].some(Z=>Z.contains(T));!_||H||(o?.(O),a?.(O),O.defaultPrevented||c?.())},h),I=Mx(O=>{const T=O.target;[...l.branches].some(Z=>Z.contains(T))||(s?.(O),a?.(O),O.defaultPrevented||c?.())},h);return Rx(O=>{w===l.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},h),m.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Gc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Kc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Gc)}},[f,h,n,l]),m.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Kc())},[f,l]),m.useEffect(()=>{const O=()=>p({});return document.addEventListener(va,O),()=>document.removeEventListener(va,O)},[]),i.jsx(ve.div,{...u,ref:g,style:{pointerEvents:S?_?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,I.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,C.onPointerDownCapture)})});xs.displayName=Ax;var Px="DismissableLayerBranch",Dx=m.forwardRef((e,t)=>{const n=m.useContext(vd),r=m.useRef(null),o=Ee(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(ve.div,{...e,ref:o})});Dx.displayName=Px;function Ix(e,t=globalThis?.document){const n=Vt(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let u=function(){xd(Tx,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mx(e,t=globalThis?.document){const n=Vt(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&xd(Ox,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kc(){const e=new CustomEvent(va);document.dispatchEvent(e)}function xd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bd(o,s):o.dispatchEvent(s)}var ea=0;function hi(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jc()),document.body.insertAdjacentElement("beforeend",e[1]??Jc()),ea++,()=>{ea===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ea--}},[])}function Jc(){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 ta="focusScope.autoFocusOnMount",na="focusScope.autoFocusOnUnmount",Xc={bubbles:!1,cancelable:!0},$x="FocusScope",ws=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[c,u]=m.useState(null),l=Vt(o),f=Vt(s),d=m.useRef(null),h=Ee(t,y=>u(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(S){if(p.paused||!c)return;const _=S.target;c.contains(_)?d.current=_:mn(d.current,{select:!0})},b=function(S){if(p.paused||!c)return;const _=S.relatedTarget;_!==null&&(c.contains(_)||mn(d.current,{select:!0}))},v=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&mn(c)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const w=new MutationObserver(v);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),w.disconnect()}}},[r,c,p.paused]),m.useEffect(()=>{if(c){el.add(p);const y=document.activeElement;if(!c.contains(y)){const v=new CustomEvent(ta,Xc);c.addEventListener(ta,l),c.dispatchEvent(v),v.defaultPrevented||(Fx(Ux(wd(c)),{select:!0}),document.activeElement===y&&mn(c))}return()=>{c.removeEventListener(ta,l),setTimeout(()=>{const v=new CustomEvent(na,Xc);c.addEventListener(na,f),c.dispatchEvent(v),v.defaultPrevented||mn(y??document.body,{select:!0}),c.removeEventListener(na,f),el.remove(p)},0)}}},[c,l,f,p]);const g=m.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(b&&v){const w=y.currentTarget,[S,_]=zx(w);S&&_?!y.shiftKey&&v===_?(y.preventDefault(),n&&mn(S,{select:!0})):y.shiftKey&&v===S&&(y.preventDefault(),n&&mn(_,{select:!0})):v===w&&y.preventDefault()}},[n,r,p.paused]);return i.jsx(ve.div,{tabIndex:-1,...a,ref:h,onKeyDown:g})});ws.displayName=$x;function Fx(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mn(r,{select:t}),document.activeElement!==n)return}function zx(e){const t=wd(e),n=Qc(t,e),r=Qc(t.reverse(),e);return[n,r]}function wd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qc(e,t){for(const n of e)if(!Lx(n,{upTo:t}))return n}function Lx(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bx(e){return e instanceof HTMLInputElement&&"select"in e}function mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Bx(e)&&t&&e.select()}}var el=Vx();function Vx(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=tl(e,t),e.unshift(t)},remove(t){e=tl(e,t),e[0]?.resume()}}}function tl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ux(e){return e.filter(t=>t.tagName!=="A")}var Wx=m[" useId ".trim().toString()]||(()=>{}),Hx=0;function Kt(e){const[t,n]=m.useState(Wx());return Xe(()=>{n(r=>r??String(Hx++))},[e]),e||(t?`radix-${t}`:"")}const Zx=["top","right","bottom","left"],pn=Math.min,ft=Math.max,qo=Math.round,wo=Math.floor,Bt=e=>({x:e,y:e}),qx={left:"right",right:"left",bottom:"top",top:"bottom"};function xa(e,t,n){return ft(e,pn(t,n))}function Xt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function lr(e){return e.split("-")[1]}function gi(e){return e==="x"?"y":"x"}function yi(e){return e==="y"?"height":"width"}function Lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function bi(e){return gi(Lt(e))}function Yx(e,t,n){n===void 0&&(n=!1);const r=lr(e),o=bi(e),s=yi(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Yo(a)),[a,Yo(a)]}function Gx(e){const t=Yo(e);return[wa(e),t,wa(t)]}function wa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const nl=["left","right"],rl=["right","left"],Kx=["top","bottom"],Jx=["bottom","top"];function Xx(e,t,n){switch(e){case"top":case"bottom":return n?t?rl:nl:t?nl:rl;case"left":case"right":return t?Kx:Jx;default:return[]}}function Qx(e,t,n,r){const o=lr(e);let s=Xx(Qt(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(wa)))),s}function Yo(e){const t=Qt(e);return qx[t]+e.slice(t.length)}function ew(e){return{top:0,right:0,bottom:0,left:0,...e}}function _d(e){return typeof e!="number"?ew(e):{top:e,right:e,bottom:e,left:e}}function Go(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ol(e,t,n){let{reference:r,floating:o}=e;const s=Lt(t),a=bi(t),c=yi(a),u=Qt(t),l=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(lr(t)){case"start":p[a]-=h*(n&&l?-1:1);break;case"end":p[a]+=h*(n&&l?-1:1);break}return p}async function tw(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Xt(t,e),g=_d(p),b=c[h?d==="floating"?"reference":"floating":d],v=Go(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:u})),w=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),_=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},C=Go(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:S,strategy:u}):w);return{top:(v.top-C.top+g.top)/_.y,bottom:(C.bottom-v.bottom+g.bottom)/_.y,left:(v.left-C.left+g.left)/_.x,right:(C.right-v.right+g.right)/_.x}}const nw=50,rw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:tw},u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=ol(l,r,u),h=r,p=0;const g={};for(let y=0;y<s.length;y++){const b=s[y];if(!b)continue;const{name:v,fn:w}=b,{x:S,y:_,data:C,reset:I}=await w({x:f,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:l,platform:c,elements:{reference:e,floating:t}});f=S??f,d=_??d,g[v]={...g[v],...C},I&&p<nw&&(p++,typeof I=="object"&&(I.placement&&(h=I.placement),I.rects&&(l=I.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:f,y:d}=ol(l,h,u)),y=-1)}return{x:f,y:d,placement:h,strategy:o,middlewareData:g}},ow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:c,middlewareData:u}=t,{element:l,padding:f=0}=Xt(e,t)||{};if(l==null)return{};const d=_d(f),h={x:n,y:r},p=bi(o),g=yi(p),y=await a.getDimensions(l),b=p==="y",v=b?"top":"left",w=b?"bottom":"right",S=b?"clientHeight":"clientWidth",_=s.reference[g]+s.reference[p]-h[p]-s.floating[g],C=h[p]-s.reference[p],I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let O=I?I[S]:0;(!O||!await(a.isElement==null?void 0:a.isElement(I)))&&(O=c.floating[S]||s.floating[g]);const T=_/2-C/2,H=O/2-y[g]/2-1,Z=pn(d[v],H),ne=pn(d[w],H),N=Z,P=O-y[g]-ne,z=O/2-y[g]/2+T,G=xa(N,z,P),D=!u.arrow&&lr(o)!=null&&z!==G&&s.reference[g]/2-(z<N?Z:ne)-y[g]/2<0,W=D?z<N?z-N:z-P:0;return{[p]:h[p]+W,data:{[p]:G,centerOffset:z-G-W,...D&&{alignmentOffset:W}},reset:D}}}),sw=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...b}=Xt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Qt(o),w=Lt(c),S=Qt(c)===c,_=await(u.isRTL==null?void 0:u.isRTL(l.floating)),C=h||(S||!y?[Yo(c)]:Gx(c)),I=g!=="none";!h&&I&&C.push(...Qx(c,y,g,_));const O=[c,...C],T=await u.detectOverflow(t,b),H=[];let Z=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&H.push(T[v]),d){const z=Yx(o,a,_);H.push(T[z[0]],T[z[1]])}if(Z=[...Z,{placement:o,overflows:H}],!H.every(z=>z<=0)){var ne,N;const z=(((ne=s.flip)==null?void 0:ne.index)||0)+1,G=O[z];if(G&&(!(d==="alignment"?w!==Lt(G):!1)||Z.every(V=>Lt(V.placement)===w?V.overflows[0]>0:!0)))return{data:{index:z,overflows:Z},reset:{placement:G}};let D=(N=Z.filter(W=>W.overflows[0]<=0).sort((W,V)=>W.overflows[1]-V.overflows[1])[0])==null?void 0:N.placement;if(!D)switch(p){case"bestFit":{var P;const W=(P=Z.filter(V=>{if(I){const B=Lt(V.placement);return B===w||B==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(B=>B>0).reduce((B,F)=>B+F,0)]).sort((V,B)=>V[1]-B[1])[0])==null?void 0:P[0];W&&(D=W);break}case"initialPlacement":D=c;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function sl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return Zx.some(t=>e[t]>=0)}const aw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Xt(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=sl(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:al(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),c=sl(a,n.floating);return{data:{escapedOffsets:c,escaped:al(c)}}}default:return{}}}}},Sd=new Set(["left","top"]);async function iw(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Qt(n),c=lr(n),u=Lt(n)==="y",l=Sd.has(a)?-1:1,f=s&&u?-1:1,d=Xt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(p=c==="end"?g*-1:g),u?{x:p*f,y:h*l}:{x:h*l,y:p*f}}const cw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:c}=t,u=await iw(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},lw=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:v=>{let{x:w,y:S}=v;return{x:w,y:S}}},...l}=Xt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,l),h=Lt(Qt(o)),p=gi(h);let g=f[p],y=f[h];if(a){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=g+d[v],_=g-d[w];g=xa(S,g,_)}if(c){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=y+d[v],_=y-d[w];y=xa(S,y,_)}const b=u.fn({...t,[p]:g,[h]:y});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:a,[h]:c}}}}}},uw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=Xt(e,t),f={x:n,y:r},d=Lt(o),h=gi(d);let p=f[h],g=f[d];const y=Xt(c,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const S=h==="y"?"height":"width",_=s.reference[h]-s.floating[S]+b.mainAxis,C=s.reference[h]+s.reference[S]-b.mainAxis;p<_?p=_:p>C&&(p=C)}if(l){var v,w;const S=h==="y"?"width":"height",_=Sd.has(Qt(o)),C=s.reference[d]-s.floating[S]+(_&&((v=a.offset)==null?void 0:v[d])||0)+(_?0:b.crossAxis),I=s.reference[d]+s.reference[S]+(_?0:((w=a.offset)==null?void 0:w[d])||0)-(_?b.crossAxis:0);g<C?g=C:g>I&&(g=I)}return{[h]:p,[d]:g}}}},dw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:c}=t,{apply:u=()=>{},...l}=Xt(e,t),f=await a.detectOverflow(t,l),d=Qt(o),h=lr(o),p=Lt(o)==="y",{width:g,height:y}=s.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const w=y-f.top-f.bottom,S=g-f.left-f.right,_=pn(y-f[b],w),C=pn(g-f[v],S),I=!t.middlewareData.shift;let O=_,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=w),I&&!h){const Z=ft(f.left,0),ne=ft(f.right,0),N=ft(f.top,0),P=ft(f.bottom,0);p?T=g-2*(Z!==0||ne!==0?Z+ne:ft(f.left,f.right)):O=y-2*(N!==0||P!==0?N+P:ft(f.top,f.bottom))}await u({...t,availableWidth:T,availableHeight:O});const H=await a.getDimensions(c.floating);return g!==H.width||y!==H.height?{reset:{rects:!0}}:{}}}};function _s(){return typeof window<"u"}function ur(e){return kd(e)?(e.nodeName||"").toLowerCase():"#document"}function pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(kd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kd(e){return _s()?e instanceof Node||e instanceof pt(e).Node:!1}function Ot(e){return _s()?e instanceof Element||e instanceof pt(e).Element:!1}function nn(e){return _s()?e instanceof HTMLElement||e instanceof pt(e).HTMLElement:!1}function il(e){return!_s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pt(e).ShadowRoot}function Gr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function fw(e){return/^(table|td|th)$/.test(ur(e))}function Ss(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const mw=/transform|translate|scale|rotate|perspective|filter/,pw=/paint|layout|strict|content/,En=e=>!!e&&e!=="none";let ra;function vi(e){const t=Ot(e)?Pt(e):e;return En(t.transform)||En(t.translate)||En(t.scale)||En(t.rotate)||En(t.perspective)||!xi()&&(En(t.backdropFilter)||En(t.filter))||mw.test(t.willChange||"")||pw.test(t.contain||"")}function hw(e){let t=hn(e);for(;nn(t)&&!sr(t);){if(vi(t))return t;if(Ss(t))return null;t=hn(t)}return null}function xi(){return ra==null&&(ra=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ra}function sr(e){return/^(html|body|#document)$/.test(ur(e))}function Pt(e){return pt(e).getComputedStyle(e)}function ks(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hn(e){if(ur(e)==="html")return e;const t=e.assignedSlot||e.parentNode||il(e)&&e.host||Ut(e);return il(t)?t.host:t}function Ed(e){const t=hn(e);return sr(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&Gr(t)?t:Ed(t)}function Dr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ed(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=pt(o);if(s){const c=_a(a);return t.concat(a,a.visualViewport||[],Gr(o)?o:[],c&&n?Dr(c):[])}else return t.concat(o,Dr(o,[],n))}function _a(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cd(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nn(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=qo(n)!==s||qo(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function wi(e){return Ot(e)?e:e.contextElement}function Qn(e){const t=wi(e);if(!nn(t))return Bt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Cd(t);let a=(s?qo(n.width):n.width)/r,c=(s?qo(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const gw=Bt(0);function Nd(e){const t=pt(e);return!xi()||!t.visualViewport?gw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pt(e)?!1:t}function Dn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=wi(e);let a=Bt(1);t&&(r?Ot(r)&&(a=Qn(r)):a=Qn(e));const c=yw(s,n,r)?Nd(s):Bt(0);let u=(o.left+c.x)/a.x,l=(o.top+c.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(s){const h=pt(s),p=r&&Ot(r)?pt(r):r;let g=h,y=_a(g);for(;y&&r&&p!==g;){const b=Qn(y),v=y.getBoundingClientRect(),w=Pt(y),S=v.left+(y.clientLeft+parseFloat(w.paddingLeft))*b.x,_=v.top+(y.clientTop+parseFloat(w.paddingTop))*b.y;u*=b.x,l*=b.y,f*=b.x,d*=b.y,u+=S,l+=_,g=pt(y),y=_a(g)}}return Go({width:f,height:d,x:u,y:l})}function Es(e,t){const n=ks(e).scrollLeft;return t?t.left+n:Dn(Ut(e)).left+n}function jd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Es(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function bw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Ut(r),c=t?Ss(t.floating):!1;if(r===a||c&&s)return n;let u={scrollLeft:0,scrollTop:0},l=Bt(1);const f=Bt(0),d=nn(r);if((d||!d&&!s)&&((ur(r)!=="body"||Gr(a))&&(u=ks(r)),d)){const p=Dn(r);l=Qn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const h=a&&!d&&!s?jd(a,u):Bt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+f.x+h.x,y:n.y*l.y-u.scrollTop*l.y+f.y+h.y}}function vw(e){return Array.from(e.getClientRects())}function xw(e){const t=Ut(e),n=ks(e),r=e.ownerDocument.body,o=ft(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ft(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Es(e);const c=-n.scrollTop;return Pt(r).direction==="rtl"&&(a+=ft(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:c}}const cl=25;function ww(e,t){const n=pt(e),r=Ut(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,u=0;if(o){s=o.width,a=o.height;const f=xi();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const l=Es(r);if(l<=0){const f=r.ownerDocument,d=f.body,h=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-p);g<=cl&&(s-=g)}else l<=cl&&(s+=l);return{width:s,height:a,x:c,y:u}}function _w(e,t){const n=Dn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nn(e)?Qn(e):Bt(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,l=r*s.y;return{width:a,height:c,x:u,y:l}}function ll(e,t,n){let r;if(t==="viewport")r=ww(e,n);else if(t==="document")r=xw(Ut(e));else if(Ot(t))r=_w(t,n);else{const o=Nd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Go(r)}function Rd(e,t){const n=hn(e);return n===t||!Ot(n)||sr(n)?!1:Pt(n).position==="fixed"||Rd(n,t)}function Sw(e,t){const n=t.get(e);if(n)return n;let r=Dr(e,[],!1).filter(c=>Ot(c)&&ur(c)!=="body"),o=null;const s=Pt(e).position==="fixed";let a=s?hn(e):e;for(;Ot(a)&&!sr(a);){const c=Pt(a),u=vi(a);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Gr(a)&&!u&&Rd(e,a))?r=r.filter(f=>f!==a):o=c,a=hn(a)}return t.set(e,r),r}function kw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Ss(t)?[]:Sw(t,this._c):[].concat(n),r],c=ll(t,a[0],o);let u=c.top,l=c.right,f=c.bottom,d=c.left;for(let h=1;h<a.length;h++){const p=ll(t,a[h],o);u=ft(p.top,u),l=pn(p.right,l),f=pn(p.bottom,f),d=ft(p.left,d)}return{width:l-d,height:f-u,x:d,y:u}}function Ew(e){const{width:t,height:n}=Cd(e);return{width:t,height:n}}function Cw(e,t,n){const r=nn(t),o=Ut(t),s=n==="fixed",a=Dn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=Bt(0);function l(){u.x=Es(o)}if(r||!r&&!s)if((ur(t)!=="body"||Gr(o))&&(c=ks(t)),r){const p=Dn(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&l();s&&!r&&o&&l();const f=o&&!r&&!s?jd(o,c):Bt(0),d=a.left+c.scrollLeft-u.x-f.x,h=a.top+c.scrollTop-u.y-f.y;return{x:d,y:h,width:a.width,height:a.height}}function oa(e){return Pt(e).position==="static"}function ul(e,t){if(!nn(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Ad(e,t){const n=pt(e);if(Ss(e))return n;if(!nn(e)){let o=hn(e);for(;o&&!sr(o);){if(Ot(o)&&!oa(o))return o;o=hn(o)}return n}let r=ul(e,t);for(;r&&fw(r)&&oa(r);)r=ul(r,t);return r&&sr(r)&&oa(r)&&!vi(r)?n:r||hw(e)||n}const Nw=async function(e){const t=this.getOffsetParent||Ad,n=this.getDimensions,r=await n(e.floating);return{reference:Cw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jw(e){return Pt(e).direction==="rtl"}const Rw={convertOffsetParentRelativeRectToViewportRelativeRect:bw,getDocumentElement:Ut,getClippingRect:kw,getOffsetParent:Ad,getElementRects:Nw,getClientRects:vw,getDimensions:Ew,getScale:Qn,isElement:Ot,isRTL:jw};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aw(e,t){let n=null,r;const o=Ut(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:d,width:h,height:p}=l;if(c||t(),!h||!p)return;const g=wo(d),y=wo(o.clientWidth-(f+h)),b=wo(o.clientHeight-(d+p)),v=wo(f),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-v+"px",threshold:ft(0,pn(1,u))||1};let _=!0;function C(I){const O=I[0].intersectionRatio;if(O!==u){if(!_)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Td(l,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(C,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return a(!0),s}function Tw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=wi(e),f=o||s?[...l?Dr(l):[],...t?Dr(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&c?Aw(l,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),l&&!u&&p.observe(l),t&&p.observe(t));let g,y=u?Dn(e):null;u&&b();function b(){const v=Dn(e);y&&!Td(y,v)&&n(),y=v,g=requestAnimationFrame(b)}return n(),()=>{var v;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d?.(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(g)}}const Ow=cw,Pw=lw,Dw=sw,Iw=dw,Mw=aw,dl=ow,$w=uw,Fw=(e,t,n)=>{const r=new Map,o={platform:Rw,...n},s={...o.platform,_c:r};return rw(e,t,{...o,platform:s})};var zw=typeof document<"u",Lw=function(){},Mo=zw?E.useLayoutEffect:Lw;function Ko(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ko(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ko(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Od(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fl(e,t){const n=Od(e);return Math.round(t*n)/n}function sa(e){const t=m.useRef(e);return Mo(()=>{t.current=e}),t}function Bw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[f,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Ko(h,r)||p(r);const[g,y]=m.useState(null),[b,v]=m.useState(null),w=m.useCallback(V=>{V!==I.current&&(I.current=V,y(V))},[]),S=m.useCallback(V=>{V!==O.current&&(O.current=V,v(V))},[]),_=s||g,C=a||b,I=m.useRef(null),O=m.useRef(null),T=m.useRef(f),H=u!=null,Z=sa(u),ne=sa(o),N=sa(l),P=m.useCallback(()=>{if(!I.current||!O.current)return;const V={placement:t,strategy:n,middleware:h};ne.current&&(V.platform=ne.current),Fw(I.current,O.current,V).then(B=>{const F={...B,isPositioned:N.current!==!1};z.current&&!Ko(T.current,F)&&(T.current=F,us.flushSync(()=>{d(F)}))})},[h,t,n,ne,N]);Mo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[l]);const z=m.useRef(!1);Mo(()=>(z.current=!0,()=>{z.current=!1}),[]),Mo(()=>{if(_&&(I.current=_),C&&(O.current=C),_&&C){if(Z.current)return Z.current(_,C,P);P()}},[_,C,P,Z,H]);const G=m.useMemo(()=>({reference:I,floating:O,setReference:w,setFloating:S}),[w,S]),D=m.useMemo(()=>({reference:_,floating:C}),[_,C]),W=m.useMemo(()=>{const V={position:n,left:0,top:0};if(!D.floating)return V;const B=fl(D.floating,f.x),F=fl(D.floating,f.y);return c?{...V,transform:"translate("+B+"px, "+F+"px)",...Od(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:F}},[n,c,D.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:P,refs:G,elements:D,floatingStyles:W}),[f,P,G,D,W])}const Vw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dl({element:r.current,padding:o}).fn(n):{}:r?dl({element:r,padding:o}).fn(n):{}}}},Uw=(e,t)=>{const n=Ow(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ww=(e,t)=>{const n=Pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hw=(e,t)=>({fn:$w(e).fn,options:[e,t]}),Zw=(e,t)=>{const n=Dw(e);return{name:n.name,fn:n.fn,options:[e,t]}},qw=(e,t)=>{const n=Iw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yw=(e,t)=>{const n=Mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gw=(e,t)=>{const n=Vw(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Kw="Arrow",Pd=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return i.jsx(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pd.displayName=Kw;var Jw=Pd;function Xw(e){const[t,n]=m.useState(void 0);return Xe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _i="Popper",[Dd,Cs]=yn(_i),[Qw,Id]=Dd(_i),Md=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return i.jsx(Qw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Md.displayName=_i;var $d="PopperAnchor",Fd=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Id($d,n),a=m.useRef(null),c=Ee(t,a),u=m.useRef(null);return m.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&s.onAnchorChange(u.current)}),r?null:i.jsx(ve.div,{...o,ref:c})});Fd.displayName=$d;var Si="PopperContent",[e0,t0]=Dd(Si),zd=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...y}=e,b=Id(Si,n),[v,w]=m.useState(null),S=Ee(t,$=>w($)),[_,C]=m.useState(null),I=Xw(_),O=I?.width??0,T=I?.height??0,H=r+(s!=="center"?"-"+s:""),Z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},ne=Array.isArray(l)?l:[l],N=ne.length>0,P={padding:Z,boundary:ne.filter(r0),altBoundary:N},{refs:z,floatingStyles:G,placement:D,isPositioned:W,middlewareData:V}=Bw({strategy:"fixed",placement:H,whileElementsMounted:(...$)=>Tw(...$,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[Uw({mainAxis:o+T,alignmentAxis:a}),u&&Ww({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Hw():void 0,...P}),u&&Zw({...P}),qw({...P,apply:({elements:$,rects:Q,availableWidth:le,availableHeight:me})=>{const{width:he,height:be}=Q.reference,De=$.floating.style;De.setProperty("--radix-popper-available-width",`${le}px`),De.setProperty("--radix-popper-available-height",`${me}px`),De.setProperty("--radix-popper-anchor-width",`${he}px`),De.setProperty("--radix-popper-anchor-height",`${be}px`)}}),_&&Gw({element:_,padding:c}),o0({arrowWidth:O,arrowHeight:T}),h&&Yw({strategy:"referenceHidden",...P})]}),[B,F]=Vd(D),R=Vt(g);Xe(()=>{W&&R?.()},[W,R]);const J=V.arrow?.x,Y=V.arrow?.y,X=V.arrow?.centerOffset!==0,[re,ce]=m.useState();return Xe(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:W?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(e0,{scope:n,placedSide:B,onArrowChange:C,arrowX:J,arrowY:Y,shouldHideArrow:X,children:i.jsx(ve.div,{"data-side":B,"data-align":F,...y,ref:S,style:{...y.style,animation:W?void 0:"none"}})})})});zd.displayName=Si;var Ld="PopperArrow",n0={top:"bottom",right:"left",bottom:"top",left:"right"},Bd=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=t0(Ld,r),a=n0[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(Jw,{...o,ref:n,style:{...o.style,display:"block"}})})});Bd.displayName=Ld;function r0(e){return e!==null}var o0=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,f]=Vd(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(o.arrow?.x??0)+c/2,p=(o.arrow?.y??0)+u/2;let g="",y="";return l==="bottom"?(g=a?d:`${h}px`,y=`${-u}px`):l==="top"?(g=a?d:`${h}px`,y=`${r.floating.height+u}px`):l==="right"?(g=`${-u}px`,y=a?d:`${p}px`):l==="left"&&(g=`${r.floating.width+u}px`,y=a?d:`${p}px`),{data:{x:g,y}}}});function Vd(e){const[t,n="center"]=e.split("-");return[t,n]}var Ud=Md,Wd=Fd,Hd=zd,Zd=Bd,s0="Portal",Ns=m.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=m.useState(!1);Xe(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?qa.createPortal(i.jsx(ve.div,{...r,ref:t}),a):null});Ns.displayName=s0;function a0(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var bn=e=>{const{present:t,children:n}=e,r=i0(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Ee(r.ref,c0(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};bn.displayName="Presence";function i0(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),a=e?"mounted":"unmounted",[c,u]=a0(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const l=_o(r.current);s.current=c==="mounted"?l:"none"},[c]),Xe(()=>{const l=r.current,f=o.current;if(f!==e){const h=s.current,p=_o(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Xe(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=p=>{const y=_o(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(s.current=_o(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function _o(e){return e?.animationName||"none"}function c0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aa="rovingFocusGroup.onEntryFocus",l0={bubbles:!1,cancelable:!0},Kr="RovingFocusGroup",[Sa,qd,u0]=mi(Kr),[d0,Yd]=yn(Kr,[u0]),[f0,m0]=d0(Kr),Gd=m.forwardRef((e,t)=>i.jsx(Sa.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Sa.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(p0,{...e,ref:t})})}));Gd.displayName=Kr;var p0=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,h=m.useRef(null),p=Ee(t,h),g=pi(s),[y,b]=Pr({prop:a,defaultProp:c??null,onChange:u,caller:Kr}),[v,w]=m.useState(!1),S=Vt(l),_=qd(n),C=m.useRef(!1),[I,O]=m.useState(0);return m.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(aa,S),()=>T.removeEventListener(aa,S)},[S]),i.jsx(f0,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:y,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[]),children:i.jsx(ve.div,{tabIndex:v||I===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{C.current=!0}),onFocus:oe(e.onFocus,T=>{const H=!C.current;if(T.target===T.currentTarget&&H&&!v){const Z=new CustomEvent(aa,l0);if(T.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const ne=_().filter(D=>D.focusable),N=ne.find(D=>D.active),P=ne.find(D=>D.id===y),G=[N,P,...ne].filter(Boolean).map(D=>D.ref.current);Xd(G,f)}}C.current=!1}),onBlur:oe(e.onBlur,()=>w(!1))})})}),Kd="RovingFocusGroupItem",Jd=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=e,u=Kt(),l=s||u,f=m0(Kd,n),d=f.currentTabStopId===l,h=qd(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:y}=f;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),i.jsx(Sa.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:i.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:oe(e.onMouseDown,b=>{r?f.onItemFocus(l):b.preventDefault()}),onFocus:oe(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:oe(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=y0(b,f.orientation,f.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=h().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const _=S.indexOf(b.currentTarget);S=f.loop?b0(S,_+1):S.slice(_+1)}setTimeout(()=>Xd(S))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:y!=null}):a})})});Jd.displayName=Kd;var h0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function g0(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function y0(e,t,n){const r=g0(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return h0[r]}function Xd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function b0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var v0=Gd,x0=Jd;function w0(e){const t=_0(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(k0);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function _0(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=C0(o),c=E0(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S0=Symbol("radix.slottable");function k0(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S0}function E0(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function C0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var N0=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zn=new WeakMap,So=new WeakMap,ko={},ia=0,Qd=function(e){return e&&(e.host||Qd(e.parentNode))},j0=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Qd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},R0=function(e,t,n,r){var o=j0(t,Array.isArray(e)?e:[e]);ko[n]||(ko[n]=new WeakMap);var s=ko[n],a=[],c=new Set,u=new Set(o),l=function(d){!d||c.has(d)||(c.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(h){if(c.has(h))f(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",y=(Zn.get(h)||0)+1,b=(s.get(h)||0)+1;Zn.set(h,y),s.set(h,b),a.push(h),y===1&&g&&So.set(h,!0),b===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),c.clear(),ia++,function(){a.forEach(function(d){var h=Zn.get(d)-1,p=s.get(d)-1;Zn.set(d,h),s.set(d,p),h||(So.has(d)||d.removeAttribute(r),So.delete(d)),p||d.removeAttribute(n)}),ia--,ia||(Zn=new WeakMap,Zn=new WeakMap,So=new WeakMap,ko={})}},ki=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=N0(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),R0(r,o,n,"aria-hidden")):function(){return null}},zt=function(){return zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},zt.apply(this,arguments)};function ef(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function A0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var $o="right-scroll-bar-position",Fo="width-before-scroll-bar",T0="with-scroll-bars-hidden",O0="--removed-body-scroll-bar-size";function ca(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function P0(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var D0=typeof window<"u"?m.useLayoutEffect:m.useEffect,ml=new WeakMap;function I0(e,t){var n=P0(null,function(r){return e.forEach(function(o){return ca(o,r)})});return D0(function(){var r=ml.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(c){s.has(c)||ca(c,null)}),s.forEach(function(c){o.has(c)||ca(c,a)})}ml.set(n,e)},[e]),n}function M0(e){return e}function $0(e,t){t===void 0&&(t=M0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function F0(e){e===void 0&&(e={});var t=$0(null);return t.options=zt({async:!0,ssr:!1},e),t}var tf=function(e){var t=e.sideCar,n=ef(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,zt({},n))};tf.isSideCarExport=!0;function z0(e,t){return e.useMedium(t),tf}var nf=F0(),la=function(){},js=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:la,onWheelCapture:la,onTouchMoveCapture:la}),o=r[0],s=r[1],a=e.forwardProps,c=e.children,u=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,S=e.gapMode,_=ef(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,I=I0([n,t]),O=zt(zt({},_),o);return m.createElement(m.Fragment,null,f&&m.createElement(C,{sideCar:nf,removeScrollBar:l,shards:d,noRelative:p,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:S}),a?m.cloneElement(m.Children.only(c),zt(zt({},O),{ref:I})):m.createElement(w,zt({},O,{className:u,ref:I}),c))});js.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};js.classNames={fullWidth:Fo,zeroRight:$o};var L0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=L0();return t&&e.setAttribute("nonce",t),e}function V0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function U0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var W0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B0())&&(V0(t,n),U0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H0=function(){var e=W0();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rf=function(){var e=H0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Z0={left:0,top:0,right:0,gap:0},ua=function(e){return parseInt(e||"",10)||0},q0=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ua(n),ua(r),ua(o)]},Y0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Z0;var t=q0(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},G0=rf(),er="data-scroll-locked",K0=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
6
|
+
<%s key={someKey} {...props} />`,X,I,Q,I),F[I+X]=!0)}if(I=null,G!==void 0&&(n(G),I=""+G),a(J)&&(n(J.key),I=""+J.key),"key"in J){G={};for(var le in J)le!=="key"&&(G[le]=J[le])}else G=J;return I&&c(G,typeof R=="function"?R.displayName||R.name||"Unknown":R),l(R,I,G,o(),re,ce)}function d(R){p(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===W&&(R._payload.status==="fulfilled"?p(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function p(R){return typeof R=="object"&&R!==null&&R.$$typeof===g}var h=k,g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),C=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,z=Array.isArray,Y=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(R){return R()}};var D,q={},B=h.react_stack_bottom_frame.bind(h,s)(),V=Y(r(s)),F={};yr.Fragment=b,yr.jsx=function(R,J,G){var X=1e4>C.recentlyCreatedOwnerStacks++;return f(R,J,G,!1,X?Error("react-stack-top-frame"):B,X?Y(r(R)):V)},yr.jsxs=function(R,J,G){var X=1e4>C.recentlyCreatedOwnerStacks++;return f(R,J,G,!0,X?Error("react-stack-top-frame"):B,X?Y(r(R)):V)}})()),yr}var uc;function Zp(){return uc||(uc=1,process.env.NODE_ENV==="production"?go.exports=Wp():go.exports=Hp()),go.exports}var i=Zp();const Gp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),dc=e=>{const t=Yp(e);return t.charAt(0).toUpperCase()+t.slice(1)},du=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Kp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Jp={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 Xp=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},u)=>k.createElement("svg",{ref:u,...Jp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:du("lucide",o),...!s&&!Kp(c)&&{"aria-hidden":"true"},...c},[...a.map(([l,f])=>k.createElement(l,f)),...Array.isArray(s)?s:[s]]));const ye=(e,t)=>{const n=k.forwardRef(({className:r,...o},s)=>k.createElement(Xp,{ref:s,iconNode:t,className:du(`lucide-${Gp(dc(e))}`,`lucide-${e}`,r),...o}));return n.displayName=dc(e),n};const Qp=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ga=ye("arrow-left",Qp);const eh=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],th=ye("briefcase",eh);const nh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fu=ye("check",nh);const rh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mu=ye("chevron-down",rh);const oh=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sh=ye("chevron-right",oh);const ah=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ih=ye("chevron-up",ah);const ch=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lh=ye("circle-alert",ch);const uh=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],dh=ye("clipboard-list",uh);const fh=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mh=ye("clock",fh);const ph=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Er=ye("cloud",ph);const hh=[["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"}]],gh=ye("copy",hh);const yh=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jt=ye("database",yh);const bh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],vh=ye("download",bh);const xh=[["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"}]],Ya=ye("ellipsis-vertical",xh);const wh=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],_h=ye("folder-open",wh);const Sh=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Ka=ye("folder-tree",Sh);const Eh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ds=ye("globe",Eh);const kh=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],fs=ye("hard-drive",kh);const Nh=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ch=ye("history",Nh);const jh=[["path",{d:"M2 20h20",key:"owomy5"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}],["rect",{x:"3",y:"4",width:"18",height:"12",rx:"2",key:"8ur36m"}]],Rh=ye("laptop-minimal-check",jh);const Ah=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Th=ye("layout-dashboard",Ah);const Oh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],rt=ye("loader-circle",Oh);const Ph=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Dh=ye("lock",Ph);const $h=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Mh=ye("moon",$h);const Ih=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Tr=ye("package",Ih);const Fh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Lr=ye("pencil",Fh);const zh=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ja=ye("play",zh);const Lh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rt=ye("plus",Lh);const Vh=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Xa=ye("rotate-cw",Vh);const Bh=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Tn=ye("server",Bh);const Uh=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],qh=ye("settings",Uh);const Wh=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],pu=ye("shield",Wh);const Hh=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Zh=ye("sun",Hh);const Gh=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Yh=ye("terminal",Gh);const Kh=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Vr=ye("trash-2",Kh);const Jh=[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]],hu=ye("waypoints",Jh);const Xh=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ms=ye("x",Xh);function gu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=gu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=gu(e))&&(r&&(r+=" "),r+=t);return r}const Qh=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},eg=(e,t)=>({classGroupId:e,validator:t}),bu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vo="-",fc=[],tg="arbitrary..",ng=e=>{const t=og(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return rg(a);const c=a.split(Vo),u=c[0]===""&&c.length>1?1:0;return vu(c,u,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const u=r[a],l=n[a];return u?l?Qh(l,u):u:l||fc}return n[a]||fc}}},vu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const l=vu(e,t+1,s);if(l)return l}const a=n.validators;if(a===null)return;const c=t===0?e.join(Vo):e.slice(t).join(Vo),u=a.length;for(let l=0;l<u;l++){const f=a[l];if(f.validator(c))return f.classGroupId}},rg=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?tg+r:void 0})(),og=e=>{const{theme:t,classGroups:n}=e;return sg(n,t)},sg=(e,t)=>{const n=bu();for(const r in e){const o=e[r];Qa(o,n,r,t)}return n},Qa=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];ag(a,t,n,r)}},ag=(e,t,n,r)=>{if(typeof e=="string"){ig(e,t,n);return}if(typeof e=="function"){cg(e,t,n,r);return}lg(e,t,n,r)},ig=(e,t,n)=>{const r=e===""?t:xu(t,e);r.classGroupId=n},cg=(e,t,n,r)=>{if(ug(e)){Qa(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(eg(n,e))},lg=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[c,u]=o[a];Qa(u,xu(t,c),n,r)}},xu=(e,t)=>{let n=e;const r=t.split(Vo),o=r.length;for(let s=0;s<o;s++){const a=r[s];let c=n.nextPart.get(a);c||(c=bu(),n.nextPart.set(a,c)),n=c}return n},ug=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},pa="!",mc=":",fg=[],pc=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),mg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,c=0,u=0,l;const f=o.length;for(let y=0;y<f;y++){const b=o[y];if(a===0&&c===0){if(b===mc){s.push(o.slice(u,y)),u=y+1;continue}if(b==="/"){l=y;continue}}b==="["?a++:b==="]"?a--:b==="("?c++:b===")"&&c--}const d=s.length===0?o:o.slice(u);let p=d,h=!1;d.endsWith(pa)?(p=d.slice(0,-1),h=!0):d.startsWith(pa)&&(p=d.slice(1),h=!0);const g=l&&l>u?l-u:void 0;return pc(s,h,p,g)};if(t){const o=t+mc,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):pc(fg,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},pg=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],c=a[0]==="[",u=t.has(a);c||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},hg=e=>({cache:dg(e.cacheSize),parseClassName:mg(e),sortModifiers:pg(e),...ng(e)}),gg=/\s+/,yg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],c=e.trim().split(gg);let u="";for(let l=c.length-1;l>=0;l-=1){const f=c[l],{isExternal:d,modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:y}=n(f);if(d){u=f+(u.length>0?" "+u:u);continue}let b=!!y,v=r(b?g.substring(0,y):g);if(!v){if(!b){u=f+(u.length>0?" "+u:u);continue}if(v=r(g),!v){u=f+(u.length>0?" "+u:u);continue}b=!1}const w=p.length===0?"":p.length===1?p[0]:s(p).join(":"),S=h?w+pa:w,_=S+v;if(a.indexOf(_)>-1)continue;a.push(_);const N=o(v,b);for(let $=0;$<N.length;++$){const O=N[$];a.push(S+O)}u=f+(u.length>0?" "+u:u)}return u},bg=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=wu(n))&&(o&&(o+=" "),o+=r);return o},wu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wu(e[r]))&&(n&&(n+=" "),n+=t);return n},vg=(e,...t)=>{let n,r,o,s;const a=u=>{const l=t.reduce((f,d)=>d(f),e());return n=hg(l),r=n.cache.get,o=n.cache.set,s=c,c(u)},c=u=>{const l=r(u);if(l)return l;const f=yg(u,n);return o(u,f),f};return s=a,(...u)=>s(bg(...u))},xg=[],Ue=e=>{const t=n=>n[e]||xg;return t.isThemeGetter=!0,t},_u=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Su=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sg=/\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$/,Eg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ng=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,an=e=>wg.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),cn=e=>!!e&&Number.isInteger(Number(e)),Zs=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Wt=e=>_g.test(e),Eu=()=>!0,Cg=e=>Sg.test(e)&&!Eg.test(e),ei=()=>!1,jg=e=>kg.test(e),Rg=e=>Ng.test(e),Ag=e=>!ee(e)&&!te(e),Tg=e=>gn(e,Cu,ei),ee=e=>_u.test(e),En=e=>gn(e,ju,Cg),hc=e=>gn(e,zg,pe),Og=e=>gn(e,Au,Eu),Pg=e=>gn(e,Ru,ei),gc=e=>gn(e,ku,ei),Dg=e=>gn(e,Nu,Rg),yo=e=>gn(e,Tu,jg),te=e=>Su.test(e),br=e=>Ln(e,ju),$g=e=>Ln(e,Ru),yc=e=>Ln(e,ku),Mg=e=>Ln(e,Cu),Ig=e=>Ln(e,Nu),bo=e=>Ln(e,Tu,!0),Fg=e=>Ln(e,Au,!0),gn=(e,t,n)=>{const r=_u.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ln=(e,t,n=!1)=>{const r=Su.exec(e);return r?r[1]?t(r[1]):n:!1},ku=e=>e==="position"||e==="percentage",Nu=e=>e==="image"||e==="url",Cu=e=>e==="length"||e==="size"||e==="bg-size",ju=e=>e==="length",zg=e=>e==="number",Ru=e=>e==="family-name",Au=e=>e==="number"||e==="weight",Tu=e=>e==="shadow",Lg=()=>{const e=Ue("color"),t=Ue("font"),n=Ue("text"),r=Ue("font-weight"),o=Ue("tracking"),s=Ue("leading"),a=Ue("breakpoint"),c=Ue("container"),u=Ue("spacing"),l=Ue("radius"),f=Ue("shadow"),d=Ue("inset-shadow"),p=Ue("text-shadow"),h=Ue("drop-shadow"),g=Ue("blur"),y=Ue("perspective"),b=Ue("aspect"),v=Ue("ease"),w=Ue("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[..._(),te,ee],$=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[te,ee,u],W=()=>[an,"full","auto",...T()],H=()=>[cn,"none","subgrid",te,ee],ne=()=>["auto",{span:["full",cn,te,ee]},cn,te,ee],C=()=>[cn,"auto",te,ee],P=()=>["auto","min","max","fr",te,ee],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],q=()=>[an,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],B=()=>[an,"screen","full","dvw","lvw","svw","min","max","fit",...T()],V=()=>[an,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],F=()=>[e,te,ee],R=()=>[..._(),yc,gc,{position:[te,ee]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",Mg,Tg,{size:[te,ee]}],X=()=>[Zs,br,En],re=()=>["","none","full",l,te,ee],ce=()=>["",pe,br,En],I=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[pe,Zs,yc,gc],me=()=>["","none",g,te,ee],he=()=>["none",pe,te,ee],be=()=>["none",pe,te,ee],De=()=>[pe,te,ee],qe=()=>[an,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wt],breakpoint:[Wt],color:[Eu],container:[Wt],"drop-shadow":[Wt],ease:["in","out","in-out"],font:[Ag],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wt],shadow:[Wt],spacing:["px",pe],text:[Wt],"text-shadow":[Wt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",an,ee,te,b]}],container:["container"],columns:[{columns:[pe,ee,te,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:N()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{"inset-s":W(),start:W()}],end:[{"inset-e":W(),end:W()}],"inset-bs":[{"inset-bs":W()}],"inset-be":[{"inset-be":W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[cn,"auto",te,ee]}],basis:[{basis:[an,"full","auto",c,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,an,"auto","initial","none",ee]}],grow:[{grow:["",pe,te,ee]}],shrink:[{shrink:["",pe,te,ee]}],order:[{order:[cn,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,br,En]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Fg,Og]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zs,ee]}],"font-family":[{font:[$g,Pg,t]}],"font-features":[{"font-features":[ee]}],"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,te,ee]}],"line-clamp":[{"line-clamp":[pe,"none",te,hc]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",te,En]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pe,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],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",te,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cn,te,ee],radial:["",te,ee],conic:[cn,te,ee]},Ig,Dg]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,te,ee]}],"outline-w":[{outline:["",pe,br,En]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",f,bo,yo]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,bo,yo]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pe,En]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",p,bo,yo]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pe,te,ee]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:me()}],brightness:[{brightness:[pe,te,ee]}],contrast:[{contrast:[pe,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",h,bo,yo]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",pe,te,ee]}],"hue-rotate":[{"hue-rotate":[pe,te,ee]}],invert:[{invert:["",pe,te,ee]}],saturate:[{saturate:[pe,te,ee]}],sepia:[{sepia:["",pe,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[pe,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[pe,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",pe,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[pe,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[pe,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",te,ee]}],ease:[{ease:["linear","initial",v,te,ee]}],delay:[{delay:[pe,te,ee]}],animate:[{animate:["none",w,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,te,ee]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qe()}],"translate-x":[{"translate-x":qe()}],"translate-y":[{"translate-y":qe()}],"translate-z":[{"translate-z":qe()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",te,ee]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",te,ee]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[pe,br,En,hc]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},Vg=vg(Lg);function ae(...e){return Vg(yu(e))}const bc=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>u,subscribe:l=>(n.add(l),()=>n.delete(l))},u=t=e(r,o,c);return c},Bg=(e=>e?bc(e):bc),Ug=e=>e;function qg(e,t=Ug){const n=k.useSyncExternalStore(e.subscribe,k.useCallback(()=>t(e.getState()),[e,t]),k.useCallback(()=>t(e.getInitialState()),[e,t]));return k.useDebugValue(n),n}const vc=e=>{const t=Bg(e),n=r=>qg(t,r);return Object.assign(n,t),n},Wg=(e=>e?vc(e):vc),Hg="backupcore.theme";function xc(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(Hg,e)}const Zg=Wg((e,t)=>({mode:"light",setMode:n=>{xc(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";xc(n),e({mode:n})}})),Gg=[{to:"/",label:"Dashboard",icon:Th,end:!0},{to:"/jobs",label:"Backup Jobs",icon:th},{to:"/settings",label:"Settings",icon:qh}];function Ou(){const e=Be.useLocation(),{mode:t,toggle:n}=Zg();return i.jsxs("aside",{className:"sticky top-0 flex h-screen w-56 shrink-0 flex-col border-r border-border bg-sidebar px-3 py-5",children:[i.jsxs("div",{className:"mb-6 flex items-center gap-2.5 px-2 py-2",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border bg-background/80 shadow-sm",children:i.jsx(pu,{size:15,color:"currentColor",strokeWidth:2.2,className:"text-primary"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold leading-tight text-foreground",children:"Meyi Backup"}),i.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Backup Manager"})]})]}),i.jsx("nav",{className:"flex flex-1 flex-col gap-0.5",children:Gg.map(({to:r,label:o,icon:s,end:a})=>{const c=a?e.pathname===r||e.pathname==="":e.pathname===r||e.pathname.startsWith(r+"/");return i.jsxs(Pe,{to:r,className:ae("flex items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm transition-all",c?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[i.jsx(s,{size:16,strokeWidth:1.9}),i.jsx("span",{className:"flex-1",children:o})]},r)})}),i.jsxs("div",{className:"border-t border-border/50 pt-3 space-y-1",children:[i.jsxs("button",{onClick:n,className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm text-muted-foreground transition-all hover:bg-accent hover:text-accent-foreground",title:t==="dark"?"Switch to light mode":"Switch to dark mode",children:[t==="dark"?i.jsx(Zh,{size:15,strokeWidth:1.8}):i.jsx(Mh,{size:15,strokeWidth:1.8}),i.jsx("span",{children:t==="dark"?"Light Mode":"Dark Mode"})]}),i.jsxs("div",{className:"px-3 pb-1 text-[11px] text-muted-foreground",children:["Powered by ",i.jsx("span",{className:"text-primary",children:"Meyi Connect"})]})]})]})}function Yg(){return i.jsxs("div",{className:"flex min-h-screen bg-background",children:[i.jsx(Ou,{}),i.jsx("main",{className:"flex-1 min-w-0 overflow-auto px-1 py-1",children:i.jsx(Be.Outlet,{})})]})}const ti=()=>Ha.useDispatch(),ni=Ha.useSelector;function Pu(e,t){return function(){return e.apply(t,arguments)}}const{toString:Kg}=Object.prototype,{getPrototypeOf:ri}=Object,{iterator:ps,toStringTag:Du}=Symbol,hs=(e=>t=>{const n=Kg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=e=>(e=e.toLowerCase(),t=>hs(t)===e),gs=e=>t=>typeof t===e,{isArray:ir}=Array,or=gs("undefined");function Br(e){return e!==null&&!or(e)&&e.constructor!==null&&!or(e.constructor)&&it(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $u=Dt("ArrayBuffer");function Jg(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$u(e.buffer),t}const Xg=gs("string"),it=gs("function"),Mu=gs("number"),Ur=e=>e!==null&&typeof e=="object",Qg=e=>e===!0||e===!1,Oo=e=>{if(hs(e)!=="object")return!1;const t=ri(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Du in e)&&!(ps in e)},ey=e=>{if(!Ur(e)||Br(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ty=Dt("Date"),ny=Dt("File"),ry=e=>!!(e&&typeof e.uri<"u"),oy=e=>e&&typeof e.getParts<"u",sy=Dt("Blob"),ay=Dt("FileList"),iy=e=>Ur(e)&&it(e.pipe);function cy(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const wc=cy(),_c=typeof wc.FormData<"u"?wc.FormData:void 0,ly=e=>{let t;return e&&(_c&&e instanceof _c||it(e.append)&&((t=hs(e))==="formdata"||t==="object"&&it(e.toString)&&e.toString()==="[object FormData]"))},uy=Dt("URLSearchParams"),[dy,fy,my,py]=["ReadableStream","Request","Response","Headers"].map(Dt),hy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),ir(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Br(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let c;for(r=0;r<a;r++)c=s[r],t.call(null,e[c],c,e)}}function Iu(e,t){if(Br(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Rn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fu=e=>!or(e)&&e!==Rn;function ha(){const{caseless:e,skipUndefined:t}=Fu(this)&&this||{},n={},r=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=e&&Iu(n,s)||s;Oo(n[a])&&Oo(o)?n[a]=ha(n[a],o):Oo(o)?n[a]=ha({},o):ir(o)?n[a]=o.slice():(!t||!or(o))&&(n[a]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&qr(arguments[o],r);return n}const gy=(e,t,n,{allOwnKeys:r}={})=>(qr(t,(o,s)=>{n&&it(o)?Object.defineProperty(e,s,{value:Pu(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),yy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),by=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},vy=(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&ri(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wy=e=>{if(!e)return null;if(ir(e))return e;let t=e.length;if(!Mu(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_y=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ri(Uint8Array)),Sy=(e,t)=>{const r=(e&&e[ps]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Ey=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ky=Dt("HTMLFormElement"),Ny=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Sc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Cy=Dt("RegExp"),zu=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qr(n,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(r[s]=a||o)}),Object.defineProperties(e,r)},jy=e=>{zu(e,(t,n)=>{if(it(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(it(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ry=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return ir(e)?r(e):r(String(e).split(t)),n},Ay=()=>{},Ty=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Oy(e){return!!(e&&it(e.append)&&e[Du]==="FormData"&&e[ps])}const Py=e=>{const t=new Array(10),n=(r,o)=>{if(Ur(r)){if(t.indexOf(r)>=0)return;if(Br(r))return r;if(!("toJSON"in r)){t[o]=r;const s=ir(r)?[]:{};return qr(r,(a,c)=>{const u=n(a,o+1);!or(u)&&(s[c]=u)}),t[o]=void 0,s}}return r};return n(e,0)},Dy=Dt("AsyncFunction"),$y=e=>e&&(Ur(e)||it(e))&&it(e.then)&&it(e.catch),Lu=((e,t)=>e?setImmediate:t?((n,r)=>(Rn.addEventListener("message",({source:o,data:s})=>{o===Rn&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Rn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",it(Rn.postMessage)),My=typeof queueMicrotask<"u"?queueMicrotask.bind(Rn):typeof process<"u"&&process.nextTick||Lu,Iy=e=>e!=null&&it(e[ps]),j={isArray:ir,isArrayBuffer:$u,isBuffer:Br,isFormData:ly,isArrayBufferView:Jg,isString:Xg,isNumber:Mu,isBoolean:Qg,isObject:Ur,isPlainObject:Oo,isEmptyObject:ey,isReadableStream:dy,isRequest:fy,isResponse:my,isHeaders:py,isUndefined:or,isDate:ty,isFile:ny,isReactNativeBlob:ry,isReactNative:oy,isBlob:sy,isRegExp:Cy,isFunction:it,isStream:iy,isURLSearchParams:uy,isTypedArray:_y,isFileList:ay,forEach:qr,merge:ha,extend:gy,trim:hy,stripBOM:yy,inherits:by,toFlatObject:vy,kindOf:hs,kindOfTest:Dt,endsWith:xy,toArray:wy,forEachEntry:Sy,matchAll:Ey,isHTMLForm:ky,hasOwnProperty:Sc,hasOwnProp:Sc,reduceDescriptors:zu,freezeMethods:jy,toObjectSet:Ry,toCamelCase:Ny,noop:Ay,toFiniteNumber:Ty,findKey:Iu,global:Rn,isContextDefined:Fu,isSpecCompliantForm:Oy,toJSONObject:Py,isAsyncFn:Dy,isThenable:$y,setImmediate:Lu,asap:My,isIterable:Iy};let ue=class Vu extends Error{static from(t,n,r,o,s,a){const c=new Vu(t.message,n||t.code,r,o,s);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),a&&Object.assign(c,a),c}constructor(t,n,r,o,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}};ue.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ue.ERR_BAD_OPTION="ERR_BAD_OPTION";ue.ECONNABORTED="ECONNABORTED";ue.ETIMEDOUT="ETIMEDOUT";ue.ERR_NETWORK="ERR_NETWORK";ue.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ue.ERR_DEPRECATED="ERR_DEPRECATED";ue.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ue.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ue.ERR_CANCELED="ERR_CANCELED";ue.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ue.ERR_INVALID_URL="ERR_INVALID_URL";const Fy=null;function ga(e){return j.isPlainObject(e)||j.isArray(e)}function Bu(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function Gs(e,t,n){return e?e.concat(t).map(function(o,s){return o=Bu(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function zy(e){return j.isArray(e)&&!e.some(ga)}const Ly=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function ys(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!j.isUndefined(b[y])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(j.isDate(g))return g.toISOString();if(j.isBoolean(g))return g.toString();if(!u&&j.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(g)||j.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function f(g,y,b){let v=g;if(j.isReactNative(t)&&j.isReactNativeBlob(g))return t.append(Gs(b,y,s),l(g)),!1;if(g&&!b&&typeof g=="object"){if(j.endsWith(y,"{}"))y=r?y:y.slice(0,-2),g=JSON.stringify(g);else if(j.isArray(g)&&zy(g)||(j.isFileList(g)||j.endsWith(y,"[]"))&&(v=j.toArray(g)))return y=Bu(y),v.forEach(function(S,_){!(j.isUndefined(S)||S===null)&&t.append(a===!0?Gs([y],_,s):a===null?y:y+"[]",l(S))}),!1}return ga(g)?!0:(t.append(Gs(b,y,s),l(g)),!1)}const d=[],p=Object.assign(Ly,{defaultVisitor:f,convertValue:l,isVisitable:ga});function h(g,y){if(!j.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(g),j.forEach(g,function(v,w){(!(j.isUndefined(v)||v===null)&&o.call(t,v,j.isString(w)?w.trim():w,y,p))===!0&&h(v,y?y.concat(w):[w])}),d.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Ec(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oi(e,t){this._pairs=[],e&&ys(e,this,t)}const Uu=oi.prototype;Uu.append=function(t,n){this._pairs.push([t,n])};Uu.toString=function(t){const n=t?function(r){return t.call(this,r,Ec)}:Ec;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Vy(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qu(e,t,n){if(!t)return e;const r=n&&n.encode||Vy,o=j.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let a;if(s?a=s(t,o):a=j.isURLSearchParams(t)?t.toString():new oi(t,o).toString(r),a){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class kc{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const si={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},By=typeof URLSearchParams<"u"?URLSearchParams:oi,Uy=typeof FormData<"u"?FormData:null,qy=typeof Blob<"u"?Blob:null,Wy={isBrowser:!0,classes:{URLSearchParams:By,FormData:Uy,Blob:qy},protocols:["http","https","file","blob","url","data"]},ai=typeof window<"u"&&typeof document<"u",ya=typeof navigator=="object"&&navigator||void 0,Hy=ai&&(!ya||["ReactNative","NativeScript","NS"].indexOf(ya.product)<0),Zy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gy=ai&&window.location.href||"http://localhost",Yy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ai,hasStandardBrowserEnv:Hy,hasStandardBrowserWebWorkerEnv:Zy,navigator:ya,origin:Gy},Symbol.toStringTag,{value:"Module"})),Je={...Yy,...Wy};function Ky(e,t){return ys(e,new Je.classes.URLSearchParams,{visitor:function(n,r,o,s){return Je.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Jy(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xy(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Wu(e){function t(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),u=s>=n.length;return a=!a&&j.isArray(o)?o.length:a,u?(j.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!c):((!o[a]||!j.isObject(o[a]))&&(o[a]=[]),t(n,r,o[a],s)&&j.isArray(o[a])&&(o[a]=Xy(o[a])),!c)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,o)=>{t(Jy(r),o,n,0)}),n}return null}function Qy(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wr={transitional:si,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=j.isObject(t);if(s&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(Wu(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ky(t,this.formSerializer).toString();if((c=j.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ys(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Qy(t)):t}],transformResponse:[function(t){const n=this.transitional||Wr.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?ue.from(c,ue.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Wr.headers[e]={}});const eb=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tb=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
7
|
+
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&eb[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Nc=Symbol("internals");function vr(e){return e&&String(e).trim().toLowerCase()}function Po(e){return e===!1||e==null?e:j.isArray(e)?e.map(Po):String(e)}function nb(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const rb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ys(e,t,n,r,o){if(j.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function ob(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function sb(e,t){const n=j.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,a){return this[r].call(this,t,o,s,a)},configurable:!0})})}let ct=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(c,u,l){const f=vr(u);if(!f)throw new Error("header name must be a non-empty string");const d=j.findKey(o,f);(!d||o[d]===void 0||l===!0||l===void 0&&o[d]!==!1)&&(o[d||u]=Po(c))}const a=(c,u)=>j.forEach(c,(l,f)=>s(l,f,u));if(j.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(j.isString(t)&&(t=t.trim())&&!rb(t))a(tb(t),n);else if(j.isObject(t)&&j.isIterable(t)){let c={},u,l;for(const f of t){if(!j.isArray(f))throw TypeError("Object iterator must return a key-value pair");c[l=f[0]]=(u=c[l])?j.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}a(c,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=vr(t),t){const r=j.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return nb(o);if(j.isFunction(n))return n.call(this,o,r);if(j.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=vr(t),t){const r=j.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ys(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(a){if(a=vr(a),a){const c=j.findKey(r,a);c&&(!n||Ys(r,r[c],c,n))&&(delete r[c],o=!0)}}return j.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Ys(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return j.forEach(this,(o,s)=>{const a=j.findKey(r,s);if(a){n[a]=Po(o),delete n[s];return}const c=t?ob(s):String(s).trim();c!==s&&delete n[s],n[c]=Po(o),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return j.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&j.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
8
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Nc]=this[Nc]={accessors:{}}).accessors,o=this.prototype;function s(a){const c=vr(a);r[c]||(sb(o,a),r[c]=!0)}return j.isArray(t)?t.forEach(s):s(t),this}};ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);j.reduceDescriptors(ct.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});j.freezeMethods(ct);function Ks(e,t){const n=this||Wr,r=t||n,o=ct.from(r.headers);let s=r.data;return j.forEach(e,function(c){s=c.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Hu(e){return!!(e&&e.__CANCEL__)}let Hr=class extends ue{constructor(t,n,r){super(t??"canceled",ue.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Zu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ab(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ib(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=r[s];a||(a=l),n[o]=u,r[o]=l;let d=s,p=0;for(;d!==o;)p+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const h=f&&l-f;return h?Math.round(p*1e3/h):void 0}}function cb(e,t){let n=0,r=1e3/t,o,s;const a=(l,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const f=Date.now(),d=f-n;d>=r?a(l,f):(o=l,s||(s=setTimeout(()=>{s=null,a(o)},r-d)))},()=>o&&a(o)]}const Bo=(e,t,n=3)=>{let r=0;const o=ib(50,250);return cb(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,u=a-r,l=o(u),f=a<=c;r=a;const d={loaded:a,total:c,progress:c?a/c:void 0,bytes:u,rate:l||void 0,estimated:l&&c&&f?(c-a)/l:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Cc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jc=e=>(...t)=>j.asap(()=>e(...t)),lb=Je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,ub=Je.hasStandardBrowserEnv?{write(e,t,n,r,o,s,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];j.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),j.isString(r)&&c.push(`path=${r}`),j.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),j.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function db(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fb(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Gu(e,t,n){let r=!db(t);return e&&(r||n==!1)?fb(e,t):t}const Rc=e=>e instanceof ct?{...e}:e;function Pn(e,t){t=t||{};const n={};function r(l,f,d,p){return j.isPlainObject(l)&&j.isPlainObject(f)?j.merge.call({caseless:p},l,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function o(l,f,d,p){if(j.isUndefined(f)){if(!j.isUndefined(l))return r(void 0,l,d,p)}else return r(l,f,d,p)}function s(l,f){if(!j.isUndefined(f))return r(void 0,f)}function a(l,f){if(j.isUndefined(f)){if(!j.isUndefined(l))return r(void 0,l)}else return r(void 0,f)}function c(l,f,d){if(d in t)return r(l,f);if(d in e)return r(void 0,l)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(l,f,d)=>o(Rc(l),Rc(f),d,!0)};return j.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const d=j.hasOwnProp(u,f)?u[f]:o,p=d(e[f],t[f],f);j.isUndefined(p)&&d!==c||(n[f]=p)}),n}const Yu=e=>{const t=Pn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=ct.from(a),t.url=qu(Gu(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),j.isFormData(n)){if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(j.isFunction(n.getHeaders)){const u=n.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,d])=>{l.includes(f.toLowerCase())&&a.set(f,d)})}}if(Je.hasStandardBrowserEnv&&(r&&j.isFunction(r)&&(r=r(t)),r||r!==!1&&lb(t.url))){const u=o&&s&&ub.read(s);u&&a.set(o,u)}return t},mb=typeof XMLHttpRequest<"u",pb=mb&&function(e){return new Promise(function(n,r){const o=Yu(e);let s=o.data;const a=ct.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:l}=o,f,d,p,h,g;function y(){h&&h(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function v(){if(!b)return;const S=ct.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),N={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};Zu(function(O){n(O),y()},function(O){r(O),y()},N),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(r(new ue("Request aborted",ue.ECONNABORTED,e,b)),b=null)},b.onerror=function(_){const N=_&&_.message?_.message:"Network Error",$=new ue(N,ue.ERR_NETWORK,e,b);$.event=_||null,r($),b=null},b.ontimeout=function(){let _=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const N=o.transitional||si;o.timeoutErrorMessage&&(_=o.timeoutErrorMessage),r(new ue(_,N.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,b)),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&j.forEach(a.toJSON(),function(_,N){b.setRequestHeader(N,_)}),j.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),c&&c!=="json"&&(b.responseType=o.responseType),l&&([p,g]=Bo(l,!0),b.addEventListener("progress",p)),u&&b.upload&&([d,h]=Bo(u),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(f=S=>{b&&(r(!S||S.type?new Hr(null,e,b):S),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const w=ab(o.url);if(w&&Je.protocols.indexOf(w)===-1){r(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,e));return}b.send(s||null)})},hb=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(l){if(!o){o=!0,c();const f=l instanceof Error?l:this.reason;r.abort(f instanceof ue?f:new Hr(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,s(new ue(`timeout of ${t}ms exceeded`,ue.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>j.asap(c),u}},gb=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},yb=async function*(e,t){for await(const n of bb(e))yield*gb(n,t)},bb=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ac=(e,t,n,r)=>{const o=yb(e,t);let s=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){c(),u.close();return}let d=f.byteLength;if(n){let p=s+=d;n(p)}u.enqueue(new Uint8Array(f))}catch(l){throw c(l),l}},cancel(u){return c(u),o.return()}},{highWaterMark:2})},Tc=64*1024,{isFunction:vo}=j,vb=(({Request:e,Response:t})=>({Request:e,Response:t}))(j.global),{ReadableStream:Oc,TextEncoder:Pc}=j.global,Dc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xb=e=>{e=j.merge.call({skipUndefined:!0},vb,e);const{fetch:t,Request:n,Response:r}=e,o=t?vo(t):typeof fetch=="function",s=vo(n),a=vo(r);if(!o)return!1;const c=o&&vo(Oc),u=o&&(typeof Pc=="function"?(g=>y=>g.encode(y))(new Pc):async g=>new Uint8Array(await new n(g).arrayBuffer())),l=s&&c&&Dc(()=>{let g=!1;const y=new n(Je.origin,{body:new Oc,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!y}),f=a&&c&&Dc(()=>j.isReadableStream(new r("").body)),d={stream:f&&(g=>g.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!d[g]&&(d[g]=(y,b)=>{let v=y&&y[g];if(v)return v.call(y);throw new ue(`Response type '${g}' is not supported`,ue.ERR_NOT_SUPPORT,b)})});const p=async g=>{if(g==null)return 0;if(j.isBlob(g))return g.size;if(j.isSpecCompliantForm(g))return(await new n(Je.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(j.isArrayBufferView(g)||j.isArrayBuffer(g))return g.byteLength;if(j.isURLSearchParams(g)&&(g=g+""),j.isString(g))return(await u(g)).byteLength},h=async(g,y)=>{const b=j.toFiniteNumber(g.getContentLength());return b??p(y)};return async g=>{let{url:y,method:b,data:v,signal:w,cancelToken:S,timeout:_,onDownloadProgress:N,onUploadProgress:$,responseType:O,headers:T,withCredentials:W="same-origin",fetchOptions:H}=Yu(g),ne=t||fetch;O=O?(O+"").toLowerCase():"text";let C=hb([w,S&&S.toAbortSignal()],_),P=null;const z=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let Y;try{if($&&l&&b!=="get"&&b!=="head"&&(Y=await h(T,v))!==0){let R=new n(y,{method:"POST",body:v,duplex:"half"}),J;if(j.isFormData(v)&&(J=R.headers.get("content-type"))&&T.setContentType(J),R.body){const[G,X]=Cc(Y,Bo(jc($)));v=Ac(R.body,Tc,G,X)}}j.isString(W)||(W=W?"include":"omit");const D=s&&"credentials"in n.prototype,q={...H,signal:C,method:b.toUpperCase(),headers:T.normalize().toJSON(),body:v,duplex:"half",credentials:D?W:void 0};P=s&&new n(y,q);let B=await(s?ne(P,H):ne(y,q));const V=f&&(O==="stream"||O==="response");if(f&&(N||V&&z)){const R={};["status","statusText","headers"].forEach(re=>{R[re]=B[re]});const J=j.toFiniteNumber(B.headers.get("content-length")),[G,X]=N&&Cc(J,Bo(jc(N),!0))||[];B=new r(Ac(B.body,Tc,G,()=>{X&&X(),z&&z()}),R)}O=O||"text";let F=await d[j.findKey(d,O)||"text"](B,g);return!V&&z&&z(),await new Promise((R,J)=>{Zu(R,J,{data:F,headers:ct.from(B.headers),status:B.status,statusText:B.statusText,config:g,request:P})})}catch(D){throw z&&z(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,g,P,D&&D.response),{cause:D.cause||D}):ue.from(D,D&&D.code,g,P,D&&D.response)}}},wb=new Map,Ku=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let a=s.length,c=a,u,l,f=wb;for(;c--;)u=s[c],l=f.get(u),l===void 0&&f.set(u,l=c?new Map:xb(t)),f=l;return l};Ku();const ii={http:Fy,xhr:pb,fetch:{get:Ku}};j.forEach(ii,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $c=e=>`- ${e}`,_b=e=>j.isFunction(e)||e===null||e===!1;function Sb(e,t){e=j.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let a=0;a<n;a++){r=e[a];let c;if(o=r,!_b(r)&&(o=ii[(c=String(r)).toLowerCase()],o===void 0))throw new ue(`Unknown adapter '${c}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;s[c||"#"+a]=o}if(!o){const a=Object.entries(s).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
9
|
+
`+a.map($c).join(`
|
|
10
|
+
`):" "+$c(a[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const Ju={getAdapter:Sb,adapters:ii};function Js(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Hr(null,e)}function Mc(e){return Js(e),e.headers=ct.from(e.headers),e.data=Ks.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ju.getAdapter(e.adapter||Wr.adapter,e)(e).then(function(r){return Js(e),r.data=Ks.call(e,e.transformResponse,r),r.headers=ct.from(r.headers),r},function(r){return Hu(r)||(Js(e),r&&r.response&&(r.response.data=Ks.call(e,e.transformResponse,r.response),r.response.headers=ct.from(r.response.headers))),Promise.reject(r)})}const Xu="1.13.6",bs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bs[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ic={};bs.transitional=function(t,n,r){function o(s,a){return"[Axios v"+Xu+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(t===!1)throw new ue(o(a," has been removed"+(n?" in "+n:"")),ue.ERR_DEPRECATED);return n&&!Ic[a]&&(Ic[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,c):!0}};bs.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Eb(e,t,n){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],a=t[s];if(a){const c=e[s],u=c===void 0||a(c,s,e);if(u!==!0)throw new ue("option "+s+" must be "+u,ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ue("Unknown option "+s,ue.ERR_BAD_OPTION)}}const Do={assertOptions:Eb,validators:bs},gt=Do.validators;let On=class{constructor(t){this.defaults=t||{},this.interceptors={request:new kc,response:new kc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
11
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Do.assertOptions(r,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean),legacyInterceptorReqResOrdering:gt.transitional(gt.boolean)},!1),o!=null&&(j.isFunction(o)?n.paramsSerializer={serialize:o}:Do.assertOptions(o,{encode:gt.function,serialize:gt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Do.assertOptions(n,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&j.merge(s.common,s[n.method]);s&&j.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=ct.concat(a,s);const c=[];let u=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(n)===!1)return;u=u&&y.synchronous;const b=n.transitional||si;b&&b.legacyInterceptorReqResOrdering?c.unshift(y.fulfilled,y.rejected):c.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let f,d=0,p;if(!u){const g=[Mc.bind(this),void 0];for(g.unshift(...c),g.push(...l),p=g.length,f=Promise.resolve(n);d<p;)f=f.then(g[d++],g[d++]);return f}p=c.length;let h=n;for(;d<p;){const g=c[d++],y=c[d++];try{h=g(h)}catch(b){y.call(this,b);break}}try{f=Mc.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,p=l.length;d<p;)f=f.then(l[d++],l[d++]);return f}getUri(t){t=Pn(this.defaults,t);const n=Gu(t.baseURL,t.url,t.allowAbsoluteUrls);return qu(n,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){On.prototype[t]=function(n,r){return this.request(Pn(r||{},{method:t,url:n,data:(r||{}).data}))}});j.forEach(["post","put","patch"],function(t){function n(r){return function(s,a,c){return this.request(Pn(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}On.prototype[t]=n(),On.prototype[t+"Form"]=n(!0)});let kb=class Qu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,c){r.reason||(r.reason=new Hr(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Qu(function(o){t=o}),cancel:t}}};function Nb(e){return function(n){return e.apply(null,n)}}function Cb(e){return j.isObject(e)&&e.isAxiosError===!0}const ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ba).forEach(([e,t])=>{ba[t]=e});function ed(e){const t=new On(e),n=Pu(On.prototype.request,t);return j.extend(n,On.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ed(Pn(e,o))},n}const Me=ed(Wr);Me.Axios=On;Me.CanceledError=Hr;Me.CancelToken=kb;Me.isCancel=Hu;Me.VERSION=Xu;Me.toFormData=ys;Me.AxiosError=ue;Me.Cancel=Me.CanceledError;Me.all=function(t){return Promise.all(t)};Me.spread=Nb;Me.isAxiosError=Cb;Me.mergeConfig=Pn;Me.AxiosHeaders=ct;Me.formToJSON=e=>Wu(j.isHTMLForm(e)?new FormData(e):e);Me.getAdapter=Ju.getAdapter;Me.HttpStatusCode=ba;Me.default=Me;const{Axios:qR,AxiosError:WR,CanceledError:HR,isCancel:ZR,CancelToken:GR,VERSION:YR,all:KR,Cancel:JR,isAxiosError:XR,spread:QR,toFormData:eA,AxiosHeaders:tA,HttpStatusCode:nA,formToJSON:rA,getAdapter:oA,mergeConfig:sA}=Me,jb={apiBase:"/api"},fe=Me.create({baseURL:jb.apiBase,headers:{"Content-Type":"application/json"}});fe.interceptors.request.use(e=>{const t=localStorage.getItem("access_token");return t&&(e.headers.Authorization=`Bearer ${t}`),e});fe.interceptors.response.use(e=>e.data,e=>Promise.reject(e.response?.data||e));function td(e){e?fe.defaults.headers.common.Authorization=`Bearer ${e}`:delete fe.defaults.headers.common.Authorization}const He={getAll:()=>fe.get("/jobs"),get:e=>fe.get(`/jobs/${e}`),create:e=>fe.post("/jobs",e),update:(e,t)=>fe.put(`/jobs/${e}`,t),delete:e=>fe.delete(`/jobs/${e}`),run:e=>fe.post(`/jobs/${e}/run`),getRuns:e=>fe.get(`/jobs/${e}/runs`),getSnapshots:e=>fe.get(`/jobs/${e}/snapshots`)},Rb={getAll:()=>fe.get("/runs")},Ab={get:()=>fe.get("/dashboard")},Tb={list:[],current:null,runs:[],loading:!1,error:null},Xn=Ce.createAsyncThunk("jobs/fetchAll",async()=>await He.getAll()),Ob=Ce.createAsyncThunk("jobs/fetchOne",async e=>await He.get(e)),Pb=Ce.createAsyncThunk("jobs/create",async e=>await He.create(e)),Db=Ce.createAsyncThunk("jobs/update",async({id:e,data:t})=>await He.update(e,t)),nd=Ce.createAsyncThunk("jobs/delete",async e=>(await He.delete(e),e)),$b=Ce.createAsyncThunk("jobs/run",async e=>await He.run(e)),Mb=Ce.createAsyncThunk("jobs/fetchRuns",async e=>await He.getRuns(e)),Ib=Ce.createSlice({name:"jobs",initialState:Tb,reducers:{},extraReducers:e=>{e.addCase(Xn.pending,t=>{t.loading=!0,t.error=null}).addCase(Xn.fulfilled,(t,n)=>{t.loading=!1,t.list=Array.isArray(n.payload)?n.payload:[]}).addCase(Xn.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch jobs"}).addCase(Ob.fulfilled,(t,n)=>{t.current=n.payload}).addCase(Pb.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(Db.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(nd.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}).addCase(Mb.fulfilled,(t,n)=>{t.runs=n.payload})}}),Fb=Ib.reducer,rd=6048e5,zb=864e5,xo=43200,Fc=1440,zc=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&zc in e?e[zc](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ze(e,t){return Jt(t||e,e)}let Lb={};function Zr(){return Lb}function Or(e,t){const n=Zr(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ze(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Uo(e,t){return Or(e,{...t,weekStartsOn:1})}function od(e,t){const n=Ze(e,t?.in),r=n.getFullYear(),o=Jt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Uo(o),a=Jt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const c=Uo(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function qo(e){const t=Ze(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function vs(e,...t){const n=Jt.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Lc(e,t){const n=Ze(e,t?.in);return n.setHours(0,0,0,0),n}function Vb(e,t,n){const[r,o]=vs(n?.in,e,t),s=Lc(r),a=Lc(o),c=+s-qo(s),u=+a-qo(a);return Math.round((c-u)/zb)}function Bb(e,t){const n=od(e,t),r=Jt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Uo(r)}function $o(e,t){const n=+Ze(e)-+Ze(t);return n<0?-1:n>0?1:n}function Ub(e){return Jt(e,Date.now())}function qb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Wb(e){return!(!qb(e)&&typeof e!="number"||isNaN(+Ze(e)))}function Hb(e,t,n){const[r,o]=vs(n?.in,e,t),s=r.getFullYear()-o.getFullYear(),a=r.getMonth()-o.getMonth();return s*12+a}function Zb(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gb(e,t){return+Ze(e)-+Ze(t)}function Yb(e,t){const n=Ze(e,t?.in);return n.setHours(23,59,59,999),n}function Kb(e,t){const n=Ze(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Jb(e,t){const n=Ze(e,t?.in);return+Yb(n,t)==+Kb(n,t)}function Xb(e,t,n){const[r,o,s]=vs(n?.in,e,e,t),a=$o(o,s),c=Math.abs(Hb(o,s));if(c<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-a*c);let u=$o(o,s)===-a;Jb(r)&&c===1&&$o(r,s)===1&&(u=!1);const l=a*(c-+u);return l===0?0:l}function Qb(e,t,n){const r=Gb(e,t)/1e3;return Zb(n?.roundingMethod)(r)}function ev(e,t){const n=Ze(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const tv={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nv=(e,t,n)=>{let r;const o=tv[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Xs(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ov={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},av={date:Xs({formats:rv,defaultWidth:"full"}),time:Xs({formats:ov,defaultWidth:"full"}),dateTime:Xs({formats:sv,defaultWidth:"full"})},iv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cv=(e,t,n,r)=>iv[e];function xr(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;o=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const lv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dv={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fv={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pv={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hv=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gv={ordinalNumber:hv,era:xr({values:lv,defaultWidth:"wide"}),quarter:xr({values:uv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xr({values:dv,defaultWidth:"wide"}),day:xr({values:fv,defaultWidth:"wide"}),dayPeriod:xr({values:mv,defaultWidth:"wide",formattingValues:pv,defaultFormattingWidth:"wide"})};function wr(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?bv(c,d=>d.test(a)):yv(c,d=>d.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(a.length);return{value:l,rest:f}}}function yv(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bv(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vv(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(o.length);return{value:a,rest:c}}}const xv=/^(\d+)(th|st|nd|rd)?/i,wv=/\d+/i,_v={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sv={any:[/^b/i,/^(a|c)/i]},Ev={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kv={any:[/1/i,/2/i,/3/i,/4/i]},Nv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Cv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Rv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Av={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Tv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ov={ordinalNumber:vv({matchPattern:xv,parsePattern:wv,valueCallback:e=>parseInt(e,10)}),era:wr({matchPatterns:_v,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any"}),quarter:wr({matchPatterns:Ev,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wr({matchPatterns:Nv,defaultMatchWidth:"wide",parsePatterns:Cv,defaultParseWidth:"any"}),day:wr({matchPatterns:jv,defaultMatchWidth:"wide",parsePatterns:Rv,defaultParseWidth:"any"}),dayPeriod:wr({matchPatterns:Av,defaultMatchWidth:"any",parsePatterns:Tv,defaultParseWidth:"any"})},sd={code:"en-US",formatDistance:nv,formatLong:av,formatRelative:cv,localize:gv,match:Ov,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pv(e,t){const n=Ze(e,t?.in);return Vb(n,ev(n))+1}function Dv(e,t){const n=Ze(e,t?.in),r=+Uo(n)-+Bb(n);return Math.round(r/rd)+1}function ad(e,t){const n=Ze(e,t?.in),r=n.getFullYear(),o=Zr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=Jt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const c=Or(a,t),u=Jt(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const l=Or(u,t);return+n>=+c?r+1:+n>=+l?r:r-1}function $v(e,t){const n=Zr(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=ad(e,t),s=Jt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Or(s,t)}function Mv(e,t){const n=Ze(e,t?.in),r=+Or(n,t)-+$v(n,t);return Math.round(r/rd)+1}function Se(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ln={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Se(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Se(n+1,2)},d(e,t){return Se(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Se(e.getHours()%12||12,t.length)},H(e,t){return Se(e.getHours(),t.length)},m(e,t){return Se(e.getMinutes(),t.length)},s(e,t){return Se(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Se(o,t.length)}},Wn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Vc={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ln.y(e,t)},Y:function(e,t,n,r){const o=ad(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return Se(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Se(s,t.length)},R:function(e,t){const n=od(e);return Se(n,t.length)},u:function(e,t){const n=e.getFullYear();return Se(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Se(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Se(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ln.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Se(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Mv(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Se(o,t.length)},I:function(e,t,n){const r=Dv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Se(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ln.d(e,t)},D:function(e,t,n){const r=Pv(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Se(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Se(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Se(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Se(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Wn.noon:r===0?o=Wn.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Wn.evening:r>=12?o=Wn.afternoon:r>=4?o=Wn.morning:o=Wn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ln.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ln.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ln.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ln.s(e,t)},S:function(e,t){return ln.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Uc(r);case"XXXX":case"XX":return jn(r);default:return jn(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Uc(r);case"xxxx":case"xx":return jn(r);default:return jn(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bc(r,":");default:return"GMT"+jn(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bc(r,":");default:return"GMT"+jn(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Se(r,t.length)},T:function(e,t,n){return Se(+e,t.length)}};function Bc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Se(s,2)}function Uc(e,t){return e%60===0?(e>0?"-":"+")+Se(Math.abs(e)/60,2):jn(e,t)}function jn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Se(Math.trunc(r/60),2),s=Se(r%60,2);return n+o+t+s}const qc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},id=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Iv=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return qc(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",qc(r,t)).replace("{{time}}",id(o,t))},Fv={p:id,P:Iv},zv=/^D+$/,Lv=/^Y+$/,Vv=["D","DD","YY","YYYY"];function Bv(e){return zv.test(e)}function Uv(e){return Lv.test(e)}function qv(e,t,n){const r=Wv(e,t,n);if(console.warn(r),Vv.includes(e))throw new RangeError(r)}function Wv(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Hv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gv=/^'([^]*?)'?$/,Yv=/''/g,Kv=/[a-zA-Z]/;function Jv(e,t,n){const r=Zr(),o=r.locale??sd,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=Ze(e,n?.in);if(!Wb(c))throw new RangeError("Invalid time value");let u=t.match(Zv).map(f=>{const d=f[0];if(d==="p"||d==="P"){const p=Fv[d];return p(f,o.formatLong)}return f}).join("").match(Hv).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const d=f[0];if(d==="'")return{isToken:!1,value:Xv(f)};if(Vc[d])return{isToken:!0,value:f};if(d.match(Kv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:f}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return u.map(f=>{if(!f.isToken)return f.value;const d=f.value;(Uv(d)||Bv(d))&&qv(d,t,String(e));const p=Vc[d[0]];return p(c,d,o.localize,l)}).join("")}function Xv(e){const t=e.match(Gv);return t?t[1].replace(Yv,"'"):e}function Qv(e,t,n){const r=Zr(),o=n?.locale??r.locale??sd,s=2520,a=$o(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const c=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[u,l]=vs(n?.in,...a>0?[t,e]:[e,t]),f=Qb(l,u),d=(qo(l)-qo(u))/1e3,p=Math.round((f-d)/60);let h;if(p<2)return n?.includeSeconds?f<5?o.formatDistance("lessThanXSeconds",5,c):f<10?o.formatDistance("lessThanXSeconds",10,c):f<20?o.formatDistance("lessThanXSeconds",20,c):f<40?o.formatDistance("halfAMinute",0,c):f<60?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",1,c):p===0?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",p,c);if(p<45)return o.formatDistance("xMinutes",p,c);if(p<90)return o.formatDistance("aboutXHours",1,c);if(p<Fc){const g=Math.round(p/60);return o.formatDistance("aboutXHours",g,c)}else{if(p<s)return o.formatDistance("xDays",1,c);if(p<xo){const g=Math.round(p/Fc);return o.formatDistance("xDays",g,c)}else if(p<xo*2)return h=Math.round(p/xo),o.formatDistance("aboutXMonths",h,c)}if(h=Xb(l,u),h<12){const g=Math.round(p/xo);return o.formatDistance("xMonths",g,c)}else{const g=h%12,y=Math.trunc(h/12);return g<3?o.formatDistance("aboutXYears",y,c):g<9?o.formatDistance("overXYears",y,c):o.formatDistance("almostXYears",y+1,c)}}function ex(e,t){return Qv(e,Ub(e),t)}function Wo({className:e,...t}){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:ae(e),...t,children:i.jsx("path",{fill:"#FF9900",d:"M 20.455 5.412 C 20.104 5.412 19.769 5.453 19.449 5.549 C 19.13 5.645 18.858 5.781 18.619 5.965 C 18.38 6.141 18.189 6.363 18.045 6.619 C 17.901 6.874 17.828 7.171 17.828 7.506 C 17.828 7.921 17.964 8.311 18.227 8.662 C 18.49 9.021 18.921 9.294 19.504 9.477 L 20.66 9.836 C 21.051 9.964 21.323 10.098 21.467 10.25 C 21.611 10.402 21.682 10.585 21.682 10.809 C 21.682 11.136 21.539 11.391 21.268 11.566 C 20.997 11.742 20.604 11.83 20.102 11.83 C 19.783 11.83 19.471 11.798 19.152 11.734 C 18.841 11.67 18.544 11.574 18.273 11.455 C 18.193 11.423 18.122 11.391 18.074 11.375 C 18.026 11.359 17.978 11.352 17.93 11.352 C 17.81 11.352 17.746 11.431 17.746 11.598 L 17.746 12.006 C 17.746 12.078 17.763 12.158 17.795 12.229 C 17.828 12.304 17.916 12.381 18.043 12.453 C 18.251 12.573 18.562 12.677 18.961 12.773 C 19.36 12.869 19.774 12.918 20.189 12.918 C 20.596 12.918 20.971 12.86 21.33 12.748 C 21.673 12.644 21.97 12.503 22.217 12.303 C 22.464 12.111 22.655 11.871 22.799 11.6 C 22.935 11.329 23.008 11.017 23.008 10.674 C 23.008 10.259 22.888 9.884 22.641 9.557 C 22.394 9.23 21.977 8.974 21.402 8.791 L 20.27 8.432 C 19.847 8.296 19.553 8.144 19.393 7.992 C 19.233 7.84 19.152 7.65 19.152 7.426 C 19.152 7.099 19.28 6.868 19.527 6.717 C 19.774 6.565 20.135 6.492 20.59 6.492 C 21.157 6.492 21.668 6.598 22.123 6.805 C 22.259 6.869 22.362 6.9 22.426 6.9 C 22.546 6.9 22.609 6.812 22.609 6.645 L 22.609 6.268 C 22.609 6.156 22.585 6.069 22.537 6.006 C 22.489 5.934 22.41 5.869 22.299 5.805 C 22.219 5.757 22.108 5.708 21.965 5.66 C 21.821 5.612 21.67 5.573 21.51 5.533 C 21.342 5.501 21.174 5.469 20.99 5.445 C 20.814 5.421 20.631 5.412 20.455 5.412 Z M 3.994 5.43 C 3.555 5.43 3.139 5.478 2.748 5.582 C 2.356 5.677 2.021 5.797 1.742 5.941 C 1.63 5.997 1.56 6.052 1.52 6.107 C 1.48 6.163 1.463 6.261 1.463 6.389 L 1.463 6.779 C 1.463 6.947 1.519 7.025 1.631 7.025 C 1.663 7.025 1.704 7.018 1.76 7.002 C 1.815 6.986 1.909 6.954 2.037 6.898 C 2.316 6.786 2.605 6.7 2.9 6.629 C 3.195 6.557 3.483 6.523 3.762 6.523 C 4.377 6.523 4.808 6.644 5.063 6.891 C 5.31 7.138 5.438 7.561 5.438 8.168 L 5.438 8.752 C 5.119 8.68 4.816 8.614 4.52 8.574 C 4.225 8.534 3.945 8.512 3.674 8.512 C 2.852 8.512 2.206 8.72 1.719 9.135 C 1.233 9.55 0.992 10.099 0.992 10.777 C 0.992 11.416 1.191 11.927 1.582 12.311 C 1.973 12.694 2.51 12.887 3.18 12.887 C 4.122 12.887 4.902 12.518 5.525 11.783 C 5.613 11.967 5.694 12.12 5.773 12.256 C 5.853 12.384 5.95 12.511 6.061 12.631 C 6.141 12.703 6.22 12.742 6.299 12.742 C 6.363 12.742 6.436 12.718 6.508 12.67 L 7.01 12.336 C 7.114 12.256 7.162 12.175 7.162 12.096 C 7.162 12.04 7.145 11.976 7.105 11.912 C 6.993 11.704 6.915 11.514 6.852 11.338 C 6.796 11.162 6.764 10.922 6.764 10.627 L 6.746 10.627 L 6.746 8.039 C 6.746 7.161 6.524 6.507 6.084 6.076 C 5.638 5.646 4.944 5.43 3.994 5.43 Z M 7.705 5.621 C 7.577 5.621 7.514 5.694 7.514 5.822 C 7.514 5.878 7.538 5.982 7.586 6.141 L 9.461 12.311 C 9.509 12.463 9.565 12.573 9.629 12.621 C 9.693 12.677 9.789 12.701 9.932 12.701 L 10.617 12.701 C 10.761 12.701 10.874 12.677 10.938 12.621 C 11.002 12.565 11.05 12.462 11.09 12.303 L 12.318 7.162 L 13.555 12.311 C 13.587 12.471 13.643 12.575 13.707 12.631 C 13.771 12.687 13.874 12.711 14.025 12.711 L 14.713 12.711 C 14.849 12.711 14.952 12.679 15.016 12.631 C 15.08 12.583 15.136 12.477 15.184 12.318 L 17.107 6.148 C 17.139 6.06 17.154 5.997 17.162 5.949 C 17.17 5.901 17.18 5.86 17.18 5.82 C 17.18 5.684 17.107 5.621 16.979 5.621 L 16.236 5.621 C 16.092 5.621 15.99 5.653 15.926 5.701 C 15.87 5.749 15.814 5.853 15.766 6.012 L 14.385 11.359 L 13.123 6.012 C 13.091 5.86 13.037 5.749 12.973 5.701 C 12.909 5.645 12.803 5.621 12.652 5.621 L 12.014 5.621 C 11.87 5.621 11.759 5.653 11.695 5.701 C 11.631 5.749 11.583 5.853 11.543 6.012 L 10.301 11.297 L 8.959 6.014 C 8.911 5.862 8.863 5.749 8.799 5.701 C 8.743 5.645 8.639 5.621 8.488 5.621 L 7.705 5.621 Z M 3.971 9.461 C 4.218 9.461 4.466 9.478 4.721 9.51 C 4.976 9.542 5.222 9.589 5.453 9.645 L 5.453 9.98 C 5.453 10.251 5.421 10.483 5.373 10.674 C 5.325 10.866 5.231 11.034 5.104 11.186 C 4.888 11.425 4.633 11.599 4.346 11.695 C 4.059 11.791 3.786 11.84 3.523 11.84 C 3.156 11.84 2.877 11.744 2.686 11.545 C 2.486 11.353 2.391 11.074 2.391 10.699 C 2.391 10.3 2.518 9.997 2.781 9.781 C 3.044 9.565 3.436 9.461 3.971 9.461 Z M 22.236 14.361 C 21.396 14.373 20.404 14.561 19.654 15.088 C 19.423 15.256 19.463 15.479 19.719 15.447 C 20.573 15.343 22.458 15.12 22.793 15.551 C 23.128 15.974 22.417 17.755 22.098 18.545 C 22.002 18.784 22.211 18.878 22.426 18.695 C 23.83 17.514 24.195 15.048 24.032 14.689 C 23.888 14.514 23.076 14.349 22.236 14.361 Z M 0.176 14.838 C 0 14.86 0 15.073 0.107 15.24 C 3.236 18.066 7.38 19.766 11.977 19.766 C 15.258 19.766 19.071 18.736 21.697 16.797 C 22.128 16.477 21.753 15.989 21.314 16.189 C 18.369 17.434 15.17 18.043 12.256 18.043 C 7.938 18.043 3.763 16.853 0.379 14.889 C 0.305 14.845 0.234 14.831 0.176 14.838 Z"})})}function cd({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 48 48",className:ae(e),...t,children:[i.jsx("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),i.jsx("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),i.jsx("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),i.jsx("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"})]})}function ld({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 48 48",className:ae(e),...t,children:[i.jsx("path",{fill:"#ff5722",d:"M6 6H22V22H6z",transform:"rotate(-180 14 14)"}),i.jsx("path",{fill:"#4caf50",d:"M26 6H42V22H26z",transform:"rotate(-180 34 14)"}),i.jsx("path",{fill:"#ffc107",d:"M26 26H42V42H26z",transform:"rotate(-180 34 34)"}),i.jsx("path",{fill:"#03a9f4",d:"M6 26H22V42H6z",transform:"rotate(-180 14 34)"})]})}function ud({className:e,...t}){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:ae(e),...t,children:i.jsx("path",{fill:"#F01F26",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 7h2v10h-2V7zM7 11h10v2H7v-2z"})})}function dd({className:e,...t}){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ae(e),...t,children:[i.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",ry:"2"}),i.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",ry:"2"}),i.jsx("line",{x1:"6",y1:"6",x2:"6.01",y2:"6"}),i.jsx("line",{x1:"6",y1:"18",x2:"6.01",y2:"18"})]})}function cr(e){if(!e||e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${n[r]}`}function ci(e){return e?ex(new Date(e),{addSuffix:!0}):"-"}function li(e){return e?Jv(new Date(e),"MMM d, yyyy HH:mm"):"-"}function ui(e,t){if(!e)return"-";const n=new Date(e),r=t?new Date(t):new Date,o=Math.round((r.getTime()-n.getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m ${o%60}s`:`${Math.floor(o/3600)}h ${Math.floor(o%3600/60)}m`}const fd={postgresql:{label:"PostgreSQL",color:"badge-info",icon:jt},mysql:{label:"MySQL",color:"badge-orange",icon:jt},mongodb:{label:"MongoDB",color:"badge-success",icon:jt},filesystem:{label:"Filesystem",color:"badge-muted",icon:Ka},s3:{label:"S3 / Object",color:"badge-warning",icon:Wo},ec2:{label:"AWS EC2",color:"badge-orange",icon:Wo},ssh_host:{label:"SSH / Linux Host",color:"badge-purple",icon:Tn}},md={local:{label:"Local",color:"badge-muted",icon:fs},s3:{label:"S3",color:"badge-warning",icon:Wo},b2:{label:"Backblaze B2",color:"badge-orange",icon:ud},sftp:{label:"SFTP",color:"badge-purple",icon:dd},rest:{label:"REST Server",color:"badge-info",icon:hu},azure:{label:"Azure",color:"badge-info",icon:ld},gs:{label:"GCS",color:"badge-success",icon:cd}},pd={success:{label:"Success",badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",dot:"#3fb950"},failed:{label:"Failed",badge:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",dot:"#f85149"},running:{label:"Running",badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",dot:"#58a6ff"},pending:{label:"Pending",badge:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",dot:"#d29922"},cancelled:{label:"Cancelled",badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"},connecting:{label:"Connecting...",badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"},error:{label:"Error",badge:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",dot:"#f85149"}};function Gr(e){return pd[e]||{label:e.charAt(0).toUpperCase()+e.slice(1),badge:"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400",dot:"#8b949e"}}function Qs(e){if(!e)return"";const t=e.toLowerCase();return t.includes("error")||t.includes("fatal")||t.includes("failed")?"error":t.includes("success")||t.includes("snapshot")||t.includes("done")?"success":t.includes("[dump]")||t.includes("[retention]")||t.startsWith("{")?"info":""}function Wc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Wc(e[o],null)}}}}function ke(...e){return m.useCallback(tn(...e),e)}var tx=Symbol.for("react.lazy"),Ho=m[" use ".trim().toString()];function nx(e){return typeof e=="object"&&e!==null&&"then"in e}function hd(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tx&&"_payload"in e&&nx(e._payload)}function gd(e){const t=rx(e),n=m.forwardRef((r,o)=>{let{children:s,...a}=r;hd(s)&&typeof Ho=="function"&&(s=Ho(s._payload));const c=m.Children.toArray(s),u=c.find(sx);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var di=gd("Slot");function rx(e){const t=m.forwardRef((n,r)=>{let{children:o,...s}=n;if(hd(o)&&typeof Ho=="function"&&(o=Ho(o._payload)),m.isValidElement(o)){const a=ix(o),c=ax(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ox=Symbol("radix.slottable");function sx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ox}function ax(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ix(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Hc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zc=yu,yd=(e,t)=>n=>{var r;if(t?.variants==null)return Zc(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(l=>{const f=n?.[l],d=s?.[l];if(f===null)return null;const p=Hc(f)||Hc(d);return o[l][p]}),c=n&&Object.entries(n).reduce((l,f)=>{let[d,p]=f;return p===void 0||(l[d]=p),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,f)=>{let{class:d,className:p,...h}=f;return Object.entries(h).every(g=>{let[y,b]=g;return Array.isArray(b)?b.includes({...s,...c}[y]):{...s,...c}[y]===b})?[...l,d,p]:l},[]);return Zc(e,a,u,n?.class,n?.className)},fi=yd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ge({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?di:"button";return i.jsx(s,{"data-slot":"button",className:ae(fi({variant:t,size:n,className:e})),...o})}const cx=yd("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{success:"bg-green-500 text-white",default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function $e({className:e,variant:t,asChild:n=!1,...r}){const o=n?di:"span";return i.jsx(o,{"data-slot":"badge",className:ae(cx({variant:t}),e),...r})}function At({className:e,...t}){return i.jsx("div",{"data-slot":"card",className:ae("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function lx({className:e,...t}){return i.jsx("div",{"data-slot":"card-header",className:ae("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ux({className:e,...t}){return i.jsx("div",{"data-slot":"card-title",className:ae("leading-none font-semibold",e),...t})}function Tt({className:e,...t}){return i.jsx("div",{"data-slot":"card-content",className:ae("px-6",e),...t})}function oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function dx(e,t){const n=m.createContext(t),r=s=>{const{children:a,...c}=s,u=m.useMemo(()=>c,Object.values(c));return i.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(s){const a=m.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function yn(e,t=[]){let n=[];function r(s,a){const c=m.createContext(a),u=n.length;n=[...n,a];const l=d=>{const{scope:p,children:h,...g}=d,y=p?.[e]?.[u]||c,b=m.useMemo(()=>g,Object.values(g));return i.jsx(y.Provider,{value:b,children:h})};l.displayName=s+"Provider";function f(d,p){const h=p?.[e]?.[u]||c,g=m.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>m.createContext(a));return function(c){const u=c?.[e]||s;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,fx(o,...t)]}function fx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:u,scopeName:l})=>{const d=u(s)[`__scope${l}`];return{...c,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Xe=globalThis?.document?m.useLayoutEffect:()=>{},mx=m[" useInsertionEffect ".trim().toString()]||Xe;function Pr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=px({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=m.useRef(e!==void 0);m.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=m.useCallback(f=>{if(c){const d=hx(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[c,e,s,a]);return[u,l]}function px({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),s=m.useRef(t);return mx(()=>{s.current=t},[t]),m.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function hx(e){return typeof e=="function"}function gx(e){const t=yx(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(vx);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function yx(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=wx(o),c=xx(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bx=Symbol("radix.slottable");function vx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bx}function xx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _x=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=_x.reduce((e,t)=>{const n=gx(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:a,...c}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bd(e,t){e&&us.flushSync(()=>e.dispatchEvent(t))}function Gc(e){const t=Sx(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(kx);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Sx(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=Cx(o),c=Nx(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ex=Symbol("radix.slottable");function kx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ex}function Nx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mi(e){const t=e+"CollectionProvider",[n,r]=yn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:v}=y,w=k.useRef(null),S=k.useRef(new Map).current;return i.jsx(o,{scope:b,itemMap:S,collectionRef:w,children:v})};a.displayName=t;const c=e+"CollectionSlot",u=Gc(c),l=k.forwardRef((y,b)=>{const{scope:v,children:w}=y,S=s(c,v),_=ke(b,S.collectionRef);return i.jsx(u,{ref:_,children:w})});l.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Gc(f),h=k.forwardRef((y,b)=>{const{scope:v,children:w,...S}=y,_=k.useRef(null),N=ke(b,_),$=s(f,v);return k.useEffect(()=>($.itemMap.set(_,{ref:_,...S}),()=>{$.itemMap.delete(_)})),i.jsx(p,{[d]:"",ref:N,children:w})});h.displayName=f;function g(y){const b=s(e+"CollectionConsumer",y);return k.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const S=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort(($,O)=>S.indexOf($.ref.current)-S.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},g,r]}var jx=m.createContext(void 0);function pi(e){const t=m.useContext(jx);return e||t||"ltr"}function Bt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function Rx(e,t=globalThis?.document){const n=Bt(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ax="DismissableLayer",va="dismissableLayer.update",Tx="dismissableLayer.pointerDownOutside",Ox="dismissableLayer.focusOutside",Yc,vd=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xs=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,l=m.useContext(vd),[f,d]=m.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=ke(t,O=>d(O)),y=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(b),w=f?y.indexOf(f):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,_=w>=v,N=$x(O=>{const T=O.target,W=[...l.branches].some(H=>H.contains(T));!_||W||(o?.(O),a?.(O),O.defaultPrevented||c?.())},p),$=Mx(O=>{const T=O.target;[...l.branches].some(H=>H.contains(T))||(s?.(O),a?.(O),O.defaultPrevented||c?.())},p);return Rx(O=>{w===l.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},p),m.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Yc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Kc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yc)}},[f,p,n,l]),m.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Kc())},[f,l]),m.useEffect(()=>{const O=()=>h({});return document.addEventListener(va,O),()=>document.removeEventListener(va,O)},[]),i.jsx(ve.div,{...u,ref:g,style:{pointerEvents:S?_?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,$.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,N.onPointerDownCapture)})});xs.displayName=Ax;var Px="DismissableLayerBranch",Dx=m.forwardRef((e,t)=>{const n=m.useContext(vd),r=m.useRef(null),o=ke(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(ve.div,{...e,ref:o})});Dx.displayName=Px;function $x(e,t=globalThis?.document){const n=Bt(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let u=function(){xd(Tx,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mx(e,t=globalThis?.document){const n=Bt(e),r=m.useRef(!1);return m.useEffect(()=>{const o=s=>{s.target&&!r.current&&xd(Ox,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kc(){const e=new CustomEvent(va);document.dispatchEvent(e)}function xd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bd(o,s):o.dispatchEvent(s)}var ea=0;function hi(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jc()),document.body.insertAdjacentElement("beforeend",e[1]??Jc()),ea++,()=>{ea===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ea--}},[])}function Jc(){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 ta="focusScope.autoFocusOnMount",na="focusScope.autoFocusOnUnmount",Xc={bubbles:!1,cancelable:!0},Ix="FocusScope",ws=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[c,u]=m.useState(null),l=Bt(o),f=Bt(s),d=m.useRef(null),p=ke(t,y=>u(y)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(S){if(h.paused||!c)return;const _=S.target;c.contains(_)?d.current=_:mn(d.current,{select:!0})},b=function(S){if(h.paused||!c)return;const _=S.relatedTarget;_!==null&&(c.contains(_)||mn(d.current,{select:!0}))},v=function(S){if(document.activeElement===document.body)for(const N of S)N.removedNodes.length>0&&mn(c)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const w=new MutationObserver(v);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),w.disconnect()}}},[r,c,h.paused]),m.useEffect(()=>{if(c){el.add(h);const y=document.activeElement;if(!c.contains(y)){const v=new CustomEvent(ta,Xc);c.addEventListener(ta,l),c.dispatchEvent(v),v.defaultPrevented||(Fx(Ux(wd(c)),{select:!0}),document.activeElement===y&&mn(c))}return()=>{c.removeEventListener(ta,l),setTimeout(()=>{const v=new CustomEvent(na,Xc);c.addEventListener(na,f),c.dispatchEvent(v),v.defaultPrevented||mn(y??document.body,{select:!0}),c.removeEventListener(na,f),el.remove(h)},0)}}},[c,l,f,h]);const g=m.useCallback(y=>{if(!n&&!r||h.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(b&&v){const w=y.currentTarget,[S,_]=zx(w);S&&_?!y.shiftKey&&v===_?(y.preventDefault(),n&&mn(S,{select:!0})):y.shiftKey&&v===S&&(y.preventDefault(),n&&mn(_,{select:!0})):v===w&&y.preventDefault()}},[n,r,h.paused]);return i.jsx(ve.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});ws.displayName=Ix;function Fx(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mn(r,{select:t}),document.activeElement!==n)return}function zx(e){const t=wd(e),n=Qc(t,e),r=Qc(t.reverse(),e);return[n,r]}function wd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qc(e,t){for(const n of e)if(!Lx(n,{upTo:t}))return n}function Lx(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Vx(e){return e instanceof HTMLInputElement&&"select"in e}function mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vx(e)&&t&&e.select()}}var el=Bx();function Bx(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=tl(e,t),e.unshift(t)},remove(t){e=tl(e,t),e[0]?.resume()}}}function tl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ux(e){return e.filter(t=>t.tagName!=="A")}var qx=m[" useId ".trim().toString()]||(()=>{}),Wx=0;function Kt(e){const[t,n]=m.useState(qx());return Xe(()=>{n(r=>r??String(Wx++))},[e]),e||(t?`radix-${t}`:"")}const Hx=["top","right","bottom","left"],pn=Math.min,ft=Math.max,Zo=Math.round,wo=Math.floor,Vt=e=>({x:e,y:e}),Zx={left:"right",right:"left",bottom:"top",top:"bottom"};function xa(e,t,n){return ft(e,pn(t,n))}function Xt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function lr(e){return e.split("-")[1]}function gi(e){return e==="x"?"y":"x"}function yi(e){return e==="y"?"height":"width"}function Lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function bi(e){return gi(Lt(e))}function Gx(e,t,n){n===void 0&&(n=!1);const r=lr(e),o=bi(e),s=yi(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Go(a)),[a,Go(a)]}function Yx(e){const t=Go(e);return[wa(e),t,wa(t)]}function wa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const nl=["left","right"],rl=["right","left"],Kx=["top","bottom"],Jx=["bottom","top"];function Xx(e,t,n){switch(e){case"top":case"bottom":return n?t?rl:nl:t?nl:rl;case"left":case"right":return t?Kx:Jx;default:return[]}}function Qx(e,t,n,r){const o=lr(e);let s=Xx(Qt(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(wa)))),s}function Go(e){const t=Qt(e);return Zx[t]+e.slice(t.length)}function ew(e){return{top:0,right:0,bottom:0,left:0,...e}}function _d(e){return typeof e!="number"?ew(e):{top:e,right:e,bottom:e,left:e}}function Yo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ol(e,t,n){let{reference:r,floating:o}=e;const s=Lt(t),a=bi(t),c=yi(a),u=Qt(t),l=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(u){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(lr(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1);break}return h}async function tw(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Xt(t,e),g=_d(h),b=c[p?d==="floating"?"reference":"floating":d],v=Yo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:u})),w=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),_=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},N=Yo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:S,strategy:u}):w);return{top:(v.top-N.top+g.top)/_.y,bottom:(N.bottom-v.bottom+g.bottom)/_.y,left:(v.left-N.left+g.left)/_.x,right:(N.right-v.right+g.right)/_.x}}const nw=50,rw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:tw},u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=ol(l,r,u),p=r,h=0;const g={};for(let y=0;y<s.length;y++){const b=s[y];if(!b)continue;const{name:v,fn:w}=b,{x:S,y:_,data:N,reset:$}=await w({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:l,platform:c,elements:{reference:e,floating:t}});f=S??f,d=_??d,g[v]={...g[v],...N},$&&h<nw&&(h++,typeof $=="object"&&($.placement&&(p=$.placement),$.rects&&(l=$.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):$.rects),{x:f,y:d}=ol(l,p,u)),y=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:g}},ow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:c,middlewareData:u}=t,{element:l,padding:f=0}=Xt(e,t)||{};if(l==null)return{};const d=_d(f),p={x:n,y:r},h=bi(o),g=yi(h),y=await a.getDimensions(l),b=h==="y",v=b?"top":"left",w=b?"bottom":"right",S=b?"clientHeight":"clientWidth",_=s.reference[g]+s.reference[h]-p[h]-s.floating[g],N=p[h]-s.reference[h],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let O=$?$[S]:0;(!O||!await(a.isElement==null?void 0:a.isElement($)))&&(O=c.floating[S]||s.floating[g]);const T=_/2-N/2,W=O/2-y[g]/2-1,H=pn(d[v],W),ne=pn(d[w],W),C=H,P=O-y[g]-ne,z=O/2-y[g]/2+T,Y=xa(C,z,P),D=!u.arrow&&lr(o)!=null&&z!==Y&&s.reference[g]/2-(z<C?H:ne)-y[g]/2<0,q=D?z<C?z-C:z-P:0;return{[h]:p[h]+q,data:{[h]:Y,centerOffset:z-Y-q,...D&&{alignmentOffset:q}},reset:D}}}),sw=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...b}=Xt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Qt(o),w=Lt(c),S=Qt(c)===c,_=await(u.isRTL==null?void 0:u.isRTL(l.floating)),N=p||(S||!y?[Go(c)]:Yx(c)),$=g!=="none";!p&&$&&N.push(...Qx(c,y,g,_));const O=[c,...N],T=await u.detectOverflow(t,b),W=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&W.push(T[v]),d){const z=Gx(o,a,_);W.push(T[z[0]],T[z[1]])}if(H=[...H,{placement:o,overflows:W}],!W.every(z=>z<=0)){var ne,C;const z=(((ne=s.flip)==null?void 0:ne.index)||0)+1,Y=O[z];if(Y&&(!(d==="alignment"?w!==Lt(Y):!1)||H.every(B=>Lt(B.placement)===w?B.overflows[0]>0:!0)))return{data:{index:z,overflows:H},reset:{placement:Y}};let D=(C=H.filter(q=>q.overflows[0]<=0).sort((q,B)=>q.overflows[1]-B.overflows[1])[0])==null?void 0:C.placement;if(!D)switch(h){case"bestFit":{var P;const q=(P=H.filter(B=>{if($){const V=Lt(B.placement);return V===w||V==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(V=>V>0).reduce((V,F)=>V+F,0)]).sort((B,V)=>B[1]-V[1])[0])==null?void 0:P[0];q&&(D=q);break}case"initialPlacement":D=c;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function sl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return Hx.some(t=>e[t]>=0)}const aw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Xt(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=sl(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:al(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),c=sl(a,n.floating);return{data:{escapedOffsets:c,escaped:al(c)}}}default:return{}}}}},Sd=new Set(["left","top"]);async function iw(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Qt(n),c=lr(n),u=Lt(n)==="y",l=Sd.has(a)?-1:1,f=s&&u?-1:1,d=Xt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),u?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const cw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:c}=t,u=await iw(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},lw=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:v=>{let{x:w,y:S}=v;return{x:w,y:S}}},...l}=Xt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,l),p=Lt(Qt(o)),h=gi(p);let g=f[h],y=f[p];if(a){const v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=g+d[v],_=g-d[w];g=xa(S,g,_)}if(c){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=y+d[v],_=y-d[w];y=xa(S,y,_)}const b=u.fn({...t,[h]:g,[p]:y});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:a,[p]:c}}}}}},uw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=Xt(e,t),f={x:n,y:r},d=Lt(o),p=gi(d);let h=f[p],g=f[d];const y=Xt(c,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const S=p==="y"?"height":"width",_=s.reference[p]-s.floating[S]+b.mainAxis,N=s.reference[p]+s.reference[S]-b.mainAxis;h<_?h=_:h>N&&(h=N)}if(l){var v,w;const S=p==="y"?"width":"height",_=Sd.has(Qt(o)),N=s.reference[d]-s.floating[S]+(_&&((v=a.offset)==null?void 0:v[d])||0)+(_?0:b.crossAxis),$=s.reference[d]+s.reference[S]+(_?0:((w=a.offset)==null?void 0:w[d])||0)-(_?b.crossAxis:0);g<N?g=N:g>$&&(g=$)}return{[p]:h,[d]:g}}}},dw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:c}=t,{apply:u=()=>{},...l}=Xt(e,t),f=await a.detectOverflow(t,l),d=Qt(o),p=lr(o),h=Lt(o)==="y",{width:g,height:y}=s.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,b=p==="end"?"top":"bottom");const w=y-f.top-f.bottom,S=g-f.left-f.right,_=pn(y-f[b],w),N=pn(g-f[v],S),$=!t.middlewareData.shift;let O=_,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=w),$&&!p){const H=ft(f.left,0),ne=ft(f.right,0),C=ft(f.top,0),P=ft(f.bottom,0);h?T=g-2*(H!==0||ne!==0?H+ne:ft(f.left,f.right)):O=y-2*(C!==0||P!==0?C+P:ft(f.top,f.bottom))}await u({...t,availableWidth:T,availableHeight:O});const W=await a.getDimensions(c.floating);return g!==W.width||y!==W.height?{reset:{rects:!0}}:{}}}};function _s(){return typeof window<"u"}function ur(e){return Ed(e)?(e.nodeName||"").toLowerCase():"#document"}function pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(Ed(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ed(e){return _s()?e instanceof Node||e instanceof pt(e).Node:!1}function Ot(e){return _s()?e instanceof Element||e instanceof pt(e).Element:!1}function nn(e){return _s()?e instanceof HTMLElement||e instanceof pt(e).HTMLElement:!1}function il(e){return!_s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pt(e).ShadowRoot}function Yr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function fw(e){return/^(table|td|th)$/.test(ur(e))}function Ss(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const mw=/transform|translate|scale|rotate|perspective|filter/,pw=/paint|layout|strict|content/,kn=e=>!!e&&e!=="none";let ra;function vi(e){const t=Ot(e)?Pt(e):e;return kn(t.transform)||kn(t.translate)||kn(t.scale)||kn(t.rotate)||kn(t.perspective)||!xi()&&(kn(t.backdropFilter)||kn(t.filter))||mw.test(t.willChange||"")||pw.test(t.contain||"")}function hw(e){let t=hn(e);for(;nn(t)&&!sr(t);){if(vi(t))return t;if(Ss(t))return null;t=hn(t)}return null}function xi(){return ra==null&&(ra=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ra}function sr(e){return/^(html|body|#document)$/.test(ur(e))}function Pt(e){return pt(e).getComputedStyle(e)}function Es(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hn(e){if(ur(e)==="html")return e;const t=e.assignedSlot||e.parentNode||il(e)&&e.host||Ut(e);return il(t)?t.host:t}function kd(e){const t=hn(e);return sr(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&Yr(t)?t:kd(t)}function Dr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=kd(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=pt(o);if(s){const c=_a(a);return t.concat(a,a.visualViewport||[],Yr(o)?o:[],c&&n?Dr(c):[])}else return t.concat(o,Dr(o,[],n))}function _a(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nd(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nn(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=Zo(n)!==s||Zo(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function wi(e){return Ot(e)?e:e.contextElement}function Qn(e){const t=wi(e);if(!nn(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Nd(t);let a=(s?Zo(n.width):n.width)/r,c=(s?Zo(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const gw=Vt(0);function Cd(e){const t=pt(e);return!xi()||!t.visualViewport?gw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pt(e)?!1:t}function Dn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=wi(e);let a=Vt(1);t&&(r?Ot(r)&&(a=Qn(r)):a=Qn(e));const c=yw(s,n,r)?Cd(s):Vt(0);let u=(o.left+c.x)/a.x,l=(o.top+c.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(s){const p=pt(s),h=r&&Ot(r)?pt(r):r;let g=p,y=_a(g);for(;y&&r&&h!==g;){const b=Qn(y),v=y.getBoundingClientRect(),w=Pt(y),S=v.left+(y.clientLeft+parseFloat(w.paddingLeft))*b.x,_=v.top+(y.clientTop+parseFloat(w.paddingTop))*b.y;u*=b.x,l*=b.y,f*=b.x,d*=b.y,u+=S,l+=_,g=pt(y),y=_a(g)}}return Yo({width:f,height:d,x:u,y:l})}function ks(e,t){const n=Es(e).scrollLeft;return t?t.left+n:Dn(Ut(e)).left+n}function jd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ks(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function bw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Ut(r),c=t?Ss(t.floating):!1;if(r===a||c&&s)return n;let u={scrollLeft:0,scrollTop:0},l=Vt(1);const f=Vt(0),d=nn(r);if((d||!d&&!s)&&((ur(r)!=="body"||Yr(a))&&(u=Es(r)),d)){const h=Dn(r);l=Qn(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=a&&!d&&!s?jd(a,u):Vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-u.scrollTop*l.y+f.y+p.y}}function vw(e){return Array.from(e.getClientRects())}function xw(e){const t=Ut(e),n=Es(e),r=e.ownerDocument.body,o=ft(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ft(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ks(e);const c=-n.scrollTop;return Pt(r).direction==="rtl"&&(a+=ft(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:c}}const cl=25;function ww(e,t){const n=pt(e),r=Ut(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,u=0;if(o){s=o.width,a=o.height;const f=xi();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const l=ks(r);if(l<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-h);g<=cl&&(s-=g)}else l<=cl&&(s+=l);return{width:s,height:a,x:c,y:u}}function _w(e,t){const n=Dn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nn(e)?Qn(e):Vt(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,l=r*s.y;return{width:a,height:c,x:u,y:l}}function ll(e,t,n){let r;if(t==="viewport")r=ww(e,n);else if(t==="document")r=xw(Ut(e));else if(Ot(t))r=_w(t,n);else{const o=Cd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yo(r)}function Rd(e,t){const n=hn(e);return n===t||!Ot(n)||sr(n)?!1:Pt(n).position==="fixed"||Rd(n,t)}function Sw(e,t){const n=t.get(e);if(n)return n;let r=Dr(e,[],!1).filter(c=>Ot(c)&&ur(c)!=="body"),o=null;const s=Pt(e).position==="fixed";let a=s?hn(e):e;for(;Ot(a)&&!sr(a);){const c=Pt(a),u=vi(a);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Yr(a)&&!u&&Rd(e,a))?r=r.filter(f=>f!==a):o=c,a=hn(a)}return t.set(e,r),r}function Ew(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Ss(t)?[]:Sw(t,this._c):[].concat(n),r],c=ll(t,a[0],o);let u=c.top,l=c.right,f=c.bottom,d=c.left;for(let p=1;p<a.length;p++){const h=ll(t,a[p],o);u=ft(h.top,u),l=pn(h.right,l),f=pn(h.bottom,f),d=ft(h.left,d)}return{width:l-d,height:f-u,x:d,y:u}}function kw(e){const{width:t,height:n}=Nd(e);return{width:t,height:n}}function Nw(e,t,n){const r=nn(t),o=Ut(t),s=n==="fixed",a=Dn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=Vt(0);function l(){u.x=ks(o)}if(r||!r&&!s)if((ur(t)!=="body"||Yr(o))&&(c=Es(t)),r){const h=Dn(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const f=o&&!r&&!s?jd(o,c):Vt(0),d=a.left+c.scrollLeft-u.x-f.x,p=a.top+c.scrollTop-u.y-f.y;return{x:d,y:p,width:a.width,height:a.height}}function oa(e){return Pt(e).position==="static"}function ul(e,t){if(!nn(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Ad(e,t){const n=pt(e);if(Ss(e))return n;if(!nn(e)){let o=hn(e);for(;o&&!sr(o);){if(Ot(o)&&!oa(o))return o;o=hn(o)}return n}let r=ul(e,t);for(;r&&fw(r)&&oa(r);)r=ul(r,t);return r&&sr(r)&&oa(r)&&!vi(r)?n:r||hw(e)||n}const Cw=async function(e){const t=this.getOffsetParent||Ad,n=this.getDimensions,r=await n(e.floating);return{reference:Nw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jw(e){return Pt(e).direction==="rtl"}const Rw={convertOffsetParentRelativeRectToViewportRelativeRect:bw,getDocumentElement:Ut,getClippingRect:Ew,getOffsetParent:Ad,getElementRects:Cw,getClientRects:vw,getDimensions:kw,getScale:Qn,isElement:Ot,isRTL:jw};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aw(e,t){let n=null,r;const o=Ut(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:f,top:d,width:p,height:h}=l;if(c||t(),!p||!h)return;const g=wo(d),y=wo(o.clientWidth-(f+p)),b=wo(o.clientHeight-(d+h)),v=wo(f),S={rootMargin:-g+"px "+-y+"px "+-b+"px "+-v+"px",threshold:ft(0,pn(1,u))||1};let _=!0;function N($){const O=$[0].intersectionRatio;if(O!==u){if(!_)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Td(l,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(N,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,S)}n.observe(e)}return a(!0),s}function Tw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=wi(e),f=o||s?[...l?Dr(l):[],...t?Dr(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&c?Aw(l,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),l&&!u&&h.observe(l),t&&h.observe(t));let g,y=u?Dn(e):null;u&&b();function b(){const v=Dn(e);y&&!Td(y,v)&&n(),y=v,g=requestAnimationFrame(b)}return n(),()=>{var v;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const Ow=cw,Pw=lw,Dw=sw,$w=dw,Mw=aw,dl=ow,Iw=uw,Fw=(e,t,n)=>{const r=new Map,o={platform:Rw,...n},s={...o.platform,_c:r};return rw(e,t,{...o,platform:s})};var zw=typeof document<"u",Lw=function(){},Mo=zw?k.useLayoutEffect:Lw;function Ko(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ko(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ko(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Od(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fl(e,t){const n=Od(e);return Math.round(t*n)/n}function sa(e){const t=m.useRef(e);return Mo(()=>{t.current=e}),t}function Vw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[f,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(r);Ko(p,r)||h(r);const[g,y]=m.useState(null),[b,v]=m.useState(null),w=m.useCallback(B=>{B!==$.current&&($.current=B,y(B))},[]),S=m.useCallback(B=>{B!==O.current&&(O.current=B,v(B))},[]),_=s||g,N=a||b,$=m.useRef(null),O=m.useRef(null),T=m.useRef(f),W=u!=null,H=sa(u),ne=sa(o),C=sa(l),P=m.useCallback(()=>{if(!$.current||!O.current)return;const B={placement:t,strategy:n,middleware:p};ne.current&&(B.platform=ne.current),Fw($.current,O.current,B).then(V=>{const F={...V,isPositioned:C.current!==!1};z.current&&!Ko(T.current,F)&&(T.current=F,us.flushSync(()=>{d(F)}))})},[p,t,n,ne,C]);Mo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[l]);const z=m.useRef(!1);Mo(()=>(z.current=!0,()=>{z.current=!1}),[]),Mo(()=>{if(_&&($.current=_),N&&(O.current=N),_&&N){if(H.current)return H.current(_,N,P);P()}},[_,N,P,H,W]);const Y=m.useMemo(()=>({reference:$,floating:O,setReference:w,setFloating:S}),[w,S]),D=m.useMemo(()=>({reference:_,floating:N}),[_,N]),q=m.useMemo(()=>{const B={position:n,left:0,top:0};if(!D.floating)return B;const V=fl(D.floating,f.x),F=fl(D.floating,f.y);return c?{...B,transform:"translate("+V+"px, "+F+"px)",...Od(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:F}},[n,c,D.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:P,refs:Y,elements:D,floatingStyles:q}),[f,P,Y,D,q])}const Bw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dl({element:r.current,padding:o}).fn(n):{}:r?dl({element:r,padding:o}).fn(n):{}}}},Uw=(e,t)=>{const n=Ow(e);return{name:n.name,fn:n.fn,options:[e,t]}},qw=(e,t)=>{const n=Pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ww=(e,t)=>({fn:Iw(e).fn,options:[e,t]}),Hw=(e,t)=>{const n=Dw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zw=(e,t)=>{const n=$w(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gw=(e,t)=>{const n=Mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yw=(e,t)=>{const n=Bw(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Kw="Arrow",Pd=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return i.jsx(ve.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pd.displayName=Kw;var Jw=Pd;function Xw(e){const[t,n]=m.useState(void 0);return Xe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _i="Popper",[Dd,Ns]=yn(_i),[Qw,$d]=Dd(_i),Md=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return i.jsx(Qw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Md.displayName=_i;var Id="PopperAnchor",Fd=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=$d(Id,n),a=m.useRef(null),c=ke(t,a),u=m.useRef(null);return m.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&s.onAnchorChange(u.current)}),r?null:i.jsx(ve.div,{...o,ref:c})});Fd.displayName=Id;var Si="PopperContent",[e0,t0]=Dd(Si),zd=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...y}=e,b=$d(Si,n),[v,w]=m.useState(null),S=ke(t,I=>w(I)),[_,N]=m.useState(null),$=Xw(_),O=$?.width??0,T=$?.height??0,W=r+(s!=="center"?"-"+s:""),H=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},ne=Array.isArray(l)?l:[l],C=ne.length>0,P={padding:H,boundary:ne.filter(r0),altBoundary:C},{refs:z,floatingStyles:Y,placement:D,isPositioned:q,middlewareData:B}=Vw({strategy:"fixed",placement:W,whileElementsMounted:(...I)=>Tw(...I,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[Uw({mainAxis:o+T,alignmentAxis:a}),u&&qw({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ww():void 0,...P}),u&&Hw({...P}),Zw({...P,apply:({elements:I,rects:Q,availableWidth:le,availableHeight:me})=>{const{width:he,height:be}=Q.reference,De=I.floating.style;De.setProperty("--radix-popper-available-width",`${le}px`),De.setProperty("--radix-popper-available-height",`${me}px`),De.setProperty("--radix-popper-anchor-width",`${he}px`),De.setProperty("--radix-popper-anchor-height",`${be}px`)}}),_&&Yw({element:_,padding:c}),o0({arrowWidth:O,arrowHeight:T}),p&&Gw({strategy:"referenceHidden",...P})]}),[V,F]=Bd(D),R=Bt(g);Xe(()=>{q&&R?.()},[q,R]);const J=B.arrow?.x,G=B.arrow?.y,X=B.arrow?.centerOffset!==0,[re,ce]=m.useState();return Xe(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:q?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(e0,{scope:n,placedSide:V,onArrowChange:N,arrowX:J,arrowY:G,shouldHideArrow:X,children:i.jsx(ve.div,{"data-side":V,"data-align":F,...y,ref:S,style:{...y.style,animation:q?void 0:"none"}})})})});zd.displayName=Si;var Ld="PopperArrow",n0={top:"bottom",right:"left",bottom:"top",left:"right"},Vd=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=t0(Ld,r),a=n0[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(Jw,{...o,ref:n,style:{...o.style,display:"block"}})})});Vd.displayName=Ld;function r0(e){return e!==null}var o0=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,f]=Bd(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+c/2,h=(o.arrow?.y??0)+u/2;let g="",y="";return l==="bottom"?(g=a?d:`${p}px`,y=`${-u}px`):l==="top"?(g=a?d:`${p}px`,y=`${r.floating.height+u}px`):l==="right"?(g=`${-u}px`,y=a?d:`${h}px`):l==="left"&&(g=`${r.floating.width+u}px`,y=a?d:`${h}px`),{data:{x:g,y}}}});function Bd(e){const[t,n="center"]=e.split("-");return[t,n]}var Ud=Md,qd=Fd,Wd=zd,Hd=Vd,s0="Portal",Cs=m.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=m.useState(!1);Xe(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Za.createPortal(i.jsx(ve.div,{...r,ref:t}),a):null});Cs.displayName=s0;function a0(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var bn=e=>{const{present:t,children:n}=e,r=i0(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=ke(r.ref,c0(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};bn.displayName="Presence";function i0(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),a=e?"mounted":"unmounted",[c,u]=a0(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const l=_o(r.current);s.current=c==="mounted"?l:"none"},[c]),Xe(()=>{const l=r.current,f=o.current;if(f!==e){const p=s.current,h=_o(l);e?u("MOUNT"):h==="none"||l?.display==="none"?u("UNMOUNT"):u(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Xe(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=h=>{const y=_o(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&y&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=h=>{h.target===t&&(s.current=_o(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function _o(e){return e?.animationName||"none"}function c0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aa="rovingFocusGroup.onEntryFocus",l0={bubbles:!1,cancelable:!0},Kr="RovingFocusGroup",[Sa,Zd,u0]=mi(Kr),[d0,Gd]=yn(Kr,[u0]),[f0,m0]=d0(Kr),Yd=m.forwardRef((e,t)=>i.jsx(Sa.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Sa.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(p0,{...e,ref:t})})}));Yd.displayName=Kr;var p0=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...d}=e,p=m.useRef(null),h=ke(t,p),g=pi(s),[y,b]=Pr({prop:a,defaultProp:c??null,onChange:u,caller:Kr}),[v,w]=m.useState(!1),S=Bt(l),_=Zd(n),N=m.useRef(!1),[$,O]=m.useState(0);return m.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(aa,S),()=>T.removeEventListener(aa,S)},[S]),i.jsx(f0,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:y,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[]),children:i.jsx(ve.div,{tabIndex:v||$===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{N.current=!0}),onFocus:oe(e.onFocus,T=>{const W=!N.current;if(T.target===T.currentTarget&&W&&!v){const H=new CustomEvent(aa,l0);if(T.currentTarget.dispatchEvent(H),!H.defaultPrevented){const ne=_().filter(D=>D.focusable),C=ne.find(D=>D.active),P=ne.find(D=>D.id===y),Y=[C,P,...ne].filter(Boolean).map(D=>D.ref.current);Xd(Y,f)}}N.current=!1}),onBlur:oe(e.onBlur,()=>w(!1))})})}),Kd="RovingFocusGroupItem",Jd=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=e,u=Kt(),l=s||u,f=m0(Kd,n),d=f.currentTabStopId===l,p=Zd(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:y}=f;return m.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),i.jsx(Sa.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:i.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:oe(e.onMouseDown,b=>{r?f.onItemFocus(l):b.preventDefault()}),onFocus:oe(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:oe(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=y0(b,f.orientation,f.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=p().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const _=S.indexOf(b.currentTarget);S=f.loop?b0(S,_+1):S.slice(_+1)}setTimeout(()=>Xd(S))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:y!=null}):a})})});Jd.displayName=Kd;var h0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function g0(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function y0(e,t,n){const r=g0(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return h0[r]}function Xd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function b0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var v0=Yd,x0=Jd;function w0(e){const t=_0(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(E0);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function _0(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=N0(o),c=k0(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S0=Symbol("radix.slottable");function E0(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S0}function k0(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function N0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var C0=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hn=new WeakMap,So=new WeakMap,Eo={},ia=0,Qd=function(e){return e&&(e.host||Qd(e.parentNode))},j0=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Qd(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},R0=function(e,t,n,r){var o=j0(t,Array.isArray(e)?e:[e]);Eo[n]||(Eo[n]=new WeakMap);var s=Eo[n],a=[],c=new Set,u=new Set(o),l=function(d){!d||c.has(d)||(c.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(c.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",y=(Hn.get(p)||0)+1,b=(s.get(p)||0)+1;Hn.set(p,y),s.set(p,b),a.push(p),y===1&&g&&So.set(p,!0),b===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),c.clear(),ia++,function(){a.forEach(function(d){var p=Hn.get(d)-1,h=s.get(d)-1;Hn.set(d,p),s.set(d,h),p||(So.has(d)||d.removeAttribute(r),So.delete(d)),h||d.removeAttribute(n)}),ia--,ia||(Hn=new WeakMap,Hn=new WeakMap,So=new WeakMap,Eo={})}},Ei=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=C0(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),R0(r,o,n,"aria-hidden")):function(){return null}},zt=function(){return zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},zt.apply(this,arguments)};function ef(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function A0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Io="right-scroll-bar-position",Fo="width-before-scroll-bar",T0="with-scroll-bars-hidden",O0="--removed-body-scroll-bar-size";function ca(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function P0(e,t){var n=k.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var D0=typeof window<"u"?m.useLayoutEffect:m.useEffect,ml=new WeakMap;function $0(e,t){var n=P0(null,function(r){return e.forEach(function(o){return ca(o,r)})});return D0(function(){var r=ml.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(c){s.has(c)||ca(c,null)}),s.forEach(function(c){o.has(c)||ca(c,a)})}ml.set(n,e)},[e]),n}function M0(e){return e}function I0(e,t){t===void 0&&(t=M0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function F0(e){e===void 0&&(e={});var t=I0(null);return t.options=zt({async:!0,ssr:!1},e),t}var tf=function(e){var t=e.sideCar,n=ef(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,zt({},n))};tf.isSideCarExport=!0;function z0(e,t){return e.useMedium(t),tf}var nf=F0(),la=function(){},js=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:la,onWheelCapture:la,onTouchMoveCapture:la}),o=r[0],s=r[1],a=e.forwardProps,c=e.children,u=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,S=e.gapMode,_=ef(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,$=$0([n,t]),O=zt(zt({},_),o);return m.createElement(m.Fragment,null,f&&m.createElement(N,{sideCar:nf,removeScrollBar:l,shards:d,noRelative:h,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:S}),a?m.cloneElement(m.Children.only(c),zt(zt({},O),{ref:$})):m.createElement(w,zt({},O,{className:u,ref:$}),c))});js.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};js.classNames={fullWidth:Fo,zeroRight:Io};var L0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function V0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=L0();return t&&e.setAttribute("nonce",t),e}function B0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function U0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var q0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=V0())&&(B0(t,n),U0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},W0=function(){var e=q0();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rf=function(){var e=W0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},H0={left:0,top:0,right:0,gap:0},ua=function(e){return parseInt(e||"",10)||0},Z0=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ua(n),ua(r),ua(o)]},G0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return H0;var t=Z0(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Y0=rf(),er="data-scroll-locked",K0=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
12
12
|
.`.concat(T0,` {
|
|
13
13
|
overflow: hidden `).concat(r,`;
|
|
14
14
|
padding-right: `).concat(c,"px ").concat(r,`;
|
|
@@ -26,7 +26,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
26
26
|
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.`).concat(
|
|
29
|
+
.`).concat(Io,` {
|
|
30
30
|
right: `).concat(c,"px ").concat(r,`;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
34
34
|
margin-right: `).concat(c,"px ").concat(r,`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.`).concat(
|
|
37
|
+
.`).concat(Io," .").concat(Io,` {
|
|
38
38
|
right: 0 `).concat(r,`;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -45,64 +45,687 @@ React keys must be passed directly to JSX without using spread:
|
|
|
45
45
|
body[`).concat(er,`] {
|
|
46
46
|
`).concat(O0,": ").concat(c,`px;
|
|
47
47
|
}
|
|
48
|
-
`)},pl=function(){var e=parseInt(document.body.getAttribute(er)||"0",10);return isFinite(e)?e:0},J0=function(){m.useEffect(function(){return document.body.setAttribute(er,(pl()+1).toString()),function(){var e=pl()-1;e<=0?document.body.removeAttribute(er):document.body.setAttribute(er,e.toString())}},[])},X0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;J0();var s=m.useMemo(function(){return
|
|
48
|
+
`)},pl=function(){var e=parseInt(document.body.getAttribute(er)||"0",10);return isFinite(e)?e:0},J0=function(){m.useEffect(function(){return document.body.setAttribute(er,(pl()+1).toString()),function(){var e=pl()-1;e<=0?document.body.removeAttribute(er):document.body.setAttribute(er,e.toString())}},[])},X0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;J0();var s=m.useMemo(function(){return G0(o)},[o]);return m.createElement(Y0,{styles:K0(s,!t,o,n?"":"!important")})},Ea=!1;if(typeof window<"u")try{var ko=Object.defineProperty({},"passive",{get:function(){return Ea=!0,!0}});window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,ko)}catch{Ea=!1}var Zn=Ea?{passive:!1}:!1,Q0=function(e){return e.tagName==="TEXTAREA"},of=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q0(e)&&n[t]==="visible")},e1=function(e){return of(e,"overflowY")},t1=function(e){return of(e,"overflowX")},hl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=sf(e,r);if(o){var s=af(e,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},n1=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},r1=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sf=function(e,t){return e==="v"?e1(t):t1(t)},af=function(e,t){return e==="v"?n1(t):r1(t)},o1=function(e,t){return e==="h"&&t==="rtl"?-1:1},s1=function(e,t,n,r,o){var s=o1(e,window.getComputedStyle(t).direction),a=s*r,c=n.target,u=t.contains(c),l=!1,f=a>0,d=0,p=0;do{if(!c)break;var h=af(e,c),g=h[0],y=h[1],b=h[2],v=y-b-s*g;(g||v)&&sf(e,c)&&(d+=v,p+=g);var w=c.parentNode;c=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(l=!0),l},No=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gl=function(e){return[e.deltaX,e.deltaY]},yl=function(e){return e&&"current"in e?e.current:e},a1=function(e,t){return e[0]===t[0]&&e[1]===t[1]},i1=function(e){return`
|
|
49
49
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
50
50
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
51
|
-
`)},c1=0,Yn=[];function l1(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(c1++)[0],s=m.useState(rf)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=A0([e.lockRef.current],(e.shards||[]).map(yl),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=Co(y),w=n.current,S="deltaX"in y?y.deltaX:w[0]-v[0],_="deltaY"in y?y.deltaY:w[1]-v[1],C,I=y.target,O=Math.abs(S)>Math.abs(_)?"h":"v";if("touches"in y&&O==="h"&&I.type==="range")return!1;var T=window.getSelection(),H=T&&T.anchorNode,Z=H?H===I||H.contains(I):!1;if(Z)return!1;var ne=hl(O,I);if(!ne)return!0;if(ne?C=O:(C=O==="v"?"h":"v",ne=hl(O,I)),!ne)return!1;if(!r.current&&"changedTouches"in y&&(S||_)&&(r.current=C),!C)return!0;var N=r.current||C;return s1(N,b,y,N==="h"?S:_)},[]),u=m.useCallback(function(y){var b=y;if(!(!Yn.length||Yn[Yn.length-1]!==s)){var v="deltaY"in b?gl(b):Co(b),w=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&a1(C.delta,v)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var S=(a.current.shards||[]).map(yl).filter(Boolean).filter(function(C){return C.contains(b.target)}),_=S.length>0?c(b,S[0]):!a.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),l=m.useCallback(function(y,b,v,w){var S={name:y,delta:b,target:v,should:w,shadowParent:u1(v)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(_){return _!==S})},1)},[]),f=m.useCallback(function(y){n.current=Co(y),r.current=void 0},[]),d=m.useCallback(function(y){l(y.type,gl(y),y.target,c(y,e.lockRef.current))},[]),h=m.useCallback(function(y){l(y.type,Co(y),y.target,c(y,e.lockRef.current))},[]);m.useEffect(function(){return Yn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,qn),document.addEventListener("touchmove",u,qn),document.addEventListener("touchstart",f,qn),function(){Yn=Yn.filter(function(y){return y!==s}),document.removeEventListener("wheel",u,qn),document.removeEventListener("touchmove",u,qn),document.removeEventListener("touchstart",f,qn)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:i1(o)}):null,p?m.createElement(X0,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function u1(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const d1=z0(nf,l1);var Rs=m.forwardRef(function(e,t){return m.createElement(js,zt({},e,{ref:t,sideCar:d1}))});Rs.classNames=js.classNames;var Ea=["Enter"," "],f1=["ArrowDown","PageUp","Home"],cf=["ArrowUp","PageDown","End"],m1=[...f1,...cf],p1={ltr:[...Ea,"ArrowRight"],rtl:[...Ea,"ArrowLeft"]},h1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jr="Menu",[Ir,g1,y1]=mi(Jr),[Bn,lf]=yn(Jr,[y1,Cs,Yd]),As=Cs(),uf=Yd(),[b1,Vn]=Bn(Jr),[v1,Xr]=Bn(Jr),df=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,c=As(t),[u,l]=m.useState(null),f=m.useRef(!1),d=Vt(s),h=pi(o);return m.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(Ud,{...c,children:i.jsx(b1,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:i.jsx(v1,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:h,modal:a,children:r})})})};df.displayName=Jr;var x1="MenuAnchor",Ei=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=As(n);return i.jsx(Wd,{...o,...r,ref:t})});Ei.displayName=x1;var Ci="MenuPortal",[w1,ff]=Bn(Ci,{forceMount:void 0}),mf=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Vn(Ci,t);return i.jsx(w1,{scope:t,forceMount:n,children:i.jsx(bn,{present:n||s.open,children:i.jsx(Ns,{asChild:!0,container:o,children:r})})})};mf.displayName=Ci;var yt="MenuContent",[_1,Ni]=Bn(yt),pf=m.forwardRef((e,t)=>{const n=ff(yt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vn(yt,e.__scopeMenu),a=Xr(yt,e.__scopeMenu);return i.jsx(Ir.Provider,{scope:e.__scopeMenu,children:i.jsx(bn,{present:r||s.open,children:i.jsx(Ir.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(S1,{...o,ref:t}):i.jsx(k1,{...o,ref:t})})})})}),S1=m.forwardRef((e,t)=>{const n=Vn(yt,e.__scopeMenu),r=m.useRef(null),o=Ee(t,r);return m.useEffect(()=>{const s=r.current;if(s)return ki(s)},[]),i.jsx(ji,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),k1=m.forwardRef((e,t)=>{const n=Vn(yt,e.__scopeMenu);return i.jsx(ji,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),E1=w0("MenuContent.ScrollLock"),ji=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...y}=e,b=Vn(yt,n),v=Xr(yt,n),w=As(n),S=uf(n),_=g1(n),[C,I]=m.useState(null),O=m.useRef(null),T=Ee(t,O,b.onContentChange),H=m.useRef(0),Z=m.useRef(""),ne=m.useRef(0),N=m.useRef(null),P=m.useRef("right"),z=m.useRef(0),G=g?Rs:m.Fragment,D=g?{as:E1,allowPinchZoom:!0}:void 0,W=B=>{const F=Z.current+B,R=_().filter($=>!$.disabled),J=document.activeElement,Y=R.find($=>$.ref.current===J)?.textValue,X=R.map($=>$.textValue),re=$1(X,F,Y),ce=R.find($=>$.textValue===re)?.ref.current;(function $(Q){Z.current=Q,window.clearTimeout(H.current),Q!==""&&(H.current=window.setTimeout(()=>$(""),1e3))})(F),ce&&setTimeout(()=>ce.focus())};m.useEffect(()=>()=>window.clearTimeout(H.current),[]),hi();const V=m.useCallback(B=>P.current===N.current?.side&&z1(B,N.current?.area),[]);return i.jsx(_1,{scope:n,searchRef:Z,onItemEnter:m.useCallback(B=>{V(B)&&B.preventDefault()},[V]),onItemLeave:m.useCallback(B=>{V(B)||(O.current?.focus(),I(null))},[V]),onTriggerLeave:m.useCallback(B=>{V(B)&&B.preventDefault()},[V]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:m.useCallback(B=>{N.current=B},[]),children:i.jsx(G,{...D,children:i.jsx(ws,{asChild:!0,trapped:o,onMountAutoFocus:oe(s,B=>{B.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(xs,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:i.jsx(v0,{asChild:!0,...S,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:I,onEntryFocus:oe(u,B=>{v.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Hd,{role:"menu","aria-orientation":"vertical","data-state":Af(b.open),"data-radix-menu-content":"",dir:v.dir,...w,...y,ref:T,style:{outline:"none",...y.style},onKeyDown:oe(y.onKeyDown,B=>{const R=B.target.closest("[data-radix-menu-content]")===B.currentTarget,J=B.ctrlKey||B.altKey||B.metaKey,Y=B.key.length===1;R&&(B.key==="Tab"&&B.preventDefault(),!J&&Y&&W(B.key));const X=O.current;if(B.target!==X||!m1.includes(B.key))return;B.preventDefault();const ce=_().filter($=>!$.disabled).map($=>$.ref.current);cf.includes(B.key)&&ce.reverse(),I1(ce)}),onBlur:oe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(H.current),Z.current="")}),onPointerMove:oe(e.onPointerMove,Mr(B=>{const F=B.target,R=z.current!==B.clientX;if(B.currentTarget.contains(F)&&R){const J=B.clientX>z.current?"right":"left";P.current=J,z.current=B.clientX}}))})})})})})})});pf.displayName=yt;var C1="MenuGroup",Ri=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"group",...r,ref:t})});Ri.displayName=C1;var N1="MenuLabel",hf=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});hf.displayName=N1;var Jo="MenuItem",bl="menu.itemSelect",Ts=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=m.useRef(null),a=Xr(Jo,e.__scopeMenu),c=Ni(Jo,e.__scopeMenu),u=Ee(t,s),l=m.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(bl,{bubbles:!0,cancelable:!0});d.addEventListener(bl,p=>r?.(p),{once:!0}),bd(d,h),h.defaultPrevented?l.current=!1:a.onClose()}};return i.jsx(gf,{...o,ref:u,disabled:n,onClick:oe(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:oe(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:oe(e.onKeyDown,d=>{const h=c.searchRef.current!=="";n||h&&d.key===" "||Ea.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ts.displayName=Jo;var gf=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=Ni(Jo,n),c=uf(n),u=m.useRef(null),l=Ee(t,u),[f,d]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const g=u.current;g&&p((g.textContent??"").trim())},[s.children]),i.jsx(Ir.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:i.jsx(x0,{asChild:!0,...c,focusable:!r,children:i.jsx(ve.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:oe(e.onPointerMove,Mr(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,Mr(g=>a.onItemLeave(g))),onFocus:oe(e.onFocus,()=>d(!0)),onBlur:oe(e.onBlur,()=>d(!1))})})})}),j1="MenuCheckboxItem",yf=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(_f,{scope:e.__scopeMenu,checked:n,children:i.jsx(Ts,{role:"menuitemcheckbox","aria-checked":Xo(n)?"mixed":n,...o,ref:t,"data-state":Ti(n),onSelect:oe(o.onSelect,()=>r?.(Xo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yf.displayName=j1;var bf="MenuRadioGroup",[R1,A1]=Bn(bf,{value:void 0,onValueChange:()=>{}}),vf=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Vt(r);return i.jsx(R1,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(Ri,{...o,ref:t})})});vf.displayName=bf;var xf="MenuRadioItem",wf=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=A1(xf,e.__scopeMenu),s=n===o.value;return i.jsx(_f,{scope:e.__scopeMenu,checked:s,children:i.jsx(Ts,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ti(s),onSelect:oe(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});wf.displayName=xf;var Ai="MenuItemIndicator",[_f,T1]=Bn(Ai,{checked:!1}),Sf=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=T1(Ai,n);return i.jsx(bn,{present:r||Xo(s.checked)||s.checked===!0,children:i.jsx(ve.span,{...o,ref:t,"data-state":Ti(s.checked)})})});Sf.displayName=Ai;var O1="MenuSeparator",kf=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kf.displayName=O1;var P1="MenuArrow",Ef=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=As(n);return i.jsx(Zd,{...o,...r,ref:t})});Ef.displayName=P1;var D1="MenuSub",[aA,Cf]=Bn(D1),Er="MenuSubTrigger",Nf=m.forwardRef((e,t)=>{const n=Vn(Er,e.__scopeMenu),r=Xr(Er,e.__scopeMenu),o=Cf(Er,e.__scopeMenu),s=Ni(Er,e.__scopeMenu),a=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,l={__scopeMenu:e.__scopeMenu},f=m.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return m.useEffect(()=>f,[f]),m.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),u(null)}},[c,u]),i.jsx(Ei,{asChild:!0,...l,children:i.jsx(gf,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Af(n.open),...e,ref:tn(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,Mr(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:oe(e.onPointerLeave,Mr(d=>{f();const h=n.content?.getBoundingClientRect();if(h){const p=n.content?.dataset.side,g=p==="right",y=g?-5:5,b=h[g?"left":"right"],v=h[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:b,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:b,y:h.bottom}],side:p}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,d=>{const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||p1[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Nf.displayName=Er;var jf="MenuSubContent",Rf=m.forwardRef((e,t)=>{const n=ff(yt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vn(yt,e.__scopeMenu),a=Xr(yt,e.__scopeMenu),c=Cf(jf,e.__scopeMenu),u=m.useRef(null),l=Ee(t,u);return i.jsx(Ir.Provider,{scope:e.__scopeMenu,children:i.jsx(bn,{present:r||s.open,children:i.jsx(Ir.Slot,{scope:e.__scopeMenu,children:i.jsx(ji,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:oe(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:oe(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),h=h1[a.dir].includes(f.key);d&&h&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});Rf.displayName=jf;function Af(e){return e?"open":"closed"}function Xo(e){return e==="indeterminate"}function Ti(e){return Xo(e)?"indeterminate":e?"checked":"unchecked"}function I1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function M1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $1(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=M1(e,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function F1(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],u=t[a],l=c.x,f=c.y,d=u.x,h=u.y;f>r!=h>r&&n<(d-l)*(r-f)/(h-f)+l&&(o=!o)}return o}function z1(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return F1(n,t)}function Mr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var L1=df,B1=Ei,V1=mf,U1=pf,W1=Ri,H1=hf,Z1=Ts,q1=yf,Y1=vf,G1=wf,K1=Sf,J1=kf,X1=Ef,Q1=Nf,e_=Rf,Os="DropdownMenu",[t_]=yn(Os,[lf]),ot=lf(),[n_,Tf]=t_(Os),Of=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:c=!0}=e,u=ot(t),l=m.useRef(null),[f,d]=Pr({prop:o,defaultProp:s??!1,onChange:a,caller:Os});return i.jsx(n_,{scope:t,triggerId:Kt(),triggerRef:l,contentId:Kt(),open:f,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:c,children:i.jsx(L1,{...u,open:f,onOpenChange:d,dir:r,modal:c,children:n})})};Of.displayName=Os;var Pf="DropdownMenuTrigger",Df=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Tf(Pf,n),a=ot(n);return i.jsx(B1,{asChild:!0,...a,children:i.jsx(ve.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:tn(t,s.triggerRef),onPointerDown:oe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:oe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Df.displayName=Pf;var r_="DropdownMenuPortal",If=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return i.jsx(V1,{...r,...n})};If.displayName=r_;var Mf="DropdownMenuContent",$f=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Tf(Mf,n),s=ot(n),a=m.useRef(!1);return i.jsx(U1,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,c=>{const u=c.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$f.displayName=Mf;var o_="DropdownMenuGroup",s_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(W1,{...o,...r,ref:t})});s_.displayName=o_;var a_="DropdownMenuLabel",i_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(H1,{...o,...r,ref:t})});i_.displayName=a_;var c_="DropdownMenuItem",Ff=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Z1,{...o,...r,ref:t})});Ff.displayName=c_;var l_="DropdownMenuCheckboxItem",u_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(q1,{...o,...r,ref:t})});u_.displayName=l_;var d_="DropdownMenuRadioGroup",f_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Y1,{...o,...r,ref:t})});f_.displayName=d_;var m_="DropdownMenuRadioItem",p_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(G1,{...o,...r,ref:t})});p_.displayName=m_;var h_="DropdownMenuItemIndicator",g_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(K1,{...o,...r,ref:t})});g_.displayName=h_;var y_="DropdownMenuSeparator",b_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(J1,{...o,...r,ref:t})});b_.displayName=y_;var v_="DropdownMenuArrow",x_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(X1,{...o,...r,ref:t})});x_.displayName=v_;var w_="DropdownMenuSubTrigger",__=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Q1,{...o,...r,ref:t})});__.displayName=w_;var S_="DropdownMenuSubContent",k_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(e_,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});k_.displayName=S_;var E_=Of,C_=Df,N_=If,j_=$f,R_=Ff;function Oi({...e}){return i.jsx(E_,{"data-slot":"dropdown-menu",...e})}function Pi({...e}){return i.jsx(C_,{"data-slot":"dropdown-menu-trigger",...e})}function Di({className:e,sideOffset:t=4,...n}){return i.jsx(N_,{children:i.jsx(j_,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ae("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function ar({className:e,inset:t,variant:n="default",...r}){return i.jsx(R_,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function A_(e){const t=T_(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(P_);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function T_(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=I_(o),c=D_(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O_=Symbol("radix.slottable");function P_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O_}function D_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function I_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps="Dialog",[zf,Lf]=yn(Ps),[M_,It]=zf(Ps),Bf=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=m.useRef(null),u=m.useRef(null),[l,f]=Pr({prop:r,defaultProp:o??!1,onChange:s,caller:Ps});return i.jsx(M_,{scope:t,triggerRef:c,contentRef:u,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:l,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Bf.displayName=Ps;var Vf="DialogTrigger",Uf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=It(Vf,n),s=Ee(t,o.triggerRef);return i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$i(o.open),...r,ref:s,onClick:oe(e.onClick,o.onOpenToggle)})});Uf.displayName=Vf;var Ii="DialogPortal",[$_,Wf]=zf(Ii,{forceMount:void 0}),Hf=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=It(Ii,t);return i.jsx($_,{scope:t,forceMount:n,children:m.Children.map(r,a=>i.jsx(bn,{present:n||s.open,children:i.jsx(Ns,{asChild:!0,container:o,children:a})}))})};Hf.displayName=Ii;var Qo="DialogOverlay",Zf=m.forwardRef((e,t)=>{const n=Wf(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=It(Qo,e.__scopeDialog);return s.modal?i.jsx(bn,{present:r||s.open,children:i.jsx(z_,{...o,ref:t})}):null});Zf.displayName=Qo;var F_=A_("DialogOverlay.RemoveScroll"),z_=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=It(Qo,n);return i.jsx(Rs,{as:F_,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(ve.div,{"data-state":$i(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),In="DialogContent",qf=m.forwardRef((e,t)=>{const n=Wf(In,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=It(In,e.__scopeDialog);return i.jsx(bn,{present:r||s.open,children:s.modal?i.jsx(L_,{...o,ref:t}):i.jsx(B_,{...o,ref:t})})});qf.displayName=In;var L_=m.forwardRef((e,t)=>{const n=It(In,e.__scopeDialog),r=m.useRef(null),o=Ee(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return ki(s)},[]),i.jsx(Yf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,s=>s.preventDefault())})}),B_=m.forwardRef((e,t)=>{const n=It(In,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return i.jsx(Yf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Yf=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,c=It(In,n),u=m.useRef(null),l=Ee(t,u);return hi(),i.jsxs(i.Fragment,{children:[i.jsx(ws,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(xs,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":$i(c.open),...a,ref:l,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(U_,{titleId:c.titleId}),i.jsx(H_,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Mi="DialogTitle",Gf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=It(Mi,n);return i.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Gf.displayName=Mi;var Kf="DialogDescription",Jf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=It(Kf,n);return i.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Jf.displayName=Kf;var Xf="DialogClose",Qf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=It(Xf,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:oe(e.onClick,()=>o.onOpenChange(!1))})});Qf.displayName=Xf;function $i(e){return e?"open":"closed"}var em="DialogTitleWarning",[V_,tm]=dx(em,{contentName:In,titleName:Mi,docsSlug:"dialog"}),U_=({titleId:e})=>{const t=tm(em),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
51
|
+
`)},c1=0,Gn=[];function l1(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(c1++)[0],s=m.useState(rf)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=A0([e.lockRef.current],(e.shards||[]).map(yl),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=No(y),w=n.current,S="deltaX"in y?y.deltaX:w[0]-v[0],_="deltaY"in y?y.deltaY:w[1]-v[1],N,$=y.target,O=Math.abs(S)>Math.abs(_)?"h":"v";if("touches"in y&&O==="h"&&$.type==="range")return!1;var T=window.getSelection(),W=T&&T.anchorNode,H=W?W===$||W.contains($):!1;if(H)return!1;var ne=hl(O,$);if(!ne)return!0;if(ne?N=O:(N=O==="v"?"h":"v",ne=hl(O,$)),!ne)return!1;if(!r.current&&"changedTouches"in y&&(S||_)&&(r.current=N),!N)return!0;var C=r.current||N;return s1(C,b,y,C==="h"?S:_)},[]),u=m.useCallback(function(y){var b=y;if(!(!Gn.length||Gn[Gn.length-1]!==s)){var v="deltaY"in b?gl(b):No(b),w=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&a1(N.delta,v)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var S=(a.current.shards||[]).map(yl).filter(Boolean).filter(function(N){return N.contains(b.target)}),_=S.length>0?c(b,S[0]):!a.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),l=m.useCallback(function(y,b,v,w){var S={name:y,delta:b,target:v,should:w,shadowParent:u1(v)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(_){return _!==S})},1)},[]),f=m.useCallback(function(y){n.current=No(y),r.current=void 0},[]),d=m.useCallback(function(y){l(y.type,gl(y),y.target,c(y,e.lockRef.current))},[]),p=m.useCallback(function(y){l(y.type,No(y),y.target,c(y,e.lockRef.current))},[]);m.useEffect(function(){return Gn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Zn),document.addEventListener("touchmove",u,Zn),document.addEventListener("touchstart",f,Zn),function(){Gn=Gn.filter(function(y){return y!==s}),document.removeEventListener("wheel",u,Zn),document.removeEventListener("touchmove",u,Zn),document.removeEventListener("touchstart",f,Zn)}},[]);var h=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:i1(o)}):null,h?m.createElement(X0,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function u1(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const d1=z0(nf,l1);var Rs=m.forwardRef(function(e,t){return m.createElement(js,zt({},e,{ref:t,sideCar:d1}))});Rs.classNames=js.classNames;var ka=["Enter"," "],f1=["ArrowDown","PageUp","Home"],cf=["ArrowUp","PageDown","End"],m1=[...f1,...cf],p1={ltr:[...ka,"ArrowRight"],rtl:[...ka,"ArrowLeft"]},h1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jr="Menu",[$r,g1,y1]=mi(Jr),[Vn,lf]=yn(Jr,[y1,Ns,Gd]),As=Ns(),uf=Gd(),[b1,Bn]=Vn(Jr),[v1,Xr]=Vn(Jr),df=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,c=As(t),[u,l]=m.useState(null),f=m.useRef(!1),d=Bt(s),p=pi(o);return m.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(Ud,{...c,children:i.jsx(b1,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:i.jsx(v1,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};df.displayName=Jr;var x1="MenuAnchor",ki=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=As(n);return i.jsx(qd,{...o,...r,ref:t})});ki.displayName=x1;var Ni="MenuPortal",[w1,ff]=Vn(Ni,{forceMount:void 0}),mf=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Bn(Ni,t);return i.jsx(w1,{scope:t,forceMount:n,children:i.jsx(bn,{present:n||s.open,children:i.jsx(Cs,{asChild:!0,container:o,children:r})})})};mf.displayName=Ni;var yt="MenuContent",[_1,Ci]=Vn(yt),pf=m.forwardRef((e,t)=>{const n=ff(yt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Bn(yt,e.__scopeMenu),a=Xr(yt,e.__scopeMenu);return i.jsx($r.Provider,{scope:e.__scopeMenu,children:i.jsx(bn,{present:r||s.open,children:i.jsx($r.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(S1,{...o,ref:t}):i.jsx(E1,{...o,ref:t})})})})}),S1=m.forwardRef((e,t)=>{const n=Bn(yt,e.__scopeMenu),r=m.useRef(null),o=ke(t,r);return m.useEffect(()=>{const s=r.current;if(s)return Ei(s)},[]),i.jsx(ji,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),E1=m.forwardRef((e,t)=>{const n=Bn(yt,e.__scopeMenu);return i.jsx(ji,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),k1=w0("MenuContent.ScrollLock"),ji=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...y}=e,b=Bn(yt,n),v=Xr(yt,n),w=As(n),S=uf(n),_=g1(n),[N,$]=m.useState(null),O=m.useRef(null),T=ke(t,O,b.onContentChange),W=m.useRef(0),H=m.useRef(""),ne=m.useRef(0),C=m.useRef(null),P=m.useRef("right"),z=m.useRef(0),Y=g?Rs:m.Fragment,D=g?{as:k1,allowPinchZoom:!0}:void 0,q=V=>{const F=H.current+V,R=_().filter(I=>!I.disabled),J=document.activeElement,G=R.find(I=>I.ref.current===J)?.textValue,X=R.map(I=>I.textValue),re=I1(X,F,G),ce=R.find(I=>I.textValue===re)?.ref.current;(function I(Q){H.current=Q,window.clearTimeout(W.current),Q!==""&&(W.current=window.setTimeout(()=>I(""),1e3))})(F),ce&&setTimeout(()=>ce.focus())};m.useEffect(()=>()=>window.clearTimeout(W.current),[]),hi();const B=m.useCallback(V=>P.current===C.current?.side&&z1(V,C.current?.area),[]);return i.jsx(_1,{scope:n,searchRef:H,onItemEnter:m.useCallback(V=>{B(V)&&V.preventDefault()},[B]),onItemLeave:m.useCallback(V=>{B(V)||(O.current?.focus(),$(null))},[B]),onTriggerLeave:m.useCallback(V=>{B(V)&&V.preventDefault()},[B]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:m.useCallback(V=>{C.current=V},[]),children:i.jsx(Y,{...D,children:i.jsx(ws,{asChild:!0,trapped:o,onMountAutoFocus:oe(s,V=>{V.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(xs,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:i.jsx(v0,{asChild:!0,...S,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:$,onEntryFocus:oe(u,V=>{v.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Wd,{role:"menu","aria-orientation":"vertical","data-state":Af(b.open),"data-radix-menu-content":"",dir:v.dir,...w,...y,ref:T,style:{outline:"none",...y.style},onKeyDown:oe(y.onKeyDown,V=>{const R=V.target.closest("[data-radix-menu-content]")===V.currentTarget,J=V.ctrlKey||V.altKey||V.metaKey,G=V.key.length===1;R&&(V.key==="Tab"&&V.preventDefault(),!J&&G&&q(V.key));const X=O.current;if(V.target!==X||!m1.includes(V.key))return;V.preventDefault();const ce=_().filter(I=>!I.disabled).map(I=>I.ref.current);cf.includes(V.key)&&ce.reverse(),$1(ce)}),onBlur:oe(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(W.current),H.current="")}),onPointerMove:oe(e.onPointerMove,Mr(V=>{const F=V.target,R=z.current!==V.clientX;if(V.currentTarget.contains(F)&&R){const J=V.clientX>z.current?"right":"left";P.current=J,z.current=V.clientX}}))})})})})})})});pf.displayName=yt;var N1="MenuGroup",Ri=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"group",...r,ref:t})});Ri.displayName=N1;var C1="MenuLabel",hf=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});hf.displayName=C1;var Jo="MenuItem",bl="menu.itemSelect",Ts=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=m.useRef(null),a=Xr(Jo,e.__scopeMenu),c=Ci(Jo,e.__scopeMenu),u=ke(t,s),l=m.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(bl,{bubbles:!0,cancelable:!0});d.addEventListener(bl,h=>r?.(h),{once:!0}),bd(d,p),p.defaultPrevented?l.current=!1:a.onClose()}};return i.jsx(gf,{...o,ref:u,disabled:n,onClick:oe(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:oe(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:oe(e.onKeyDown,d=>{const p=c.searchRef.current!=="";n||p&&d.key===" "||ka.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ts.displayName=Jo;var gf=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=Ci(Jo,n),c=uf(n),u=m.useRef(null),l=ke(t,u),[f,d]=m.useState(!1),[p,h]=m.useState("");return m.useEffect(()=>{const g=u.current;g&&h((g.textContent??"").trim())},[s.children]),i.jsx($r.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:i.jsx(x0,{asChild:!0,...c,focusable:!r,children:i.jsx(ve.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:oe(e.onPointerMove,Mr(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,Mr(g=>a.onItemLeave(g))),onFocus:oe(e.onFocus,()=>d(!0)),onBlur:oe(e.onBlur,()=>d(!1))})})})}),j1="MenuCheckboxItem",yf=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(_f,{scope:e.__scopeMenu,checked:n,children:i.jsx(Ts,{role:"menuitemcheckbox","aria-checked":Xo(n)?"mixed":n,...o,ref:t,"data-state":Ti(n),onSelect:oe(o.onSelect,()=>r?.(Xo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yf.displayName=j1;var bf="MenuRadioGroup",[R1,A1]=Vn(bf,{value:void 0,onValueChange:()=>{}}),vf=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Bt(r);return i.jsx(R1,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(Ri,{...o,ref:t})})});vf.displayName=bf;var xf="MenuRadioItem",wf=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=A1(xf,e.__scopeMenu),s=n===o.value;return i.jsx(_f,{scope:e.__scopeMenu,checked:s,children:i.jsx(Ts,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ti(s),onSelect:oe(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});wf.displayName=xf;var Ai="MenuItemIndicator",[_f,T1]=Vn(Ai,{checked:!1}),Sf=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=T1(Ai,n);return i.jsx(bn,{present:r||Xo(s.checked)||s.checked===!0,children:i.jsx(ve.span,{...o,ref:t,"data-state":Ti(s.checked)})})});Sf.displayName=Ai;var O1="MenuSeparator",Ef=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ef.displayName=O1;var P1="MenuArrow",kf=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=As(n);return i.jsx(Hd,{...o,...r,ref:t})});kf.displayName=P1;var D1="MenuSub",[aA,Nf]=Vn(D1),kr="MenuSubTrigger",Cf=m.forwardRef((e,t)=>{const n=Bn(kr,e.__scopeMenu),r=Xr(kr,e.__scopeMenu),o=Nf(kr,e.__scopeMenu),s=Ci(kr,e.__scopeMenu),a=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,l={__scopeMenu:e.__scopeMenu},f=m.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return m.useEffect(()=>f,[f]),m.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),u(null)}},[c,u]),i.jsx(ki,{asChild:!0,...l,children:i.jsx(gf,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Af(n.open),...e,ref:tn(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,Mr(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:oe(e.onPointerLeave,Mr(d=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,g=h==="right",y=g?-5:5,b=p[g?"left":"right"],v=p[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:b,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x:b,y:p.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,d=>{const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||p1[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Cf.displayName=kr;var jf="MenuSubContent",Rf=m.forwardRef((e,t)=>{const n=ff(yt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Bn(yt,e.__scopeMenu),a=Xr(yt,e.__scopeMenu),c=Nf(jf,e.__scopeMenu),u=m.useRef(null),l=ke(t,u);return i.jsx($r.Provider,{scope:e.__scopeMenu,children:i.jsx(bn,{present:r||s.open,children:i.jsx($r.Slot,{scope:e.__scopeMenu,children:i.jsx(ji,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:oe(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:oe(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),p=h1[a.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});Rf.displayName=jf;function Af(e){return e?"open":"closed"}function Xo(e){return e==="indeterminate"}function Ti(e){return Xo(e)?"indeterminate":e?"checked":"unchecked"}function $1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function M1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function I1(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=M1(e,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function F1(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],u=t[a],l=c.x,f=c.y,d=u.x,p=u.y;f>r!=p>r&&n<(d-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function z1(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return F1(n,t)}function Mr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var L1=df,V1=ki,B1=mf,U1=pf,q1=Ri,W1=hf,H1=Ts,Z1=yf,G1=vf,Y1=wf,K1=Sf,J1=Ef,X1=kf,Q1=Cf,e_=Rf,Os="DropdownMenu",[t_]=yn(Os,[lf]),ot=lf(),[n_,Tf]=t_(Os),Of=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:c=!0}=e,u=ot(t),l=m.useRef(null),[f,d]=Pr({prop:o,defaultProp:s??!1,onChange:a,caller:Os});return i.jsx(n_,{scope:t,triggerId:Kt(),triggerRef:l,contentId:Kt(),open:f,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(p=>!p),[d]),modal:c,children:i.jsx(L1,{...u,open:f,onOpenChange:d,dir:r,modal:c,children:n})})};Of.displayName=Os;var Pf="DropdownMenuTrigger",Df=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Tf(Pf,n),a=ot(n);return i.jsx(V1,{asChild:!0,...a,children:i.jsx(ve.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:tn(t,s.triggerRef),onPointerDown:oe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:oe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Df.displayName=Pf;var r_="DropdownMenuPortal",$f=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ot(t);return i.jsx(B1,{...r,...n})};$f.displayName=r_;var Mf="DropdownMenuContent",If=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Tf(Mf,n),s=ot(n),a=m.useRef(!1);return i.jsx(U1,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,c=>{const u=c.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0,f=u.button===2||l;(!o.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});If.displayName=Mf;var o_="DropdownMenuGroup",s_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(q1,{...o,...r,ref:t})});s_.displayName=o_;var a_="DropdownMenuLabel",i_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(W1,{...o,...r,ref:t})});i_.displayName=a_;var c_="DropdownMenuItem",Ff=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(H1,{...o,...r,ref:t})});Ff.displayName=c_;var l_="DropdownMenuCheckboxItem",u_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Z1,{...o,...r,ref:t})});u_.displayName=l_;var d_="DropdownMenuRadioGroup",f_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(G1,{...o,...r,ref:t})});f_.displayName=d_;var m_="DropdownMenuRadioItem",p_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Y1,{...o,...r,ref:t})});p_.displayName=m_;var h_="DropdownMenuItemIndicator",g_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(K1,{...o,...r,ref:t})});g_.displayName=h_;var y_="DropdownMenuSeparator",b_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(J1,{...o,...r,ref:t})});b_.displayName=y_;var v_="DropdownMenuArrow",x_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(X1,{...o,...r,ref:t})});x_.displayName=v_;var w_="DropdownMenuSubTrigger",__=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(Q1,{...o,...r,ref:t})});__.displayName=w_;var S_="DropdownMenuSubContent",E_=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ot(n);return i.jsx(e_,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E_.displayName=S_;var k_=Of,N_=Df,C_=$f,j_=If,R_=Ff;function Oi({...e}){return i.jsx(k_,{"data-slot":"dropdown-menu",...e})}function Pi({...e}){return i.jsx(N_,{"data-slot":"dropdown-menu-trigger",...e})}function Di({className:e,sideOffset:t=4,...n}){return i.jsx(C_,{children:i.jsx(j_,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ae("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function ar({className:e,inset:t,variant:n="default",...r}){return i.jsx(R_,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function A_(e){const t=T_(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(P_);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function T_(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=$_(o),c=D_(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O_=Symbol("radix.slottable");function P_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O_}function D_(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps="Dialog",[zf,Lf]=yn(Ps),[M_,$t]=zf(Ps),Vf=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=m.useRef(null),u=m.useRef(null),[l,f]=Pr({prop:r,defaultProp:o??!1,onChange:s,caller:Ps});return i.jsx(M_,{scope:t,triggerRef:c,contentRef:u,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:l,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Vf.displayName=Ps;var Bf="DialogTrigger",Uf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Bf,n),s=ke(t,o.triggerRef);return i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ii(o.open),...r,ref:s,onClick:oe(e.onClick,o.onOpenToggle)})});Uf.displayName=Bf;var $i="DialogPortal",[I_,qf]=zf($i,{forceMount:void 0}),Wf=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=$t($i,t);return i.jsx(I_,{scope:t,forceMount:n,children:m.Children.map(r,a=>i.jsx(bn,{present:n||s.open,children:i.jsx(Cs,{asChild:!0,container:o,children:a})}))})};Wf.displayName=$i;var Qo="DialogOverlay",Hf=m.forwardRef((e,t)=>{const n=qf(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=$t(Qo,e.__scopeDialog);return s.modal?i.jsx(bn,{present:r||s.open,children:i.jsx(z_,{...o,ref:t})}):null});Hf.displayName=Qo;var F_=A_("DialogOverlay.RemoveScroll"),z_=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Qo,n);return i.jsx(Rs,{as:F_,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(ve.div,{"data-state":Ii(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$n="DialogContent",Zf=m.forwardRef((e,t)=>{const n=qf($n,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=$t($n,e.__scopeDialog);return i.jsx(bn,{present:r||s.open,children:s.modal?i.jsx(L_,{...o,ref:t}):i.jsx(V_,{...o,ref:t})})});Zf.displayName=$n;var L_=m.forwardRef((e,t)=>{const n=$t($n,e.__scopeDialog),r=m.useRef(null),o=ke(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return Ei(s)},[]),i.jsx(Gf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,s=>s.preventDefault())})}),V_=m.forwardRef((e,t)=>{const n=$t($n,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return i.jsx(Gf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Gf=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,c=$t($n,n),u=m.useRef(null),l=ke(t,u);return hi(),i.jsxs(i.Fragment,{children:[i.jsx(ws,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(xs,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ii(c.open),...a,ref:l,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(U_,{titleId:c.titleId}),i.jsx(W_,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Mi="DialogTitle",Yf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Mi,n);return i.jsx(ve.h2,{id:o.titleId,...r,ref:t})});Yf.displayName=Mi;var Kf="DialogDescription",Jf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Kf,n);return i.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});Jf.displayName=Kf;var Xf="DialogClose",Qf=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Xf,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:oe(e.onClick,()=>o.onOpenChange(!1))})});Qf.displayName=Xf;function Ii(e){return e?"open":"closed"}var em="DialogTitleWarning",[B_,tm]=dx(em,{contentName:$n,titleName:Mi,docsSlug:"dialog"}),U_=({titleId:e})=>{const t=tm(em),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
52
52
|
|
|
53
53
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
54
|
|
|
55
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},
|
|
55
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},q_="DialogDescriptionWarning",W_=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tm(q_).contentName}}.`;return m.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},nm=Vf,H_=Uf,rm=Wf,om=Hf,sm=Zf,am=Yf,im=Jf,Fi=Qf,Z_=Symbol("radix.slottable");function G_(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Z_,t}var cm="AlertDialog",[Y_]=yn(cm,[Lf]),rn=Lf(),lm=e=>{const{__scopeAlertDialog:t,...n}=e,r=rn(t);return i.jsx(nm,{...r,...n,modal:!0})};lm.displayName=cm;var K_="AlertDialogTrigger",um=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=rn(n);return i.jsx(H_,{...o,...r,ref:t})});um.displayName=K_;var J_="AlertDialogPortal",dm=e=>{const{__scopeAlertDialog:t,...n}=e,r=rn(t);return i.jsx(rm,{...r,...n})};dm.displayName=J_;var X_="AlertDialogOverlay",fm=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=rn(n);return i.jsx(om,{...o,...r,ref:t})});fm.displayName=X_;var tr="AlertDialogContent",[Q_,eS]=Y_(tr),tS=G_("AlertDialogContent"),mm=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,s=rn(n),a=m.useRef(null),c=ke(t,a),u=m.useRef(null);return i.jsx(B_,{contentName:tr,titleName:pm,docsSlug:"alert-dialog",children:i.jsx(Q_,{scope:n,cancelRef:u,children:i.jsxs(sm,{role:"alertdialog",...s,...o,ref:c,onOpenAutoFocus:oe(o.onOpenAutoFocus,l=>{l.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[i.jsx(tS,{children:r}),i.jsx(rS,{contentRef:a})]})})})});mm.displayName=tr;var pm="AlertDialogTitle",hm=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=rn(n);return i.jsx(am,{...o,...r,ref:t})});hm.displayName=pm;var gm="AlertDialogDescription",ym=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=rn(n);return i.jsx(im,{...o,...r,ref:t})});ym.displayName=gm;var nS="AlertDialogAction",bm=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=rn(n);return i.jsx(Fi,{...o,...r,ref:t})});bm.displayName=nS;var vm="AlertDialogCancel",xm=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=eS(vm,n),s=rn(n),a=ke(t,o);return i.jsx(Fi,{...s,...r,ref:a})});xm.displayName=vm;var rS=({contentRef:e})=>{const t=`\`${tr}\` requires a description for the component to be accessible for screen reader users.
|
|
56
56
|
|
|
57
57
|
You can add a description to the \`${tr}\` by passing a \`${gm}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
58
58
|
|
|
59
59
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${tr}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
60
60
|
|
|
61
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},oS=lm,sS=um,aS=dm,iS=fm,cS=mm,lS=bm,uS=xm,dS=hm,fS=ym;function Qr({...e}){return i.jsx(oS,{"data-slot":"alert-dialog",...e})}function mS({...e}){return i.jsx(sS,{"data-slot":"alert-dialog-trigger",...e})}function pS({...e}){return i.jsx(aS,{"data-slot":"alert-dialog-portal",...e})}function hS({className:e,...t}){return i.jsx(iS,{"data-slot":"alert-dialog-overlay",className:ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eo({className:e,...t}){return i.jsxs(pS,{children:[i.jsx(hS,{}),i.jsx(cS,{"data-slot":"alert-dialog-content",className:ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function to({className:e,...t}){return i.jsx("div",{"data-slot":"alert-dialog-header",className:ae("flex flex-col gap-2 text-center sm:text-start",e),...t})}function no({className:e,...t}){return i.jsx("div",{"data-slot":"alert-dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ro({className:e,...t}){return i.jsx(dS,{"data-slot":"alert-dialog-title",className:ae("text-lg font-semibold",e),...t})}function oo({className:e,...t}){return i.jsx(fS,{"data-slot":"alert-dialog-description",className:ae("text-muted-foreground text-sm",e),...t})}function so({className:e,...t}){return i.jsx(lS,{className:ae(fi(),e),...t})}function ao({className:e,...t}){return i.jsx(uS,{className:ae(fi({variant:"outline"}),e),...t})}function gS(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yS=e=>{switch(e){case"success":return xS;case"info":return _S;case"warning":return wS;case"error":return SS;default:return null}},bS=Array(12).fill(0),vS=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},bS.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),xS=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wS=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_S=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SS=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kS=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ES=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ca=1;class CS{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Ca++,a=this.toasts.find(u=>u.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:r}),{...u,...t,id:s,dismissible:c,title:r}):u):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,a;const c=o.then(async l=>{if(a=["resolve",l],E.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(jS(l)&&!l.ok){s=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,g=typeof d=="object"&&!E.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:h,...g})}else if(l instanceof Error){s=!1;const d=typeof n.error=="function"?await n.error(l):n.error,h=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!E.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:h,...g})}else if(n.success!==void 0){s=!1;const d=typeof n.success=="function"?await n.success(l):n.success,h=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!E.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:h,...g})}}).catch(async l=>{if(a=["reject",l],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,p=typeof f=="object"&&!E.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:d,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((l,f)=>c.then(()=>a[0]==="reject"?f(a[1]):l(a[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||Ca++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const st=new CS,NS=(e,t)=>{const n=t?.id||Ca++;return st.addToast({title:e,...t,id:n}),n},jS=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",RS=NS,AS=()=>st.toasts,TS=()=>st.getActiveToasts(),Ce=Object.assign(RS,{success:st.success,info:st.info,warning:st.warning,error:st.error,custom:st.custom,message:st.message,promise:st.promise,dismiss:st.dismiss,loading:st.loading},{getHistory:AS,getToasts:TS});gS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function No(e){return e.label!==void 0}const OS=3,PS="24px",DS="16px",vl=4e3,IS=356,MS=14,$S=45,FS=200;function Ft(...e){return e.filter(Boolean).join(" ")}function zS(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const LS=e=>{var t,n,r,o,s,a,c,u,l;const{invert:f,toast:d,unstyled:h,interacting:p,setHeights:g,visibleToasts:y,heights:b,index:v,toasts:w,expanded:S,removeToast:_,defaultRichColors:C,closeButton:I,style:O,cancelButtonStyle:T,actionButtonStyle:H,className:Z="",descriptionClassName:ne="",duration:N,position:P,gap:z,expandByDefault:G,classNames:D,icons:W,closeButtonAriaLabel:V="Close toast"}=e,[B,F]=E.useState(null),[R,J]=E.useState(null),[Y,X]=E.useState(!1),[re,ce]=E.useState(!1),[$,Q]=E.useState(!1),[le,me]=E.useState(!1),[he,be]=E.useState(!1),[De,We]=E.useState(0),[sn,Wt]=E.useState(0),vt=E.useRef(d.duration||N||vl),lo=E.useRef(null),Mt=E.useRef(null),uo=v===0,x=v+1<=y,k=d.type,A=d.dismissible!==!1,K=d.className||"",U=d.descriptionClassName||"",L=E.useMemo(()=>b.findIndex(de=>de.toastId===d.id)||0,[b,d.id]),se=E.useMemo(()=>{var de;return(de=d.closeButton)!=null?de:I},[d.closeButton,I]),we=E.useMemo(()=>d.duration||N||vl,[d.duration,N]),xe=E.useRef(0),Oe=E.useRef(0),$t=E.useRef(0),Qe=E.useRef(null),[Zs,pr]=P.split("-"),Wn=E.useMemo(()=>b.reduce((de,He,Ke)=>Ke>=L?de:de+He.height,0),[b,L]),fo=ES(),mo=d.invert||f,hr=k==="loading";Oe.current=E.useMemo(()=>L*z+Wn,[L,Wn]),E.useEffect(()=>{vt.current=we},[we]),E.useEffect(()=>{X(!0)},[]),E.useEffect(()=>{const de=Mt.current;if(de){const He=de.getBoundingClientRect().height;return Wt(He),g(Ke=>[{toastId:d.id,height:He,position:d.position},...Ke]),()=>g(Ke=>Ke.filter(ut=>ut.toastId!==d.id))}},[g,d.id]),E.useLayoutEffect(()=>{if(!Y)return;const de=Mt.current,He=de.style.height;de.style.height="auto";const Ke=de.getBoundingClientRect().height;de.style.height=He,Wt(Ke),g(ut=>ut.find(Ye=>Ye.toastId===d.id)?ut.map(Ye=>Ye.toastId===d.id?{...Ye,height:Ke}:Ye):[{toastId:d.id,height:Ke,position:d.position},...ut])},[Y,d.title,d.description,g,d.id,d.jsx,d.action,d.cancel]);const xt=E.useCallback(()=>{ce(!0),We(Oe.current),g(de=>de.filter(He=>He.toastId!==d.id)),setTimeout(()=>{_(d)},FS)},[d,_,g,Oe]);E.useEffect(()=>{if(d.promise&&k==="loading"||d.duration===1/0||d.type==="loading")return;let de;return S||p||fo?(()=>{if($t.current<xe.current){const ut=new Date().getTime()-xe.current;vt.current=vt.current-ut}$t.current=new Date().getTime()})():vt.current!==1/0&&(xe.current=new Date().getTime(),de=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),xt()},vt.current)),()=>clearTimeout(de)},[S,p,d,k,fo,xt]),E.useEffect(()=>{d.delete&&(xt(),d.onDismiss==null||d.onDismiss.call(d,d))},[xt,d.delete]);function Up(){var de;if(W?.loading){var He;return E.createElement("div",{className:Ft(D?.loader,d==null||(He=d.classNames)==null?void 0:He.loader,"sonner-loader"),"data-visible":k==="loading"},W.loading)}return E.createElement(vS,{className:Ft(D?.loader,d==null||(de=d.classNames)==null?void 0:de.loader),visible:k==="loading"})}const Wp=d.icon||W?.[k]||yS(k);var sc,ac;return E.createElement("li",{tabIndex:0,ref:Mt,className:Ft(Z,K,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[k],d==null||(n=d.classNames)==null?void 0:n[k]),"data-sonner-toast":"","data-rich-colors":(sc=d.richColors)!=null?sc:C,"data-styled":!(d.jsx||d.unstyled||h),"data-mounted":Y,"data-promise":!!d.promise,"data-swiped":he,"data-removed":re,"data-visible":x,"data-y-position":Zs,"data-x-position":pr,"data-index":v,"data-front":uo,"data-swiping":$,"data-dismissible":A,"data-type":k,"data-invert":mo,"data-swipe-out":le,"data-swipe-direction":R,"data-expanded":!!(S||G&&Y),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":w.length-v,"--offset":`${re?De:Oe.current}px`,"--initial-height":G?"auto":`${sn}px`,...O,...d.style},onDragEnd:()=>{Q(!1),F(null),Qe.current=null},onPointerDown:de=>{de.button!==2&&(hr||!A||(lo.current=new Date,We(Oe.current),de.target.setPointerCapture(de.pointerId),de.target.tagName!=="BUTTON"&&(Q(!0),Qe.current={x:de.clientX,y:de.clientY})))},onPointerUp:()=>{var de,He,Ke;if(le||!A)return;Qe.current=null;const ut=Number(((de=Mt.current)==null?void 0:de.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),po=Number(((He=Mt.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ye=new Date().getTime()-((Ke=lo.current)==null?void 0:Ke.getTime()),ht=B==="x"?ut:po,ho=Math.abs(ht)/Ye;if(Math.abs(ht)>=$S||ho>.11){We(Oe.current),d.onDismiss==null||d.onDismiss.call(d,d),J(B==="x"?ut>0?"right":"left":po>0?"down":"up"),xt(),me(!0);return}else{var wt,_t;(wt=Mt.current)==null||wt.style.setProperty("--swipe-amount-x","0px"),(_t=Mt.current)==null||_t.style.setProperty("--swipe-amount-y","0px")}be(!1),Q(!1),F(null)},onPointerMove:de=>{var He,Ke,ut;if(!Qe.current||!A||((He=window.getSelection())==null?void 0:He.toString().length)>0)return;const Ye=de.clientY-Qe.current.y,ht=de.clientX-Qe.current.x;var ho;const wt=(ho=e.swipeDirections)!=null?ho:zS(P);!B&&(Math.abs(ht)>1||Math.abs(Ye)>1)&&F(Math.abs(ht)>Math.abs(Ye)?"x":"y");let _t={x:0,y:0};const ic=Sn=>1/(1.5+Math.abs(Sn)/20);if(B==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&Ye<0||wt.includes("bottom")&&Ye>0)_t.y=Ye;else{const Sn=Ye*ic(Ye);_t.y=Math.abs(Sn)<Math.abs(Ye)?Sn:Ye}}else if(B==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&ht<0||wt.includes("right")&&ht>0)_t.x=ht;else{const Sn=ht*ic(ht);_t.x=Math.abs(Sn)<Math.abs(ht)?Sn:ht}(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&be(!0),(Ke=Mt.current)==null||Ke.style.setProperty("--swipe-amount-x",`${_t.x}px`),(ut=Mt.current)==null||ut.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},se&&!d.jsx&&k!=="loading"?E.createElement("button",{"aria-label":V,"data-disabled":hr,"data-close-button":!0,onClick:hr||!A?()=>{}:()=>{xt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Ft(D?.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(ac=W?.close)!=null?ac:kS):null,(k||d.icon||d.promise)&&d.icon!==null&&(W?.[k]!==null||d.icon)?E.createElement("div",{"data-icon":"",className:Ft(D?.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Up():null,d.type!=="loading"?Wp:null):null,E.createElement("div",{"data-content":"",className:Ft(D?.content,d==null||(s=d.classNames)==null?void 0:s.content)},E.createElement("div",{"data-title":"",className:Ft(D?.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?E.createElement("div",{"data-description":"",className:Ft(ne,U,D?.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),E.isValidElement(d.cancel)?d.cancel:d.cancel&&No(d.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:de=>{No(d.cancel)&&A&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,de),xt())},className:Ft(D?.cancelButton,d==null||(u=d.classNames)==null?void 0:u.cancelButton)},d.cancel.label):null,E.isValidElement(d.action)?d.action:d.action&&No(d.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||H,onClick:de=>{No(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,de),!de.defaultPrevented&&xt())},className:Ft(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function xl(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function BS(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,a=s?"--mobile-offset":"--offset",c=s?DS:PS;function u(l){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${a}-${l}`]=c:n[`${a}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):u(c)}),n}const VS=E.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:u,className:l,offset:f,mobileOffset:d,theme:h="light",richColors:p,duration:g,style:y,visibleToasts:b=OS,toastOptions:v,dir:w=xl(),gap:S=MS,icons:_,containerAriaLabel:C="Notifications"}=t,[I,O]=E.useState([]),T=E.useMemo(()=>r?I.filter(Y=>Y.toasterId===r):I.filter(Y=>!Y.toasterId),[I,r]),H=E.useMemo(()=>Array.from(new Set([s].concat(T.filter(Y=>Y.position).map(Y=>Y.position)))),[T,s]),[Z,ne]=E.useState([]),[N,P]=E.useState(!1),[z,G]=E.useState(!1),[D,W]=E.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=E.useRef(null),B=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=E.useRef(null),R=E.useRef(!1),J=E.useCallback(Y=>{O(X=>{var re;return(re=X.find(ce=>ce.id===Y.id))!=null&&re.delete||st.dismiss(Y.id),X.filter(({id:ce})=>ce!==Y.id)})},[]);return E.useEffect(()=>st.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{O(X=>X.map(re=>re.id===Y.id?{...re,delete:!0}:re))});return}setTimeout(()=>{qa.flushSync(()=>{O(X=>{const re=X.findIndex(ce=>ce.id===Y.id);return re!==-1?[...X.slice(0,re),{...X[re],...Y},...X.slice(re+1)]:[Y,...X]})})})}),[I]),E.useEffect(()=>{if(h!=="system"){W(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:X})=>{W(X?"dark":"light")})}catch{Y.addListener(({matches:re})=>{try{W(re?"dark":"light")}catch(ce){console.error(ce)}})}},[h]),E.useEffect(()=>{I.length<=1&&P(!1)},[I]),E.useEffect(()=>{const Y=X=>{var re;if(a.every(Q=>X[Q]||X.code===Q)){var $;P(!0),($=V.current)==null||$.focus()}X.code==="Escape"&&(document.activeElement===V.current||(re=V.current)!=null&&re.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[a]),E.useEffect(()=>{if(V.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,R.current=!1)}},[V.current]),E.createElement("section",{ref:n,"aria-label":`${C} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((Y,X)=>{var re;const[ce,$]=Y.split("-");return T.length?E.createElement("ol",{key:Y,dir:w==="auto"?xl():w,tabIndex:-1,ref:V,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":$,style:{"--front-toast-height":`${((re=Z[0])==null?void 0:re.height)||0}px`,"--width":`${IS}px`,"--gap":`${S}px`,...y,...BS(f,d)},onBlur:Q=>{R.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(R.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||R.current||(R.current=!0,F.current=Q.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{z||P(!1)},onDragEnd:()=>P(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},T.filter(Q=>!Q.position&&X===0||Q.position===Y).map((Q,le)=>{var me,he;return E.createElement(LS,{key:Q.id,icons:_,index:le,toast:Q,defaultRichColors:p,duration:(me=v?.duration)!=null?me:g,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(he=v?.closeButton)!=null?he:u,interacting:z,position:Y,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:J,toasts:T.filter(be=>be.position==Q.position),heights:Z.filter(be=>be.position==Q.position),setHeights:ne,expandByDefault:c,gap:S,expanded:N,swipeDirections:t.swipeDirections})})):null}))});function zi(){const e=ti(),{list:t,loading:n}=ni(f=>f.jobs),r=Array.isArray(t)?t:[],[o,s]=m.useState(null),[a,c]=m.useState(new Set);m.useEffect(()=>{e(Xn());const f=setInterval(()=>e(Xn()),8e3);return()=>clearInterval(f)},[e]);const u=async()=>{if(o)try{await e(nd(o.id)).unwrap(),Ce.success(`Job "${o.name}" deleted`),s(null)}catch{Ce.error("Failed to delete job")}},l=async f=>{c(d=>new Set(d).add(f));try{await e(Ib(f)).unwrap(),Ce.success("Job triggered"),e(Xn())}catch{Ce.error("Failed to run job")}finally{c(d=>{const h=new Set(d);return h.delete(f),h})}};return n&&r.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Backup Jobs"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Scheduled and manual backup tasks"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]}),r.length===0?i.jsx("div",{children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No jobs yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a backup job to connect a source to a target"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:r.map(f=>{const d=f.last_run??f.lastRun,h=d?pd[d.status]:null,p=d?.status==="running",g=a.has(f.id),y=f.source_type??f.sourceType,b=f.target_type??f.targetType,v=y?fd[y]:null,w=b?md[b]:null,S=v?.icon,_=w?.icon,C=d?.started_at??d?.startedAt,I=d?.data_added_bytes??d?.dataAddedBytes;return i.jsx("div",{className:"space-y-3",children:i.jsx(Pe,{to:"/jobs/$id",params:{id:f.id},className:"block",children:i.jsx(At,{className:"py-0 transition-all hover:-translate-y-0.5 hover:shadow-md",children:i.jsxs(Tt,{className:"space-y-6 p-5",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h3",{className:"truncate text-base font-semibold",children:f.name})}),i.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-sm text-muted-foreground",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[S?i.jsx(S,{className:"h-3.5 w-3.5 shrink-0"}):null,i.jsx("span",{className:"truncate max-w-[120px]",children:f.source_name??f.sourceName})]}),i.jsx(sh,{className:"h-3 w-3 shrink-0"}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[_?i.jsx(_,{className:"h-3.5 w-3.5 shrink-0"}):null,i.jsx("span",{className:"truncate max-w-[120px]",children:f.target_name??f.targetName})]})]})]}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,onClick:O=>O.preventDefault(),children:i.jsx(ge,{variant:"ghost",size:"icon",className:"h-9 w-9",title:"More actions",children:i.jsx(Ga,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsx(ar,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/$id/edit",params:{id:f.id},children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]})}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:O=>{O.preventDefault(),s(f)},children:[i.jsx(Br,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(Ie,{variant:"outline",className:"font-mono text-xs",children:f.schedule||"Manual"}),h?i.jsx(Ie,{className:ae("text-xs",h.badge),children:h.label}):i.jsx(Ie,{variant:"secondary",className:"text-xs",children:"Never run"})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide",children:"Last Run"}),i.jsx("div",{className:"mt-1 text-foreground truncate",children:d?ci(C):"Never"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide",children:"Data Added"}),i.jsx("div",{className:"mt-1 text-foreground",children:I&&I>0?cr(I):"-"})]}),i.jsx("div",{children:i.jsx(ge,{variant:"default",size:"sm",className:"h-9 px-3 rounded-full",title:"Run",disabled:p||g,onClick:()=>l(f.id),children:i.jsx(Ja,{className:"h-3.5 w-3.5"})})})]})]})})})},f.id)})}),i.jsx(Qr,{open:!!o,onOpenChange:f=>!f&&s(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Job"}),i.jsxs(oo,{children:['Delete "',o?.name,'"? Run history will also be deleted.']})]}),i.jsxs(no,{className:"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:u,children:"Delete"})]})]})})]})}function US(e,t){const n=t||"latest",r=e.resticRepository||"",o=e.resticPassword||"",s=e.awsAccessKeyId||"",a=e.awsSecretAccessKey||"",c=e.b2AccountId||"",u=e.b2AccountKey||"",l=e.jobName||"backup-job",f=e.connectorType||"s3";let d=`export RESTIC_REPOSITORY="${r}"
|
|
61
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},oS=lm,sS=um,aS=dm,iS=fm,cS=mm,lS=bm,uS=xm,dS=hm,fS=ym;function Qr({...e}){return i.jsx(oS,{"data-slot":"alert-dialog",...e})}function mS({...e}){return i.jsx(sS,{"data-slot":"alert-dialog-trigger",...e})}function pS({...e}){return i.jsx(aS,{"data-slot":"alert-dialog-portal",...e})}function hS({className:e,...t}){return i.jsx(iS,{"data-slot":"alert-dialog-overlay",className:ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eo({className:e,...t}){return i.jsxs(pS,{children:[i.jsx(hS,{}),i.jsx(cS,{"data-slot":"alert-dialog-content",className:ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function to({className:e,...t}){return i.jsx("div",{"data-slot":"alert-dialog-header",className:ae("flex flex-col gap-2 text-center sm:text-start",e),...t})}function no({className:e,...t}){return i.jsx("div",{"data-slot":"alert-dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ro({className:e,...t}){return i.jsx(dS,{"data-slot":"alert-dialog-title",className:ae("text-lg font-semibold",e),...t})}function oo({className:e,...t}){return i.jsx(fS,{"data-slot":"alert-dialog-description",className:ae("text-muted-foreground text-sm",e),...t})}function so({className:e,...t}){return i.jsx(lS,{className:ae(fi(),e),...t})}function ao({className:e,...t}){return i.jsx(uS,{className:ae(fi({variant:"outline"}),e),...t})}function gS(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yS=e=>{switch(e){case"success":return xS;case"info":return _S;case"warning":return wS;case"error":return SS;default:return null}},bS=Array(12).fill(0),vS=({visible:e,className:t})=>k.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},k.createElement("div",{className:"sonner-spinner"},bS.map((n,r)=>k.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),xS=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wS=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_S=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SS=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ES=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},k.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),k.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kS=()=>{const[e,t]=k.useState(document.hidden);return k.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Na=1;class NS{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Na++,a=this.toasts.find(u=>u.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:r}),{...u,...t,id:s,dismissible:c,title:r}):u):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,a;const c=o.then(async l=>{if(a=["resolve",l],k.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(jS(l)&&!l.ok){s=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,g=typeof d=="object"&&!k.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...g})}else if(l instanceof Error){s=!1;const d=typeof n.error=="function"?await n.error(l):n.error,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!k.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...g})}else if(n.success!==void 0){s=!1;const d=typeof n.success=="function"?await n.success(l):n.success,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!k.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...g})}}).catch(async l=>{if(a=["reject",l],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,h=typeof f=="object"&&!k.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:d,...h})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((l,f)=>c.then(()=>a[0]==="reject"?f(a[1]):l(a[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||Na++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const st=new NS,CS=(e,t)=>{const n=t?.id||Na++;return st.addToast({title:e,...t,id:n}),n},jS=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",RS=CS,AS=()=>st.toasts,TS=()=>st.getActiveToasts(),Ne=Object.assign(RS,{success:st.success,info:st.info,warning:st.warning,error:st.error,custom:st.custom,message:st.message,promise:st.promise,dismiss:st.dismiss,loading:st.loading},{getHistory:AS,getToasts:TS});gS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Co(e){return e.label!==void 0}const OS=3,PS="24px",DS="16px",vl=4e3,$S=356,MS=14,IS=45,FS=200;function Ft(...e){return e.filter(Boolean).join(" ")}function zS(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const LS=e=>{var t,n,r,o,s,a,c,u,l;const{invert:f,toast:d,unstyled:p,interacting:h,setHeights:g,visibleToasts:y,heights:b,index:v,toasts:w,expanded:S,removeToast:_,defaultRichColors:N,closeButton:$,style:O,cancelButtonStyle:T,actionButtonStyle:W,className:H="",descriptionClassName:ne="",duration:C,position:P,gap:z,expandByDefault:Y,classNames:D,icons:q,closeButtonAriaLabel:B="Close toast"}=e,[V,F]=k.useState(null),[R,J]=k.useState(null),[G,X]=k.useState(!1),[re,ce]=k.useState(!1),[I,Q]=k.useState(!1),[le,me]=k.useState(!1),[he,be]=k.useState(!1),[De,qe]=k.useState(0),[sn,qt]=k.useState(0),vt=k.useRef(d.duration||C||vl),lo=k.useRef(null),Mt=k.useRef(null),uo=v===0,x=v+1<=y,E=d.type,A=d.dismissible!==!1,K=d.className||"",U=d.descriptionClassName||"",L=k.useMemo(()=>b.findIndex(de=>de.toastId===d.id)||0,[b,d.id]),se=k.useMemo(()=>{var de;return(de=d.closeButton)!=null?de:$},[d.closeButton,$]),we=k.useMemo(()=>d.duration||C||vl,[d.duration,C]),xe=k.useRef(0),Oe=k.useRef(0),It=k.useRef(0),Qe=k.useRef(null),[Hs,pr]=P.split("-"),qn=k.useMemo(()=>b.reduce((de,We,Ke)=>Ke>=L?de:de+We.height,0),[b,L]),fo=kS(),mo=d.invert||f,hr=E==="loading";Oe.current=k.useMemo(()=>L*z+qn,[L,qn]),k.useEffect(()=>{vt.current=we},[we]),k.useEffect(()=>{X(!0)},[]),k.useEffect(()=>{const de=Mt.current;if(de){const We=de.getBoundingClientRect().height;return qt(We),g(Ke=>[{toastId:d.id,height:We,position:d.position},...Ke]),()=>g(Ke=>Ke.filter(ut=>ut.toastId!==d.id))}},[g,d.id]),k.useLayoutEffect(()=>{if(!G)return;const de=Mt.current,We=de.style.height;de.style.height="auto";const Ke=de.getBoundingClientRect().height;de.style.height=We,qt(Ke),g(ut=>ut.find(Ge=>Ge.toastId===d.id)?ut.map(Ge=>Ge.toastId===d.id?{...Ge,height:Ke}:Ge):[{toastId:d.id,height:Ke,position:d.position},...ut])},[G,d.title,d.description,g,d.id,d.jsx,d.action,d.cancel]);const xt=k.useCallback(()=>{ce(!0),qe(Oe.current),g(de=>de.filter(We=>We.toastId!==d.id)),setTimeout(()=>{_(d)},FS)},[d,_,g,Oe]);k.useEffect(()=>{if(d.promise&&E==="loading"||d.duration===1/0||d.type==="loading")return;let de;return S||h||fo?(()=>{if(It.current<xe.current){const ut=new Date().getTime()-xe.current;vt.current=vt.current-ut}It.current=new Date().getTime()})():vt.current!==1/0&&(xe.current=new Date().getTime(),de=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),xt()},vt.current)),()=>clearTimeout(de)},[S,h,d,E,fo,xt]),k.useEffect(()=>{d.delete&&(xt(),d.onDismiss==null||d.onDismiss.call(d,d))},[xt,d.delete]);function Up(){var de;if(q?.loading){var We;return k.createElement("div",{className:Ft(D?.loader,d==null||(We=d.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":E==="loading"},q.loading)}return k.createElement(vS,{className:Ft(D?.loader,d==null||(de=d.classNames)==null?void 0:de.loader),visible:E==="loading"})}const qp=d.icon||q?.[E]||yS(E);var sc,ac;return k.createElement("li",{tabIndex:0,ref:Mt,className:Ft(H,K,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[E],d==null||(n=d.classNames)==null?void 0:n[E]),"data-sonner-toast":"","data-rich-colors":(sc=d.richColors)!=null?sc:N,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":G,"data-promise":!!d.promise,"data-swiped":he,"data-removed":re,"data-visible":x,"data-y-position":Hs,"data-x-position":pr,"data-index":v,"data-front":uo,"data-swiping":I,"data-dismissible":A,"data-type":E,"data-invert":mo,"data-swipe-out":le,"data-swipe-direction":R,"data-expanded":!!(S||Y&&G),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":w.length-v,"--offset":`${re?De:Oe.current}px`,"--initial-height":Y?"auto":`${sn}px`,...O,...d.style},onDragEnd:()=>{Q(!1),F(null),Qe.current=null},onPointerDown:de=>{de.button!==2&&(hr||!A||(lo.current=new Date,qe(Oe.current),de.target.setPointerCapture(de.pointerId),de.target.tagName!=="BUTTON"&&(Q(!0),Qe.current={x:de.clientX,y:de.clientY})))},onPointerUp:()=>{var de,We,Ke;if(le||!A)return;Qe.current=null;const ut=Number(((de=Mt.current)==null?void 0:de.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),po=Number(((We=Mt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ge=new Date().getTime()-((Ke=lo.current)==null?void 0:Ke.getTime()),ht=V==="x"?ut:po,ho=Math.abs(ht)/Ge;if(Math.abs(ht)>=IS||ho>.11){qe(Oe.current),d.onDismiss==null||d.onDismiss.call(d,d),J(V==="x"?ut>0?"right":"left":po>0?"down":"up"),xt(),me(!0);return}else{var wt,_t;(wt=Mt.current)==null||wt.style.setProperty("--swipe-amount-x","0px"),(_t=Mt.current)==null||_t.style.setProperty("--swipe-amount-y","0px")}be(!1),Q(!1),F(null)},onPointerMove:de=>{var We,Ke,ut;if(!Qe.current||!A||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;const Ge=de.clientY-Qe.current.y,ht=de.clientX-Qe.current.x;var ho;const wt=(ho=e.swipeDirections)!=null?ho:zS(P);!V&&(Math.abs(ht)>1||Math.abs(Ge)>1)&&F(Math.abs(ht)>Math.abs(Ge)?"x":"y");let _t={x:0,y:0};const ic=Sn=>1/(1.5+Math.abs(Sn)/20);if(V==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&Ge<0||wt.includes("bottom")&&Ge>0)_t.y=Ge;else{const Sn=Ge*ic(Ge);_t.y=Math.abs(Sn)<Math.abs(Ge)?Sn:Ge}}else if(V==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&ht<0||wt.includes("right")&&ht>0)_t.x=ht;else{const Sn=ht*ic(ht);_t.x=Math.abs(Sn)<Math.abs(ht)?Sn:ht}(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&be(!0),(Ke=Mt.current)==null||Ke.style.setProperty("--swipe-amount-x",`${_t.x}px`),(ut=Mt.current)==null||ut.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},se&&!d.jsx&&E!=="loading"?k.createElement("button",{"aria-label":B,"data-disabled":hr,"data-close-button":!0,onClick:hr||!A?()=>{}:()=>{xt(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Ft(D?.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(ac=q?.close)!=null?ac:ES):null,(E||d.icon||d.promise)&&d.icon!==null&&(q?.[E]!==null||d.icon)?k.createElement("div",{"data-icon":"",className:Ft(D?.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Up():null,d.type!=="loading"?qp:null):null,k.createElement("div",{"data-content":"",className:Ft(D?.content,d==null||(s=d.classNames)==null?void 0:s.content)},k.createElement("div",{"data-title":"",className:Ft(D?.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?k.createElement("div",{"data-description":"",className:Ft(ne,U,D?.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),k.isValidElement(d.cancel)?d.cancel:d.cancel&&Co(d.cancel)?k.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:de=>{Co(d.cancel)&&A&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,de),xt())},className:Ft(D?.cancelButton,d==null||(u=d.classNames)==null?void 0:u.cancelButton)},d.cancel.label):null,k.isValidElement(d.action)?d.action:d.action&&Co(d.action)?k.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||W,onClick:de=>{Co(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,de),!de.defaultPrevented&&xt())},className:Ft(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function xl(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function VS(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,a=s?"--mobile-offset":"--offset",c=s?DS:PS;function u(l){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${a}-${l}`]=c:n[`${a}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):u(c)}),n}const BS=k.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:u,className:l,offset:f,mobileOffset:d,theme:p="light",richColors:h,duration:g,style:y,visibleToasts:b=OS,toastOptions:v,dir:w=xl(),gap:S=MS,icons:_,containerAriaLabel:N="Notifications"}=t,[$,O]=k.useState([]),T=k.useMemo(()=>r?$.filter(G=>G.toasterId===r):$.filter(G=>!G.toasterId),[$,r]),W=k.useMemo(()=>Array.from(new Set([s].concat(T.filter(G=>G.position).map(G=>G.position)))),[T,s]),[H,ne]=k.useState([]),[C,P]=k.useState(!1),[z,Y]=k.useState(!1),[D,q]=k.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=k.useRef(null),V=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=k.useRef(null),R=k.useRef(!1),J=k.useCallback(G=>{O(X=>{var re;return(re=X.find(ce=>ce.id===G.id))!=null&&re.delete||st.dismiss(G.id),X.filter(({id:ce})=>ce!==G.id)})},[]);return k.useEffect(()=>st.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{O(X=>X.map(re=>re.id===G.id?{...re,delete:!0}:re))});return}setTimeout(()=>{Za.flushSync(()=>{O(X=>{const re=X.findIndex(ce=>ce.id===G.id);return re!==-1?[...X.slice(0,re),{...X[re],...G},...X.slice(re+1)]:[G,...X]})})})}),[$]),k.useEffect(()=>{if(p!=="system"){q(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:X})=>{q(X?"dark":"light")})}catch{G.addListener(({matches:re})=>{try{q(re?"dark":"light")}catch(ce){console.error(ce)}})}},[p]),k.useEffect(()=>{$.length<=1&&P(!1)},[$]),k.useEffect(()=>{const G=X=>{var re;if(a.every(Q=>X[Q]||X.code===Q)){var I;P(!0),(I=B.current)==null||I.focus()}X.code==="Escape"&&(document.activeElement===B.current||(re=B.current)!=null&&re.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[a]),k.useEffect(()=>{if(B.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,R.current=!1)}},[B.current]),k.createElement("section",{ref:n,"aria-label":`${N} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},W.map((G,X)=>{var re;const[ce,I]=G.split("-");return T.length?k.createElement("ol",{key:G,dir:w==="auto"?xl():w,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":I,style:{"--front-toast-height":`${((re=H[0])==null?void 0:re.height)||0}px`,"--width":`${$S}px`,"--gap":`${S}px`,...y,...VS(f,d)},onBlur:Q=>{R.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(R.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||R.current||(R.current=!0,F.current=Q.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{z||P(!1)},onDragEnd:()=>P(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},T.filter(Q=>!Q.position&&X===0||Q.position===G).map((Q,le)=>{var me,he;return k.createElement(LS,{key:Q.id,icons:_,index:le,toast:Q,defaultRichColors:h,duration:(me=v?.duration)!=null?me:g,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(he=v?.closeButton)!=null?he:u,interacting:z,position:G,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:J,toasts:T.filter(be=>be.position==Q.position),heights:H.filter(be=>be.position==Q.position),setHeights:ne,expandByDefault:c,gap:S,expanded:C,swipeDirections:t.swipeDirections})})):null}))});function zi(){const e=ti(),{list:t,loading:n}=ni(f=>f.jobs),r=Array.isArray(t)?t:[],[o,s]=m.useState(null),[a,c]=m.useState(new Set);m.useEffect(()=>{e(Xn());const f=setInterval(()=>e(Xn()),8e3);return()=>clearInterval(f)},[e]);const u=async()=>{if(o)try{await e(nd(o.id)).unwrap(),Ne.success(`Job "${o.name}" deleted`),s(null)}catch{Ne.error("Failed to delete job")}},l=async f=>{c(d=>new Set(d).add(f));try{await e($b(f)).unwrap(),Ne.success("Job triggered"),e(Xn())}catch{Ne.error("Failed to run job")}finally{c(d=>{const p=new Set(d);return p.delete(f),p})}};return n&&r.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Backup Jobs"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Scheduled and manual backup tasks"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]}),r.length===0?i.jsx("div",{children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No jobs yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a backup job to connect a source to a target"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:r.map(f=>{const d=f.last_run??f.lastRun,p=d?pd[d.status]:null,h=d?.status==="running",g=a.has(f.id),y=f.source_type??f.sourceType,b=f.target_type??f.targetType,v=y?fd[y]:null,w=b?md[b]:null,S=v?.icon,_=w?.icon,N=d?.started_at??d?.startedAt,$=d?.data_added_bytes??d?.dataAddedBytes;return i.jsx("div",{className:"space-y-3",children:i.jsx(Pe,{to:"/jobs/$id",params:{id:f.id},className:"block",children:i.jsx(At,{className:"py-0 transition-all hover:-translate-y-0.5 hover:shadow-md",children:i.jsxs(Tt,{className:"space-y-6 p-5",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h3",{className:"truncate text-base font-semibold",children:f.name})}),i.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-sm text-muted-foreground",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[S?i.jsx(S,{className:"h-3.5 w-3.5 shrink-0"}):null,i.jsx("span",{className:"truncate max-w-[120px]",children:f.source_name??f.sourceName})]}),i.jsx(sh,{className:"h-3 w-3 shrink-0"}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[_?i.jsx(_,{className:"h-3.5 w-3.5 shrink-0"}):null,i.jsx("span",{className:"truncate max-w-[120px]",children:f.target_name??f.targetName})]})]})]}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,onClick:O=>O.preventDefault(),children:i.jsx(ge,{variant:"ghost",size:"icon",className:"h-9 w-9",title:"More actions",children:i.jsx(Ya,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsx(ar,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/$id/edit",params:{id:f.id},children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]})}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:O=>{O.preventDefault(),s(f)},children:[i.jsx(Vr,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx($e,{variant:"outline",className:"font-mono text-xs",children:f.schedule||"Manual"}),p?i.jsx($e,{className:ae("text-xs",p.badge),children:p.label}):i.jsx($e,{variant:"secondary",className:"text-xs",children:"Never run"})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide",children:"Last Run"}),i.jsx("div",{className:"mt-1 text-foreground truncate",children:d?ci(N):"Never"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide",children:"Data Added"}),i.jsx("div",{className:"mt-1 text-foreground",children:$&&$>0?cr($):"-"})]}),i.jsx("div",{children:i.jsx(ge,{variant:"default",size:"sm",className:"h-9 px-3 rounded-full",title:"Run",disabled:h||g,onClick:()=>l(f.id),children:i.jsx(Ja,{className:"h-3.5 w-3.5"})})})]})]})})})},f.id)})}),i.jsx(Qr,{open:!!o,onOpenChange:f=>!f&&s(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Job"}),i.jsxs(oo,{children:['Delete "',o?.name,'"? Run history will also be deleted.']})]}),i.jsxs(no,{className:"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:u,children:"Delete"})]})]})})]})}function US(e,t){const n=t||"latest",r=e.resticRepository||"",o=e.resticPassword||"",s=e.awsAccessKeyId||"",a=e.awsSecretAccessKey||"",c=e.b2AccountId||"",u=e.b2AccountKey||"",l=e.jobName||"backup-job",f=e.connectorType||"s3";let d=`export RESTIC_REPOSITORY="${r}"
|
|
62
62
|
export RESTIC_PASSWORD="${o}"
|
|
63
|
-
`;
|
|
63
|
+
`;f==="s3"?d+=`export AWS_ACCESS_KEY_ID="${s}"
|
|
64
64
|
export AWS_SECRET_ACCESS_KEY="${a}"
|
|
65
65
|
`:f==="b2"&&(d+=`export B2_ACCOUNT_ID="${c}"
|
|
66
66
|
export B2_ACCOUNT_KEY="${u}"
|
|
67
|
-
`),["#!/usr/bin/env bash","# =============================================================================","#","# Universal Meyi connect Recover & Docker Auto-Start Script","# Version : 2.0 | Author : Meyi Backup",`# Job : ${l}`,`# Snapshot: ${n}`,"#","# USAGE:","# chmod +x restore.sh && sudo ./restore.sh",`# sudo ./restore.sh --snapshot ${n} --target /`,"# sudo ./restore.sh --dry-run","#","# OPTIONS:",`# --snapshot <id|latest> Snapshot to restore (default: ${n})`,"# --target <path> Restore destination (default: /tmp/restic-restore)","# --dry-run List snapshot contents without writing anything","#","# =============================================================================","","set -euo pipefail","",'export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"',"","# ─── Pre-filled credentials (generated by Meyi Backup) ──────────────────────",d,"# ─────────────────────────────────────────────────────────────────────────────","","RED=$'\\e[0;31m'; GREEN=$'\\e[0;32m'; YELLOW=$'\\e[1;33m'","CYAN=$'\\e[0;36m'; BLUE=$'\\e[0;34m'; BOLD=$'\\e[1m'; DIM=$'\\e[2m'; NC=$'\\e[0m'","",'info() { echo -e " ${CYAN}•${NC} $*"; }','success() { echo -e " ${GREEN}✔${NC} $*"; }','warn() { echo -e " ${YELLOW}⚠${NC} $*"; }','error() { echo -e " ${RED}✘${NC} $*" >&2; }','die() { echo ""; error "$*"; echo ""; exit 1; }',"","section() {",' echo ""',' echo -e " ${BOLD}${BLUE}▶ $*${NC}"'," echo -e \" ${DIM}$(printf '─%.0s' {1..58})${NC}\"","}","","get_free_port() {"," local port=$1",' if ! command -v ss &>/dev/null; then echo "$port"; return; fi',` while ss -ltn | awk '{print $4}' | grep -q ":$port$"; do port=$((port + 1)); done`,' echo "$port"',"}","",`SNAPSHOT_ID="${n}"`,'RESTORE_TARGET="/tmp/restic-restore"',"DRY_RUN=false","","while [[ $# -gt 0 ]]; do",' case "$1" in',' --snapshot) SNAPSHOT_ID="$2"; shift 2 ;;',' --target) RESTORE_TARGET="$2"; shift 2 ;;'," --dry-run) DRY_RUN=true; shift 1 ;;",` -h|--help) grep '^#' "$0" | grep -v '^#!/' | sed 's/^# \\{0,2\\}//'; exit 0 ;;`,` *) die "Unknown argument: '$1'. Run with --help for usage." ;;`," esac","done","","clear 2>/dev/null || true",'echo ""',`echo -e "\${BOLD} ╔${"═".repeat(58)}╗\${NC}"`,`echo -e "\${BOLD} ║ Universal Meyi connect recover — ${l.slice(0,50).padEnd(50)} ║\${NC}"`,`echo -e "\${BOLD} ╚${"═".repeat(58)}╝\${NC}"`,'[[ "$DRY_RUN" == true ]] && echo -e " ${YELLOW} Mode : DRY RUN — no files will be written${NC}"','echo ""',"",'[[ $EUID -ne 0 ]] && die "This script must be run as root.\\n\\n Try: sudo bash $0"',"","# =============================================================================","# STEP 1 — Install Required Tools","# =============================================================================","",'section "Step 1 of 7 — Checking Required Tools"',"","if ! command -v restic &>/dev/null; then",' info "Restic not found — detecting OS and installing..."'," OS_INFO=$(cat /etc/os-release 2>/dev/null | grep -E '^(ID|ID_LIKE)=' | tr '\\n' ',' || echo '')",` if echo "$OS_INFO" | grep -qiE 'rhel|centos|alma|rocky|fedora'; then`," dnf install -y epel-release 2>/dev/null || yum install -y epel-release 2>/dev/null || true"," dnf install -y restic 2>/dev/null || yum install -y restic 2>/dev/null || true",` elif echo "$OS_INFO" | grep -qiE 'debian|ubuntu'; then`," apt-get update -qq && apt-get install -y -qq restic || true"," fi"," if ! command -v restic &>/dev/null; then",' info "Package install failed — fetching official binary..."'," ARCH=$(uname -m)",' case "$ARCH" in x86_64) R_ARCH="amd64" ;; aarch64) R_ARCH="arm64" ;; *) R_ARCH="386" ;; esac',` RESTIC_VERSION=$(curl -s https://api.github.com/repos/restic/restic/releases/latest | grep tag_name | cut -d'"' -f4 | sed 's/v//' || echo "0.17.3")`,' [[ -z "$RESTIC_VERSION" ]] && RESTIC_VERSION="0.17.3"'," command -v bunzip2 &>/dev/null || (dnf install -y bzip2 2>/dev/null || apt-get install -y bzip2 2>/dev/null || true)",' URL="https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_${R_ARCH}.bz2"',' curl -fsSL -o /usr/local/bin/restic.bz2 "$URL" || die "Failed to download restic."'," [[ -f /usr/local/bin/restic ]] && mv /usr/local/bin/restic /usr/local/bin/restic.old"," bunzip2 -f /usr/local/bin/restic.bz2"," chmod +x /usr/local/bin/restic"," fi","fi",'success "Restic $(restic version 2>/dev/null | head -1)"',"","if ! command -v docker &>/dev/null; then",' info "Docker not found — installing..."'," if command -v dnf &>/dev/null; then"," dnf install -y dnf-plugins-core"," dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"," dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin"," elif command -v yum &>/dev/null; then"," yum install -y yum-utils"," yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"," yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin"," else"," curl -fsSL https://get.docker.com | bash"," fi"," systemctl enable docker && systemctl start docker","fi",'success "Docker $(docker --version 2>/dev/null)"',"","! docker compose version &>/dev/null && (dnf install -y docker-compose-plugin 2>/dev/null || yum install -y docker-compose-plugin 2>/dev/null || apt-get install -y docker-compose-plugin 2>/dev/null || true)",'success "Compose $(docker compose version 2>/dev/null)"',"","! command -v rsync &>/dev/null && (dnf install -y rsync 2>/dev/null || yum install -y rsync 2>/dev/null || apt-get install -y rsync 2>/dev/null)",'success "rsync $(rsync --version 2>/dev/null | head -1)"',"","# =============================================================================","# STEP 2 — Verify repository connection","# =============================================================================","",'section "Step 2 of 7 — Repository Credentials"',"",'info "Repository : $RESTIC_REPOSITORY"','info "Verifying connection..."',"if ! restic snapshots --quiet &>/dev/null; then",' die "Cannot connect to repository.\\n\\n Check your credentials and repository URL, then try again."',"fi",'success "Connected to: $RESTIC_REPOSITORY"',"","# =============================================================================","# STEP 3 — Select Snapshot","# =============================================================================","",'section "Step 3 of 7 — Selecting Snapshot"',"",'if [[ "$SNAPSHOT_ID" == "latest" ]]; then',' info "Resolving latest snapshot ID..."',` SNAPSHOT_ID=$(restic snapshots --latest 1 --json | grep -o '"short_id":"[^"]*"' | head -1 | cut -d'"' -f4)`,' [[ -z "$SNAPSHOT_ID" ]] && die "No snapshots found in this repository."',"fi",'success "Snapshot selected : ${BOLD}${SNAPSHOT_ID}${NC}"',"","# =============================================================================","# STEP 4 — Disk Space Check","# =============================================================================","",'section "Step 4 of 7 — Disk Space Check"',"",'if [[ "$DRY_RUN" == false ]]; then',` RESTORE_SIZE_BYTES=$(restic stats "$SNAPSHOT_ID" --mode restore-size --json 2>/dev/null | grep -o '"total_size": *[0-9]*' | grep -o '[0-9]*' || echo "")`,' if [[ -n "$RESTORE_SIZE_BYTES" && "$RESTORE_SIZE_BYTES" =~ ^[0-9]+$ ]]; then',' mkdir -p "$RESTORE_TARGET" 2>/dev/null || true',` AVAILABLE_KB=$(df -k "$RESTORE_TARGET" 2>/dev/null | awk 'NR==2 {print $4}' || echo "")`,' if [[ -n "$AVAILABLE_KB" && "$AVAILABLE_KB" =~ ^[0-9]+$ ]]; then'," AVAILABLE_BYTES=$((AVAILABLE_KB * 1024))"," SIZE_MB=$((RESTORE_SIZE_BYTES / 1024 / 1024))"," AVAIL_MB=$((AVAILABLE_BYTES / 1024 / 1024))",' info "Snapshot size : ~${SIZE_MB} MB"',' info "Available space : ~${AVAIL_MB} MB"',' (( RESTORE_SIZE_BYTES > AVAILABLE_BYTES )) && die "Not enough disk space. Required: ~${SIZE_MB} MB | Available: ~${AVAIL_MB} MB"',' success "Disk space is sufficient."'," else",` warn "Could not determine available space on '\${RESTORE_TARGET}'. Proceeding anyway."`," fi"," else",' warn "Could not determine snapshot size. Proceeding anyway."'," fi","else",' info "Dry-run mode — skipping disk space check."',"fi","","# =============================================================================","# STEP 5 — Restore Snapshot","# =============================================================================","",'section "Step 5 of 7 — Restoring Snapshot"',"",'info "Snapshot : $SNAPSHOT_ID"','info "Target : $RESTORE_TARGET"','echo ""',"",'if [[ "$DRY_RUN" == true ]]; then',' warn "DRY RUN — listing snapshot contents only:"',' echo ""',' restic ls "$SNAPSHOT_ID"',' echo ""',' success "Dry run complete. No files were written."'," exit 0","fi","","set +e",'restic restore "$SNAPSHOT_ID" --target "$RESTORE_TARGET"',"RESTIC_EXIT=$?","set -e","","if [[ $RESTIC_EXIT -eq 0 ]]; then",' success "Snapshot restored to: $RESTORE_TARGET"',"elif [[ $RESTIC_EXIT -eq 1 ]]; then",' warn "Restore finished with minor warnings (exit code 1). This is expected for device files."',' success "Continuing with data migration..."',"else",' die "Restic exited with code ${RESTIC_EXIT}."',"fi","","# =============================================================================","# STEP 6 — Migrate Application Data","# =============================================================================","",'section "Step 6 of 7 — Migrating Data to Host"',"",'info "Stopping database services..."',"VOLUMES_IN_SNAPSHOT=false",'[[ -d "$RESTORE_TARGET/var/lib/docker/volumes" ]] && VOLUMES_IN_SNAPSHOT=true',"systemctl stop docker mariadb mysqld postgresql mongod redis redis-server 2>/dev/null || true","sleep 2",'success "Services stopped."',"",'SAFE_DIRS=("home" "root" "opt" "var/www" "var/lib/docker/volumes" "var/lib/pgsql" "var/lib/mysql" "var/lib/mongo" "var/lib/redis" "var/lib/odoo" "etc/nginx" "etc/letsencrypt" "etc/cron.d" "etc/cron.daily" "etc/environment" "etc/odoo" "etc/my.cnf" "etc/my.cnf.d" "etc/mysql" "etc/postgresql" "etc/redis")',"",'echo ""','info "Syncing restored directories to host..."','for BDIR in "${SAFE_DIRS[@]}"; do',' if [[ -d "$RESTORE_TARGET/$BDIR" ]]; then',' info " /$BDIR"',' mkdir -p "/$BDIR" 2>/dev/null || true',' rsync -a "$RESTORE_TARGET/$BDIR/" "/$BDIR/"',' success " /$BDIR synced."'," fi","done","",'if [[ "$VOLUMES_IN_SNAPSHOT" == true ]]; then',' echo ""',' info "Restarting Docker with restored volumes..."'," systemctl start docker 2>/dev/null || service docker start 2>/dev/null || true"," sleep 3",' docker info &>/dev/null && success "Docker is running." || warn "Docker may not have started. Run: sudo systemctl start docker"',' echo ""',' info "Restored Docker volumes:"',' ls /var/lib/docker/volumes/ 2>/dev/null | grep -v \'^metadata.db$\' | while read -r vol; do echo -e " ${GREEN}▸${NC} $vol"; done || warn "No volumes found."',"fi","","# =============================================================================","# STEP 7 — Container & Compose Restore","# =============================================================================","",'section "Step 7 of 7 — Restoring Docker Containers"',"",'CONTAINER_SCRIPT="/opt/meyi-backup/containers.sh"',"",'if [[ -f "$CONTAINER_SCRIPT" ]]; then',' success "Found container config script: ${CONTAINER_SCRIPT}"',' bash "$CONTAINER_SCRIPT" && success "Containers restored." || warn "Container script completed with errors."',"else",' info "No container config script found — running auto-detection..."',' find /home /opt -name "docker-compose.yml" 2>/dev/null | while read -r compose_file; do',' d=$(dirname "$compose_file")',' info " Found: $d"',' (cd "$d" && docker compose pull && docker compose up --no-start) || warn " Could not initialise: $d"',' success " Compose project ready: $d"'," done",""," VOLS=$(ls /var/lib/docker/volumes 2>/dev/null | grep -v '^metadata.db$' || true)"," for vol in $VOLS; do",' DATA="/var/lib/docker/volumes/$vol/_data"',' [[ ! -d "$DATA" ]] && continue',' IMAGE="" MOUNT="" PORT="" NAME_PREFIX=""',' if [[ -f "$DATA/PG_VERSION" ]]; then VER=$(cat "$DATA/PG_VERSION" 2>/dev/null || echo "15"); IMAGE="postgres:${VER}"; MOUNT="/var/lib/postgresql/data"; PORT=5432; NAME_PREFIX="pg"',' elif [[ -f "$DATA/ibdata1" ]] && [[ -f "$DATA/aria_log_control" ]]; then IMAGE="mariadb:10.11"; MOUNT="/var/lib/mysql"; PORT=3306; NAME_PREFIX="mariadb"',' elif [[ -f "$DATA/ibdata1" ]]; then IMAGE="mysql:8.0"; MOUNT="/var/lib/mysql"; PORT=3306; NAME_PREFIX="mysql"',' elif [[ -f "$DATA/WiredTiger" ]]; then IMAGE="mongo:7"; MOUNT="/data/db"; PORT=27017; NAME_PREFIX="mongo"',' elif [[ -f "$DATA/dump.rdb" ]]; then IMAGE="redis:7"; MOUNT="/data"; PORT=6379; NAME_PREFIX="redis"'," fi",' if [[ -n "$IMAGE" ]]; then',' C_NAME="${NAME_PREFIX}-${vol:0:8}"',` if ! docker ps -a --format '{{.Names}}' | grep -q "^\${C_NAME}$"; then`,' FREE_PORT=$(get_free_port "$PORT")',' info " Creating $C_NAME ($IMAGE, port ${FREE_PORT}→${PORT})..."',' docker pull "$IMAGE" >/dev/null',' docker create --name "$C_NAME" -v "$vol:$MOUNT" -p "${FREE_PORT}:${PORT}" --restart unless-stopped "$IMAGE" >/dev/null',` success " Container '$C_NAME' created on host port $FREE_PORT"`," else",` warn " Container '$C_NAME' already exists — skipping."`," fi"," fi"," done","fi","","# =============================================================================","# Summary","# =============================================================================","",'echo ""','echo -e "${BOLD}${BLUE}▶ All Containers (docker ps -a)${NC}"',"echo -e \"${DIM}$(printf '─%.0s' {1..58})${NC}\"",'docker ps -a --format " {{.Names}}\\t{{.Status}}\\t{{.Ports}}" 2>/dev/null || true','echo ""',`echo -e "\${BOLD} ╔${"═".repeat(58)}╗\${NC}"`,'echo -e "${BOLD} ║ Restore Complete ✔ ║${NC}"',`echo -e "\${BOLD} ╠${"═".repeat(58)}╣\${NC}"`,'echo -e "${BOLD} ║${NC} Snapshot : $SNAPSHOT_ID"','echo -e "${BOLD} ║${NC} Target : $RESTORE_TARGET"',`echo -e "\${BOLD} ╚${"═".repeat(58)}╝\${NC}"`,'echo ""','echo -e " ${DIM}Note: Native database services were left disabled intentionally."','echo -e " Verify your data before starting them with: systemctl start <service>${NC}"','echo ""'].join(`
|
|
68
|
-
`)}function WS({runId:e,onClose:t}){const[n,r]=m.useState([]),[o,s]=m.useState("connecting"),[a,c]=m.useState(null),u=m.useRef(null);m.useEffect(()=>{const f=localStorage.getItem("access_token"),h=`${window.MEYI_API_BASE||"/api/v1/backup"}/runs/${e}/stream${f?`?token=${f}`:""}`,p=new EventSource(h);return p.addEventListener("log",g=>{const{line:y}=JSON.parse(g.data);r(b=>[...b,y])}),p.addEventListener("progress",g=>c(JSON.parse(g.data))),p.addEventListener("status",g=>{const{status:y}=JSON.parse(g.data);s(y),["success","failed","cancelled"].includes(y)&&p.close()}),p.onerror=()=>{s(g=>g==="running"?"error":g),p.close()},()=>p.close()},[e]),m.useEffect(()=>{u.current?.scrollIntoView({behavior:"smooth"})},[n]);const l=Yr(o);return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:i.jsxs("div",{className:"w-full max-w-3xl rounded-xl border border-border bg-background shadow-xl",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[i.jsxs("h2",{className:"text-sm font-semibold",children:["Run Log - ",e.slice(0,8),"..."]}),i.jsx(ge,{variant:"ghost",size:"icon",onClick:t,children:i.jsx(ms,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-2 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2",children:[i.jsx(Ie,{className:ae("text-xs",l.badge),children:l.label}),o==="running"&&i.jsx(rt,{className:"h-3 w-3 animate-spin text-muted-foreground"}),a&&i.jsxs("span",{className:"ml-auto text-xs text-muted-foreground",children:[a.files_done,"/",a.total_files," files - ",cr(a.bytes_done??0)]})]}),i.jsxs("div",{className:"overflow-auto rounded-lg border border-border bg-zinc-950 px-4 py-3",style:{maxHeight:400},children:[i.jsx("pre",{className:"text-xs font-mono leading-relaxed",children:n.length===0?i.jsx("span",{className:"text-muted-foreground",children:"Waiting for output..."}):n.map((f,d)=>i.jsx("div",{className:ae("text-zinc-400",Qs(f)==="error"&&"text-red-400",Qs(f)==="success"&&"text-emerald-400",Qs(f)==="info"&&"text-blue-400"),children:f},d))}),i.jsx("div",{ref:u})]})]})]})})}function HS({run:e,jobId:t,onViewLogs:n}){const r=Yr(e.status),o=e.started_at??e.startedAt,s=e.finished_at??e.finishedAt,a=e.data_added_bytes??e.dataAddedBytes??0,c=e.snapshot_id??e.snapshotId,[u,l]=m.useState(!1),[f,d]=m.useState(!1),h=()=>{c&&(navigator.clipboard.writeText(c),l(!0),setTimeout(()=>l(!1),2e3))},p=async()=>{d(!0);try{const g=localStorage.getItem("access_token"),y=window.MEYI_API_BASE||"/api/v1/backup",b={"Content-Type":"application/json"};g&&(b.Authorization=`Bearer ${g}`);const v=await fetch(`${y}/jobs/${t}/restore-script-meta`,{headers:b});if(!v.ok)throw new Error("Failed to fetch job credentials");const w=await v.json(),S=US(w,c),_=new Blob([S],{type:"text/x-shellscript"}),C=URL.createObjectURL(_),I=document.createElement("a");I.href=C,I.download=`restore-${(w.jobName||"job").replace(/[^a-z0-9]/gi,"-").toLowerCase()}-${(c||"latest").slice(0,8)}.sh`,document.body.appendChild(I),I.click(),document.body.removeChild(I),URL.revokeObjectURL(C),Ce.success("Restore script downloaded")}catch(g){Ce.error(g.message||"Failed to generate script")}finally{d(!1)}};return i.jsxs("div",{className:"flex items-center gap-4 border-b border-border/50 px-4 py-3 transition-colors last:border-0 hover:bg-muted/40",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"text-xs font-mono text-foreground truncate",children:[e.id,"..."]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:li(o)})]}),i.jsx(Ie,{className:ae("shrink-0 text-xs",r.badge),children:r.label}),i.jsx("div",{className:"shrink-0 text-xs text-muted-foreground",children:ui(o,s)}),a>0&&i.jsxs("div",{className:"shrink-0 text-xs text-muted-foreground",children:["+",cr(a)]}),c&&i.jsx("div",{className:"flex items-center gap-1 shrink-0",children:i.jsxs(Ie,{variant:"secondary",className:"text-xs font-mono",children:[c.slice(0,8),"..",i.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:h,title:"Copy Snapshot ID",children:u?i.jsx(fu,{className:"h-2 w-2"}):i.jsx(gh,{className:"h-2 w-2"})})]})}),c&&i.jsx(ge,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",onClick:p,disabled:f,title:"Download restore script for this snapshot",children:f?i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(vh,{className:"h-3.5 w-3.5"})}),i.jsx(ge,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>n(e.id),title:"View logs",children:i.jsx(Gh,{className:"h-4 w-4"})})]})}function Li({id:e}){const t=co(),n=e||t.id,r=Re.useQueryClient(),[o,s]=m.useState(null),a=oc(),{data:c,isLoading:u}=Re.useQuery({queryKey:["job",n],queryFn:()=>Ze.get(n),enabled:!!n&&n!=="new"}),{data:l=[],isLoading:f}=Re.useQuery({queryKey:["runs",n],queryFn:()=>Ze.getRuns(n),refetchInterval:5e3,enabled:!!n&&n!=="new"}),d=async()=>{try{await Ze.run(n),Ce.success("Job triggered"),setTimeout(()=>r.invalidateQueries({queryKey:["runs",n]}),800)}catch{Ce.error("Failed to trigger job")}},h=async()=>{try{await Ze.delete(n),Ce.success("Job deleted"),a({to:"/jobs"})}catch{Ce.error("Failed to delete job")}};if(u)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!c)return i.jsx("div",{className:"p-6 text-muted-foreground",children:"Job not found"});const p=l[0];return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{to:"/jobs",className:"mb-1 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:i.jsx(Ya,{className:"h-5 w-5"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:c.name}),i.jsxs("div",{className:"flex items-center gap-2",children:[c.schedule&&i.jsx(Ie,{variant:"outline",className:"text-xs font-mono",children:c.schedule}),c.backupScope==="full"||c.backup_scope==="full"?i.jsxs(Ie,{variant:"outline",className:"text-xs gap-1",children:[i.jsx(Rh,{className:"h-3 w-3"})," Full Backup"]}):i.jsxs(Ie,{variant:"outline",className:"text-xs gap-1",children:[i.jsx(Ka,{className:"h-3 w-3"})," Specific Paths (",(c.backupIncludePaths||c.backup_include_paths||[]).length,")"]}),!c.enabled&&i.jsx(Ie,{variant:"outline",className:"text-xs",children:"Disabled"})]})]}),i.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[i.jsxs("a",{href:`/resources/${c.source_id??c.sourceId}`,className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[i.jsx("span",{className:"flex items-center bg-muted rounded-md p-1",children:i.jsx(jt,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-sm font-semibold",children:c.source_name??c.sourceName})]}),i.jsxs(Pe,{to:"/jobs/$id/snapshots",params:{id:n},className:"flex items-center gap-2",children:[i.jsx("span",{className:"flex items-center bg-muted rounded-md p-1",children:i.jsx(fs,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-sm font-semibold",children:c.target_name??c.targetName})]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ge,{variant:"default",onClick:d,children:[i.jsx(Ja,{className:"h-4 w-4"})," Run "]}),i.jsx(ge,{variant:"outline",asChild:!0,children:i.jsxs(Pe,{to:"/jobs/$id/edit",params:{id:n},children:[i.jsx(Lr,{className:"h-4 w-4"})," Edit"]})}),i.jsxs(Qr,{children:[i.jsx(mS,{asChild:!0,children:i.jsxs(ge,{variant:"destructive",children:[i.jsx(Br,{className:"h-4 w-4"})," Delete"]})}),i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Are you absolutely sure?"}),i.jsxs(oo,{children:["This action cannot be undone. This will permanently delete the backup job",i.jsxs("span",{className:"font-semibold text-foreground",children:[' "',c.name,'"']})," and its schedule. Remote snapshots will remain safe in storage."]})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{onClick:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Job"})]})]})]})]})]}),p&&i.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Last Status",value:Yr(p.status).label},{label:"Last Run",value:ci(p.started_at??p.startedAt)},{label:"Duration",value:ui(p.started_at??p.startedAt,p.finished_at??p.finishedAt)},{label:"Data Added",value:cr(p.data_added_bytes??p.dataAddedBytes)}].map(({label:g,value:y})=>i.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:g}),i.jsx("div",{className:"mt-1 text-sm font-semibold",children:y})]},g))}),i.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[i.jsx("span",{className:"text-sm font-semibold",children:"Run History"}),i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r.invalidateQueries({queryKey:["runs",n]}),children:i.jsx(Xa,{className:"h-4 w-4"})})]}),f&&i.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:i.jsx(rt,{className:"mx-auto h-5 w-5 animate-spin"})}),!f&&l.length===0&&i.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:'No runs yet. Click "Run Now" to start.'}),l.map(g=>i.jsx(HS,{run:g,jobId:n,onViewLogs:s},g.id))]}),o&&i.jsx(WS,{runId:o,onClose:()=>s(null)})]})}const nr={getAll:()=>fe.get("/connectors"),get:e=>fe.get(`/connectors/${e}`),create:e=>fe.post("/connectors",e),update:(e,t)=>fe.put(`/connectors/${e}`,t),delete:e=>fe.delete(`/connectors/${e}`),initRepo:e=>fe.post(`/connectors/${e}/init`)},wm={getAll:()=>fe.get("/sources"),get:e=>fe.get(`/sources/${e}`),create:e=>fe.post("/sources",e),update:(e,t)=>fe.put(`/sources/${e}`,t),delete:e=>fe.delete(`/sources/${e}`)},_m={getPlatformResources:async()=>{try{const e=localStorage.getItem("access_token"),t={"Content-Type":"application/json"};e&&(t.Authorization=`Bearer ${e}`);const n=await fetch("/api/v1/resources",{headers:t});if(!n.ok)return[];const r=await n.json();return Array.isArray(r)?r:r?.data||[]}catch{return[]}},getAll:async()=>{const[e,t]=await Promise.all([_m.getPlatformResources(),wm.getAll().catch(()=>[])]),n=e.map(a=>({...a,origin:"platform",source_id:a.id})),r=new Set(e.map(a=>a.id)),s=t.filter(a=>{if(r.has(a.id))return!1;const c=a.config&&Object.keys(a.config).length>0,u=a.credentials&&a.credentials!=="{}";return!(!c&&!u)}).map(a=>({...a,origin:"local",source_id:a.id}));return[...n,...s]}};function Et({className:e,type:t,...n}){return i.jsx("input",{type:t,"data-slot":"input",className:ae("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"," focus-visible:ring-ring/50 focus-visible:ring-[1px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var ZS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qS=ZS.reduce((e,t)=>{const n=gd(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:a,...c}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),YS="Label",Sm=m.forwardRef((e,t)=>i.jsx(qS.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Sm.displayName=YS;var GS=Sm;function Gt({className:e,...t}){return i.jsx(GS,{"data-slot":"label",className:ae("flex items-center gap-2 text-sm mb-2 leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function KS({...e}){return i.jsx(nm,{"data-slot":"dialog",...e})}function JS({...e}){return i.jsx(rm,{"data-slot":"dialog-portal",...e})}function XS({className:e,...t}){return i.jsx(om,{"data-slot":"dialog-overlay",className:ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function QS({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(JS,{"data-slot":"dialog-portal",children:[i.jsx(XS,{}),i.jsxs(sm,{"data-slot":"dialog-content",className:ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&i.jsxs(Fi,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(ms,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ek({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:ae("flex flex-col gap-2 text-center sm:text-start",e),...t})}function tk({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function nk({className:e,...t}){return i.jsx(am,{"data-slot":"dialog-title",className:ae("text-lg leading-none font-semibold",e),...t})}function rk({className:e,...t}){return i.jsx(im,{"data-slot":"dialog-description",className:ae("text-muted-foreground text-sm",e),...t})}const jr={s3:{label:"Amazon S3 / Compatible",icon:Ho,fields:[{key:"endpoint",label:"Endpoint",placeholder:"s3.amazonaws.com (leave blank for AWS)",required:!1},{key:"bucket",label:"Bucket Name",placeholder:"my-backup-bucket",required:!0},{key:"region",label:"Region",placeholder:"us-east-1",required:!1},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"access_key_id",label:"Access Key ID",placeholder:"AKIA...",required:!0,secret:!0},{key:"secret_access_key",label:"Secret Access Key",placeholder:"••••••••",required:!0,secret:!0,password:!0}]},gcs:{label:"Google Cloud Storage",icon:cd,fields:[{key:"bucket",label:"Bucket Name",placeholder:"my-gcs-bucket",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"project_id",label:"Project ID",placeholder:"my-gcp-project",required:!0},{key:"credentials_json",label:"Service Account JSON",placeholder:'{"type":"service_account",...}',required:!0,password:!0,multiline:!0}]},azure:{label:"Azure Blob Storage",icon:ld,fields:[{key:"container",label:"Container Name",placeholder:"my-backups",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"account_name",label:"Storage Account Name",placeholder:"mystorageaccount",required:!0},{key:"account_key",label:"Account Key",placeholder:"••••••••",required:!0,password:!0}]},b2:{label:"Backblaze B2",icon:ud,fields:[{key:"bucket",label:"Bucket Name",placeholder:"my-b2-bucket",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"account_id",label:"Account ID",placeholder:"...",required:!0},{key:"account_key",label:"Application Key",placeholder:"••••••••",required:!0,password:!0}]},sftp:{label:"SFTP Server",icon:dd,fields:[{key:"host",label:"Host",placeholder:"backup.example.com",required:!0},{key:"port",label:"Port",placeholder:"22",required:!1},{key:"user",label:"Username",placeholder:"admin",required:!0},{key:"path",label:"Remote Path",placeholder:"/backups",required:!0},{key:"password",label:"Password",placeholder:"••••••••",required:!1,password:!0}]},local:{label:"Local Filesystem",icon:fs,fields:[{key:"path",label:"Directory Path",placeholder:"/mnt/backups or D:\\Backups",required:!0}]}};function ok({editing:e,onClose:t}){const n=Re.useQueryClient(),r=!!e,[o,s]=m.useState(e?.type??"s3"),[a,c]=m.useState(e?.name??""),[u,l]=m.useState(e?.config??{}),f=jr[o];m.useEffect(()=>{r||l({})},[o,r]);const d=Re.useMutation({mutationFn:async()=>{const p={name:a,type:o,config:u};return r?nr.update(e.id,p):nr.create(p)},onSuccess:()=>{n.invalidateQueries({queryKey:["connectors"]}),Ce.success(r?"Connector updated":"Connector added"),t()},onError:p=>Ce.error(p?.error||"Failed to save connector")});function h(p){p.preventDefault(),d.mutate()}return i.jsx(KS,{open:!0,onOpenChange:p=>!p&&t(),children:i.jsxs(QS,{className:"max-w-[480px] w-[95vw] p-0 overflow-hidden rounded-2xl border-border/75",children:[i.jsxs(ek,{className:"px-6 pt-6 pb-2 text-left",children:[i.jsx(nk,{className:"text-xl font-bold",children:r?"Edit Connector":"Add Storage Connector"}),i.jsx(rk,{className:"text-sm",children:"Configure storage credentials for backup targets. Connectors define where your data is stored."})]}),i.jsxs("form",{onSubmit:h,className:"",children:[i.jsxs("div",{className:"px-6 space-y-5 max-h-[60vh] overflow-y-auto py-2",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Gt,{htmlFor:"conn-name",className:"text-sm font-semibold",children:"Display Name"}),i.jsx(Et,{id:"conn-name",value:a,onChange:p=>c(p.target.value),placeholder:"e.g. Production S3 Bucket",className:"h-10 bg-muted/5 shadow-none",required:!0})]}),!r&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Gt,{className:"text-sm font-semibold",children:"Storage Provider"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:Object.keys(jr).map(p=>{const g=jr[p],y=g.icon,b=o===p;return i.jsxs("button",{type:"button",onClick:()=>s(p),className:ae("flex flex-col items-center gap-2 rounded-xl border p-3 text-[11px] transition-all relative overflow-hidden",b?"border-primary bg-primary/5 text-primary font-bold ring-1 ring-primary":"border-border bg-card hover:bg-muted/50 text-muted-foreground"),children:[i.jsx(y,{className:ae("h-5 w-5",b?"text-primary":"text-muted-foreground/60")}),i.jsx("span",{className:"truncate w-full text-center",children:g.label.split(" ")[0]})]},p)})})]})]}),i.jsx("div",{className:"space-y-4 pt-2",children:i.jsx("div",{className:"grid gap-4",children:f.fields.map(p=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Gt,{htmlFor:`cf-${p.key}`,className:"text-sm font-semibold flex items-center gap-1.5",children:[p.label,p.required&&i.jsx("span",{className:"text-destructive font-bold",children:"*"}),p.secret&&i.jsx(Dh,{className:"h-3 w-3 text-muted-foreground/50"})]}),p.multiline?i.jsx("textarea",{id:`cf-${p.key}`,value:u[p.key]??"",onChange:g=>l(y=>({...y,[p.key]:g.target.value})),placeholder:p.placeholder,rows:3,className:"w-full rounded-lg border border-input bg-muted/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none font-mono",required:p.required}):i.jsx(Et,{id:`cf-${p.key}`,type:p.password?"password":"text",value:u[p.key]??"",onChange:g=>l(y=>({...y,[p.key]:g.target.value})),placeholder:p.placeholder,className:"h-10 bg-muted/5 shadow-none",required:p.required})]},p.key))})})]}),i.jsxs(tk,{className:"px-3 py-2 border-t border-border/40",children:[i.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsxs(ge,{type:"submit",variant:"default",size:"sm",disabled:d.isPending,children:[d.isPending&&i.jsx(rt,{className:"h-4 w-4 mr-2 animate-spin"}),r?"Save":"Add Connector"]})]})]})]})})}function sk({connector:e,onEdit:t,onDelete:n,onInit:r}){const o=e.type??"local",s=jr[o]??jr.local,a=s.icon;return i.jsx(At,{className:"transition-all hover:border-muted-foreground/40 hover:shadow-md py-0",children:i.jsxs(Tt,{className:"p-3.5 space-y-3.5",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[i.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border bg-muted/30 text-foreground",children:i.jsx(a,{className:"h-4.5 w-4.5"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h3",{className:"truncate text-sm font-semibold",children:e.name}),i.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-tight mt-0.5",children:s.label})]})]}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,children:i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:i.jsx(Ga,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsxs(ar,{onClick:t,children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:n,children:[i.jsx(Br,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs(Ie,{variant:"outline",className:"font-mono text-[10px] gap-1 text-muted-foreground py-0.5",children:[i.jsx(_h,{className:"h-3 w-3"}),i.jsxs("span",{className:"truncate max-w-[150px]",children:[e.config?.bucket||e.config?.path||"No path",e.config?.prefix&&e.config.prefix!=="/"?`/${e.config.prefix}`:""]})]}),e.config?.region&&i.jsxs(Ie,{variant:"outline",className:"font-mono text-[10px] gap-1 text-muted-foreground py-0.5",children:[i.jsx(ds,{className:"h-3 w-3"}),e.config.region]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground border-t border-border/40 pt-3",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] uppercase tracking-wide",children:"Provider"}),i.jsx("div",{className:"mt-0.5 text-foreground font-medium uppercase text-[10px]",children:o})]}),i.jsx("div",{children:i.jsxs(ge,{variant:"outline",size:"sm",className:"h-7 px-2.5 gap-1.5",onClick:r,title:"Initialize Repository",children:[i.jsx(Xa,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[11px]",children:"Init Repo"})]})})]})]})})}function km(){const e=Re.useQueryClient(),[t,n]=m.useState(!1),[r,o]=m.useState(null),[s,a]=m.useState(null),{data:c,isLoading:u}=Re.useQuery({queryKey:["connectors"],queryFn:nr.getAll}),l=Array.isArray(c)?c:[],f=Re.useMutation({mutationFn:g=>nr.delete(g),onSuccess:()=>{e.invalidateQueries({queryKey:["connectors"]}),Ce.success("Connector deleted"),a(null)},onError:()=>Ce.error("Failed to delete connector")}),d=Re.useMutation({mutationFn:g=>nr.initRepo(g),onSuccess:g=>{Ce.success(g.data?.message||"Repository initialized successfully")},onError:g=>{Ce.error(g?.response?.data?.error||g?.error||"Failed to initialize repository")}});function h(){o(null),n(!0)}function p(g){o(g),n(!0)}return i.jsxs("div",{className:"w-full space-y-8 animate-in fade-in duration-500",children:[i.jsx("div",{className:"flex items-start justify-between",children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Backend Settings"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure storage destinations and global backup preferences"})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 pb-3",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Storage Connectors"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Physical storage locations for your encrypted snapshots"})]}),i.jsxs(ge,{onClick:h,size:"sm",className:"gap-2 h-8 shadow-sm",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Storage"]})]}),u?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(g=>i.jsx(At,{className:"h-40 animate-pulse bg-muted/10 border-border/50"},g))}):l.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-center rounded-2xl border border-dashed border-muted-foreground/20 bg-muted/5",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-background border border-border shadow-sm",children:i.jsx(kr,{className:"h-7 w-7 text-muted-foreground/60"})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("h3",{className:"font-bold text-base",children:"No storage configured"}),i.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"You need a storage destination like S3, B2, or Local folder to store backups."})]}),i.jsx(ge,{onClick:h,variant:"outline",size:"sm",className:"mt-2",children:"Add Your First Connector"})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4 gap-4",children:l.map(g=>i.jsx(sk,{connector:g,onEdit:()=>p(g),onDelete:()=>a(g),onInit:()=>d.mutate(g.id)},g.id))})]}),t&&i.jsx(ok,{editing:r,onClose:()=>n(!1)}),i.jsx(Qr,{open:!!s,onOpenChange:g=>{g||a(null)},children:i.jsxs(eo,{className:"max-w-md rounded-xl",children:[i.jsxs(to,{children:[i.jsx(ro,{className:"text-xl",children:"Delete Storage Connector"}),i.jsxs(oo,{className:"text-sm pt-2",children:["Are you sure you want to delete ",i.jsxs("span",{className:"font-bold text-foreground",children:['"',s?.name,'"']}),"? Existing backup jobs using this storage will fail until updated."]})]}),i.jsxs(no,{className:"pt-4 gap-2",children:[i.jsx(ao,{className:"h-9",children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 h-9 px-6",onClick:()=>s&&f.mutate(s.id),children:"Delete"})]})]})})]})}function M(e,t,n){function r(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);const l=a.prototype,f=Object.keys(l);for(let d=0;d<f.length;d++){const h=f[d];h in c||(c[h]=l[h].bind(c))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(c){var u;const l=n?.Parent?new s:this;r(l,c),(u=l._zod).deferred??(u.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class rr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Em extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Cm={};function Mn(e){return Cm}function Nm(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Na(e,t){return typeof t=="bigint"?t.toString():t}function Bi(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Vi(e){return e==null}function Ui(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ak(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u?.[1]&&(o=Number.parseInt(u[1]))}const s=n>o?n:o,a=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return a%c/10**s}const wl=Symbol("evaluating");function ke(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==wl)return r===void 0&&(r=wl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Un(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function _l(e){return JSON.stringify(e)}function ik(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function es(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ck=Bi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function $r(e){if(es(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(es(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Rm(e){return $r(e)?{...e}:Array.isArray(e)?[...e]:e}const lk=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function uk(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const dk={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fk(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=vn(e._zod.def,{get shape(){const a={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return Un(this,"shape",a),a},checks:[]});return xn(e,s)}function mk(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=vn(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return Un(this,"shape",a),a},checks:[]});return xn(e,s)}function pk(e,t){if(!$r(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=vn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Un(this,"shape",s),s}});return xn(e,o)}function hk(e,t){if(!$r(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=vn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Un(this,"shape",r),r}});return xn(e,n)}function gk(e,t){const n=vn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Un(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return xn(e,n)}function yk(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=vn(t._zod.def,{get shape(){const c=t._zod.def.shape,u={...c};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(const l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Un(this,"shape",u),u},checks:[]});return xn(t,a)}function bk(e,t,n){const r=vn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const a in n){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return Un(this,"shape",s),s}});return xn(t,r)}function Jn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Am(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jo(e){return typeof e=="string"?e:e?.message}function $n(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=jo(e.inst?._zod.def?.error?.(e))??jo(t?.error?.(e))??jo(n.customError?.(e))??jo(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Wi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Tm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Na,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hi=M("$ZodError",Tm),Is=M("$ZodError",Tm,{Parent:Error});function vk(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function xk(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let a=n,c=0;for(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return r(e),n}const Ms=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new rr;if(a.issues.length){const c=new(o?.Err??e)(a.issues.map(u=>$n(u,s,Mn())));throw jm(c,o?.callee),c}return a.value},wk=Ms(Is),$s=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(o?.Err??e)(a.issues.map(u=>$n(u,s,Mn())));throw jm(c,o?.callee),c}return a.value},_k=$s(Is),Fs=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new rr;return s.issues.length?{success:!1,error:new(e??Hi)(s.issues.map(a=>$n(a,o,Mn())))}:{success:!0,data:s.value}},Sk=Fs(Is),zs=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>$n(a,o,Mn())))}:{success:!0,data:s.value}},kk=zs(Is),Ek=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ms(e)(t,n,o)},Ck=e=>(t,n,r)=>Ms(e)(t,n,r),Nk=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $s(e)(t,n,o)},jk=e=>async(t,n,r)=>$s(e)(t,n,r),Rk=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fs(e)(t,n,o)},Ak=e=>(t,n,r)=>Fs(e)(t,n,r),Tk=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zs(e)(t,n,o)},Ok=e=>async(t,n,r)=>zs(e)(t,n,r),Pk=/^[cC][^\s-]{8,}$/,Dk=/^[0-9a-z]+$/,Ik=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mk=/^[0-9a-vA-V]{20}$/,$k=/^[A-Za-z0-9]{27}$/,Fk=/^[a-zA-Z0-9_-]{21}$/,zk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Uk(){return new RegExp(Vk,"u")}const Wk=/^(?:(?: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])$/,Hk=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Zk=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,qk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Om=/^[A-Za-z0-9_-]*$/,Gk=/^\+[1-9]\d{6,14}$/,Pm="(?:(?:\\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])))",Kk=new RegExp(`^${Pm}$`);function Dm(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Jk(e){return new RegExp(`^${Dm(e)}$`)}function Xk(e){const t=Dm({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Pm}T(?:${r})$`)}const Qk=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eE=/^-?\d+$/,tE=/^-?\d+(?:\.\d+)?$/,nE=/^(?:true|false)$/i,rE=/^[^A-Z]*$/,oE=/^[^a-z]*$/,lt=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Im={number:"number",bigint:"bigint",object:"date"},Mm=M("$ZodCheckLessThan",(e,t)=>{lt.init(e,t);const n=Im[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$m=M("$ZodCheckGreaterThan",(e,t)=>{lt.init(e,t);const n=Im[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sE=M("$ZodCheckMultipleOf",(e,t)=>{lt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):ak(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),aE=M("$ZodCheckNumberFormat",(e,t)=>{lt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=dk[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,n&&(c.pattern=eE)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),iE=M("$ZodCheckMaxLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Vi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=Wi(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),cE=M("$ZodCheckMinLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Vi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=Wi(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lE=M("$ZodCheckLengthEquals",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Vi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const a=Wi(o),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ls=M("$ZodCheckStringFormat",(e,t)=>{var n,r;lt.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uE=M("$ZodCheckRegex",(e,t)=>{Ls.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dE=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rE),Ls.init(e,t)}),fE=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oE),Ls.init(e,t)}),mE=M("$ZodCheckIncludes",(e,t)=>{lt.init(e,t);const n=Ds(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pE=M("$ZodCheckStartsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`^${Ds(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),hE=M("$ZodCheckEndsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`.*${Ds(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gE=M("$ZodCheckOverwrite",(e,t)=>{lt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yE{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
67
|
+
`);const p="═".repeat(58),h=l.slice(0,50).padEnd(50);return`#!/usr/bin/env bash
|
|
68
|
+
# =============================================================================
|
|
69
|
+
#
|
|
70
|
+
# Universal Restic Restore & Docker Auto-Start Script
|
|
71
|
+
# Version : 2.0 | Author : Meyi Backup
|
|
72
|
+
# Job : ${l}
|
|
73
|
+
# Snapshot: ${n}
|
|
74
|
+
#
|
|
75
|
+
# USAGE:
|
|
76
|
+
# chmod +x restore.sh && sudo ./restore.sh
|
|
77
|
+
# sudo ./restore.sh --snapshot ${n} --target /
|
|
78
|
+
# sudo ./restore.sh --dry-run
|
|
79
|
+
#
|
|
80
|
+
# OPTIONS:
|
|
81
|
+
# --snapshot <id|latest> Snapshot to restore (default: ${n})
|
|
82
|
+
# --target <path> Restore destination (default: /tmp/restic-restore)
|
|
83
|
+
# --dry-run List snapshot contents without writing anything
|
|
84
|
+
#
|
|
85
|
+
# =============================================================================
|
|
86
|
+
|
|
87
|
+
set -euo pipefail
|
|
88
|
+
|
|
89
|
+
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
|
|
90
|
+
|
|
91
|
+
# ─── Pre-filled credentials (generated by Meyi Backup) ──────────────────────
|
|
92
|
+
${d}
|
|
93
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
|
|
95
|
+
# Console colours
|
|
96
|
+
RED='\\033[0;31m'
|
|
97
|
+
GREEN='\\033[0;32m'
|
|
98
|
+
YELLOW='\\033[1;33m'
|
|
99
|
+
CYAN='\\033[0;36m'
|
|
100
|
+
BLUE='\\033[0;34m'
|
|
101
|
+
BOLD='\\033[1m'
|
|
102
|
+
DIM='\\033[2m'
|
|
103
|
+
NC='\\033[0m'
|
|
104
|
+
|
|
105
|
+
info() { echo -e " \${CYAN}•\${NC} $*"; }
|
|
106
|
+
success() { echo -e " \${GREEN}✔\${NC} $*"; }
|
|
107
|
+
warn() { echo -e " \${YELLOW}⚠\${NC} $*"; }
|
|
108
|
+
error() { echo -e " \${RED}✘\${NC} $*" >&2; }
|
|
109
|
+
die() { echo ""; error "$*"; echo ""; exit 1; }
|
|
110
|
+
|
|
111
|
+
section() {
|
|
112
|
+
echo ""
|
|
113
|
+
echo -e " \${BOLD}\${BLUE}▶ $*\${NC}"
|
|
114
|
+
echo -e " \${DIM}$(printf '─%.0s' {1..58})\${NC}"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get_free_port() {
|
|
118
|
+
local port=$1
|
|
119
|
+
if ! command -v ss &>/dev/null; then echo "$port"; return; fi
|
|
120
|
+
while ss -ltn | awk '{print $4}' | grep -q ":$port$"; do port=$((port + 1)); done
|
|
121
|
+
echo "$port"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
get_tag_version() {
|
|
125
|
+
echo "$SNAP_INFO" \\
|
|
126
|
+
| grep -oiE "$1-([0-9]+\\.?[0-9]*)" | head -n 1 \\
|
|
127
|
+
| cut -d'-' -f2 || echo ""
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
SNAPSHOT_ID="${n}"
|
|
131
|
+
RESTORE_TARGET="/tmp/restic-restore"
|
|
132
|
+
DRY_RUN=false
|
|
133
|
+
|
|
134
|
+
while [[ $# -gt 0 ]]; do
|
|
135
|
+
case "$1" in
|
|
136
|
+
--snapshot) SNAPSHOT_ID="$2"; shift 2 ;;
|
|
137
|
+
--target) RESTORE_TARGET="$2"; shift 2 ;;
|
|
138
|
+
--dry-run) DRY_RUN=true; shift 1 ;;
|
|
139
|
+
-h|--help) grep '^#' "$0" | grep -v '^#!/' | sed 's/^# \\{0,2\\}//'; exit 0 ;;
|
|
140
|
+
*) die "Unknown argument: '$1'. Run with --help for usage." ;;
|
|
141
|
+
esac
|
|
142
|
+
done
|
|
143
|
+
|
|
144
|
+
clear 2>/dev/null || true
|
|
145
|
+
echo ""
|
|
146
|
+
echo -e "\${BOLD} ╔${p}╗\${NC}"
|
|
147
|
+
echo -e "\${BOLD} ║ Universal Meyi connect recover — ${h} ║\${NC}"
|
|
148
|
+
echo -e "\${BOLD} ╚${p}╝\${NC}"
|
|
149
|
+
[[ "$DRY_RUN" == true ]] && echo -e " \${YELLOW} Mode : DRY RUN — no files will be written\${NC}"
|
|
150
|
+
echo ""
|
|
151
|
+
|
|
152
|
+
[[ $EUID -ne 0 ]] && die "This script must be run as root.\\n\\n Try: sudo bash $0"
|
|
153
|
+
|
|
154
|
+
# =============================================================================
|
|
155
|
+
# STEP 1 — Install Required Tools
|
|
156
|
+
# =============================================================================
|
|
157
|
+
|
|
158
|
+
section "Step 1 of 7 — Checking Required Tools"
|
|
159
|
+
|
|
160
|
+
if ! command -v restic &>/dev/null; then
|
|
161
|
+
info "Restic not found — installing..."
|
|
162
|
+
if command -v dnf &>/dev/null; then dnf install -y restic || true
|
|
163
|
+
elif command -v yum &>/dev/null; then yum install -y restic || true
|
|
164
|
+
elif command -v apt-get &>/dev/null; then apt-get update -qq && apt-get install -y -qq restic || true
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
if ! command -v restic &>/dev/null; then
|
|
168
|
+
info "Package install failed — fetching official binary..."
|
|
169
|
+
ARCH=$(uname -m)
|
|
170
|
+
case "$ARCH" in
|
|
171
|
+
x86_64) R_ARCH="amd64" ;;
|
|
172
|
+
aarch64) R_ARCH="arm64" ;;
|
|
173
|
+
*) R_ARCH="386" ;;
|
|
174
|
+
esac
|
|
175
|
+
RESTIC_VERSION=$(curl -s https://api.github.com/repos/restic/restic/releases/latest | grep tag_name | cut -d'"' -f4 | sed 's/v//' || echo "0.17.3")
|
|
176
|
+
[[ -z "$RESTIC_VERSION" ]] && RESTIC_VERSION="0.17.3"
|
|
177
|
+
info "Downloading restic v\${RESTIC_VERSION} (\${R_ARCH})..."
|
|
178
|
+
if ! command -v bunzip2 &>/dev/null; then
|
|
179
|
+
if command -v dnf &>/dev/null; then dnf install -y bzip2
|
|
180
|
+
elif command -v yum &>/dev/null; then yum install -y bzip2
|
|
181
|
+
else apt-get install -y -qq bzip2
|
|
182
|
+
fi
|
|
183
|
+
fi
|
|
184
|
+
URL="https://github.com/restic/restic/releases/download/v\${RESTIC_VERSION}/restic_\${RESTIC_VERSION}_linux_\${R_ARCH}.bz2"
|
|
185
|
+
curl -fsSL -o /usr/local/bin/restic.bz2 "$URL" || die "Failed to download restic from GitHub."
|
|
186
|
+
[[ -f /usr/local/bin/restic ]] && mv /usr/local/bin/restic /usr/local/bin/restic.old
|
|
187
|
+
bunzip2 -f /usr/local/bin/restic.bz2
|
|
188
|
+
chmod +x /usr/local/bin/restic
|
|
189
|
+
fi
|
|
190
|
+
fi
|
|
191
|
+
success "Restic $(restic version 2>/dev/null | head -1)"
|
|
192
|
+
|
|
193
|
+
if ! command -v docker &>/dev/null; then
|
|
194
|
+
info "Docker not found — installing..."
|
|
195
|
+
if command -v dnf &>/dev/null; then
|
|
196
|
+
dnf install -y dnf-plugins-core
|
|
197
|
+
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
198
|
+
dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
199
|
+
elif command -v yum &>/dev/null; then
|
|
200
|
+
yum install -y yum-utils
|
|
201
|
+
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
202
|
+
yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
203
|
+
else
|
|
204
|
+
curl -fsSL https://get.docker.com | bash
|
|
205
|
+
fi
|
|
206
|
+
systemctl enable docker
|
|
207
|
+
systemctl start docker
|
|
208
|
+
fi
|
|
209
|
+
success "Docker $(docker --version 2>/dev/null)"
|
|
210
|
+
|
|
211
|
+
if ! docker compose version &>/dev/null; then
|
|
212
|
+
info "Docker Compose plugin not found — installing..."
|
|
213
|
+
if command -v dnf &>/dev/null; then dnf install -y docker-compose-plugin || true
|
|
214
|
+
elif command -v yum &>/dev/null; then yum install -y docker-compose-plugin || true
|
|
215
|
+
else apt-get update -qq && apt-get install -y -qq docker-compose-plugin || true
|
|
216
|
+
fi
|
|
217
|
+
fi
|
|
218
|
+
success "Compose $(docker compose version 2>/dev/null)"
|
|
219
|
+
|
|
220
|
+
if ! command -v rsync &>/dev/null; then
|
|
221
|
+
if command -v dnf &>/dev/null; then dnf install -y rsync
|
|
222
|
+
elif command -v yum &>/dev/null; then yum install -y rsync
|
|
223
|
+
else apt-get install -y rsync
|
|
224
|
+
fi
|
|
225
|
+
fi
|
|
226
|
+
success "rsync $(rsync --version 2>/dev/null | head -1)"
|
|
227
|
+
|
|
228
|
+
# =============================================================================
|
|
229
|
+
# STEP 2 — Verify repository connection
|
|
230
|
+
# =============================================================================
|
|
231
|
+
|
|
232
|
+
section "Step 2 of 7 — Repository Credentials"
|
|
233
|
+
|
|
234
|
+
info "Repository : $RESTIC_REPOSITORY"
|
|
235
|
+
info "Verifying connection..."
|
|
236
|
+
if ! restic snapshots --quiet &>/dev/null; then
|
|
237
|
+
die "Cannot connect to repository.\\n\\n Check your credentials and repository URL, then try again."
|
|
238
|
+
fi
|
|
239
|
+
success "Connected to: $RESTIC_REPOSITORY"
|
|
240
|
+
|
|
241
|
+
# =============================================================================
|
|
242
|
+
# STEP 3 — Select Snapshot
|
|
243
|
+
# =============================================================================
|
|
244
|
+
|
|
245
|
+
section "Step 3 of 7 — Selecting Snapshot"
|
|
246
|
+
|
|
247
|
+
if [[ "$SNAPSHOT_ID" == "latest" ]]; then
|
|
248
|
+
info "Resolving latest snapshot ID..."
|
|
249
|
+
SNAPSHOT_ID=$(restic snapshots --latest 1 --json | grep -o '"short_id":"[^"]*"' | head -1 | cut -d'"' -f4)
|
|
250
|
+
[[ -z "$SNAPSHOT_ID" ]] && die "No snapshots found in this repository."
|
|
251
|
+
fi
|
|
252
|
+
success "Snapshot selected : \${BOLD}\${SNAPSHOT_ID}\${NC}"
|
|
253
|
+
|
|
254
|
+
# =============================================================================
|
|
255
|
+
# STEP 4 — Disk Space Check
|
|
256
|
+
# =============================================================================
|
|
257
|
+
|
|
258
|
+
section "Step 4 of 7 — Disk Space Check"
|
|
259
|
+
|
|
260
|
+
if [[ "$DRY_RUN" == false ]]; then
|
|
261
|
+
info "Calculating snapshot restore size (this may take a moment)..."
|
|
262
|
+
|
|
263
|
+
RESTORE_SIZE_BYTES=$(restic stats "$SNAPSHOT_ID" --mode restore-size --json 2>/dev/null | grep -o '"total_size": *[0-9]*' | grep -o '[0-9]*' || echo "")
|
|
264
|
+
|
|
265
|
+
if [[ -n "$RESTORE_SIZE_BYTES" && "$RESTORE_SIZE_BYTES" =~ ^[0-9]+$ ]]; then
|
|
266
|
+
mkdir -p "$RESTORE_TARGET" 2>/dev/null || true
|
|
267
|
+
AVAILABLE_KB=$(df -k "$RESTORE_TARGET" 2>/dev/null | awk 'NR==2 {print $4}' || echo "")
|
|
268
|
+
if [[ -n "$AVAILABLE_KB" && "$AVAILABLE_KB" =~ ^[0-9]+$ ]]; then
|
|
269
|
+
AVAILABLE_BYTES=$((AVAILABLE_KB * 1024))
|
|
270
|
+
SIZE_MB=$((RESTORE_SIZE_BYTES / 1024 / 1024))
|
|
271
|
+
AVAIL_MB=$((AVAILABLE_BYTES / 1024 / 1024))
|
|
272
|
+
info "Snapshot size : ~\${SIZE_MB} MB"
|
|
273
|
+
info "Available space : ~\${AVAIL_MB} MB"
|
|
274
|
+
if (( RESTORE_SIZE_BYTES > AVAILABLE_BYTES )); then
|
|
275
|
+
die "Not enough disk space.\\n\\n Required: ~\${SIZE_MB} MB | Available: ~\${AVAIL_MB} MB\\n\\n Free up space or choose a different target path."
|
|
276
|
+
fi
|
|
277
|
+
success "Disk space is sufficient."
|
|
278
|
+
else
|
|
279
|
+
warn "Could not determine available space on '\${RESTORE_TARGET}'. Proceeding anyway."
|
|
280
|
+
fi
|
|
281
|
+
else
|
|
282
|
+
warn "Could not determine snapshot size from restic stats. Proceeding anyway."
|
|
283
|
+
fi
|
|
284
|
+
else
|
|
285
|
+
info "Dry-run mode — skipping disk space check."
|
|
286
|
+
fi
|
|
287
|
+
|
|
288
|
+
# =============================================================================
|
|
289
|
+
# STEP 5 — Restore Snapshot
|
|
290
|
+
# =============================================================================
|
|
291
|
+
|
|
292
|
+
section "Step 5 of 7 — Restoring Snapshot"
|
|
293
|
+
|
|
294
|
+
info "Snapshot : $SNAPSHOT_ID"
|
|
295
|
+
info "Target : $RESTORE_TARGET"
|
|
296
|
+
echo ""
|
|
297
|
+
|
|
298
|
+
if [[ "$DRY_RUN" == true ]]; then
|
|
299
|
+
warn "DRY RUN — listing snapshot contents only:"
|
|
300
|
+
echo ""
|
|
301
|
+
restic ls "$SNAPSHOT_ID"
|
|
302
|
+
echo ""
|
|
303
|
+
success "Dry run complete. No files were written."
|
|
304
|
+
exit 0
|
|
305
|
+
fi
|
|
306
|
+
|
|
307
|
+
set +e
|
|
308
|
+
restic restore "$SNAPSHOT_ID" --target "$RESTORE_TARGET"
|
|
309
|
+
RESTIC_EXIT=$?
|
|
310
|
+
set -e
|
|
311
|
+
|
|
312
|
+
if [[ $RESTIC_EXIT -eq 0 ]]; then
|
|
313
|
+
success "Snapshot restored successfully to: \${RESTORE_TARGET}"
|
|
314
|
+
elif [[ $RESTIC_EXIT -eq 1 ]]; then
|
|
315
|
+
echo ""
|
|
316
|
+
warn "Restore finished with minor warnings (exit code 1)."
|
|
317
|
+
warn "This is expected — snap/containerd/docker device files cannot be"
|
|
318
|
+
warn "overwritten on a live OS. Your application data is fully restored."
|
|
319
|
+
success "Continuing with data migration..."
|
|
320
|
+
else
|
|
321
|
+
die "Restic exited with code \${RESTIC_EXIT}. See output above for details."
|
|
322
|
+
fi
|
|
323
|
+
|
|
324
|
+
# =============================================================================
|
|
325
|
+
# STEP 6 — Migrate Application Data
|
|
326
|
+
# =============================================================================
|
|
327
|
+
|
|
328
|
+
section "Step 6 of 7 — Migrating Data to Host"
|
|
329
|
+
|
|
330
|
+
info "Stopping database services to prevent data corruption..."
|
|
331
|
+
VOLUMES_IN_SNAPSHOT=false
|
|
332
|
+
[[ -d "$RESTORE_TARGET/var/lib/docker/volumes" ]] && VOLUMES_IN_SNAPSHOT=true
|
|
333
|
+
systemctl stop docker 2>/dev/null || true
|
|
334
|
+
systemctl stop mariadb 2>/dev/null || true
|
|
335
|
+
systemctl stop mysqld 2>/dev/null || true
|
|
336
|
+
systemctl stop postgresql 2>/dev/null || true
|
|
337
|
+
systemctl stop mongod 2>/dev/null || true
|
|
338
|
+
systemctl stop redis 2>/dev/null || true
|
|
339
|
+
systemctl stop redis-server 2>/dev/null || true
|
|
340
|
+
sleep 2
|
|
341
|
+
success "Services stopped."
|
|
342
|
+
|
|
343
|
+
SAFE_DIRS=(
|
|
344
|
+
"home"
|
|
345
|
+
"root"
|
|
346
|
+
"opt"
|
|
347
|
+
"var/www"
|
|
348
|
+
"var/lib/docker/volumes"
|
|
349
|
+
"var/lib/pgsql"
|
|
350
|
+
"var/lib/mysql"
|
|
351
|
+
"var/lib/mongo"
|
|
352
|
+
"var/lib/redis"
|
|
353
|
+
"var/lib/odoo"
|
|
354
|
+
"etc/nginx"
|
|
355
|
+
"etc/letsencrypt"
|
|
356
|
+
"etc/cron.d"
|
|
357
|
+
"etc/cron.daily"
|
|
358
|
+
"etc/environment"
|
|
359
|
+
"etc/odoo"
|
|
360
|
+
"etc/my.cnf"
|
|
361
|
+
"etc/my.cnf.d"
|
|
362
|
+
"etc/mysql"
|
|
363
|
+
"etc/postgresql"
|
|
364
|
+
"etc/redis"
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
echo ""
|
|
368
|
+
info "Syncing restored directories to host..."
|
|
369
|
+
for BDIR in "\${SAFE_DIRS[@]}"; do
|
|
370
|
+
if [[ -d "$RESTORE_TARGET/$BDIR" ]]; then
|
|
371
|
+
info " /\${BDIR}"
|
|
372
|
+
mkdir -p "/\${BDIR}" 2>/dev/null || true
|
|
373
|
+
rsync -a "$RESTORE_TARGET/\${BDIR}/" "/\${BDIR}/"
|
|
374
|
+
success " /\${BDIR} synced."
|
|
375
|
+
fi
|
|
376
|
+
done
|
|
377
|
+
|
|
378
|
+
if [[ "$VOLUMES_IN_SNAPSHOT" == true ]]; then
|
|
379
|
+
echo ""
|
|
380
|
+
info "Restarting Docker with restored volumes..."
|
|
381
|
+
systemctl start docker 2>/dev/null || service docker start 2>/dev/null || true
|
|
382
|
+
sleep 3
|
|
383
|
+
if docker info &>/dev/null 2>&1; then
|
|
384
|
+
success "Docker is running."
|
|
385
|
+
else
|
|
386
|
+
warn "Docker may not have started automatically."
|
|
387
|
+
warn "Run: sudo systemctl start docker"
|
|
388
|
+
fi
|
|
389
|
+
echo ""
|
|
390
|
+
info "Restored Docker volumes:"
|
|
391
|
+
RESTORED_VOLS=$(ls /var/lib/docker/volumes/ 2>/dev/null | grep -v "^metadata.db$" || true)
|
|
392
|
+
if [[ -n "$RESTORED_VOLS" ]]; then
|
|
393
|
+
while IFS= read -r vol; do
|
|
394
|
+
echo -e " \${GREEN}▸\${NC} $vol"
|
|
395
|
+
done <<< "$RESTORED_VOLS"
|
|
396
|
+
else
|
|
397
|
+
warn "No Docker volumes found after migration."
|
|
398
|
+
fi
|
|
399
|
+
fi
|
|
400
|
+
|
|
401
|
+
# ── Native Application & Database Detection ──────────────────────────────────
|
|
402
|
+
echo ""
|
|
403
|
+
info "Scanning for native (non-Docker) application data..."
|
|
404
|
+
|
|
405
|
+
SNAP_INFO=$(restic snapshots --json "$SNAPSHOT_ID" 2>/dev/null || echo "[]")
|
|
406
|
+
|
|
407
|
+
# ── PostgreSQL ────────────────────────────────────────────────────────────────
|
|
408
|
+
if [[ -f /var/lib/pgsql/data/PG_VERSION ]] || \\
|
|
409
|
+
[[ -f "$RESTORE_TARGET/var/lib/pgsql/data/PG_VERSION" ]]; then
|
|
410
|
+
|
|
411
|
+
PG_PATH="$RESTORE_TARGET/var/lib/pgsql/data"
|
|
412
|
+
[[ ! -d "$PG_PATH" ]] && PG_PATH="/var/lib/pgsql/data"
|
|
413
|
+
|
|
414
|
+
PG_V=$(get_tag_version "postgres")
|
|
415
|
+
[[ -z "$PG_V" ]] && PG_V=$(cat "$PG_PATH/PG_VERSION" 2>/dev/null || echo "15")
|
|
416
|
+
|
|
417
|
+
info "Detected PostgreSQL \${PG_V} — installing matching server..."
|
|
418
|
+
|
|
419
|
+
if command -v dnf &>/dev/null; then
|
|
420
|
+
if [[ "$PG_V" != "13" ]]; then
|
|
421
|
+
dnf install -y "https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm" || true
|
|
422
|
+
dnf -qy module disable postgresql || true
|
|
423
|
+
dnf install -y "postgresql\${PG_V}-server" || dnf install -y postgresql-server || true
|
|
424
|
+
else
|
|
425
|
+
dnf install -y postgresql-server || true
|
|
426
|
+
fi
|
|
427
|
+
elif command -v apt-get &>/dev/null; then
|
|
428
|
+
apt-get update -qq && apt-get install -y -qq "postgresql-\${PG_V}" \\
|
|
429
|
+
|| apt-get install -y -qq postgresql || true
|
|
430
|
+
fi
|
|
431
|
+
|
|
432
|
+
systemctl stop postgresql 2>/dev/null || \\
|
|
433
|
+
systemctl stop "postgresql-\${PG_V}" 2>/dev/null || true
|
|
434
|
+
chown -R postgres:postgres /var/lib/pgsql 2>/dev/null || true
|
|
435
|
+
restorecon -Rv /var/lib/pgsql &>/dev/null || true
|
|
436
|
+
systemctl disable postgresql 2>/dev/null || \\
|
|
437
|
+
systemctl disable "postgresql-\${PG_V}" 2>/dev/null || true
|
|
438
|
+
|
|
439
|
+
success "PostgreSQL \${PG_V} ready (service disabled — start manually when ready)"
|
|
440
|
+
fi
|
|
441
|
+
|
|
442
|
+
# ── MySQL / MariaDB ───────────────────────────────────────────────────────────
|
|
443
|
+
if [[ -f /var/lib/mysql/ibdata1 ]] || \\
|
|
444
|
+
[[ -f "$RESTORE_TARGET/var/lib/mysql/ibdata1" ]]; then
|
|
445
|
+
|
|
446
|
+
DET_PATH="$RESTORE_TARGET/var/lib/mysql"
|
|
447
|
+
[[ ! -d "$DET_PATH" ]] && DET_PATH="/var/lib/mysql"
|
|
448
|
+
|
|
449
|
+
DB_ENGINE="MySQL"
|
|
450
|
+
[[ -f "$DET_PATH/aria_log_control" ]] && DB_ENGINE="MariaDB"
|
|
451
|
+
|
|
452
|
+
V_FOUND=$(get_tag_version "mariadb")
|
|
453
|
+
[[ -z "$V_FOUND" ]] && V_FOUND=$(get_tag_version "mysql")
|
|
454
|
+
|
|
455
|
+
if [[ -z "$V_FOUND" ]] && [[ -f "$DET_PATH/mysql_upgrade_info" ]]; then
|
|
456
|
+
V_FOUND=$(head -n 1 "$DET_PATH/mysql_upgrade_info" | cut -d'.' -f1,2)
|
|
457
|
+
fi
|
|
458
|
+
|
|
459
|
+
if [[ -z "$V_FOUND" ]] && [[ -f "$DET_PATH/ibdata1" ]]; then
|
|
460
|
+
V_FOUND=$(
|
|
461
|
+
head -c 10000000 "$DET_PATH/ibdata1" \\
|
|
462
|
+
| strings \\
|
|
463
|
+
| grep -Ei "(mariadb|mysql)-[0-9]+\\.[0-9]+" | head -n 1 \\
|
|
464
|
+
| sed -E 's/.*(mariadb|mysql)-([0-9]+\\.[0-9]+).*/\\2/i' || echo ""
|
|
465
|
+
)
|
|
466
|
+
fi
|
|
467
|
+
|
|
468
|
+
if [[ "$DB_ENGINE" == "MariaDB" ]]; then
|
|
469
|
+
info "Detected MariaDB\${V_FOUND:+ \${V_FOUND}} — installing matching server..."
|
|
470
|
+
|
|
471
|
+
if [[ -n "$V_FOUND" ]]; then
|
|
472
|
+
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup \\
|
|
473
|
+
| bash -s -- --mariadb-server-version="\${V_FOUND}" \\
|
|
474
|
+
|| warn "MariaDB repo setup failed — falling back to OS default."
|
|
475
|
+
else
|
|
476
|
+
warn "Could not detect MariaDB version — using OS default."
|
|
477
|
+
fi
|
|
478
|
+
|
|
479
|
+
if command -v dnf &>/dev/null; then dnf install -y mariadb-server || true
|
|
480
|
+
elif command -v apt-get &>/dev/null; then apt-get update -qq && apt-get install -y -qq mariadb-server || true
|
|
481
|
+
fi
|
|
482
|
+
|
|
483
|
+
systemctl stop mariadb 2>/dev/null || true
|
|
484
|
+
U_NAME="mysql"; id -u mariadb &>/dev/null && U_NAME="mariadb"
|
|
485
|
+
chown -R "\${U_NAME}:\${U_NAME}" /var/lib/mysql 2>/dev/null || true
|
|
486
|
+
command -v restorecon &>/dev/null && restorecon -Rv /var/lib/mysql &>/dev/null || true
|
|
487
|
+
|
|
488
|
+
mkdir -p /var/lib/mysql/redo_log_bak 2>/dev/null || true
|
|
489
|
+
if [[ -f /var/lib/mysql/ib_logfile0 ]]; then
|
|
490
|
+
mv /var/lib/mysql/ib_logfile* /var/lib/mysql/redo_log_bak/ 2>/dev/null || true
|
|
491
|
+
fi
|
|
492
|
+
|
|
493
|
+
systemctl disable mariadb 2>/dev/null || true
|
|
494
|
+
success "MariaDB \${V_FOUND:-detected} ready (service disabled — start manually when ready)"
|
|
495
|
+
|
|
496
|
+
else
|
|
497
|
+
info "Detected MySQL\${V_FOUND:+ \${V_FOUND}} — installing matching server..."
|
|
498
|
+
|
|
499
|
+
if command -v dnf &>/dev/null; then dnf install -y mysql-server || true
|
|
500
|
+
elif command -v apt-get &>/dev/null; then apt-get update -qq && apt-get install -y -qq mysql-server || true
|
|
501
|
+
fi
|
|
502
|
+
|
|
503
|
+
systemctl stop mysqld 2>/dev/null || true
|
|
504
|
+
chown -R mysql:mysql /var/lib/mysql 2>/dev/null || true
|
|
505
|
+
command -v restorecon &>/dev/null && restorecon -Rv /var/lib/mysql &>/dev/null || true
|
|
506
|
+
|
|
507
|
+
mkdir -p /var/lib/mysql/redo_log_bak 2>/dev/null || true
|
|
508
|
+
if [[ -f /var/lib/mysql/ib_logfile0 ]]; then
|
|
509
|
+
mv /var/lib/mysql/ib_logfile* /var/lib/mysql/redo_log_bak/ 2>/dev/null || true
|
|
510
|
+
fi
|
|
511
|
+
|
|
512
|
+
systemctl disable mysqld 2>/dev/null || true
|
|
513
|
+
success "MySQL \${V_FOUND:-detected} ready (service disabled — start manually when ready)"
|
|
514
|
+
fi
|
|
515
|
+
fi
|
|
516
|
+
|
|
517
|
+
# ── MongoDB ───────────────────────────────────────────────────────────────────
|
|
518
|
+
if [[ -f /var/lib/mongo/WiredTiger ]] || \\
|
|
519
|
+
[[ -f "$RESTORE_TARGET/var/lib/mongo/WiredTiger" ]]; then
|
|
520
|
+
|
|
521
|
+
V_MON=$(get_tag_version "mongo")
|
|
522
|
+
info "Detected MongoDB\${V_MON:+ \${V_MON}} — installing server..."
|
|
523
|
+
|
|
524
|
+
if command -v dnf &>/dev/null; then dnf install -y mongodb-server || true
|
|
525
|
+
elif command -v apt-get &>/dev/null; then apt-get update -qq && apt-get install -y -qq mongodb || true
|
|
526
|
+
fi
|
|
527
|
+
|
|
528
|
+
systemctl stop mongod 2>/dev/null || true
|
|
529
|
+
chown -R mongod:mongod /var/lib/mongo 2>/dev/null || true
|
|
530
|
+
systemctl disable mongod 2>/dev/null || true
|
|
531
|
+
|
|
532
|
+
success "MongoDB \${V_MON:-detected} ready (service disabled — start manually when ready)"
|
|
533
|
+
fi
|
|
534
|
+
|
|
535
|
+
# ── Redis ─────────────────────────────────────────────────────────────────────
|
|
536
|
+
if [[ -f /var/lib/redis/dump.rdb ]] || \\
|
|
537
|
+
[[ -f "$RESTORE_TARGET/var/lib/redis/dump.rdb" ]]; then
|
|
538
|
+
|
|
539
|
+
V_RED=$(get_tag_version "redis")
|
|
540
|
+
info "Detected Redis\${V_RED:+ \${V_RED}} — installing server..."
|
|
541
|
+
|
|
542
|
+
if command -v dnf &>/dev/null; then dnf install -y redis || true
|
|
543
|
+
elif command -v apt-get &>/dev/null; then apt-get update -qq && apt-get install -y -qq redis-server || true
|
|
544
|
+
fi
|
|
545
|
+
|
|
546
|
+
systemctl stop redis 2>/dev/null || \\
|
|
547
|
+
systemctl stop redis-server 2>/dev/null || true
|
|
548
|
+
chown -R redis:redis /var/lib/redis 2>/dev/null || true
|
|
549
|
+
systemctl disable redis 2>/dev/null || \\
|
|
550
|
+
systemctl disable redis-server 2>/dev/null || true
|
|
551
|
+
|
|
552
|
+
success "Redis \${V_RED:-detected} ready (service disabled — start manually when ready)"
|
|
553
|
+
fi
|
|
554
|
+
|
|
555
|
+
# ── Odoo ──────────────────────────────────────────────────────────────────────
|
|
556
|
+
if [[ -d /var/lib/odoo ]]; then
|
|
557
|
+
info "Detected Odoo data — installing server..."
|
|
558
|
+
if command -v dnf &>/dev/null; then dnf install -y odoo || true; fi
|
|
559
|
+
systemctl stop odoo 2>/dev/null || true
|
|
560
|
+
systemctl disable odoo 2>/dev/null || true
|
|
561
|
+
success "Odoo ready (service disabled — start manually when ready)"
|
|
562
|
+
fi
|
|
563
|
+
|
|
564
|
+
# =============================================================================
|
|
565
|
+
# STEP 7 — Container & Compose Restore
|
|
566
|
+
# =============================================================================
|
|
567
|
+
|
|
568
|
+
section "Step 7 of 7 — Restoring Docker Containers"
|
|
569
|
+
|
|
570
|
+
CONTAINER_SCRIPT="/opt/meyi-backup/containers.sh"
|
|
571
|
+
|
|
572
|
+
if [[ -f "$CONTAINER_SCRIPT" ]]; then
|
|
573
|
+
success "Found container config script: \${CONTAINER_SCRIPT}"
|
|
574
|
+
info "Pulling images and creating containers in stopped state..."
|
|
575
|
+
if bash "$CONTAINER_SCRIPT"; then
|
|
576
|
+
success "Containers restored via config script."
|
|
577
|
+
else
|
|
578
|
+
warn "Container script completed with errors — review output above."
|
|
579
|
+
fi
|
|
580
|
+
else
|
|
581
|
+
info "No container config script found — running auto-detection..."
|
|
582
|
+
echo ""
|
|
583
|
+
|
|
584
|
+
info "Scanning /home and /opt for docker-compose.yml files..."
|
|
585
|
+
find /home /opt -name "docker-compose.yml" 2>/dev/null | while read -r compose_file; do
|
|
586
|
+
compose_dir=$(dirname "$compose_file")
|
|
587
|
+
info " Found: \${compose_dir}"
|
|
588
|
+
(
|
|
589
|
+
cd "$compose_dir"
|
|
590
|
+
docker compose pull && docker compose up --no-start
|
|
591
|
+
) || warn " Could not initialise: \${compose_dir}"
|
|
592
|
+
success " Compose project ready: \${compose_dir}"
|
|
593
|
+
done
|
|
594
|
+
|
|
595
|
+
echo ""
|
|
596
|
+
info "Scanning named Docker volumes for unmanaged databases..."
|
|
597
|
+
|
|
598
|
+
DOCKER_CMD="docker"
|
|
599
|
+
command -v docker &>/dev/null || DOCKER_CMD="sudo docker"
|
|
600
|
+
|
|
601
|
+
VOLS=$(ls /var/lib/docker/volumes 2>/dev/null | grep -v "^metadata.db$" || true)
|
|
602
|
+
|
|
603
|
+
for vol in $VOLS; do
|
|
604
|
+
DATA="/var/lib/docker/volumes/$vol/_data"
|
|
605
|
+
[[ ! -d "$DATA" ]] && continue
|
|
606
|
+
|
|
607
|
+
IMAGE="" MOUNT="" PORT="" NAME_PREFIX=""
|
|
608
|
+
|
|
609
|
+
if [[ -f "$DATA/PG_VERSION" ]]; then
|
|
610
|
+
VER=$(cat "$DATA/PG_VERSION" 2>/dev/null || get_tag_version "postgres" || echo "15")
|
|
611
|
+
IMAGE="postgres:\${VER}"; MOUNT="/var/lib/postgresql/data"; PORT=5432; NAME_PREFIX="pg"
|
|
612
|
+
|
|
613
|
+
elif [[ -f "$DATA/ibdata1" ]]; then
|
|
614
|
+
if [[ -f "$DATA/aria_log_control" ]]; then
|
|
615
|
+
V_VOL=$(get_tag_version "mariadb")
|
|
616
|
+
[[ -z "$V_VOL" ]] && V_VOL=$(get_tag_version "mysql")
|
|
617
|
+
[[ -z "$V_VOL" && -f "$DATA/mysql_upgrade_info" ]] \\
|
|
618
|
+
&& V_VOL=$(head -n 1 "$DATA/mysql_upgrade_info" | cut -d'.' -f1,2)
|
|
619
|
+
[[ -z "$V_VOL" ]] && V_VOL=$(
|
|
620
|
+
head -c 1000000 "$DATA/ibdata1" | strings \\
|
|
621
|
+
| grep -Ei "mariadb-[0-9]+\\.[0-9]+" | head -n 1 \\
|
|
622
|
+
| sed -E 's/.*mariadb-([0-9]+\\.[0-9]+).*/\\2/i' || echo ""
|
|
623
|
+
)
|
|
624
|
+
IMAGE="mariadb:\${V_VOL:-10.11}"; MOUNT="/var/lib/mysql"; PORT=3306; NAME_PREFIX="mariadb"
|
|
625
|
+
else
|
|
626
|
+
V_VOL=$(get_tag_version "mysql")
|
|
627
|
+
[[ -z "$V_VOL" && -f "$DATA/mysql_upgrade_info" ]] \\
|
|
628
|
+
&& V_VOL=$(head -n 1 "$DATA/mysql_upgrade_info" | cut -d'.' -f1,2)
|
|
629
|
+
[[ -z "$V_VOL" ]] && V_VOL=$(
|
|
630
|
+
head -c 1000000 "$DATA/ibdata1" | strings \\
|
|
631
|
+
| grep -Ei "mysql-[0-9]+\\.[0-9]+" | head -n 1 \\
|
|
632
|
+
| sed -E 's/.*mysql-([0-9]+\\.[0-9]+).*/\\2/i' || echo ""
|
|
633
|
+
)
|
|
634
|
+
IMAGE="mysql:\${V_VOL:-8.0}"; MOUNT="/var/lib/mysql"; PORT=3306; NAME_PREFIX="mysql"
|
|
635
|
+
fi
|
|
636
|
+
|
|
637
|
+
elif [[ -f "$DATA/WiredTiger" ]]; then
|
|
638
|
+
VER=$(get_tag_version "mongo" || echo "7")
|
|
639
|
+
IMAGE="mongo:\${VER}"; MOUNT="/data/db"; PORT=27017; NAME_PREFIX="mongo"
|
|
640
|
+
|
|
641
|
+
elif [[ -f "$DATA/dump.rdb" ]]; then
|
|
642
|
+
VER=$(get_tag_version "redis" || echo "7")
|
|
643
|
+
IMAGE="redis:\${VER}"; MOUNT="/data"; PORT=6379; NAME_PREFIX="redis"
|
|
644
|
+
|
|
645
|
+
elif [[ -d "$DATA/filestore" ]] || [[ -f "$DATA/odoo.conf" ]]; then
|
|
646
|
+
VER=$(get_tag_version "odoo" || echo "16")
|
|
647
|
+
IMAGE="odoo:\${VER}"; MOUNT="/var/lib/odoo"; PORT=8069; NAME_PREFIX="odoo"
|
|
648
|
+
fi
|
|
649
|
+
|
|
650
|
+
if [[ -n "$IMAGE" ]]; then
|
|
651
|
+
V_SHORT=\${vol:0:8}
|
|
652
|
+
C_NAME="\${NAME_PREFIX}-\${V_SHORT}"
|
|
653
|
+
if ! $DOCKER_CMD ps -a --format '{{.Names}}' | grep -q "^\${C_NAME}$"; then
|
|
654
|
+
FREE_PORT=$(get_free_port "$PORT")
|
|
655
|
+
info " Creating \${C_NAME} (image: \${IMAGE}, port: \${FREE_PORT}→\${PORT})..."
|
|
656
|
+
$DOCKER_CMD pull "$IMAGE" >/dev/null
|
|
657
|
+
$DOCKER_CMD create \\
|
|
658
|
+
--name "$C_NAME" \\
|
|
659
|
+
-v "$vol:$MOUNT" \\
|
|
660
|
+
-p "$FREE_PORT:$PORT" \\
|
|
661
|
+
--restart unless-stopped \\
|
|
662
|
+
"$IMAGE" >/dev/null
|
|
663
|
+
success " Container '\${C_NAME}' created on host port \${FREE_PORT}"
|
|
664
|
+
else
|
|
665
|
+
warn " Container '\${C_NAME}' already exists — skipping."
|
|
666
|
+
fi
|
|
667
|
+
fi
|
|
668
|
+
done
|
|
669
|
+
fi
|
|
670
|
+
|
|
671
|
+
# =============================================================================
|
|
672
|
+
# Summary
|
|
673
|
+
# =============================================================================
|
|
674
|
+
|
|
675
|
+
echo ""
|
|
676
|
+
echo -e " \${BOLD}\${BLUE}▶ All Containers (docker ps -a)\${NC}"
|
|
677
|
+
echo -e " \${DIM}$(printf '─%.0s' {1..58})\${NC}"
|
|
678
|
+
docker ps -a --format " {{.Names}}\\t{{.Status}}\\t{{.Ports}}" 2>/dev/null || true
|
|
679
|
+
|
|
680
|
+
echo ""
|
|
681
|
+
echo -e "\${BOLD} ╔${p}╗\${NC}"
|
|
682
|
+
echo -e "\${BOLD} ║ Restore Complete ✔ ║\${NC}"
|
|
683
|
+
echo -e "\${BOLD} ╠${p}╣\${NC}"
|
|
684
|
+
echo -e "\${BOLD} ║\${NC} Snapshot : $SNAPSHOT_ID"
|
|
685
|
+
echo -e "\${BOLD} ║\${NC} Target : $RESTORE_TARGET"
|
|
686
|
+
echo -e "\${BOLD} ╚${p}╝\${NC}"
|
|
687
|
+
echo ""
|
|
688
|
+
echo -e " \${DIM}Note: Native database services were left disabled intentionally."
|
|
689
|
+
echo -e " Verify your data before starting them with: systemctl start <service>\${NC}"
|
|
690
|
+
echo ""
|
|
691
|
+
`}function qS({runId:e,onClose:t}){const[n,r]=m.useState([]),[o,s]=m.useState("connecting"),[a,c]=m.useState(null),u=m.useRef(null);m.useEffect(()=>{const f=localStorage.getItem("access_token"),p=`${window.MEYI_API_BASE||"/api/v1/backup"}/runs/${e}/stream${f?`?token=${f}`:""}`,h=new EventSource(p);return h.addEventListener("log",g=>{const{line:y}=JSON.parse(g.data);r(b=>[...b,y])}),h.addEventListener("progress",g=>c(JSON.parse(g.data))),h.addEventListener("status",g=>{const{status:y}=JSON.parse(g.data);s(y),["success","failed","cancelled"].includes(y)&&h.close()}),h.onerror=()=>{s(g=>g==="running"?"error":g),h.close()},()=>h.close()},[e]),m.useEffect(()=>{u.current?.scrollIntoView({behavior:"smooth"})},[n]);const l=Gr(o);return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:i.jsxs("div",{className:"w-full max-w-3xl rounded-xl border border-border bg-background shadow-xl",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[i.jsxs("h2",{className:"text-sm font-semibold",children:["Run Log - ",e.slice(0,8),"..."]}),i.jsx(ge,{variant:"ghost",size:"icon",onClick:t,children:i.jsx(ms,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-2 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2",children:[i.jsx($e,{className:ae("text-xs",l.badge),children:l.label}),o==="running"&&i.jsx(rt,{className:"h-3 w-3 animate-spin text-muted-foreground"}),a&&i.jsxs("span",{className:"ml-auto text-xs text-muted-foreground",children:[a.files_done,"/",a.total_files," files - ",cr(a.bytes_done??0)]})]}),i.jsxs("div",{className:"overflow-auto rounded-lg border border-border bg-zinc-950 px-4 py-3",style:{maxHeight:400},children:[i.jsx("pre",{className:"text-xs font-mono leading-relaxed",children:n.length===0?i.jsx("span",{className:"text-muted-foreground",children:"Waiting for output..."}):n.map((f,d)=>i.jsx("div",{className:ae("text-zinc-400",Qs(f)==="error"&&"text-red-400",Qs(f)==="success"&&"text-emerald-400",Qs(f)==="info"&&"text-blue-400"),children:f},d))}),i.jsx("div",{ref:u})]})]})]})})}function WS({run:e,jobId:t,onViewLogs:n}){const r=Gr(e.status),o=e.started_at??e.startedAt,s=e.finished_at??e.finishedAt,a=e.data_added_bytes??e.dataAddedBytes??0,c=e.snapshot_id??e.snapshotId,[u,l]=m.useState(!1),[f,d]=m.useState(!1),p=()=>{c&&(navigator.clipboard.writeText(c),l(!0),setTimeout(()=>l(!1),2e3))},h=async()=>{d(!0);try{const g=localStorage.getItem("access_token"),y=window.MEYI_API_BASE||"/api/v1/backup",b={"Content-Type":"application/json"};g&&(b.Authorization=`Bearer ${g}`);const v=await fetch(`${y}/jobs/${t}/restore-script-meta`,{headers:b});if(!v.ok)throw new Error("Failed to fetch job credentials");const w=await v.json(),S=US(w,c),_=new Blob([S],{type:"text/x-shellscript"}),N=URL.createObjectURL(_),$=document.createElement("a");$.href=N,$.download=`restore-${(w.jobName||"job").replace(/[^a-z0-9]/gi,"-").toLowerCase()}-${(c||"latest").slice(0,8)}.sh`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(N),Ne.success("Restore script downloaded")}catch(g){Ne.error(g.message||"Failed to generate script")}finally{d(!1)}};return i.jsxs("div",{className:"flex items-center gap-4 border-b border-border/50 px-4 py-3 transition-colors last:border-0 hover:bg-muted/40",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"text-xs font-mono text-foreground truncate",children:[e.id,"..."]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:li(o)})]}),i.jsx($e,{className:ae("shrink-0 text-xs",r.badge),children:r.label}),i.jsx("div",{className:"shrink-0 text-xs text-muted-foreground",children:ui(o,s)}),a>0&&i.jsxs("div",{className:"shrink-0 text-xs text-muted-foreground",children:["+",cr(a)]}),c&&i.jsx("div",{className:"flex items-center gap-1 shrink-0",children:i.jsxs($e,{variant:"secondary",className:"text-xs font-mono",children:[c.slice(0,8),"..",i.jsx(ge,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:p,title:"Copy Snapshot ID",children:u?i.jsx(fu,{className:"h-2 w-2"}):i.jsx(gh,{className:"h-2 w-2"})})]})}),c&&i.jsx(ge,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",onClick:h,disabled:f,title:"Download restore script for this snapshot",children:f?i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(vh,{className:"h-3.5 w-3.5"})}),i.jsx(ge,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>n(e.id),title:"View logs",children:i.jsx(Yh,{className:"h-4 w-4"})})]})}function Li({id:e}){const t=co(),n=e||t.id,r=Re.useQueryClient(),[o,s]=m.useState(null),a=oc(),{data:c,isLoading:u}=Re.useQuery({queryKey:["job",n],queryFn:()=>He.get(n),enabled:!!n&&n!=="new"}),{data:l=[],isLoading:f}=Re.useQuery({queryKey:["runs",n],queryFn:()=>He.getRuns(n),refetchInterval:5e3,enabled:!!n&&n!=="new"}),d=async()=>{try{await He.run(n),Ne.success("Job triggered"),setTimeout(()=>r.invalidateQueries({queryKey:["runs",n]}),800)}catch{Ne.error("Failed to trigger job")}},p=async()=>{try{await He.delete(n),Ne.success("Job deleted"),a({to:"/jobs"})}catch{Ne.error("Failed to delete job")}};if(u)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!c)return i.jsx("div",{className:"p-6 text-muted-foreground",children:"Job not found"});const h=l[0];return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{to:"/jobs",className:"mb-1 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:i.jsx(Ga,{className:"h-5 w-5"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:c.name}),i.jsxs("div",{className:"flex items-center gap-2",children:[c.schedule&&i.jsx($e,{variant:"outline",className:"text-xs font-mono",children:c.schedule}),c.backupScope==="full"||c.backup_scope==="full"?i.jsxs($e,{variant:"outline",className:"text-xs gap-1",children:[i.jsx(Rh,{className:"h-3 w-3"})," Full Backup"]}):i.jsxs($e,{variant:"outline",className:"text-xs gap-1",children:[i.jsx(Ka,{className:"h-3 w-3"})," Specific Paths (",(c.backupIncludePaths||c.backup_include_paths||[]).length,")"]}),!c.enabled&&i.jsx($e,{variant:"outline",className:"text-xs",children:"Disabled"})]})]}),i.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[i.jsxs("a",{href:`/resources/${c.source_id??c.sourceId}`,className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[i.jsx("span",{className:"flex items-center bg-muted rounded-md p-1",children:i.jsx(jt,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-sm font-semibold",children:c.source_name??c.sourceName})]}),i.jsxs(Pe,{to:"/jobs/$id/snapshots",params:{id:n},className:"flex items-center gap-2",children:[i.jsx("span",{className:"flex items-center bg-muted rounded-md p-1",children:i.jsx(fs,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-sm font-semibold",children:c.target_name??c.targetName})]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(ge,{variant:"default",onClick:d,children:[i.jsx(Ja,{className:"h-4 w-4"})," Run "]}),i.jsx(ge,{variant:"outline",asChild:!0,children:i.jsxs(Pe,{to:"/jobs/$id/edit",params:{id:n},children:[i.jsx(Lr,{className:"h-4 w-4"})," Edit"]})}),i.jsxs(Qr,{children:[i.jsx(mS,{asChild:!0,children:i.jsxs(ge,{variant:"destructive",children:[i.jsx(Vr,{className:"h-4 w-4"})," Delete"]})}),i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Are you absolutely sure?"}),i.jsxs(oo,{children:["This action cannot be undone. This will permanently delete the backup job",i.jsxs("span",{className:"font-semibold text-foreground",children:[' "',c.name,'"']})," and its schedule. Remote snapshots will remain safe in storage."]})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{onClick:p,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Job"})]})]})]})]})]}),h&&i.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Last Status",value:Gr(h.status).label},{label:"Last Run",value:ci(h.started_at??h.startedAt)},{label:"Duration",value:ui(h.started_at??h.startedAt,h.finished_at??h.finishedAt)},{label:"Data Added",value:cr(h.data_added_bytes??h.dataAddedBytes)}].map(({label:g,value:y})=>i.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 shadow-sm",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:g}),i.jsx("div",{className:"mt-1 text-sm font-semibold",children:y})]},g))}),i.jsxs("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[i.jsx("span",{className:"text-sm font-semibold",children:"Run History"}),i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r.invalidateQueries({queryKey:["runs",n]}),children:i.jsx(Xa,{className:"h-4 w-4"})})]}),f&&i.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:i.jsx(rt,{className:"mx-auto h-5 w-5 animate-spin"})}),!f&&l.length===0&&i.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:'No runs yet. Click "Run Now" to start.'}),l.map(g=>i.jsx(WS,{run:g,jobId:n,onViewLogs:s},g.id))]}),o&&i.jsx(qS,{runId:o,onClose:()=>s(null)})]})}const nr={getAll:()=>fe.get("/connectors"),get:e=>fe.get(`/connectors/${e}`),create:e=>fe.post("/connectors",e),update:(e,t)=>fe.put(`/connectors/${e}`,t),delete:e=>fe.delete(`/connectors/${e}`),initRepo:e=>fe.post(`/connectors/${e}/init`)},wm={getAll:()=>fe.get("/sources"),get:e=>fe.get(`/sources/${e}`),create:e=>fe.post("/sources",e),update:(e,t)=>fe.put(`/sources/${e}`,t),delete:e=>fe.delete(`/sources/${e}`)},_m={getPlatformResources:async()=>{try{const e=localStorage.getItem("access_token"),t={"Content-Type":"application/json"};e&&(t.Authorization=`Bearer ${e}`);const n=await fetch("/api/v1/resources",{headers:t});if(!n.ok)return[];const r=await n.json();return Array.isArray(r)?r:r?.data||[]}catch{return[]}},getAll:async()=>{const[e,t]=await Promise.all([_m.getPlatformResources(),wm.getAll().catch(()=>[])]),n=e.map(a=>({...a,origin:"platform",source_id:a.id})),r=new Set(e.map(a=>a.id)),s=t.filter(a=>{if(r.has(a.id))return!1;const c=a.config&&Object.keys(a.config).length>0,u=a.credentials&&a.credentials!=="{}";return!(!c&&!u)}).map(a=>({...a,origin:"local",source_id:a.id}));return[...n,...s]}};function kt({className:e,type:t,...n}){return i.jsx("input",{type:t,"data-slot":"input",className:ae("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"," focus-visible:ring-ring/50 focus-visible:ring-[1px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var HS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZS=HS.reduce((e,t)=>{const n=gd(`Primitive.${t}`),r=m.forwardRef((o,s)=>{const{asChild:a,...c}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),GS="Label",Sm=m.forwardRef((e,t)=>i.jsx(ZS.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Sm.displayName=GS;var YS=Sm;function Yt({className:e,...t}){return i.jsx(YS,{"data-slot":"label",className:ae("flex items-center gap-2 text-sm mb-2 leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function KS({...e}){return i.jsx(nm,{"data-slot":"dialog",...e})}function JS({...e}){return i.jsx(rm,{"data-slot":"dialog-portal",...e})}function XS({className:e,...t}){return i.jsx(om,{"data-slot":"dialog-overlay",className:ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function QS({className:e,children:t,showCloseButton:n=!0,...r}){return i.jsxs(JS,{"data-slot":"dialog-portal",children:[i.jsx(XS,{}),i.jsxs(sm,{"data-slot":"dialog-content",className:ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&i.jsxs(Fi,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(ms,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function eE({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:ae("flex flex-col gap-2 text-center sm:text-start",e),...t})}function tE({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function nE({className:e,...t}){return i.jsx(am,{"data-slot":"dialog-title",className:ae("text-lg leading-none font-semibold",e),...t})}function rE({className:e,...t}){return i.jsx(im,{"data-slot":"dialog-description",className:ae("text-muted-foreground text-sm",e),...t})}const jr={s3:{label:"Amazon S3 / Compatible",icon:Wo,fields:[{key:"endpoint",label:"Endpoint",placeholder:"s3.amazonaws.com (leave blank for AWS)",required:!1},{key:"bucket",label:"Bucket Name",placeholder:"my-backup-bucket",required:!0},{key:"region",label:"Region",placeholder:"us-east-1",required:!1},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"access_key_id",label:"Access Key ID",placeholder:"AKIA...",required:!0,secret:!0},{key:"secret_access_key",label:"Secret Access Key",placeholder:"••••••••",required:!0,secret:!0,password:!0}]},gcs:{label:"Google Cloud Storage",icon:cd,fields:[{key:"bucket",label:"Bucket Name",placeholder:"my-gcs-bucket",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"project_id",label:"Project ID",placeholder:"my-gcp-project",required:!0},{key:"credentials_json",label:"Service Account JSON",placeholder:'{"type":"service_account",...}',required:!0,password:!0,multiline:!0}]},azure:{label:"Azure Blob Storage",icon:ld,fields:[{key:"container",label:"Container Name",placeholder:"my-backups",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"account_name",label:"Storage Account Name",placeholder:"mystorageaccount",required:!0},{key:"account_key",label:"Account Key",placeholder:"••••••••",required:!0,password:!0}]},b2:{label:"Backblaze B2",icon:ud,fields:[{key:"bucket",label:"Bucket Name",placeholder:"my-b2-bucket",required:!0},{key:"prefix",label:"Path Prefix",placeholder:"backups/",required:!1},{key:"account_id",label:"Account ID",placeholder:"...",required:!0},{key:"account_key",label:"Application Key",placeholder:"••••••••",required:!0,password:!0}]},sftp:{label:"SFTP Server",icon:dd,fields:[{key:"host",label:"Host",placeholder:"backup.example.com",required:!0},{key:"port",label:"Port",placeholder:"22",required:!1},{key:"user",label:"Username",placeholder:"admin",required:!0},{key:"path",label:"Remote Path",placeholder:"/backups",required:!0},{key:"password",label:"Password",placeholder:"••••••••",required:!1,password:!0}]},local:{label:"Local Filesystem",icon:fs,fields:[{key:"path",label:"Directory Path",placeholder:"/mnt/backups or D:\\Backups",required:!0}]}};function oE({editing:e,onClose:t}){const n=Re.useQueryClient(),r=!!e,[o,s]=m.useState(e?.type??"s3"),[a,c]=m.useState(e?.name??""),[u,l]=m.useState(e?.config??{}),f=jr[o];m.useEffect(()=>{r||l({})},[o,r]);const d=Re.useMutation({mutationFn:async()=>{const h={name:a,type:o,config:u};return r?nr.update(e.id,h):nr.create(h)},onSuccess:()=>{n.invalidateQueries({queryKey:["connectors"]}),Ne.success(r?"Connector updated":"Connector added"),t()},onError:h=>Ne.error(h?.error||"Failed to save connector")});function p(h){h.preventDefault(),d.mutate()}return i.jsx(KS,{open:!0,onOpenChange:h=>!h&&t(),children:i.jsxs(QS,{className:"max-w-[480px] w-[95vw] p-0 overflow-hidden rounded-2xl border-border/75",children:[i.jsxs(eE,{className:"px-6 pt-6 pb-2 text-left",children:[i.jsx(nE,{className:"text-xl font-bold",children:r?"Edit Connector":"Add Storage Connector"}),i.jsx(rE,{className:"text-sm",children:"Configure storage credentials for backup targets. Connectors define where your data is stored."})]}),i.jsxs("form",{onSubmit:p,className:"",children:[i.jsxs("div",{className:"px-6 space-y-5 max-h-[60vh] overflow-y-auto py-2",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Yt,{htmlFor:"conn-name",className:"text-sm font-semibold",children:"Display Name"}),i.jsx(kt,{id:"conn-name",value:a,onChange:h=>c(h.target.value),placeholder:"e.g. Production S3 Bucket",className:"h-10 bg-muted/5 shadow-none",required:!0})]}),!r&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Yt,{className:"text-sm font-semibold",children:"Storage Provider"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:Object.keys(jr).map(h=>{const g=jr[h],y=g.icon,b=o===h;return i.jsxs("button",{type:"button",onClick:()=>s(h),className:ae("flex flex-col items-center gap-2 rounded-xl border p-3 text-[11px] transition-all relative overflow-hidden",b?"border-primary bg-primary/5 text-primary font-bold ring-1 ring-primary":"border-border bg-card hover:bg-muted/50 text-muted-foreground"),children:[i.jsx(y,{className:ae("h-5 w-5",b?"text-primary":"text-muted-foreground/60")}),i.jsx("span",{className:"truncate w-full text-center",children:g.label.split(" ")[0]})]},h)})})]})]}),i.jsx("div",{className:"space-y-4 pt-2",children:i.jsx("div",{className:"grid gap-4",children:f.fields.map(h=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Yt,{htmlFor:`cf-${h.key}`,className:"text-sm font-semibold flex items-center gap-1.5",children:[h.label,h.required&&i.jsx("span",{className:"text-destructive font-bold",children:"*"}),h.secret&&i.jsx(Dh,{className:"h-3 w-3 text-muted-foreground/50"})]}),h.multiline?i.jsx("textarea",{id:`cf-${h.key}`,value:u[h.key]??"",onChange:g=>l(y=>({...y,[h.key]:g.target.value})),placeholder:h.placeholder,rows:3,className:"w-full rounded-lg border border-input bg-muted/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none font-mono",required:h.required}):i.jsx(kt,{id:`cf-${h.key}`,type:h.password?"password":"text",value:u[h.key]??"",onChange:g=>l(y=>({...y,[h.key]:g.target.value})),placeholder:h.placeholder,className:"h-10 bg-muted/5 shadow-none",required:h.required})]},h.key))})})]}),i.jsxs(tE,{className:"px-3 py-2 border-t border-border/40",children:[i.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsxs(ge,{type:"submit",variant:"default",size:"sm",disabled:d.isPending,children:[d.isPending&&i.jsx(rt,{className:"h-4 w-4 mr-2 animate-spin"}),r?"Save":"Add Connector"]})]})]})]})})}function sE({connector:e,onEdit:t,onDelete:n,onInit:r}){const o=e.type??"local",s=jr[o]??jr.local,a=s.icon;return i.jsx(At,{className:"transition-all hover:border-muted-foreground/40 hover:shadow-md py-0",children:i.jsxs(Tt,{className:"p-3.5 space-y-3.5",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[i.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border bg-muted/30 text-foreground",children:i.jsx(a,{className:"h-4.5 w-4.5"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h3",{className:"truncate text-sm font-semibold",children:e.name}),i.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-tight mt-0.5",children:s.label})]})]}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,children:i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:i.jsx(Ya,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsxs(ar,{onClick:t,children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:n,children:[i.jsx(Vr,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs($e,{variant:"outline",className:"font-mono text-[10px] gap-1 text-muted-foreground py-0.5",children:[i.jsx(_h,{className:"h-3 w-3"}),i.jsxs("span",{className:"truncate max-w-[150px]",children:[e.config?.bucket||e.config?.path||"No path",e.config?.prefix&&e.config.prefix!=="/"?`/${e.config.prefix}`:""]})]}),e.config?.region&&i.jsxs($e,{variant:"outline",className:"font-mono text-[10px] gap-1 text-muted-foreground py-0.5",children:[i.jsx(ds,{className:"h-3 w-3"}),e.config.region]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground border-t border-border/40 pt-3",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[9px] uppercase tracking-wide",children:"Provider"}),i.jsx("div",{className:"mt-0.5 text-foreground font-medium uppercase text-[10px]",children:o})]}),i.jsx("div",{children:i.jsxs(ge,{variant:"outline",size:"sm",className:"h-7 px-2.5 gap-1.5",onClick:r,title:"Initialize Repository",children:[i.jsx(Xa,{className:"h-3 w-3"}),i.jsx("span",{className:"text-[11px]",children:"Init Repo"})]})})]})]})})}function Em(){const e=Re.useQueryClient(),[t,n]=m.useState(!1),[r,o]=m.useState(null),[s,a]=m.useState(null),{data:c,isLoading:u}=Re.useQuery({queryKey:["connectors"],queryFn:nr.getAll}),l=Array.isArray(c)?c:[],f=Re.useMutation({mutationFn:g=>nr.delete(g),onSuccess:()=>{e.invalidateQueries({queryKey:["connectors"]}),Ne.success("Connector deleted"),a(null)},onError:()=>Ne.error("Failed to delete connector")}),d=Re.useMutation({mutationFn:g=>nr.initRepo(g),onSuccess:g=>{Ne.success(g.data?.message||"Repository initialized successfully")},onError:g=>{Ne.error(g?.response?.data?.error||g?.error||"Failed to initialize repository")}});function p(){o(null),n(!0)}function h(g){o(g),n(!0)}return i.jsxs("div",{className:"w-full space-y-8 animate-in fade-in duration-500",children:[i.jsx("div",{className:"flex items-start justify-between",children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Backend Settings"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure storage destinations and global backup preferences"})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 pb-3",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Storage Connectors"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Physical storage locations for your encrypted snapshots"})]}),i.jsxs(ge,{onClick:p,size:"sm",className:"gap-2 h-8 shadow-sm",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Storage"]})]}),u?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(g=>i.jsx(At,{className:"h-40 animate-pulse bg-muted/10 border-border/50"},g))}):l.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-16 text-center rounded-2xl border border-dashed border-muted-foreground/20 bg-muted/5",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-background border border-border shadow-sm",children:i.jsx(Er,{className:"h-7 w-7 text-muted-foreground/60"})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("h3",{className:"font-bold text-base",children:"No storage configured"}),i.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"You need a storage destination like S3, B2, or Local folder to store backups."})]}),i.jsx(ge,{onClick:p,variant:"outline",size:"sm",className:"mt-2",children:"Add Your First Connector"})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4 gap-4",children:l.map(g=>i.jsx(sE,{connector:g,onEdit:()=>h(g),onDelete:()=>a(g),onInit:()=>d.mutate(g.id)},g.id))})]}),t&&i.jsx(oE,{editing:r,onClose:()=>n(!1)}),i.jsx(Qr,{open:!!s,onOpenChange:g=>{g||a(null)},children:i.jsxs(eo,{className:"max-w-md rounded-xl",children:[i.jsxs(to,{children:[i.jsx(ro,{className:"text-xl",children:"Delete Storage Connector"}),i.jsxs(oo,{className:"text-sm pt-2",children:["Are you sure you want to delete ",i.jsxs("span",{className:"font-bold text-foreground",children:['"',s?.name,'"']}),"? Existing backup jobs using this storage will fail until updated."]})]}),i.jsxs(no,{className:"pt-4 gap-2",children:[i.jsx(ao,{className:"h-9",children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 h-9 px-6",onClick:()=>s&&f.mutate(s.id),children:"Delete"})]})]})})]})}function M(e,t,n){function r(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);const l=a.prototype,f=Object.keys(l);for(let d=0;d<f.length;d++){const p=f[d];p in c||(c[p]=l[p].bind(c))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(c){var u;const l=n?.Parent?new s:this;r(l,c),(u=l._zod).deferred??(u.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class rr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class km extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Nm={};function Mn(e){return Nm}function Cm(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ca(e,t){return typeof t=="bigint"?t.toString():t}function Vi(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bi(e){return e==null}function Ui(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function aE(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u?.[1]&&(o=Number.parseInt(u[1]))}const s=n>o?n:o,a=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return a%c/10**s}const wl=Symbol("evaluating");function Ee(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==wl)return r===void 0&&(r=wl,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Un(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function _l(e){return JSON.stringify(e)}function iE(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function es(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const cE=Vi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ir(e){if(es(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(es(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Rm(e){return Ir(e)?{...e}:Array.isArray(e)?[...e]:e}const lE=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function uE(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const dE={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fE(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=vn(e._zod.def,{get shape(){const a={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return Un(this,"shape",a),a},checks:[]});return xn(e,s)}function mE(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=vn(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return Un(this,"shape",a),a},checks:[]});return xn(e,s)}function pE(e,t){if(!Ir(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=vn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Un(this,"shape",s),s}});return xn(e,o)}function hE(e,t){if(!Ir(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=vn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Un(this,"shape",r),r}});return xn(e,n)}function gE(e,t){const n=vn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Un(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return xn(e,n)}function yE(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=vn(t._zod.def,{get shape(){const c=t._zod.def.shape,u={...c};if(n)for(const l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(const l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Un(this,"shape",u),u},checks:[]});return xn(t,a)}function bE(e,t,n){const r=vn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const a in n){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return Un(this,"shape",s),s}});return xn(t,r)}function Jn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Am(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jo(e){return typeof e=="string"?e:e?.message}function In(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=jo(e.inst?._zod.def?.error?.(e))??jo(t?.error?.(e))??jo(n.customError?.(e))??jo(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function qi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Tm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ca,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wi=M("$ZodError",Tm),$s=M("$ZodError",Tm,{Parent:Error});function vE(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function xE(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let a=n,c=0;for(;c<s.path.length;){const u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return r(e),n}const Ms=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new rr;if(a.issues.length){const c=new(o?.Err??e)(a.issues.map(u=>In(u,s,Mn())));throw jm(c,o?.callee),c}return a.value},wE=Ms($s),Is=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(o?.Err??e)(a.issues.map(u=>In(u,s,Mn())));throw jm(c,o?.callee),c}return a.value},_E=Is($s),Fs=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new rr;return s.issues.length?{success:!1,error:new(e??Wi)(s.issues.map(a=>In(a,o,Mn())))}:{success:!0,data:s.value}},SE=Fs($s),zs=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>In(a,o,Mn())))}:{success:!0,data:s.value}},EE=zs($s),kE=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ms(e)(t,n,o)},NE=e=>(t,n,r)=>Ms(e)(t,n,r),CE=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Is(e)(t,n,o)},jE=e=>async(t,n,r)=>Is(e)(t,n,r),RE=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fs(e)(t,n,o)},AE=e=>(t,n,r)=>Fs(e)(t,n,r),TE=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zs(e)(t,n,o)},OE=e=>async(t,n,r)=>zs(e)(t,n,r),PE=/^[cC][^\s-]{8,}$/,DE=/^[0-9a-z]+$/,$E=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ME=/^[0-9a-vA-V]{20}$/,IE=/^[A-Za-z0-9]{27}$/,FE=/^[a-zA-Z0-9_-]{21}$/,zE=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,LE=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VE=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UE(){return new RegExp(BE,"u")}const qE=/^(?:(?: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])$/,WE=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,HE=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,ZE=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GE=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Om=/^[A-Za-z0-9_-]*$/,YE=/^\+[1-9]\d{6,14}$/,Pm="(?:(?:\\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])))",KE=new RegExp(`^${Pm}$`);function Dm(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function JE(e){return new RegExp(`^${Dm(e)}$`)}function XE(e){const t=Dm({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Pm}T(?:${r})$`)}const QE=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ek=/^-?\d+$/,tk=/^-?\d+(?:\.\d+)?$/,nk=/^(?:true|false)$/i,rk=/^[^A-Z]*$/,ok=/^[^a-z]*$/,lt=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$m={number:"number",bigint:"bigint",object:"date"},Mm=M("$ZodCheckLessThan",(e,t)=>{lt.init(e,t);const n=$m[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Im=M("$ZodCheckGreaterThan",(e,t)=>{lt.init(e,t);const n=$m[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sk=M("$ZodCheckMultipleOf",(e,t)=>{lt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):aE(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ak=M("$ZodCheckNumberFormat",(e,t)=>{lt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=dE[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,n&&(c.pattern=ek)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),ik=M("$ZodCheckMaxLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=qi(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ck=M("$ZodCheckMinLength",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=qi(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lk=M("$ZodCheckLengthEquals",(e,t)=>{var n;lt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bi(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const a=qi(o),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ls=M("$ZodCheckStringFormat",(e,t)=>{var n,r;lt.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uk=M("$ZodCheckRegex",(e,t)=>{Ls.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dk=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rk),Ls.init(e,t)}),fk=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ok),Ls.init(e,t)}),mk=M("$ZodCheckIncludes",(e,t)=>{lt.init(e,t);const n=Ds(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pk=M("$ZodCheckStartsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`^${Ds(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),hk=M("$ZodCheckEndsWith",(e,t)=>{lt.init(e,t);const n=new RegExp(`.*${Ds(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gk=M("$ZodCheckOverwrite",(e,t)=>{lt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yk{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
69
692
|
`).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
|
|
70
|
-
`))}}const
|
|
693
|
+
`))}}const bk={major:4,minor:3,patch:6},Ie=M("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bk;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,c,u)=>{let l=Jn(a),f;for(const d of c){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(l)continue;const p=a.issues.length,h=d._zod.check(a);if(h instanceof Promise&&u?.async===!1)throw new rr;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==p&&(l||(l=Jn(a,p)))});else{if(a.issues.length===p)continue;l||(l=Jn(a,p))}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(Jn(a))return a.aborted=!0,a;const l=o(c,r,u);if(l instanceof Promise){if(u.async===!1)throw new rr;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}const u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new rr;return u.then(l=>o(l,r,c))}return o(u,r,c)}}Ee(e,"~standard",()=>({validate:o=>{try{const s=SE(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return EE(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Hi=M("$ZodString",(e,t)=>{Ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??QE(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ae=M("$ZodStringFormat",(e,t)=>{Ls.init(e,t),Hi.init(e,t)}),vk=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=LE),Ae.init(e,t)}),xk=M("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Sl(r))}else t.pattern??(t.pattern=Sl());Ae.init(e,t)}),wk=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=VE),Ae.init(e,t)}),_k=M("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Sk=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=UE()),Ae.init(e,t)}),Ek=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=FE),Ae.init(e,t)}),kk=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=PE),Ae.init(e,t)}),Nk=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=DE),Ae.init(e,t)}),Ck=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=$E),Ae.init(e,t)}),jk=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ME),Ae.init(e,t)}),Rk=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=IE),Ae.init(e,t)}),Ak=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=XE(t)),Ae.init(e,t)}),Tk=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=KE),Ae.init(e,t)}),Ok=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=JE(t)),Ae.init(e,t)}),Pk=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=zE),Ae.init(e,t)}),Dk=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qE),Ae.init(e,t),e._zod.bag.format="ipv4"}),$k=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=WE),Ae.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Mk=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=HE),Ae.init(e,t)}),Ik=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ZE),Ae.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Fm(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Fk=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=GE),Ae.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Fm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function zk(e){if(!Om.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fm(n)}const Lk=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Om),Ae.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{zk(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Vk=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=YE),Ae.init(e,t)});function Bk(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Uk=M("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{Bk(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),zm=M("$ZodNumber",(e,t)=>{Ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??tk,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),qk=M("$ZodNumberFormat",(e,t)=>{ak.init(e,t),zm.init(e,t)}),Wk=M("$ZodBoolean",(e,t)=>{Ie.init(e,t),e._zod.pattern=nk,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Hk=M("$ZodUnknown",(e,t)=>{Ie.init(e,t),e._zod.parse=n=>n}),Zk=M("$ZodNever",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function El(e,t,n){e.issues.length&&t.issues.push(...Am(n,e.issues)),t.value[n]=e.value}const Gk=M("$ZodArray",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const c=o[a],u=t.element._zod.run({value:c,issues:[]},r);u instanceof Promise?s.push(u.then(l=>El(l,n,a))):El(u,n,a)}return s.length?Promise.all(s).then(()=>n):n}});function ts(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Am(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Lm(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=uE(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Vm(e,t,n,r,o,s){const a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optout==="optional";for(const d in t){if(c.has(d))continue;if(l==="never"){a.push(d);continue}const p=u.run({value:t[d],issues:[]},r);p instanceof Promise?e.push(p.then(h=>ts(h,n,d,t,f))):ts(p,n,d,t,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Yk=M("$ZodObject",(e,t)=>{if(Ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=Vi(()=>Lm(t));Ee(e._zod,"propValues",()=>{const c=t.shape,u={};for(const l in c){const f=c[l]._zod;if(f.values){u[l]??(u[l]=new Set);for(const d of f.values)u[l].add(d)}}return u});const o=es,s=t.catchall;let a;e._zod.parse=(c,u)=>{a??(a=r.value);const l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};const f=[],d=a.shape;for(const p of a.keys){const h=d[p],g=h._zod.optout==="optional",y=h._zod.run({value:l[p],issues:[]},u);y instanceof Promise?f.push(y.then(b=>ts(b,c,p,l,g))):ts(y,c,p,l,g)}return s?Vm(f,l,c,u,r.value,e):f.length?Promise.all(f).then(()=>c):c}}),Kk=M("$ZodObjectJIT",(e,t)=>{Yk.init(e,t);const n=e._zod.parse,r=Vi(()=>Lm(t)),o=p=>{const h=new yk(["shape","payload","ctx"]),g=r.value,y=S=>{const _=_l(S);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};h.write("const input = payload.value;");const b=Object.create(null);let v=0;for(const S of g.keys)b[S]=`key_${v++}`;h.write("const newResult = {};");for(const S of g.keys){const _=b[S],N=_l(S),O=p[S]?._zod?.optout==="optional";h.write(`const ${_} = ${y(S)};`),O?h.write(`
|
|
71
694
|
if (${_}.issues.length) {
|
|
72
|
-
if (${
|
|
695
|
+
if (${N} in input) {
|
|
73
696
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
74
697
|
...iss,
|
|
75
|
-
path: iss.path ? [${
|
|
698
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
76
699
|
})));
|
|
77
700
|
}
|
|
78
701
|
}
|
|
79
702
|
|
|
80
703
|
if (${_}.value === undefined) {
|
|
81
|
-
if (${
|
|
82
|
-
newResult[${
|
|
704
|
+
if (${N} in input) {
|
|
705
|
+
newResult[${N}] = undefined;
|
|
83
706
|
}
|
|
84
707
|
} else {
|
|
85
|
-
newResult[${
|
|
708
|
+
newResult[${N}] = ${_}.value;
|
|
86
709
|
}
|
|
87
710
|
|
|
88
|
-
`):
|
|
711
|
+
`):h.write(`
|
|
89
712
|
if (${_}.issues.length) {
|
|
90
713
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
91
714
|
...iss,
|
|
92
|
-
path: iss.path ? [${
|
|
715
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
93
716
|
})));
|
|
94
717
|
}
|
|
95
718
|
|
|
96
719
|
if (${_}.value === undefined) {
|
|
97
|
-
if (${
|
|
98
|
-
newResult[${
|
|
720
|
+
if (${N} in input) {
|
|
721
|
+
newResult[${N}] = undefined;
|
|
99
722
|
}
|
|
100
723
|
} else {
|
|
101
|
-
newResult[${
|
|
724
|
+
newResult[${N}] = ${_}.value;
|
|
102
725
|
}
|
|
103
726
|
|
|
104
|
-
`)}p.write("payload.value = newResult;"),p.write("return payload;");const w=p.compile();return(S,_)=>w(h,S,_)};let s;const a=es,c=!Cm.jitless,l=c&&ck.value,f=t.catchall;let d;e._zod.parse=(h,p)=>{d??(d=r.value);const g=h.value;return a(g)?c&&l&&p?.async===!1&&p.jitless!==!0?(s||(s=o(t.shape)),h=s(h,p),f?Bm([],g,h,p,d,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function El(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Jn(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(a=>$n(a,r,Mn())))}),t)}const JE=M("$ZodUnion",(e,t)=>{$e.init(e,t),ke(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ke(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ke(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ke(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ui(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let a=!1;const c=[];for(const u of t.options){const l=u._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)c.push(l),a=!0;else{if(l.issues.length===0)return l;c.push(l)}}return a?Promise.all(c).then(u=>El(u,o,e,s)):El(c,o,e,s)}}),XE=M("$ZodIntersection",(e,t)=>{$e.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,l])=>Cl(n,u,l)):Cl(n,s,a)}});function ja(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($r(e)&&$r(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const a=ja(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],a=ja(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Cl(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const u of c.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Jn(e))return e;const a=ja(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const QE=M("$ZodEnum",(e,t)=>{$e.init(e,t);const n=Nm(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>lk.has(typeof o)).map(o=>typeof o=="string"?Ds(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),eC=M("$ZodTransform",(e,t)=>{$e.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Em(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new rr;return n.value=o,n}});function Nl(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Vm=M("$ZodOptional",(e,t)=>{$e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ke(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ui(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Nl(s,n.value)):Nl(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),tC=M("$ZodExactOptional",(e,t)=>{Vm.init(e,t),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),nC=M("$ZodNullable",(e,t)=>{$e.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ui(n.source)}|null)$`):void 0}),ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),rC=M("$ZodDefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>jl(s,t)):jl(o,t)}});function jl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const oC=M("$ZodPrefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),sC=M("$ZodNonOptional",(e,t)=>{$e.init(e,t),ke(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Rl(s,e)):Rl(o,e)}});function Rl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const aC=M("$ZodCatch",(e,t)=>{$e.init(e,t),ke(e._zod,"optin",()=>t.innerType._zod.optin),ke(e._zod,"optout",()=>t.innerType._zod.optout),ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(a=>$n(a,r,Mn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>$n(s,r,Mn()))},input:n.value}),n.issues=[]),n)}}),iC=M("$ZodPipe",(e,t)=>{$e.init(e,t),ke(e._zod,"values",()=>t.in._zod.values),ke(e._zod,"optin",()=>t.in._zod.optin),ke(e._zod,"optout",()=>t.out._zod.optout),ke(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(a=>Ro(a,t.in,r)):Ro(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Ro(s,t.out,r)):Ro(o,t.out,r)}});function Ro(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const cC=M("$ZodReadonly",(e,t)=>{$e.init(e,t),ke(e._zod,"propValues",()=>t.innerType._zod.propValues),ke(e._zod,"values",()=>t.innerType._zod.values),ke(e._zod,"optin",()=>t.innerType?._zod?.optin),ke(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Al):Al(o)}});function Al(e){return e.value=Object.freeze(e.value),e}const lC=M("$ZodCustom",(e,t)=>{lt.init(e,t),$e.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Tl(s,n,r,e));Tl(o,n,r,e)}});function Tl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Fr(o))}}var Ol;class uC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dC(){return new uC}(Ol=globalThis).__zod_globalRegistry??(Ol.__zod_globalRegistry=dC());const Cr=globalThis.__zod_globalRegistry;function fC(e,t){return new e({type:"string",...ie(t)})}function mC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function Pl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function pC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function hC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function gC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function yC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function bC(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function vC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function xC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function wC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function _C(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function SC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function kC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function EC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function CC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function NC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function jC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function RC(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function AC(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function TC(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function OC(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function PC(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function DC(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function IC(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function MC(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function $C(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function FC(e,t){return new e({type:"number",checks:[],...ie(t)})}function zC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function LC(e,t){return new e({type:"boolean",...ie(t)})}function BC(e){return new e({type:"unknown"})}function VC(e,t){return new e({type:"never",...ie(t)})}function Dl(e,t){return new Mm({check:"less_than",...ie(t),value:e,inclusive:!1})}function da(e,t){return new Mm({check:"less_than",...ie(t),value:e,inclusive:!0})}function Il(e,t){return new $m({check:"greater_than",...ie(t),value:e,inclusive:!1})}function fa(e,t){return new $m({check:"greater_than",...ie(t),value:e,inclusive:!0})}function Ml(e,t){return new sE({check:"multiple_of",...ie(t),value:e})}function Um(e,t){return new iE({check:"max_length",...ie(t),maximum:e})}function ns(e,t){return new cE({check:"min_length",...ie(t),minimum:e})}function Wm(e,t){return new lE({check:"length_equals",...ie(t),length:e})}function UC(e,t){return new uE({check:"string_format",format:"regex",...ie(t),pattern:e})}function WC(e){return new dE({check:"string_format",format:"lowercase",...ie(e)})}function HC(e){return new fE({check:"string_format",format:"uppercase",...ie(e)})}function ZC(e,t){return new mE({check:"string_format",format:"includes",...ie(t),includes:e})}function qC(e,t){return new pE({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function YC(e,t){return new hE({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function dr(e){return new gE({check:"overwrite",tx:e})}function GC(e){return dr(t=>t.normalize(e))}function KC(){return dr(e=>e.trim())}function JC(){return dr(e=>e.toLowerCase())}function XC(){return dr(e=>e.toUpperCase())}function QC(){return dr(e=>ik(e))}function eN(e,t,n){return new e({type:"array",element:t,...ie(n)})}function tN(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}function nN(e){const t=rN(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Fr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Fr(o))}},e(n.value,n)));return t}function rN(e,t){const n=new lt({check:"custom",...ie(t)});return n._zod.check=e,n}function Hm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Cr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ge(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{const h=a.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,h,f)}const d=e._zod.parent;d&&(a.ref||(a.ref=d),Ge(d,t,f),t.seen.get(d).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&et(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Zm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const c=e.metadataRegistry.get(a[0])?.id;if(c){const u=r.get(c);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,a[0])}}const o=a=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(a[0])?.id,h=e.external.uri??(g=>g);if(d)return{ref:h(d)};const p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${h("__shared")}#/${c}/${p}`}}if(a[1]===n)return{ref:"#"};const l=`#/${c}/`,f=a[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+f}},s=a=>{if(a[1].schema.$ref)return;const c=a[1],{ref:u,defId:l}=o(a);c.def={...c.schema},l&&(c.defId=l);const f=c.schema;for(const d in f)delete f[d];f.$ref=u};if(e.cycles==="throw")for(const a of e.seen.entries()){const c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
727
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const w=h.compile();return(S,_)=>w(p,S,_)};let s;const a=es,c=!Nm.jitless,l=c&&cE.value,f=t.catchall;let d;e._zod.parse=(p,h)=>{d??(d=r.value);const g=p.value;return a(g)?c&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),p=s(p,h),f?Vm([],g,p,h,d,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function kl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Jn(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(a=>In(a,r,Mn())))}),t)}const Jk=M("$ZodUnion",(e,t)=>{Ie.init(e,t),Ee(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ee(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ee(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ee(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ui(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let a=!1;const c=[];for(const u of t.options){const l=u._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)c.push(l),a=!0;else{if(l.issues.length===0)return l;c.push(l)}}return a?Promise.all(c).then(u=>kl(u,o,e,s)):kl(c,o,e,s)}}),Xk=M("$ZodIntersection",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,l])=>Nl(n,u,l)):Nl(n,s,a)}});function ja(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ir(e)&&Ir(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const a=ja(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],a=ja(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Nl(e,t,n){const r=new Map;let o;for(const c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(const u of c.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&e.issues.push({...o,keys:s}),Jn(e))return e;const a=ja(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Qk=M("$ZodEnum",(e,t)=>{Ie.init(e,t);const n=Cm(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>lE.has(typeof o)).map(o=>typeof o=="string"?Ds(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),eN=M("$ZodTransform",(e,t)=>{Ie.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new km(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new rr;return n.value=o,n}});function Cl(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Bm=M("$ZodOptional",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ee(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ui(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Cl(s,n.value)):Cl(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),tN=M("$ZodExactOptional",(e,t)=>{Bm.init(e,t),Ee(e._zod,"values",()=>t.innerType._zod.values),Ee(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),nN=M("$ZodNullable",(e,t)=>{Ie.init(e,t),Ee(e._zod,"optin",()=>t.innerType._zod.optin),Ee(e._zod,"optout",()=>t.innerType._zod.optout),Ee(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ui(n.source)}|null)$`):void 0}),Ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),rN=M("$ZodDefault",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",Ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>jl(s,t)):jl(o,t)}});function jl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const oN=M("$ZodPrefault",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",Ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),sN=M("$ZodNonOptional",(e,t)=>{Ie.init(e,t),Ee(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Rl(s,e)):Rl(o,e)}});function Rl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const aN=M("$ZodCatch",(e,t)=>{Ie.init(e,t),Ee(e._zod,"optin",()=>t.innerType._zod.optin),Ee(e._zod,"optout",()=>t.innerType._zod.optout),Ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(a=>In(a,r,Mn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>In(s,r,Mn()))},input:n.value}),n.issues=[]),n)}}),iN=M("$ZodPipe",(e,t)=>{Ie.init(e,t),Ee(e._zod,"values",()=>t.in._zod.values),Ee(e._zod,"optin",()=>t.in._zod.optin),Ee(e._zod,"optout",()=>t.out._zod.optout),Ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(a=>Ro(a,t.in,r)):Ro(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Ro(s,t.out,r)):Ro(o,t.out,r)}});function Ro(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const cN=M("$ZodReadonly",(e,t)=>{Ie.init(e,t),Ee(e._zod,"propValues",()=>t.innerType._zod.propValues),Ee(e._zod,"values",()=>t.innerType._zod.values),Ee(e._zod,"optin",()=>t.innerType?._zod?.optin),Ee(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Al):Al(o)}});function Al(e){return e.value=Object.freeze(e.value),e}const lN=M("$ZodCustom",(e,t)=>{lt.init(e,t),Ie.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Tl(s,n,r,e));Tl(o,n,r,e)}});function Tl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Fr(o))}}var Ol;class uN{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dN(){return new uN}(Ol=globalThis).__zod_globalRegistry??(Ol.__zod_globalRegistry=dN());const Nr=globalThis.__zod_globalRegistry;function fN(e,t){return new e({type:"string",...ie(t)})}function mN(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function Pl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function pN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function hN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function gN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function yN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function bN(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function vN(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function xN(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function wN(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function _N(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function SN(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function EN(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function kN(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function NN(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function CN(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function jN(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function RN(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function AN(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function TN(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function ON(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function PN(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function DN(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function $N(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function MN(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function IN(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function FN(e,t){return new e({type:"number",checks:[],...ie(t)})}function zN(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function LN(e,t){return new e({type:"boolean",...ie(t)})}function VN(e){return new e({type:"unknown"})}function BN(e,t){return new e({type:"never",...ie(t)})}function Dl(e,t){return new Mm({check:"less_than",...ie(t),value:e,inclusive:!1})}function da(e,t){return new Mm({check:"less_than",...ie(t),value:e,inclusive:!0})}function $l(e,t){return new Im({check:"greater_than",...ie(t),value:e,inclusive:!1})}function fa(e,t){return new Im({check:"greater_than",...ie(t),value:e,inclusive:!0})}function Ml(e,t){return new sk({check:"multiple_of",...ie(t),value:e})}function Um(e,t){return new ik({check:"max_length",...ie(t),maximum:e})}function ns(e,t){return new ck({check:"min_length",...ie(t),minimum:e})}function qm(e,t){return new lk({check:"length_equals",...ie(t),length:e})}function UN(e,t){return new uk({check:"string_format",format:"regex",...ie(t),pattern:e})}function qN(e){return new dk({check:"string_format",format:"lowercase",...ie(e)})}function WN(e){return new fk({check:"string_format",format:"uppercase",...ie(e)})}function HN(e,t){return new mk({check:"string_format",format:"includes",...ie(t),includes:e})}function ZN(e,t){return new pk({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function GN(e,t){return new hk({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function dr(e){return new gk({check:"overwrite",tx:e})}function YN(e){return dr(t=>t.normalize(e))}function KN(){return dr(e=>e.trim())}function JN(){return dr(e=>e.toLowerCase())}function XN(){return dr(e=>e.toUpperCase())}function QN(){return dr(e=>iE(e))}function eC(e,t,n){return new e({type:"array",element:t,...ie(n)})}function tC(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}function nC(e){const t=rC(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Fr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Fr(o))}},e(n.value,n)));return t}function rC(e,t){const n=new lt({check:"custom",...ie(t)});return n._zod.check=e,n}function Wm(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ye(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{const p=a.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,p,f)}const d=e._zod.parent;d&&(a.ref||(a.ref=d),Ye(d,t,f),t.seen.get(d).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&et(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Hm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const c=e.metadataRegistry.get(a[0])?.id;if(c){const u=r.get(c);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,a[0])}}const o=a=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(a[0])?.id,p=e.external.uri??(g=>g);if(d)return{ref:p(d)};const h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${p("__shared")}#/${c}/${h}`}}if(a[1]===n)return{ref:"#"};const l=`#/${c}/`,f=a[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+f}},s=a=>{if(a[1].schema.$ref)return;const c=a[1],{ref:u,defId:l}=o(a);c.def={...c.schema},l&&(c.defId=l);const f=c.schema;for(const d in f)delete f[d];f.$ref=u};if(e.cycles==="throw")for(const a of e.seen.entries()){const c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
105
728
|
|
|
106
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const c=a[1];if(t===a[0]){s(a);continue}if(e.external){const l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1&&e.reused==="ref"){s(a);continue}}}function qm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){r(f);const h=e.seen.get(f),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,l),a._zod.parent===f)for(const y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(p.$ref&&h.def)for(const y in u)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y])&&delete u[y]}const d=a._zod.parent;if(d&&d!==f){r(d);const h=e.seen.get(d);if(h?.schema.$ref&&(u.$ref=h.schema.$ref,h.def))for(const p in u)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(u[p])===JSON.stringify(h.def[p])&&delete u[p]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:rs(t,"input",e.processors),output:rs(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function et(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return et(r.element,n);if(r.type==="set")return et(r.valueType,n);if(r.type==="lazy")return et(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return et(r.innerType,n);if(r.type==="intersection")return et(r.left,n)||et(r.right,n);if(r.type==="record"||r.type==="map")return et(r.keyType,n)||et(r.valueType,n);if(r.type==="pipe")return et(r.in,n)||et(r.out,n);if(r.type==="object"){for(const o in r.shape)if(et(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(et(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(et(o,n))return!0;return!!(r.rest&&et(r.rest,n))}return!1}const oN=(e,t={})=>n=>{const r=Hm({...n,processors:t});return Ge(e,r),Zm(r,e),qm(r,e)},rs=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},a=Hm({...o??{},target:s,io:t,processors:n});return Ge(e,a),Zm(a,e),qm(a,e)},sN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aN=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:a,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),c&&(o.format=sN[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),l&&(o.contentEncoding=l),u&&u.size>0){const f=[...u];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},iN=(e,t,n,r)=>{const o=n,{minimum:s,maximum:a,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f),typeof s=="number"&&(o.minimum=s,typeof f=="number"&&t.target!=="draft-04"&&(f>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l),typeof a=="number"&&(o.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof u=="number"&&(o.multipleOf=u)},cN=(e,t,n,r)=>{n.type="boolean"},lN=(e,t,n,r)=>{n.not={}},uN=(e,t,n,r)=>{},dN=(e,t,n,r)=>{const o=e._zod.def,s=Nm(o.entries);s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),n.enum=s},fN=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mN=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pN=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=Ge(s.element,t,{...r,path:[...r.path,"items"]})},hN=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const l in a)o.properties[l]=Ge(a[l],t,{...r,path:[...r.path,"properties",l]});const c=new Set(Object.keys(a)),u=new Set([...c].filter(l=>{const f=s.shape[l]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ge(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},gN=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((c,u)=>Ge(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=a:n.anyOf=a},yN=(e,t,n,r)=>{const o=e._zod.def,s=Ge(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=Ge(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];n.allOf=u},bN=(e,t,n,r)=>{const o=e._zod.def,s=Ge(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},vN=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},xN=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},wN=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},_N=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},SN=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ge(s,t,r);const a=t.seen.get(e);a.ref=s},kN=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Ym=(e,t,n,r)=>{const o=e._zod.def;Ge(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},EN=M("ZodISODateTime",(e,t)=>{AE.init(e,t),Te.init(e,t)});function CN(e){return DC(EN,e)}const NN=M("ZodISODate",(e,t)=>{TE.init(e,t),Te.init(e,t)});function jN(e){return IC(NN,e)}const RN=M("ZodISOTime",(e,t)=>{OE.init(e,t),Te.init(e,t)});function AN(e){return MC(RN,e)}const TN=M("ZodISODuration",(e,t)=>{PE.init(e,t),Te.init(e,t)});function ON(e){return $C(TN,e)}const PN=(e,t)=>{Hi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>xk(e,n)},flatten:{value:n=>vk(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Na,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Na,2)}},isEmpty:{get(){return e.issues.length===0}}})},bt=M("ZodError",PN,{Parent:Error}),DN=Ms(bt),IN=$s(bt),MN=Fs(bt),$N=zs(bt),FN=Ek(bt),zN=Ck(bt),LN=Nk(bt),BN=jk(bt),VN=Rk(bt),UN=Ak(bt),WN=Tk(bt),HN=Ok(bt),Fe=M("ZodType",(e,t)=>($e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rs(e,"input"),output:rs(e,"output")}}),e.toJSONSchema=oN(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(vn(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>xn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>DN(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>MN(e,n,r),e.parseAsync=async(n,r)=>IN(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>$N(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>FN(e,n,r),e.decode=(n,r)=>zN(e,n,r),e.encodeAsync=async(n,r)=>LN(e,n,r),e.decodeAsync=async(n,r)=>BN(e,n,r),e.safeEncode=(n,r)=>VN(e,n,r),e.safeDecode=(n,r)=>UN(e,n,r),e.safeEncodeAsync=async(n,r)=>WN(e,n,r),e.safeDecodeAsync=async(n,r)=>HN(e,n,r),e.refine=(n,r)=>e.check($2(n,r)),e.superRefine=n=>e.check(F2(n)),e.overwrite=n=>e.check(dr(n)),e.optional=()=>Vl(e),e.exactOptional=()=>k2(e),e.nullable=()=>Ul(e),e.nullish=()=>Vl(Ul(e)),e.nonoptional=n=>A2(e,n),e.array=()=>Ra(e),e.or=n=>b2([e,n]),e.and=n=>x2(e,n),e.transform=n=>Wl(e,_2(n)),e.default=n=>N2(e,n),e.prefault=n=>R2(e,n),e.catch=n=>O2(e,n),e.pipe=n=>Wl(e,n),e.readonly=()=>I2(e),e.describe=n=>{const r=e.clone();return Cr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Cr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Cr.get(e);const r=e.clone();return Cr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Gm=M("_ZodString",(e,t)=>{Zi.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>aN(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(UC(...r)),e.includes=(...r)=>e.check(ZC(...r)),e.startsWith=(...r)=>e.check(qC(...r)),e.endsWith=(...r)=>e.check(YC(...r)),e.min=(...r)=>e.check(ns(...r)),e.max=(...r)=>e.check(Um(...r)),e.length=(...r)=>e.check(Wm(...r)),e.nonempty=(...r)=>e.check(ns(1,...r)),e.lowercase=r=>e.check(WC(r)),e.uppercase=r=>e.check(HC(r)),e.trim=()=>e.check(KC()),e.normalize=(...r)=>e.check(GC(...r)),e.toLowerCase=()=>e.check(JC()),e.toUpperCase=()=>e.check(XC()),e.slugify=()=>e.check(QC())}),ZN=M("ZodString",(e,t)=>{Zi.init(e,t),Gm.init(e,t),e.email=n=>e.check(mC(qN,n)),e.url=n=>e.check(bC(YN,n)),e.jwt=n=>e.check(PC(l2,n)),e.emoji=n=>e.check(vC(GN,n)),e.guid=n=>e.check(Pl($l,n)),e.uuid=n=>e.check(pC(Ao,n)),e.uuidv4=n=>e.check(hC(Ao,n)),e.uuidv6=n=>e.check(gC(Ao,n)),e.uuidv7=n=>e.check(yC(Ao,n)),e.nanoid=n=>e.check(xC(KN,n)),e.guid=n=>e.check(Pl($l,n)),e.cuid=n=>e.check(wC(JN,n)),e.cuid2=n=>e.check(_C(XN,n)),e.ulid=n=>e.check(SC(QN,n)),e.base64=n=>e.check(AC(a2,n)),e.base64url=n=>e.check(TC(i2,n)),e.xid=n=>e.check(kC(e2,n)),e.ksuid=n=>e.check(EC(t2,n)),e.ipv4=n=>e.check(CC(n2,n)),e.ipv6=n=>e.check(NC(r2,n)),e.cidrv4=n=>e.check(jC(o2,n)),e.cidrv6=n=>e.check(RC(s2,n)),e.e164=n=>e.check(OC(c2,n)),e.datetime=n=>e.check(CN(n)),e.date=n=>e.check(jN(n)),e.time=n=>e.check(AN(n)),e.duration=n=>e.check(ON(n))});function un(e){return fC(ZN,e)}const Te=M("ZodStringFormat",(e,t)=>{Ae.init(e,t),Gm.init(e,t)}),qN=M("ZodEmail",(e,t)=>{wE.init(e,t),Te.init(e,t)}),$l=M("ZodGUID",(e,t)=>{vE.init(e,t),Te.init(e,t)}),Ao=M("ZodUUID",(e,t)=>{xE.init(e,t),Te.init(e,t)}),YN=M("ZodURL",(e,t)=>{_E.init(e,t),Te.init(e,t)}),GN=M("ZodEmoji",(e,t)=>{SE.init(e,t),Te.init(e,t)}),KN=M("ZodNanoID",(e,t)=>{kE.init(e,t),Te.init(e,t)}),JN=M("ZodCUID",(e,t)=>{EE.init(e,t),Te.init(e,t)}),XN=M("ZodCUID2",(e,t)=>{CE.init(e,t),Te.init(e,t)}),QN=M("ZodULID",(e,t)=>{NE.init(e,t),Te.init(e,t)}),e2=M("ZodXID",(e,t)=>{jE.init(e,t),Te.init(e,t)}),t2=M("ZodKSUID",(e,t)=>{RE.init(e,t),Te.init(e,t)}),n2=M("ZodIPv4",(e,t)=>{DE.init(e,t),Te.init(e,t)}),r2=M("ZodIPv6",(e,t)=>{IE.init(e,t),Te.init(e,t)}),o2=M("ZodCIDRv4",(e,t)=>{ME.init(e,t),Te.init(e,t)}),s2=M("ZodCIDRv6",(e,t)=>{$E.init(e,t),Te.init(e,t)}),a2=M("ZodBase64",(e,t)=>{FE.init(e,t),Te.init(e,t)}),i2=M("ZodBase64URL",(e,t)=>{LE.init(e,t),Te.init(e,t)}),c2=M("ZodE164",(e,t)=>{BE.init(e,t),Te.init(e,t)}),l2=M("ZodJWT",(e,t)=>{UE.init(e,t),Te.init(e,t)}),Km=M("ZodNumber",(e,t)=>{zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>iN(e,r,o),e.gt=(r,o)=>e.check(Il(r,o)),e.gte=(r,o)=>e.check(fa(r,o)),e.min=(r,o)=>e.check(fa(r,o)),e.lt=(r,o)=>e.check(Dl(r,o)),e.lte=(r,o)=>e.check(da(r,o)),e.max=(r,o)=>e.check(da(r,o)),e.int=r=>e.check(Fl(r)),e.safe=r=>e.check(Fl(r)),e.positive=r=>e.check(Il(0,r)),e.nonnegative=r=>e.check(fa(0,r)),e.negative=r=>e.check(Dl(0,r)),e.nonpositive=r=>e.check(da(0,r)),e.multipleOf=(r,o)=>e.check(Ml(r,o)),e.step=(r,o)=>e.check(Ml(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function _r(e){return FC(Km,e)}const u2=M("ZodNumberFormat",(e,t)=>{WE.init(e,t),Km.init(e,t)});function Fl(e){return zC(u2,e)}const d2=M("ZodBoolean",(e,t)=>{HE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cN(e,n,r)});function zl(e){return LC(d2,e)}const f2=M("ZodUnknown",(e,t)=>{ZE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uN()});function Ll(){return BC(f2)}const m2=M("ZodNever",(e,t)=>{qE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lN(e,n,r)});function p2(e){return VC(m2,e)}const h2=M("ZodArray",(e,t)=>{YE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pN(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(ns(n,r)),e.nonempty=n=>e.check(ns(1,n)),e.max=(n,r)=>e.check(Um(n,r)),e.length=(n,r)=>e.check(Wm(n,r)),e.unwrap=()=>e.element});function Ra(e,t){return eN(h2,e,t)}const g2=M("ZodObject",(e,t)=>{KE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hN(e,n,r,o),ke(e,"shape",()=>t.shape),e.keyof=()=>Ta(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ll()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ll()}),e.strict=()=>e.clone({...e._zod.def,catchall:p2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>pk(e,n),e.safeExtend=n=>hk(e,n),e.merge=n=>gk(e,n),e.pick=n=>fk(e,n),e.omit=n=>mk(e,n),e.partial=(...n)=>yk(Jm,e,n[0]),e.required=(...n)=>bk(Xm,e,n[0])});function Bl(e,t){const n={type:"object",shape:e??{},...ie(t)};return new g2(n)}const y2=M("ZodUnion",(e,t)=>{JE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gN(e,n,r,o),e.options=t.options});function b2(e,t){return new y2({type:"union",options:e,...ie(t)})}const v2=M("ZodIntersection",(e,t)=>{XE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yN(e,n,r,o)});function x2(e,t){return new v2({type:"intersection",left:e,right:t})}const Aa=M("ZodEnum",(e,t)=>{QE.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>dN(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const a of r)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Aa({...t,checks:[],...ie(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Aa({...t,checks:[],...ie(o),entries:s})}});function Ta(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Aa({type:"enum",entries:n,...ie(t)})}const w2=M("ZodTransform",(e,t)=>{eC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mN(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Em(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Fr(s,n.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Fr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function _2(e){return new w2({type:"transform",transform:e})}const Jm=M("ZodOptional",(e,t)=>{Vm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ym(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Vl(e){return new Jm({type:"optional",innerType:e})}const S2=M("ZodExactOptional",(e,t)=>{tC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ym(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function k2(e){return new S2({type:"optional",innerType:e})}const E2=M("ZodNullable",(e,t)=>{nC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bN(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ul(e){return new E2({type:"nullable",innerType:e})}const C2=M("ZodDefault",(e,t)=>{rC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xN(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function N2(e,t){return new C2({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Rm(t)}})}const j2=M("ZodPrefault",(e,t)=>{oC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wN(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function R2(e,t){return new j2({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Rm(t)}})}const Xm=M("ZodNonOptional",(e,t)=>{sC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vN(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function A2(e,t){return new Xm({type:"nonoptional",innerType:e,...ie(t)})}const T2=M("ZodCatch",(e,t)=>{aC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_N(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function O2(e,t){return new T2({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const P2=M("ZodPipe",(e,t)=>{iC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SN(e,n,r,o),e.in=t.in,e.out=t.out});function Wl(e,t){return new P2({type:"pipe",in:e,out:t})}const D2=M("ZodReadonly",(e,t)=>{cC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kN(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function I2(e){return new D2({type:"readonly",innerType:e})}const M2=M("ZodCustom",(e,t)=>{lC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fN(e,n)});function $2(e,t={}){return tN(M2,e,t)}function F2(e){return nN(e)}var io=e=>e.type==="checkbox",An=e=>e instanceof Date,at=e=>e==null;const Qm=e=>typeof e=="object";var Be=e=>!at(e)&&!Array.isArray(e)&&Qm(e)&&!An(e),ep=e=>Be(e)&&e.target?io(e.target)?e.target.checked:e.target.value:e,z2=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,tp=(e,t)=>e.has(z2(t)),L2=e=>{const t=e.constructor&&e.constructor.prototype;return Be(t)&&t.hasOwnProperty("isPrototypeOf")},qi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ze(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(qi&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Be(e)&&L2(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=ze(e[o]));return r}var Bs=e=>/^\w*$/.test(e),je=e=>e===void 0,Yi=e=>Array.isArray(e)?e.filter(Boolean):[],Gi=e=>Yi(e.replace(/["|']|\]/g,"").split(/\.|\[/)),q=(e,t,n)=>{if(!t||!Be(e))return n;const r=(Bs(t)?[t]:Gi(t)).reduce((o,s)=>at(o)?o:o[s],e);return je(r)||r===e?je(e[t])?n:e[t]:r},dt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=Bs(t)?[t]:Gi(t),s=o.length,a=s-1;for(;++r<s;){const c=o[r];let u=n;if(r!==a){const l=e[c];u=Be(l)||Array.isArray(l)?l:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=u,e=e[c]}};const os={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ct={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Zt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ki=E.createContext(null);Ki.displayName="HookFormControlContext";const Ji=()=>E.useContext(Ki);var np=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==Ct.all&&(t._proxyFormState[a]=!r||Ct.all),n&&(n[a]=!0),e[a]}});return o};const Xi=typeof window<"u"?E.useLayoutEffect:E.useEffect;function rp(e){const t=Ji(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[a,c]=E.useState(n._formState),u=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Xi(()=>n._subscribe({name:o,formState:u.current,exact:s,callback:l=>{!r&&c({...n._formState,...l})}}),[o,r,s]),E.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),E.useMemo(()=>np(a,n,u.current,!1),[a,n])}var mt=e=>typeof e=="string",Oa=(e,t,n,r,o)=>mt(e)?(r&&t.watch.add(e),q(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),q(n,s))):(r&&(t.watchAll=!0),n),Pa=e=>at(e)||!Qm(e);function Nt(e,t,n=new WeakSet){if(Pa(e)||Pa(t))return Object.is(e,t);if(An(e)&&An(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const a=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const c=t[s];if(An(a)&&An(c)||Be(a)&&Be(c)||Array.isArray(a)&&Array.isArray(c)?!Nt(a,c,n):!Object.is(a,c))return!1}}return!0}function B2(e){const t=Ji(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:a,compute:c}=e||{},u=E.useRef(o),l=E.useRef(c),f=E.useRef(void 0),d=E.useRef(n),h=E.useRef(r);l.current=c;const[p,g]=E.useState(()=>{const _=n._getWatch(r,u.current);return l.current?l.current(_):_}),y=E.useCallback(_=>{const C=Oa(r,n._names,_||n._formValues,!1,u.current);return l.current?l.current(C):C},[n._formValues,n._names,r]),b=E.useCallback(_=>{if(!s){const C=Oa(r,n._names,_||n._formValues,!1,u.current);if(l.current){const I=l.current(C);Nt(I,f.current)||(g(I),f.current=I)}else g(C)}},[n._formValues,n._names,s,r]);Xi(()=>((d.current!==n||!Nt(h.current,r))&&(d.current=n,h.current=r,b()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:_=>{b(_.values)}})),[n,a,r,b]),E.useEffect(()=>n._removeUnmounted());const v=d.current!==n,w=h.current,S=E.useMemo(()=>{if(s)return null;const _=!v&&!Nt(w,r);return v||_?y():null},[s,v,r,w,y]);return S!==null?S:p}function V2(e){const t=Ji(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:a,exact:c=!0}=e,u=tp(o._names.array,n),l=E.useMemo(()=>q(o._formValues,n,q(o._defaultValues,n,a)),[o,n,a]),f=B2({control:o,name:n,defaultValue:l,exact:c}),d=rp({control:o,name:n,exact:c}),h=E.useRef(e),p=E.useRef(void 0),g=E.useRef(o.register(n,{...e.rules,value:f,...dt(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const y=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!q(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!q(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!q(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!q(d.validatingFields,n)},error:{enumerable:!0,get:()=>q(d.errors,n)}}),[d,n]),b=E.useCallback(_=>g.current.onChange({target:{value:ep(_),name:n},type:os.CHANGE}),[n]),v=E.useCallback(()=>g.current.onBlur({target:{value:q(o._formValues,n),name:n},type:os.BLUR}),[n,o._formValues]),w=E.useCallback(_=>{const C=q(o._fields,n);C&&C._f&&_&&(C._f.ref={focus:()=>nt(_.focus)&&_.focus(),select:()=>nt(_.select)&&_.select(),setCustomValidity:I=>nt(_.setCustomValidity)&&_.setCustomValidity(I),reportValidity:()=>nt(_.reportValidity)&&_.reportValidity()})},[o._fields,n]),S=E.useMemo(()=>({name:n,value:f,...dt(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:b,onBlur:v,ref:w}),[n,r,d.disabled,b,v,w,f]);return E.useEffect(()=>{const _=o._options.shouldUnregister||s,C=p.current;C&&C!==n&&!u&&o.unregister(C),o.register(n,{...h.current.rules,...dt(h.current.disabled)?{disabled:h.current.disabled}:{}});const I=(O,T)=>{const H=q(o._fields,O);H&&H._f&&(H._f.mount=T)};if(I(n,!0),_){const O=ze(q(o._options.defaultValues,n,h.current.defaultValue));_e(o._defaultValues,n,O),je(q(o._formValues,n))&&_e(o._formValues,n,O)}return!u&&o.register(n),p.current=n,()=>{(u?_&&!o._state.action:_)?o.unregister(n):I(n,!1)}},[n,o,u,s]),E.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),E.useMemo(()=>({field:S,formState:d,fieldState:y}),[S,d,y])}const U2=e=>e.render(V2(e)),Qi=E.createContext(null);Qi.displayName="HookFormContext";const W2=()=>E.useContext(Qi),H2=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:a,setValue:c,trigger:u,formState:l,resetField:f,reset:d,handleSubmit:h,unregister:p,control:g,register:y,setFocus:b,subscribe:v}=e;return E.createElement(Qi.Provider,{value:E.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:a,setValue:c,trigger:u,formState:l,resetField:f,reset:d,handleSubmit:h,unregister:p,control:g,register:y,setFocus:b,subscribe:v}),[a,g,l,o,r,h,y,d,f,s,b,c,v,u,p,n])},E.createElement(Ki.Provider,{value:g},t))};var ec=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Rr=e=>Array.isArray(e)?e:[e],Hl=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function op(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Be(o)&&s){const a=op(o,s);Be(a)&&(n[r]=a)}else e[r]&&(n[r]=s)}return n}var tt=e=>Be(e)&&!Object.keys(e).length,tc=e=>e.type==="file",ss=e=>{if(!qi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},sp=e=>e.type==="select-multiple",nc=e=>e.type==="radio",Z2=e=>nc(e)||io(e),ma=e=>ss(e)&&e.isConnected;function q2(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=je(e)?r++:e[t[r++]];return e}function Y2(e){for(const t in e)if(e.hasOwnProperty(t)&&!je(e[t]))return!1;return!0}function Le(e,t){const n=Array.isArray(t)?t:Bs(t)?[t]:Gi(t),r=n.length===1?e:q2(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Be(r)&&tt(r)||Array.isArray(r)&&Y2(r))&&Le(e,n.slice(0,-1)),e}var G2=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function ap(e){return Array.isArray(e)||Be(e)&&!G2(e)}function Da(e,t={}){for(const n in e){const r=e[n];ap(r)?(t[n]=Array.isArray(r)?[]:{},Da(r,t[n])):je(r)||(t[n]=!0)}return t}function Kn(e,t,n){n||(n=Da(t));for(const r in e){const o=e[r];if(ap(o))je(t)||Pa(n[r])?n[r]=Da(o,Array.isArray(o)?[]:{}):Kn(o,at(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!Nt(o,s)}}return n}const Zl={value:!1,isValid:!1},ql={value:!0,isValid:!0};var ip=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!je(e[0].attributes.value)?je(e[0].value)||e[0].value===""?ql:{value:e[0].value,isValid:!0}:ql:Zl}return Zl},cp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>je(e)?e:t?e===""?NaN:e&&+e:n&&mt(e)?new Date(e):r?r(e):e;const Yl={isValid:!1,value:null};var lp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Yl):Yl;function Gl(e){const t=e.ref;return tc(t)?t.files:nc(t)?lp(e.refs).value:sp(t)?[...t.selectedOptions].map(({value:n})=>n):io(t)?ip(e.refs).value:cp(je(t.value)?e.ref.value:t.value,e)}var K2=(e,t,n,r)=>{const o={};for(const s of e){const a=q(t,s);a&&_e(o,s,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},as=e=>e instanceof RegExp,Sr=e=>je(e)?e:as(e)?e.source:Be(e)?as(e.value)?e.value.source:e.value:e,Kl=e=>({isOnSubmit:!e||e===Ct.onSubmit,isOnBlur:e===Ct.onBlur,isOnChange:e===Ct.onChange,isOnAll:e===Ct.all,isOnTouch:e===Ct.onTouched});const Jl="AsyncFunction";var J2=e=>!!e&&!!e.validate&&!!(nt(e.validate)&&e.validate.constructor.name===Jl||Be(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Jl)),X2=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Xl=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ar=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=q(e,o);if(s){const{_f:a,...c}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(Ar(c,t))break}else if(Be(c)&&Ar(c,t))break}}};function Ql(e,t,n){const r=q(e,n);if(r||Bs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),a=q(t,s),c=q(e,s);if(a&&!Array.isArray(a)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var Q2=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return tt(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!r||Ct.all))},ej=(e,t,n)=>!e||!t||e===t||Rr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),tj=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,nj=(e,t)=>!Yi(q(e,t)).length&&Le(e,t),rj=(e,t,n)=>{const r=Rr(q(e,n));return _e(r,"root",t[n]),_e(e,n,r),e};function eu(e,t,n="validate"){if(mt(e)||Array.isArray(e)&&e.every(mt)||dt(e)&&!e)return{type:n,message:mt(e)?e:"",ref:t}}var Gn=e=>Be(e)&&!as(e)?e:{value:e,message:""},tu=async(e,t,n,r,o,s)=>{const{ref:a,refs:c,required:u,maxLength:l,minLength:f,min:d,max:h,pattern:p,validate:g,name:y,valueAsNumber:b,mount:v}=e._f,w=q(n,y);if(!v||t.has(y))return{};const S=c?c[0]:a,_=N=>{o&&S.reportValidity&&(S.setCustomValidity(dt(N)?"":N||""),S.reportValidity())},C={},I=nc(a),O=io(a),T=I||O,H=(b||tc(a))&&je(a.value)&&je(w)||ss(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,Z=ec.bind(null,y,r,C),ne=(N,P,z,G=Zt.maxLength,D=Zt.minLength)=>{const W=N?P:z;C[y]={type:N?G:D,message:W,ref:a,...Z(N?G:D,W)}};if(s?!Array.isArray(w)||!w.length:u&&(!T&&(H||at(w))||dt(w)&&!w||O&&!ip(c).isValid||I&&!lp(c).isValid)){const{value:N,message:P}=mt(u)?{value:!!u,message:u}:Gn(u);if(N&&(C[y]={type:Zt.required,message:P,ref:S,...Z(Zt.required,P)},!r))return _(P),C}if(!H&&(!at(d)||!at(h))){let N,P;const z=Gn(h),G=Gn(d);if(!at(w)&&!isNaN(w)){const D=a.valueAsNumber||w&&+w;at(z.value)||(N=D>z.value),at(G.value)||(P=D<G.value)}else{const D=a.valueAsDate||new Date(w),W=F=>new Date(new Date().toDateString()+" "+F),V=a.type=="time",B=a.type=="week";mt(z.value)&&w&&(N=V?W(w)>W(z.value):B?w>z.value:D>new Date(z.value)),mt(G.value)&&w&&(P=V?W(w)<W(G.value):B?w<G.value:D<new Date(G.value))}if((N||P)&&(ne(!!N,z.message,G.message,Zt.max,Zt.min),!r))return _(C[y].message),C}if((l||f)&&!H&&(mt(w)||s&&Array.isArray(w))){const N=Gn(l),P=Gn(f),z=!at(N.value)&&w.length>+N.value,G=!at(P.value)&&w.length<+P.value;if((z||G)&&(ne(z,N.message,P.message),!r))return _(C[y].message),C}if(p&&!H&&mt(w)){const{value:N,message:P}=Gn(p);if(as(N)&&!w.match(N)&&(C[y]={type:Zt.pattern,message:P,ref:a,...Z(Zt.pattern,P)},!r))return _(P),C}if(g){if(nt(g)){const N=await g(w,n),P=eu(N,S);if(P&&(C[y]={...P,...Z(Zt.validate,P.message)},!r))return _(P.message),C}else if(Be(g)){let N={};for(const P in g){if(!tt(N)&&!r)break;const z=eu(await g[P](w,n),S,P);z&&(N={...z,...Z(P,z.message)},_(z.message),r&&(C[y]=N))}if(!tt(N)&&(C[y]={ref:S,...N},!r))return C}}return _(!0),C};const oj={mode:Ct.onSubmit,reValidateMode:Ct.onChange,shouldFocusError:!0};function sj(e={}){let t={...oj,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:nt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Be(t.defaultValues)||Be(t.values)?ze(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ze(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let h={...d};const p={array:Hl(),state:Hl()},g=t.criteriaMode===Ct.all,y=x=>k=>{clearTimeout(l),l=setTimeout(x,k)},b=async x=>{if(!a.keepIsValid&&!t.disabled&&(d.isValid||h.isValid||x)){let k;t.resolver?(k=tt((await T()).errors),v()):k=await Z(r,!0),k!==n.isValid&&p.state.next({isValid:k})}},v=(x,k)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((x||Array.from(c.mount)).forEach(A=>{A&&(k?_e(n.validatingFields,A,k):Le(n.validatingFields,A))}),p.state.next({validatingFields:n.validatingFields,isValidating:!tt(n.validatingFields)}))},w=(x,k=[],A,K,U=!0,L=!0)=>{if(K&&A&&!t.disabled){if(a.action=!0,L&&Array.isArray(q(r,x))){const se=A(q(r,x),K.argA,K.argB);U&&_e(r,x,se)}if(L&&Array.isArray(q(n.errors,x))){const se=A(q(n.errors,x),K.argA,K.argB);U&&_e(n.errors,x,se),nj(n.errors,x)}if((d.touchedFields||h.touchedFields)&&L&&Array.isArray(q(n.touchedFields,x))){const se=A(q(n.touchedFields,x),K.argA,K.argB);U&&_e(n.touchedFields,x,se)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Kn(o,s)),p.state.next({name:x,isDirty:N(x,k),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else _e(s,x,k)},S=(x,k)=>{_e(n.errors,x,k),p.state.next({errors:n.errors})},_=x=>{n.errors=x,p.state.next({errors:n.errors,isValid:!1})},C=(x,k,A,K)=>{const U=q(r,x);if(U){const L=q(s,x,je(A)?q(o,x):A);je(L)||K&&K.defaultChecked||k?_e(s,x,k?L:Gl(U._f)):G(x,L),a.mount&&!a.action&&b()}},I=(x,k,A,K,U)=>{let L=!1,se=!1;const we={name:x};if(!t.disabled){if(!A||K){(d.isDirty||h.isDirty)&&(se=n.isDirty,n.isDirty=we.isDirty=N(),L=se!==we.isDirty);const xe=Nt(q(o,x),k);se=!!q(n.dirtyFields,x),xe?Le(n.dirtyFields,x):_e(n.dirtyFields,x,!0),we.dirtyFields=n.dirtyFields,L=L||(d.dirtyFields||h.dirtyFields)&&se!==!xe}if(A){const xe=q(n.touchedFields,x);xe||(_e(n.touchedFields,x,A),we.touchedFields=n.touchedFields,L=L||(d.touchedFields||h.touchedFields)&&xe!==A)}L&&U&&p.state.next(we)}return L?we:{}},O=(x,k,A,K)=>{const U=q(n.errors,x),L=(d.isValid||h.isValid)&&dt(k)&&n.isValid!==k;if(t.delayError&&A?(u=y(()=>S(x,A)),u(t.delayError)):(clearTimeout(l),u=null,A?_e(n.errors,x,A):Le(n.errors,x)),(A?!Nt(U,A):U)||!tt(K)||L){const se={...K,...L&&dt(k)?{isValid:k}:{},errors:n.errors,name:x};n={...n,...se},p.state.next(se)}},T=async x=>(v(x,!0),await t.resolver(s,t.context,K2(x||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),H=async x=>{const{errors:k}=await T(x);if(v(x),x)for(const A of x){const K=q(k,A);K?_e(n.errors,A,K):Le(n.errors,A)}else n.errors=k;return k},Z=async(x,k,A={valid:!0})=>{for(const K in x){const U=x[K];if(U){const{_f:L,...se}=U;if(L){const we=c.array.has(L.name),xe=U._f&&J2(U._f);xe&&d.validatingFields&&v([L.name],!0);const Oe=await tu(U,c.disabled,s,g,t.shouldUseNativeValidation&&!k,we);if(xe&&d.validatingFields&&v([L.name]),Oe[L.name]&&(A.valid=!1,k||e.shouldUseNativeValidation))break;!k&&(q(Oe,L.name)?we?rj(n.errors,Oe,L.name):_e(n.errors,L.name,Oe[L.name]):Le(n.errors,L.name))}!tt(se)&&await Z(se,k,A)}}return A.valid},ne=()=>{for(const x of c.unMount){const k=q(r,x);k&&(k._f.refs?k._f.refs.every(A=>!ma(A)):!ma(k._f.ref))&&Q(x)}c.unMount=new Set},N=(x,k)=>!t.disabled&&(x&&k&&_e(s,x,k),!Nt(R(),o)),P=(x,k,A)=>Oa(x,c,{...a.mount?s:je(k)?o:mt(x)?{[x]:k}:k},A,k),z=x=>Yi(q(a.mount?s:o,x,t.shouldUnregister?q(o,x,[]):[])),G=(x,k,A={})=>{const K=q(r,x);let U=k;if(K){const L=K._f;L&&(!L.disabled&&_e(s,x,cp(k,L)),U=ss(L.ref)&&at(k)?"":k,sp(L.ref)?[...L.ref.options].forEach(se=>se.selected=U.includes(se.value)):L.refs?io(L.ref)?L.refs.forEach(se=>{(!se.defaultChecked||!se.disabled)&&(Array.isArray(U)?se.checked=!!U.find(we=>we===se.value):se.checked=U===se.value||!!U)}):L.refs.forEach(se=>se.checked=se.value===U):tc(L.ref)?L.ref.value="":(L.ref.value=U,L.ref.type||p.state.next({name:x,values:ze(s)})))}(A.shouldDirty||A.shouldTouch)&&I(x,U,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&F(x)},D=(x,k,A)=>{for(const K in k){if(!k.hasOwnProperty(K))return;const U=k[K],L=x+"."+K,se=q(r,L);(c.array.has(x)||Be(U)||se&&!se._f)&&!An(U)?D(L,U,A):G(L,U,A)}},W=(x,k,A={})=>{const K=q(r,x),U=c.array.has(x),L=ze(k);_e(s,x,L),U?(p.array.next({name:x,values:ze(s)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&A.shouldDirty&&p.state.next({name:x,dirtyFields:Kn(o,s),isDirty:N(x,L)})):K&&!K._f&&!at(L)?D(x,L,A):G(x,L,A),Xl(x,c)?p.state.next({...n,name:x,values:ze(s)}):p.state.next({name:a.mount?x:void 0,values:ze(s)})},V=async x=>{a.mount=!0;const k=x.target;let A=k.name,K=!0;const U=q(r,A),L=xe=>{K=Number.isNaN(xe)||An(xe)&&isNaN(xe.getTime())||Nt(xe,q(s,A,xe))},se=Kl(t.mode),we=Kl(t.reValidateMode);if(U){let xe,Oe;const $t=k.type?Gl(U._f):ep(x),Qe=x.type===os.BLUR||x.type===os.FOCUS_OUT,Zs=!X2(U._f)&&!t.resolver&&!q(n.errors,A)&&!U._f.deps||tj(Qe,q(n.touchedFields,A),n.isSubmitted,we,se),pr=Xl(A,c,Qe);_e(s,A,$t),Qe?(!k||!k.readOnly)&&(U._f.onBlur&&U._f.onBlur(x),u&&u(0)):U._f.onChange&&U._f.onChange(x);const Wn=I(A,$t,Qe),fo=!tt(Wn)||pr;if(!Qe&&p.state.next({name:A,type:x.type,values:ze(s)}),Zs)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Qe&&b():Qe||b()),fo&&p.state.next({name:A,...pr?{}:Wn});if(!Qe&&pr&&p.state.next({...n}),t.resolver){const{errors:mo}=await T([A]);if(v([A]),L($t),K){const hr=Ql(n.errors,r,A),xt=Ql(mo,r,hr.name||A);xe=xt.error,A=xt.name,Oe=tt(mo)}}else v([A],!0),xe=(await tu(U,c.disabled,s,g,t.shouldUseNativeValidation))[A],v([A]),L($t),K&&(xe?Oe=!1:(d.isValid||h.isValid)&&(Oe=await Z(r,!0)));K&&(U._f.deps&&(!Array.isArray(U._f.deps)||U._f.deps.length>0)&&F(U._f.deps),O(A,Oe,xe,Wn))}},B=(x,k)=>{if(q(n.errors,k)&&x.focus)return x.focus(),1},F=async(x,k={})=>{let A,K;const U=Rr(x);if(t.resolver){const L=await H(je(x)?x:U);A=tt(L),K=x?!U.some(se=>q(L,se)):A}else x?(K=(await Promise.all(U.map(async L=>{const se=q(r,L);return await Z(se&&se._f?{[L]:se}:se)}))).every(Boolean),!(!K&&!n.isValid)&&b()):K=A=await Z(r);return p.state.next({...!mt(x)||(d.isValid||h.isValid)&&A!==n.isValid?{}:{name:x},...t.resolver||!x?{isValid:A}:{},errors:n.errors}),k.shouldFocus&&!K&&Ar(r,B,x?U:c.mount),K},R=(x,k)=>{let A={...a.mount?s:o};return k&&(A=op(k.dirtyFields?n.dirtyFields:n.touchedFields,A)),je(x)?A:mt(x)?q(A,x):x.map(K=>q(A,K))},J=(x,k)=>({invalid:!!q((k||n).errors,x),isDirty:!!q((k||n).dirtyFields,x),error:q((k||n).errors,x),isValidating:!!q(n.validatingFields,x),isTouched:!!q((k||n).touchedFields,x)}),Y=x=>{const k=x?Rr(x):void 0;k?.forEach(A=>Le(n.errors,A)),k?k.forEach(A=>{p.state.next({name:A,errors:n.errors})}):p.state.next({errors:{}})},X=(x,k,A)=>{const K=(q(r,x,{_f:{}})._f||{}).ref,U=q(n.errors,x)||{},{ref:L,message:se,type:we,...xe}=U;_e(n.errors,x,{...xe,...k,ref:K}),p.state.next({name:x,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&K&&K.focus&&K.focus()},re=(x,k)=>nt(x)?p.state.subscribe({next:A=>"values"in A&&x(P(void 0,k),A)}):P(x,k,!0),ce=x=>p.state.subscribe({next:k=>{ej(x.name,k.name,x.exact)&&Q2(k,x.formState||d,lo,x.reRenderRoot)&&x.callback({values:{...s},...n,...k,defaultValues:o})}}).unsubscribe,$=x=>(a.mount=!0,h={...h,...x.formState},ce({...x,formState:{...f,...x.formState}})),Q=(x,k={})=>{for(const A of x?Rr(x):c.mount)c.mount.delete(A),c.array.delete(A),k.keepValue||(Le(r,A),Le(s,A)),!k.keepError&&Le(n.errors,A),!k.keepDirty&&Le(n.dirtyFields,A),!k.keepTouched&&Le(n.touchedFields,A),!k.keepIsValidating&&Le(n.validatingFields,A),!t.shouldUnregister&&!k.keepDefaultValue&&Le(o,A);p.state.next({values:ze(s)}),p.state.next({...n,...k.keepDirty?{isDirty:N()}:{}}),!k.keepIsValid&&b()},le=({disabled:x,name:k})=>{if(dt(x)&&a.mount||x||c.disabled.has(k)){const U=c.disabled.has(k)!==!!x;x?c.disabled.add(k):c.disabled.delete(k),U&&a.mount&&!a.action&&b()}},me=(x,k={})=>{let A=q(r,x);const K=dt(k.disabled)||dt(t.disabled);return _e(r,x,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:x}},name:x,mount:!0,...k}}),c.mount.add(x),A?le({disabled:dt(k.disabled)?k.disabled:t.disabled,name:x}):C(x,!0,k.value),{...K?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:Sr(k.min),max:Sr(k.max),minLength:Sr(k.minLength),maxLength:Sr(k.maxLength),pattern:Sr(k.pattern)}:{},name:x,onChange:V,onBlur:V,ref:U=>{if(U){me(x,k),A=q(r,x);const L=je(U.value)&&U.querySelectorAll&&U.querySelectorAll("input,select,textarea")[0]||U,se=Z2(L),we=A._f.refs||[];if(se?we.find(xe=>xe===L):L===A._f.ref)return;_e(r,x,{_f:{...A._f,...se?{refs:[...we.filter(ma),L,...Array.isArray(q(o,x))?[{}]:[]],ref:{type:L.type,name:x}}:{ref:L}}}),C(x,!1,void 0,L)}else A=q(r,x,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(tp(c.array,x)&&a.action)&&c.unMount.add(x)}}},he=()=>t.shouldFocusError&&Ar(r,B,c.mount),be=x=>{dt(x)&&(p.state.next({disabled:x}),Ar(r,(k,A)=>{const K=q(r,A);K&&(k.disabled=K._f.disabled||x,Array.isArray(K._f.refs)&&K._f.refs.forEach(U=>{U.disabled=K._f.disabled||x}))},0,!1))},De=(x,k)=>async A=>{let K;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let U=ze(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:se}=await T();v(),n.errors=L,U=ze(se)}else await Z(r);if(c.disabled.size)for(const L of c.disabled)Le(U,L);if(Le(n.errors,"root"),tt(n.errors)){p.state.next({errors:{}});try{await x(U,A)}catch(L){K=L}}else k&&await k({...n.errors},A),he(),setTimeout(he);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tt(n.errors)&&!K,submitCount:n.submitCount+1,errors:n.errors}),K)throw K},We=(x,k={})=>{q(r,x)&&(je(k.defaultValue)?W(x,ze(q(o,x))):(W(x,k.defaultValue),_e(o,x,ze(k.defaultValue))),k.keepTouched||Le(n.touchedFields,x),k.keepDirty||(Le(n.dirtyFields,x),n.isDirty=k.defaultValue?N(x,ze(q(o,x))):N()),k.keepError||(Le(n.errors,x),d.isValid&&b()),p.state.next({...n}))},sn=(x,k={})=>{const A=x?ze(x):o,K=ze(A),U=tt(x),L=U?o:K;if(k.keepDefaultValues||(o=A),!k.keepValues){if(k.keepDirtyValues){const se=new Set([...c.mount,...Object.keys(Kn(o,s))]);for(const we of Array.from(se)){const xe=q(n.dirtyFields,we),Oe=q(s,we),$t=q(L,we);xe&&!je(Oe)?_e(L,we,Oe):!xe&&!je($t)&&W(we,$t)}}else{if(qi&&je(x))for(const se of c.mount){const we=q(r,se);if(we&&we._f){const xe=Array.isArray(we._f.refs)?we._f.refs[0]:we._f.ref;if(ss(xe)){const Oe=xe.closest("form");if(Oe){Oe.reset();break}}}}if(k.keepFieldsRef)for(const se of c.mount)W(se,q(L,se));else r={}}s=t.shouldUnregister?k.keepDefaultValues?ze(o):{}:ze(L),p.array.next({values:{...L}}),p.state.next({values:{...L}})}c={mount:k.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!tt(L),a.watch=!!t.shouldUnregister,a.keepIsValid=!!k.keepIsValid,a.action=!1,k.keepErrors||(n.errors={}),p.state.next({submitCount:k.keepSubmitCount?n.submitCount:0,isDirty:U?!1:k.keepDirty?n.isDirty:!!(k.keepDefaultValues&&!Nt(x,o)),isSubmitted:k.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:U?{}:k.keepDirtyValues?k.keepDefaultValues&&s?Kn(o,s):n.dirtyFields:k.keepDefaultValues&&x?Kn(o,x):k.keepDirty?n.dirtyFields:{},touchedFields:k.keepTouched?n.touchedFields:{},errors:k.keepErrors?n.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Wt=(x,k)=>sn(nt(x)?x(s):x,{...t.resetOptions,...k}),vt=(x,k={})=>{const A=q(r,x),K=A&&A._f;if(K){const U=K.refs?K.refs[0]:K.ref;U.focus&&setTimeout(()=>{U.focus(),k.shouldSelect&&nt(U.select)&&U.select()})}},lo=x=>{n={...n,...x}},uo={control:{register:me,unregister:Q,getFieldState:J,handleSubmit:De,setError:X,_subscribe:ce,_runSchema:T,_updateIsValidating:v,_focusError:he,_getWatch:P,_getDirty:N,_setValid:b,_setFieldArray:w,_setDisabledField:le,_setErrors:_,_getFieldArray:z,_reset:sn,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(x=>{Wt(x,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:ne,_disableForm:be,_subjects:p,_proxyFormState:d,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(x){a=x},get _defaultValues(){return o},get _names(){return c},set _names(x){c=x},get _formState(){return n},get _options(){return t},set _options(x){t={...t,...x}}},subscribe:$,trigger:F,register:me,handleSubmit:De,watch:re,setValue:W,getValues:R,reset:Wt,resetField:We,clearErrors:Y,unregister:Q,setError:X,setFocus:vt,getFieldState:J};return{...uo,formControl:uo}}function aj(e={}){const t=E.useRef(void 0),n=E.useRef(void 0),[r,o]=E.useState({isDirty:!1,isValidating:!1,isLoading:nt(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:nt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=sj(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Xi(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,a},[s]),E.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),E.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),E.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),E.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),E.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==r.isDirty&&s._subjects.state.next({isDirty:a})}},[s,r.isDirty]),E.useEffect(()=>{var a;e.values&&!Nt(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((a=s._options.resetOptions)===null||a===void 0)&&a.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),E.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=E.useMemo(()=>np(r,s),[s,r]),t.current}const nu=(e,t,n)=>{if(e&&"reportValidity"in e){const r=q(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ia=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?nu(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>nu(o,n,e))}},ru=(e,t)=>{t.shouldUseNativeValidation&&Ia(e,t);const n={};for(const r in e){const o=q(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(ij(t.names||Object.keys(e),r)){const a=Object.assign({},q(n,r));_e(a,"root",s),_e(n,r,a)}else _e(n,r,s)}return n},ij=(e,t)=>{const n=ou(t);return e.some(r=>ou(r).match(`^${n}\\.\\d+`))};function ou(e){return e.replace(/\]|\[/g,"")}function su(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function cj(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=ec(a,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function lj(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,a=r.path.join(".");if(!n[a])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[a]={message:c.message,type:c.code}}else n[a]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(f){return f.forEach(function(d){return e.push(d)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=ec(a,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function uj(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(su(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(a){return s.shouldUseNativeValidation&&Ia({},s),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return Array.isArray(c?.issues)})(a))return{values:{},errors:ru(cj(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(su(function(){return Promise.resolve((n.mode==="sync"?wk:_k)(e,r,t)).then(function(a){return s.shouldUseNativeValidation&&Ia({},s),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return c instanceof Hi})(a))return{values:{},errors:ru(lj(a.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const dj=H2,up=m.createContext({}),qt=({...e})=>i.jsx(up.Provider,{value:{name:e.name},children:i.jsx(U2,{...e})}),Vs=()=>{const e=m.useContext(up),t=m.useContext(dp),{getFieldState:n}=W2(),r=rp({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},dp=m.createContext({});function St({className:e,...t}){const n=m.useId();return i.jsx(dp.Provider,{value:{id:n},children:i.jsx("div",{"data-slot":"form-item",className:ae("grid gap-2",e),...t})})}function Yt({className:e,children:t,required:n,...r}){const{error:o,formItemId:s}=Vs();return i.jsxs(Gt,{"data-slot":"form-label","data-error":!!o,className:e,htmlFor:s,...r,children:[t,n&&i.jsx("span",{className:"text-destructive",children:"*"})]})}function dn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Vs();return i.jsx(di,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Cn({className:e,...t}){const{formDescriptionId:n}=Vs();return i.jsx("p",{"data-slot":"form-description",id:n,className:ae("text-muted-foreground text-sm",e),...t})}function fn({className:e,...t}){const{error:n,formMessageId:r}=Vs(),o=n?String(n?.message??""):t.children;return o?i.jsx("p",{"data-slot":"form-message",id:r,className:ae("text-destructive text-sm",e),...t,children:o}):null}function au(e,[t,n]){return Math.min(n,Math.max(t,e))}function fj(e){const t=mj(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(hj);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function mj(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=yj(o),c=gj(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pj=Symbol("radix.slottable");function hj(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pj}function gj(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function yj(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bj(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fp=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"}),vj="VisuallyHidden",xj=m.forwardRef((e,t)=>i.jsx(ve.span,{...e,ref:t,style:{...fp,...e.style}}));xj.displayName=vj;var wj=[" ","Enter","ArrowUp","ArrowDown"],_j=[" ","Enter"],Fn="Select",[Us,Ws,Sj]=mi(Fn),[fr]=yn(Fn,[Sj,Cs]),Hs=Cs(),[kj,wn]=fr(Fn),[Ej,Cj]=fr(Fn),mp=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:c,onValueChange:u,dir:l,name:f,autoComplete:d,disabled:h,required:p,form:g}=e,y=Hs(t),[b,v]=m.useState(null),[w,S]=m.useState(null),[_,C]=m.useState(!1),I=pi(l),[O,T]=Pr({prop:r,defaultProp:o??!1,onChange:s,caller:Fn}),[H,Z]=Pr({prop:a,defaultProp:c,onChange:u,caller:Fn}),ne=m.useRef(null),N=b?g||!!b.closest("form"):!0,[P,z]=m.useState(new Set),G=Array.from(P).map(D=>D.props.value).join(";");return i.jsx(Ud,{...y,children:i.jsxs(kj,{required:p,scope:t,trigger:b,onTriggerChange:v,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Kt(),value:H,onValueChange:Z,open:O,onOpenChange:T,dir:I,triggerPointerDownPosRef:ne,disabled:h,children:[i.jsx(Us.Provider,{scope:t,children:i.jsx(Ej,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(D=>{z(W=>new Set(W).add(D))},[]),onNativeOptionRemove:m.useCallback(D=>{z(W=>{const V=new Set(W);return V.delete(D),V})},[]),children:n})}),N?i.jsxs(Ip,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:H,onChange:D=>Z(D.target.value),disabled:h,form:g,children:[H===void 0?i.jsx("option",{value:""}):null,Array.from(P)]},G):null]})})};mp.displayName=Fn;var pp="SelectTrigger",hp=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Hs(n),a=wn(pp,n),c=a.disabled||r,u=Ee(t,a.onTriggerChange),l=Ws(n),f=m.useRef("touch"),[d,h,p]=$p(y=>{const b=l().filter(S=>!S.disabled),v=b.find(S=>S.value===a.value),w=Fp(b,y,v);w!==void 0&&a.onValueChange(w.value)}),g=y=>{c||(a.onOpenChange(!0),p()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return i.jsx(Wd,{asChild:!0,...s,children:i.jsx(ve.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Mp(a.value)?"":void 0,...o,ref:u,onClick:oe(o.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&g(y)}),onPointerDown:oe(o.onPointerDown,y=>{f.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(g(y),y.preventDefault())}),onKeyDown:oe(o.onKeyDown,y=>{const b=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(b&&y.key===" ")&&wj.includes(y.key)&&(g(),y.preventDefault())})})})});hp.displayName=pp;var gp="SelectValue",yp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...c}=e,u=wn(gp,n),{onValueNodeHasChildrenChange:l}=u,f=s!==void 0,d=Ee(t,u.onValueNodeChange);return Xe(()=>{l(f)},[l,f]),i.jsx(ve.span,{...c,ref:d,style:{pointerEvents:"none"},children:Mp(u.value)?i.jsx(i.Fragment,{children:a}):s})});yp.displayName=gp;var Nj="SelectIcon",bp=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(ve.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bp.displayName=Nj;var jj="SelectPortal",vp=e=>i.jsx(Ns,{asChild:!0,...e});vp.displayName=jj;var zn="SelectContent",xp=m.forwardRef((e,t)=>{const n=wn(zn,e.__scopeSelect),[r,o]=m.useState();if(Xe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?us.createPortal(i.jsx(wp,{scope:e.__scopeSelect,children:i.jsx(Us.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(_p,{...e,ref:t})});xp.displayName=zn;var kt=10,[wp,_n]=fr(zn),Rj="SelectContentImpl",Aj=fj("SelectContent.RemoveScroll"),_p=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:u,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:b,...v}=e,w=wn(zn,n),[S,_]=m.useState(null),[C,I]=m.useState(null),O=Ee(t,$=>_($)),[T,H]=m.useState(null),[Z,ne]=m.useState(null),N=Ws(n),[P,z]=m.useState(!1),G=m.useRef(!1);m.useEffect(()=>{if(S)return ki(S)},[S]),hi();const D=m.useCallback($=>{const[Q,...le]=N().map(be=>be.ref.current),[me]=le.slice(-1),he=document.activeElement;for(const be of $)if(be===he||(be?.scrollIntoView({block:"nearest"}),be===Q&&C&&(C.scrollTop=0),be===me&&C&&(C.scrollTop=C.scrollHeight),be?.focus(),document.activeElement!==he))return},[N,C]),W=m.useCallback(()=>D([T,S]),[D,T,S]);m.useEffect(()=>{P&&W()},[P,W]);const{onOpenChange:V,triggerPointerDownPosRef:B}=w;m.useEffect(()=>{if(S){let $={x:0,y:0};const Q=me=>{$={x:Math.abs(Math.round(me.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(B.current?.y??0))}},le=me=>{$.x<=10&&$.y<=10?me.preventDefault():S.contains(me.target)||V(!1),document.removeEventListener("pointermove",Q),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",le,{capture:!0})}}},[S,V,B]),m.useEffect(()=>{const $=()=>V(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[V]);const[F,R]=$p($=>{const Q=N().filter(he=>!he.disabled),le=Q.find(he=>he.ref.current===document.activeElement),me=Fp(Q,$,le);me&&setTimeout(()=>me.ref.current.focus())}),J=m.useCallback(($,Q,le)=>{const me=!G.current&&!le;(w.value!==void 0&&w.value===Q||me)&&(H($),me&&(G.current=!0))},[w.value]),Y=m.useCallback(()=>S?.focus(),[S]),X=m.useCallback(($,Q,le)=>{const me=!G.current&&!le;(w.value!==void 0&&w.value===Q||me)&&ne($)},[w.value]),re=r==="popper"?Ma:Sp,ce=re===Ma?{side:c,sideOffset:u,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:b}:{};return i.jsx(wp,{scope:n,content:S,viewport:C,onViewportChange:I,itemRefCallback:J,selectedItem:T,onItemLeave:Y,itemTextRefCallback:X,focusSelectedItem:W,selectedItemText:Z,position:r,isPositioned:P,searchRef:F,children:i.jsx(Rs,{as:Aj,allowPinchZoom:!0,children:i.jsx(ws,{asChild:!0,trapped:w.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:oe(o,$=>{w.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:i.jsx(xs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:i.jsx(re,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:$=>$.preventDefault(),...v,...ce,onPlaced:()=>z(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:oe(v.onKeyDown,$=>{const Q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Q&&$.key.length===1&&R($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let me=N().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes($.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const he=$.target,be=me.indexOf(he);me=me.slice(be+1)}setTimeout(()=>D(me)),$.preventDefault()}})})})})})})});_p.displayName=Rj;var Tj="SelectItemAlignedPosition",Sp=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=wn(zn,n),a=_n(zn,n),[c,u]=m.useState(null),[l,f]=m.useState(null),d=Ee(t,O=>f(O)),h=Ws(n),p=m.useRef(!1),g=m.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:v,focusSelectedItem:w}=a,S=m.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&l&&y&&b&&v){const O=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),Z=v.getBoundingClientRect();if(s.dir!=="rtl"){const he=Z.left-T.left,be=H.left-he,De=O.left-be,We=O.width+De,sn=Math.max(We,T.width),Wt=window.innerWidth-kt,vt=au(be,[kt,Math.max(kt,Wt-sn)]);c.style.minWidth=We+"px",c.style.left=vt+"px"}else{const he=T.right-Z.right,be=window.innerWidth-H.right-he,De=window.innerWidth-O.right-be,We=O.width+De,sn=Math.max(We,T.width),Wt=window.innerWidth-kt,vt=au(be,[kt,Math.max(kt,Wt-sn)]);c.style.minWidth=We+"px",c.style.right=vt+"px"}const ne=h(),N=window.innerHeight-kt*2,P=y.scrollHeight,z=window.getComputedStyle(l),G=parseInt(z.borderTopWidth,10),D=parseInt(z.paddingTop,10),W=parseInt(z.borderBottomWidth,10),V=parseInt(z.paddingBottom,10),B=G+D+P+V+W,F=Math.min(b.offsetHeight*5,B),R=window.getComputedStyle(y),J=parseInt(R.paddingTop,10),Y=parseInt(R.paddingBottom,10),X=O.top+O.height/2-kt,re=N-X,ce=b.offsetHeight/2,$=b.offsetTop+ce,Q=G+D+$,le=B-Q;if(Q<=X){const he=ne.length>0&&b===ne[ne.length-1].ref.current;c.style.bottom="0px";const be=l.clientHeight-y.offsetTop-y.offsetHeight,De=Math.max(re,ce+(he?Y:0)+be+W),We=Q+De;c.style.height=We+"px"}else{const he=ne.length>0&&b===ne[0].ref.current;c.style.top="0px";const De=Math.max(X,G+y.offsetTop+(he?J:0)+ce)+le;c.style.height=De+"px",y.scrollTop=Q-X+y.offsetTop}c.style.margin=`${kt}px 0`,c.style.minHeight=F+"px",c.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,c,l,y,b,v,s.dir,r]);Xe(()=>S(),[S]);const[_,C]=m.useState();Xe(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);const I=m.useCallback(O=>{O&&g.current===!0&&(S(),w?.(),g.current=!1)},[S,w]);return i.jsx(Pj,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:I,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(ve.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Sp.displayName=Tj;var Oj="SelectPopperPosition",Ma=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=kt,...s}=e,a=Hs(n);return i.jsx(Hd,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Ma.displayName=Oj;var[Pj,rc]=fr(zn,{}),$a="SelectViewport",kp=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=_n($a,n),a=rc($a,n),c=Ee(t,s.onViewportChange),u=m.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:r}),i.jsx(Us.Slot,{scope:n,children:i.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:oe(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const p=Math.abs(u.current-f.scrollTop);if(p>0){const g=window.innerHeight-kt*2,y=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(y,b);if(v<g){const w=v+p,S=Math.min(g,w),_=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});kp.displayName=$a;var Ep="SelectGroup",[Dj,Ij]=fr(Ep),Mj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kt();return i.jsx(Dj,{scope:n,id:o,children:i.jsx(ve.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Mj.displayName=Ep;var Cp="SelectLabel",$j=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ij(Cp,n);return i.jsx(ve.div,{id:o.id,...r,ref:t})});$j.displayName=Cp;var is="SelectItem",[Fj,Np]=fr(is),jp=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,c=wn(is,n),u=_n(is,n),l=c.value===r,[f,d]=m.useState(s??""),[h,p]=m.useState(!1),g=Ee(t,w=>u.itemRefCallback?.(w,r,o)),y=Kt(),b=m.useRef("touch"),v=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")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 i.jsx(Fj,{scope:n,value:r,disabled:o,textId:y,isSelected:l,onItemTextChange:m.useCallback(w=>{d(S=>S||(w?.textContent??"").trim())},[]),children:i.jsx(Us.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(ve.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:oe(a.onFocus,()=>p(!0)),onBlur:oe(a.onBlur,()=>p(!1)),onClick:oe(a.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:oe(a.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:oe(a.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:oe(a.onPointerMove,w=>{b.current=w.pointerType,o?u.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:oe(a.onKeyDown,w=>{u.searchRef?.current!==""&&w.key===" "||(_j.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});jp.displayName=is;var Nr="SelectItemText",Rp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=wn(Nr,n),c=_n(Nr,n),u=Np(Nr,n),l=Cj(Nr,n),[f,d]=m.useState(null),h=Ee(t,v=>d(v),u.onItemTextChange,v=>c.itemTextRefCallback?.(v,u.value,u.disabled)),p=f?.textContent,g=m.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return Xe(()=>(y(g),()=>b(g)),[y,b,g]),i.jsxs(i.Fragment,{children:[i.jsx(ve.span,{id:u.textId,...s,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?us.createPortal(s.children,a.valueNode):null]})});Rp.displayName=Nr;var Ap="SelectItemIndicator",Tp=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Np(Ap,n).isSelected?i.jsx(ve.span,{"aria-hidden":!0,...r,ref:t}):null});Tp.displayName=Ap;var Fa="SelectScrollUpButton",Op=m.forwardRef((e,t)=>{const n=_n(Fa,e.__scopeSelect),r=rc(Fa,e.__scopeSelect),[o,s]=m.useState(!1),a=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollTop>0;s(l)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Dp,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Op.displayName=Fa;var za="SelectScrollDownButton",Pp=m.forwardRef((e,t)=>{const n=_n(za,e.__scopeSelect),r=rc(za,e.__scopeSelect),[o,s]=m.useState(!1),a=Ee(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<l;s(f)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Dp,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Pp.displayName=za;var Dp=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=_n("SelectScrollButton",n),a=m.useRef(null),c=Ws(n),u=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>u(),[u]),Xe(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),i.jsx(ve.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{u()})})}),zj="SelectSeparator",Lj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(ve.div,{"aria-hidden":!0,...r,ref:t})});Lj.displayName=zj;var La="SelectArrow",Bj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hs(n),s=wn(La,n),a=_n(La,n);return s.open&&a.position==="popper"?i.jsx(Zd,{...o,...r,ref:t}):null});Bj.displayName=La;var Vj="SelectBubbleInput",Ip=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=Ee(r,o),a=bj(t);return m.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[a,t]),i.jsx(ve.select,{...n,style:{...fp,...n.style},ref:s,defaultValue:t})});Ip.displayName=Vj;function Mp(e){return e===""||e===void 0}function $p(e){const t=Vt(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const c=n.current+a;t(c),(function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Fp(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Uj(e,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Uj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Wj=mp,Hj=hp,Zj=yp,qj=bp,Yj=vp,Gj=xp,Kj=kp,Jj=jp,Xj=Rp,Qj=Tp,eR=Op,tR=Pp;function Ba({...e}){return i.jsx(Wj,{"data-slot":"select",...e})}function Va({...e}){return i.jsx(Zj,{"data-slot":"select-value",...e})}function Ua({className:e,size:t="default",children:n,...r}){return i.jsxs(Hj,{"data-slot":"select-trigger","data-size":t,className:ae("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,i.jsx(qj,{asChild:!0,children:i.jsx(mu,{className:"size-4 opacity-50"})})]})}function Wa({className:e,children:t,position:n="popper",...r}){return i.jsx(Yj,{children:i.jsxs(Gj,{"data-slot":"select-content",className:ae("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(nR,{}),i.jsx(Kj,{className:ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),i.jsx(rR,{})]})})}function Ha({className:e,children:t,...n}){return i.jsxs(Jj,{"data-slot":"select-item",className:ae("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[i.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:i.jsx(Qj,{children:i.jsx(fu,{className:"size-4"})})}),i.jsx(Xj,{children:t})]})}function nR({className:e,...t}){return i.jsx(eR,{"data-slot":"select-scroll-up-button",className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(ih,{className:"size-4"})})}function rR({className:e,...t}){return i.jsx(tR,{"data-slot":"select-scroll-down-button",className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(mu,{className:"size-4"})})}const oR=[{id:"ssh_host",name:"SSH Host",icon:Tn},{id:"postgresql",name:"PostgreSQL",icon:jt},{id:"mysql",name:"MySQL",icon:jt},{id:"mongodb",name:"MongoDB",icon:jt},{id:"filesystem",name:"Local Path",icon:ds}];function sR({open:e,onOpenChange:t,onSuccess:n}){const r=Re.useQueryClient(),[o,s]=E.useState("ssh_host"),[a,c]=E.useState(""),[u,l]=E.useState({host:"",port:"",path:""}),[f,d]=E.useState({username:"",password:""}),h=Re.useMutation({mutationFn:y=>wm.create(y),onSuccess:y=>{r.invalidateQueries({queryKey:["resources"]}),Ce.success("Custom source created"),n?.(y.id),t(!1),p()},onError:y=>{Ce.error(y.response?.data?.error||"Failed to create source")}}),p=()=>{c(""),s("ssh_host"),l({host:"",port:"",path:""}),d({username:"",password:""})},g=y=>{if(y.preventDefault(),!a)return Ce.error("Please enter a name");const b={...u};h.mutate({name:a,type:o,config:b,credentials:f})};return e?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[i.jsx("div",{className:"absolute inset-0 bg-background/50 backdrop-blur-sm transition-opacity",onClick:()=>t(!1)}),i.jsxs("div",{className:"relative w-full max-w-lg overflow-hidden rounded-xl border bg-card shadow-2xl animate-in fade-in zoom-in duration-200",children:[i.jsxs("div",{className:"flex items-center justify-between border-b px-6 py-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold leading-none tracking-tight",children:"Add Custom Source"}),i.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Add a backup source not managed by the platform."})]}),i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>t(!1),children:i.jsx(ms,{className:"h-4 w-4"})})]}),i.jsxs("form",{onSubmit:g,className:"p-6 space-y-5 max-h-[80vh] overflow-y-auto",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Gt,{htmlFor:"s-name",children:"Source Name"}),i.jsx(Et,{id:"s-name",value:a,onChange:y=>c(y.target.value),placeholder:"Production Database",required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Gt,{htmlFor:"s-type",children:"Type"}),i.jsxs(Ba,{value:o,onValueChange:s,children:[i.jsx(Ua,{id:"s-type",children:i.jsx(Va,{placeholder:"Select type"})}),i.jsx(Wa,{children:oR.map(y=>i.jsx(Ha,{value:y.id,children:y.name},y.id))})]})]}),i.jsxs("div",{className:"space-y-4 border-t pt-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Gt,{htmlFor:"s-host",children:o==="filesystem"?"Base Path":"Host / IP"}),i.jsx(Et,{id:"s-host",value:o==="filesystem"?u.base_path||"":u.host||"",onChange:y=>l(b=>o==="filesystem"?{...b,base_path:y.target.value}:{...b,host:y.target.value}),placeholder:o==="filesystem"?"/var/www/html":"192.168.1.50",required:!0})]}),o!=="filesystem"&&i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Gt,{htmlFor:"s-username",children:"Username"}),i.jsx(Et,{id:"s-username",value:f.username||"",onChange:y=>d(b=>({...b,username:y.target.value})),required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Gt,{htmlFor:"s-password",children:"Password / Key"}),i.jsx(Et,{id:"s-password",type:"password",value:f.password||"",onChange:y=>d(b=>({...b,password:y.target.value})),required:!0})]})]})]})]}),i.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[i.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:h.isPending,children:"Cancel"}),i.jsxs(ge,{type:"submit",disabled:h.isPending,children:[h.isPending&&i.jsx(rt,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Source"]})]})]})]})]}):null}const iu={keep_last:7,keep_daily:14,keep_weekly:8,keep_monthly:12,keep_yearly:0},aR=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6h",value:"0 */6 * * *"},{label:"Daily 2am",value:"0 2 * * *"},{label:"Weekly",value:"0 3 * * 0"},{label:"Monthly",value:"0 4 1 * *"}],cu={ssh:{label:"SSH Host",icon:Tn,color:"text-purple-500"},ssh_host:{label:"SSH Host",icon:Tn,color:"text-purple-500"},ec2:{label:"AWS EC2",icon:Tn,color:"text-orange-500"},rdp:{label:"RDP Desktop",icon:ds,color:"text-blue-500"},database:{label:"Database",icon:jt,color:"text-green-500"},postgresql:{label:"PostgreSQL",icon:jt,color:"text-blue-500"},mysql:{label:"MySQL",icon:jt,color:"text-orange-400"},mongodb:{label:"MongoDB",icon:jt,color:"text-green-500"},filesystem:{label:"Filesystem",icon:Ka,color:"text-orange-500"}},lu={s3:{label:"Amazon S3",icon:kr,color:"text-orange-500",bg:"bg-orange-50 dark:bg-orange-950/30"},gcs:{label:"Google Cloud Storage",icon:kr,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/30"},azure:{label:"Azure Blob",icon:kr,color:"text-cyan-500",bg:"bg-cyan-50 dark:bg-cyan-950/30"},b2:{label:"Backblaze B2",icon:kr,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/30"},sftp:{label:"SFTP Server",icon:ds,color:"text-purple-500",bg:"bg-purple-50 dark:bg-purple-950/30"},local:{label:"Local Filesystem",icon:fs,color:"text-gray-500",bg:"bg-gray-50 dark:bg-gray-950/30"}},iR=[{id:"local",label:"Local Backup",desc:"Run on the Meyi Server. Use for local files or mounted drives.",icon:Tn},{id:"remote_push",label:"Remote Push (SSH)",desc:"Runs Restic on the remote host. Efficient for many files. Requires Restic on host.",icon:pu},{id:"remote_stream",label:"Remote Stream",desc:"Streams data via SSH pipe. No Restic installation needed on source host.",icon:hu}],cR=Bl({name:un().min(1,"Job name is required"),source_id:un().min(1,"Please select a backup source"),source_type:Ta(["platform","local"]),target_id:un().min(1,"Please select a storage target"),backup_path:un().optional(),schedule:un(),scheduleEnabled:zl(),enabled:zl(),retention_policy:Bl({keep_last:_r().min(0),keep_daily:_r().min(0),keep_weekly:_r().min(0),keep_monthly:_r().min(0),keep_yearly:_r().min(0)}),tags:Ra(un()),backup_mode:un(),backup_scope:Ta(["full","specific"]),backup_include_paths:Ra(un())});function Nn({title:e,description:t,children:n,action:r}){return i.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm",children:[i.jsxs("div",{className:"flex items-start justify-between px-6 py-5 border-b",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-base font-semibold tracking-tight",children:e}),t&&i.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),r&&i.jsx("div",{className:"ml-4 shrink-0",children:r})]}),i.jsx("div",{className:"px-6 py-5 space-y-4",children:n})]})}function cs({id:e}){const t=co(),n=e||t.id,r=oc(),o=Re.useQueryClient(),s=!!n&&n!=="new",[a,c]=E.useState(""),[u,l]=E.useState(!1),{data:f,isLoading:d}=Re.useQuery({queryKey:["mc-resources"],queryFn:_m.getAll}),h=Array.isArray(f)?f:[],{data:p,isLoading:g}=Re.useQuery({queryKey:["connectors"],queryFn:nr.getAll}),y=Array.isArray(p)?p:[],{data:b}=Re.useQuery({queryKey:["job",n],queryFn:()=>Ze.get(n),enabled:s&&n!=="new"}),v=aj({resolver:uj(cR),defaultValues:{name:"",source_id:"",source_type:"platform",target_id:"",backup_path:"",schedule:"0 2 * * *",scheduleEnabled:!1,enabled:!0,retention_policy:iu,tags:[],backup_mode:"local",backup_scope:"full",backup_include_paths:[]},mode:"onChange"});E.useEffect(()=>{b&&v.reset({name:b.name||"",source_id:b.source_id??b.sourceId??"",source_type:b.source_type??b.sourceType??"platform",target_id:b.target_id??b.targetId??b.connectorId??b.connector_id??"",backup_path:b.backup_path??b.backupPath??"",schedule:b.schedule||"0 2 * * *",scheduleEnabled:!!b.schedule,enabled:typeof b.enabled=="boolean"?b.enabled:!0,retention_policy:b.retention_policy||b.retentionPolicy||iu,tags:b.tags||[],backup_mode:b.backup_mode??b.backupMode??"local",backup_scope:b.backup_scope??b.backupScope??"full",backup_include_paths:b.backup_include_paths??b.backupIncludePaths??[]})},[b,v]);const w=Re.useMutation({mutationFn:N=>s?Ze.update(n,N):Ze.create(N),onSuccess:()=>{o.invalidateQueries({queryKey:["jobs"]}),r({to:"/jobs"})}});function S(N){const{scheduleEnabled:P,...z}=N;w.mutate({...z,schedule:P?z.schedule:null,backup_path:N.backup_path,source_id:N.source_id,target_id:N.target_id,backup_mode:N.backup_mode,source_type:N.source_type,backup_scope:N.backup_scope,backup_include_paths:N.backup_include_paths,source_name:H?.name})}const _=v.watch("target_id"),C=v.watch("scheduleEnabled"),I=v.watch("schedule"),O=v.watch("tags"),T=v.watch("source_id"),H=h.find(N=>N.id===T),Z=y.find(N=>N.id===_),ne=H&&["ssh","ssh_host","ec2"].includes(H.host_type||H.type);return E.useEffect(()=>{ne&&v.getValues("backup_mode")==="local"?v.setValue("backup_mode","remote_push"):!ne&&v.getValues("backup_mode")!=="local"&&v.setValue("backup_mode","local")},[ne,v]),i.jsxs("div",{className:"max-w-2xl p-2 space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r({to:"/jobs"}),children:i.jsx(Ya,{className:"h-4 w-4"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-bold tracking-tight",children:s?"Edit Backup Job":"New Backup Job"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure what to back up, where, and when"})]})]}),i.jsx(dj,{...v,children:i.jsxs("form",{onSubmit:v.handleSubmit(S),className:"space-y-6 pb-10",children:[i.jsx(Nn,{title:"Job Details",description:"Give your backup job a recognisable name.",children:i.jsx(qt,{control:v.control,name:"name",render:({field:N})=>i.jsxs(St,{children:[i.jsx(Yt,{required:!0,children:"Job Name"}),i.jsx(dn,{children:i.jsx(Et,{placeholder:"e.g. Daily Production Backup",className:"h-9",...N})}),i.jsx(Cn,{children:"This name appears in the Jobs list and in backup logs."}),i.jsx(fn,{})]})})}),i.jsxs(Nn,{title:"Backup Source",description:"Select a Meyi Connect resource or add a custom source to back up.",action:i.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!0),children:[i.jsx(Rt,{className:"h-3.5 w-3.5 mr-1"})," Add Custom"]}),children:[i.jsx(qt,{control:v.control,name:"source_id",render:({field:N})=>i.jsxs(St,{children:[i.jsx(Yt,{required:!0,children:"Resource"}),i.jsxs(Ba,{value:N.value,onValueChange:P=>{N.onChange(P);const z=h.find(G=>G.id===P);z&&v.setValue("source_type",z.origin==="local"?"local":"platform")},disabled:d,children:[i.jsx(dn,{children:i.jsx(Ua,{className:"h-9",children:d?i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"})," ","Loading resources…"]}):i.jsx(Va,{placeholder:"Select a resource to back up"})})}),i.jsx(Wa,{children:h.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No resources found. Connect to Meyi Platform first."}):h.map(P=>{const z=P.host_type||P.type||"ssh",D=(cu[z]??cu.ssh).icon,W=P.origin==="local"?`Local Custom (${z})`:`${P.host||""}${P.port?":"+P.port:""}`;return i.jsx(Ha,{value:P.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(D,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:P.name}),W&&i.jsx("p",{className:"text-muted-foreground text-xs",children:W}),P.origin==="local"&&i.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Custom"})]})},P.id)})})]}),i.jsx(Cn,{children:'Resources from Meyi Connect appear here. Use "Add Custom" to register a source manually.'}),i.jsx(fn,{})]})}),T&&i.jsx(qt,{control:v.control,name:"backup_include_paths",render:({field:N})=>i.jsxs(St,{className:"pt-2",children:[i.jsx(Yt,{children:"Backup Scope"}),i.jsx(dn,{children:i.jsx("textarea",{placeholder:"/",className:"w-full rounded-lg border border-input bg-muted/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none font-mono min-h-[50px]",value:(N.value||[]).join(`
|
|
729
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const c=a[1];if(t===a[0]){s(a);continue}if(e.external){const l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1&&e.reused==="ref"){s(a);continue}}}function Zm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){r(f);const p=e.seen.get(f),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,l),a._zod.parent===f)for(const y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(h.$ref&&p.def)for(const y in u)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(u[y])===JSON.stringify(p.def[y])&&delete u[y]}const d=a._zod.parent;if(d&&d!==f){r(d);const p=e.seen.get(d);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(const h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:rs(t,"input",e.processors),output:rs(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function et(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return et(r.element,n);if(r.type==="set")return et(r.valueType,n);if(r.type==="lazy")return et(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return et(r.innerType,n);if(r.type==="intersection")return et(r.left,n)||et(r.right,n);if(r.type==="record"||r.type==="map")return et(r.keyType,n)||et(r.valueType,n);if(r.type==="pipe")return et(r.in,n)||et(r.out,n);if(r.type==="object"){for(const o in r.shape)if(et(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(et(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(et(o,n))return!0;return!!(r.rest&&et(r.rest,n))}return!1}const oC=(e,t={})=>n=>{const r=Wm({...n,processors:t});return Ye(e,r),Hm(r,e),Zm(r,e)},rs=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},a=Wm({...o??{},target:s,io:t,processors:n});return Ye(e,a),Hm(a,e),Zm(a,e)},sC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aC=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:a,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),c&&(o.format=sC[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),l&&(o.contentEncoding=l),u&&u.size>0){const f=[...u];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},iC=(e,t,n,r)=>{const o=n,{minimum:s,maximum:a,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f),typeof s=="number"&&(o.minimum=s,typeof f=="number"&&t.target!=="draft-04"&&(f>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l),typeof a=="number"&&(o.maximum=a,typeof l=="number"&&t.target!=="draft-04"&&(l<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof u=="number"&&(o.multipleOf=u)},cC=(e,t,n,r)=>{n.type="boolean"},lC=(e,t,n,r)=>{n.not={}},uC=(e,t,n,r)=>{},dC=(e,t,n,r)=>{const o=e._zod.def,s=Cm(o.entries);s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),n.enum=s},fC=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mC=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pC=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=Ye(s.element,t,{...r,path:[...r.path,"items"]})},hC=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const l in a)o.properties[l]=Ye(a[l],t,{...r,path:[...r.path,"properties",l]});const c=new Set(Object.keys(a)),u=new Set([...c].filter(l=>{const f=s.shape[l]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ye(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},gC=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((c,u)=>Ye(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=a:n.anyOf=a},yC=(e,t,n,r)=>{const o=e._zod.def,s=Ye(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=Ye(o.right,t,{...r,path:[...r.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];n.allOf=u},bC=(e,t,n,r)=>{const o=e._zod.def,s=Ye(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},vC=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},xC=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},wC=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},_C=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},SC=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ye(s,t,r);const a=t.seen.get(e);a.ref=s},EC=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Gm=(e,t,n,r)=>{const o=e._zod.def;Ye(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},kC=M("ZodISODateTime",(e,t)=>{Ak.init(e,t),Te.init(e,t)});function NC(e){return DN(kC,e)}const CC=M("ZodISODate",(e,t)=>{Tk.init(e,t),Te.init(e,t)});function jC(e){return $N(CC,e)}const RC=M("ZodISOTime",(e,t)=>{Ok.init(e,t),Te.init(e,t)});function AC(e){return MN(RC,e)}const TC=M("ZodISODuration",(e,t)=>{Pk.init(e,t),Te.init(e,t)});function OC(e){return IN(TC,e)}const PC=(e,t)=>{Wi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>xE(e,n)},flatten:{value:n=>vE(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ca,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ca,2)}},isEmpty:{get(){return e.issues.length===0}}})},bt=M("ZodError",PC,{Parent:Error}),DC=Ms(bt),$C=Is(bt),MC=Fs(bt),IC=zs(bt),FC=kE(bt),zC=NE(bt),LC=CE(bt),VC=jE(bt),BC=RE(bt),UC=AE(bt),qC=TE(bt),WC=OE(bt),Fe=M("ZodType",(e,t)=>(Ie.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rs(e,"input"),output:rs(e,"output")}}),e.toJSONSchema=oC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(vn(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>xn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>DC(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>MC(e,n,r),e.parseAsync=async(n,r)=>$C(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>IC(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>FC(e,n,r),e.decode=(n,r)=>zC(e,n,r),e.encodeAsync=async(n,r)=>LC(e,n,r),e.decodeAsync=async(n,r)=>VC(e,n,r),e.safeEncode=(n,r)=>BC(e,n,r),e.safeDecode=(n,r)=>UC(e,n,r),e.safeEncodeAsync=async(n,r)=>qC(e,n,r),e.safeDecodeAsync=async(n,r)=>WC(e,n,r),e.refine=(n,r)=>e.check(I2(n,r)),e.superRefine=n=>e.check(F2(n)),e.overwrite=n=>e.check(dr(n)),e.optional=()=>Bl(e),e.exactOptional=()=>E2(e),e.nullable=()=>Ul(e),e.nullish=()=>Bl(Ul(e)),e.nonoptional=n=>A2(e,n),e.array=()=>Ra(e),e.or=n=>b2([e,n]),e.and=n=>x2(e,n),e.transform=n=>ql(e,_2(n)),e.default=n=>C2(e,n),e.prefault=n=>R2(e,n),e.catch=n=>O2(e,n),e.pipe=n=>ql(e,n),e.readonly=()=>$2(e),e.describe=n=>{const r=e.clone();return Nr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Nr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Nr.get(e);const r=e.clone();return Nr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Ym=M("_ZodString",(e,t)=>{Hi.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>aC(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(UN(...r)),e.includes=(...r)=>e.check(HN(...r)),e.startsWith=(...r)=>e.check(ZN(...r)),e.endsWith=(...r)=>e.check(GN(...r)),e.min=(...r)=>e.check(ns(...r)),e.max=(...r)=>e.check(Um(...r)),e.length=(...r)=>e.check(qm(...r)),e.nonempty=(...r)=>e.check(ns(1,...r)),e.lowercase=r=>e.check(qN(r)),e.uppercase=r=>e.check(WN(r)),e.trim=()=>e.check(KN()),e.normalize=(...r)=>e.check(YN(...r)),e.toLowerCase=()=>e.check(JN()),e.toUpperCase=()=>e.check(XN()),e.slugify=()=>e.check(QN())}),HC=M("ZodString",(e,t)=>{Hi.init(e,t),Ym.init(e,t),e.email=n=>e.check(mN(ZC,n)),e.url=n=>e.check(bN(GC,n)),e.jwt=n=>e.check(PN(l2,n)),e.emoji=n=>e.check(vN(YC,n)),e.guid=n=>e.check(Pl(Il,n)),e.uuid=n=>e.check(pN(Ao,n)),e.uuidv4=n=>e.check(hN(Ao,n)),e.uuidv6=n=>e.check(gN(Ao,n)),e.uuidv7=n=>e.check(yN(Ao,n)),e.nanoid=n=>e.check(xN(KC,n)),e.guid=n=>e.check(Pl(Il,n)),e.cuid=n=>e.check(wN(JC,n)),e.cuid2=n=>e.check(_N(XC,n)),e.ulid=n=>e.check(SN(QC,n)),e.base64=n=>e.check(AN(a2,n)),e.base64url=n=>e.check(TN(i2,n)),e.xid=n=>e.check(EN(e2,n)),e.ksuid=n=>e.check(kN(t2,n)),e.ipv4=n=>e.check(NN(n2,n)),e.ipv6=n=>e.check(CN(r2,n)),e.cidrv4=n=>e.check(jN(o2,n)),e.cidrv6=n=>e.check(RN(s2,n)),e.e164=n=>e.check(ON(c2,n)),e.datetime=n=>e.check(NC(n)),e.date=n=>e.check(jC(n)),e.time=n=>e.check(AC(n)),e.duration=n=>e.check(OC(n))});function un(e){return fN(HC,e)}const Te=M("ZodStringFormat",(e,t)=>{Ae.init(e,t),Ym.init(e,t)}),ZC=M("ZodEmail",(e,t)=>{wk.init(e,t),Te.init(e,t)}),Il=M("ZodGUID",(e,t)=>{vk.init(e,t),Te.init(e,t)}),Ao=M("ZodUUID",(e,t)=>{xk.init(e,t),Te.init(e,t)}),GC=M("ZodURL",(e,t)=>{_k.init(e,t),Te.init(e,t)}),YC=M("ZodEmoji",(e,t)=>{Sk.init(e,t),Te.init(e,t)}),KC=M("ZodNanoID",(e,t)=>{Ek.init(e,t),Te.init(e,t)}),JC=M("ZodCUID",(e,t)=>{kk.init(e,t),Te.init(e,t)}),XC=M("ZodCUID2",(e,t)=>{Nk.init(e,t),Te.init(e,t)}),QC=M("ZodULID",(e,t)=>{Ck.init(e,t),Te.init(e,t)}),e2=M("ZodXID",(e,t)=>{jk.init(e,t),Te.init(e,t)}),t2=M("ZodKSUID",(e,t)=>{Rk.init(e,t),Te.init(e,t)}),n2=M("ZodIPv4",(e,t)=>{Dk.init(e,t),Te.init(e,t)}),r2=M("ZodIPv6",(e,t)=>{$k.init(e,t),Te.init(e,t)}),o2=M("ZodCIDRv4",(e,t)=>{Mk.init(e,t),Te.init(e,t)}),s2=M("ZodCIDRv6",(e,t)=>{Ik.init(e,t),Te.init(e,t)}),a2=M("ZodBase64",(e,t)=>{Fk.init(e,t),Te.init(e,t)}),i2=M("ZodBase64URL",(e,t)=>{Lk.init(e,t),Te.init(e,t)}),c2=M("ZodE164",(e,t)=>{Vk.init(e,t),Te.init(e,t)}),l2=M("ZodJWT",(e,t)=>{Uk.init(e,t),Te.init(e,t)}),Km=M("ZodNumber",(e,t)=>{zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>iC(e,r,o),e.gt=(r,o)=>e.check($l(r,o)),e.gte=(r,o)=>e.check(fa(r,o)),e.min=(r,o)=>e.check(fa(r,o)),e.lt=(r,o)=>e.check(Dl(r,o)),e.lte=(r,o)=>e.check(da(r,o)),e.max=(r,o)=>e.check(da(r,o)),e.int=r=>e.check(Fl(r)),e.safe=r=>e.check(Fl(r)),e.positive=r=>e.check($l(0,r)),e.nonnegative=r=>e.check(fa(0,r)),e.negative=r=>e.check(Dl(0,r)),e.nonpositive=r=>e.check(da(0,r)),e.multipleOf=(r,o)=>e.check(Ml(r,o)),e.step=(r,o)=>e.check(Ml(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function _r(e){return FN(Km,e)}const u2=M("ZodNumberFormat",(e,t)=>{qk.init(e,t),Km.init(e,t)});function Fl(e){return zN(u2,e)}const d2=M("ZodBoolean",(e,t)=>{Wk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cC(e,n,r)});function zl(e){return LN(d2,e)}const f2=M("ZodUnknown",(e,t)=>{Hk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uC()});function Ll(){return VN(f2)}const m2=M("ZodNever",(e,t)=>{Zk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lC(e,n,r)});function p2(e){return BN(m2,e)}const h2=M("ZodArray",(e,t)=>{Gk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pC(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(ns(n,r)),e.nonempty=n=>e.check(ns(1,n)),e.max=(n,r)=>e.check(Um(n,r)),e.length=(n,r)=>e.check(qm(n,r)),e.unwrap=()=>e.element});function Ra(e,t){return eC(h2,e,t)}const g2=M("ZodObject",(e,t)=>{Kk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hC(e,n,r,o),Ee(e,"shape",()=>t.shape),e.keyof=()=>Ta(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ll()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ll()}),e.strict=()=>e.clone({...e._zod.def,catchall:p2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>pE(e,n),e.safeExtend=n=>hE(e,n),e.merge=n=>gE(e,n),e.pick=n=>fE(e,n),e.omit=n=>mE(e,n),e.partial=(...n)=>yE(Jm,e,n[0]),e.required=(...n)=>bE(Xm,e,n[0])});function Vl(e,t){const n={type:"object",shape:e??{},...ie(t)};return new g2(n)}const y2=M("ZodUnion",(e,t)=>{Jk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gC(e,n,r,o),e.options=t.options});function b2(e,t){return new y2({type:"union",options:e,...ie(t)})}const v2=M("ZodIntersection",(e,t)=>{Xk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yC(e,n,r,o)});function x2(e,t){return new v2({type:"intersection",left:e,right:t})}const Aa=M("ZodEnum",(e,t)=>{Qk.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,s)=>dC(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const a of r)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Aa({...t,checks:[],...ie(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Aa({...t,checks:[],...ie(o),entries:s})}});function Ta(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Aa({type:"enum",entries:n,...ie(t)})}const w2=M("ZodTransform",(e,t)=>{eN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mC(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new km(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Fr(s,n.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Fr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function _2(e){return new w2({type:"transform",transform:e})}const Jm=M("ZodOptional",(e,t)=>{Bm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gm(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new Jm({type:"optional",innerType:e})}const S2=M("ZodExactOptional",(e,t)=>{tN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gm(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function E2(e){return new S2({type:"optional",innerType:e})}const k2=M("ZodNullable",(e,t)=>{nN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bC(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ul(e){return new k2({type:"nullable",innerType:e})}const N2=M("ZodDefault",(e,t)=>{rN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xC(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function C2(e,t){return new N2({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Rm(t)}})}const j2=M("ZodPrefault",(e,t)=>{oN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wC(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function R2(e,t){return new j2({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Rm(t)}})}const Xm=M("ZodNonOptional",(e,t)=>{sN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vC(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function A2(e,t){return new Xm({type:"nonoptional",innerType:e,...ie(t)})}const T2=M("ZodCatch",(e,t)=>{aN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_C(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function O2(e,t){return new T2({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const P2=M("ZodPipe",(e,t)=>{iN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SC(e,n,r,o),e.in=t.in,e.out=t.out});function ql(e,t){return new P2({type:"pipe",in:e,out:t})}const D2=M("ZodReadonly",(e,t)=>{cN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EC(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $2(e){return new D2({type:"readonly",innerType:e})}const M2=M("ZodCustom",(e,t)=>{lN.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fC(e,n)});function I2(e,t={}){return tC(M2,e,t)}function F2(e){return nC(e)}var io=e=>e.type==="checkbox",An=e=>e instanceof Date,at=e=>e==null;const Qm=e=>typeof e=="object";var Ve=e=>!at(e)&&!Array.isArray(e)&&Qm(e)&&!An(e),ep=e=>Ve(e)&&e.target?io(e.target)?e.target.checked:e.target.value:e,z2=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,tp=(e,t)=>e.has(z2(t)),L2=e=>{const t=e.constructor&&e.constructor.prototype;return Ve(t)&&t.hasOwnProperty("isPrototypeOf")},Zi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ze(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Zi&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Ve(e)&&L2(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=ze(e[o]));return r}var Vs=e=>/^\w*$/.test(e),je=e=>e===void 0,Gi=e=>Array.isArray(e)?e.filter(Boolean):[],Yi=e=>Gi(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Z=(e,t,n)=>{if(!t||!Ve(e))return n;const r=(Vs(t)?[t]:Yi(t)).reduce((o,s)=>at(o)?o:o[s],e);return je(r)||r===e?je(e[t])?n:e[t]:r},dt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=Vs(t)?[t]:Yi(t),s=o.length,a=s-1;for(;++r<s;){const c=o[r];let u=n;if(r!==a){const l=e[c];u=Ve(l)||Array.isArray(l)?l:isNaN(+o[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=u,e=e[c]}};const os={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Nt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ht={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ki=k.createContext(null);Ki.displayName="HookFormControlContext";const Ji=()=>k.useContext(Ki);var np=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const a=s;return t._proxyFormState[a]!==Nt.all&&(t._proxyFormState[a]=!r||Nt.all),n&&(n[a]=!0),e[a]}});return o};const Xi=typeof window<"u"?k.useLayoutEffect:k.useEffect;function rp(e){const t=Ji(),{control:n=t,disabled:r,name:o,exact:s}=e||{},[a,c]=k.useState(n._formState),u=k.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Xi(()=>n._subscribe({name:o,formState:u.current,exact:s,callback:l=>{!r&&c({...n._formState,...l})}}),[o,r,s]),k.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),k.useMemo(()=>np(a,n,u.current,!1),[a,n])}var mt=e=>typeof e=="string",Oa=(e,t,n,r,o)=>mt(e)?(r&&t.watch.add(e),Z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),Z(n,s))):(r&&(t.watchAll=!0),n),Pa=e=>at(e)||!Qm(e);function Ct(e,t,n=new WeakSet){if(Pa(e)||Pa(t))return Object.is(e,t);if(An(e)&&An(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const a=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const c=t[s];if(An(a)&&An(c)||Ve(a)&&Ve(c)||Array.isArray(a)&&Array.isArray(c)?!Ct(a,c,n):!Object.is(a,c))return!1}}return!0}function V2(e){const t=Ji(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:a,compute:c}=e||{},u=k.useRef(o),l=k.useRef(c),f=k.useRef(void 0),d=k.useRef(n),p=k.useRef(r);l.current=c;const[h,g]=k.useState(()=>{const _=n._getWatch(r,u.current);return l.current?l.current(_):_}),y=k.useCallback(_=>{const N=Oa(r,n._names,_||n._formValues,!1,u.current);return l.current?l.current(N):N},[n._formValues,n._names,r]),b=k.useCallback(_=>{if(!s){const N=Oa(r,n._names,_||n._formValues,!1,u.current);if(l.current){const $=l.current(N);Ct($,f.current)||(g($),f.current=$)}else g(N)}},[n._formValues,n._names,s,r]);Xi(()=>((d.current!==n||!Ct(p.current,r))&&(d.current=n,p.current=r,b()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:_=>{b(_.values)}})),[n,a,r,b]),k.useEffect(()=>n._removeUnmounted());const v=d.current!==n,w=p.current,S=k.useMemo(()=>{if(s)return null;const _=!v&&!Ct(w,r);return v||_?y():null},[s,v,r,w,y]);return S!==null?S:h}function B2(e){const t=Ji(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:a,exact:c=!0}=e,u=tp(o._names.array,n),l=k.useMemo(()=>Z(o._formValues,n,Z(o._defaultValues,n,a)),[o,n,a]),f=V2({control:o,name:n,defaultValue:l,exact:c}),d=rp({control:o,name:n,exact:c}),p=k.useRef(e),h=k.useRef(void 0),g=k.useRef(o.register(n,{...e.rules,value:f,...dt(e.disabled)?{disabled:e.disabled}:{}}));p.current=e;const y=k.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(d.validatingFields,n)},error:{enumerable:!0,get:()=>Z(d.errors,n)}}),[d,n]),b=k.useCallback(_=>g.current.onChange({target:{value:ep(_),name:n},type:os.CHANGE}),[n]),v=k.useCallback(()=>g.current.onBlur({target:{value:Z(o._formValues,n),name:n},type:os.BLUR}),[n,o._formValues]),w=k.useCallback(_=>{const N=Z(o._fields,n);N&&N._f&&_&&(N._f.ref={focus:()=>nt(_.focus)&&_.focus(),select:()=>nt(_.select)&&_.select(),setCustomValidity:$=>nt(_.setCustomValidity)&&_.setCustomValidity($),reportValidity:()=>nt(_.reportValidity)&&_.reportValidity()})},[o._fields,n]),S=k.useMemo(()=>({name:n,value:f,...dt(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:b,onBlur:v,ref:w}),[n,r,d.disabled,b,v,w,f]);return k.useEffect(()=>{const _=o._options.shouldUnregister||s,N=h.current;N&&N!==n&&!u&&o.unregister(N),o.register(n,{...p.current.rules,...dt(p.current.disabled)?{disabled:p.current.disabled}:{}});const $=(O,T)=>{const W=Z(o._fields,O);W&&W._f&&(W._f.mount=T)};if($(n,!0),_){const O=ze(Z(o._options.defaultValues,n,p.current.defaultValue));_e(o._defaultValues,n,O),je(Z(o._formValues,n))&&_e(o._formValues,n,O)}return!u&&o.register(n),h.current=n,()=>{(u?_&&!o._state.action:_)?o.unregister(n):$(n,!1)}},[n,o,u,s]),k.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),k.useMemo(()=>({field:S,formState:d,fieldState:y}),[S,d,y])}const U2=e=>e.render(B2(e)),Qi=k.createContext(null);Qi.displayName="HookFormContext";const q2=()=>k.useContext(Qi),W2=e=>{const{children:t,watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:a,setValue:c,trigger:u,formState:l,resetField:f,reset:d,handleSubmit:p,unregister:h,control:g,register:y,setFocus:b,subscribe:v}=e;return k.createElement(Qi.Provider,{value:k.useMemo(()=>({watch:n,getValues:r,getFieldState:o,setError:s,clearErrors:a,setValue:c,trigger:u,formState:l,resetField:f,reset:d,handleSubmit:p,unregister:h,control:g,register:y,setFocus:b,subscribe:v}),[a,g,l,o,r,p,y,d,f,s,b,c,v,u,h,n])},k.createElement(Ki.Provider,{value:g},t))};var ec=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Rr=e=>Array.isArray(e)?e:[e],Wl=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function op(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],s=t[r];if(o&&Ve(o)&&s){const a=op(o,s);Ve(a)&&(n[r]=a)}else e[r]&&(n[r]=s)}return n}var tt=e=>Ve(e)&&!Object.keys(e).length,tc=e=>e.type==="file",ss=e=>{if(!Zi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},sp=e=>e.type==="select-multiple",nc=e=>e.type==="radio",H2=e=>nc(e)||io(e),ma=e=>ss(e)&&e.isConnected;function Z2(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=je(e)?r++:e[t[r++]];return e}function G2(e){for(const t in e)if(e.hasOwnProperty(t)&&!je(e[t]))return!1;return!0}function Le(e,t){const n=Array.isArray(t)?t:Vs(t)?[t]:Yi(t),r=n.length===1?e:Z2(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ve(r)&&tt(r)||Array.isArray(r)&&G2(r))&&Le(e,n.slice(0,-1)),e}var Y2=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function ap(e){return Array.isArray(e)||Ve(e)&&!Y2(e)}function Da(e,t={}){for(const n in e){const r=e[n];ap(r)?(t[n]=Array.isArray(r)?[]:{},Da(r,t[n])):je(r)||(t[n]=!0)}return t}function Kn(e,t,n){n||(n=Da(t));for(const r in e){const o=e[r];if(ap(o))je(t)||Pa(n[r])?n[r]=Da(o,Array.isArray(o)?[]:{}):Kn(o,at(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!Ct(o,s)}}return n}const Hl={value:!1,isValid:!1},Zl={value:!0,isValid:!0};var ip=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!je(e[0].attributes.value)?je(e[0].value)||e[0].value===""?Zl:{value:e[0].value,isValid:!0}:Zl:Hl}return Hl},cp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>je(e)?e:t?e===""?NaN:e&&+e:n&&mt(e)?new Date(e):r?r(e):e;const Gl={isValid:!1,value:null};var lp=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Gl):Gl;function Yl(e){const t=e.ref;return tc(t)?t.files:nc(t)?lp(e.refs).value:sp(t)?[...t.selectedOptions].map(({value:n})=>n):io(t)?ip(e.refs).value:cp(je(t.value)?e.ref.value:t.value,e)}var K2=(e,t,n,r)=>{const o={};for(const s of e){const a=Z(t,s);a&&_e(o,s,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},as=e=>e instanceof RegExp,Sr=e=>je(e)?e:as(e)?e.source:Ve(e)?as(e.value)?e.value.source:e.value:e,Kl=e=>({isOnSubmit:!e||e===Nt.onSubmit,isOnBlur:e===Nt.onBlur,isOnChange:e===Nt.onChange,isOnAll:e===Nt.all,isOnTouch:e===Nt.onTouched});const Jl="AsyncFunction";var J2=e=>!!e&&!!e.validate&&!!(nt(e.validate)&&e.validate.constructor.name===Jl||Ve(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Jl)),X2=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Xl=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ar=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=Z(e,o);if(s){const{_f:a,...c}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(Ar(c,t))break}else if(Ve(c)&&Ar(c,t))break}}};function Ql(e,t,n){const r=Z(e,n);if(r||Vs(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),a=Z(t,s),c=Z(e,s);if(a&&!Array.isArray(a)&&n!==s)return{name:n};if(c&&c.type)return{name:s,error:c};if(c&&c.root&&c.root.type)return{name:`${s}.root`,error:c.root};o.pop()}return{name:n}}var Q2=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return tt(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!r||Nt.all))},ej=(e,t,n)=>!e||!t||e===t||Rr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),tj=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,nj=(e,t)=>!Gi(Z(e,t)).length&&Le(e,t),rj=(e,t,n)=>{const r=Rr(Z(e,n));return _e(r,"root",t[n]),_e(e,n,r),e};function eu(e,t,n="validate"){if(mt(e)||Array.isArray(e)&&e.every(mt)||dt(e)&&!e)return{type:n,message:mt(e)?e:"",ref:t}}var Yn=e=>Ve(e)&&!as(e)?e:{value:e,message:""},tu=async(e,t,n,r,o,s)=>{const{ref:a,refs:c,required:u,maxLength:l,minLength:f,min:d,max:p,pattern:h,validate:g,name:y,valueAsNumber:b,mount:v}=e._f,w=Z(n,y);if(!v||t.has(y))return{};const S=c?c[0]:a,_=C=>{o&&S.reportValidity&&(S.setCustomValidity(dt(C)?"":C||""),S.reportValidity())},N={},$=nc(a),O=io(a),T=$||O,W=(b||tc(a))&&je(a.value)&&je(w)||ss(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,H=ec.bind(null,y,r,N),ne=(C,P,z,Y=Ht.maxLength,D=Ht.minLength)=>{const q=C?P:z;N[y]={type:C?Y:D,message:q,ref:a,...H(C?Y:D,q)}};if(s?!Array.isArray(w)||!w.length:u&&(!T&&(W||at(w))||dt(w)&&!w||O&&!ip(c).isValid||$&&!lp(c).isValid)){const{value:C,message:P}=mt(u)?{value:!!u,message:u}:Yn(u);if(C&&(N[y]={type:Ht.required,message:P,ref:S,...H(Ht.required,P)},!r))return _(P),N}if(!W&&(!at(d)||!at(p))){let C,P;const z=Yn(p),Y=Yn(d);if(!at(w)&&!isNaN(w)){const D=a.valueAsNumber||w&&+w;at(z.value)||(C=D>z.value),at(Y.value)||(P=D<Y.value)}else{const D=a.valueAsDate||new Date(w),q=F=>new Date(new Date().toDateString()+" "+F),B=a.type=="time",V=a.type=="week";mt(z.value)&&w&&(C=B?q(w)>q(z.value):V?w>z.value:D>new Date(z.value)),mt(Y.value)&&w&&(P=B?q(w)<q(Y.value):V?w<Y.value:D<new Date(Y.value))}if((C||P)&&(ne(!!C,z.message,Y.message,Ht.max,Ht.min),!r))return _(N[y].message),N}if((l||f)&&!W&&(mt(w)||s&&Array.isArray(w))){const C=Yn(l),P=Yn(f),z=!at(C.value)&&w.length>+C.value,Y=!at(P.value)&&w.length<+P.value;if((z||Y)&&(ne(z,C.message,P.message),!r))return _(N[y].message),N}if(h&&!W&&mt(w)){const{value:C,message:P}=Yn(h);if(as(C)&&!w.match(C)&&(N[y]={type:Ht.pattern,message:P,ref:a,...H(Ht.pattern,P)},!r))return _(P),N}if(g){if(nt(g)){const C=await g(w,n),P=eu(C,S);if(P&&(N[y]={...P,...H(Ht.validate,P.message)},!r))return _(P.message),N}else if(Ve(g)){let C={};for(const P in g){if(!tt(C)&&!r)break;const z=eu(await g[P](w,n),S,P);z&&(C={...z,...H(P,z.message)},_(z.message),r&&(N[y]=C))}if(!tt(C)&&(N[y]={ref:S,...C},!r))return N}}return _(!0),N};const oj={mode:Nt.onSubmit,reValidateMode:Nt.onChange,shouldFocusError:!0};function sj(e={}){let t={...oj,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:nt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ve(t.defaultValues)||Ve(t.values)?ze(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ze(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let p={...d};const h={array:Wl(),state:Wl()},g=t.criteriaMode===Nt.all,y=x=>E=>{clearTimeout(l),l=setTimeout(x,E)},b=async x=>{if(!a.keepIsValid&&!t.disabled&&(d.isValid||p.isValid||x)){let E;t.resolver?(E=tt((await T()).errors),v()):E=await H(r,!0),E!==n.isValid&&h.state.next({isValid:E})}},v=(x,E)=>{!t.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((x||Array.from(c.mount)).forEach(A=>{A&&(E?_e(n.validatingFields,A,E):Le(n.validatingFields,A))}),h.state.next({validatingFields:n.validatingFields,isValidating:!tt(n.validatingFields)}))},w=(x,E=[],A,K,U=!0,L=!0)=>{if(K&&A&&!t.disabled){if(a.action=!0,L&&Array.isArray(Z(r,x))){const se=A(Z(r,x),K.argA,K.argB);U&&_e(r,x,se)}if(L&&Array.isArray(Z(n.errors,x))){const se=A(Z(n.errors,x),K.argA,K.argB);U&&_e(n.errors,x,se),nj(n.errors,x)}if((d.touchedFields||p.touchedFields)&&L&&Array.isArray(Z(n.touchedFields,x))){const se=A(Z(n.touchedFields,x),K.argA,K.argB);U&&_e(n.touchedFields,x,se)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Kn(o,s)),h.state.next({name:x,isDirty:C(x,E),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else _e(s,x,E)},S=(x,E)=>{_e(n.errors,x,E),h.state.next({errors:n.errors})},_=x=>{n.errors=x,h.state.next({errors:n.errors,isValid:!1})},N=(x,E,A,K)=>{const U=Z(r,x);if(U){const L=Z(s,x,je(A)?Z(o,x):A);je(L)||K&&K.defaultChecked||E?_e(s,x,E?L:Yl(U._f)):Y(x,L),a.mount&&!a.action&&b()}},$=(x,E,A,K,U)=>{let L=!1,se=!1;const we={name:x};if(!t.disabled){if(!A||K){(d.isDirty||p.isDirty)&&(se=n.isDirty,n.isDirty=we.isDirty=C(),L=se!==we.isDirty);const xe=Ct(Z(o,x),E);se=!!Z(n.dirtyFields,x),xe?Le(n.dirtyFields,x):_e(n.dirtyFields,x,!0),we.dirtyFields=n.dirtyFields,L=L||(d.dirtyFields||p.dirtyFields)&&se!==!xe}if(A){const xe=Z(n.touchedFields,x);xe||(_e(n.touchedFields,x,A),we.touchedFields=n.touchedFields,L=L||(d.touchedFields||p.touchedFields)&&xe!==A)}L&&U&&h.state.next(we)}return L?we:{}},O=(x,E,A,K)=>{const U=Z(n.errors,x),L=(d.isValid||p.isValid)&&dt(E)&&n.isValid!==E;if(t.delayError&&A?(u=y(()=>S(x,A)),u(t.delayError)):(clearTimeout(l),u=null,A?_e(n.errors,x,A):Le(n.errors,x)),(A?!Ct(U,A):U)||!tt(K)||L){const se={...K,...L&&dt(E)?{isValid:E}:{},errors:n.errors,name:x};n={...n,...se},h.state.next(se)}},T=async x=>(v(x,!0),await t.resolver(s,t.context,K2(x||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),W=async x=>{const{errors:E}=await T(x);if(v(x),x)for(const A of x){const K=Z(E,A);K?_e(n.errors,A,K):Le(n.errors,A)}else n.errors=E;return E},H=async(x,E,A={valid:!0})=>{for(const K in x){const U=x[K];if(U){const{_f:L,...se}=U;if(L){const we=c.array.has(L.name),xe=U._f&&J2(U._f);xe&&d.validatingFields&&v([L.name],!0);const Oe=await tu(U,c.disabled,s,g,t.shouldUseNativeValidation&&!E,we);if(xe&&d.validatingFields&&v([L.name]),Oe[L.name]&&(A.valid=!1,E||e.shouldUseNativeValidation))break;!E&&(Z(Oe,L.name)?we?rj(n.errors,Oe,L.name):_e(n.errors,L.name,Oe[L.name]):Le(n.errors,L.name))}!tt(se)&&await H(se,E,A)}}return A.valid},ne=()=>{for(const x of c.unMount){const E=Z(r,x);E&&(E._f.refs?E._f.refs.every(A=>!ma(A)):!ma(E._f.ref))&&Q(x)}c.unMount=new Set},C=(x,E)=>!t.disabled&&(x&&E&&_e(s,x,E),!Ct(R(),o)),P=(x,E,A)=>Oa(x,c,{...a.mount?s:je(E)?o:mt(x)?{[x]:E}:E},A,E),z=x=>Gi(Z(a.mount?s:o,x,t.shouldUnregister?Z(o,x,[]):[])),Y=(x,E,A={})=>{const K=Z(r,x);let U=E;if(K){const L=K._f;L&&(!L.disabled&&_e(s,x,cp(E,L)),U=ss(L.ref)&&at(E)?"":E,sp(L.ref)?[...L.ref.options].forEach(se=>se.selected=U.includes(se.value)):L.refs?io(L.ref)?L.refs.forEach(se=>{(!se.defaultChecked||!se.disabled)&&(Array.isArray(U)?se.checked=!!U.find(we=>we===se.value):se.checked=U===se.value||!!U)}):L.refs.forEach(se=>se.checked=se.value===U):tc(L.ref)?L.ref.value="":(L.ref.value=U,L.ref.type||h.state.next({name:x,values:ze(s)})))}(A.shouldDirty||A.shouldTouch)&&$(x,U,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&F(x)},D=(x,E,A)=>{for(const K in E){if(!E.hasOwnProperty(K))return;const U=E[K],L=x+"."+K,se=Z(r,L);(c.array.has(x)||Ve(U)||se&&!se._f)&&!An(U)?D(L,U,A):Y(L,U,A)}},q=(x,E,A={})=>{const K=Z(r,x),U=c.array.has(x),L=ze(E);_e(s,x,L),U?(h.array.next({name:x,values:ze(s)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&A.shouldDirty&&h.state.next({name:x,dirtyFields:Kn(o,s),isDirty:C(x,L)})):K&&!K._f&&!at(L)?D(x,L,A):Y(x,L,A),Xl(x,c)?h.state.next({...n,name:x,values:ze(s)}):h.state.next({name:a.mount?x:void 0,values:ze(s)})},B=async x=>{a.mount=!0;const E=x.target;let A=E.name,K=!0;const U=Z(r,A),L=xe=>{K=Number.isNaN(xe)||An(xe)&&isNaN(xe.getTime())||Ct(xe,Z(s,A,xe))},se=Kl(t.mode),we=Kl(t.reValidateMode);if(U){let xe,Oe;const It=E.type?Yl(U._f):ep(x),Qe=x.type===os.BLUR||x.type===os.FOCUS_OUT,Hs=!X2(U._f)&&!t.resolver&&!Z(n.errors,A)&&!U._f.deps||tj(Qe,Z(n.touchedFields,A),n.isSubmitted,we,se),pr=Xl(A,c,Qe);_e(s,A,It),Qe?(!E||!E.readOnly)&&(U._f.onBlur&&U._f.onBlur(x),u&&u(0)):U._f.onChange&&U._f.onChange(x);const qn=$(A,It,Qe),fo=!tt(qn)||pr;if(!Qe&&h.state.next({name:A,type:x.type,values:ze(s)}),Hs)return(d.isValid||p.isValid)&&(t.mode==="onBlur"?Qe&&b():Qe||b()),fo&&h.state.next({name:A,...pr?{}:qn});if(!Qe&&pr&&h.state.next({...n}),t.resolver){const{errors:mo}=await T([A]);if(v([A]),L(It),K){const hr=Ql(n.errors,r,A),xt=Ql(mo,r,hr.name||A);xe=xt.error,A=xt.name,Oe=tt(mo)}}else v([A],!0),xe=(await tu(U,c.disabled,s,g,t.shouldUseNativeValidation))[A],v([A]),L(It),K&&(xe?Oe=!1:(d.isValid||p.isValid)&&(Oe=await H(r,!0)));K&&(U._f.deps&&(!Array.isArray(U._f.deps)||U._f.deps.length>0)&&F(U._f.deps),O(A,Oe,xe,qn))}},V=(x,E)=>{if(Z(n.errors,E)&&x.focus)return x.focus(),1},F=async(x,E={})=>{let A,K;const U=Rr(x);if(t.resolver){const L=await W(je(x)?x:U);A=tt(L),K=x?!U.some(se=>Z(L,se)):A}else x?(K=(await Promise.all(U.map(async L=>{const se=Z(r,L);return await H(se&&se._f?{[L]:se}:se)}))).every(Boolean),!(!K&&!n.isValid)&&b()):K=A=await H(r);return h.state.next({...!mt(x)||(d.isValid||p.isValid)&&A!==n.isValid?{}:{name:x},...t.resolver||!x?{isValid:A}:{},errors:n.errors}),E.shouldFocus&&!K&&Ar(r,V,x?U:c.mount),K},R=(x,E)=>{let A={...a.mount?s:o};return E&&(A=op(E.dirtyFields?n.dirtyFields:n.touchedFields,A)),je(x)?A:mt(x)?Z(A,x):x.map(K=>Z(A,K))},J=(x,E)=>({invalid:!!Z((E||n).errors,x),isDirty:!!Z((E||n).dirtyFields,x),error:Z((E||n).errors,x),isValidating:!!Z(n.validatingFields,x),isTouched:!!Z((E||n).touchedFields,x)}),G=x=>{const E=x?Rr(x):void 0;E?.forEach(A=>Le(n.errors,A)),E?E.forEach(A=>{h.state.next({name:A,errors:n.errors})}):h.state.next({errors:{}})},X=(x,E,A)=>{const K=(Z(r,x,{_f:{}})._f||{}).ref,U=Z(n.errors,x)||{},{ref:L,message:se,type:we,...xe}=U;_e(n.errors,x,{...xe,...E,ref:K}),h.state.next({name:x,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&K&&K.focus&&K.focus()},re=(x,E)=>nt(x)?h.state.subscribe({next:A=>"values"in A&&x(P(void 0,E),A)}):P(x,E,!0),ce=x=>h.state.subscribe({next:E=>{ej(x.name,E.name,x.exact)&&Q2(E,x.formState||d,lo,x.reRenderRoot)&&x.callback({values:{...s},...n,...E,defaultValues:o})}}).unsubscribe,I=x=>(a.mount=!0,p={...p,...x.formState},ce({...x,formState:{...f,...x.formState}})),Q=(x,E={})=>{for(const A of x?Rr(x):c.mount)c.mount.delete(A),c.array.delete(A),E.keepValue||(Le(r,A),Le(s,A)),!E.keepError&&Le(n.errors,A),!E.keepDirty&&Le(n.dirtyFields,A),!E.keepTouched&&Le(n.touchedFields,A),!E.keepIsValidating&&Le(n.validatingFields,A),!t.shouldUnregister&&!E.keepDefaultValue&&Le(o,A);h.state.next({values:ze(s)}),h.state.next({...n,...E.keepDirty?{isDirty:C()}:{}}),!E.keepIsValid&&b()},le=({disabled:x,name:E})=>{if(dt(x)&&a.mount||x||c.disabled.has(E)){const U=c.disabled.has(E)!==!!x;x?c.disabled.add(E):c.disabled.delete(E),U&&a.mount&&!a.action&&b()}},me=(x,E={})=>{let A=Z(r,x);const K=dt(E.disabled)||dt(t.disabled);return _e(r,x,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:x}},name:x,mount:!0,...E}}),c.mount.add(x),A?le({disabled:dt(E.disabled)?E.disabled:t.disabled,name:x}):N(x,!0,E.value),{...K?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:Sr(E.min),max:Sr(E.max),minLength:Sr(E.minLength),maxLength:Sr(E.maxLength),pattern:Sr(E.pattern)}:{},name:x,onChange:B,onBlur:B,ref:U=>{if(U){me(x,E),A=Z(r,x);const L=je(U.value)&&U.querySelectorAll&&U.querySelectorAll("input,select,textarea")[0]||U,se=H2(L),we=A._f.refs||[];if(se?we.find(xe=>xe===L):L===A._f.ref)return;_e(r,x,{_f:{...A._f,...se?{refs:[...we.filter(ma),L,...Array.isArray(Z(o,x))?[{}]:[]],ref:{type:L.type,name:x}}:{ref:L}}}),N(x,!1,void 0,L)}else A=Z(r,x,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(tp(c.array,x)&&a.action)&&c.unMount.add(x)}}},he=()=>t.shouldFocusError&&Ar(r,V,c.mount),be=x=>{dt(x)&&(h.state.next({disabled:x}),Ar(r,(E,A)=>{const K=Z(r,A);K&&(E.disabled=K._f.disabled||x,Array.isArray(K._f.refs)&&K._f.refs.forEach(U=>{U.disabled=K._f.disabled||x}))},0,!1))},De=(x,E)=>async A=>{let K;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let U=ze(s);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:L,values:se}=await T();v(),n.errors=L,U=ze(se)}else await H(r);if(c.disabled.size)for(const L of c.disabled)Le(U,L);if(Le(n.errors,"root"),tt(n.errors)){h.state.next({errors:{}});try{await x(U,A)}catch(L){K=L}}else E&&await E({...n.errors},A),he(),setTimeout(he);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tt(n.errors)&&!K,submitCount:n.submitCount+1,errors:n.errors}),K)throw K},qe=(x,E={})=>{Z(r,x)&&(je(E.defaultValue)?q(x,ze(Z(o,x))):(q(x,E.defaultValue),_e(o,x,ze(E.defaultValue))),E.keepTouched||Le(n.touchedFields,x),E.keepDirty||(Le(n.dirtyFields,x),n.isDirty=E.defaultValue?C(x,ze(Z(o,x))):C()),E.keepError||(Le(n.errors,x),d.isValid&&b()),h.state.next({...n}))},sn=(x,E={})=>{const A=x?ze(x):o,K=ze(A),U=tt(x),L=U?o:K;if(E.keepDefaultValues||(o=A),!E.keepValues){if(E.keepDirtyValues){const se=new Set([...c.mount,...Object.keys(Kn(o,s))]);for(const we of Array.from(se)){const xe=Z(n.dirtyFields,we),Oe=Z(s,we),It=Z(L,we);xe&&!je(Oe)?_e(L,we,Oe):!xe&&!je(It)&&q(we,It)}}else{if(Zi&&je(x))for(const se of c.mount){const we=Z(r,se);if(we&&we._f){const xe=Array.isArray(we._f.refs)?we._f.refs[0]:we._f.ref;if(ss(xe)){const Oe=xe.closest("form");if(Oe){Oe.reset();break}}}}if(E.keepFieldsRef)for(const se of c.mount)q(se,Z(L,se));else r={}}s=t.shouldUnregister?E.keepDefaultValues?ze(o):{}:ze(L),h.array.next({values:{...L}}),h.state.next({values:{...L}})}c={mount:E.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!E.keepIsValid||!!E.keepDirtyValues||!t.shouldUnregister&&!tt(L),a.watch=!!t.shouldUnregister,a.keepIsValid=!!E.keepIsValid,a.action=!1,E.keepErrors||(n.errors={}),h.state.next({submitCount:E.keepSubmitCount?n.submitCount:0,isDirty:U?!1:E.keepDirty?n.isDirty:!!(E.keepDefaultValues&&!Ct(x,o)),isSubmitted:E.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:U?{}:E.keepDirtyValues?E.keepDefaultValues&&s?Kn(o,s):n.dirtyFields:E.keepDefaultValues&&x?Kn(o,x):E.keepDirty?n.dirtyFields:{},touchedFields:E.keepTouched?n.touchedFields:{},errors:E.keepErrors?n.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},qt=(x,E)=>sn(nt(x)?x(s):x,{...t.resetOptions,...E}),vt=(x,E={})=>{const A=Z(r,x),K=A&&A._f;if(K){const U=K.refs?K.refs[0]:K.ref;U.focus&&setTimeout(()=>{U.focus(),E.shouldSelect&&nt(U.select)&&U.select()})}},lo=x=>{n={...n,...x}},uo={control:{register:me,unregister:Q,getFieldState:J,handleSubmit:De,setError:X,_subscribe:ce,_runSchema:T,_updateIsValidating:v,_focusError:he,_getWatch:P,_getDirty:C,_setValid:b,_setFieldArray:w,_setDisabledField:le,_setErrors:_,_getFieldArray:z,_reset:sn,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(x=>{qt(x,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:ne,_disableForm:be,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(x){a=x},get _defaultValues(){return o},get _names(){return c},set _names(x){c=x},get _formState(){return n},get _options(){return t},set _options(x){t={...t,...x}}},subscribe:I,trigger:F,register:me,handleSubmit:De,watch:re,setValue:q,getValues:R,reset:qt,resetField:qe,clearErrors:G,unregister:Q,setError:X,setFocus:vt,getFieldState:J};return{...uo,formControl:uo}}function aj(e={}){const t=k.useRef(void 0),n=k.useRef(void 0),[r,o]=k.useState({isDirty:!1,isValidating:!1,isLoading:nt(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:nt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=sj(e);t.current={...c,formState:r}}const s=t.current.control;return s._options=e,Xi(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),s._formState.isReady=!0,a},[s]),k.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),k.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),k.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),k.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),k.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==r.isDirty&&s._subjects.state.next({isDirty:a})}},[s,r.isDirty]),k.useEffect(()=>{var a;e.values&&!Ct(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((a=s._options.resetOptions)===null||a===void 0)&&a.keepIsValid||s._setValid(),n.current=e.values,o(c=>({...c}))):s._resetDefaultValues()},[s,e.values]),k.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=k.useMemo(()=>np(r,s),[s,r]),t.current}const nu=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Z(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},$a=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?nu(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>nu(o,n,e))}},ru=(e,t)=>{t.shouldUseNativeValidation&&$a(e,t);const n={};for(const r in e){const o=Z(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(ij(t.names||Object.keys(e),r)){const a=Object.assign({},Z(n,r));_e(a,"root",s),_e(n,r,a)}else _e(n,r,s)}return n},ij=(e,t)=>{const n=ou(t);return e.some(r=>ou(r).match(`^${n}\\.\\d+`))};function ou(e){return e.replace(/\]|\[/g,"")}function su(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function cj(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=ec(a,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function lj(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,a=r.path.join(".");if(!n[a])if(r.code==="invalid_union"&&r.errors.length>0){var c=r.errors[0][0];n[a]={message:c.message,type:c.code}}else n[a]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(f){return f.forEach(function(d){return e.push(d)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=ec(a,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function uj(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(su(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(a){return s.shouldUseNativeValidation&&$a({},s),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return Array.isArray(c?.issues)})(a))return{values:{},errors:ru(cj(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(su(function(){return Promise.resolve((n.mode==="sync"?wE:_E)(e,r,t)).then(function(a){return s.shouldUseNativeValidation&&$a({},s),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return c instanceof Wi})(a))return{values:{},errors:ru(lj(a.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const dj=W2,up=m.createContext({}),Zt=({...e})=>i.jsx(up.Provider,{value:{name:e.name},children:i.jsx(U2,{...e})}),Bs=()=>{const e=m.useContext(up),t=m.useContext(dp),{getFieldState:n}=q2(),r=rp({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},dp=m.createContext({});function St({className:e,...t}){const n=m.useId();return i.jsx(dp.Provider,{value:{id:n},children:i.jsx("div",{"data-slot":"form-item",className:ae("grid gap-2",e),...t})})}function Gt({className:e,children:t,required:n,...r}){const{error:o,formItemId:s}=Bs();return i.jsxs(Yt,{"data-slot":"form-label","data-error":!!o,className:e,htmlFor:s,...r,children:[t,n&&i.jsx("span",{className:"text-destructive",children:"*"})]})}function dn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Bs();return i.jsx(di,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function Nn({className:e,...t}){const{formDescriptionId:n}=Bs();return i.jsx("p",{"data-slot":"form-description",id:n,className:ae("text-muted-foreground text-sm",e),...t})}function fn({className:e,...t}){const{error:n,formMessageId:r}=Bs(),o=n?String(n?.message??""):t.children;return o?i.jsx("p",{"data-slot":"form-message",id:r,className:ae("text-destructive text-sm",e),...t,children:o}):null}function au(e,[t,n]){return Math.min(n,Math.max(t,e))}function fj(e){const t=mj(e),n=m.forwardRef((r,o)=>{const{children:s,...a}=r,c=m.Children.toArray(s),u=c.find(hj);if(u){const l=u.props.children,f=c.map(d=>d===u?m.Children.count(l)>1?m.Children.only(null):m.isValidElement(l)?l.props.children:null:d);return i.jsx(t,{...a,ref:o,children:m.isValidElement(l)?m.cloneElement(l,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function mj(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const a=yj(o),c=gj(s,o.props);return o.type!==m.Fragment&&(c.ref=r?tn(r,a):a),m.cloneElement(o,c)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pj=Symbol("radix.slottable");function hj(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pj}function gj(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function yj(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bj(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fp=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"}),vj="VisuallyHidden",xj=m.forwardRef((e,t)=>i.jsx(ve.span,{...e,ref:t,style:{...fp,...e.style}}));xj.displayName=vj;var wj=[" ","Enter","ArrowUp","ArrowDown"],_j=[" ","Enter"],Fn="Select",[Us,qs,Sj]=mi(Fn),[fr]=yn(Fn,[Sj,Ns]),Ws=Ns(),[Ej,wn]=fr(Fn),[kj,Nj]=fr(Fn),mp=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:c,onValueChange:u,dir:l,name:f,autoComplete:d,disabled:p,required:h,form:g}=e,y=Ws(t),[b,v]=m.useState(null),[w,S]=m.useState(null),[_,N]=m.useState(!1),$=pi(l),[O,T]=Pr({prop:r,defaultProp:o??!1,onChange:s,caller:Fn}),[W,H]=Pr({prop:a,defaultProp:c,onChange:u,caller:Fn}),ne=m.useRef(null),C=b?g||!!b.closest("form"):!0,[P,z]=m.useState(new Set),Y=Array.from(P).map(D=>D.props.value).join(";");return i.jsx(Ud,{...y,children:i.jsxs(Ej,{required:h,scope:t,trigger:b,onTriggerChange:v,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:_,onValueNodeHasChildrenChange:N,contentId:Kt(),value:W,onValueChange:H,open:O,onOpenChange:T,dir:$,triggerPointerDownPosRef:ne,disabled:p,children:[i.jsx(Us.Provider,{scope:t,children:i.jsx(kj,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(D=>{z(q=>new Set(q).add(D))},[]),onNativeOptionRemove:m.useCallback(D=>{z(q=>{const B=new Set(q);return B.delete(D),B})},[]),children:n})}),C?i.jsxs($p,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:W,onChange:D=>H(D.target.value),disabled:p,form:g,children:[W===void 0?i.jsx("option",{value:""}):null,Array.from(P)]},Y):null]})})};mp.displayName=Fn;var pp="SelectTrigger",hp=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Ws(n),a=wn(pp,n),c=a.disabled||r,u=ke(t,a.onTriggerChange),l=qs(n),f=m.useRef("touch"),[d,p,h]=Ip(y=>{const b=l().filter(S=>!S.disabled),v=b.find(S=>S.value===a.value),w=Fp(b,y,v);w!==void 0&&a.onValueChange(w.value)}),g=y=>{c||(a.onOpenChange(!0),h()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return i.jsx(qd,{asChild:!0,...s,children:i.jsx(ve.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Mp(a.value)?"":void 0,...o,ref:u,onClick:oe(o.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&g(y)}),onPointerDown:oe(o.onPointerDown,y=>{f.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(g(y),y.preventDefault())}),onKeyDown:oe(o.onKeyDown,y=>{const b=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(b&&y.key===" ")&&wj.includes(y.key)&&(g(),y.preventDefault())})})})});hp.displayName=pp;var gp="SelectValue",yp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...c}=e,u=wn(gp,n),{onValueNodeHasChildrenChange:l}=u,f=s!==void 0,d=ke(t,u.onValueNodeChange);return Xe(()=>{l(f)},[l,f]),i.jsx(ve.span,{...c,ref:d,style:{pointerEvents:"none"},children:Mp(u.value)?i.jsx(i.Fragment,{children:a}):s})});yp.displayName=gp;var Cj="SelectIcon",bp=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(ve.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bp.displayName=Cj;var jj="SelectPortal",vp=e=>i.jsx(Cs,{asChild:!0,...e});vp.displayName=jj;var zn="SelectContent",xp=m.forwardRef((e,t)=>{const n=wn(zn,e.__scopeSelect),[r,o]=m.useState();if(Xe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?us.createPortal(i.jsx(wp,{scope:e.__scopeSelect,children:i.jsx(Us.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(_p,{...e,ref:t})});xp.displayName=zn;var Et=10,[wp,_n]=fr(zn),Rj="SelectContentImpl",Aj=fj("SelectContent.RemoveScroll"),_p=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:u,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:b,...v}=e,w=wn(zn,n),[S,_]=m.useState(null),[N,$]=m.useState(null),O=ke(t,I=>_(I)),[T,W]=m.useState(null),[H,ne]=m.useState(null),C=qs(n),[P,z]=m.useState(!1),Y=m.useRef(!1);m.useEffect(()=>{if(S)return Ei(S)},[S]),hi();const D=m.useCallback(I=>{const[Q,...le]=C().map(be=>be.ref.current),[me]=le.slice(-1),he=document.activeElement;for(const be of I)if(be===he||(be?.scrollIntoView({block:"nearest"}),be===Q&&N&&(N.scrollTop=0),be===me&&N&&(N.scrollTop=N.scrollHeight),be?.focus(),document.activeElement!==he))return},[C,N]),q=m.useCallback(()=>D([T,S]),[D,T,S]);m.useEffect(()=>{P&&q()},[P,q]);const{onOpenChange:B,triggerPointerDownPosRef:V}=w;m.useEffect(()=>{if(S){let I={x:0,y:0};const Q=me=>{I={x:Math.abs(Math.round(me.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(V.current?.y??0))}},le=me=>{I.x<=10&&I.y<=10?me.preventDefault():S.contains(me.target)||B(!1),document.removeEventListener("pointermove",Q),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",le,{capture:!0})}}},[S,B,V]),m.useEffect(()=>{const I=()=>B(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[B]);const[F,R]=Ip(I=>{const Q=C().filter(he=>!he.disabled),le=Q.find(he=>he.ref.current===document.activeElement),me=Fp(Q,I,le);me&&setTimeout(()=>me.ref.current.focus())}),J=m.useCallback((I,Q,le)=>{const me=!Y.current&&!le;(w.value!==void 0&&w.value===Q||me)&&(W(I),me&&(Y.current=!0))},[w.value]),G=m.useCallback(()=>S?.focus(),[S]),X=m.useCallback((I,Q,le)=>{const me=!Y.current&&!le;(w.value!==void 0&&w.value===Q||me)&&ne(I)},[w.value]),re=r==="popper"?Ma:Sp,ce=re===Ma?{side:c,sideOffset:u,align:l,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:b}:{};return i.jsx(wp,{scope:n,content:S,viewport:N,onViewportChange:$,itemRefCallback:J,selectedItem:T,onItemLeave:G,itemTextRefCallback:X,focusSelectedItem:q,selectedItemText:H,position:r,isPositioned:P,searchRef:F,children:i.jsx(Rs,{as:Aj,allowPinchZoom:!0,children:i.jsx(ws,{asChild:!0,trapped:w.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:oe(o,I=>{w.trigger?.focus({preventScroll:!0}),I.preventDefault()}),children:i.jsx(xs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:i.jsx(re,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:I=>I.preventDefault(),...v,...ce,onPlaced:()=>z(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:oe(v.onKeyDown,I=>{const Q=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!Q&&I.key.length===1&&R(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let me=C().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(I.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const he=I.target,be=me.indexOf(he);me=me.slice(be+1)}setTimeout(()=>D(me)),I.preventDefault()}})})})})})})});_p.displayName=Rj;var Tj="SelectItemAlignedPosition",Sp=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=wn(zn,n),a=_n(zn,n),[c,u]=m.useState(null),[l,f]=m.useState(null),d=ke(t,O=>f(O)),p=qs(n),h=m.useRef(!1),g=m.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:v,focusSelectedItem:w}=a,S=m.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&l&&y&&b&&v){const O=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),W=s.valueNode.getBoundingClientRect(),H=v.getBoundingClientRect();if(s.dir!=="rtl"){const he=H.left-T.left,be=W.left-he,De=O.left-be,qe=O.width+De,sn=Math.max(qe,T.width),qt=window.innerWidth-Et,vt=au(be,[Et,Math.max(Et,qt-sn)]);c.style.minWidth=qe+"px",c.style.left=vt+"px"}else{const he=T.right-H.right,be=window.innerWidth-W.right-he,De=window.innerWidth-O.right-be,qe=O.width+De,sn=Math.max(qe,T.width),qt=window.innerWidth-Et,vt=au(be,[Et,Math.max(Et,qt-sn)]);c.style.minWidth=qe+"px",c.style.right=vt+"px"}const ne=p(),C=window.innerHeight-Et*2,P=y.scrollHeight,z=window.getComputedStyle(l),Y=parseInt(z.borderTopWidth,10),D=parseInt(z.paddingTop,10),q=parseInt(z.borderBottomWidth,10),B=parseInt(z.paddingBottom,10),V=Y+D+P+B+q,F=Math.min(b.offsetHeight*5,V),R=window.getComputedStyle(y),J=parseInt(R.paddingTop,10),G=parseInt(R.paddingBottom,10),X=O.top+O.height/2-Et,re=C-X,ce=b.offsetHeight/2,I=b.offsetTop+ce,Q=Y+D+I,le=V-Q;if(Q<=X){const he=ne.length>0&&b===ne[ne.length-1].ref.current;c.style.bottom="0px";const be=l.clientHeight-y.offsetTop-y.offsetHeight,De=Math.max(re,ce+(he?G:0)+be+q),qe=Q+De;c.style.height=qe+"px"}else{const he=ne.length>0&&b===ne[0].ref.current;c.style.top="0px";const De=Math.max(X,Y+y.offsetTop+(he?J:0)+ce)+le;c.style.height=De+"px",y.scrollTop=Q-X+y.offsetTop}c.style.margin=`${Et}px 0`,c.style.minHeight=F+"px",c.style.maxHeight=C+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,c,l,y,b,v,s.dir,r]);Xe(()=>S(),[S]);const[_,N]=m.useState();Xe(()=>{l&&N(window.getComputedStyle(l).zIndex)},[l]);const $=m.useCallback(O=>{O&&g.current===!0&&(S(),w?.(),g.current=!1)},[S,w]);return i.jsx(Pj,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:$,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(ve.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Sp.displayName=Tj;var Oj="SelectPopperPosition",Ma=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Et,...s}=e,a=Ws(n);return i.jsx(Wd,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Ma.displayName=Oj;var[Pj,rc]=fr(zn,{}),Ia="SelectViewport",Ep=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=_n(Ia,n),a=rc(Ia,n),c=ke(t,s.onViewportChange),u=m.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:r}),i.jsx(Us.Slot,{scope:n,children:i.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:oe(o.onScroll,l=>{const f=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const h=Math.abs(u.current-f.scrollTop);if(h>0){const g=window.innerHeight-Et*2,y=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(y,b);if(v<g){const w=v+h,S=Math.min(g,w),_=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Ep.displayName=Ia;var kp="SelectGroup",[Dj,$j]=fr(kp),Mj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kt();return i.jsx(Dj,{scope:n,id:o,children:i.jsx(ve.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Mj.displayName=kp;var Np="SelectLabel",Ij=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=$j(Np,n);return i.jsx(ve.div,{id:o.id,...r,ref:t})});Ij.displayName=Np;var is="SelectItem",[Fj,Cp]=fr(is),jp=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,c=wn(is,n),u=_n(is,n),l=c.value===r,[f,d]=m.useState(s??""),[p,h]=m.useState(!1),g=ke(t,w=>u.itemRefCallback?.(w,r,o)),y=Kt(),b=m.useRef("touch"),v=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")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 i.jsx(Fj,{scope:n,value:r,disabled:o,textId:y,isSelected:l,onItemTextChange:m.useCallback(w=>{d(S=>S||(w?.textContent??"").trim())},[]),children:i.jsx(Us.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(ve.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:oe(a.onFocus,()=>h(!0)),onBlur:oe(a.onBlur,()=>h(!1)),onClick:oe(a.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:oe(a.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:oe(a.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:oe(a.onPointerMove,w=>{b.current=w.pointerType,o?u.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:oe(a.onKeyDown,w=>{u.searchRef?.current!==""&&w.key===" "||(_j.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});jp.displayName=is;var Cr="SelectItemText",Rp=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=wn(Cr,n),c=_n(Cr,n),u=Cp(Cr,n),l=Nj(Cr,n),[f,d]=m.useState(null),p=ke(t,v=>d(v),u.onItemTextChange,v=>c.itemTextRefCallback?.(v,u.value,u.disabled)),h=f?.textContent,g=m.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:h},u.value),[u.disabled,u.value,h]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return Xe(()=>(y(g),()=>b(g)),[y,b,g]),i.jsxs(i.Fragment,{children:[i.jsx(ve.span,{id:u.textId,...s,ref:p}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?us.createPortal(s.children,a.valueNode):null]})});Rp.displayName=Cr;var Ap="SelectItemIndicator",Tp=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cp(Ap,n).isSelected?i.jsx(ve.span,{"aria-hidden":!0,...r,ref:t}):null});Tp.displayName=Ap;var Fa="SelectScrollUpButton",Op=m.forwardRef((e,t)=>{const n=_n(Fa,e.__scopeSelect),r=rc(Fa,e.__scopeSelect),[o,s]=m.useState(!1),a=ke(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollTop>0;s(l)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Dp,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Op.displayName=Fa;var za="SelectScrollDownButton",Pp=m.forwardRef((e,t)=>{const n=_n(za,e.__scopeSelect),r=rc(za,e.__scopeSelect),[o,s]=m.useState(!1),a=ke(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const l=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<l;s(f)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(Dp,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Pp.displayName=za;var Dp=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=_n("SelectScrollButton",n),a=m.useRef(null),c=qs(n),u=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>u(),[u]),Xe(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),i.jsx(ve.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{u()})})}),zj="SelectSeparator",Lj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(ve.div,{"aria-hidden":!0,...r,ref:t})});Lj.displayName=zj;var La="SelectArrow",Vj=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ws(n),s=wn(La,n),a=_n(La,n);return s.open&&a.position==="popper"?i.jsx(Hd,{...o,...r,ref:t}):null});Vj.displayName=La;var Bj="SelectBubbleInput",$p=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=ke(r,o),a=bj(t);return m.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[a,t]),i.jsx(ve.select,{...n,style:{...fp,...n.style},ref:s,defaultValue:t})});$p.displayName=Bj;function Mp(e){return e===""||e===void 0}function Ip(e){const t=Bt(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const c=n.current+a;t(c),(function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Fp(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Uj(e,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Uj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qj=mp,Wj=hp,Hj=yp,Zj=bp,Gj=vp,Yj=xp,Kj=Ep,Jj=jp,Xj=Rp,Qj=Tp,eR=Op,tR=Pp;function Va({...e}){return i.jsx(qj,{"data-slot":"select",...e})}function Ba({...e}){return i.jsx(Hj,{"data-slot":"select-value",...e})}function Ua({className:e,size:t="default",children:n,...r}){return i.jsxs(Wj,{"data-slot":"select-trigger","data-size":t,className:ae("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,i.jsx(Zj,{asChild:!0,children:i.jsx(mu,{className:"size-4 opacity-50"})})]})}function qa({className:e,children:t,position:n="popper",...r}){return i.jsx(Gj,{children:i.jsxs(Yj,{"data-slot":"select-content",className:ae("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(nR,{}),i.jsx(Kj,{className:ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),i.jsx(rR,{})]})})}function Wa({className:e,children:t,...n}){return i.jsxs(Jj,{"data-slot":"select-item",className:ae("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[i.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:i.jsx(Qj,{children:i.jsx(fu,{className:"size-4"})})}),i.jsx(Xj,{children:t})]})}function nR({className:e,...t}){return i.jsx(eR,{"data-slot":"select-scroll-up-button",className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(ih,{className:"size-4"})})}function rR({className:e,...t}){return i.jsx(tR,{"data-slot":"select-scroll-down-button",className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(mu,{className:"size-4"})})}const oR=[{id:"ssh_host",name:"SSH Host",icon:Tn},{id:"postgresql",name:"PostgreSQL",icon:jt},{id:"mysql",name:"MySQL",icon:jt},{id:"mongodb",name:"MongoDB",icon:jt},{id:"filesystem",name:"Local Path",icon:ds}];function sR({open:e,onOpenChange:t,onSuccess:n}){const r=Re.useQueryClient(),[o,s]=k.useState("ssh_host"),[a,c]=k.useState(""),[u,l]=k.useState({host:"",port:"",path:""}),[f,d]=k.useState({username:"",password:""}),p=Re.useMutation({mutationFn:y=>wm.create(y),onSuccess:y=>{r.invalidateQueries({queryKey:["resources"]}),Ne.success("Custom source created"),n?.(y.id),t(!1),h()},onError:y=>{Ne.error(y.response?.data?.error||"Failed to create source")}}),h=()=>{c(""),s("ssh_host"),l({host:"",port:"",path:""}),d({username:"",password:""})},g=y=>{if(y.preventDefault(),!a)return Ne.error("Please enter a name");const b={...u};p.mutate({name:a,type:o,config:b,credentials:f})};return e?i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",children:[i.jsx("div",{className:"absolute inset-0 bg-background/50 backdrop-blur-sm transition-opacity",onClick:()=>t(!1)}),i.jsxs("div",{className:"relative w-full max-w-lg overflow-hidden rounded-xl border bg-card shadow-2xl animate-in fade-in zoom-in duration-200",children:[i.jsxs("div",{className:"flex items-center justify-between border-b px-6 py-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold leading-none tracking-tight",children:"Add Custom Source"}),i.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Add a backup source not managed by the platform."})]}),i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>t(!1),children:i.jsx(ms,{className:"h-4 w-4"})})]}),i.jsxs("form",{onSubmit:g,className:"p-6 space-y-5 max-h-[80vh] overflow-y-auto",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Yt,{htmlFor:"s-name",children:"Source Name"}),i.jsx(kt,{id:"s-name",value:a,onChange:y=>c(y.target.value),placeholder:"Production Database",required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Yt,{htmlFor:"s-type",children:"Type"}),i.jsxs(Va,{value:o,onValueChange:s,children:[i.jsx(Ua,{id:"s-type",children:i.jsx(Ba,{placeholder:"Select type"})}),i.jsx(qa,{children:oR.map(y=>i.jsx(Wa,{value:y.id,children:y.name},y.id))})]})]}),i.jsxs("div",{className:"space-y-4 border-t pt-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Yt,{htmlFor:"s-host",children:o==="filesystem"?"Base Path":"Host / IP"}),i.jsx(kt,{id:"s-host",value:o==="filesystem"?u.base_path||"":u.host||"",onChange:y=>l(b=>o==="filesystem"?{...b,base_path:y.target.value}:{...b,host:y.target.value}),placeholder:o==="filesystem"?"/var/www/html":"192.168.1.50",required:!0})]}),o!=="filesystem"&&i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Yt,{htmlFor:"s-username",children:"Username"}),i.jsx(kt,{id:"s-username",value:f.username||"",onChange:y=>d(b=>({...b,username:y.target.value})),required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(Yt,{htmlFor:"s-password",children:"Password / Key"}),i.jsx(kt,{id:"s-password",type:"password",value:f.password||"",onChange:y=>d(b=>({...b,password:y.target.value})),required:!0})]})]})]})]}),i.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[i.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:p.isPending,children:"Cancel"}),i.jsxs(ge,{type:"submit",disabled:p.isPending,children:[p.isPending&&i.jsx(rt,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Source"]})]})]})]})]}):null}const iu={keep_last:7,keep_daily:14,keep_weekly:8,keep_monthly:12,keep_yearly:0},aR=[{label:"Every hour",value:"0 * * * *"},{label:"Every 6h",value:"0 */6 * * *"},{label:"Daily 2am",value:"0 2 * * *"},{label:"Weekly",value:"0 3 * * 0"},{label:"Monthly",value:"0 4 1 * *"}],cu={ssh:{label:"SSH Host",icon:Tn,color:"text-purple-500"},ssh_host:{label:"SSH Host",icon:Tn,color:"text-purple-500"},ec2:{label:"AWS EC2",icon:Tn,color:"text-orange-500"},rdp:{label:"RDP Desktop",icon:ds,color:"text-blue-500"},database:{label:"Database",icon:jt,color:"text-green-500"},postgresql:{label:"PostgreSQL",icon:jt,color:"text-blue-500"},mysql:{label:"MySQL",icon:jt,color:"text-orange-400"},mongodb:{label:"MongoDB",icon:jt,color:"text-green-500"},filesystem:{label:"Filesystem",icon:Ka,color:"text-orange-500"}},lu={s3:{label:"Amazon S3",icon:Er,color:"text-orange-500",bg:"bg-orange-50 dark:bg-orange-950/30"},gcs:{label:"Google Cloud Storage",icon:Er,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/30"},azure:{label:"Azure Blob",icon:Er,color:"text-cyan-500",bg:"bg-cyan-50 dark:bg-cyan-950/30"},b2:{label:"Backblaze B2",icon:Er,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/30"},sftp:{label:"SFTP Server",icon:ds,color:"text-purple-500",bg:"bg-purple-50 dark:bg-purple-950/30"},local:{label:"Local Filesystem",icon:fs,color:"text-gray-500",bg:"bg-gray-50 dark:bg-gray-950/30"}},iR=[{id:"local",label:"Local Backup",desc:"Run on the Meyi Server. Use for local files or mounted drives.",icon:Tn},{id:"remote_push",label:"Remote Push (SSH)",desc:"Runs Restic on the remote host. Efficient for many files. Requires Restic on host.",icon:pu},{id:"remote_stream",label:"Remote Stream",desc:"Streams data via SSH pipe. No Restic installation needed on source host.",icon:hu}],cR=Vl({name:un().min(1,"Job name is required"),source_id:un().min(1,"Please select a backup source"),source_type:Ta(["platform","local"]),target_id:un().min(1,"Please select a storage target"),backup_path:un().optional(),schedule:un(),scheduleEnabled:zl(),enabled:zl(),retention_policy:Vl({keep_last:_r().min(0),keep_daily:_r().min(0),keep_weekly:_r().min(0),keep_monthly:_r().min(0),keep_yearly:_r().min(0)}),tags:Ra(un()),backup_mode:un(),backup_scope:Ta(["full","specific"]),backup_include_paths:Ra(un())});function Cn({title:e,description:t,children:n,action:r}){return i.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm",children:[i.jsxs("div",{className:"flex items-start justify-between px-6 py-5 border-b",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-base font-semibold tracking-tight",children:e}),t&&i.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),r&&i.jsx("div",{className:"ml-4 shrink-0",children:r})]}),i.jsx("div",{className:"px-6 py-5 space-y-4",children:n})]})}function cs({id:e}){const t=co(),n=e||t.id,r=oc(),o=Re.useQueryClient(),s=!!n&&n!=="new",[a,c]=k.useState(""),[u,l]=k.useState(!1),{data:f,isLoading:d}=Re.useQuery({queryKey:["mc-resources"],queryFn:_m.getAll}),p=Array.isArray(f)?f:[],{data:h,isLoading:g}=Re.useQuery({queryKey:["connectors"],queryFn:nr.getAll}),y=Array.isArray(h)?h:[],{data:b}=Re.useQuery({queryKey:["job",n],queryFn:()=>He.get(n),enabled:s&&n!=="new"}),v=aj({resolver:uj(cR),defaultValues:{name:"",source_id:"",source_type:"platform",target_id:"",backup_path:"",schedule:"0 2 * * *",scheduleEnabled:!1,enabled:!0,retention_policy:iu,tags:[],backup_mode:"local",backup_scope:"full",backup_include_paths:[]},mode:"onChange"});k.useEffect(()=>{b&&v.reset({name:b.name||"",source_id:b.source_id??b.sourceId??"",source_type:b.source_type??b.sourceType??"platform",target_id:b.target_id??b.targetId??b.connectorId??b.connector_id??"",backup_path:b.backup_path??b.backupPath??"",schedule:b.schedule||"0 2 * * *",scheduleEnabled:!!b.schedule,enabled:typeof b.enabled=="boolean"?b.enabled:!0,retention_policy:b.retention_policy||b.retentionPolicy||iu,tags:b.tags||[],backup_mode:b.backup_mode??b.backupMode??"local",backup_scope:b.backup_scope??b.backupScope??"full",backup_include_paths:b.backup_include_paths??b.backupIncludePaths??[]})},[b,v]);const w=Re.useMutation({mutationFn:C=>s?He.update(n,C):He.create(C),onSuccess:()=>{o.invalidateQueries({queryKey:["jobs"]}),r({to:"/jobs"})}});function S(C){const{scheduleEnabled:P,...z}=C;w.mutate({...z,schedule:P?z.schedule:null,backup_path:C.backup_path,source_id:C.source_id,target_id:C.target_id,backup_mode:C.backup_mode,source_type:C.source_type,backup_scope:C.backup_scope,backup_include_paths:C.backup_include_paths,source_name:W?.name})}const _=v.watch("target_id"),N=v.watch("scheduleEnabled"),$=v.watch("schedule"),O=v.watch("tags"),T=v.watch("source_id"),W=p.find(C=>C.id===T),H=y.find(C=>C.id===_),ne=W&&["ssh","ssh_host","ec2"].includes(W.host_type||W.type);return k.useEffect(()=>{ne&&v.getValues("backup_mode")==="local"?v.setValue("backup_mode","remote_push"):!ne&&v.getValues("backup_mode")!=="local"&&v.setValue("backup_mode","local")},[ne,v]),i.jsxs("div",{className:"max-w-2xl p-2 space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r({to:"/jobs"}),children:i.jsx(Ga,{className:"h-4 w-4"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-bold tracking-tight",children:s?"Edit Backup Job":"New Backup Job"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure what to back up, where, and when"})]})]}),i.jsx(dj,{...v,children:i.jsxs("form",{onSubmit:v.handleSubmit(S),className:"space-y-6 pb-10",children:[i.jsx(Cn,{title:"Job Details",description:"Give your backup job a recognisable name.",children:i.jsx(Zt,{control:v.control,name:"name",render:({field:C})=>i.jsxs(St,{children:[i.jsx(Gt,{required:!0,children:"Job Name"}),i.jsx(dn,{children:i.jsx(kt,{placeholder:"e.g. Daily Production Backup",className:"h-9",...C})}),i.jsx(Nn,{children:"This name appears in the Jobs list and in backup logs."}),i.jsx(fn,{})]})})}),i.jsxs(Cn,{title:"Backup Source",description:"Select a Meyi Connect resource or add a custom source to back up.",action:i.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!0),children:[i.jsx(Rt,{className:"h-3.5 w-3.5 mr-1"})," Add Custom"]}),children:[i.jsx(Zt,{control:v.control,name:"source_id",render:({field:C})=>i.jsxs(St,{children:[i.jsx(Gt,{required:!0,children:"Resource"}),i.jsxs(Va,{value:C.value,onValueChange:P=>{C.onChange(P);const z=p.find(Y=>Y.id===P);z&&v.setValue("source_type",z.origin==="local"?"local":"platform")},disabled:d,children:[i.jsx(dn,{children:i.jsx(Ua,{className:"h-9",children:d?i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"})," ","Loading resources…"]}):i.jsx(Ba,{placeholder:"Select a resource to back up"})})}),i.jsx(qa,{children:p.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No resources found. Connect to Meyi Platform first."}):p.map(P=>{const z=P.host_type||P.type||"ssh",D=(cu[z]??cu.ssh).icon,q=P.origin==="local"?`Local Custom (${z})`:`${P.host||""}${P.port?":"+P.port:""}`;return i.jsx(Wa,{value:P.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(D,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:P.name}),q&&i.jsx("p",{className:"text-muted-foreground text-xs",children:q}),P.origin==="local"&&i.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Custom"})]})},P.id)})})]}),i.jsx(Nn,{children:'Resources from Meyi Connect appear here. Use "Add Custom" to register a source manually.'}),i.jsx(fn,{})]})}),T&&i.jsx(Zt,{control:v.control,name:"backup_include_paths",render:({field:C})=>i.jsxs(St,{className:"pt-2",children:[i.jsx(Gt,{children:"Backup Scope"}),i.jsx(dn,{children:i.jsx("textarea",{placeholder:"/",className:"w-full rounded-lg border border-input bg-muted/5 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none font-mono min-h-[50px]",value:(C.value||[]).join(`
|
|
107
730
|
`),onChange:P=>{const z=P.target.value.split(`
|
|
108
|
-
`).filter(Boolean);N.onChange(z),v.setValue("backup_scope",z.length>0?"specific":"full")}})}),i.jsx(Cn,{className:"text-[11px]",children:"Enter one absolute path per line. Leave empty for Full Instance backup."}),i.jsx(fn,{})]})})]}),i.jsx(sR,{open:u,onOpenChange:l,onSuccess:N=>{v.setValue("source_id",N,{shouldValidate:!0}),v.setValue("source_type","local")}}),i.jsxs(Nn,{title:"Storage Target",description:"Choose a connector as the backup destination.",action:i.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>r({to:"/settings"}),children:[i.jsx(Rt,{className:"h-3.5 w-3.5 mr-1"})," Add Connector"]}),children:[i.jsx(qt,{control:v.control,name:"target_id",render:({field:N})=>i.jsxs(St,{children:[i.jsx(Yt,{required:!0,children:"Connector"}),i.jsxs(Ba,{value:N.value,onValueChange:N.onChange,disabled:g,children:[i.jsx(dn,{children:i.jsx(Ua,{className:"h-9",children:g?i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"})," ","Loading connectors…"]}):i.jsx(Va,{placeholder:"Select a storage connector"})})}),i.jsx(Wa,{children:y.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No connectors configured. Add one in Settings."}):y.map(P=>{const G=(lu[P.type]??lu.local).icon,D=P.config?.bucket||P.config?.container||P.config?.host||P.config?.path||"";return i.jsx(Ha,{value:P.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(G,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:P.name}),D&&i.jsx("p",{className:"text-muted-foreground text-xs",children:D})]})},P.id)})})]}),i.jsx(Cn,{children:"The storage backend where backup snapshots will be written."}),i.jsx(fn,{})]})}),_&&i.jsxs("div",{className:"space-y-4 pt-2",children:[i.jsx(qt,{control:v.control,name:"backup_path",render:({field:N})=>i.jsxs(St,{children:[i.jsx(Yt,{children:"Backup Path / Prefix"}),i.jsx(dn,{children:i.jsx("div",{className:"relative",children:i.jsx(Et,{placeholder:Z&&Z.type==="local"?"/mnt/backups/my-job":"backups/my-job/",className:"h-9 font-mono text-sm pr-10",...N})})}),i.jsx(Cn,{children:"Sub-path within the connector storage. Leave empty to auto-generate a unique folder."}),i.jsx(fn,{})]})}),Z&&i.jsxs("div",{className:"rounded-lg bg-muted/30 p-2 border border-border/50",children:[i.jsx("div",{className:"text-xs text-muted-foreground/60 mb-1 tracking-wider",children:"Storage Path Preview"}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-muted-foreground break-all",children:[i.jsx("span",{className:"shrink-0",children:Z.type==="s3"?"s3://":Z.type==="local"?"file://":""}),i.jsx("span",{children:Z.config?.bucket||Z.config?.path||"repository"}),i.jsx("span",{children:"/"}),i.jsxs("span",{children:[Z.config?.prefix?Z.config.prefix.replace(/^\/+/,"").replace(/\/+$/,"")+"/":"",v.watch("backup_path")||"<auto-generated>"]})]})]})]})]}),i.jsx(Nn,{title:"Backup Method",description:"How should the data be fetched from the source?",children:i.jsx(qt,{control:v.control,name:"backup_mode",render:({field:N})=>i.jsxs(St,{className:"space-y-3",children:[i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:iR.map(P=>{const z=P.icon,G=N.value===P.id,D=!ne;return i.jsxs("button",{type:"button",disabled:D,onClick:()=>N.onChange(P.id),className:ae("relative flex flex-col items-start p-3 rounded-lg border text-left transition-all",G?"border-primary bg-primary/5 ring-1 ring-primary":D?"opacity-40 cursor-not-allowed bg-muted/30 border-border grayscale":"border-border hover:border-muted-foreground/40 hover:bg-accent/40"),children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[i.jsx("div",{className:ae("p-1 rounded bg-muted border",G?"border-primary/40":"border-border"),children:i.jsx(z,{className:"h-3.5 w-3.5"})}),i.jsx("span",{className:"text-sm font-semibold",children:P.label})]}),i.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:P.desc})]},P.id)})}),i.jsx(fn,{})]})})}),i.jsxs(Nn,{title:"Schedule",description:"Configure when this backup runs automatically.",children:[i.jsx(qt,{control:v.control,name:"scheduleEnabled",render:({field:N})=>i.jsx(St,{children:i.jsx(dn,{children:i.jsxs("label",{className:"flex items-center gap-2.5 text-sm cursor-pointer",children:[i.jsx("div",{onClick:()=>N.onChange(!N.value),className:ae("relative h-5 w-9 rounded-full transition-colors cursor-pointer",N.value?"bg-primary":"bg-muted"),children:i.jsx("div",{className:ae("absolute top-0.5 h-4 w-4 rounded-full shadow transition-transform",N.value?"translate-x-4 bg-black":"translate-x-0.5 bg-white")})}),"Enable automatic schedule"]})})})}),C?i.jsxs(i.Fragment,{children:[i.jsxs(St,{children:[i.jsx(Yt,{children:"Quick Presets"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:aR.map(N=>i.jsx("button",{type:"button",onClick:()=>v.setValue("schedule",N.value),className:ae("rounded-full border px-3 py-1 text-xs transition-colors",I===N.value?"border-primary bg-primary/10 text-primary font-medium":"border-border text-muted-foreground hover:border-primary/40 hover:text-foreground"),children:N.label},N.value))})]}),i.jsx(qt,{control:v.control,name:"schedule",render:({field:N})=>i.jsxs(St,{children:[i.jsx(Yt,{children:"Custom Cron Expression"}),i.jsx(dn,{children:i.jsx(Et,{placeholder:"0 2 * * *",className:"h-9 font-mono",...N})}),i.jsx(Cn,{children:"Standard 5-field cron syntax (minute hour day month weekday)."}),i.jsx(fn,{})]})})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Manual trigger only — run from the Jobs page."})]}),i.jsx(Nn,{title:"Retention Policy",description:"How many snapshots to keep in each retention window.",children:i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-5",children:[{key:"keep_last",label:"Last N"},{key:"keep_daily",label:"Daily (days)"},{key:"keep_weekly",label:"Weekly"},{key:"keep_monthly",label:"Monthly"},{key:"keep_yearly",label:"Yearly"}].map(({key:N,label:P})=>i.jsx(qt,{control:v.control,name:`retention_policy.${N}`,render:({field:z})=>i.jsxs(St,{children:[i.jsx(Yt,{children:P}),i.jsx(dn,{children:i.jsx(Et,{type:"number",min:"0",className:"h-9",...z,onChange:G=>z.onChange(Number(G.target.value)||0)})}),i.jsx(fn,{})]})},N))})}),i.jsxs(Nn,{title:"Tags",description:"Label snapshots for easier filtering.",children:[i.jsxs(St,{children:[i.jsx(Yt,{children:"Add Tags"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Et,{value:a,onChange:N=>c(N.target.value),placeholder:"production, nightly, critical",className:"h-9",onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),a.trim()&&(v.setValue("tags",[...O,a.trim()]),c("")))}}),i.jsx(ge,{type:"button",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{a.trim()&&(v.setValue("tags",[...O,a.trim()]),c(""))},children:i.jsx(Rt,{className:"h-4 w-4"})})]}),i.jsx(Cn,{children:"Press Enter or click + to add a tag."})]}),O.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.map(N=>i.jsxs(Ie,{variant:"secondary",className:"gap-1 pr-1 text-xs",children:[N,i.jsx("button",{type:"button",onClick:()=>v.setValue("tags",O.filter(P=>P!==N)),children:i.jsx(ms,{className:"h-3 w-3"})})]},N))})]}),w.error&&i.jsx("div",{className:"rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:w.error?.error||"Failed to save job"}),i.jsxs("div",{className:"flex justify-end gap-4 pt-2",children:[i.jsx(ge,{type:"button",variant:"outline",onClick:()=>r({to:"/jobs"}),children:"Cancel"}),i.jsx(ge,{type:"submit",disabled:w.isPending,children:w.isPending?i.jsxs(i.Fragment,{children:[i.jsx(rt,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Saving...":"Creating..."]}):s?"Save Changes":"Create Job"})]})]})})]})}const en={getAll:()=>fe.get("/targets"),get:e=>fe.get(`/targets/${e}`),create:e=>fe.post("/targets",e),update:(e,t)=>fe.put(`/targets/${e}`,t),delete:e=>fe.delete(`/targets/${e}`),initRepo:e=>fe.post(`/targets/${e}/init`),getSnapshots:e=>fe.get(`/targets/${e}/snapshots`)};function zr({id:e}){const t=co(),n=e||t.id,o=Ve.useLocation().pathname.includes("/jobs/"),{data:s}=Re.useQuery({queryKey:[o?"job":"target",n],queryFn:()=>o?Ze.get(n):en.get(n)}),{data:a=[],isLoading:c,error:u}=Re.useQuery({queryKey:["snapshots",o?"job":"target",n],queryFn:()=>o?Ze.getSnapshots(n):en.getSnapshots(n)});if(c)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});const l=o?`/jobs/${n}`:"/targets";return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{to:l,className:"flex items-center gap-1 text-xs",style:{color:"var(--text-muted)"},children:i.jsx(Ya,{className:"w-5 h-5"})}),i.jsxs("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:[s?.name,"'s Snapshots"]})]}),i.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.length," snapshots in repository ",o?"(filtered for this job)":""]}),u&&i.jsxs("div",{className:"rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 px-4 py-3 text-sm text-red-700 dark:text-red-400",children:["Failed to load snapshots: ",u.message]}),i.jsx("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:a.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No snapshots"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Run a backup job to create snapshots"})]}):a.map(f=>i.jsxs("div",{className:"flex flex-col gap-2 px-4 py-3 border-b border-border/50 last:border-0 hover:bg-muted/40 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx(Ie,{variant:"secondary",className:"font-mono text-xs text-primary",children:f.short_id||f.id?.slice(0,8)}),i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx(mh,{className:"h-3 w-3"}),li(f.time)]}),f.hostname&&i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx(Tn,{className:"h-3 w-3"}),f.hostname]}),(f.tags?.length??0)>0&&i.jsx("div",{className:"flex items-center gap-1 ml-auto",children:f.tags.map(d=>i.jsx(Ie,{variant:"outline",className:"text-xs bg-purple-500/10 text-purple-500 border-purple-500/20",children:d},d))})]}),(f.paths?.length??0)>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.paths.map(d=>i.jsx("code",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground font-mono",children:d},d))})]},f.id))})]})}const on=Ve.createRootRoute({component:Gg}),lR=Ve.createRoute({getParentRoute:()=>on,path:"/",component:ls}),uR=Ve.createRoute({getParentRoute:()=>on,path:"/jobs",component:zi}),dR=Ve.createRoute({getParentRoute:()=>on,path:"/jobs/new",component:cs}),fR=Ve.createRoute({getParentRoute:()=>on,path:"/jobs/$id",component:Li}),mR=Ve.createRoute({getParentRoute:()=>on,path:"/jobs/$id/edit",component:cs}),pR=Ve.createRoute({getParentRoute:()=>on,path:"/jobs/$id/snapshots",component:zr}),hR=Ve.createRoute({getParentRoute:()=>on,path:"/targets/$id/snapshots",component:zr}),gR=Ve.createRoute({getParentRoute:()=>on,path:"/settings",component:km}),yR=on.addChildren([lR,uR,dR,fR,mR,pR,hR,gR]),bR=Ve.createRouter({routeTree:yR});function zp({basePath:e="/backup",showSidebar:t=!0}){const r=Ve.useLocation().pathname,o=r.startsWith(e)?r.substring(e.length)||"/":r;let s,a={};const c=(u,l)=>{const f=l.match(u);return f?f[1]:null};return o==="/"||o===""?s=i.jsx(ls,{}):o==="/jobs"?s=i.jsx(zi,{}):o==="/jobs/new"?s=i.jsx(cs,{}):o==="/settings"?s=i.jsx(km,{}):o.match(/^\/jobs\/([^/]+)\/edit$/)?(a.id=c(/^\/jobs\/([^/]+)\/edit$/,o),s=i.jsx(cs,{...a})):o.match(/^\/jobs\/([^/]+)$/)?(a.id=c(/^\/jobs\/([^/]+)$/,o),s=i.jsx(Li,{...a})):o.match(/^\/jobs\/([^/]+)\/snapshots$/)?(a.id=c(/^\/jobs\/([^/]+)\/snapshots$/,o),s=i.jsx(zr,{...a})):o.match(/^\/targets\/([^/]+)\/snapshots$/)?(a.id=c(/^\/targets\/([^/]+)\/snapshots$/,o),s=i.jsx(zr,{...a})):s=i.jsx(ls,{}),i.jsxs("div",{className:"flex min-h-screen bg-background w-full",children:[t&&i.jsx(Ou,{}),i.jsx("main",{className:"flex-1 min-w-0 overflow-auto py-1 px-1",children:s})]})}function co(e){try{return Ve.useParams(e)}catch{const t=window.location.pathname.split("/"),n=t[t.length-1],r=t[t.length-2];return n==="edit"?{id:r}:r==="jobs"?{id:n==="new"?null:n}:{id:null}}}function oc(){const e=Ve.useNavigate(),t="/backup";return n=>{let r=n.to;r==="/"&&(r=""),n.params&&Object.entries(n.params).forEach(([s,a])=>{r=r.replace(`$${s}`,a)});const o=r.startsWith("/")?`${t}${r}`:`${t}/${r}`;return e({...n,to:o})}}function Pe(e){const{basePath:t,to:n,params:r,...o}=e,s=t??"/backup";let a=n;if(!a)return i.jsx(Ve.Link,{...e});a==="/"&&(a=""),r&&Object.entries(r).forEach(([u,l])=>{a=a.replace(`$${u}`,l)});const c=a.startsWith("/")?`${s}${a}`:`${s}/${a}`;return i.jsx(Ve.Link,{...o,to:c})}function To({label:e,value:t,sub:n,className:r,icon:o}){return i.jsx(At,{className:"py-0 shadow-sm border-border/50",children:i.jsxs(Tt,{className:"flex items-center gap-4 p-5",children:[o&&i.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-muted/50",children:i.jsx(o,{className:ae("h-5 w-5",r||"text-muted-foreground")})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wider",children:e}),i.jsx("div",{className:ae("text-2xl font-bold text-foreground mt-0.5",r),children:t??"-"}),n&&i.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:n})]})]})})}function ls(){const e=Re.useQueryClient(),{data:t,isLoading:n}=Re.useQuery({queryKey:["dashboard"],queryFn:Ab.get,refetchInterval:15e3}),{data:r}=Re.useQuery({queryKey:["jobs"],queryFn:Ze.getAll}),o=Array.isArray(r)?r:[];async function s(u,l){l.preventDefault();try{await Ze.run(u),Ce.success("Job triggered"),e.invalidateQueries({queryKey:["dashboard"]}),e.invalidateQueries({queryKey:["jobs"]})}catch{Ce.error("Failed to trigger job")}}if(n)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});const a=t?.runs??{success_7d:0,failed_7d:0,bytes_7d:0},c=t?.jobs??{total:0,enabled:0};return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your backup infrastructure"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[i.jsx(To,{label:"Active Jobs",value:c.enabled,sub:`${c.total} total`}),i.jsx(To,{label:"Success (7d)",value:a.success_7d,sub:"completed runs",className:"text-emerald-600 dark:text-emerald-400"}),i.jsx(To,{label:"Failed (7d)",value:a.failed_7d,sub:"failed runs",className:Number(a.failed_7d)>0?"text-red-600 dark:text-red-400":void 0}),i.jsx(To,{label:"Data Backed Up (7d)",value:cr(a.bytes_7d),sub:"added this week"})]}),i.jsxs(At,{className:"py-0 gap-0 shadow-sm border-border/50",children:[i.jsxs(lx,{className:"flex flex-row items-center justify-between border-b border-border/40 px-5 py-3.5",children:[i.jsx(ux,{className:"text-base font-semibold",children:"Backup Jobs"}),i.jsx(ge,{variant:"outline",size:"sm",asChild:!0,children:i.jsxs(Pe,{to:"/jobs",children:[i.jsx(dh,{className:"h-4 w-4"})," View all"]})})]}),o.length===0?i.jsxs(Tt,{className:"p-10 text-center text-sm text-muted-foreground",children:["No jobs yet. ",i.jsx(Pe,{to:"/jobs/new",className:"text-primary hover:underline",children:"Create your first job →"})]}):i.jsx(Tt,{className:"p-0",children:i.jsx("div",{className:"divide-y",children:o.slice(0,6).map(u=>{const l=u.last_run??u.lastRun;l&&Yr(l.status);const f=l?.started_at??l?.startedAt;return i.jsxs(Pe,{to:"/jobs/$id",params:{id:u.id},className:"flex items-center justify-between px-5 py-3.5 hover:bg-muted/40 transition",children:[i.jsxs("div",{className:"min-w-0 flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"font-medium truncate",children:u.name}),i.jsx(Ie,{variant:"outline",className:"font-mono text-xs",children:u.schedule||"Manual"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:l?ci(f):"Never run"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(ge,{variant:"default",size:"sm",className:"h-8 px-3",onClick:d=>s(u.id,d),children:i.jsx(Ja,{className:"h-3.5 w-3.5"})})})]},u.id)})})})]})]})}const mr={getAll:()=>fe.get("/sources"),get:e=>fe.get(`/sources/${e}`),create:e=>fe.post("/sources",e),update:(e,t)=>fe.put(`/sources/${e}`,t),delete:e=>fe.delete(`/sources/${e}`),test:e=>fe.post(`/sources/${e}/test`)},vR={list:[],current:null,loading:!1,error:null},zo=Ne.createAsyncThunk("sources/fetchAll",async()=>await mr.getAll()),xR=Ne.createAsyncThunk("sources/fetchOne",async e=>await mr.get(e)),wR=Ne.createAsyncThunk("sources/create",async e=>await mr.create(e)),_R=Ne.createAsyncThunk("sources/update",async({id:e,data:t})=>await mr.update(e,t)),Lp=Ne.createAsyncThunk("sources/delete",async e=>(await mr.delete(e),e));Ne.createAsyncThunk("sources/test",async e=>await mr.test(e));const SR=Ne.createSlice({name:"sources",initialState:vR,reducers:{},extraReducers:e=>{e.addCase(zo.pending,t=>{t.loading=!0,t.error=null}).addCase(zo.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}).addCase(zo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch sources"}).addCase(xR.fulfilled,(t,n)=>{t.current=n.payload}).addCase(wR.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(_R.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(Lp.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)})}}),kR=SR.reducer;function ER(){const e=ti(),{list:t,loading:n}=ni(a=>a.sources),[r,o]=m.useState(null);m.useEffect(()=>{e(zo())},[e]);const s=async()=>{if(r)try{await e(Lp(r.id)).unwrap(),Ce.success(`Source "${r.name}" deleted`),o(null)}catch{Ce.error("Failed to delete source")}};return n&&t.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Sources"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Databases and filesystems to back up"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Source"]})})]}),t.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No sources yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a database or filesystem to start backing up"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Source"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:t.map(a=>{const c=fd[a.type],u=a.config?.host?`${a.config.host}${a.config.port?`:${a.config.port}`:""}`:a.config?.base_path||"-",l=c?.icon;return i.jsx(Pe,{to:"/sources/$id/edit",params:{id:a.id},className:"block",children:i.jsx(At,{className:"py-0 transition-all hover:-translate-y-0.5 hover:shadow-md",children:i.jsxs(Tt,{className:"space-y-5 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsx("div",{className:"min-w-0",children:i.jsxs("div",{className:"flex items-center gap-2",children:[l?i.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl border bg-muted/40",children:i.jsx(l,{className:"h-4 w-4"})}):null,i.jsxs("div",{children:[i.jsx("h3",{className:"truncate text-base font-semibold",children:a.name}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:u})]})]})}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,onClick:f=>f.preventDefault(),children:i.jsx(ge,{variant:"ghost",size:"icon",title:"More actions",children:i.jsx(Ga,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsx(ar,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/$id/edit",params:{id:a.id},children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]})}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:f=>{f.preventDefault(),o(a)},children:[i.jsx(Br,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(Ie,{variant:"outline",children:c?.label??a.type}),i.jsx(Ie,{variant:"secondary",className:"text-xs",children:(a.scope_type??a.scopeType)==="all"?"Full backup":"Partial scope"})]})]})})},a.id)})}),i.jsx(Qr,{open:!!r,onOpenChange:a=>!a&&o(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Source"}),i.jsxs(oo,{children:['Delete "',r?.name,'"? This will also remove any backup jobs using this source.']})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:s,children:"Delete"})]})]})})]})}const CR={list:[],current:null,snapshots:[],loading:!1,error:null},Lo=Ne.createAsyncThunk("targets/fetchAll",async()=>await en.getAll()),NR=Ne.createAsyncThunk("targets/fetchOne",async e=>await en.get(e)),jR=Ne.createAsyncThunk("targets/create",async e=>await en.create(e)),RR=Ne.createAsyncThunk("targets/update",async({id:e,data:t})=>await en.update(e,t)),Bp=Ne.createAsyncThunk("targets/delete",async e=>(await en.delete(e),e)),AR=Ne.createAsyncThunk("targets/initRepo",async e=>await en.initRepo(e)),TR=Ne.createAsyncThunk("targets/fetchSnapshots",async e=>await en.getSnapshots(e)),OR=Ne.createSlice({name:"targets",initialState:CR,reducers:{},extraReducers:e=>{e.addCase(Lo.pending,t=>{t.loading=!0,t.error=null}).addCase(Lo.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}).addCase(Lo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch targets"}).addCase(NR.fulfilled,(t,n)=>{t.current=n.payload}).addCase(jR.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(RR.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(Bp.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}).addCase(TR.fulfilled,(t,n)=>{t.snapshots=n.payload})}}),PR=OR.reducer;function DR(){const e=ti(),{list:t,loading:n}=ni(l=>l.targets),[r,o]=m.useState(null),[s,a]=m.useState(new Set);m.useEffect(()=>{e(Lo())},[e]);const c=async()=>{if(r)try{await e(Bp(r.id)).unwrap(),Ce.success(`Target "${r.name}" deleted`),o(null)}catch{Ce.error("Failed to delete target")}},u=async l=>{a(f=>new Set(f).add(l));try{await e(AR(l)).unwrap(),Ce.success("Repository initialized")}catch{Ce.error("Failed to initialize repository")}finally{a(f=>{const d=new Set(f);return d.delete(l),d})}};return n&&t.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Targets"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Repositories where backups are stored"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/targets/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Target"]})})]}),t.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No targets yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure a repository to start storing backups"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/targets/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Target"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:t.map(l=>{const f=md[l.type];l.config?.path||l.config?.bucket||l.config?.url||l.config?.host;const d=s.has(l.id),h=f?.icon;return i.jsxs("div",{className:"relative group",children:[i.jsx(Pe,{to:"/targets/$id/snapshots",params:{id:l.id},className:"block h-full",children:i.jsx(At,{className:"h-full flex flex-col items-center justify-center p-6 text-center transition-all hover:-translate-y-1 hover:shadow-lg hover:border-primary/50 bg-background/50 border-dashed",children:i.jsxs(Tt,{className:"p-0 flex flex-col items-center gap-4",children:[i.jsx("div",{className:ae("flex h-16 w-16 items-center justify-center rounded-2xl border bg-muted/30 transition-colors group-hover:bg-primary/5",d&&"animate-pulse border-primary/30"),children:h?i.jsx(h,{className:"h-8 w-8 text-muted-foreground group-hover:text-primary transition-colors"}):i.jsx(Tr,{className:"h-8 w-8"})}),i.jsxs("div",{className:"space-y-1.5 min-w-0 w-full px-2",children:[i.jsx("h3",{className:"truncate text-sm font-bold tracking-tight",children:l.name}),i.jsx("p",{className:"truncate text-[10px] font-medium text-muted-foreground uppercase opacity-70",children:f?.label??l.type})]}),i.jsx("div",{className:"flex flex-wrap items-center justify-center gap-1.5 mt-1",children:i.jsx(Ie,{variant:"outline",className:ae("px-1.5 py-0 text-[9px] font-bold uppercase tracking-widest",d?"border-primary/50 text-primary":"opacity-60"),children:d?"Initializing":"Ready"})})]})})}),i.jsxs("div",{className:"absolute top-3 right-3 flex flex-col gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-primary hover:text-white transition-colors",onClick:()=>u(l.id),title:"Initialize Repo",children:i.jsx(Xa,{className:ae("h-4 w-4",d&&"animate-spin")})}),i.jsx(Pe,{to:"/targets/$id/edit",params:{id:l.id},children:i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-primary hover:text-white transition-colors",children:i.jsx(Lr,{className:"h-4 w-4"})})}),i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-destructive hover:text-white transition-colors",onClick:()=>o(l),children:i.jsx(Br,{className:"h-4 w-4"})})]})]},l.id)})}),i.jsx(Qr,{open:!!r,onOpenChange:l=>!l&&o(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Target"}),i.jsxs(oo,{children:['Delete "',r?.name,'"? This removes the configuration only and does not delete repository data.']})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:c,children:"Delete"})]})]})})]})}function IR(){const{data:e=[],isLoading:t,isError:n}=Re.useQuery({queryKey:["runs"],queryFn:Rb.getAll,refetchInterval:1e4});return t?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[i.jsx(lh,{className:"h-4 w-4"}),"Failed to load run history"]})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"All backup runs across all jobs"})]}),e.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Nh,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No runs yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Triggered jobs will appear here once a backup starts."})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:e.map(r=>{const o=Yr(r.status),s=r.startedAt??r.started_at,a=r.finishedAt??r.finished_at,c=r.snapshotId??r.snapshot_id,u=r.dataAddedBytes??r.data_added_bytes??0,l=r.totalFilesProcessed??r.total_files_processed??0,f=r.jobName??r.job_name??"Unknown job";return i.jsx(At,{className:"py-0",children:i.jsxs(Tt,{className:"space-y-4 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-semibold",children:f})}),i.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[r.id.slice(0,10),"..."]})]}),i.jsx(Ie,{className:ae("text-xs",o.badge),children:o.label})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Started"}),i.jsx("div",{className:"mt-1 text-foreground",children:li(s)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Duration"}),i.jsx("div",{className:"mt-1 text-foreground",children:ui(s,a)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Files"}),i.jsx("div",{className:"mt-1 text-foreground",children:l>0?`${l} files`:"-"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Data Added"}),i.jsx("div",{className:"mt-1 text-foreground",children:u>0?`+${cr(u)}`:"-"})]})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:i.jsx(Ie,{variant:"secondary",className:"font-mono text-xs",children:c?c.slice(0,8):"No snapshot"})})]})},r.id)})})]})}const MR={role:null},Vp=Ne.createSlice({name:"auth",initialState:MR,reducers:{setRole(e,t){e.role=t.payload}}}),{setRole:iA}=Vp.actions,$R=Vp.reducer,FR=Ne.configureStore({reducer:{auth:$R,sources:kR,targets:PR,jobs:Fb}});function zR({apiBase:e,token:t,basePath:n="/backup"}){const[r,o]=E.useState(!1),s=E.useMemo(()=>new Re.QueryClient({defaultOptions:{queries:{staleTime:3e4,retry:1}}}),[]);return E.useEffect(()=>{t&&td(t),fe.defaults.baseURL=e,o(!0)},[e,t]),r?i.jsx(Za.Provider,{store:FR,children:i.jsxs(Re.QueryClientProvider,{client:s,children:[i.jsx(zp,{basePath:n,showSidebar:!1}),i.jsx(VS,{richColors:!0,position:"bottom-right"})]})}):null}Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>Ve.useLocation});Object.defineProperty(exports,"useRouter",{enumerable:!0,get:()=>Ve.useRouter});exports.DashboardPage=ls;exports.JobDetailPage=Li;exports.JobsPage=zi;exports.Link=Pe;exports.MeyiBackupPage=zR;exports.MeyiBackupRouter=zp;exports.RunHistoryPage=IR;exports.SnapshotsPage=zr;exports.SourcesPage=ER;exports.TargetsPage=DR;exports.api=fe;exports.router=bR;exports.setToken=td;exports.useMeyiParams=co;exports.useNavigate=oc;exports.useParams=co;
|
|
731
|
+
`).filter(Boolean);C.onChange(z),v.setValue("backup_scope",z.length>0?"specific":"full")}})}),i.jsx(Nn,{className:"text-[11px]",children:"Enter one absolute path per line. Leave empty for Full Instance backup."}),i.jsx(fn,{})]})})]}),i.jsx(sR,{open:u,onOpenChange:l,onSuccess:C=>{v.setValue("source_id",C,{shouldValidate:!0}),v.setValue("source_type","local")}}),i.jsxs(Cn,{title:"Storage Target",description:"Choose a connector as the backup destination.",action:i.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>r({to:"/settings"}),children:[i.jsx(Rt,{className:"h-3.5 w-3.5 mr-1"})," Add Connector"]}),children:[i.jsx(Zt,{control:v.control,name:"target_id",render:({field:C})=>i.jsxs(St,{children:[i.jsx(Gt,{required:!0,children:"Connector"}),i.jsxs(Va,{value:C.value,onValueChange:C.onChange,disabled:g,children:[i.jsx(dn,{children:i.jsx(Ua,{className:"h-9",children:g?i.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(rt,{className:"h-3.5 w-3.5 animate-spin"})," ","Loading connectors…"]}):i.jsx(Ba,{placeholder:"Select a storage connector"})})}),i.jsx(qa,{children:y.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No connectors configured. Add one in Settings."}):y.map(P=>{const Y=(lu[P.type]??lu.local).icon,D=P.config?.bucket||P.config?.container||P.config?.host||P.config?.path||"";return i.jsx(Wa,{value:P.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Y,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{children:P.name}),D&&i.jsx("p",{className:"text-muted-foreground text-xs",children:D})]})},P.id)})})]}),i.jsx(Nn,{children:"The storage backend where backup snapshots will be written."}),i.jsx(fn,{})]})}),_&&i.jsxs("div",{className:"space-y-4 pt-2",children:[i.jsx(Zt,{control:v.control,name:"backup_path",render:({field:C})=>i.jsxs(St,{children:[i.jsx(Gt,{children:"Backup Path / Prefix"}),i.jsx(dn,{children:i.jsx("div",{className:"relative",children:i.jsx(kt,{placeholder:H&&H.type==="local"?"/mnt/backups/my-job":"backups/my-job/",className:"h-9 font-mono text-sm pr-10",...C})})}),i.jsx(Nn,{children:"Sub-path within the connector storage. Leave empty to auto-generate a unique folder."}),i.jsx(fn,{})]})}),H&&i.jsxs("div",{className:"rounded-lg bg-muted/30 p-2 border border-border/50",children:[i.jsx("div",{className:"text-xs text-muted-foreground/60 mb-1 tracking-wider",children:"Storage Path Preview"}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-muted-foreground break-all",children:[i.jsx("span",{className:"shrink-0",children:H.type==="s3"?"s3://":H.type==="local"?"file://":""}),i.jsx("span",{children:H.config?.bucket||H.config?.path||"repository"}),i.jsx("span",{children:"/"}),i.jsxs("span",{children:[H.config?.prefix?H.config.prefix.replace(/^\/+/,"").replace(/\/+$/,"")+"/":"",v.watch("backup_path")||"<auto-generated>"]})]})]})]})]}),i.jsx(Cn,{title:"Backup Method",description:"How should the data be fetched from the source?",children:i.jsx(Zt,{control:v.control,name:"backup_mode",render:({field:C})=>i.jsxs(St,{className:"space-y-3",children:[i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:iR.map(P=>{const z=P.icon,Y=C.value===P.id,D=!ne;return i.jsxs("button",{type:"button",disabled:D,onClick:()=>C.onChange(P.id),className:ae("relative flex flex-col items-start p-3 rounded-lg border text-left transition-all",Y?"border-primary bg-primary/5 ring-1 ring-primary":D?"opacity-40 cursor-not-allowed bg-muted/30 border-border grayscale":"border-border hover:border-muted-foreground/40 hover:bg-accent/40"),children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[i.jsx("div",{className:ae("p-1 rounded bg-muted border",Y?"border-primary/40":"border-border"),children:i.jsx(z,{className:"h-3.5 w-3.5"})}),i.jsx("span",{className:"text-sm font-semibold",children:P.label})]}),i.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:P.desc})]},P.id)})}),i.jsx(fn,{})]})})}),i.jsxs(Cn,{title:"Schedule",description:"Configure when this backup runs automatically.",children:[i.jsx(Zt,{control:v.control,name:"scheduleEnabled",render:({field:C})=>i.jsx(St,{children:i.jsx(dn,{children:i.jsxs("label",{className:"flex items-center gap-2.5 text-sm cursor-pointer",children:[i.jsx("div",{onClick:()=>C.onChange(!C.value),className:ae("relative h-5 w-9 rounded-full transition-colors cursor-pointer",C.value?"bg-primary":"bg-muted"),children:i.jsx("div",{className:ae("absolute top-0.5 h-4 w-4 rounded-full shadow transition-transform",C.value?"translate-x-4 bg-black":"translate-x-0.5 bg-white")})}),"Enable automatic schedule"]})})})}),N?i.jsxs(i.Fragment,{children:[i.jsxs(St,{children:[i.jsx(Gt,{children:"Quick Presets"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:aR.map(C=>i.jsx("button",{type:"button",onClick:()=>v.setValue("schedule",C.value),className:ae("rounded-full border px-3 py-1 text-xs transition-colors",$===C.value?"border-primary bg-primary/10 text-primary font-medium":"border-border text-muted-foreground hover:border-primary/40 hover:text-foreground"),children:C.label},C.value))})]}),i.jsx(Zt,{control:v.control,name:"schedule",render:({field:C})=>i.jsxs(St,{children:[i.jsx(Gt,{children:"Custom Cron Expression"}),i.jsx(dn,{children:i.jsx(kt,{placeholder:"0 2 * * *",className:"h-9 font-mono",...C})}),i.jsx(Nn,{children:"Standard 5-field cron syntax (minute hour day month weekday)."}),i.jsx(fn,{})]})})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Manual trigger only — run from the Jobs page."})]}),i.jsx(Cn,{title:"Retention Policy",description:"How many snapshots to keep in each retention window.",children:i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-5",children:[{key:"keep_last",label:"Last N"},{key:"keep_daily",label:"Daily (days)"},{key:"keep_weekly",label:"Weekly"},{key:"keep_monthly",label:"Monthly"},{key:"keep_yearly",label:"Yearly"}].map(({key:C,label:P})=>i.jsx(Zt,{control:v.control,name:`retention_policy.${C}`,render:({field:z})=>i.jsxs(St,{children:[i.jsx(Gt,{children:P}),i.jsx(dn,{children:i.jsx(kt,{type:"number",min:"0",className:"h-9",...z,onChange:Y=>z.onChange(Number(Y.target.value)||0)})}),i.jsx(fn,{})]})},C))})}),i.jsxs(Cn,{title:"Tags",description:"Label snapshots for easier filtering.",children:[i.jsxs(St,{children:[i.jsx(Gt,{children:"Add Tags"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(kt,{value:a,onChange:C=>c(C.target.value),placeholder:"production, nightly, critical",className:"h-9",onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),a.trim()&&(v.setValue("tags",[...O,a.trim()]),c("")))}}),i.jsx(ge,{type:"button",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{a.trim()&&(v.setValue("tags",[...O,a.trim()]),c(""))},children:i.jsx(Rt,{className:"h-4 w-4"})})]}),i.jsx(Nn,{children:"Press Enter or click + to add a tag."})]}),O.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.map(C=>i.jsxs($e,{variant:"secondary",className:"gap-1 pr-1 text-xs",children:[C,i.jsx("button",{type:"button",onClick:()=>v.setValue("tags",O.filter(P=>P!==C)),children:i.jsx(ms,{className:"h-3 w-3"})})]},C))})]}),w.error&&i.jsx("div",{className:"rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:w.error?.error||"Failed to save job"}),i.jsxs("div",{className:"flex justify-end gap-4 pt-2",children:[i.jsx(ge,{type:"button",variant:"outline",onClick:()=>r({to:"/jobs"}),children:"Cancel"}),i.jsx(ge,{type:"submit",disabled:w.isPending,children:w.isPending?i.jsxs(i.Fragment,{children:[i.jsx(rt,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Saving...":"Creating..."]}):s?"Save Changes":"Create Job"})]})]})})]})}const en={getAll:()=>fe.get("/targets"),get:e=>fe.get(`/targets/${e}`),create:e=>fe.post("/targets",e),update:(e,t)=>fe.put(`/targets/${e}`,t),delete:e=>fe.delete(`/targets/${e}`),initRepo:e=>fe.post(`/targets/${e}/init`),getSnapshots:e=>fe.get(`/targets/${e}/snapshots`)};function zr({id:e}){const t=co(),n=e||t.id,o=Be.useLocation().pathname.includes("/jobs/"),{data:s}=Re.useQuery({queryKey:[o?"job":"target",n],queryFn:()=>o?He.get(n):en.get(n)}),{data:a=[],isLoading:c,error:u}=Re.useQuery({queryKey:["snapshots",o?"job":"target",n],queryFn:()=>o?He.getSnapshots(n):en.getSnapshots(n)});if(c)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});const l=o?`/jobs/${n}`:"/targets";return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{to:l,className:"flex items-center gap-1 text-xs",style:{color:"var(--text-muted)"},children:i.jsx(Ga,{className:"w-5 h-5"})}),i.jsxs("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:[s?.name,"'s Snapshots"]})]}),i.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.length," snapshots in repository ",o?"(filtered for this job)":""]}),u&&i.jsxs("div",{className:"rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 px-4 py-3 text-sm text-red-700 dark:text-red-400",children:["Failed to load snapshots: ",u.message]}),i.jsx("div",{className:"rounded-xl border border-border bg-card shadow-sm",children:a.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No snapshots"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Run a backup job to create snapshots"})]}):a.map(f=>i.jsxs("div",{className:"flex flex-col gap-2 px-4 py-3 border-b border-border/50 last:border-0 hover:bg-muted/40 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx($e,{variant:"secondary",className:"font-mono text-xs text-primary",children:f.short_id||f.id?.slice(0,8)}),i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx(mh,{className:"h-3 w-3"}),li(f.time)]}),f.hostname&&i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx(Tn,{className:"h-3 w-3"}),f.hostname]}),(f.tags?.length??0)>0&&i.jsx("div",{className:"flex items-center gap-1 ml-auto",children:f.tags.map(d=>i.jsx($e,{variant:"outline",className:"text-xs bg-purple-500/10 text-purple-500 border-purple-500/20",children:d},d))})]}),(f.paths?.length??0)>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.paths.map(d=>i.jsx("code",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground font-mono",children:d},d))})]},f.id))})]})}const on=Be.createRootRoute({component:Yg}),lR=Be.createRoute({getParentRoute:()=>on,path:"/",component:ls}),uR=Be.createRoute({getParentRoute:()=>on,path:"/jobs",component:zi}),dR=Be.createRoute({getParentRoute:()=>on,path:"/jobs/new",component:cs}),fR=Be.createRoute({getParentRoute:()=>on,path:"/jobs/$id",component:Li}),mR=Be.createRoute({getParentRoute:()=>on,path:"/jobs/$id/edit",component:cs}),pR=Be.createRoute({getParentRoute:()=>on,path:"/jobs/$id/snapshots",component:zr}),hR=Be.createRoute({getParentRoute:()=>on,path:"/targets/$id/snapshots",component:zr}),gR=Be.createRoute({getParentRoute:()=>on,path:"/settings",component:Em}),yR=on.addChildren([lR,uR,dR,fR,mR,pR,hR,gR]),bR=Be.createRouter({routeTree:yR});function zp({basePath:e="/backup",showSidebar:t=!0}){const r=Be.useLocation().pathname,o=r.startsWith(e)?r.substring(e.length)||"/":r;let s,a={};const c=(u,l)=>{const f=l.match(u);return f?f[1]:null};return o==="/"||o===""?s=i.jsx(ls,{}):o==="/jobs"?s=i.jsx(zi,{}):o==="/jobs/new"?s=i.jsx(cs,{}):o==="/settings"?s=i.jsx(Em,{}):o.match(/^\/jobs\/([^/]+)\/edit$/)?(a.id=c(/^\/jobs\/([^/]+)\/edit$/,o),s=i.jsx(cs,{...a})):o.match(/^\/jobs\/([^/]+)$/)?(a.id=c(/^\/jobs\/([^/]+)$/,o),s=i.jsx(Li,{...a})):o.match(/^\/jobs\/([^/]+)\/snapshots$/)?(a.id=c(/^\/jobs\/([^/]+)\/snapshots$/,o),s=i.jsx(zr,{...a})):o.match(/^\/targets\/([^/]+)\/snapshots$/)?(a.id=c(/^\/targets\/([^/]+)\/snapshots$/,o),s=i.jsx(zr,{...a})):s=i.jsx(ls,{}),i.jsxs("div",{className:"flex min-h-screen bg-background w-full",children:[t&&i.jsx(Ou,{}),i.jsx("main",{className:"flex-1 min-w-0 overflow-auto py-1 px-1",children:s})]})}function co(e){try{return Be.useParams(e)}catch{const t=window.location.pathname.split("/"),n=t[t.length-1],r=t[t.length-2];return n==="edit"?{id:r}:r==="jobs"?{id:n==="new"?null:n}:{id:null}}}function oc(){const e=Be.useNavigate(),t="/backup";return n=>{let r=n.to;r==="/"&&(r=""),n.params&&Object.entries(n.params).forEach(([s,a])=>{r=r.replace(`$${s}`,a)});const o=r.startsWith("/")?`${t}${r}`:`${t}/${r}`;return e({...n,to:o})}}function Pe(e){const{basePath:t,to:n,params:r,...o}=e,s=t??"/backup";let a=n;if(!a)return i.jsx(Be.Link,{...e});a==="/"&&(a=""),r&&Object.entries(r).forEach(([u,l])=>{a=a.replace(`$${u}`,l)});const c=a.startsWith("/")?`${s}${a}`:`${s}/${a}`;return i.jsx(Be.Link,{...o,to:c})}function To({label:e,value:t,sub:n,className:r,icon:o}){return i.jsx(At,{className:"py-0 shadow-sm border-border/50",children:i.jsxs(Tt,{className:"flex items-center gap-4 p-5",children:[o&&i.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-muted/50",children:i.jsx(o,{className:ae("h-5 w-5",r||"text-muted-foreground")})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wider",children:e}),i.jsx("div",{className:ae("text-2xl font-bold text-foreground mt-0.5",r),children:t??"-"}),n&&i.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:n})]})]})})}function ls(){const e=Re.useQueryClient(),{data:t,isLoading:n}=Re.useQuery({queryKey:["dashboard"],queryFn:Ab.get,refetchInterval:15e3}),{data:r}=Re.useQuery({queryKey:["jobs"],queryFn:He.getAll}),o=Array.isArray(r)?r:[];async function s(u,l){l.preventDefault();try{await He.run(u),Ne.success("Job triggered"),e.invalidateQueries({queryKey:["dashboard"]}),e.invalidateQueries({queryKey:["jobs"]})}catch{Ne.error("Failed to trigger job")}}if(n)return i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});const a=t?.runs??{success_7d:0,failed_7d:0,bytes_7d:0},c=t?.jobs??{total:0,enabled:0};return i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your backup infrastructure"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/jobs/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," New Job"]})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[i.jsx(To,{label:"Active Jobs",value:c.enabled,sub:`${c.total} total`}),i.jsx(To,{label:"Success (7d)",value:a.success_7d,sub:"completed runs",className:"text-emerald-600 dark:text-emerald-400"}),i.jsx(To,{label:"Failed (7d)",value:a.failed_7d,sub:"failed runs",className:Number(a.failed_7d)>0?"text-red-600 dark:text-red-400":void 0}),i.jsx(To,{label:"Data Backed Up (7d)",value:cr(a.bytes_7d),sub:"added this week"})]}),i.jsxs(At,{className:"py-0 gap-0 shadow-sm border-border/50",children:[i.jsxs(lx,{className:"flex flex-row items-center justify-between border-b border-border/40 px-5 py-3.5",children:[i.jsx(ux,{className:"text-base font-semibold",children:"Backup Jobs"}),i.jsx(ge,{variant:"outline",size:"sm",asChild:!0,children:i.jsxs(Pe,{to:"/jobs",children:[i.jsx(dh,{className:"h-4 w-4"})," View all"]})})]}),o.length===0?i.jsxs(Tt,{className:"p-10 text-center text-sm text-muted-foreground",children:["No jobs yet. ",i.jsx(Pe,{to:"/jobs/new",className:"text-primary hover:underline",children:"Create your first job →"})]}):i.jsx(Tt,{className:"p-0",children:i.jsx("div",{className:"divide-y",children:o.slice(0,6).map(u=>{const l=u.last_run??u.lastRun;l&&Gr(l.status);const f=l?.started_at??l?.startedAt;return i.jsxs(Pe,{to:"/jobs/$id",params:{id:u.id},className:"flex items-center justify-between px-5 py-3.5 hover:bg-muted/40 transition",children:[i.jsxs("div",{className:"min-w-0 flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"font-medium truncate",children:u.name}),i.jsx($e,{variant:"outline",className:"font-mono text-xs",children:u.schedule||"Manual"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:l?ci(f):"Never run"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(ge,{variant:"default",size:"sm",className:"h-8 px-3",onClick:d=>s(u.id,d),children:i.jsx(Ja,{className:"h-3.5 w-3.5"})})})]},u.id)})})})]})]})}const mr={getAll:()=>fe.get("/sources"),get:e=>fe.get(`/sources/${e}`),create:e=>fe.post("/sources",e),update:(e,t)=>fe.put(`/sources/${e}`,t),delete:e=>fe.delete(`/sources/${e}`),test:e=>fe.post(`/sources/${e}/test`)},vR={list:[],current:null,loading:!1,error:null},zo=Ce.createAsyncThunk("sources/fetchAll",async()=>await mr.getAll()),xR=Ce.createAsyncThunk("sources/fetchOne",async e=>await mr.get(e)),wR=Ce.createAsyncThunk("sources/create",async e=>await mr.create(e)),_R=Ce.createAsyncThunk("sources/update",async({id:e,data:t})=>await mr.update(e,t)),Lp=Ce.createAsyncThunk("sources/delete",async e=>(await mr.delete(e),e));Ce.createAsyncThunk("sources/test",async e=>await mr.test(e));const SR=Ce.createSlice({name:"sources",initialState:vR,reducers:{},extraReducers:e=>{e.addCase(zo.pending,t=>{t.loading=!0,t.error=null}).addCase(zo.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}).addCase(zo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch sources"}).addCase(xR.fulfilled,(t,n)=>{t.current=n.payload}).addCase(wR.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(_R.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(Lp.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)})}}),ER=SR.reducer;function kR(){const e=ti(),{list:t,loading:n}=ni(a=>a.sources),[r,o]=m.useState(null);m.useEffect(()=>{e(zo())},[e]);const s=async()=>{if(r)try{await e(Lp(r.id)).unwrap(),Ne.success(`Source "${r.name}" deleted`),o(null)}catch{Ne.error("Failed to delete source")}};return n&&t.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Sources"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Databases and filesystems to back up"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Source"]})})]}),t.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No sources yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a database or filesystem to start backing up"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Source"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:t.map(a=>{const c=fd[a.type],u=a.config?.host?`${a.config.host}${a.config.port?`:${a.config.port}`:""}`:a.config?.base_path||"-",l=c?.icon;return i.jsx(Pe,{to:"/sources/$id/edit",params:{id:a.id},className:"block",children:i.jsx(At,{className:"py-0 transition-all hover:-translate-y-0.5 hover:shadow-md",children:i.jsxs(Tt,{className:"space-y-5 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsx("div",{className:"min-w-0",children:i.jsxs("div",{className:"flex items-center gap-2",children:[l?i.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl border bg-muted/40",children:i.jsx(l,{className:"h-4 w-4"})}):null,i.jsxs("div",{children:[i.jsx("h3",{className:"truncate text-base font-semibold",children:a.name}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:u})]})]})}),i.jsxs(Oi,{children:[i.jsx(Pi,{asChild:!0,onClick:f=>f.preventDefault(),children:i.jsx(ge,{variant:"ghost",size:"icon",title:"More actions",children:i.jsx(Ya,{className:"h-4 w-4"})})}),i.jsxs(Di,{align:"end",children:[i.jsx(ar,{asChild:!0,children:i.jsxs(Pe,{to:"/sources/$id/edit",params:{id:a.id},children:[i.jsx(Lr,{className:"mr-2 h-4 w-4"})," Edit"]})}),i.jsxs(ar,{className:"text-destructive focus:text-destructive",onClick:f=>{f.preventDefault(),o(a)},children:[i.jsx(Vr,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx($e,{variant:"outline",children:c?.label??a.type}),i.jsx($e,{variant:"secondary",className:"text-xs",children:(a.scope_type??a.scopeType)==="all"?"Full backup":"Partial scope"})]})]})})},a.id)})}),i.jsx(Qr,{open:!!r,onOpenChange:a=>!a&&o(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Source"}),i.jsxs(oo,{children:['Delete "',r?.name,'"? This will also remove any backup jobs using this source.']})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:s,children:"Delete"})]})]})})]})}const NR={list:[],current:null,snapshots:[],loading:!1,error:null},Lo=Ce.createAsyncThunk("targets/fetchAll",async()=>await en.getAll()),CR=Ce.createAsyncThunk("targets/fetchOne",async e=>await en.get(e)),jR=Ce.createAsyncThunk("targets/create",async e=>await en.create(e)),RR=Ce.createAsyncThunk("targets/update",async({id:e,data:t})=>await en.update(e,t)),Vp=Ce.createAsyncThunk("targets/delete",async e=>(await en.delete(e),e)),AR=Ce.createAsyncThunk("targets/initRepo",async e=>await en.initRepo(e)),TR=Ce.createAsyncThunk("targets/fetchSnapshots",async e=>await en.getSnapshots(e)),OR=Ce.createSlice({name:"targets",initialState:NR,reducers:{},extraReducers:e=>{e.addCase(Lo.pending,t=>{t.loading=!0,t.error=null}).addCase(Lo.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}).addCase(Lo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message??"Failed to fetch targets"}).addCase(CR.fulfilled,(t,n)=>{t.current=n.payload}).addCase(jR.fulfilled,(t,n)=>{t.list.push(n.payload)}).addCase(RR.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.id);r!==-1&&(t.list[r]=n.payload),t.current?.id===n.payload.id&&(t.current=n.payload)}).addCase(Vp.fulfilled,(t,n)=>{t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}).addCase(TR.fulfilled,(t,n)=>{t.snapshots=n.payload})}}),PR=OR.reducer;function DR(){const e=ti(),{list:t,loading:n}=ni(l=>l.targets),[r,o]=m.useState(null),[s,a]=m.useState(new Set);m.useEffect(()=>{e(Lo())},[e]);const c=async()=>{if(r)try{await e(Vp(r.id)).unwrap(),Ne.success(`Target "${r.name}" deleted`),o(null)}catch{Ne.error("Failed to delete target")}},u=async l=>{a(f=>new Set(f).add(l));try{await e(AR(l)).unwrap(),Ne.success("Repository initialized")}catch{Ne.error("Failed to initialize repository")}finally{a(f=>{const d=new Set(f);return d.delete(l),d})}};return n&&t.length===0?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Targets"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Repositories where backups are stored"})]}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/targets/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Target"]})})]}),t.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Tr,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No targets yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure a repository to start storing backups"}),i.jsx(ge,{asChild:!0,children:i.jsxs(Pe,{to:"/targets/new",children:[i.jsx(Rt,{className:"h-4 w-4"})," Add Target"]})})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:t.map(l=>{const f=md[l.type];l.config?.path||l.config?.bucket||l.config?.url||l.config?.host;const d=s.has(l.id),p=f?.icon;return i.jsxs("div",{className:"relative group",children:[i.jsx(Pe,{to:"/targets/$id/snapshots",params:{id:l.id},className:"block h-full",children:i.jsx(At,{className:"h-full flex flex-col items-center justify-center p-6 text-center transition-all hover:-translate-y-1 hover:shadow-lg hover:border-primary/50 bg-background/50 border-dashed",children:i.jsxs(Tt,{className:"p-0 flex flex-col items-center gap-4",children:[i.jsx("div",{className:ae("flex h-16 w-16 items-center justify-center rounded-2xl border bg-muted/30 transition-colors group-hover:bg-primary/5",d&&"animate-pulse border-primary/30"),children:p?i.jsx(p,{className:"h-8 w-8 text-muted-foreground group-hover:text-primary transition-colors"}):i.jsx(Tr,{className:"h-8 w-8"})}),i.jsxs("div",{className:"space-y-1.5 min-w-0 w-full px-2",children:[i.jsx("h3",{className:"truncate text-sm font-bold tracking-tight",children:l.name}),i.jsx("p",{className:"truncate text-[10px] font-medium text-muted-foreground uppercase opacity-70",children:f?.label??l.type})]}),i.jsx("div",{className:"flex flex-wrap items-center justify-center gap-1.5 mt-1",children:i.jsx($e,{variant:"outline",className:ae("px-1.5 py-0 text-[9px] font-bold uppercase tracking-widest",d?"border-primary/50 text-primary":"opacity-60"),children:d?"Initializing":"Ready"})})]})})}),i.jsxs("div",{className:"absolute top-3 right-3 flex flex-col gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-primary hover:text-white transition-colors",onClick:()=>u(l.id),title:"Initialize Repo",children:i.jsx(Xa,{className:ae("h-4 w-4",d&&"animate-spin")})}),i.jsx(Pe,{to:"/targets/$id/edit",params:{id:l.id},children:i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-primary hover:text-white transition-colors",children:i.jsx(Lr,{className:"h-4 w-4"})})}),i.jsx(ge,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full shadow-md hover:bg-destructive hover:text-white transition-colors",onClick:()=>o(l),children:i.jsx(Vr,{className:"h-4 w-4"})})]})]},l.id)})}),i.jsx(Qr,{open:!!r,onOpenChange:l=>!l&&o(null),children:i.jsxs(eo,{children:[i.jsxs(to,{children:[i.jsx(ro,{children:"Delete Target"}),i.jsxs(oo,{children:['Delete "',r?.name,'"? This removes the configuration only and does not delete repository data.']})]}),i.jsxs(no,{children:[i.jsx(ao,{children:"Cancel"}),i.jsx(so,{className:"bg-destructive text-white hover:bg-destructive/90",onClick:c,children:"Delete"})]})]})})]})}function $R(){const{data:e=[],isLoading:t,isError:n}=Re.useQuery({queryKey:["runs"],queryFn:Rb.getAll,refetchInterval:1e4});return t?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsx(rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?i.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:i.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[i.jsx(lh,{className:"h-4 w-4"}),"Failed to load run history"]})}):i.jsxs("div",{className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"All backup runs across all jobs"})]}),e.length===0?i.jsx(At,{children:i.jsxs(Tt,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted/50",children:i.jsx(Ch,{className:"h-8 w-8 text-muted-foreground"})}),i.jsx("h3",{className:"font-semibold",children:"No runs yet"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Triggered jobs will appear here once a backup starts."})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:e.map(r=>{const o=Gr(r.status),s=r.startedAt??r.started_at,a=r.finishedAt??r.finished_at,c=r.snapshotId??r.snapshot_id,u=r.dataAddedBytes??r.data_added_bytes??0,l=r.totalFilesProcessed??r.total_files_processed??0,f=r.jobName??r.job_name??"Unknown job";return i.jsx(At,{className:"py-0",children:i.jsxs(Tt,{className:"space-y-4 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-semibold",children:f})}),i.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[r.id.slice(0,10),"..."]})]}),i.jsx($e,{className:ae("text-xs",o.badge),children:o.label})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Started"}),i.jsx("div",{className:"mt-1 text-foreground",children:li(s)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Duration"}),i.jsx("div",{className:"mt-1 text-foreground",children:ui(s,a)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Files"}),i.jsx("div",{className:"mt-1 text-foreground",children:l>0?`${l} files`:"-"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Data Added"}),i.jsx("div",{className:"mt-1 text-foreground",children:u>0?`+${cr(u)}`:"-"})]})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:i.jsx($e,{variant:"secondary",className:"font-mono text-xs",children:c?c.slice(0,8):"No snapshot"})})]})},r.id)})})]})}const MR={role:null},Bp=Ce.createSlice({name:"auth",initialState:MR,reducers:{setRole(e,t){e.role=t.payload}}}),{setRole:iA}=Bp.actions,IR=Bp.reducer,FR=Ce.configureStore({reducer:{auth:IR,sources:ER,targets:PR,jobs:Fb}});function zR({apiBase:e,token:t,basePath:n="/backup"}){const[r,o]=k.useState(!1),s=k.useMemo(()=>new Re.QueryClient({defaultOptions:{queries:{staleTime:3e4,retry:1}}}),[]);return k.useEffect(()=>{t&&td(t),fe.defaults.baseURL=e,o(!0)},[e,t]),r?i.jsx(Ha.Provider,{store:FR,children:i.jsxs(Re.QueryClientProvider,{client:s,children:[i.jsx(zp,{basePath:n,showSidebar:!1}),i.jsx(BS,{richColors:!0,position:"bottom-right"})]})}):null}Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>Be.useLocation});Object.defineProperty(exports,"useRouter",{enumerable:!0,get:()=>Be.useRouter});exports.DashboardPage=ls;exports.JobDetailPage=Li;exports.JobsPage=zi;exports.Link=Pe;exports.MeyiBackupPage=zR;exports.MeyiBackupRouter=zp;exports.RunHistoryPage=$R;exports.SnapshotsPage=zr;exports.SourcesPage=kR;exports.TargetsPage=DR;exports.api=fe;exports.router=bR;exports.setToken=td;exports.useMeyiParams=co;exports.useNavigate=oc;exports.useParams=co;
|