pulsewatch-frontend 0.1.2 → 0.1.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 +20 -20
- package/dist/index.mjs +3322 -3322
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Dc=require("react-dom");function lb(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 v=lb(T),Ic=lb(Dc);var ji={exports:{}},lo={};var Vh;function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Dc=require("react-dom");function lb(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 v=lb(T),Ic=lb(Dc);var ji={exports:{}},lo={};var Vh;function oE(){if(Vh)return lo;Vh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return lo.Fragment=t,lo.jsx=n,lo.jsxs=n,lo}var uo={};var Bh;function iE(){return Bh||(Bh=1,process.env.NODE_ENV!=="production"&&(function(){function e(I){if(I==null)return null;if(typeof I=="function")return I.$$typeof===N?null:I.displayName||I.name||null;if(typeof I=="string")return I;switch(I){case y:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case k:return"SuspenseList";case O:return"Activity"}if(typeof I=="object")switch(typeof I.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case m:return"Portal";case w:return I.displayName||"Context";case _:return(I._context.displayName||"Context")+".Consumer";case S:var Y=I.render;return I=I.displayName,I||(I=Y.displayName||Y.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case E:return Y=I.displayName||null,Y!==null?Y:e(I.type)||"Memo";case P:Y=I._payload,I=I._init;try{return e(I(Y))}catch{}}return null}function t(I){return""+I}function n(I){try{t(I);var Y=!1}catch{Y=!0}if(Y){Y=console;var K=Y.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return K.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),t(I)}}function r(I){if(I===y)return"<>";if(typeof I=="object"&&I!==null&&I.$$typeof===P)return"<...>";try{var Y=e(I);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function s(){var I=A.A;return I===null?null:I.getOwner()}function o(){return Error("react-stack-top-frame")}function i(I){if(j.call(I,"key")){var Y=Object.getOwnPropertyDescriptor(I,"key").get;if(Y&&Y.isReactWarning)return!1}return I.key!==void 0}function a(I,Y){function K(){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)",Y))}K.isReactWarning=!0,Object.defineProperty(I,"key",{get:K,configurable:!0})}function c(){var I=e(this.type);return H[I]||(H[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function l(I,Y,K,Z,oe,ce){var V=K.ref;return I={$$typeof:p,type:I,key:Y,props:K,_owner:Z},(V!==void 0?V:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:c}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function u(I,Y,K,Z,oe,ce){var V=Y.children;if(V!==void 0)if(Z)if($(V)){for(Z=0;Z<V.length;Z++)d(V[Z]);Object.freeze&&Object.freeze(V)}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(V);if(j.call(Y,"key")){V=e(I);var ee=Object.keys(Y).filter(function(le){return le!=="key"});Z=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",se[V+Z]||(ee=0<ee.length?"{"+ee.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} />`,Z,V,ee,V),se[V+Z]=!0)}if(V=null,K!==void 0&&(n(K),V=""+K),i(Y)&&(n(Y.key),V=""+Y.key),"key"in Y){K={};for(var me in Y)me!=="key"&&(K[me]=Y[me])}else K=Y;return V&&a(K,typeof I=="function"?I.displayName||I.name||"Unknown":I),l(I,V,K,s(),oe,ce)}function d(I){f(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===P&&(I._payload.status==="fulfilled"?f(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function f(I){return typeof I=="object"&&I!==null&&I.$$typeof===p}var h=T,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),w=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,$=Array.isArray,q=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(I){return I()}};var D,H={},F=h.react_stack_bottom_frame.bind(h,o)(),W=q(r(o)),se={};uo.Fragment=y,uo.jsx=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!1,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)},uo.jsxs=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!0,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)}})()),uo}var Uh;function oE(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?ji.exports=rE():ji.exports=sE()),ji.exports}var g=oE();const Fu=new WeakMap,iE=new WeakMap,Ua={current:[]};let Il=!1,jo=0;const Co=new Set,Li=new Map;function ub(e){for(const t of e){if(Ua.current.includes(t))continue;Ua.current.push(t),t.recompute();const n=iE.get(t);if(n)for(const r of n){const s=Fu.get(r);s?.length&&ub(s)}}}function aE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function cE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function db(e){if(jo>0&&!Li.has(e)&&Li.set(e,e.prevState),Co.add(e),!(jo>0)&&!Il)try{for(Il=!0;Co.size>0;){const t=Array.from(Co);Co.clear();for(const n of t){const r=Li.get(n)??n.prevState;n.prevState=r,aE(n)}for(const n of t){const r=Fu.get(n);r&&(Ua.current.push(n),ub(r))}for(const n of t){const r=Fu.get(n);if(r)for(const s of r)cE(s)}}}finally{Il=!1,Ua.current=[],Li.clear()}}function lE(e){jo++;try{e()}finally{if(jo--,jo===0){const t=Co.values().next().value;t&&db(t)}}}function uE(e){return typeof e=="function"}class dE{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var s,o;this.listeners.add(r);const i=(o=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:o.call(s,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,s;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):uE(t)?this.state=t(this.prevState):this.state=t,(s=(r=this.options)==null?void 0:r.onUpdate)==null||s.call(r),db(this)}}const ur="__TSR_index",Wh="popstate",Hh="beforeunload";function fE(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},s=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},o=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const u=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&d)for(const f of u){const h=Wa(c.path,c.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[ur];a=qh(l+1,a),o({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[ur];a=qh(l,a),o({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{o({task:()=>{e.go(i),s({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{o({task:()=>{e.back(i?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{o({task:()=>{e.forward(i?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[ur]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function qh(e,t){t||(t={});const n=Yd();return{...t,key:n,__TSR_key:n,[ur]:e}}function hE(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const o=()=>s,i=E=>s=E,a=(E=>E),c=(()=>Wa(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const E=Yd();t.history.replaceState({[ur]:0,key:E,__TSR_key:E},"")}let l=c(),u,d=!1,f=!1,h=!1,p=!1;const m=()=>l;let y,b;const x=()=>{y&&(k._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),k._ignoreSubscribers=!1,y=void 0,b=void 0,u=void 0)},_=(E,P,O)=>{const N=a(P);b||(u=l),l=Wa(P,O),y={href:N,state:O,isPush:y?.isPush||E==="push"},b||(b=Promise.resolve().then(()=>x()))},w=E=>{l=c(),k.notify({type:E})},S=async()=>{if(f){f=!1;return}const E=c(),P=E.state[ur]-l.state[ur],O=P===1,N=P===-1,A=!O&&!N||d;d=!1;const j=A?"GO":N?"BACK":"FORWARD",$=A?{type:"GO",index:P}:{type:N?"BACK":"FORWARD"};if(h)h=!1;else{const q=o();if(typeof document<"u"&&q.length){for(const D of q)if(await D.blockerFn({currentLocation:l,nextLocation:E,action:j})){f=!0,t.history.go(1),k.notify($);return}}}l=c(),k.notify($)},C=E=>{if(p){p=!1;return}let P=!1;const O=o();if(typeof document<"u"&&O.length)for(const N of O){const A=N.enableBeforeUnload??!0;if(A===!0){P=!0;break}if(typeof A=="function"&&A()===!0){P=!0;break}}if(P)return E.preventDefault(),E.returnValue=""},k=fE({getLocation:m,getLength:()=>t.history.length,pushState:(E,P)=>_("push",E,P),replaceState:(E,P)=>_("replace",E,P),back:E=>(E&&(h=!0),p=!0,t.history.back()),forward:E=>{E&&(h=!0),p=!0,t.history.forward()},go:E=>{d=!0,t.history.go(E)},createHref:E=>a(E),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hh,C,{capture:!0}),t.removeEventListener(Wh,S)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:o,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(Hh,C,{capture:!0}),t.addEventListener(Wh,S),t.history.pushState=function(...E){const P=n.apply(t.history,E);return k._ignoreSubscribers||w("PUSH"),P},t.history.replaceState=function(...E){const P=r.apply(t.history,E);return k._ignoreSubscribers||w("REPLACE"),P},k}function pE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Wa(e,t){const n=pE(e),r=n.indexOf("#"),s=n.indexOf("?"),o=Yd();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[ur]:0,key:o,__TSR_key:o}}}function Yd(){return(Math.random()+1).toString(36).substring(7)}const mE=!1;function Lo(e){let t;return lE(()=>{t=e()}),t}function Ho(e){return e[e.length-1]}function gE(e){return typeof e=="function"}function sr(e,t){return gE(e)?e(t):e}const yE=Object.prototype.hasOwnProperty,Kh=Object.prototype.propertyIsEnumerable;function Ot(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,s=Yh(e)&&Yh(r);if(!s&&!(Ha(e)&&Ha(r)))return r;const o=s?e:Zh(e);if(!o)return r;const i=s?r:Zh(r);if(!i)return r;const a=o.length,c=i.length,l=s?new Array(c):{};let u=0;for(let d=0;d<c;d++){const f=s?d:i[d],h=e[f],p=r[f];if(h===p){l[f]=h,(s?d<a:yE.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[f]=p;continue}const m=Ot(h,p,n+1);l[f]=m,m===h&&u++}return a===c&&u===a?e:l}function Zh(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Kh.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!Kh.call(e,s))return!1;r.push(s)}return r}function Ha(e){if(!Gh(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Gh(n)||!n.hasOwnProperty("isPrototypeOf"))}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!Wr(e[r],t[r],n))return!1;return!0}if(Ha(e)&&Ha(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Wr(e[i],t[i],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&s++;let o=0;for(const i in t)if((!r||t[i]!==void 0)&&(o++,o>s||!Wr(e[i],t[i],n)))return!1;return s===o}return!1}function Us(e){let t,n;const r=new Promise((s,o)=>{t=s,n=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Ms(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Xh(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}}function bE(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Jh(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return bE(t)}const fb=["http:","https:","mailto:","tel:"];function qa(e){if(!e)return!1;try{const t=new URL(e);return!fb.includes(t.protocol)}catch{return!1}}function fo(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,s="",o;for(;(o=n.exec(e))!==null;)s+=Jh(e.slice(r,o.index))+o[0],r=n.lastIndex;return s=s+Jh(r?e.slice(r):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function vE(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var xE=process.env.NODE_ENV==="production",jl="Invariant failed";function qn(e,t){if(!e){if(xE)throw new Error(jl);var n=typeof t=="function"?t():t,r=n?"".concat(jl,": ").concat(n):jl;throw new Error(r)}}function Ka(e){const t=new Map;let n,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const i=t.get(o);if(i)return s(i),i.value},set(o,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(o);if(a)a.value=i,s(a);else{const c={key:o,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(o,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ws=0,Yr=1,Xr=2,qo=3,Fr=4,hb=5;function _E(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Xd(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,o=e.substring(t,s);if(!o||!o.includes("$"))return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(o==="$"){const a=e.length;return n[0]=Xr,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(o.charCodeAt(0)===36)return n[0]=Yr,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const i=_E(o);if(i){const[a,c]=i,l=o.charCodeAt(a+1);if(l===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const u=a+3,d=c;if(u<d)return n[0]=qo,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=s,n}}else if(l===36){const u=a+1,d=a+2;return d===c?(n[0]=Xr,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=Yr,n[1]=t+a,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=s,n)}}return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function jc(e,t,n,r,s,o,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,u=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=Xd(c,a,t);let p;const m=a,y=h[5];switch(a=y+1,o++,h[0]){case Ws:{const x=c.substring(h[2],h[3]);if(u){const _=s.static?.get(x);if(_)p=_;else{s.static??=new Map;const w=zr(n.fullPath??n.from);w.parent=s,w.depth=o,p=w,s.static.set(x,w)}}else{const _=x.toLowerCase(),w=s.staticInsensitive?.get(_);if(w)p=w;else{s.staticInsensitive??=new Map;const S=zr(n.fullPath??n.from);S.parent=s,S.depth=o,p=S,s.staticInsensitive.set(_,S)}}break}case Yr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(Yr,n.fullPath??n.from,w,S,C);p=E,E.depth=o,E.parent=s,s.dynamic??=[],s.dynamic.push(E)}break}case qo:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(qo,n.fullPath??n.from,w,S,C);p=E,E.parent=s,E.depth=o,s.optional??=[],s.optional.push(E)}break}case Xr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=Fl(Xr,n.fullPath??n.from,w,S,C);p=k,k.parent=s,k.depth=o,s.wildcard??=[],s.wildcard.push(k)}}s=p}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=zr(n.fullPath??n.from);h.kind=hb,h.parent=s,o++,h.depth=o,s.pathless??=[],s.pathless.push(h),s=h}const f=(n.path||!n.children)&&!n.isRoot;if(f&&c.endsWith("/")){const h=zr(n.fullPath??n.from);h.kind=Fr,h.parent=s,o++,h.depth=o,s.index=h,s=h}s.parse=n.options?.params?.parse??null,s.skipOnParamError=d,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,f&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)jc(e,t,c,a,s,o,i)}function Ll(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function rr(e){if(e.pathless)for(const t of e.pathless)rr(t);if(e.static)for(const t of e.static.values())rr(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())rr(t);if(e.dynamic?.length){e.dynamic.sort(Ll);for(const t of e.dynamic)rr(t)}if(e.optional?.length){e.optional.sort(Ll);for(const t of e.optional)rr(t)}if(e.wildcard?.length){e.wildcard.sort(Ll);for(const t of e.wildcard)rr(t)}}function zr(e){return{kind:Ws,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fl(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function wE(e,t){const n=zr("/"),r=new Uint16Array(6);for(const s of e)jc(!1,r,s,1,n,0);rr(n),t.masksTree=n,t.flatCache=Ka(1e3)}function SE(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Jd(e,t.masksTree);return t.flatCache.set(e,r),r}function EE(e,t,n,r,s){e||="/",r||="/";const o=t?`case\0${e}`:e;let i=s.singleCache.get(o);if(!i){i=zr("/");const a=new Uint16Array(6);jc(t,a,{from:e},1,i,0),s.singleCache.set(o,i)}return Jd(r,i,n)}function kE(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let o;try{o=Jd(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)o=null;else throw i}return o&&(o.branch=PE(o.route)),t.matchCache.set(r,o),o}function CE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function RE(e,t=!1,n){const r=zr(e.fullPath),s=new Uint16Array(6),o={},i={};let a=0;return jc(t,s,e,1,r,0,l=>{if(n?.(l,a),qn(!(l.id in o),`Duplicate routes found with id: ${String(l.id)}`),o[l.id]=l,a!==0&&l.path){const u=CE(l.fullPath);(!i[u]||l.fullPath.endsWith("/"))&&(i[u]=l)}a++}),rr(r),{processedTree:{segmentTree:r,singleCache:Ka(1e3),matchCache:Ka(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:i}}function Jd(e,t,n=!1){const r=e.split("/"),s=TE(e,r,t,n);if(!s)return null;const[o]=pb(e,r,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function pb(e,t,n){const r=OE(n.node);let s=null;const o={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const u=r[a];if(u.kind===Fr)break;if(u.kind===hb){l--,i--,c--;continue}const d=t[i],f=c;if(d&&(c+=d.length),u.kind===Yr){s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0;if(h.charCodeAt(p)===123){const y=u.suffix?.length??0,b=h.substring(p+2,h.length-y-1),x=d.substring(p,d.length-y);o[b]=decodeURIComponent(x)}else{const y=h.substring(1);o[y]=decodeURIComponent(d)}}else if(u.kind===qo){if(n.skipped&1<<a){i--,c=f-1;continue}s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0,m=u.suffix?.length??0,y=h.substring(p+3,h.length-m-1),b=u.suffix||u.prefix?d.substring(p,d.length-m):d;b&&(o[y]=decodeURIComponent(b))}else if(u.kind===Xr){const h=u,p=e.substring(f+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(p);o["*"]=m,o._splat=m;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:i,node:a,path:c,segment:l}]}function PE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function OE(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function TE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Ho(t),o=s&&e!=="/",i=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,u=null;for(;a.length;){const d=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:y,dynamics:b,optionals:x}=d;let{extract:_,rawParams:w,parsedParams:S}=d;if(f.skipOnParamError){if(!zl(e,t,d))continue;w=d.rawParams,_=d.extract,S=d.parsedParams}r&&f.route&&f.kind!==Fr&&ho(l,d)&&(l=d);const C=h===i;if(C&&(f.route&&!o&&ho(u,d)&&(u=d),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const k=C?void 0:t[h];let E;if(C&&f.index){const P={node:f.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};let O=!0;if(f.index.skipOnParamError&&(zl(e,t,P)||(O=!1)),O){if(y===i&&!b&&!x&&!p)return P;ho(u,P)&&(u=P)}}if(f.wildcard&&ho(c,d))for(const P of f.wildcard){const{prefix:O,suffix:N}=P;if(O&&(C||!(P.caseSensitive?k:E??=k.toLowerCase()).startsWith(O)))continue;if(N){if(C)continue;const j=t.slice(h).join("/").slice(-N.length);if((P.caseSensitive?j:j.toLowerCase())!==N)continue}const A={node:P,index:i,skipped:p,depth:m,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};if(!(P.skipOnParamError&&!zl(e,t,A))){c=A;break}}if(f.optional){const P=p|1<<m,O=m+1;for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N];a.push({node:A,index:h,skipped:P,depth:O,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C)for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N],{prefix:j,suffix:$}=A;if(j||$){const q=A.caseSensitive?k:E??=k.toLowerCase();if(j&&!q.startsWith(j)||$&&!q.endsWith($))continue}a.push({node:A,index:h+1,skipped:p,depth:O,statics:y,dynamics:b,optionals:x+1,extract:_,rawParams:w,parsedParams:S})}}if(!C&&f.dynamic&&k)for(let P=f.dynamic.length-1;P>=0;P--){const O=f.dynamic[P],{prefix:N,suffix:A}=O;if(N||A){const j=O.caseSensitive?k:E??=k.toLowerCase();if(N&&!j.startsWith(N)||A&&!j.endsWith(A))continue}a.push({node:O,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:b+1,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.staticInsensitive){const P=f.staticInsensitive.get(E??=k.toLowerCase());P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.static){const P=f.static.get(k);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(f.pathless){const P=m+1;for(let O=f.pathless.length-1;O>=0;O--){const N=f.pathless[O];a.push({node:N,index:h,skipped:p,depth:P,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}}}if(u&&c)return ho(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let d=l.index;for(let h=0;h<l.index;h++)d+=t[h].length;const f=d===e.length?"/":e.slice(d);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(f),l}return null}function zl(e,t,n){try{const[r,s]=pb(e,t,n);n.rawParams=r,n.extract=s;const o=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,o),!0}catch{return null}}function ho(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Fr)>(e.node.kind===Fr)||t.node.kind===Fr==(e.node.kind===Fr)&&t.depth>e.depth))):!0}function Ea(e){return Qd(e.filter(t=>t!==void 0).join("/"))}function Qd(e){return e.replace(/\/{2,}/g,"/")}function mb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Vn(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function gb(e){return Vn(mb(e))}function Za(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function ME(e,t,n){return Za(e,n)===Za(t,n)}function AE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),o=!s&&t===".";let i;if(r){i=s?t:o?e:e+"\0"+t;const d=r.get(i);if(d)return d}let a;if(o)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&Ho(a)==="";)a.pop();const d=t.split("/");for(let f=0,h=d.length;f<h;f++){const p=d[f];p===""?f?f===h-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Ho(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let d=0;d<a.length;d++){d>0&&(l+="/");const f=a[d];if(!f)continue;c=Xd(f,0,c);const h=c[0];if(h===Ws){l+=f;continue}const p=c[5],m=f.substring(0,c[1]),y=f.substring(c[4],p),b=f.substring(c[2],c[3]);h===Yr?l+=m||y?`${m}{$${b}}${y}`:`$${b}`:h===Xr?l+=m||y?`${m}{$}${y}`:"$":l+=`${m}{-$${b}}${y}`}l=Qd(l);const u=l||"/";return i&&r&&r.set(i,u),u}function NE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,o=>t.get(o)??o)}function $l(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Qh(s,n)).join("/"):Qh(r,n)}function Vl({path:e,params:t,decoder:n,server:r}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let a=0,c,l="";for(;a<i;){const d=a;c=Xd(e,d,c);const f=c[5];if(a=f+1,d===f)continue;const h=c[0];if(h===Ws){l+="/"+e.substring(d,f);continue}if(h===Xr){const p=t._splat;o._splat=p,o["*"]=p;const m=e.substring(d,c[1]),y=e.substring(c[4],f);if(!p){s=!0,(m||y)&&(l+="/"+m+y);continue}const b=$l("_splat",t,n);l+="/"+m+b+y;continue}if(h===Yr){const p=e.substring(c[2],c[3]);!s&&!(p in t)&&(s=!0),o[p]=t[p];const m=e.substring(d,c[1]),y=e.substring(c[4],f),b=$l(p,t,n)??"undefined";l+="/"+m+b+y;continue}if(h===qo){const p=e.substring(c[2],c[3]),m=t[p];if(m==null)continue;o[p]=m;const y=e.substring(d,c[1]),b=e.substring(c[4],f),x=$l(p,t,n)??"";l+="/"+y+x+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function Qh(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Wt(e){return!!e?.isNotFound}function DE(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const zu="tsr-scroll-restoration-v1_3",IE=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function jE(){const e=DE();if(!e)return null;const t=e.getItem(zu);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=sr(r,n)||n;try{e.setItem(zu,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Fi=jE(),LE=e=>e.state.__TSR_key||e.href;function FE(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ga=!1;function zE({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:s,location:o}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Ga=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const f=c[d];if(d==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(d){const h=document.querySelector(d);h&&(h.scrollLeft=f.scrollX,h.scrollTop=f.scrollY)}}break e}const l=(o??window.location).hash.split("#",2)[1];if(l){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const f=document.getElementById(l);f&&f.scrollIntoView(d)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),s)for(const d of s){if(d==="window")continue;const f=typeof d=="function"?d():document.querySelector(d);f&&f.scrollTo(u)}}Ga=!1}function $E(e,t){if(!Fi||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Fi))return;e.isScrollRestorationSetup=!0,Ga=!1;const r=e.options.getScrollRestorationKey||LE;window.history.scrollRestoration="manual";const s=o=>{if(Ga||!e.isScrollRestoring)return;let i="";if(o.target===document||o.target===window)i="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=FE(o.target)}const a=r(e.state.location);Fi.set(c=>{const l=c[a]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const d=document.querySelector(i);d&&(u.scrollX=d.scrollLeft||0,u.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",IE(s,100),!0),e.subscribe("onRendered",o=>{const i=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(zE({storageKey:zu,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Fi.set(a=>(a[i]||={},a)))})}function VE(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function BE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function Bl(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function UE(e){const t=new URLSearchParams(e),n={};for(const[r,s]of t.entries()){const o=n[r];o==null?n[r]=Bl(s):Array.isArray(o)?o.push(Bl(s)):n[r]=[o,Bl(s)]}return n}const WE=qE(JSON.parse),HE=KE(JSON.stringify,JSON.parse);function qE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=UE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function KE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=BE(s,r);return o?`?${o}`:""}}const Gt="__root__";function yb(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&qa(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${fb.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Jt(e){return e instanceof Response&&!!e.options}const ka=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lc=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),As=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let o=0;o<=s;o++){const i=e.matches[o];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},bb=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),qn(n.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const r=e.matches.find(s=>s.routeId===n.id);qn(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,s=>({...s,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,bb(e,t))},or=(e,t,n)=>{if(!(!Jt(n)&&!Wt(n))){if(Jt(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Jt(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,s=>({...s,status:r,context:As(e,t.index),isFetching:!1,error:n})),Wt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Jt(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(bb(e,n),n)}},vb=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,po=(e,t,n,r)=>{const{id:s,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,or(e,e.router.getMatch(s),n);try{i.options.onError?.(n)}catch(a){n=a,or(e,e.router.getMatch(s),n)}e.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},xb=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Lc(e,t)&&(n.options.loader||n.options.beforeLoad||Sb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ka(e)},s);r._nonReactive.pendingTimeout=i}},ZE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;xb(e,t,n,r);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&or(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},GE=(e,t,n,r)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Us(()=>{o?.resolve()});const{paramsError:i,searchError:a}=s;i&&po(e,n,i,"PARSE_PARAMS"),a&&po(e,n,a,"VALIDATE_SEARCH"),xb(e,t,r,s);const c=new AbortController;let l=!1;const u=()=>{l||(l=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:c})))},d=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){Lo(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Us();const f={...As(e,n,!1),...s.__routeContext},{search:h,params:p,cause:m}=s,y=Lc(e,t),b={search:h,abortController:c,params:p,preload:y,context:f,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":m,matches:e.matches,...e.router.options.additionalContext},x=w=>{if(w===void 0){Lo(()=>{u(),d()});return}(Jt(w)||Wt(w))&&(u(),po(e,n,w,"BEFORE_LOAD")),Lo(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:w})),d()})};let _;try{if(_=r.options.beforeLoad(b),Ms(_))return u(),_.catch(w=>{po(e,n,w,"BEFORE_LOAD")}).then(x)}catch(w){u(),po(e,n,w,"BEFORE_LOAD")}x(_)},YE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],o=()=>a(),i=()=>GE(e,n,t,s),a=()=>{if(vb(e,n))return;const c=ZE(e,n,s);return Ms(c)?c.then(i):i()};return o()},XE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([o,i,a])=>{const c=o?.meta,l=o?.links,u=o?.scripts,d=o?.styles;return{meta:c,links:l,headScripts:u,headers:a,scripts:i,styles:d}})},_b=(e,t,n,r)=>{const s=e.matchPromises[n-1],{params:o,loaderDeps:i,abortController:a,cause:c}=e.router.getMatch(t),l=As(e,n),u=Lc(e,t);return{params:o,deps:i,preload:!!u,parentMatchPromise:s,abortController:a,context:l,location:e.location,navigate:d=>e.router.navigate({...d,_fromLocation:e.location}),cause:u?"preload":c,route:r,...e.router.options.additionalContext}},ep=async(e,t,n,r)=>{try{const s=e.router.getMatch(t);try{(!(mE??e.router.isServer)||s.ssr===!0)&&wb(r);const o=r.options.loader?.(_b(e,t,n,r)),i=r.options.loader&&Ms(o);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,l=>({...l,isFetching:"loader"})),r.options.loader){const l=i?await o:o;or(e,e.router.getMatch(t),l),l!==void 0&&e.updateMatch(t,u=>({...u,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,l=>({...l,error:void 0,context:As(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let i=o;if(i?.name==="AbortError"){e.updateMatch(t,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:As(e,n)}));return}const a=s._nonReactive.minPendingPromise;a&&await a,Wt(o)&&await r.options.notFoundComponent?.preload?.(),or(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(c){i=c,or(e,e.router.getMatch(t),c)}e.updateMatch(t,c=>({...c,error:i,context:As(e,n),status:"error",isFetching:!1}))}}catch(s){const o=e.router.getMatch(t);o&&(o._nonReactive.loaderPromise=void 0),or(e,o,s)}},JE=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let s=!1,o=!1;const i=e.router.looseRoutesById[r];if(!vb(e,n)){const l=e.router.getMatch(n);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!e.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=e.router.getMatch(n),d=u._nonReactive.error||u.error;d&&or(e,u,d)}else{const u=Date.now()-l.updatedAt,d=Lc(e,n),f=d?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,h=i.options.shouldReload,p=typeof h=="function"?h(_b(e,n,t,i)):h,m=!!d&&!e.router.state.matches.some(_=>_.id===n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=Us(),m!==y.preload&&e.updateMatch(n,_=>({..._,preload:m}));const{status:b,invalid:x}=y;s=b==="success"&&(x||(p??u>f)),d&&i.options.preload===!1||(s&&!e.sync?(o=!0,(async()=>{try{await ep(e,n,t,i);const _=e.router.getMatch(n);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){Jt(_)&&await e.router.navigate(_.options)}})()):(b!=="success"||s&&e.sync)&&await ep(e,n,t,i))}}const a=e.router.getMatch(n);o||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,o||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=o?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(e.updateMatch(n,l=>({...l,isFetching:c,invalid:!1})),e.router.getMatch(n)):a};async function tp(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ka(t);try{for(let a=0;a<t.matches.length;a++){const c=YE(t,a);Ms(c)&&await c}const n=t.firstBadMatchIndex??t.matches.length;for(let a=0;a<n;a++)t.matchPromises.push(JE(t,a));const s=(await Promise.allSettled(t.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let o;for(const a of s){if(Jt(a))throw a;!o&&Wt(a)&&(o=a)}for(const a of t.matches){const{id:c,routeId:l}=a,u=t.router.looseRoutesById[l];try{const d=XE(t,c,u);if(d){const f=await d;t.updateMatch(c,h=>({...h,...f}))}}catch(d){console.error(`Error executing head for route ${l}:`,d)}}if(o)throw o;const i=ka(t);Ms(i)&&await i}catch(n){if(Wt(n)&&!t.preload){const r=ka(t);throw Ms(r)&&await r,n}if(Jt(n))throw n}return t.matches}async function wb(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of Eb){const s=e.options[r]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Sb(e){for(const t of Eb)if(e.options[t]?.preload)return!0;return!1}const Eb=["component","errorComponent","pendingComponent","notFoundComponent"];function QE(e){return{input:({url:t})=>{for(const n of e)t=$u(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=kb(e[n],t);return t}}}function ek(e){const t=gb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===s?i.pathname="/":a.startsWith(o)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=Ea(["/",t,i.pathname]),i)}}function $u(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function kb(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Hr(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,s=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:s,hashChanged:o}}class tk{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,s=this.basepath??r?.basepath??"/",o=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=NE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=hE()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Ka(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=new dE(rk(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),$E(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(o||s!==c||i!==l){this.basepath=c;const f=[],h=gb(c);h&&h!=="/"&&f.push(ek({basepath:c})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:QE(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=RE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&wE(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:l,hash:u,href:d,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const x=this.options.parseSearch(l),_=this.options.stringifySearch(x);return{href:c+_+u,publicHref:d,pathname:fo(c),external:!1,searchStr:_,search:Ot(r?.search,x),hash:fo(u.slice(1)),state:Ot(r?.state,f)}}const h=new URL(d,this.origin),p=$u(this.rewrite,h),m=this.options.parseSearch(p.search),y=this.options.stringifySearch(m);return p.search=y,{href:p.href.replace(p.origin,""),publicHref:d,pathname:fo(p.pathname),external:!!this.rewrite&&p.origin!==this.origin,searchStr:y,search:Ot(r?.search,m),hash:fo(p.hash.slice(1)),state:Ot(r?.state,f)}},o=s(n),{__tempLocation:i,__tempKey:a}=o.state;if(i&&(!a||a===this.tempLocationKey)){const c=s(i);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>AE({base:n,to:Qd(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>sk({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const i=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);if(o.from&&process.env.NODE_ENV!=="production"&&o._isNavigate){const j=this.getMatchedRoutes(o.from).matchedRoutes,$=Xh(a.matchedRoutes,D=>rp(D.fullPath,o.from)),q=Xh(j,D=>rp(D.fullPath,a.fullPath));!$&&!q&&console.warn(`Could not find match for from: ${o.from}`)}const c=o.unsafeRelative==="path"?i.pathname:o.from??a.fullPath,l=this.resolvePathWithBase(c,"."),u=a.search,d={...a.params},f=o.to?this.resolvePathWithBase(l,`${o.to}`):this.resolvePathWithBase(l,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?d:Object.assign(d,sr(o.params,d)),p=Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,m=this.getMatchedRoutes(p);let y=m.matchedRoutes;(m.foundRoute?m.foundRoute.path!=="/"&&m.routeParams["**"]:Vn(p))&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]);let x=!1;if(Object.keys(h).length>0)for(const j of y){const $=j.options.params?.stringify??j.options.stringifyParams;$&&(x=!0,Object.assign(h,$(h)))}const _=n.leaveParams?f:fo(x?Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:p);let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const j={};y.forEach($=>{if($.options.validateSearch)try{Object.assign(j,Ca($.options.validateSearch,{...j,...w}))}catch{}}),w=j}w=ok({search:w,dest:o,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),w=Ot(u,w);const S=this.options.stringifySearch(w),C=o.hash===!0?i.hash:o.hash?sr(o.hash,i.hash):void 0,k=C?`#${C}`:"";let E=o.state===!0?i.state:o.state?sr(o.state,i.state):{};E=Ot(i.state,E);const P=`${_}${S}${k}`;let O,N,A=!1;if(this.rewrite){const j=new URL(P,this.origin),$=kb(this.rewrite,j);O=j.href.replace(j.origin,""),$.origin!==this.origin?(N=$.href,A=!0):N=$.pathname+$.search+$.hash}else O=vE(P),N=O;return{publicHref:N,href:O,pathname:_,search:w,searchStr:S,state:E,hash:C??"",external:A,unmaskOnReload:o.unmaskOnReload}},s=(o={},i)=>{const a=r(o);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const u=SE(a.pathname,this.processedTree);if(u){Object.assign(l,u.rawParams);const{from:d,params:f,...h}=u.route,p=f===!1||f===null?{}:(f??!0)===!0?l:Object.assign(l,sr(f,l));i={from:n.from,...h,params:p},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const l=Wr(s.state,this.latestLocation.state);return c.forEach(u=>{delete s.state[u]}),l},i=Vn(this.latestLocation.href)===Vn(s.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Us(()=>{a?.resolve()}),i&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...u}=s;c&&(u={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:i,href:a,...c}={})=>{if(a){const d=this.history.location.state.__TSR_index,f=Wa(a,{__TSR_index:n?d:d+1}),h=new URL(f.pathname,this.origin),p=$u(this.rewrite,h);c.to=p.pathname,c.search=this.options.parseSearch(f.search),c.hash=f.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:o,...i})=>{let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const l=this.buildLocation({to:n,...i});s=s??l.publicHref,o=o??l.publicHref}const c=!a&&o?o:s;if(qa(c))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${c}`),Promise.resolve();if(!i.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const d of u)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(s=>!n.some(o=>o.id===s.id))}))},this.load=async n=>{let r,s,o;for(o=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Hr({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...Hr({resolvedLocation:l,location:c})}),await tp({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],d=[],f=[];Lo(()=>{this.__store.setState(h=>{const p=h.matches,m=h.pendingMatches||h.matches;return u=p.filter(y=>!m.some(b=>b.id===y.id)),d=m.filter(y=>!p.some(b=>b.id===y.id)),f=m.filter(y=>p.some(b=>b.id===y.id)),{...h,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...h.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[d,"onEnter"],[f,"onStay"]].forEach(([h,p])=>{h.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(c){Jt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Wt(c)&&(s=c),this.__store.setState(l=>({...l,statusCode:r?r.status:s?404:l.matches.some(u=>u.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(Hr({resolvedLocation:i,location:o})):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";s&&this.__store.setState(o=>({...o,[s]:o[s]?.map(i=>i.id===n?r(i):i)}))})},this.getMatch=n=>{const r=s=>s.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:s.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!r(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const o=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=wb,this.preloadRoute=async n=>{const r=this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...o,...this.state.cachedMatches.map(a=>a.id)]);Lo(()=>{s.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return s=await tp({router:this,matches:s,location:r,preload:!0,updateMatch:(a,c)=>{o.has(a)?s=s.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),s}catch(a){if(Jt(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});Wt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(s);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=EE(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!Wr(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Wr(a.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??HE,parseSearch:t.parseSearch??WE}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(s?s.path!=="/"&&o["**"]:Vn(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?ak(this.options.notFoundMode,a):void 0,u=[],d=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((f,h)=>{const p=u[h-1],[m,y,b]=(()=>{const $=p?.search??t.search,q=p?._strictSearch??void 0;try{const D=Ca(f.options.validateSearch,{...$})??void 0;return[{...$,...D},{...q,...D},void 0]}catch(D){let H=D;if(D instanceof Ya||(H=new Ya(D.message,{cause:D})),n?.throwOnError)throw H;return[$,{},H]}})(),x=f.options.loaderDeps?.({search:m})??"",_=x?JSON.stringify(x):"",{interpolatedPath:w,usedParams:S}=Vl({path:f.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),C=f.id+w+_,k=this.getMatch(C),E=this.state.matches.find($=>$.routeId===f.id),P=k?._strictParams??S;let O;if(!k)try{sp(f,S,i,P)}catch($){if(Wt($)||Jt($)?O=$:O=new nk($.message,{cause:$}),n?.throwOnError)throw O}Object.assign(o,P);const N=E?"stay":"enter";let A;if(k)A={...k,cause:N,params:E?Ot(E.params,o):o,_strictParams:P,search:Ot(E?E.search:k.search,m),_strictSearch:y};else{const $=f.options.loader||f.options.beforeLoad||f.lazyFn||Sb(f)?"pending":"success";A={id:C,ssr:f.options.ssr,index:h,routeId:f.id,params:E?Ot(E.params,o):o,_strictParams:P,pathname:w,updatedAt:Date.now(),search:E?Ot(E.search,m):m,_strictSearch:y,searchError:void 0,status:$,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:Us()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:N,loaderDeps:E?Ot(E.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(A.globalNotFound=l===f.id),A.searchError=b;const j=d(p);A.context={...j,...A.__routeContext,...A.__beforeLoadContext},u.push(A)}),u.forEach((f,h)=>{const p=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)){const y=u[h-1],b=d(y);if(p.options.context){const x={deps:f.loaderDeps,params:f.params,context:b??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:u};f.__routeContext=p.options.context(x)??void 0}f.context={...b,...f.__routeContext,...f.__beforeLoadContext}}}),u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Ho(n),i={...t.search};for(const u of n)try{Object.assign(i,Ca(u.options.validateSearch,i))}catch{}const a=Ho(this.state.matches),c=a&&a.routeId===o.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const u={...r};for(const d of n)try{sp(d,r,s??{},u)}catch{}l=u}return{matchedRoutes:n,fullPath:o.fullPath,search:i,params:l}}}class Ya extends Error{}class nk extends Error{}const np=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function rp(e,t){return np(e)===np(t)}function rk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ca(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ya("Async validation not supported");if(n.issues)throw new Ya(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function sk({pathname:e,routesById:t,processedTree:n}){const r={},s=Vn(e);let o,i;const a=kE(s,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[Gt]],routeParams:r,foundRoute:o,parsedParams:i}}function ok({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ik(n)(e,t,r??!1)}function ik(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)s.options.search?.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const o=({search:i,next:a})=>{let c=i;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(c=s.options.preSearchFilters.reduce((u,d)=>d(u),i));const l=a(c);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((u,d)=>d(u),l):l};t.middlewares.push(o)}if(s.options.validateSearch){const o=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,...Ca(s.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:s})=>{const o=t.dest;return o.search?o.search===!0?s:sr(o.search,s):{}};t.middlewares.push(n);const r=(s,o,i)=>{if(s>=i.length)return o;const a=i[s];return a({search:o,next:l=>r(s+1,l,i)})};return function(o,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,o,t.middlewares)}}function ak(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Gt}function sp(e,t,n,r){const s=e.options.params?.parse??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const ck="Error preloading route! ☝️";class Cb{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,s=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Gt:this.parentRoute||qn(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let o=s?Gt:r?.path;o&&o!=="/"&&(o=mb(o));const i=r?.id||o;let a=s?Gt:Ea([this.parentRoute.id===Gt?"":this.parentRoute.id,i]);o===Gt&&(o="/"),a!==Gt&&(a=Ea(["/",a]));const c=a===Gt?"/":Ea([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=c,this._to=Vn(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>yb({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class lk extends Cb{constructor(t){super(t)}}const zi=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Ul(e){const t=v.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function uk(e,t,n={},r={}){v.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function dk(e){const t=v.useRef(null);return v.useImperativeHandle(e,()=>t.current,[]),t}function ef(e){const t=e.errorComponent??tf;return g.jsx(fk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?v.createElement(t,{error:n,reset:r}):e.children})}class fk extends v.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function tf({error:e}){const[t,n]=v.useState(process.env.NODE_ENV!=="production");return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function hk({children:e,fallback:t=null}){return Rb()?g.jsx(T.Fragment,{children:e}):g.jsx(T.Fragment,{children:t})}function Rb(){return T.useSyncExternalStore(pk,()=>!0,()=>!1)}function pk(){return()=>{}}var mk=process.env.NODE_ENV==="production";function Hs(e,t){if(!mk){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var $i={exports:{}},Wl={},Vi={exports:{}},Hl={};var op;function gk(){if(op)return Hl;op=1;var e=T;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,y=p[1];return o(function(){m.value=h,m.getSnapshot=f,c(m)&&y({inst:m})},[d,h,f]),s(function(){return c(m)&&y({inst:m}),d(function(){c(m)&&y({inst:m})})},[d]),i(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Hl.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Hl}var ql={};var ip;function yk(){return ip||(ip=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function t(h,p){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=p();if(!d){var y=p();o(m,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=i({inst:{value:m,getSnapshot:p}});var b=y[0].inst,x=y[1];return c(function(){b.value=m,b.getSnapshot=p,n(b)&&x({inst:b})},[h,m,p]),a(function(){return n(b)&&x({inst:b}),h(function(){n(b)&&x({inst:b})})},[h]),l(m),m}function n(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!o(h,m)}catch{return!0}}function r(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=T,o=typeof Object.is=="function"?Object.is:e,i=s.useState,a=s.useEffect,c=s.useLayoutEffect,l=s.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ql.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ql}var ap;function Pb(){return ap||(ap=1,process.env.NODE_ENV==="production"?Vi.exports=gk():Vi.exports=yk()),Vi.exports}var cp;function bk(){if(cp)return Wl;cp=1;var e=T,t=Pb();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Wl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},Wl}var Kl={};var lp;function vk(){return lp||(lp=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=Pb(),r=typeof Object.is=="function"?Object.is:e,s=n.useSyncExternalStore,o=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Kl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Kl}var up;function xk(){return up||(up=1,process.env.NODE_ENV==="production"?$i.exports=bk():$i.exports=vk()),$i.exports}var _k=xk();function wk(e,t=r=>r,n={}){const r=n.equal??Sk;return _k.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Sk(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!t.has(r)||!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=dp(e);if(n.length!==dp(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function dp(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Zl=v.createContext(null);function Ob(){return typeof document>"u"?Zl:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Zl,Zl)}function tn(e){const t=v.useContext(Ob());return Hs(!((e?.warn??!0)&&!t),"useRouter must be used inside a <RouterProvider> component!"),t}function Qt(e){const t=tn({warn:e?.router===void 0}),n=e?.router||t,r=T.useRef(void 0);return wk(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Ot(r.current,e.select(s));return r.current=o,o}return e.select(s)}return s})}const Fc=v.createContext(void 0),Ek=v.createContext(void 0);function Pn(e){const t=v.useContext(e.from?Ek:Fc);return Qt({select:r=>{const s=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(qn(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function nf(e){return Pn({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rf(e){const{select:t,...n}=e;return Pn({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function pi(e){return Pn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function sf(e){return Pn({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ls(e){const t=tn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function kk(e,t){const n=tn(),r=dk(t),{activeProps:s,inactiveProps:o,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:h,viewTransition:p,children:m,target:y,disabled:b,style:x,className:_,onClick:w,onFocus:S,onMouseEnter:C,onMouseLeave:k,onTouchStart:E,ignoreBlocker:P,params:O,search:N,hash:A,state:j,mask:$,reloadDocument:q,unsafeRelative:D,from:H,_fromLocation:F,...W}=e,se=Rb(),I=Qt({select:B=>B.location.search,structuralSharing:!0}),Y=e.from,K=v.useMemo(()=>({...e,from:Y}),[n,I,Y,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=v.useMemo(()=>n.buildLocation({...K}),[n,K]),oe=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,ce=Z.maskedLocation?Z.maskedLocation.external:Z.external,V=v.useMemo(()=>Mk(oe,ce,n.history,b),[b,ce,oe,n.history]),ee=v.useMemo(()=>{if(V?.external){if(qa(V.href)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${V.href}`);return}return V.href}if(!Ak(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{if(new URL(a),qa(a)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${a}`);return}return a}catch{}},[a,V]),me=Qt({select:B=>{if(ee)return!1;if(i?.exact){if(!ME(B.location.pathname,Z.pathname,n.basepath))return!1}else{const Q=Za(B.location.pathname,n.basepath),ue=Za(Z.pathname,n.basepath);if(!(Q.startsWith(ue)&&(Q.length===ue.length||Q[ue.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Wr(B.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?se&&B.location.hash===Z.hash:!0}}),le=me?sr(s,{})??Ck:Gl,fe=me?Gl:sr(o,{})??Gl,ge=[_,le.className,fe.className].filter(Boolean).join(" "),Ze=(x||le.style||fe.style)&&{...x,...le.style,...fe.style},[_t,rn]=v.useState(!1),qt=v.useRef(!1),st=e.reloadDocument||ee?!1:c??n.options.defaultPreload,Qn=l??n.options.defaultPreloadDelay??0,ot=v.useCallback(()=>{n.preloadRoute({...K}).catch(B=>{console.warn(B),console.warn(ck)})},[n,K]),ps=v.useCallback(B=>{B?.isIntersecting&&ot()},[ot]);uk(r,ps,Tk,{disabled:!!b||st!=="viewport"}),v.useEffect(()=>{qt.current||!b&&st==="render"&&(ot(),qt.current=!0)},[b,ot,st]);const R=B=>{const Q=B.currentTarget.getAttribute("target"),ue=y!==void 0?y:Q;if(!b&&!Nk(B)&&!B.defaultPrevented&&(!ue||ue==="_self")&&B.button===0){B.preventDefault(),Dc.flushSync(()=>{rn(!0)});const ve=n.subscribe("onResolved",()=>{ve(),rn(!1)});n.navigate({...K,replace:d,resetScroll:h,hashScrollIntoView:u,startTransition:f,viewTransition:p,ignoreBlocker:P})}};if(ee)return{...W,ref:r,href:ee,...m&&{children:m},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},..._&&{className:_},...w&&{onClick:w},...S&&{onFocus:S},...C&&{onMouseEnter:C},...k&&{onMouseLeave:k},...E&&{onTouchStart:E}};const M=B=>{b||st&&ot()},z=M,J=B=>{if(!(b||!st))if(!Qn)ot();else{const Q=B.target;if(mo.has(Q))return;const ue=setTimeout(()=>{mo.delete(Q),ot()},Qn);mo.set(Q,ue)}},G=B=>{if(b||!st||!Qn)return;const Q=B.target,ue=mo.get(Q);ue&&(clearTimeout(ue),mo.delete(Q))};return{...W,...le,...fe,href:V?.href,ref:r,onClick:go([w,R]),onFocus:go([S,M]),onMouseEnter:go([C,J]),onMouseLeave:go([k,G]),onTouchStart:go([E,z]),disabled:!!b,target:y,...Ze&&{style:Ze},...ge&&{className:ge},...b&&Rk,...me&&Pk,...se&&_t&&Ok}}const Gl={},Ck={className:"active"},Rk={role:"link","aria-disabled":!0},Pk={"data-status":"active","aria-current":"page"},Ok={"data-transitioning":"transitioning"},mo=new WeakMap,Tk={rootMargin:"100px"},go=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Mk(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Ak(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tb=v.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...o}=kk(r,t),i=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=o;return v.createElement("a",c,i)}return v.createElement(n,o,i)});function Nk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Dk extends Cb{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jn(e){return new Dk(e)}class Ik extends lk{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jk(e){return new Ik(e)}function fp(e){return typeof e=="object"?new hp(e,{silent:!0}).createRoute(e):new hp(e,{silent:!0}).createRoute}class hp{constructor(t,n){this.path=t,this.createRoute=r=>{Hs(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const s=jn(r);return s.isRoot=!1,s},this.silent=n?.silent}}class pp{constructor(t){this.useMatch=n=>Pn({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>rf({...n,from:this.options.id}),this.useLoaderData=n=>nf({...n,from:this.options.id}),this.useNavigate=()=>{const n=tn();return ls({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mp(e){return typeof e=="object"?new pp(e):t=>new pp({id:e,...t})}function Lk(){const e=tn(),t=v.useRef({router:e,mounted:!1}),[n,r]=v.useState(!1),{hasPendingMatches:s,isLoading:o}=Qt({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=Ul(o),a=o||n||s,c=Ul(a),l=o||s,u=Ul(l);return e.startTransition=d=>{r(!0),v.startTransition(()=>{d(),r(!1)})},v.useEffect(()=>{const d=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vn(e.latestLocation.publicHref)!==Vn(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{d()}},[e,e.history]),zi(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),zi(()=>{i&&!o&&e.emit({type:"onLoad",...Hr(e.state)})},[i,e,o]),zi(()=>{u&&!l&&e.emit({type:"onBeforeRouteMount",...Hr(e.state)})},[l,u,e]),zi(()=>{if(c&&!a){const d=Hr(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),d.hrefChanged&&VE(e)}},[a,c,e]),null}function Fk(e){const t=Qt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return g.jsx(ef,{getResetKey:()=>t,onCatch:(n,r)=>{if(Wt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Wt(n))return e.fallback?.(n);throw n},children:e.children})}function zk(){return g.jsx("p",{children:"Not Found"})}function Ss(e){return g.jsx(g.Fragment,{children:e.children})}function Mb(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):(process.env.NODE_ENV==="development"&&Hs(t.options.notFoundComponent,`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),g.jsx(zk,{}))}function $k(){return tn().isScrollRestoring,null}const Ab=v.memo(function({matchId:t}){const n=tn(),r=Qt({select:m=>{const y=m.matches.findIndex(x=>x.id===t),b=m.matches[y];return qn(b,`Could not find match for matchId "${t}". Please file an issue!`),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[y-1]?.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],o=s.options.pendingComponent??n.options.defaultPendingComponent,i=o?g.jsx(o,{}):null,a=s.options.errorComponent??n.options.defaultErrorComponent,c=s.options.onCatch??n.options.defaultOnCatch,l=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??o??(s.options.errorComponent?.preload||u))?v.Suspense:Ss,f=a?ef:Ss,h=l?Fk:Ss,p=s.isRoot?s.options.shellComponent??Ss:Ss;return g.jsxs(p,{children:[g.jsx(Fc.Provider,{value:t,children:g.jsx(d,{fallback:i,children:g.jsx(f,{getResetKey:()=>r.resetKey,errorComponent:a||tf,onCatch:(m,y)=>{if(Wt(m))throw m;Hs(!1,`Error in route match: ${t}`),c?.(m,y)},children:g.jsx(h,{fallback:m=>{if(!l||m.routeId&&m.routeId!==r.routeId||!m.routeId&&!s.isRoot)throw m;return v.createElement(l,m)},children:u||r._displayPending?g.jsx(hk,{fallback:i,children:g.jsx(gp,{matchId:t})}):g.jsx(gp,{matchId:t})})})})}),r.parentRouteId===Gt&&n.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Vk,{}),g.jsx($k,{})]}):null]})});function Vk(){const e=tn(),t=v.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Hr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gp=v.memo(function({matchId:t}){const n=tn(),{match:r,key:s,routeId:o}=Qt({select:c=>{const l=c.matches.find(p=>p.id===t),u=l.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[o],a=v.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?g.jsx(c,{},s):g.jsx(of,{})},[s,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const u=Us();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return qn(Wt(r.error),"Expected a notFound error"),Mb(n,i,r.error);if(r.status==="redirected")throw qn(Jt(r.error),"Expected a redirect error"),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),of=v.memo(function(){const t=tn(),n=v.useContext(Fc),r=Qt({select:l=>l.matches.find(u=>u.id===n)?.routeId}),s=t.routesById[r],o=Qt({select:l=>{const d=l.matches.find(f=>f.id===n);return qn(d,`Could not find parent match for matchId "${n}"`),d.globalNotFound}}),i=Qt({select:l=>{const u=l.matches,d=u.findIndex(f=>f.id===n);return u[d+1]?.id}}),a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Mb(t,s,void 0);if(!i)return null;const c=g.jsx(Ab,{matchId:i});return r===Gt?g.jsx(v.Suspense,{fallback:a,children:c}):c});function Bk(){const e=tn(),n=e.routesById[Gt].options.pendingComponent??e.options.defaultPendingComponent,r=n?g.jsx(n,{}):null,s=typeof document<"u"&&e.ssr?Ss:v.Suspense,o=g.jsxs(s,{fallback:r,children:[g.jsx(Lk,{}),g.jsx(Uk,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:o}):o}function Uk(){const e=tn(),t=Qt({select:s=>s.matches[0]?.id}),n=Qt({select:s=>s.loadedAt}),r=t?g.jsx(Ab,{matchId:t}):null;return g.jsx(Fc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(ef,{getResetKey:()=>n,errorComponent:tf,onCatch:s=>{Hs(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),Hs(!1,s.message||s.toString())},children:r})})}const af=e=>new Wk(e);class Wk extends tk{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=fp,globalThis.createLazyFileRoute=mp):typeof window<"u"&&(window.createFileRoute=fp,window.createLazyFileRoute=mp);function Hk({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=Ob(),s=g.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:s}):s}function Nb({router:e,...t}){return g.jsx(Hk,{router:e,...t,children:g.jsx(Bk,{})})}var mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Kk=class{#e=qk;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},$r=new Kk;function Zk(e){setTimeout(e,0)}var Jr=typeof window>"u"||"Deno"in globalThis;function Mt(){}function Gk(e,t){return typeof e=="function"?e(t):e}function Vu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dr(e,t){return typeof e=="function"?e(t):e}function Yt(e,t){return typeof e=="function"?e(t):e}function yp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==cf(i,t.options))return!1}else if(!Zo(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function bp(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ko(t.options.mutationKey)!==Ko(o))return!1}else if(!Zo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function cf(e,t){return(t?.queryKeyHashFn||Ko)(e)}function Ko(e){return JSON.stringify(e,(t,n)=>Wu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zo(e[n],t[n])):!1}var Yk=Object.prototype.hasOwnProperty;function Bu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=vp(e)&&vp(t);if(!r&&!(Wu(e)&&Wu(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const d=r?u:i[u],f=e[d],h=t[d];if(f===h){c[d]=f,(r?u<o:Yk.call(e,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[d]=h;continue}const p=Bu(f,h,n+1);c[d]=p,p===f&&l++}return o===a&&l===o?e:c}function Uu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function vp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wu(e){if(!xp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xk(e){return new Promise(t=>{$r.setTimeout(t,e)})}function Hu(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Bu(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Bu(e,t)}return t}function Jk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Qk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa=Symbol();function Ib(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xa&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function eC(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var tC=class extends mi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},lf=new tC;function qu(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var nC=Zk;function rC(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=nC;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ut=rC(),sC=class extends mi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ja=new sC;function oC(e){return Math.min(1e3*2**e,3e4)}function Lb(e){return(e??"online")==="online"?Ja.isOnline():!0}var Ku=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fb(e){let t=!1,n=0,r;const s=qu(),o=()=>s.status!=="pending",i=m=>{if(!o()){const y=new Ku(m);f(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>lf.isFocused()&&(e.networkMode==="always"||Ja.isOnline())&&e.canRun(),u=()=>Lb(e.networkMode)&&e.canRun(),d=m=>{o()||(r?.(),s.resolve(m))},f=m=>{o()||(r?.(),s.reject(m))},h=()=>new Promise(m=>{r=y=>{(o()||l())&&m(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(o())return;const x=e.retry??(Jr?0:3),_=e.retryDelay??oC,w=typeof _=="function"?_(n,b):_,S=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!S){f(b);return}n++,e.onFail?.(n,b),Xk(w).then(()=>l()?void 0:h()).then(()=>{t?f(b):p()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?p():h().then(p),s)}}var zb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vu(this.gcTime)&&(this.#e=$r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jr?1/0:300*1e3))}clearGcTimeout(){this.#e&&($r.clearTimeout(this.#e),this.#e=void 0)}},iC=class extends zb{#e;#t;#n;#s;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wp(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=wp(this.options);t.data!==void 0&&(this.setState(_p(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Hu(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xa||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Db(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const a=Ib(this.options,t),l=(()=>{const u={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Fb({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ku&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ku){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$b(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,..._p(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _p(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var aC=class extends mi{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#i=qu(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#i;#o;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Sp(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Uu(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Ep(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||dr(this.options.staleTime,this.#t)!==dr(t.staleTime,this.#t))&&this.#g();const s=this.#y();r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||s!==this.#c)&&this.#b(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return lC(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mt)),t}#g(){this.#x();const e=dr(this.options.staleTime,this.#t);if(Jr||this.#s.isStale||!Vu(e))return;const n=Db(this.#s.dataUpdatedAt,e)+1;this.#l=$r.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#_(),this.#c=e,!(Jr||Yt(this.options.enabled,this.#t)===!1||!Vu(this.#c)||this.#c===0)&&(this.#u=$r.setInterval(()=>{(this.options.refetchIntervalInBackground||lf.isFocused())&&this.#d()},this.#c))}#v(){this.#g(),this.#b(this.#y())}#x(){this.#l&&($r.clearTimeout(this.#l),this.#l=void 0)}#_(){this.#u&&($r.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,o=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let u={...l},d=!1,f;if(t._optimisticResults){const E=this.hasListeners(),P=!E&&Sp(e,t),O=E&&Ep(e,n,t,r);(P||O)&&(u={...u,...$b(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:m}=u;f=u.data;let y=!1;if(t.placeholderData!==void 0&&f===void 0&&m==="pending"){let E;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(E=s.data,y=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,E!==void 0&&(m="success",f=Hu(s?.data,E,t),d=!0)}if(t.select&&f!==void 0&&!y)if(s&&f===o?.data&&t.select===this.#m)f=this.#f;else try{this.#m=t.select,f=t.select(f),f=Hu(s?.data,f,t),this.#f=f,this.#o=null}catch(E){this.#o=E}this.#o&&(h=this.#o,f=this.#f,p=Date.now(),m="error");const b=u.fetchStatus==="fetching",x=m==="pending",_=m==="error",w=x&&b,S=f!==void 0,k={status:m,fetchStatus:u.fetchStatus,isPending:x,isSuccess:m==="success",isError:_,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&S,isStale:uf(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Yt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=k.data!==void 0,P=k.status==="error"&&!E,O=j=>{P?j.reject(k.error):E&&j.resolve(k.data)},N=()=>{const j=this.#i=k.promise=qu();O(j)},A=this.#i;switch(A.status){case"pending":e.queryHash===n.queryHash&&O(A);break;case"fulfilled":(P||k.data!==A.value)&&N();break;case"rejected":(!P||k.error!==A.reason)&&N();break}}return k}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Uu(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const o=new Set(s??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(i=>{const a=i;return this.#s[a]!==e[a]&&o.has(a)})};this.#S({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function cC(e,t){return Yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sp(e,t){return cC(e,t)||e.state.data!==void 0&&Zu(e,t,t.refetchOnMount)}function Zu(e,t,n){if(Yt(t.enabled,e)!==!1&&dr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&uf(e,t)}return!1}function Ep(e,t,n,r){return(e!==t||Yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&uf(e,n)}function uf(e,t){return Yt(t.enabled,e)!==!1&&e.isStaleByTime(dr(t.staleTime,e))}function lC(e,t){return!Uu(e.getCurrentResult(),t)}function kp(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=p=>{eC(p,()=>t.signal,()=>u=!0)},f=Ib(t.options,t.fetchOptions),h=async(p,m,y)=>{if(u)return Promise.reject();if(m==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),_=await f(x),{maxPages:w}=t.options,S=y?Qk:Jk;return{pages:S(p.pages,_,w),pageParams:S(p.pageParams,m,w)}};if(s&&o.length){const p=s==="backward",m=p?uC:Cp,y={pages:o,pageParams:i},b=m(r,y);a=await h(y,b,p)}else{const p=e??o.length;do{const m=c===0?i[0]??r.initialPageParam:Cp(r,a);if(c>0&&m==null)break;a=await h(a,m),c++}while(c<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Cp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uC(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var dC=class extends zb{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||fC(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Fb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#r({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ut.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function fC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new dC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Bi(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Bi(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>bp(t,n))}findAll(e={}){return this.getAll().filter(t=>bp(e,t))}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ut.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mt))))}};function Bi(e){return e.options.scope?.id}var pC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??cf(r,t);let o=this.get(s);return o||(o=new iC({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>yp(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>yp(e,n)):t}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vb=class{#e;#t;#n;#s;#r;#a;#i;#o;constructor(e={}){this.#e=e.queryCache||new pC,this.#t=e.mutationCache||new hC,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=lf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,i=Gk(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ut.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return ut.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ut.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Mt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e.behavior=kp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e.behavior=kp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ja.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Ko(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Zo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ko(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Zo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Xa&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Bb=v.createContext(void 0),mC=e=>{const t=v.useContext(Bb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ub=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Bb.Provider,{value:e,children:t})),Wb=v.createContext(!1),gC=()=>v.useContext(Wb);Wb.Provider;function yC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bC=v.createContext(yC()),vC=()=>v.useContext(bC),xC=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_C=e=>{v.useEffect(()=>{e.clearReset()},[e])},wC=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||jb(n,[e.error,r])),SC=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},EC=(e,t)=>e.isLoading&&e.isFetching&&!t,kC=(e,t)=>e?.suspense&&t.isPending,Rp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function CC(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=gC(),s=vC(),o=mC(),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",SC(i),xC(i,s,a),_C(s);const c=!o.getQueryCache().get(i.queryHash),[l]=v.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(f=>{const h=d?l.subscribe(ut.batchCalls(f)):Mt;return l.updateResult(),h},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(i)},[i,l]),kC(i,u))throw Rp(i,l,s);if(wC({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Jr&&EC(u,r)&&(c?Rp(i,l,s):a?.promise)?.catch(Mt).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function Go(e,t){return CC(e,aC)}function RC(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 PC=e=>{switch(e){case"success":return MC;case"info":return NC;case"warning":return AC;case"error":return DC;default:return null}},OC=Array(12).fill(0),TC=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},OC.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),MC=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),AC=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),NC=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),DC=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),IC=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jC=()=>{const[e,t]=T.useState(document.hidden);return T.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Gu=1;class LC{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,...s}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Gu++,i=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},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 s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(zC(l)&&!l.ok){o=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(l instanceof Error){o=!1;const d=typeof n.error=="function"?await n.error(l):n.error,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(n.success!==void 0){o=!1;const d=typeof n.success=="function"?await n.success(l):n.success,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:f,...p})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,h=typeof u=="object"&&!T.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...h})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Gu++;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 Tt=new LC,FC=(e,t)=>{const n=t?.id||Gu++;return Tt.addToast({title:e,...t,id:n}),n},zC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$C=FC,VC=()=>Tt.toasts,BC=()=>Tt.getActiveToasts(),Ee=Object.assign($C,{success:Tt.success,info:Tt.info,warning:Tt.warning,error:Tt.error,custom:Tt.custom,message:Tt.message,promise:Tt.promise,dismiss:Tt.dismiss,loading:Tt.loading},{getHistory:VC,getToasts:BC});RC("[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 Ui(e){return e.label!==void 0}const UC=3,WC="24px",HC="16px",Pp=4e3,qC=356,KC=14,ZC=45,GC=200;function vn(...e){return e.filter(Boolean).join(" ")}function YC(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const XC=e=>{var t,n,r,s,o,i,a,c,l;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:y,index:b,toasts:x,expanded:_,removeToast:w,defaultRichColors:S,closeButton:C,style:k,cancelButtonStyle:E,actionButtonStyle:P,className:O="",descriptionClassName:N="",duration:A,position:j,gap:$,expandByDefault:q,classNames:D,icons:H,closeButtonAriaLabel:F="Close toast"}=e,[W,se]=T.useState(null),[I,Y]=T.useState(null),[K,Z]=T.useState(!1),[oe,ce]=T.useState(!1),[V,ee]=T.useState(!1),[me,le]=T.useState(!1),[fe,ge]=T.useState(!1),[Ze,_t]=T.useState(0),[rn,qt]=T.useState(0),st=T.useRef(d.duration||A||Pp),Qn=T.useRef(null),ot=T.useRef(null),ps=b===0,R=b+1<=m,M=d.type,z=d.dismissible!==!1,J=d.className||"",G=d.descriptionClassName||"",B=T.useMemo(()=>y.findIndex(he=>he.toastId===d.id)||0,[y,d.id]),Q=T.useMemo(()=>{var he;return(he=d.closeButton)!=null?he:C},[d.closeButton,C]),ue=T.useMemo(()=>d.duration||A||Pp,[d.duration,A]),ve=T.useRef(0),Ue=T.useRef(0),bn=T.useRef(0),wt=T.useRef(null),[Dl,ao]=j.split("-"),ms=T.useMemo(()=>y.reduce((he,it,ft)=>ft>=B?he:he+it.height,0),[y,B]),Ai=jC(),Ni=d.invert||u,co=M==="loading";Ue.current=T.useMemo(()=>B*$+ms,[B,ms]),T.useEffect(()=>{st.current=ue},[ue]),T.useEffect(()=>{Z(!0)},[]),T.useEffect(()=>{const he=ot.current;if(he){const it=he.getBoundingClientRect().height;return qt(it),p(ft=>[{toastId:d.id,height:it,position:d.position},...ft]),()=>p(ft=>ft.filter(Lt=>Lt.toastId!==d.id))}},[p,d.id]),T.useLayoutEffect(()=>{if(!K)return;const he=ot.current,it=he.style.height;he.style.height="auto";const ft=he.getBoundingClientRect().height;he.style.height=it,qt(ft),p(Lt=>Lt.find(ct=>ct.toastId===d.id)?Lt.map(ct=>ct.toastId===d.id?{...ct,height:ft}:ct):[{toastId:d.id,height:ft,position:d.position},...Lt])},[K,d.title,d.description,p,d.id,d.jsx,d.action,d.cancel]);const sn=T.useCallback(()=>{ce(!0),_t(Ue.current),p(he=>he.filter(it=>it.toastId!==d.id)),setTimeout(()=>{w(d)},GC)},[d,w,p,Ue]);T.useEffect(()=>{if(d.promise&&M==="loading"||d.duration===1/0||d.type==="loading")return;let he;return _||h||Ai?(()=>{if(bn.current<ve.current){const Lt=new Date().getTime()-ve.current;st.current=st.current-Lt}bn.current=new Date().getTime()})():st.current!==1/0&&(ve.current=new Date().getTime(),he=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),sn()},st.current)),()=>clearTimeout(he)},[_,h,d,M,Ai,sn]),T.useEffect(()=>{d.delete&&(sn(),d.onDismiss==null||d.onDismiss.call(d,d))},[sn,d.delete]);function tE(){var he;if(H?.loading){var it;return T.createElement("div",{className:vn(D?.loader,d==null||(it=d.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":M==="loading"},H.loading)}return T.createElement(TC,{className:vn(D?.loader,d==null||(he=d.classNames)==null?void 0:he.loader),visible:M==="loading"})}const nE=d.icon||H?.[M]||PC(M);var Fh,zh;return T.createElement("li",{tabIndex:0,ref:ot,className:vn(O,J,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[M],d==null||(n=d.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Fh=d.richColors)!=null?Fh:S,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":K,"data-promise":!!d.promise,"data-swiped":fe,"data-removed":oe,"data-visible":R,"data-y-position":Dl,"data-x-position":ao,"data-index":b,"data-front":ps,"data-swiping":V,"data-dismissible":z,"data-type":M,"data-invert":Ni,"data-swipe-out":me,"data-swipe-direction":I,"data-expanded":!!(_||q&&K),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${oe?Ze:Ue.current}px`,"--initial-height":q?"auto":`${rn}px`,...k,...d.style},onDragEnd:()=>{ee(!1),se(null),wt.current=null},onPointerDown:he=>{he.button!==2&&(co||!z||(Qn.current=new Date,_t(Ue.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(ee(!0),wt.current={x:he.clientX,y:he.clientY})))},onPointerUp:()=>{var he,it,ft;if(me||!z)return;wt.current=null;const Lt=Number(((he=ot.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Di=Number(((it=ot.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((ft=Qn.current)==null?void 0:ft.getTime()),Kt=W==="x"?Lt:Di,Ii=Math.abs(Kt)/ct;if(Math.abs(Kt)>=ZC||Ii>.11){_t(Ue.current),d.onDismiss==null||d.onDismiss.call(d,d),Y(W==="x"?Lt>0?"right":"left":Di>0?"down":"up"),sn(),le(!0);return}else{var on,an;(on=ot.current)==null||on.style.setProperty("--swipe-amount-x","0px"),(an=ot.current)==null||an.style.setProperty("--swipe-amount-y","0px")}ge(!1),ee(!1),se(null)},onPointerMove:he=>{var it,ft,Lt;if(!wt.current||!z||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const ct=he.clientY-wt.current.y,Kt=he.clientX-wt.current.x;var Ii;const on=(Ii=e.swipeDirections)!=null?Ii:YC(j);!W&&(Math.abs(Kt)>1||Math.abs(ct)>1)&&se(Math.abs(Kt)>Math.abs(ct)?"x":"y");let an={x:0,y:0};const $h=Or=>1/(1.5+Math.abs(Or)/20);if(W==="y"){if(on.includes("top")||on.includes("bottom"))if(on.includes("top")&&ct<0||on.includes("bottom")&&ct>0)an.y=ct;else{const Or=ct*$h(ct);an.y=Math.abs(Or)<Math.abs(ct)?Or:ct}}else if(W==="x"&&(on.includes("left")||on.includes("right")))if(on.includes("left")&&Kt<0||on.includes("right")&&Kt>0)an.x=Kt;else{const Or=Kt*$h(Kt);an.x=Math.abs(Or)<Math.abs(Kt)?Or:Kt}(Math.abs(an.x)>0||Math.abs(an.y)>0)&&ge(!0),(ft=ot.current)==null||ft.style.setProperty("--swipe-amount-x",`${an.x}px`),(Lt=ot.current)==null||Lt.style.setProperty("--swipe-amount-y",`${an.y}px`)}},Q&&!d.jsx&&M!=="loading"?T.createElement("button",{"aria-label":F,"data-disabled":co,"data-close-button":!0,onClick:co||!z?()=>{}:()=>{sn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:vn(D?.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(zh=H?.close)!=null?zh:IC):null,(M||d.icon||d.promise)&&d.icon!==null&&(H?.[M]!==null||d.icon)?T.createElement("div",{"data-icon":"",className:vn(D?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||tE():null,d.type!=="loading"?nE:null):null,T.createElement("div",{"data-content":"",className:vn(D?.content,d==null||(o=d.classNames)==null?void 0:o.content)},T.createElement("div",{"data-title":"",className:vn(D?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?T.createElement("div",{"data-description":"",className:vn(N,G,D?.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),T.isValidElement(d.cancel)?d.cancel:d.cancel&&Ui(d.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||E,onClick:he=>{Ui(d.cancel)&&z&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,he),sn())},className:vn(D?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,T.isValidElement(d.action)?d.action:d.action&&Ui(d.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||P,onClick:he=>{Ui(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,he),!he.defaultPrevented&&sn())},className:vn(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function Op(){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 JC(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?HC:WC;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}const QC=T.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:l,offset:u,mobileOffset:d,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:y=UC,toastOptions:b,dir:x=Op(),gap:_=KC,icons:w,containerAriaLabel:S="Notifications"}=t,[C,k]=T.useState([]),E=T.useMemo(()=>r?C.filter(K=>K.toasterId===r):C.filter(K=>!K.toasterId),[C,r]),P=T.useMemo(()=>Array.from(new Set([o].concat(E.filter(K=>K.position).map(K=>K.position)))),[E,o]),[O,N]=T.useState([]),[A,j]=T.useState(!1),[$,q]=T.useState(!1),[D,H]=T.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=T.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),se=T.useRef(null),I=T.useRef(!1),Y=T.useCallback(K=>{k(Z=>{var oe;return(oe=Z.find(ce=>ce.id===K.id))!=null&&oe.delete||Tt.dismiss(K.id),Z.filter(({id:ce})=>ce!==K.id)})},[]);return T.useEffect(()=>Tt.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{k(Z=>Z.map(oe=>oe.id===K.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Dc.flushSync(()=>{k(Z=>{const oe=Z.findIndex(ce=>ce.id===K.id);return oe!==-1?[...Z.slice(0,oe),{...Z[oe],...K},...Z.slice(oe+1)]:[K,...Z]})})})}),[C]),T.useEffect(()=>{if(f!=="system"){H(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Z})=>{H(Z?"dark":"light")})}catch{K.addListener(({matches:oe})=>{try{H(oe?"dark":"light")}catch(ce){console.error(ce)}})}},[f]),T.useEffect(()=>{C.length<=1&&j(!1)},[C]),T.useEffect(()=>{const K=Z=>{var oe;if(i.every(ee=>Z[ee]||Z.code===ee)){var V;j(!0),(V=F.current)==null||V.focus()}Z.code==="Escape"&&(document.activeElement===F.current||(oe=F.current)!=null&&oe.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),T.useEffect(()=>{if(F.current)return()=>{se.current&&(se.current.focus({preventScroll:!0}),se.current=null,I.current=!1)}},[F.current]),T.createElement("section",{ref:n,"aria-label":`${S} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((K,Z)=>{var oe;const[ce,V]=K.split("-");return E.length?T.createElement("ol",{key:K,dir:x==="auto"?Op():x,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":V,style:{"--front-toast-height":`${((oe=O[0])==null?void 0:oe.height)||0}px`,"--width":`${qC}px`,"--gap":`${_}px`,...m,...JC(u,d)},onBlur:ee=>{I.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(I.current=!1,se.current&&(se.current.focus({preventScroll:!0}),se.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I.current||(I.current=!0,se.current=ee.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{$||j(!1)},onDragEnd:()=>j(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},E.filter(ee=>!ee.position&&Z===0||ee.position===K).map((ee,me)=>{var le,fe;return T.createElement(XC,{key:ee.id,icons:w,index:me,toast:ee,defaultRichColors:h,duration:(le=b?.duration)!=null?le:p,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(fe=b?.closeButton)!=null?fe:c,interacting:$,position:K,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:Y,toasts:E.filter(ge=>ge.position==ee.position),heights:O.filter(ge=>ge.position==ee.position),setHeights:N,expandByDefault:a,gap:_,expanded:A,swipeDirections:t.swipeDirections})})):null}))}),Tp=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,a);return a},eR=(e=>e?Tp(e):Tp),tR=e=>e;function nR(e,t=tR){const n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),T.useCallback(()=>t(e.getInitialState()),[e,t]));return T.useDebugValue(n),n}const Mp=e=>{const t=eR(e),n=r=>nR(t,r);return Object.assign(n,t),n},Hb=(e=>e?Mp(e):Mp);function rR(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=c=>c===null?null:JSON.parse(c,void 0),a=(o=n.getItem(s))!=null?o:null;return a instanceof Promise?a.then(i):i(a)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const Yu=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yu(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yu(r)(n)}}}},sR=(e,t)=>(n,r,s)=>{let o={storage:rR(()=>localStorage),partialize:y=>y,version:0,merge:(y,b)=>({...b,...y}),...t},i=!1,a=0;const c=new Set,l=new Set;let u=o.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,s);const d=()=>{const y=o.partialize({...r()});return u.setItem(o.name,{state:y,version:o.version})},f=s.setState;s.setState=(y,b)=>(f(y,b),d());const h=e((...y)=>(n(...y),d()),r,s);s.getInitialState=()=>h;let p;const m=()=>{var y,b;if(!u)return;const x=++a;i=!1,c.forEach(w=>{var S;return w((S=r())!=null?S:h)});const _=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(y=r())!=null?y:h))||void 0;return Yu(u.getItem.bind(u))(o.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate){const S=o.migrate(w.state,w.version);return S instanceof Promise?S.then(C=>[!0,C]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var S;if(x!==a)return;const[C,k]=w;if(p=o.merge(k,(S=r())!=null?S:h),n(p,!0),C)return d()}).then(()=>{x===a&&(_?.(p,void 0),p=r(),i=!0,l.forEach(w=>w(p)))}).catch(w=>{x===a&&_?.(void 0,w)})};return s.persist={setOptions:y=>{o={...o,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},o.skipHydration||m(),p||h},oR=sR;function qb(e,t){return function(){return e.apply(t,arguments)}}const{toString:iR}=Object.prototype,{getPrototypeOf:df}=Object,{iterator:zc,toStringTag:Kb}=Symbol,$c=(e=>t=>{const n=iR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gn=e=>(e=e.toLowerCase(),t=>$c(t)===e),Vc=e=>t=>typeof t===e,{isArray:Qs}=Array,qs=Vc("undefined");function gi(e){return e!==null&&!qs(e)&&e.constructor!==null&&!qs(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Zb=gn("ArrayBuffer");function aR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Zb(e.buffer),t}const cR=Vc("string"),Dt=Vc("function"),Gb=Vc("number"),yi=e=>e!==null&&typeof e=="object",lR=e=>e===!0||e===!1,Ra=e=>{if($c(e)!=="object")return!1;const t=df(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Kb in e)&&!(zc in e)},uR=e=>{if(!yi(e)||gi(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dR=gn("Date"),fR=gn("File"),hR=gn("Blob"),pR=gn("FileList"),mR=e=>yi(e)&&Dt(e.pipe),gR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dt(e.append)&&((t=$c(e))==="formdata"||t==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"))},yR=gn("URLSearchParams"),[bR,vR,xR,_R]=["ReadableStream","Request","Response","Headers"].map(gn),wR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bi(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Qs(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(gi(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Yb(e,t){if(gi(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Xb=e=>!qs(e)&&e!==Vr;function Xu(){const{caseless:e,skipUndefined:t}=Xb(this)&&this||{},n={},r=(s,o)=>{const i=e&&Yb(n,o)||o;Ra(n[i])&&Ra(s)?n[i]=Xu(n[i],s):Ra(s)?n[i]=Xu({},s):Qs(s)?n[i]=s.slice():(!t||!qs(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&bi(arguments[s],r);return n}const SR=(e,t,n,{allOwnKeys:r}={})=>(bi(t,(s,o)=>{n&&Dt(s)?Object.defineProperty(e,o,{value:qb(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),ER=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),kR=(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)},CR=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&df(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},RR=(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},PR=e=>{if(!e)return null;if(Qs(e))return e;let t=e.length;if(!Gb(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},OR=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&df(Uint8Array)),TR=(e,t)=>{const r=(e&&e[zc]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},MR=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},AR=gn("HTMLFormElement"),NR=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ap=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),DR=gn("RegExp"),Jb=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bi(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},IR=e=>{Jb(e,(t,n)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dt(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+"'")})}})},jR=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Qs(e)?r(e):r(String(e).split(t)),n},LR=()=>{},FR=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zR(e){return!!(e&&Dt(e.append)&&e[Kb]==="FormData"&&e[zc])}const $R=e=>{const t=new Array(10),n=(r,s)=>{if(yi(r)){if(t.indexOf(r)>=0)return;if(gi(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Qs(r)?[]:{};return bi(r,(i,a)=>{const c=n(i,s+1);!qs(c)&&(o[a]=c)}),t[s]=void 0,o}}return r};return n(e,0)},VR=gn("AsyncFunction"),BR=e=>e&&(yi(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),Qb=((e,t)=>e?setImmediate:t?((n,r)=>(Vr.addEventListener("message",({source:s,data:o})=>{s===Vr&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Vr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Dt(Vr.postMessage)),UR=typeof queueMicrotask<"u"?queueMicrotask.bind(Vr):typeof process<"u"&&process.nextTick||Qb,WR=e=>e!=null&&Dt(e[zc]),L={isArray:Qs,isArrayBuffer:Zb,isBuffer:gi,isFormData:gR,isArrayBufferView:aR,isString:cR,isNumber:Gb,isBoolean:lR,isObject:yi,isPlainObject:Ra,isEmptyObject:uR,isReadableStream:bR,isRequest:vR,isResponse:xR,isHeaders:_R,isUndefined:qs,isDate:dR,isFile:fR,isBlob:hR,isRegExp:DR,isFunction:Dt,isStream:mR,isURLSearchParams:yR,isTypedArray:OR,isFileList:pR,forEach:bi,merge:Xu,extend:SR,trim:wR,stripBOM:ER,inherits:kR,toFlatObject:CR,kindOf:$c,kindOfTest:gn,endsWith:RR,toArray:PR,forEachEntry:TR,matchAll:MR,isHTMLForm:AR,hasOwnProperty:Ap,hasOwnProp:Ap,reduceDescriptors:Jb,freezeMethods:IR,toObjectSet:jR,toCamelCase:NR,noop:LR,toFiniteNumber:FR,findKey:Yb,global:Vr,isContextDefined:Xb,isSpecCompliantForm:zR,toJSONObject:$R,isAsyncFn:VR,isThenable:BR,setImmediate:Qb,asap:UR,isIterable:WR};let ae=class ev extends Error{static from(t,n,r,s,o,i){const a=new ev(t.message,n||t.code,r,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.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:L.toJSONObject(this.config),code:this.code,status:this.status}}};ae.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ae.ERR_BAD_OPTION="ERR_BAD_OPTION";ae.ECONNABORTED="ECONNABORTED";ae.ETIMEDOUT="ETIMEDOUT";ae.ERR_NETWORK="ERR_NETWORK";ae.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ae.ERR_DEPRECATED="ERR_DEPRECATED";ae.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ae.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ae.ERR_CANCELED="ERR_CANCELED";ae.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ae.ERR_INVALID_URL="ERR_INVALID_URL";const HR=null;function Ju(e){return L.isPlainObject(e)||L.isArray(e)}function tv(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function Np(e,t,n){return e?e.concat(t).map(function(s,o){return s=tv(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function qR(e){return L.isArray(e)&&!e.some(Ju)}const KR=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function Bc(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!L.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(L.isDate(p))return p.toISOString();if(L.isBoolean(p))return p.toString();if(!c&&L.isBlob(p))throw new ae("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(p)||L.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let b=p;if(p&&!y&&typeof p=="object"){if(L.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(L.isArray(p)&&qR(p)||(L.isFileList(p)||L.endsWith(m,"[]"))&&(b=L.toArray(p)))return m=tv(m),b.forEach(function(_,w){!(L.isUndefined(_)||_===null)&&t.append(i===!0?Np([m],w,o):i===null?m:m+"[]",l(_))}),!1}return Ju(p)?!0:(t.append(Np(y,m,o),l(p)),!1)}const d=[],f=Object.assign(KR,{defaultVisitor:u,convertValue:l,isVisitable:Ju});function h(p,m){if(!L.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),L.forEach(p,function(b,x){(!(L.isUndefined(b)||b===null)&&s.call(t,b,L.isString(x)?x.trim():x,m,f))===!0&&h(b,m?m.concat(x):[x])}),d.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Dp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ff(e,t){this._pairs=[],e&&Bc(e,this,t)}const nv=ff.prototype;nv.append=function(t,n){this._pairs.push([t,n])};nv.toString=function(t){const n=t?function(r){return t.call(this,r,Dp)}:Dp;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function ZR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rv(e,t,n){if(!t)return e;const r=n&&n.encode||ZR,s=L.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=L.isURLSearchParams(t)?t.toString():new ff(t,s).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ip{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){L.forEach(this.handlers,function(r){r!==null&&t(r)})}}const sv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},GR=typeof URLSearchParams<"u"?URLSearchParams:ff,YR=typeof FormData<"u"?FormData:null,XR=typeof Blob<"u"?Blob:null,JR={isBrowser:!0,classes:{URLSearchParams:GR,FormData:YR,Blob:XR},protocols:["http","https","file","blob","url","data"]},hf=typeof window<"u"&&typeof document<"u",Qu=typeof navigator=="object"&&navigator||void 0,QR=hf&&(!Qu||["ReactNative","NativeScript","NS"].indexOf(Qu.product)<0),eP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",tP=hf&&window.location.href||"http://localhost",nP=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:hf,hasStandardBrowserEnv:QR,hasStandardBrowserWebWorkerEnv:eP,navigator:Qu,origin:tP},Symbol.toStringTag,{value:"Module"})),yt={...nP,...JR};function rP(e,t){return Bc(e,new yt.classes.URLSearchParams,{visitor:function(n,r,s,o){return yt.isNode&&L.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function sP(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function oP(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ov(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=n.length;return i=!i&&L.isArray(s)?s.length:i,c?(L.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!L.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&L.isArray(s[i])&&(s[i]=oP(s[i])),!a)}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,(r,s)=>{t(sP(r),s,n,0)}),n}return null}function iP(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const vi={transitional:sv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=L.isObject(t);if(o&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return s?JSON.stringify(ov(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return rP(t,this.formSerializer).toString();if((a=L.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Bc(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),iP(t)):t}],transformResponse:[function(t){const n=this.transitional||vi.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?ae.from(a,ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],e=>{vi.headers[e]={}});const aP=L.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"]),cP=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
7
|
-
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&aP[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},jp=Symbol("internals");function yo(e){return e&&String(e).trim().toLowerCase()}function Pa(e){return e===!1||e==null?e:L.isArray(e)?e.map(Pa):String(e)}function lP(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 uP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Yl(e,t,n,r,s){if(L.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function dP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function fP(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let It=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,c,l){const u=yo(c);if(!u)throw new Error("header name must be a non-empty string");const d=L.findKey(s,u);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||c]=Pa(a))}const i=(a,c)=>L.forEach(a,(l,u)=>o(l,u,c));if(L.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(L.isString(t)&&(t=t.trim())&&!uP(t))i(cP(t),n);else if(L.isObject(t)&&L.isIterable(t)){let a={},c,l;for(const u of t){if(!L.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?L.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=yo(t),t){const r=L.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return lP(s);if(L.isFunction(n))return n.call(this,s,r);if(L.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yo(t),t){const r=L.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Yl(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=yo(i),i){const a=L.findKey(r,i);a&&(!n||Yl(r,r[a],a,n))&&(delete r[a],s=!0)}}return L.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Yl(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return L.forEach(this,(s,o)=>{const i=L.findKey(r,o);if(i){n[i]=Pa(s),delete n[o];return}const a=t?dP(o):String(o).trim();a!==o&&delete n[o],n[a]=Pa(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return L.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&L.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(s=>r.set(s)),r}static accessor(t){const r=(this[jp]=this[jp]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=yo(i);r[a]||(fP(s,i),r[a]=!0)}return L.isArray(t)?t.forEach(o):o(t),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(It.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});L.freezeMethods(It);function Xl(e,t){const n=this||vi,r=t||n,s=It.from(r.headers);let o=r.data;return L.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function iv(e){return!!(e&&e.__CANCEL__)}let xi=class extends ae{constructor(t,n,r){super(t??"canceled",ae.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function av(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ae("Request failed with status code "+n.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function hP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];i||(i=l),n[s]=c,r[s]=l;let d=o,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function mP(e,t){let n=0,r=1e3/t,s,o;const i=(l,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?i(l,u):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Qa=(e,t,n=3)=>{let r=0;const s=pP(50,250);return mP(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,l=s(c),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-i)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Lp=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fp=e=>(...t)=>L.asap(()=>e(...t)),gP=yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,yP=yt.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&a.push(`path=${r}`),L.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),L.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.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 bP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cv(e,t,n){let r=!bP(t);return e&&(r||n==!1)?vP(e,t):t}const zp=e=>e instanceof It?{...e}:e;function Qr(e,t){t=t||{};const n={};function r(l,u,d,f){return L.isPlainObject(l)&&L.isPlainObject(u)?L.merge.call({caseless:f},l,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function s(l,u,d,f){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function o(l,u){if(!L.isUndefined(u))return r(void 0,u)}function i(l,u){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(l,u,d)=>s(zp(l),zp(u),d,!0)};return L.forEach(Object.keys({...e,...t}),function(u){const d=c[u]||s,f=d(e[u],t[u],u);L.isUndefined(f)&&d!==a||(n[u]=f)}),n}const lv=e=>{const t=Qr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=It.from(i),t.url=rv(cv(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),L.isFormData(n)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(L.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([u,d])=>{l.includes(u.toLowerCase())&&i.set(u,d)})}}if(yt.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(t)),r||r!==!1&&gP(t.url))){const c=s&&o&&yP.read(o);c&&i.set(s,c)}return t},xP=typeof XMLHttpRequest<"u",_P=xP&&function(e){return new Promise(function(n,r){const s=lv(e);let o=s.data;const i=It.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function m(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const _=It.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:e,request:y};av(function(k){n(k),m()},function(k){r(k),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new ae("Request aborted",ae.ECONNABORTED,e,y)),y=null)},y.onerror=function(w){const S=w&&w.message?w.message:"Network Error",C=new ae(S,ae.ERR_NETWORK,e,y);C.event=w||null,r(C),y=null},y.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||sv;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new ae(w,S.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&L.forEach(i.toJSON(),function(w,S){y.setRequestHeader(S,w)}),L.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),a&&a!=="json"&&(y.responseType=s.responseType),l&&([f,p]=Qa(l,!0),y.addEventListener("progress",f)),c&&y.upload&&([d,h]=Qa(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=_=>{y&&(r(!_||_.type?new xi(null,e,y):_),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=hP(s.url);if(x&&yt.protocols.indexOf(x)===-1){r(new ae("Unsupported protocol "+x+":",ae.ERR_BAD_REQUEST,e));return}y.send(o||null)})},wP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof ae?u:new xi(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new ae(`timeout of ${t}ms exceeded`,ae.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>L.asap(a),c}},SP=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},EP=async function*(e,t){for await(const n of kP(e))yield*SP(n,t)},kP=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()}},$p=(e,t,n,r)=>{const s=EP(e,t);let o=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=o+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Vp=64*1024,{isFunction:Wi}=L,CP=(({Request:e,Response:t})=>({Request:e,Response:t}))(L.global),{ReadableStream:Bp,TextEncoder:Up}=L.global,Wp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},RP=e=>{e=L.merge.call({skipUndefined:!0},CP,e);const{fetch:t,Request:n,Response:r}=e,s=t?Wi(t):typeof fetch=="function",o=Wi(n),i=Wi(r);if(!s)return!1;const a=s&&Wi(Bp),c=s&&(typeof Up=="function"?(p=>m=>p.encode(m))(new Up):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=o&&a&&Wp(()=>{let p=!1;const m=new n(yt.origin,{body:new Bp,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=i&&a&&Wp(()=>L.isReadableStream(new r("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,y)=>{let b=m&&m[p];if(b)return b.call(m);throw new ae(`Response type '${p}' is not supported`,ae.ERR_NOT_SUPPORT,y)})});const f=async p=>{if(p==null)return 0;if(L.isBlob(p))return p.size;if(L.isSpecCompliantForm(p))return(await new n(yt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(L.isArrayBufferView(p)||L.isArrayBuffer(p))return p.byteLength;if(L.isURLSearchParams(p)&&(p=p+""),L.isString(p))return(await c(p)).byteLength},h=async(p,m)=>{const y=L.toFiniteNumber(p.getContentLength());return y??f(m)};return async p=>{let{url:m,method:y,data:b,signal:x,cancelToken:_,timeout:w,onDownloadProgress:S,onUploadProgress:C,responseType:k,headers:E,withCredentials:P="same-origin",fetchOptions:O}=lv(p),N=t||fetch;k=k?(k+"").toLowerCase():"text";let A=wP([x,_&&_.toAbortSignal()],w),j=null;const $=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let q;try{if(C&&l&&y!=="get"&&y!=="head"&&(q=await h(E,b))!==0){let I=new n(m,{method:"POST",body:b,duplex:"half"}),Y;if(L.isFormData(b)&&(Y=I.headers.get("content-type"))&&E.setContentType(Y),I.body){const[K,Z]=Lp(q,Qa(Fp(C)));b=$p(I.body,Vp,K,Z)}}L.isString(P)||(P=P?"include":"omit");const D=o&&"credentials"in n.prototype,H={...O,signal:A,method:y.toUpperCase(),headers:E.normalize().toJSON(),body:b,duplex:"half",credentials:D?P:void 0};j=o&&new n(m,H);let F=await(o?N(j,O):N(m,H));const W=u&&(k==="stream"||k==="response");if(u&&(S||W&&$)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=F[oe]});const Y=L.toFiniteNumber(F.headers.get("content-length")),[K,Z]=S&&Lp(Y,Qa(Fp(S),!0))||[];F=new r($p(F.body,Vp,K,()=>{Z&&Z(),$&&$()}),I)}k=k||"text";let se=await d[L.findKey(d,k)||"text"](F,p);return!W&&$&&$(),await new Promise((I,Y)=>{av(I,Y,{data:se,headers:It.from(F.headers),status:F.status,statusText:F.statusText,config:p,request:j})})}catch(D){throw $&&$(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new ae("Network Error",ae.ERR_NETWORK,p,j),{cause:D.cause||D}):ae.from(D,D&&D.code,p,j)}}},PP=new Map,uv=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,c,l,u=PP;for(;a--;)c=o[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:RP(t)),u=l;return l};uv();const pf={http:HR,xhr:_P,fetch:{get:uv}};L.forEach(pf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hp=e=>`- ${e}`,OP=e=>L.isFunction(e)||e===null||e===!1;function TP(e,t){e=L.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!OP(r)&&(s=pf[(a=String(r)).toLowerCase()],s===void 0))throw new ae(`Unknown adapter '${a}'`);if(s&&(L.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
9
|
-
`+i.map(Hp).join(`
|
|
10
|
-
`):" "+Hp(i[0]):"as no adapter specified";throw new ae("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const dv={getAdapter:TP,adapters:pf};function Jl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xi(null,e)}function qp(e){return Jl(e),e.headers=It.from(e.headers),e.data=Xl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dv.getAdapter(e.adapter||vi.adapter,e)(e).then(function(r){return Jl(e),r.data=Xl.call(e,e.transformResponse,r),r.headers=It.from(r.headers),r},function(r){return iv(r)||(Jl(e),r&&r.response&&(r.response.data=Xl.call(e,e.transformResponse,r.response),r.response.headers=It.from(r.response.headers))),Promise.reject(r)})}const fv="1.13.4",Uc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Uc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Kp={};Uc.transitional=function(t,n,r){function s(o,i){return"[Axios v"+fv+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new ae(s(i," has been removed"+(n?" in "+n:"")),ae.ERR_DEPRECATED);return n&&!Kp[i]&&(Kp[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};Uc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function MP(e,t,n){if(typeof e!="object")throw new ae("options must be an object",ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],c=a===void 0||i(a,o,e);if(c!==!0)throw new ae("option "+o+" must be "+c,ae.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ae("Unknown option "+o,ae.ERR_BAD_OPTION)}}const Oa={assertOptions:MP,validators:Uc},xn=Oa.validators;let qr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ip,response:new Ip}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
11
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Qr(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Oa.assertOptions(r,{silentJSONParsing:xn.transitional(xn.boolean),forcedJSONParsing:xn.transitional(xn.boolean),clarifyTimeoutError:xn.transitional(xn.boolean)},!1),s!=null&&(L.isFunction(s)?n.paramsSerializer={serialize:s}:Oa.assertOptions(s,{encode:xn.function,serialize:xn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oa.assertOptions(n,{baseUrl:xn.spelling("baseURL"),withXsrfToken:xn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&L.merge(o.common,o[n.method]);o&&L.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=It.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!c){const p=[qp.bind(this),void 0];for(p.unshift(...a),p.push(...l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(;d<f;){const p=a[d++],m=a[d++];try{h=p(h)}catch(y){m.call(this,y);break}}try{u=qp.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Qr(this.defaults,t);const n=cv(t.baseURL,t.url,t.allowAbsoluteUrls);return rv(n,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){qr.prototype[t]=function(n,r){return this.request(Qr(r||{},{method:t,url:n,data:(r||{}).data}))}});L.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(Qr(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}qr.prototype[t]=n(),qr.prototype[t+"Form"]=n(!0)});let AP=class hv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new xi(o,i,a),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 hv(function(s){t=s}),cancel:t}}};function NP(e){return function(n){return e.apply(null,n)}}function DP(e){return L.isObject(e)&&e.isAxiosError===!0}const ed={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(ed).forEach(([e,t])=>{ed[t]=e});function pv(e){const t=new qr(e),n=qb(qr.prototype.request,t);return L.extend(n,qr.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return pv(Qr(e,s))},n}const qe=pv(vi);qe.Axios=qr;qe.CanceledError=xi;qe.CancelToken=AP;qe.isCancel=iv;qe.VERSION=fv;qe.toFormData=Bc;qe.AxiosError=ae;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=NP;qe.isAxiosError=DP;qe.mergeConfig=Qr;qe.AxiosHeaders=It;qe.formToJSON=e=>ov(L.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=dv.getAdapter;qe.HttpStatusCode=ed;qe.default=qe;const{Axios:TH,AxiosError:MH,CanceledError:AH,isCancel:NH,CancelToken:DH,VERSION:IH,all:jH,Cancel:LH,isAxiosError:FH,spread:zH,toFormData:$H,AxiosHeaders:VH,HttpStatusCode:BH,formToJSON:UH,getAdapter:WH,mergeConfig:HH}=qe,td={apiBase:"http://localhost:3000/api",wsPath:"/ws"},Te=qe.create({baseURL:td.apiBase});function IP(e,t){Te.defaults.baseURL=e,t&&(Te.defaults.headers.common.Authorization=`Bearer ${t}`)}function nd(e){e?Te.defaults.headers.common.Authorization=`Bearer ${e}`:delete Te.defaults.headers.common.Authorization}const Wc=Hb()(oR(e=>({token:null,email:null,setAuth:(t,n)=>{nd(t),e({token:t,email:n})},logout:()=>{nd(null),e({token:null,email:null})}}),{name:"kuma_clone_auth"})),Zp=Wc.getState();Zp.token&&nd(Zp.token);const mv="pulsewatch.theme";function rd(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(mv,e)}const gv=Hb((e,t)=>({mode:"light",setMode:n=>{rd(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";rd(n),e({mode:n})}}));function jP(){const t=localStorage.getItem(mv)==="dark"?"dark":"light";rd(t),gv.setState({mode:t})}var _i=e=>e.type==="checkbox",Br=e=>e instanceof Date,At=e=>e==null;const yv=e=>typeof e=="object";var Je=e=>!At(e)&&!Array.isArray(e)&&yv(e)&&!Br(e),bv=e=>Je(e)&&e.target?_i(e.target)?e.target.checked:e.target.value:e,LP=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vv=(e,t)=>e.has(LP(t)),FP=e=>{const t=e.constructor&&e.constructor.prototype;return Je(t)&&t.hasOwnProperty("isPrototypeOf")},mf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(mf&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Je(e)&&FP(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Ge(e[s]));return r}var Hc=e=>/^\w*$/.test(e),Fe=e=>e===void 0,gf=e=>Array.isArray(e)?e.filter(Boolean):[],yf=e=>gf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),X=(e,t,n)=>{if(!t||!Je(e))return n;const r=(Hc(t)?[t]:yf(t)).reduce((s,o)=>At(s)?s:s[o],e);return Fe(r)||r===e?Fe(e[t])?n:e[t]:r},zt=e=>typeof e=="boolean",kt=e=>typeof e=="function",ke=(e,t,n)=>{let r=-1;const s=Hc(t)?[t]:yf(t),o=s.length,i=o-1;for(;++r<o;){const a=s[r];let c=n;if(r!==i){const l=e[a];c=Je(l)||Array.isArray(l)?l:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const ec={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},un={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Nn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},bf=T.createContext(null);bf.displayName="HookFormControlContext";const vf=()=>T.useContext(bf);var xv=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==un.all&&(t._proxyFormState[i]=!r||un.all),n&&(n[i]=!0),e[i]}});return s};const xf=typeof window<"u"?T.useLayoutEffect:T.useEffect;function _v(e){const t=vf(),{control:n=t,disabled:r,name:s,exact:o}=e||{},[i,a]=T.useState(n._formState),c=T.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return xf(()=>n._subscribe({name:s,formState:c.current,exact:o,callback:l=>{!r&&a({...n._formState,...l})}}),[s,r,o]),T.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),T.useMemo(()=>xv(i,n,c.current,!1),[i,n])}var Vt=e=>typeof e=="string",sd=(e,t,n,r,s)=>Vt(e)?(r&&t.watch.add(e),X(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),X(n,o))):(r&&(t.watchAll=!0),n),od=e=>At(e)||!yv(e);function dn(e,t,n=new WeakSet){if(od(e)||od(t))return Object.is(e,t);if(Br(e)&&Br(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(Br(i)&&Br(a)||Je(i)&&Je(a)||Array.isArray(i)&&Array.isArray(a)?!dn(i,a,n):!Object.is(i,a))return!1}}return!0}function zP(e){const t=vf(),{control:n=t,name:r,defaultValue:s,disabled:o,exact:i,compute:a}=e||{},c=T.useRef(s),l=T.useRef(a),u=T.useRef(void 0),d=T.useRef(n),f=T.useRef(r);l.current=a;const[h,p]=T.useState(()=>{const w=n._getWatch(r,c.current);return l.current?l.current(w):w}),m=T.useCallback(w=>{const S=sd(r,n._names,w||n._formValues,!1,c.current);return l.current?l.current(S):S},[n._formValues,n._names,r]),y=T.useCallback(w=>{if(!o){const S=sd(r,n._names,w||n._formValues,!1,c.current);if(l.current){const C=l.current(S);dn(C,u.current)||(p(C),u.current=C)}else p(S)}},[n._formValues,n._names,o,r]);xf(()=>((d.current!==n||!dn(f.current,r))&&(d.current=n,f.current=r,y()),n._subscribe({name:r,formState:{values:!0},exact:i,callback:w=>{y(w.values)}})),[n,i,r,y]),T.useEffect(()=>n._removeUnmounted());const b=d.current!==n,x=f.current,_=T.useMemo(()=>{if(o)return null;const w=!b&&!dn(x,r);return b||w?m():null},[o,b,r,x,m]);return _!==null?_:h}function $P(e){const t=vf(),{name:n,disabled:r,control:s=t,shouldUnregister:o,defaultValue:i,exact:a=!0}=e,c=vv(s._names.array,n),l=T.useMemo(()=>X(s._formValues,n,X(s._defaultValues,n,i)),[s,n,i]),u=zP({control:s,name:n,defaultValue:l,exact:a}),d=_v({control:s,name:n,exact:a}),f=T.useRef(e),h=T.useRef(void 0),p=T.useRef(s.register(n,{...e.rules,value:u,...zt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const m=T.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!X(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!X(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!X(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!X(d.validatingFields,n)},error:{enumerable:!0,get:()=>X(d.errors,n)}}),[d,n]),y=T.useCallback(w=>p.current.onChange({target:{value:bv(w),name:n},type:ec.CHANGE}),[n]),b=T.useCallback(()=>p.current.onBlur({target:{value:X(s._formValues,n),name:n},type:ec.BLUR}),[n,s._formValues]),x=T.useCallback(w=>{const S=X(s._fields,n);S&&S._f&&w&&(S._f.ref={focus:()=>kt(w.focus)&&w.focus(),select:()=>kt(w.select)&&w.select(),setCustomValidity:C=>kt(w.setCustomValidity)&&w.setCustomValidity(C),reportValidity:()=>kt(w.reportValidity)&&w.reportValidity()})},[s._fields,n]),_=T.useMemo(()=>({name:n,value:u,...zt(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:y,onBlur:b,ref:x}),[n,r,d.disabled,y,b,x,u]);return T.useEffect(()=>{const w=s._options.shouldUnregister||o,S=h.current;S&&S!==n&&!c&&s.unregister(S),s.register(n,{...f.current.rules,...zt(f.current.disabled)?{disabled:f.current.disabled}:{}});const C=(k,E)=>{const P=X(s._fields,k);P&&P._f&&(P._f.mount=E)};if(C(n,!0),w){const k=Ge(X(s._options.defaultValues,n,f.current.defaultValue));ke(s._defaultValues,n,k),Fe(X(s._formValues,n))&&ke(s._formValues,n,k)}return!c&&s.register(n),h.current=n,()=>{(c?w&&!s._state.action:w)?s.unregister(n):C(n,!1)}},[n,s,c,o]),T.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),T.useMemo(()=>({field:_,formState:d,fieldState:m}),[_,d,m])}const VP=e=>e.render($P(e)),_f=T.createContext(null);_f.displayName="HookFormContext";const BP=()=>T.useContext(_f),UP=e=>{const{children:t,watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}=e;return T.createElement(_f.Provider,{value:T.useMemo(()=>({watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}),[i,p,l,s,r,f,m,d,u,o,y,a,b,c,h,n])},T.createElement(bf.Provider,{value:p},t))};var wf=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Fo=e=>Array.isArray(e)?e:[e],Gp=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function wv(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],o=t[r];if(s&&Je(s)&&o){const i=wv(s,o);Je(i)&&(n[r]=i)}else e[r]&&(n[r]=o)}return n}var Et=e=>Je(e)&&!Object.keys(e).length,Sf=e=>e.type==="file",tc=e=>{if(!mf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Sv=e=>e.type==="select-multiple",Ef=e=>e.type==="radio",WP=e=>Ef(e)||_i(e),Ql=e=>tc(e)&&e.isConnected;function HP(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Fe(e)?r++:e[t[r++]];return e}function qP(e){for(const t in e)if(e.hasOwnProperty(t)&&!Fe(e[t]))return!1;return!0}function Ye(e,t){const n=Array.isArray(t)?t:Hc(t)?[t]:yf(t),r=n.length===1?e:HP(e,n),s=n.length-1,o=n[s];return r&&delete r[o],s!==0&&(Je(r)&&Et(r)||Array.isArray(r)&&qP(r))&&Ye(e,n.slice(0,-1)),e}var KP=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Ev(e){return Array.isArray(e)||Je(e)&&!KP(e)}function id(e,t={}){for(const n in e){const r=e[n];Ev(r)?(t[n]=Array.isArray(r)?[]:{},id(r,t[n])):Fe(r)||(t[n]=!0)}return t}function Es(e,t,n){n||(n=id(t));for(const r in e){const s=e[r];if(Ev(s))Fe(t)||od(n[r])?n[r]=id(s,Array.isArray(s)?[]:{}):Es(s,At(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!dn(s,o)}}return n}const Yp={value:!1,isValid:!1},Xp={value:!0,isValid:!0};var kv=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&&!Fe(e[0].attributes.value)?Fe(e[0].value)||e[0].value===""?Xp:{value:e[0].value,isValid:!0}:Xp:Yp}return Yp},Cv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Fe(e)?e:t?e===""?NaN:e&&+e:n&&Vt(e)?new Date(e):r?r(e):e;const Jp={isValid:!1,value:null};var Rv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Jp):Jp;function Qp(e){const t=e.ref;return Sf(t)?t.files:Ef(t)?Rv(e.refs).value:Sv(t)?[...t.selectedOptions].map(({value:n})=>n):_i(t)?kv(e.refs).value:Cv(Fe(t.value)?e.ref.value:t.value,e)}var ZP=(e,t,n,r)=>{const s={};for(const o of e){const i=X(t,o);i&&ke(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},nc=e=>e instanceof RegExp,bo=e=>Fe(e)?e:nc(e)?e.source:Je(e)?nc(e.value)?e.value.source:e.value:e,em=e=>({isOnSubmit:!e||e===un.onSubmit,isOnBlur:e===un.onBlur,isOnChange:e===un.onChange,isOnAll:e===un.all,isOnTouch:e===un.onTouched});const tm="AsyncFunction";var GP=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===tm||Je(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===tm)),YP=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),nm=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const zo=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=X(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(zo(a,t))break}else if(Je(a)&&zo(a,t))break}}};function rm(e,t,n){const r=X(e,n);if(r||Hc(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=X(t,o),a=X(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:n}}var XP=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Et(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||un.all))},JP=(e,t,n)=>!e||!t||e===t||Fo(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),QP=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,eO=(e,t)=>!gf(X(e,t)).length&&Ye(e,t),tO=(e,t,n)=>{const r=Fo(X(e,n));return ke(r,"root",t[n]),ke(e,n,r),e};function sm(e,t,n="validate"){if(Vt(e)||Array.isArray(e)&&e.every(Vt)||zt(e)&&!e)return{type:n,message:Vt(e)?e:"",ref:t}}var gs=e=>Je(e)&&!nc(e)?e:{value:e,message:""},om=async(e,t,n,r,s,o)=>{const{ref:i,refs:a,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:y,mount:b}=e._f,x=X(n,m);if(!b||t.has(m))return{};const _=a?a[0]:i,w=A=>{s&&_.reportValidity&&(_.setCustomValidity(zt(A)?"":A||""),_.reportValidity())},S={},C=Ef(i),k=_i(i),E=C||k,P=(y||Sf(i))&&Fe(i.value)&&Fe(x)||tc(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,O=wf.bind(null,m,r,S),N=(A,j,$,q=Nn.maxLength,D=Nn.minLength)=>{const H=A?j:$;S[m]={type:A?q:D,message:H,ref:i,...O(A?q:D,H)}};if(o?!Array.isArray(x)||!x.length:c&&(!E&&(P||At(x))||zt(x)&&!x||k&&!kv(a).isValid||C&&!Rv(a).isValid)){const{value:A,message:j}=Vt(c)?{value:!!c,message:c}:gs(c);if(A&&(S[m]={type:Nn.required,message:j,ref:_,...O(Nn.required,j)},!r))return w(j),S}if(!P&&(!At(d)||!At(f))){let A,j;const $=gs(f),q=gs(d);if(!At(x)&&!isNaN(x)){const D=i.valueAsNumber||x&&+x;At($.value)||(A=D>$.value),At(q.value)||(j=D<q.value)}else{const D=i.valueAsDate||new Date(x),H=se=>new Date(new Date().toDateString()+" "+se),F=i.type=="time",W=i.type=="week";Vt($.value)&&x&&(A=F?H(x)>H($.value):W?x>$.value:D>new Date($.value)),Vt(q.value)&&x&&(j=F?H(x)<H(q.value):W?x<q.value:D<new Date(q.value))}if((A||j)&&(N(!!A,$.message,q.message,Nn.max,Nn.min),!r))return w(S[m].message),S}if((l||u)&&!P&&(Vt(x)||o&&Array.isArray(x))){const A=gs(l),j=gs(u),$=!At(A.value)&&x.length>+A.value,q=!At(j.value)&&x.length<+j.value;if(($||q)&&(N($,A.message,j.message),!r))return w(S[m].message),S}if(h&&!P&&Vt(x)){const{value:A,message:j}=gs(h);if(nc(A)&&!x.match(A)&&(S[m]={type:Nn.pattern,message:j,ref:i,...O(Nn.pattern,j)},!r))return w(j),S}if(p){if(kt(p)){const A=await p(x,n),j=sm(A,_);if(j&&(S[m]={...j,...O(Nn.validate,j.message)},!r))return w(j.message),S}else if(Je(p)){let A={};for(const j in p){if(!Et(A)&&!r)break;const $=sm(await p[j](x,n),_,j);$&&(A={...$,...O(j,$.message)},w($.message),r&&(S[m]=A))}if(!Et(A)&&(S[m]={ref:_,...A},!r))return S}}return w(!0),S};const nO={mode:un.onSubmit,reValidateMode:un.onChange,shouldFocusError:!0};function rO(e={}){let t={...nO,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:kt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Je(t.defaultValues)||Je(t.values)?Ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let f={...d};const h={array:Gp(),state:Gp()},p=t.criteriaMode===un.all,m=R=>M=>{clearTimeout(l),l=setTimeout(R,M)},y=async R=>{if(!i.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||R)){let M;t.resolver?(M=Et((await E()).errors),b()):M=await O(r,!0),M!==n.isValid&&h.state.next({isValid:M})}},b=(R,M)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((R||Array.from(a.mount)).forEach(z=>{z&&(M?ke(n.validatingFields,z,M):Ye(n.validatingFields,z))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Et(n.validatingFields)}))},x=(R,M=[],z,J,G=!0,B=!0)=>{if(J&&z&&!t.disabled){if(i.action=!0,B&&Array.isArray(X(r,R))){const Q=z(X(r,R),J.argA,J.argB);G&&ke(r,R,Q)}if(B&&Array.isArray(X(n.errors,R))){const Q=z(X(n.errors,R),J.argA,J.argB);G&&ke(n.errors,R,Q),eO(n.errors,R)}if((d.touchedFields||f.touchedFields)&&B&&Array.isArray(X(n.touchedFields,R))){const Q=z(X(n.touchedFields,R),J.argA,J.argB);G&&ke(n.touchedFields,R,Q)}(d.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Es(s,o)),h.state.next({name:R,isDirty:A(R,M),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ke(o,R,M)},_=(R,M)=>{ke(n.errors,R,M),h.state.next({errors:n.errors})},w=R=>{n.errors=R,h.state.next({errors:n.errors,isValid:!1})},S=(R,M,z,J)=>{const G=X(r,R);if(G){const B=X(o,R,Fe(z)?X(s,R):z);Fe(B)||J&&J.defaultChecked||M?ke(o,R,M?B:Qp(G._f)):q(R,B),i.mount&&!i.action&&y()}},C=(R,M,z,J,G)=>{let B=!1,Q=!1;const ue={name:R};if(!t.disabled){if(!z||J){(d.isDirty||f.isDirty)&&(Q=n.isDirty,n.isDirty=ue.isDirty=A(),B=Q!==ue.isDirty);const ve=dn(X(s,R),M);Q=!!X(n.dirtyFields,R),ve?Ye(n.dirtyFields,R):ke(n.dirtyFields,R,!0),ue.dirtyFields=n.dirtyFields,B=B||(d.dirtyFields||f.dirtyFields)&&Q!==!ve}if(z){const ve=X(n.touchedFields,R);ve||(ke(n.touchedFields,R,z),ue.touchedFields=n.touchedFields,B=B||(d.touchedFields||f.touchedFields)&&ve!==z)}B&&G&&h.state.next(ue)}return B?ue:{}},k=(R,M,z,J)=>{const G=X(n.errors,R),B=(d.isValid||f.isValid)&&zt(M)&&n.isValid!==M;if(t.delayError&&z?(c=m(()=>_(R,z)),c(t.delayError)):(clearTimeout(l),c=null,z?ke(n.errors,R,z):Ye(n.errors,R)),(z?!dn(G,z):G)||!Et(J)||B){const Q={...J,...B&&zt(M)?{isValid:M}:{},errors:n.errors,name:R};n={...n,...Q},h.state.next(Q)}},E=async R=>(b(R,!0),await t.resolver(o,t.context,ZP(R||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),P=async R=>{const{errors:M}=await E(R);if(b(R),R)for(const z of R){const J=X(M,z);J?ke(n.errors,z,J):Ye(n.errors,z)}else n.errors=M;return M},O=async(R,M,z={valid:!0})=>{for(const J in R){const G=R[J];if(G){const{_f:B,...Q}=G;if(B){const ue=a.array.has(B.name),ve=G._f&&GP(G._f);ve&&d.validatingFields&&b([B.name],!0);const Ue=await om(G,a.disabled,o,p,t.shouldUseNativeValidation&&!M,ue);if(ve&&d.validatingFields&&b([B.name]),Ue[B.name]&&(z.valid=!1,M||e.shouldUseNativeValidation))break;!M&&(X(Ue,B.name)?ue?tO(n.errors,Ue,B.name):ke(n.errors,B.name,Ue[B.name]):Ye(n.errors,B.name))}!Et(Q)&&await O(Q,M,z)}}return z.valid},N=()=>{for(const R of a.unMount){const M=X(r,R);M&&(M._f.refs?M._f.refs.every(z=>!Ql(z)):!Ql(M._f.ref))&&ee(R)}a.unMount=new Set},A=(R,M)=>!t.disabled&&(R&&M&&ke(o,R,M),!dn(I(),s)),j=(R,M,z)=>sd(R,a,{...i.mount?o:Fe(M)?s:Vt(R)?{[R]:M}:M},z,M),$=R=>gf(X(i.mount?o:s,R,t.shouldUnregister?X(s,R,[]):[])),q=(R,M,z={})=>{const J=X(r,R);let G=M;if(J){const B=J._f;B&&(!B.disabled&&ke(o,R,Cv(M,B)),G=tc(B.ref)&&At(M)?"":M,Sv(B.ref)?[...B.ref.options].forEach(Q=>Q.selected=G.includes(Q.value)):B.refs?_i(B.ref)?B.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(G)?Q.checked=!!G.find(ue=>ue===Q.value):Q.checked=G===Q.value||!!G)}):B.refs.forEach(Q=>Q.checked=Q.value===G):Sf(B.ref)?B.ref.value="":(B.ref.value=G,B.ref.type||h.state.next({name:R,values:Ge(o)})))}(z.shouldDirty||z.shouldTouch)&&C(R,G,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&se(R)},D=(R,M,z)=>{for(const J in M){if(!M.hasOwnProperty(J))return;const G=M[J],B=R+"."+J,Q=X(r,B);(a.array.has(R)||Je(G)||Q&&!Q._f)&&!Br(G)?D(B,G,z):q(B,G,z)}},H=(R,M,z={})=>{const J=X(r,R),G=a.array.has(R),B=Ge(M);ke(o,R,B),G?(h.array.next({name:R,values:Ge(o)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&z.shouldDirty&&h.state.next({name:R,dirtyFields:Es(s,o),isDirty:A(R,B)})):J&&!J._f&&!At(B)?D(R,B,z):q(R,B,z),nm(R,a)?h.state.next({...n,name:R,values:Ge(o)}):h.state.next({name:i.mount?R:void 0,values:Ge(o)})},F=async R=>{i.mount=!0;const M=R.target;let z=M.name,J=!0;const G=X(r,z),B=ve=>{J=Number.isNaN(ve)||Br(ve)&&isNaN(ve.getTime())||dn(ve,X(o,z,ve))},Q=em(t.mode),ue=em(t.reValidateMode);if(G){let ve,Ue;const bn=M.type?Qp(G._f):bv(R),wt=R.type===ec.BLUR||R.type===ec.FOCUS_OUT,Dl=!YP(G._f)&&!t.resolver&&!X(n.errors,z)&&!G._f.deps||QP(wt,X(n.touchedFields,z),n.isSubmitted,ue,Q),ao=nm(z,a,wt);ke(o,z,bn),wt?(!M||!M.readOnly)&&(G._f.onBlur&&G._f.onBlur(R),c&&c(0)):G._f.onChange&&G._f.onChange(R);const ms=C(z,bn,wt),Ai=!Et(ms)||ao;if(!wt&&h.state.next({name:z,type:R.type,values:Ge(o)}),Dl)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?wt&&y():wt||y()),Ai&&h.state.next({name:z,...ao?{}:ms});if(!wt&&ao&&h.state.next({...n}),t.resolver){const{errors:Ni}=await E([z]);if(b([z]),B(bn),J){const co=rm(n.errors,r,z),sn=rm(Ni,r,co.name||z);ve=sn.error,z=sn.name,Ue=Et(Ni)}}else b([z],!0),ve=(await om(G,a.disabled,o,p,t.shouldUseNativeValidation))[z],b([z]),B(bn),J&&(ve?Ue=!1:(d.isValid||f.isValid)&&(Ue=await O(r,!0)));J&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&se(G._f.deps),k(z,Ue,ve,ms))}},W=(R,M)=>{if(X(n.errors,M)&&R.focus)return R.focus(),1},se=async(R,M={})=>{let z,J;const G=Fo(R);if(t.resolver){const B=await P(Fe(R)?R:G);z=Et(B),J=R?!G.some(Q=>X(B,Q)):z}else R?(J=(await Promise.all(G.map(async B=>{const Q=X(r,B);return await O(Q&&Q._f?{[B]:Q}:Q)}))).every(Boolean),!(!J&&!n.isValid)&&y()):J=z=await O(r);return h.state.next({...!Vt(R)||(d.isValid||f.isValid)&&z!==n.isValid?{}:{name:R},...t.resolver||!R?{isValid:z}:{},errors:n.errors}),M.shouldFocus&&!J&&zo(r,W,R?G:a.mount),J},I=(R,M)=>{let z={...i.mount?o:s};return M&&(z=wv(M.dirtyFields?n.dirtyFields:n.touchedFields,z)),Fe(R)?z:Vt(R)?X(z,R):R.map(J=>X(z,J))},Y=(R,M)=>({invalid:!!X((M||n).errors,R),isDirty:!!X((M||n).dirtyFields,R),error:X((M||n).errors,R),isValidating:!!X(n.validatingFields,R),isTouched:!!X((M||n).touchedFields,R)}),K=R=>{R&&Fo(R).forEach(M=>Ye(n.errors,M)),h.state.next({errors:R?n.errors:{}})},Z=(R,M,z)=>{const J=(X(r,R,{_f:{}})._f||{}).ref,G=X(n.errors,R)||{},{ref:B,message:Q,type:ue,...ve}=G;ke(n.errors,R,{...ve,...M,ref:J}),h.state.next({name:R,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&J&&J.focus&&J.focus()},oe=(R,M)=>kt(R)?h.state.subscribe({next:z=>"values"in z&&R(j(void 0,M),z)}):j(R,M,!0),ce=R=>h.state.subscribe({next:M=>{JP(R.name,M.name,R.exact)&&XP(M,R.formState||d,Qn,R.reRenderRoot)&&R.callback({values:{...o},...n,...M,defaultValues:s})}}).unsubscribe,V=R=>(i.mount=!0,f={...f,...R.formState},ce({...R,formState:{...u,...R.formState}})),ee=(R,M={})=>{for(const z of R?Fo(R):a.mount)a.mount.delete(z),a.array.delete(z),M.keepValue||(Ye(r,z),Ye(o,z)),!M.keepError&&Ye(n.errors,z),!M.keepDirty&&Ye(n.dirtyFields,z),!M.keepTouched&&Ye(n.touchedFields,z),!M.keepIsValidating&&Ye(n.validatingFields,z),!t.shouldUnregister&&!M.keepDefaultValue&&Ye(s,z);h.state.next({values:Ge(o)}),h.state.next({...n,...M.keepDirty?{isDirty:A()}:{}}),!M.keepIsValid&&y()},me=({disabled:R,name:M})=>{if(zt(R)&&i.mount||R||a.disabled.has(M)){const G=a.disabled.has(M)!==!!R;R?a.disabled.add(M):a.disabled.delete(M),G&&i.mount&&!i.action&&y()}},le=(R,M={})=>{let z=X(r,R);const J=zt(M.disabled)||zt(t.disabled);return ke(r,R,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:R}},name:R,mount:!0,...M}}),a.mount.add(R),z?me({disabled:zt(M.disabled)?M.disabled:t.disabled,name:R}):S(R,!0,M.value),{...J?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:bo(M.min),max:bo(M.max),minLength:bo(M.minLength),maxLength:bo(M.maxLength),pattern:bo(M.pattern)}:{},name:R,onChange:F,onBlur:F,ref:G=>{if(G){le(R,M),z=X(r,R);const B=Fe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,Q=WP(B),ue=z._f.refs||[];if(Q?ue.find(ve=>ve===B):B===z._f.ref)return;ke(r,R,{_f:{...z._f,...Q?{refs:[...ue.filter(Ql),B,...Array.isArray(X(s,R))?[{}]:[]],ref:{type:B.type,name:R}}:{ref:B}}}),S(R,!1,void 0,B)}else z=X(r,R,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(vv(a.array,R)&&i.action)&&a.unMount.add(R)}}},fe=()=>t.shouldFocusError&&zo(r,W,a.mount),ge=R=>{zt(R)&&(h.state.next({disabled:R}),zo(r,(M,z)=>{const J=X(r,z);J&&(M.disabled=J._f.disabled||R,Array.isArray(J._f.refs)&&J._f.refs.forEach(G=>{G.disabled=J._f.disabled||R}))},0,!1))},Ze=(R,M)=>async z=>{let J;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let G=Ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:Q}=await E();b(),n.errors=B,G=Ge(Q)}else await O(r);if(a.disabled.size)for(const B of a.disabled)Ye(G,B);if(Ye(n.errors,"root"),Et(n.errors)){h.state.next({errors:{}});try{await R(G,z)}catch(B){J=B}}else M&&await M({...n.errors},z),fe(),setTimeout(fe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Et(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},_t=(R,M={})=>{X(r,R)&&(Fe(M.defaultValue)?H(R,Ge(X(s,R))):(H(R,M.defaultValue),ke(s,R,Ge(M.defaultValue))),M.keepTouched||Ye(n.touchedFields,R),M.keepDirty||(Ye(n.dirtyFields,R),n.isDirty=M.defaultValue?A(R,Ge(X(s,R))):A()),M.keepError||(Ye(n.errors,R),d.isValid&&y()),h.state.next({...n}))},rn=(R,M={})=>{const z=R?Ge(R):s,J=Ge(z),G=Et(R),B=G?s:J;if(M.keepDefaultValues||(s=z),!M.keepValues){if(M.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Es(s,o))]);for(const ue of Array.from(Q)){const ve=X(n.dirtyFields,ue),Ue=X(o,ue),bn=X(B,ue);ve&&!Fe(Ue)?ke(B,ue,Ue):!ve&&!Fe(bn)&&H(ue,bn)}}else{if(mf&&Fe(R))for(const Q of a.mount){const ue=X(r,Q);if(ue&&ue._f){const ve=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(tc(ve)){const Ue=ve.closest("form");if(Ue){Ue.reset();break}}}}if(M.keepFieldsRef)for(const Q of a.mount)H(Q,X(B,Q));else r={}}o=t.shouldUnregister?M.keepDefaultValues?Ge(s):{}:Ge(B),h.array.next({values:{...B}}),h.state.next({values:{...B}})}a={mount:M.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!Et(B),i.watch=!!t.shouldUnregister,i.keepIsValid=!!M.keepIsValid,i.action=!1,M.keepErrors||(n.errors={}),h.state.next({submitCount:M.keepSubmitCount?n.submitCount:0,isDirty:G?!1:M.keepDirty?n.isDirty:!!(M.keepDefaultValues&&!dn(R,s)),isSubmitted:M.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:G?{}:M.keepDirtyValues?M.keepDefaultValues&&o?Es(s,o):n.dirtyFields:M.keepDefaultValues&&R?Es(s,R):M.keepDirty?n.dirtyFields:{},touchedFields:M.keepTouched?n.touchedFields:{},errors:M.keepErrors?n.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},qt=(R,M)=>rn(kt(R)?R(o):R,{...t.resetOptions,...M}),st=(R,M={})=>{const z=X(r,R),J=z&&z._f;if(J){const G=J.refs?J.refs[0]:J.ref;G.focus&&setTimeout(()=>{G.focus(),M.shouldSelect&&kt(G.select)&&G.select()})}},Qn=R=>{n={...n,...R}},ps={control:{register:le,unregister:ee,getFieldState:Y,handleSubmit:Ze,setError:Z,_subscribe:ce,_runSchema:E,_updateIsValidating:b,_focusError:fe,_getWatch:j,_getDirty:A,_setValid:y,_setFieldArray:x,_setDisabledField:me,_setErrors:w,_getFieldArray:$,_reset:rn,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(R=>{qt(R,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:ge,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(R){i=R},get _defaultValues(){return s},get _names(){return a},set _names(R){a=R},get _formState(){return n},get _options(){return t},set _options(R){t={...t,...R}}},subscribe:V,trigger:se,register:le,handleSubmit:Ze,watch:oe,setValue:H,getValues:I,reset:qt,resetField:_t,clearErrors:K,unregister:ee,setError:Z,setFocus:st,getFieldState:Y};return{...ps,formControl:ps}}function kf(e={}){const t=T.useRef(void 0),n=T.useRef(void 0),[r,s]=T.useState({isDirty:!1,isValidating:!1,isLoading:kt(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:kt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=rO(e);t.current={...a,formState:r}}const o=t.current.control;return o._options=e,xf(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),T.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),T.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),T.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),T.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),T.useEffect(()=>{var i;e.values&&!dn(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),T.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=T.useMemo(()=>xv(r,o),[o,r]),t.current}function Pv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Pv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Cf(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Pv(e))&&(r&&(r+=" "),r+=t);return r}const sO=(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},oO=(e,t)=>({classGroupId:e,validator:t}),Ov=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rc="-",im=[],iO="arbitrary..",aO=e=>{const t=lO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return cO(i);const a=i.split(rc),c=a[0]===""&&a.length>1?1:0;return Tv(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],l=n[i];return c?l?sO(l,c):c:l||im}return n[i]||im}}},Tv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const l=Tv(e,t+1,o);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(rc):e.slice(t).join(rc),c=i.length;for(let l=0;l<c;l++){const u=i[l];if(u.validator(a))return u.classGroupId}},cO=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?iO+r:void 0})(),lO=e=>{const{theme:t,classGroups:n}=e;return uO(n,t)},uO=(e,t)=>{const n=Ov();for(const r in e){const s=e[r];Rf(s,n,r,t)}return n},Rf=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];dO(i,t,n,r)}},dO=(e,t,n,r)=>{if(typeof e=="string"){fO(e,t,n);return}if(typeof e=="function"){hO(e,t,n,r);return}pO(e,t,n,r)},fO=(e,t,n)=>{const r=e===""?t:Mv(t,e);r.classGroupId=n},hO=(e,t,n,r)=>{if(mO(e)){Rf(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(oO(n,e))},pO=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];Rf(c,Mv(t,a),n,r)}},Mv=(e,t)=>{let n=e;const r=t.split(rc),s=r.length;for(let o=0;o<s;o++){const i=r[o];let a=n.nextPart.get(i);a||(a=Ov(),n.nextPart.set(i,a)),n=a}return n},mO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},ad="!",am=":",yO=[],cm=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),bO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,l;const u=s.length;for(let m=0;m<u;m++){const y=s[m];if(i===0&&a===0){if(y===am){o.push(s.slice(c,m)),c=m+1;continue}if(y==="/"){l=m;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const d=o.length===0?s:s.slice(c);let f=d,h=!1;d.endsWith(ad)?(f=d.slice(0,-1),h=!0):d.startsWith(ad)&&(f=d.slice(1),h=!0);const p=l&&l>c?l-c:void 0;return cm(o,h,f,p)};if(t){const s=t+am,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):cm(yO,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},vO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],a=i[0]==="[",c=t.has(i);a||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},xO=e=>({cache:gO(e.cacheSize),parseClassName:bO(e),sortModifiers:vO(e),...aO(e)}),_O=/\s+/,wO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(_O);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let y=!!m,b=r(y?p.substring(0,m):p);if(!b){if(!y){c=u+(c.length>0?" "+c:c);continue}if(b=r(p),!b){c=u+(c.length>0?" "+c:c);continue}y=!1}const x=f.length===0?"":f.length===1?f[0]:o(f).join(":"),_=h?x+ad:x,w=_+b;if(i.indexOf(w)>-1)continue;i.push(w);const S=s(b,y);for(let C=0;C<S.length;++C){const k=S[C];i.push(_+k)}c=u+(c.length>0?" "+c:c)}return c},SO=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Av(n))&&(s&&(s+=" "),s+=r);return s},Av=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Av(e[r]))&&(n&&(n+=" "),n+=t);return n},EO=(e,...t)=>{let n,r,s,o;const i=c=>{const l=t.reduce((u,d)=>d(u),e());return n=xO(l),r=n.cache.get,s=n.cache.set,o=a,a(c)},a=c=>{const l=r(c);if(l)return l;const u=wO(c,n);return s(c,u),u};return o=i,(...c)=>o(SO(...c))},kO=[],tt=e=>{const t=n=>n[e]||kO;return t.isThemeGetter=!0,t},Nv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Dv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CO=/^\d+\/\d+$/,RO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PO=/\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$/,OO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,TO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=e=>CO.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),er=e=>!!e&&Number.isInteger(Number(e)),eu=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Dn=e=>RO.test(e),AO=()=>!0,NO=e=>PO.test(e)&&!OO.test(e),Iv=()=>!1,DO=e=>TO.test(e),IO=e=>MO.test(e),jO=e=>!te(e)&&!ne(e),LO=e=>eo(e,Fv,Iv),te=e=>Nv.test(e),Tr=e=>eo(e,zv,NO),tu=e=>eo(e,BO,pe),lm=e=>eo(e,jv,Iv),FO=e=>eo(e,Lv,IO),Hi=e=>eo(e,$v,DO),ne=e=>Dv.test(e),vo=e=>to(e,zv),zO=e=>to(e,UO),um=e=>to(e,jv),$O=e=>to(e,Fv),VO=e=>to(e,Lv),qi=e=>to(e,$v,!0),eo=(e,t,n)=>{const r=Nv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},to=(e,t,n=!1)=>{const r=Dv.exec(e);return r?r[1]?t(r[1]):n:!1},jv=e=>e==="position"||e==="percentage",Lv=e=>e==="image"||e==="url",Fv=e=>e==="length"||e==="size"||e==="bg-size",zv=e=>e==="length",BO=e=>e==="number",UO=e=>e==="family-name",$v=e=>e==="shadow",WO=()=>{const e=tt("color"),t=tt("font"),n=tt("text"),r=tt("font-weight"),s=tt("tracking"),o=tt("leading"),i=tt("breakpoint"),a=tt("container"),c=tt("spacing"),l=tt("radius"),u=tt("shadow"),d=tt("inset-shadow"),f=tt("text-shadow"),h=tt("drop-shadow"),p=tt("blur"),m=tt("perspective"),y=tt("aspect"),b=tt("ease"),x=tt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),ne,te],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],E=()=>[ne,te,c],P=()=>[ys,"full","auto",...E()],O=()=>[er,"none","subgrid",ne,te],N=()=>["auto",{span:["full",er,ne,te]},er,ne,te],A=()=>[er,"auto",ne,te],j=()=>["auto","min","max","fr",ne,te],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...E()],H=()=>[ys,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],F=()=>[e,ne,te],W=()=>[...w(),um,lm,{position:[ne,te]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",$O,LO,{size:[ne,te]}],Y=()=>[eu,vo,Tr],K=()=>["","none","full",l,ne,te],Z=()=>["",pe,vo,Tr],oe=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[pe,eu,um,lm],ee=()=>["","none",p,ne,te],me=()=>["none",pe,ne,te],le=()=>["none",pe,ne,te],fe=()=>[pe,ne,te],ge=()=>[ys,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dn],breakpoint:[Dn],color:[AO],container:[Dn],"drop-shadow":[Dn],ease:["in","out","in-out"],font:[jO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dn],shadow:[Dn],spacing:["px",pe],text:[Dn],"text-shadow":[Dn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ys,te,ne,y]}],container:["container"],columns:[{columns:[pe,te,ne,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[er,"auto",ne,te]}],basis:[{basis:[ys,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,ys,"auto","initial","none",te]}],grow:[{grow:["",pe,ne,te]}],shrink:[{shrink:["",pe,ne,te]}],order:[{order:[er,"first","last","none",ne,te]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[a,"screen",...H()]}],"min-w":[{"min-w":[a,"screen","none",...H()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,vo,Tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ne,tu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eu,te]}],"font-family":[{font:[zO,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ne,te]}],"line-clamp":[{"line-clamp":[pe,"none",ne,tu]}],leading:[{leading:[o,...E()]}],"list-image":[{"list-image":["none",ne,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,te]}],"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:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",ne,Tr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pe,"auto",ne,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,te]}],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",ne,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},er,ne,te],radial:["",ne,te],conic:[er,ne,te]},VO,FO]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"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-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:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,ne,te]}],"outline-w":[{outline:["",pe,vo,Tr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,qi,Hi]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,qi,Hi]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pe,Tr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",f,qi,Hi]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pe,ne,te]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ne,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"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:W()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,te]}],filter:[{filter:["","none",ne,te]}],blur:[{blur:ee()}],brightness:[{brightness:[pe,ne,te]}],contrast:[{contrast:[pe,ne,te]}],"drop-shadow":[{"drop-shadow":["","none",h,qi,Hi]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",pe,ne,te]}],"hue-rotate":[{"hue-rotate":[pe,ne,te]}],invert:[{invert:["",pe,ne,te]}],saturate:[{saturate:[pe,ne,te]}],sepia:[{sepia:["",pe,ne,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,te]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[pe,ne,te]}],"backdrop-contrast":[{"backdrop-contrast":[pe,ne,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,ne,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,ne,te]}],"backdrop-invert":[{"backdrop-invert":["",pe,ne,te]}],"backdrop-opacity":[{"backdrop-opacity":[pe,ne,te]}],"backdrop-saturate":[{"backdrop-saturate":[pe,ne,te]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,ne,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ne,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",ne,te]}],ease:[{ease:["linear","initial",b,ne,te]}],delay:[{delay:[pe,ne,te]}],animate:[{animate:["none",x,ne,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ne,te]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ne,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"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",ne,te]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",ne,te]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[pe,vo,Tr,tu]}],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","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Vv=EO(WO);function Pf(...e){return Vv(Cf(e))}function Yo(e){return g.jsx("div",{...e,className:Pf("rounded-2xl border bg-white shadow-sm",e.className)})}function Xo(e){return g.jsx("div",{...e,className:Pf("border-b px-4 py-3",e.className)})}function Jo(e){return g.jsx("div",{...e,className:Pf("px-4 py-3",e.className)})}function HO(){const e=ls(),t=Wc(),{register:n,handleSubmit:r,formState:s}=kf({defaultValues:{email:"admin@example.com",password:"ChangeMe123!"}}),o=r(async i=>{try{const a=await Te.post("/auth/login",i);t.setAuth(a.data.token,a.data.user.email),Ee.success("Logged in"),e({to:"/"})}catch(a){Ee.error(a?.response?.data?.detail??"Login failed")}});return g.jsx("div",{className:"mx-auto max-w-md",children:g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Login"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"Use the admin credentials from your backend env."})]}),g.jsx(Jo,{children:g.jsxs("form",{onSubmit:o,className:"space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Email"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("email",{required:!0})})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Password"}),g.jsx("input",{type:"password",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("password",{required:!0})})]}),g.jsx("button",{disabled:s.isSubmitting,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:s.isSubmitting?"Signing in...":"Sign in"})]})})]})})}function qO(){return g.jsx("div",{className:"flex-1 bg-neutral-50 p-6 dark:bg-neutral-900/40",children:g.jsx(of,{})})}var Ki={exports:{}},nu={};var dm;function KO(){if(dm)return nu;dm=1;var e=T;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return nu.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},nu}var ru={};var fm;function ZO(){return fm||(fm=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,s=t.useRef,o=t.useEffect,i=t.useMemo,a=t.useDebugValue;ru.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ru}var hm;function GO(){return hm||(hm=1,process.env.NODE_ENV==="production"?Ki.exports=KO():Ki.exports=ZO()),Ki.exports}var YO=GO();function XO(e){e()}function JO(){let e=null,t=null;return{clear(){e=null,t=null},notify(){XO(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var pm={notify(){},get:()=>[]};function QO(e,t){let n,r=pm,s=0,o=!1;function i(m){u();const y=r.subscribe(m);let b=!1;return()=>{b||(b=!0,y(),d())}}function a(){r.notify()}function c(){p.onStateChange&&p.onStateChange()}function l(){return o}function u(){s++,n||(n=e.subscribe(c),r=JO())}function d(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=pm)}function f(){o||(o=!0,u())}function h(){o&&(o=!1,d())}const p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return p}var eT=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tT=eT(),nT=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rT=nT(),sT=()=>tT||rT?v.useLayoutEffect:v.useEffect,oT=sT(),iT=Symbol.for("react-redux-context"),aT=typeof globalThis<"u"?globalThis:{};function cT(){if(!v.createContext)return{};const e=aT[iT]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(v.createContext,t)),t}var mr=cT();function lT(e){const{children:t,context:n,serverState:r,store:s}=e,o=v.useMemo(()=>{const c=QO(s),l={store:s,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return l;{const{identityFunctionCheck:u="once",stabilityCheck:d="once"}=e;return Object.assign(l,{stabilityCheck:d,identityFunctionCheck:u})}},[s,r]),i=v.useMemo(()=>s.getState(),[s]);oT(()=>{const{subscription:c}=o;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),i!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[o,i]);const a=n||mr;return v.createElement(a.Provider,{value:o},t)}var uT=lT;function Of(e=mr){return function(){const n=v.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var Bv=Of();function Uv(e=mr){const t=e===mr?Bv:Of(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var dT=Uv();function fT(e=mr){const t=e===mr?dT:Uv(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var hT=fT(),pT=(e,t)=>e===t;function mT(e=mr){const t=e===mr?Bv:Of(e),n=(r,s={})=>{const{equalityFn:o=pT}=typeof s=="function"?{equalityFn:s}:s;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof o!="function")throw new Error("You must pass a function as an equality function to useSelector")}const i=t(),{store:a,subscription:c,getServerState:l}=i,u=v.useRef(!0),d=v.useCallback({[r.name](h){const p=r(h);if(process.env.NODE_ENV!=="production"){const{devModeChecks:m={}}=typeof s=="function"?{}:s,{identityFunctionCheck:y,stabilityCheck:b}=i,{identityFunctionCheck:x,stabilityCheck:_}={stabilityCheck:b,identityFunctionCheck:y,...m};if(_==="always"||_==="once"&&u.current){const w=r(h);if(!o(p,w)){let S;try{throw new Error}catch(C){({stack:S}=C)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
6
|
+
<%s key={someKey} {...props} />`,Z,V,ee,V),se[V+Z]=!0)}if(V=null,K!==void 0&&(n(K),V=""+K),i(Y)&&(n(Y.key),V=""+Y.key),"key"in Y){K={};for(var me in Y)me!=="key"&&(K[me]=Y[me])}else K=Y;return V&&a(K,typeof I=="function"?I.displayName||I.name||"Unknown":I),l(I,V,K,s(),oe,ce)}function d(I){f(I)?I._store&&(I._store.validated=1):typeof I=="object"&&I!==null&&I.$$typeof===P&&(I._payload.status==="fulfilled"?f(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function f(I){return typeof I=="object"&&I!==null&&I.$$typeof===p}var h=T,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),w=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,$=Array.isArray,q=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(I){return I()}};var D,H={},F=h.react_stack_bottom_frame.bind(h,o)(),W=q(r(o)),se={};uo.Fragment=y,uo.jsx=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!1,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)},uo.jsxs=function(I,Y,K){var Z=1e4>A.recentlyCreatedOwnerStacks++;return u(I,Y,K,!0,Z?Error("react-stack-top-frame"):F,Z?q(r(I)):W)}})()),uo}var Uh;function aE(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?ji.exports=oE():ji.exports=iE()),ji.exports}var g=aE();const Fu=new WeakMap,cE=new WeakMap,Ua={current:[]};let Il=!1,jo=0;const Co=new Set,Li=new Map;function ub(e){for(const t of e){if(Ua.current.includes(t))continue;Ua.current.push(t),t.recompute();const n=cE.get(t);if(n)for(const r of n){const s=Fu.get(r);s?.length&&ub(s)}}}function lE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function uE(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function db(e){if(jo>0&&!Li.has(e)&&Li.set(e,e.prevState),Co.add(e),!(jo>0)&&!Il)try{for(Il=!0;Co.size>0;){const t=Array.from(Co);Co.clear();for(const n of t){const r=Li.get(n)??n.prevState;n.prevState=r,lE(n)}for(const n of t){const r=Fu.get(n);r&&(Ua.current.push(n),ub(r))}for(const n of t){const r=Fu.get(n);if(r)for(const s of r)uE(s)}}}finally{Il=!1,Ua.current=[],Li.clear()}}function dE(e){jo++;try{e()}finally{if(jo--,jo===0){const t=Co.values().next().value;t&&db(t)}}}function fE(e){return typeof e=="function"}class hE{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var s,o;this.listeners.add(r);const i=(o=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:o.call(s,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,s;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):fE(t)?this.state=t(this.prevState):this.state=t,(s=(r=this.options)==null?void 0:r.onUpdate)==null||s.call(r),db(this)}}const ur="__TSR_index",Wh="popstate",Hh="beforeunload";function pE(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:i}))},s=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},o=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const u=e.getBlockers?.()??[],d=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&d)for(const f of u){const h=Wa(c.path,c.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:c.type})){e.onBlocked?.();return}}i()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:i=>(n.add(i),()=>{n.delete(i)}),push:(i,a,c)=>{const l=t.state[ur];a=qh(l+1,a),o({task:()=>{e.pushState(i,a),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=t.state[ur];a=qh(l,a),o({task:()=>{e.replaceState(i,a),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{o({task:()=>{e.go(i),s({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{o({task:()=>{e.back(i?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{o({task:()=>{e.forward(i?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[ur]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,i]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function qh(e,t){t||(t={});const n=Yd();return{...t,key:n,__TSR_key:n,[ur]:e}}function mE(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const o=()=>s,i=E=>s=E,a=(E=>E),c=(()=>Wa(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const E=Yd();t.history.replaceState({[ur]:0,key:E,__TSR_key:E},"")}let l=c(),u,d=!1,f=!1,h=!1,p=!1;const m=()=>l;let y,b;const x=()=>{y&&(k._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),k._ignoreSubscribers=!1,y=void 0,b=void 0,u=void 0)},_=(E,P,O)=>{const N=a(P);b||(u=l),l=Wa(P,O),y={href:N,state:O,isPush:y?.isPush||E==="push"},b||(b=Promise.resolve().then(()=>x()))},w=E=>{l=c(),k.notify({type:E})},S=async()=>{if(f){f=!1;return}const E=c(),P=E.state[ur]-l.state[ur],O=P===1,N=P===-1,A=!O&&!N||d;d=!1;const j=A?"GO":N?"BACK":"FORWARD",$=A?{type:"GO",index:P}:{type:N?"BACK":"FORWARD"};if(h)h=!1;else{const q=o();if(typeof document<"u"&&q.length){for(const D of q)if(await D.blockerFn({currentLocation:l,nextLocation:E,action:j})){f=!0,t.history.go(1),k.notify($);return}}}l=c(),k.notify($)},C=E=>{if(p){p=!1;return}let P=!1;const O=o();if(typeof document<"u"&&O.length)for(const N of O){const A=N.enableBeforeUnload??!0;if(A===!0){P=!0;break}if(typeof A=="function"&&A()===!0){P=!0;break}}if(P)return E.preventDefault(),E.returnValue=""},k=pE({getLocation:m,getLength:()=>t.history.length,pushState:(E,P)=>_("push",E,P),replaceState:(E,P)=>_("replace",E,P),back:E=>(E&&(h=!0),p=!0,t.history.back()),forward:E=>{E&&(h=!0),p=!0,t.history.forward()},go:E=>{d=!0,t.history.go(E)},createHref:E=>a(E),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hh,C,{capture:!0}),t.removeEventListener(Wh,S)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:o,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(Hh,C,{capture:!0}),t.addEventListener(Wh,S),t.history.pushState=function(...E){const P=n.apply(t.history,E);return k._ignoreSubscribers||w("PUSH"),P},t.history.replaceState=function(...E){const P=r.apply(t.history,E);return k._ignoreSubscribers||w("REPLACE"),P},k}function gE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Wa(e,t){const n=gE(e),r=n.indexOf("#"),s=n.indexOf("?"),o=Yd();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[ur]:0,key:o,__TSR_key:o}}}function Yd(){return(Math.random()+1).toString(36).substring(7)}const yE=!1;function Lo(e){let t;return dE(()=>{t=e()}),t}function Ho(e){return e[e.length-1]}function bE(e){return typeof e=="function"}function sr(e,t){return bE(e)?e(t):e}const vE=Object.prototype.hasOwnProperty,Kh=Object.prototype.propertyIsEnumerable;function Ot(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,s=Yh(e)&&Yh(r);if(!s&&!(Ha(e)&&Ha(r)))return r;const o=s?e:Zh(e);if(!o)return r;const i=s?r:Zh(r);if(!i)return r;const a=o.length,c=i.length,l=s?new Array(c):{};let u=0;for(let d=0;d<c;d++){const f=s?d:i[d],h=e[f],p=r[f];if(h===p){l[f]=h,(s?d<a:vE.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[f]=p;continue}const m=Ot(h,p,n+1);l[f]=m,m===h&&u++}return a===c&&u===a?e:l}function Zh(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!Kh.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!Kh.call(e,s))return!1;r.push(s)}return r}function Ha(e){if(!Gh(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Gh(n)||!n.hasOwnProperty("isPrototypeOf"))}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!Wr(e[r],t[r],n))return!1;return!0}if(Ha(e)&&Ha(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Wr(e[i],t[i],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&s++;let o=0;for(const i in t)if((!r||t[i]!==void 0)&&(o++,o>s||!Wr(e[i],t[i],n)))return!1;return s===o}return!1}function Us(e){let t,n;const r=new Promise((s,o)=>{t=s,n=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Ms(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Xh(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}}function xE(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Jh(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return xE(t)}const fb=["http:","https:","mailto:","tel:"];function qa(e){if(!e)return!1;try{const t=new URL(e);return!fb.includes(t.protocol)}catch{return!1}}function fo(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,s="",o;for(;(o=n.exec(e))!==null;)s+=Jh(e.slice(r,o.index))+o[0],r=n.lastIndex;return s=s+Jh(r?e.slice(r):e),s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function _E(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var wE=process.env.NODE_ENV==="production",jl="Invariant failed";function qn(e,t){if(!e){if(wE)throw new Error(jl);var n=typeof t=="function"?t():t,r=n?"".concat(jl,": ").concat(n):jl;throw new Error(r)}}function Ka(e){const t=new Map;let n,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const i=t.get(o);if(i)return s(i),i.value},set(o,i){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const a=t.get(o);if(a)a.value=i,s(a);else{const c={key:o,value:i,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(o,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ws=0,Yr=1,Xr=2,qo=3,Fr=4,hb=5;function SE(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Xd(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,o=e.substring(t,s);if(!o||!o.includes("$"))return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(o==="$"){const a=e.length;return n[0]=Xr,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(o.charCodeAt(0)===36)return n[0]=Yr,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const i=SE(o);if(i){const[a,c]=i,l=o.charCodeAt(a+1);if(l===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const u=a+3,d=c;if(u<d)return n[0]=qo,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=s,n}}else if(l===36){const u=a+1,d=a+2;return d===c?(n[0]=Xr,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+c+1,n[5]=e.length,n):(n[0]=Yr,n[1]=t+a,n[2]=t+d,n[3]=t+c,n[4]=t+c+1,n[5]=s,n)}}return n[0]=Ws,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function jc(e,t,n,r,s,o,i){i?.(n);let a=r;{const c=n.fullPath??n.from,l=c.length,u=n.options?.caseSensitive??e,d=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<l;){const h=Xd(c,a,t);let p;const m=a,y=h[5];switch(a=y+1,o++,h[0]){case Ws:{const x=c.substring(h[2],h[3]);if(u){const _=s.static?.get(x);if(_)p=_;else{s.static??=new Map;const w=zr(n.fullPath??n.from);w.parent=s,w.depth=o,p=w,s.static.set(x,w)}}else{const _=x.toLowerCase(),w=s.staticInsensitive?.get(_);if(w)p=w;else{s.staticInsensitive??=new Map;const S=zr(n.fullPath??n.from);S.parent=s,S.depth=o,p=S,s.staticInsensitive.set(_,S)}}break}case Yr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(Yr,n.fullPath??n.from,w,S,C);p=E,E.depth=o,E.parent=s,s.dynamic??=[],s.dynamic.push(E)}break}case qo:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=!d&&s.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===w&&E.prefix===S&&E.suffix===C);if(k)p=k;else{const E=Fl(qo,n.fullPath??n.from,w,S,C);p=E,E.parent=s,E.depth=o,s.optional??=[],s.optional.push(E)}break}case Xr:{const x=c.substring(m,h[1]),_=c.substring(h[4],y),w=u&&!!(x||_),S=x?w?x:x.toLowerCase():void 0,C=_?w?_:_.toLowerCase():void 0,k=Fl(Xr,n.fullPath??n.from,w,S,C);p=k,k.parent=s,k.depth=o,s.wildcard??=[],s.wildcard.push(k)}}s=p}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=zr(n.fullPath??n.from);h.kind=hb,h.parent=s,o++,h.depth=o,s.pathless??=[],s.pathless.push(h),s=h}const f=(n.path||!n.children)&&!n.isRoot;if(f&&c.endsWith("/")){const h=zr(n.fullPath??n.from);h.kind=Fr,h.parent=s,o++,h.depth=o,s.index=h,s=h}s.parse=n.options?.params?.parse??null,s.skipOnParamError=d,s.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,f&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)jc(e,t,c,a,s,o,i)}function Ll(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function rr(e){if(e.pathless)for(const t of e.pathless)rr(t);if(e.static)for(const t of e.static.values())rr(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())rr(t);if(e.dynamic?.length){e.dynamic.sort(Ll);for(const t of e.dynamic)rr(t)}if(e.optional?.length){e.optional.sort(Ll);for(const t of e.optional)rr(t)}if(e.wildcard?.length){e.wildcard.sort(Ll);for(const t of e.wildcard)rr(t)}}function zr(e){return{kind:Ws,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Fl(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:s}}function EE(e,t){const n=zr("/"),r=new Uint16Array(6);for(const s of e)jc(!1,r,s,1,n,0);rr(n),t.masksTree=n,t.flatCache=Ka(1e3)}function kE(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Jd(e,t.masksTree);return t.flatCache.set(e,r),r}function CE(e,t,n,r,s){e||="/",r||="/";const o=t?`case\0${e}`:e;let i=s.singleCache.get(o);if(!i){i=zr("/");const a=new Uint16Array(6);jc(t,a,{from:e},1,i,0),s.singleCache.set(o,i)}return Jd(r,i,n)}function RE(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let o;try{o=Jd(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)o=null;else throw i}return o&&(o.branch=TE(o.route)),t.matchCache.set(r,o),o}function PE(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function OE(e,t=!1,n){const r=zr(e.fullPath),s=new Uint16Array(6),o={},i={};let a=0;return jc(t,s,e,1,r,0,l=>{if(n?.(l,a),qn(!(l.id in o),`Duplicate routes found with id: ${String(l.id)}`),o[l.id]=l,a!==0&&l.path){const u=PE(l.fullPath);(!i[u]||l.fullPath.endsWith("/"))&&(i[u]=l)}a++}),rr(r),{processedTree:{segmentTree:r,singleCache:Ka(1e3),matchCache:Ka(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:i}}function Jd(e,t,n=!1){const r=e.split("/"),s=AE(e,r,t,n);if(!s)return null;const[o]=pb(e,r,s);return{route:s.node.route,rawParams:o,parsedParams:s.parsedParams}}function pb(e,t,n){const r=ME(n.node);let s=null;const o={};let i=n.extract?.part??0,a=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;i++,a++,c++,l++){const u=r[a];if(u.kind===Fr)break;if(u.kind===hb){l--,i--,c--;continue}const d=t[i],f=c;if(d&&(c+=d.length),u.kind===Yr){s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0;if(h.charCodeAt(p)===123){const y=u.suffix?.length??0,b=h.substring(p+2,h.length-y-1),x=d.substring(p,d.length-y);o[b]=decodeURIComponent(x)}else{const y=h.substring(1);o[y]=decodeURIComponent(d)}}else if(u.kind===qo){if(n.skipped&1<<a){i--,c=f-1;continue}s??=n.node.fullPath.split("/");const h=s[l],p=u.prefix?.length??0,m=u.suffix?.length??0,y=h.substring(p+3,h.length-m-1),b=u.suffix||u.prefix?d.substring(p,d.length-m):d;b&&(o[y]=decodeURIComponent(b))}else if(u.kind===Xr){const h=u,p=e.substring(f+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(p);o["*"]=m,o._splat=m;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:i,node:a,path:c,segment:l}]}function TE(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ME(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function AE(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Ho(t),o=s&&e!=="/",i=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,u=null;for(;a.length;){const d=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:y,dynamics:b,optionals:x}=d;let{extract:_,rawParams:w,parsedParams:S}=d;if(f.skipOnParamError){if(!zl(e,t,d))continue;w=d.rawParams,_=d.extract,S=d.parsedParams}r&&f.route&&f.kind!==Fr&&ho(l,d)&&(l=d);const C=h===i;if(C&&(f.route&&!o&&ho(u,d)&&(u=d),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const k=C?void 0:t[h];let E;if(C&&f.index){const P={node:f.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};let O=!0;if(f.index.skipOnParamError&&(zl(e,t,P)||(O=!1)),O){if(y===i&&!b&&!x&&!p)return P;ho(u,P)&&(u=P)}}if(f.wildcard&&ho(c,d))for(const P of f.wildcard){const{prefix:O,suffix:N}=P;if(O&&(C||!(P.caseSensitive?k:E??=k.toLowerCase()).startsWith(O)))continue;if(N){if(C)continue;const j=t.slice(h).join("/").slice(-N.length);if((P.caseSensitive?j:j.toLowerCase())!==N)continue}const A={node:P,index:i,skipped:p,depth:m,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S};if(!(P.skipOnParamError&&!zl(e,t,A))){c=A;break}}if(f.optional){const P=p|1<<m,O=m+1;for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N];a.push({node:A,index:h,skipped:P,depth:O,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C)for(let N=f.optional.length-1;N>=0;N--){const A=f.optional[N],{prefix:j,suffix:$}=A;if(j||$){const q=A.caseSensitive?k:E??=k.toLowerCase();if(j&&!q.startsWith(j)||$&&!q.endsWith($))continue}a.push({node:A,index:h+1,skipped:p,depth:O,statics:y,dynamics:b,optionals:x+1,extract:_,rawParams:w,parsedParams:S})}}if(!C&&f.dynamic&&k)for(let P=f.dynamic.length-1;P>=0;P--){const O=f.dynamic[P],{prefix:N,suffix:A}=O;if(N||A){const j=O.caseSensitive?k:E??=k.toLowerCase();if(N&&!j.startsWith(N)||A&&!j.endsWith(A))continue}a.push({node:O,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:b+1,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.staticInsensitive){const P=f.staticInsensitive.get(E??=k.toLowerCase());P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(!C&&f.static){const P=f.static.get(k);P&&a.push({node:P,index:h+1,skipped:p,depth:m+1,statics:y+1,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}if(f.pathless){const P=m+1;for(let O=f.pathless.length-1;O>=0;O--){const N=f.pathless[O];a.push({node:N,index:h,skipped:p,depth:P,statics:y,dynamics:b,optionals:x,extract:_,rawParams:w,parsedParams:S})}}}if(u&&c)return ho(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let d=l.index;for(let h=0;h<l.index;h++)d+=t[h].length;const f=d===e.length?"/":e.slice(d);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(f),l}return null}function zl(e,t,n){try{const[r,s]=pb(e,t,n);n.rawParams=r,n.extract=s;const o=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,o),!0}catch{return null}}function ho(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Fr)>(e.node.kind===Fr)||t.node.kind===Fr==(e.node.kind===Fr)&&t.depth>e.depth))):!0}function Ea(e){return Qd(e.filter(t=>t!==void 0).join("/"))}function Qd(e){return e.replace(/\/{2,}/g,"/")}function mb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Vn(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function gb(e){return Vn(mb(e))}function Za(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function NE(e,t,n){return Za(e,n)===Za(t,n)}function DE({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),o=!s&&t===".";let i;if(r){i=s?t:o?e:e+"\0"+t;const d=r.get(i);if(d)return d}let a;if(o)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&Ho(a)==="";)a.pop();const d=t.split("/");for(let f=0,h=d.length;f<h;f++){const p=d[f];p===""?f?f===h-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Ho(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,l="";for(let d=0;d<a.length;d++){d>0&&(l+="/");const f=a[d];if(!f)continue;c=Xd(f,0,c);const h=c[0];if(h===Ws){l+=f;continue}const p=c[5],m=f.substring(0,c[1]),y=f.substring(c[4],p),b=f.substring(c[2],c[3]);h===Yr?l+=m||y?`${m}{$${b}}${y}`:`$${b}`:h===Xr?l+=m||y?`${m}{$}${y}`:"$":l+=`${m}{-$${b}}${y}`}l=Qd(l);const u=l||"/";return i&&r&&r.set(i,u),u}function IE(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,o=>t.get(o)??o)}function $l(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>Qh(s,n)).join("/"):Qh(r,n)}function Vl({path:e,params:t,decoder:n,server:r}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let a=0,c,l="";for(;a<i;){const d=a;c=Xd(e,d,c);const f=c[5];if(a=f+1,d===f)continue;const h=c[0];if(h===Ws){l+="/"+e.substring(d,f);continue}if(h===Xr){const p=t._splat;o._splat=p,o["*"]=p;const m=e.substring(d,c[1]),y=e.substring(c[4],f);if(!p){s=!0,(m||y)&&(l+="/"+m+y);continue}const b=$l("_splat",t,n);l+="/"+m+b+y;continue}if(h===Yr){const p=e.substring(c[2],c[3]);!s&&!(p in t)&&(s=!0),o[p]=t[p];const m=e.substring(d,c[1]),y=e.substring(c[4],f),b=$l(p,t,n)??"undefined";l+="/"+m+b+y;continue}if(h===qo){const p=e.substring(c[2],c[3]),m=t[p];if(m==null)continue;o[p]=m;const y=e.substring(d,c[1]),b=e.substring(c[4],f),x=$l(p,t,n)??"";l+="/"+y+x+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function Qh(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Wt(e){return!!e?.isNotFound}function jE(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const zu="tsr-scroll-restoration-v1_3",LE=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function FE(){const e=jE();if(!e)return null;const t=e.getItem(zu);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=sr(r,n)||n;try{e.setItem(zu,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Fi=FE(),zE=e=>e.state.__TSR_key||e.href;function $E(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ga=!1;function VE({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:s,location:o}){let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(l){console.error(l);return}const a=t||window.history.state?.__TSR_key,c=i[a];Ga=!0;e:{if(r&&c&&Object.keys(c).length>0){for(const d in c){const f=c[d];if(d==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(d){const h=document.querySelector(d);h&&(h.scrollLeft=f.scrollX,h.scrollTop=f.scrollY)}}break e}const l=(o??window.location).hash.split("#",2)[1];if(l){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const f=document.getElementById(l);f&&f.scrollIntoView(d)}break e}const u={top:0,left:0,behavior:n};if(window.scrollTo(u),s)for(const d of s){if(d==="window")continue;const f=typeof d=="function"?d():document.querySelector(d);f&&f.scrollTo(u)}}Ga=!1}function BE(e,t){if(!Fi||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Fi))return;e.isScrollRestorationSetup=!0,Ga=!1;const r=e.options.getScrollRestorationKey||zE;window.history.scrollRestoration="manual";const s=o=>{if(Ga||!e.isScrollRestoring)return;let i="";if(o.target===document||o.target===window)i="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=$E(o.target)}const a=r(e.state.location);Fi.set(c=>{const l=c[a]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const d=document.querySelector(i);d&&(u.scrollX=d.scrollLeft||0,u.scrollY=d.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",LE(s,100),!0),e.subscribe("onRendered",o=>{const i=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(VE({storageKey:zu,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Fi.set(a=>(a[i]||={},a)))})}function UE(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function WE(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function Bl(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function HE(e){const t=new URLSearchParams(e),n={};for(const[r,s]of t.entries()){const o=n[r];o==null?n[r]=Bl(s):Array.isArray(o)?o.push(Bl(s)):n[r]=[o,Bl(s)]}return n}const qE=ZE(JSON.parse),KE=GE(JSON.stringify,JSON.parse);function ZE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=HE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function GE(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const o=WE(s,r);return o?`?${o}`:""}}const Gt="__root__";function yb(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&qa(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${fb.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Jt(e){return e instanceof Response&&!!e.options}const ka=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lc=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),As=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let o=0;o<=s;o++){const i=e.matches[o];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},bb=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),qn(n.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const r=e.matches.find(s=>s.routeId===n.id);qn(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,s=>({...s,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,bb(e,t))},or=(e,t,n)=>{if(!(!Jt(n)&&!Wt(n))){if(Jt(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Jt(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,s=>({...s,status:r,context:As(e,t.index),isFetching:!1,error:n})),Wt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Jt(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(bb(e,n),n)}},vb=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,po=(e,t,n,r)=>{const{id:s,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,or(e,e.router.getMatch(s),n);try{i.options.onError?.(n)}catch(a){n=a,or(e,e.router.getMatch(s),n)}e.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},xb=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Lc(e,t)&&(n.options.loader||n.options.beforeLoad||Sb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{ka(e)},s);r._nonReactive.pendingTimeout=i}},YE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;xb(e,t,n,r);const s=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&or(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},XE=(e,t,n,r)=>{const s=e.router.getMatch(t),o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Us(()=>{o?.resolve()});const{paramsError:i,searchError:a}=s;i&&po(e,n,i,"PARSE_PARAMS"),a&&po(e,n,a,"VALIDATE_SEARCH"),xb(e,t,r,s);const c=new AbortController;let l=!1;const u=()=>{l||(l=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:c})))},d=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){Lo(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Us();const f={...As(e,n,!1),...s.__routeContext},{search:h,params:p,cause:m}=s,y=Lc(e,t),b={search:h,abortController:c,params:p,preload:y,context:f,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":m,matches:e.matches,...e.router.options.additionalContext},x=w=>{if(w===void 0){Lo(()=>{u(),d()});return}(Jt(w)||Wt(w))&&(u(),po(e,n,w,"BEFORE_LOAD")),Lo(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:w})),d()})};let _;try{if(_=r.options.beforeLoad(b),Ms(_))return u(),_.catch(w=>{po(e,n,w,"BEFORE_LOAD")}).then(x)}catch(w){u(),po(e,n,w,"BEFORE_LOAD")}x(_)},JE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],o=()=>a(),i=()=>XE(e,n,t,s),a=()=>{if(vb(e,n))return;const c=YE(e,n,s);return Ms(c)?c.then(i):i()};return o()},QE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([o,i,a])=>{const c=o?.meta,l=o?.links,u=o?.scripts,d=o?.styles;return{meta:c,links:l,headScripts:u,headers:a,scripts:i,styles:d}})},_b=(e,t,n,r)=>{const s=e.matchPromises[n-1],{params:o,loaderDeps:i,abortController:a,cause:c}=e.router.getMatch(t),l=As(e,n),u=Lc(e,t);return{params:o,deps:i,preload:!!u,parentMatchPromise:s,abortController:a,context:l,location:e.location,navigate:d=>e.router.navigate({...d,_fromLocation:e.location}),cause:u?"preload":c,route:r,...e.router.options.additionalContext}},ep=async(e,t,n,r)=>{try{const s=e.router.getMatch(t);try{(!(yE??e.router.isServer)||s.ssr===!0)&&wb(r);const o=r.options.loader?.(_b(e,t,n,r)),i=r.options.loader&&Ms(o);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,l=>({...l,isFetching:"loader"})),r.options.loader){const l=i?await o:o;or(e,e.router.getMatch(t),l),l!==void 0&&e.updateMatch(t,u=>({...u,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,l=>({...l,error:void 0,context:As(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let i=o;if(i?.name==="AbortError"){e.updateMatch(t,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:As(e,n)}));return}const a=s._nonReactive.minPendingPromise;a&&await a,Wt(o)&&await r.options.notFoundComponent?.preload?.(),or(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(c){i=c,or(e,e.router.getMatch(t),c)}e.updateMatch(t,c=>({...c,error:i,context:As(e,n),status:"error",isFetching:!1}))}}catch(s){const o=e.router.getMatch(t);o&&(o._nonReactive.loaderPromise=void 0),or(e,o,s)}},ek=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let s=!1,o=!1;const i=e.router.looseRoutesById[r];if(!vb(e,n)){const l=e.router.getMatch(n);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!e.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=e.router.getMatch(n),d=u._nonReactive.error||u.error;d&&or(e,u,d)}else{const u=Date.now()-l.updatedAt,d=Lc(e,n),f=d?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,h=i.options.shouldReload,p=typeof h=="function"?h(_b(e,n,t,i)):h,m=!!d&&!e.router.state.matches.some(_=>_.id===n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=Us(),m!==y.preload&&e.updateMatch(n,_=>({..._,preload:m}));const{status:b,invalid:x}=y;s=b==="success"&&(x||(p??u>f)),d&&i.options.preload===!1||(s&&!e.sync?(o=!0,(async()=>{try{await ep(e,n,t,i);const _=e.router.getMatch(n);_._nonReactive.loaderPromise?.resolve(),_._nonReactive.loadPromise?.resolve(),_._nonReactive.loaderPromise=void 0}catch(_){Jt(_)&&await e.router.navigate(_.options)}})()):(b!=="success"||s&&e.sync)&&await ep(e,n,t,i))}}const a=e.router.getMatch(n);o||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,o||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=o?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(e.updateMatch(n,l=>({...l,isFetching:c,invalid:!1})),e.router.getMatch(n)):a};async function tp(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&ka(t);try{for(let a=0;a<t.matches.length;a++){const c=JE(t,a);Ms(c)&&await c}const n=t.firstBadMatchIndex??t.matches.length;for(let a=0;a<n;a++)t.matchPromises.push(ek(t,a));const s=(await Promise.allSettled(t.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let o;for(const a of s){if(Jt(a))throw a;!o&&Wt(a)&&(o=a)}for(const a of t.matches){const{id:c,routeId:l}=a,u=t.router.looseRoutesById[l];try{const d=QE(t,c,u);if(d){const f=await d;t.updateMatch(c,h=>({...h,...f}))}}catch(d){console.error(`Error executing head for route ${l}:`,d)}}if(o)throw o;const i=ka(t);Ms(i)&&await i}catch(n){if(Wt(n)&&!t.preload){const r=ka(t);throw Ms(r)&&await r,n}if(Jt(n))throw n}return t.matches}async function wb(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of Eb){const s=e.options[r]?.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Sb(e){for(const t of Eb)if(e.options[t]?.preload)return!0;return!1}const Eb=["component","errorComponent","pendingComponent","notFoundComponent"];function tk(e){return{input:({url:t})=>{for(const n of e)t=$u(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=kb(e[n],t);return t}}}function nk(e){const t=gb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===s?i.pathname="/":a.startsWith(o)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=Ea(["/",t,i.pathname]),i)}}function $u(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function kb(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Hr(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,s=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:s,hashChanged:o}}class rk{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,s=this.basepath??r?.basepath??"/",o=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=IE(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=mE()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Ka(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=new hE(ok(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),BE(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(o||s!==c||i!==l){this.basepath=c;const f=[],h=gb(c);h&&h!=="/"&&f.push(nk({basepath:c})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:tk(f),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=OE(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&EE(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:l,hash:u,href:d,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const x=this.options.parseSearch(l),_=this.options.stringifySearch(x);return{href:c+_+u,publicHref:d,pathname:fo(c),external:!1,searchStr:_,search:Ot(r?.search,x),hash:fo(u.slice(1)),state:Ot(r?.state,f)}}const h=new URL(d,this.origin),p=$u(this.rewrite,h),m=this.options.parseSearch(p.search),y=this.options.stringifySearch(m);return p.search=y,{href:p.href.replace(p.origin,""),publicHref:d,pathname:fo(p.pathname),external:!!this.rewrite&&p.origin!==this.origin,searchStr:y,search:Ot(r?.search,m),hash:fo(p.hash.slice(1)),state:Ot(r?.state,f)}},o=s(n),{__tempLocation:i,__tempKey:a}=o.state;if(i&&(!a||a===this.tempLocationKey)){const c=s(i);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>DE({base:n,to:Qd(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>ik({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const i=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);if(o.from&&process.env.NODE_ENV!=="production"&&o._isNavigate){const j=this.getMatchedRoutes(o.from).matchedRoutes,$=Xh(a.matchedRoutes,D=>rp(D.fullPath,o.from)),q=Xh(j,D=>rp(D.fullPath,a.fullPath));!$&&!q&&console.warn(`Could not find match for from: ${o.from}`)}const c=o.unsafeRelative==="path"?i.pathname:o.from??a.fullPath,l=this.resolvePathWithBase(c,"."),u=a.search,d={...a.params},f=o.to?this.resolvePathWithBase(l,`${o.to}`):this.resolvePathWithBase(l,"."),h=o.params===!1||o.params===null?{}:(o.params??!0)===!0?d:Object.assign(d,sr(o.params,d)),p=Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,m=this.getMatchedRoutes(p);let y=m.matchedRoutes;(m.foundRoute?m.foundRoute.path!=="/"&&m.routeParams["**"]:Vn(p))&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]);let x=!1;if(Object.keys(h).length>0)for(const j of y){const $=j.options.params?.stringify??j.options.stringifyParams;$&&(x=!0,Object.assign(h,$(h)))}const _=n.leaveParams?f:fo(x?Vl({path:f,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:p);let w=u;if(n._includeValidateSearch&&this.options.search?.strict){const j={};y.forEach($=>{if($.options.validateSearch)try{Object.assign(j,Ca($.options.validateSearch,{...j,...w}))}catch{}}),w=j}w=ak({search:w,dest:o,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),w=Ot(u,w);const S=this.options.stringifySearch(w),C=o.hash===!0?i.hash:o.hash?sr(o.hash,i.hash):void 0,k=C?`#${C}`:"";let E=o.state===!0?i.state:o.state?sr(o.state,i.state):{};E=Ot(i.state,E);const P=`${_}${S}${k}`;let O,N,A=!1;if(this.rewrite){const j=new URL(P,this.origin),$=kb(this.rewrite,j);O=j.href.replace(j.origin,""),$.origin!==this.origin?(N=$.href,A=!0):N=$.pathname+$.search+$.hash}else O=_E(P),N=O;return{publicHref:N,href:O,pathname:_,search:w,searchStr:S,state:E,hash:C??"",external:A,unmaskOnReload:o.unmaskOnReload}},s=(o={},i)=>{const a=r(o);let c=i?r(i):void 0;if(!c){const l={};if(this.options.routeMasks){const u=kE(a.pathname,this.processedTree);if(u){Object.assign(l,u.rawParams);const{from:d,params:f,...h}=u.route,p=f===!1||f===null?{}:(f??!0)===!0?l:Object.assign(l,sr(f,l));i={from:n.from,...h,params:p},c=r(i)}}}return c&&(a.maskedLocation=c),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const l=Wr(s.state,this.latestLocation.state);return c.forEach(u=>{delete s.state[u]}),l},i=Vn(this.latestLocation.href)===Vn(s.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Us(()=>{a?.resolve()}),i&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...u}=s;c&&(u={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:i,href:a,...c}={})=>{if(a){const d=this.history.location.state.__TSR_index,f=Wa(a,{__TSR_index:n?d:d+1}),h=new URL(f.pathname,this.origin),p=$u(this.rewrite,h);c.to=p.pathname,c.search=this.options.parseSearch(f.search),c.hash=f.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:o,...i})=>{let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const l=this.buildLocation({to:n,...i});s=s??l.publicHref,o=o??l.publicHref}const c=!a&&o?o:s;if(qa(c))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${c}`),Promise.resolve();if(!i.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const d of u)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...i,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(s=>!n.some(o=>o.id===s.id))}))},this.load=async n=>{let r,s,o;for(o=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Hr({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...Hr({resolvedLocation:l,location:c})}),await tp({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],d=[],f=[];Lo(()=>{this.__store.setState(h=>{const p=h.matches,m=h.pendingMatches||h.matches;return u=p.filter(y=>!m.some(b=>b.id===y.id)),d=m.filter(y=>!p.some(b=>b.id===y.id)),f=m.filter(y=>p.some(b=>b.id===y.id)),{...h,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...h.cachedMatches,...u.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[d,"onEnter"],[f,"onStay"]].forEach(([h,p])=>{h.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(c){Jt(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Wt(c)&&(s=c),this.__store.setState(l=>({...l,statusCode:r?r.status:s?404:l.matches.some(u=>u.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,i=this.state.resolvedLocation,a=typeof r.types=="function"?r.types(Hr({resolvedLocation:i,location:o})):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";s&&this.__store.setState(o=>({...o,[s]:o[s]?.map(i=>i.id===n?r(i):i)}))})},this.getMatch=n=>{const r=s=>s.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(r),cachedMatches:s.cachedMatches.map(r),pendingMatches:s.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(o=>!r(o))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const o=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=wb,this.preloadRoute=async n=>{const r=this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...o,...this.state.cachedMatches.map(a=>a.id)]);Lo(()=>{s.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return s=await tp({router:this,matches:s,location:r,preload:!0,updateMatch:(a,c)=>{o.has(a)?s=s.map(l=>l.id===a?c(l):l):this.updateMatch(a,c)}}),s}catch(a){if(Jt(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:r});Wt(a)||console.error(a);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(s);if(r?.pending&&this.state.status!=="pending")return!1;const a=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=CE(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!Wr(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Wr(a.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??KE,parseSearch:t.parseSearch??qE}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:o,parsedParams:i}=r;let{matchedRoutes:a}=r,c=!1;(s?s.path!=="/"&&o["**"]:Vn(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const l=c?lk(this.options.notFoundMode,a):void 0,u=[],d=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((f,h)=>{const p=u[h-1],[m,y,b]=(()=>{const $=p?.search??t.search,q=p?._strictSearch??void 0;try{const D=Ca(f.options.validateSearch,{...$})??void 0;return[{...$,...D},{...q,...D},void 0]}catch(D){let H=D;if(D instanceof Ya||(H=new Ya(D.message,{cause:D})),n?.throwOnError)throw H;return[$,{},H]}})(),x=f.options.loaderDeps?.({search:m})??"",_=x?JSON.stringify(x):"",{interpolatedPath:w,usedParams:S}=Vl({path:f.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),C=f.id+w+_,k=this.getMatch(C),E=this.state.matches.find($=>$.routeId===f.id),P=k?._strictParams??S;let O;if(!k)try{sp(f,S,i,P)}catch($){if(Wt($)||Jt($)?O=$:O=new sk($.message,{cause:$}),n?.throwOnError)throw O}Object.assign(o,P);const N=E?"stay":"enter";let A;if(k)A={...k,cause:N,params:E?Ot(E.params,o):o,_strictParams:P,search:Ot(E?E.search:k.search,m),_strictSearch:y};else{const $=f.options.loader||f.options.beforeLoad||f.lazyFn||Sb(f)?"pending":"success";A={id:C,ssr:f.options.ssr,index:h,routeId:f.id,params:E?Ot(E.params,o):o,_strictParams:P,pathname:w,updatedAt:Date.now(),search:E?Ot(E.search,m):m,_strictSearch:y,searchError:void 0,status:$,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:Us()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:N,loaderDeps:E?Ot(E.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(A.globalNotFound=l===f.id),A.searchError=b;const j=d(p);A.context={...j,...A.__routeContext,...A.__beforeLoadContext},u.push(A)}),u.forEach((f,h)=>{const p=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)){const y=u[h-1],b=d(y);if(p.options.context){const x={deps:f.loaderDeps,params:f.params,context:b??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:u};f.__routeContext=p.options.context(x)??void 0}f.context={...b,...f.__routeContext,...f.__beforeLoadContext}}}),u}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:s}=this.getMatchedRoutes(t.pathname),o=Ho(n),i={...t.search};for(const u of n)try{Object.assign(i,Ca(u.options.validateSearch,i))}catch{}const a=Ho(this.state.matches),c=a&&a.routeId===o.id&&t.pathname===this.state.location.pathname;let l;if(c)l=a.params;else{const u={...r};for(const d of n)try{sp(d,r,s??{},u)}catch{}l=u}return{matchedRoutes:n,fullPath:o.fullPath,search:i,params:l}}}class Ya extends Error{}class sk extends Error{}const np=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function rp(e,t){return np(e)===np(t)}function ok(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ca(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ya("Async validation not supported");if(n.issues)throw new Ya(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ik({pathname:e,routesById:t,processedTree:n}){const r={},s=Vn(e);let o,i;const a=RE(s,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[Gt]],routeParams:r,foundRoute:o,parsedParams:i}}function ak({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ck(n)(e,t,r??!1)}function ck(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)s.options.search?.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const o=({search:i,next:a})=>{let c=i;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(c=s.options.preSearchFilters.reduce((u,d)=>d(u),i));const l=a(c);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((u,d)=>d(u),l):l};t.middlewares.push(o)}if(s.options.validateSearch){const o=({search:i,next:a})=>{const c=a(i);if(!t._includeValidateSearch)return c;try{return{...c,...Ca(s.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:s})=>{const o=t.dest;return o.search?o.search===!0?s:sr(o.search,s):{}};t.middlewares.push(n);const r=(s,o,i)=>{if(s>=i.length)return o;const a=i[s];return a({search:o,next:l=>r(s+1,l,i)})};return function(o,i,a){return t.dest=i,t._includeValidateSearch=a,r(0,o,t.middlewares)}}function lk(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Gt}function sp(e,t,n,r){const s=e.options.params?.parse??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=s(r);Object.assign(r,o)}}const uk="Error preloading route! ☝️";class Cb{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,s=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=Gt:this.parentRoute||qn(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let o=s?Gt:r?.path;o&&o!=="/"&&(o=mb(o));const i=r?.id||o;let a=s?Gt:Ea([this.parentRoute.id===Gt?"":this.parentRoute.id,i]);o===Gt&&(o="/"),a!==Gt&&(a=Ea(["/",a]));const c=a===Gt?"/":Ea([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=c,this._to=Vn(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>yb({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class dk extends Cb{constructor(t){super(t)}}const zi=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Ul(e){const t=v.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function fk(e,t,n={},r={}){v.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{t(o)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function hk(e){const t=v.useRef(null);return v.useImperativeHandle(e,()=>t.current,[]),t}function ef(e){const t=e.errorComponent??tf;return g.jsx(pk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?v.createElement(t,{error:n,reset:r}):e.children})}class pk extends v.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function tf({error:e}){const[t,n]=v.useState(process.env.NODE_ENV!=="production");return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function mk({children:e,fallback:t=null}){return Rb()?g.jsx(T.Fragment,{children:e}):g.jsx(T.Fragment,{children:t})}function Rb(){return T.useSyncExternalStore(gk,()=>!0,()=>!1)}function gk(){return()=>{}}var yk=process.env.NODE_ENV==="production";function Hs(e,t){if(!yk){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var $i={exports:{}},Wl={},Vi={exports:{}},Hl={};var op;function bk(){if(op)return Hl;op=1;var e=T;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,y=p[1];return o(function(){m.value=h,m.getSnapshot=f,c(m)&&y({inst:m})},[d,h,f]),s(function(){return c(m)&&y({inst:m}),d(function(){c(m)&&y({inst:m})})},[d]),i(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Hl.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Hl}var ql={};var ip;function vk(){return ip||(ip=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function t(h,p){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=p();if(!d){var y=p();o(m,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=i({inst:{value:m,getSnapshot:p}});var b=y[0].inst,x=y[1];return c(function(){b.value=m,b.getSnapshot=p,n(b)&&x({inst:b})},[h,m,p]),a(function(){return n(b)&&x({inst:b}),h(function(){n(b)&&x({inst:b})})},[h]),l(m),m}function n(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!o(h,m)}catch{return!0}}function r(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=T,o=typeof Object.is=="function"?Object.is:e,i=s.useState,a=s.useEffect,c=s.useLayoutEffect,l=s.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ql.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ql}var ap;function Pb(){return ap||(ap=1,process.env.NODE_ENV==="production"?Vi.exports=bk():Vi.exports=vk()),Vi.exports}var cp;function xk(){if(cp)return Wl;cp=1;var e=T,t=Pb();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Wl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},Wl}var Kl={};var lp;function _k(){return lp||(lp=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=Pb(),r=typeof Object.is=="function"?Object.is:e,s=n.useSyncExternalStore,o=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Kl.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(C){if(!x){if(x=!0,_=C,C=f(C),h!==void 0&&m.hasValue){var k=m.value;if(h(k,C))return w=k}return w=C}if(k=w,r(_,C))return k;var E=f(C);return h!==void 0&&h(k,E)?(_=C,k):(_=C,w=E)}var x=!1,_,w,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,f,h]);var y=s(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Kl}var up;function wk(){return up||(up=1,process.env.NODE_ENV==="production"?$i.exports=xk():$i.exports=_k()),$i.exports}var Sk=wk();function Ek(e,t=r=>r,n={}){const r=n.equal??kk;return Sk.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function kk(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!t.has(r)||!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=dp(e);if(n.length!==dp(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function dp(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Zl=v.createContext(null);function Ob(){return typeof document>"u"?Zl:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Zl,Zl)}function tn(e){const t=v.useContext(Ob());return Hs(!((e?.warn??!0)&&!t),"useRouter must be used inside a <RouterProvider> component!"),t}function Qt(e){const t=tn({warn:e?.router===void 0}),n=e?.router||t,r=T.useRef(void 0);return Ek(n.__store,s=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Ot(r.current,e.select(s));return r.current=o,o}return e.select(s)}return s})}const Fc=v.createContext(void 0),Ck=v.createContext(void 0);function Pn(e){const t=v.useContext(e.from?Ck:Fc);return Qt({select:r=>{const s=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(qn(!((e.shouldThrow??!0)&&!s),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),s!==void 0)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function nf(e){return Pn({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rf(e){const{select:t,...n}=e;return Pn({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function pi(e){return Pn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function sf(e){return Pn({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ls(e){const t=tn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Rk(e,t){const n=tn(),r=hk(t),{activeProps:s,inactiveProps:o,activeOptions:i,to:a,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:h,viewTransition:p,children:m,target:y,disabled:b,style:x,className:_,onClick:w,onFocus:S,onMouseEnter:C,onMouseLeave:k,onTouchStart:E,ignoreBlocker:P,params:O,search:N,hash:A,state:j,mask:$,reloadDocument:q,unsafeRelative:D,from:H,_fromLocation:F,...W}=e,se=Rb(),I=Qt({select:B=>B.location.search,structuralSharing:!0}),Y=e.from,K=v.useMemo(()=>({...e,from:Y}),[n,I,Y,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Z=v.useMemo(()=>n.buildLocation({...K}),[n,K]),oe=Z.maskedLocation?Z.maskedLocation.publicHref:Z.publicHref,ce=Z.maskedLocation?Z.maskedLocation.external:Z.external,V=v.useMemo(()=>Nk(oe,ce,n.history,b),[b,ce,oe,n.history]),ee=v.useMemo(()=>{if(V?.external){if(qa(V.href)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${V.href}`);return}return V.href}if(!Dk(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{if(new URL(a),qa(a)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${a}`);return}return a}catch{}},[a,V]),me=Qt({select:B=>{if(ee)return!1;if(i?.exact){if(!NE(B.location.pathname,Z.pathname,n.basepath))return!1}else{const Q=Za(B.location.pathname,n.basepath),ue=Za(Z.pathname,n.basepath);if(!(Q.startsWith(ue)&&(Q.length===ue.length||Q[ue.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Wr(B.location.search,Z.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?se&&B.location.hash===Z.hash:!0}}),le=me?sr(s,{})??Pk:Gl,fe=me?Gl:sr(o,{})??Gl,ge=[_,le.className,fe.className].filter(Boolean).join(" "),Ze=(x||le.style||fe.style)&&{...x,...le.style,...fe.style},[_t,rn]=v.useState(!1),qt=v.useRef(!1),st=e.reloadDocument||ee?!1:c??n.options.defaultPreload,Qn=l??n.options.defaultPreloadDelay??0,ot=v.useCallback(()=>{n.preloadRoute({...K}).catch(B=>{console.warn(B),console.warn(uk)})},[n,K]),ps=v.useCallback(B=>{B?.isIntersecting&&ot()},[ot]);fk(r,ps,Ak,{disabled:!!b||st!=="viewport"}),v.useEffect(()=>{qt.current||!b&&st==="render"&&(ot(),qt.current=!0)},[b,ot,st]);const R=B=>{const Q=B.currentTarget.getAttribute("target"),ue=y!==void 0?y:Q;if(!b&&!Ik(B)&&!B.defaultPrevented&&(!ue||ue==="_self")&&B.button===0){B.preventDefault(),Dc.flushSync(()=>{rn(!0)});const ve=n.subscribe("onResolved",()=>{ve(),rn(!1)});n.navigate({...K,replace:d,resetScroll:h,hashScrollIntoView:u,startTransition:f,viewTransition:p,ignoreBlocker:P})}};if(ee)return{...W,ref:r,href:ee,...m&&{children:m},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},..._&&{className:_},...w&&{onClick:w},...S&&{onFocus:S},...C&&{onMouseEnter:C},...k&&{onMouseLeave:k},...E&&{onTouchStart:E}};const M=B=>{b||st&&ot()},z=M,J=B=>{if(!(b||!st))if(!Qn)ot();else{const Q=B.target;if(mo.has(Q))return;const ue=setTimeout(()=>{mo.delete(Q),ot()},Qn);mo.set(Q,ue)}},G=B=>{if(b||!st||!Qn)return;const Q=B.target,ue=mo.get(Q);ue&&(clearTimeout(ue),mo.delete(Q))};return{...W,...le,...fe,href:V?.href,ref:r,onClick:go([w,R]),onFocus:go([S,M]),onMouseEnter:go([C,J]),onMouseLeave:go([k,G]),onTouchStart:go([E,z]),disabled:!!b,target:y,...Ze&&{style:Ze},...ge&&{className:ge},...b&&Ok,...me&&Tk,...se&&_t&&Mk}}const Gl={},Pk={className:"active"},Ok={role:"link","aria-disabled":!0},Tk={"data-status":"active","aria-current":"page"},Mk={"data-transitioning":"transitioning"},mo=new WeakMap,Ak={rootMargin:"100px"},go=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Nk(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Dk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Tb=v.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...o}=Rk(r,t),i=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...c}=o;return v.createElement("a",c,i)}return v.createElement(n,o,i)});function Ik(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class jk extends Cb{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function jn(e){return new jk(e)}class Lk extends dk{constructor(t){super(t),this.useMatch=n=>Pn({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rf({...n,from:this.id}),this.useLoaderData=n=>nf({...n,from:this.id}),this.useNavigate=()=>ls({from:this.fullPath}),this.Link=T.forwardRef((n,r)=>g.jsx(Tb,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Fk(e){return new Lk(e)}function fp(e){return typeof e=="object"?new hp(e,{silent:!0}).createRoute(e):new hp(e,{silent:!0}).createRoute}class hp{constructor(t,n){this.path=t,this.createRoute=r=>{Hs(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const s=jn(r);return s.isRoot=!1,s},this.silent=n?.silent}}class pp{constructor(t){this.useMatch=n=>Pn({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Pn({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>sf({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>pi({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>rf({...n,from:this.options.id}),this.useLoaderData=n=>nf({...n,from:this.options.id}),this.useNavigate=()=>{const n=tn();return ls({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function mp(e){return typeof e=="object"?new pp(e):t=>new pp({id:e,...t})}function zk(){const e=tn(),t=v.useRef({router:e,mounted:!1}),[n,r]=v.useState(!1),{hasPendingMatches:s,isLoading:o}=Qt({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=Ul(o),a=o||n||s,c=Ul(a),l=o||s,u=Ul(l);return e.startTransition=d=>{r(!0),v.startTransition(()=>{d(),r(!1)})},v.useEffect(()=>{const d=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vn(e.latestLocation.publicHref)!==Vn(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{d()}},[e,e.history]),zi(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),zi(()=>{i&&!o&&e.emit({type:"onLoad",...Hr(e.state)})},[i,e,o]),zi(()=>{u&&!l&&e.emit({type:"onBeforeRouteMount",...Hr(e.state)})},[l,u,e]),zi(()=>{if(c&&!a){const d=Hr(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),d.hrefChanged&&UE(e)}},[a,c,e]),null}function $k(e){const t=Qt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return g.jsx(ef,{getResetKey:()=>t,onCatch:(n,r)=>{if(Wt(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Wt(n))return e.fallback?.(n);throw n},children:e.children})}function Vk(){return g.jsx("p",{children:"Not Found"})}function Ss(e){return g.jsx(g.Fragment,{children:e.children})}function Mb(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):(process.env.NODE_ENV==="development"&&Hs(t.options.notFoundComponent,`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),g.jsx(Vk,{}))}function Bk(){return tn().isScrollRestoring,null}const Ab=v.memo(function({matchId:t}){const n=tn(),r=Qt({select:m=>{const y=m.matches.findIndex(x=>x.id===t),b=m.matches[y];return qn(b,`Could not find match for matchId "${t}". Please file an issue!`),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[y-1]?.routeId}},structuralSharing:!0}),s=n.routesById[r.routeId],o=s.options.pendingComponent??n.options.defaultPendingComponent,i=o?g.jsx(o,{}):null,a=s.options.errorComponent??n.options.defaultErrorComponent,c=s.options.onCatch??n.options.defaultOnCatch,l=s.isRoot?s.options.notFoundComponent??n.options.notFoundRoute?.options.component:s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??o??(s.options.errorComponent?.preload||u))?v.Suspense:Ss,f=a?ef:Ss,h=l?$k:Ss,p=s.isRoot?s.options.shellComponent??Ss:Ss;return g.jsxs(p,{children:[g.jsx(Fc.Provider,{value:t,children:g.jsx(d,{fallback:i,children:g.jsx(f,{getResetKey:()=>r.resetKey,errorComponent:a||tf,onCatch:(m,y)=>{if(Wt(m))throw m;Hs(!1,`Error in route match: ${t}`),c?.(m,y)},children:g.jsx(h,{fallback:m=>{if(!l||m.routeId&&m.routeId!==r.routeId||!m.routeId&&!s.isRoot)throw m;return v.createElement(l,m)},children:u||r._displayPending?g.jsx(mk,{fallback:i,children:g.jsx(gp,{matchId:t})}):g.jsx(gp,{matchId:t})})})})}),r.parentRouteId===Gt&&n.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Uk,{}),g.jsx(Bk,{})]}):null]})});function Uk(){const e=tn(),t=v.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Hr(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gp=v.memo(function({matchId:t}){const n=tn(),{match:r,key:s,routeId:o}=Qt({select:c=>{const l=c.matches.find(p=>p.id===t),u=l.routeId,f=(n.routesById[u].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,invalid:l.invalid,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=n.routesById[o],a=v.useMemo(()=>{const c=i.options.component??n.options.defaultComponent;return c?g.jsx(c,{},s):g.jsx(of,{})},[s,i.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const c=i.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const l=n.getMatch(r.id);if(l&&!l._nonReactive.minPendingPromise){const u=Us();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return qn(Wt(r.error),"Expected a notFound error"),Mb(n,i,r.error);if(r.status==="redirected")throw qn(Jt(r.error),"Expected a redirect error"),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return a}),of=v.memo(function(){const t=tn(),n=v.useContext(Fc),r=Qt({select:l=>l.matches.find(u=>u.id===n)?.routeId}),s=t.routesById[r],o=Qt({select:l=>{const d=l.matches.find(f=>f.id===n);return qn(d,`Could not find parent match for matchId "${n}"`),d.globalNotFound}}),i=Qt({select:l=>{const u=l.matches,d=u.findIndex(f=>f.id===n);return u[d+1]?.id}}),a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Mb(t,s,void 0);if(!i)return null;const c=g.jsx(Ab,{matchId:i});return r===Gt?g.jsx(v.Suspense,{fallback:a,children:c}):c});function Wk(){const e=tn(),n=e.routesById[Gt].options.pendingComponent??e.options.defaultPendingComponent,r=n?g.jsx(n,{}):null,s=typeof document<"u"&&e.ssr?Ss:v.Suspense,o=g.jsxs(s,{fallback:r,children:[g.jsx(zk,{}),g.jsx(Hk,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:o}):o}function Hk(){const e=tn(),t=Qt({select:s=>s.matches[0]?.id}),n=Qt({select:s=>s.loadedAt}),r=t?g.jsx(Ab,{matchId:t}):null;return g.jsx(Fc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(ef,{getResetKey:()=>n,errorComponent:tf,onCatch:s=>{Hs(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),Hs(!1,s.message||s.toString())},children:r})})}const af=e=>new qk(e);class qk extends rk{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=fp,globalThis.createLazyFileRoute=mp):typeof window<"u"&&(window.createFileRoute=fp,window.createLazyFileRoute=mp);function Kk({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=Ob(),s=g.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:s}):s}function Nb({router:e,...t}){return g.jsx(Kk,{router:e,...t,children:g.jsx(Wk,{})})}var mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Gk=class{#e=Zk;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},$r=new Gk;function Yk(e){setTimeout(e,0)}var Jr=typeof window>"u"||"Deno"in globalThis;function Mt(){}function Xk(e,t){return typeof e=="function"?e(t):e}function Vu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Db(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dr(e,t){return typeof e=="function"?e(t):e}function Yt(e,t){return typeof e=="function"?e(t):e}function yp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==cf(i,t.options))return!1}else if(!Zo(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function bp(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ko(t.options.mutationKey)!==Ko(o))return!1}else if(!Zo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function cf(e,t){return(t?.queryKeyHashFn||Ko)(e)}function Ko(e){return JSON.stringify(e,(t,n)=>Wu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zo(e[n],t[n])):!1}var Jk=Object.prototype.hasOwnProperty;function Bu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=vp(e)&&vp(t);if(!r&&!(Wu(e)&&Wu(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,c=r?new Array(a):{};let l=0;for(let u=0;u<a;u++){const d=r?u:i[u],f=e[d],h=t[d];if(f===h){c[d]=f,(r?u<o:Jk.call(e,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[d]=h;continue}const p=Bu(f,h,n+1);c[d]=p,p===f&&l++}return o===a&&l===o?e:c}function Uu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function vp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wu(e){if(!xp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qk(e){return new Promise(t=>{$r.setTimeout(t,e)})}function Hu(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Bu(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Bu(e,t)}return t}function eC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function tC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa=Symbol();function Ib(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Xa&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function nC(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var rC=class extends mi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},lf=new rC;function qu(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var sC=Yk;function oC(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=sC;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ut=oC(),iC=class extends mi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Jr&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ja=new iC;function aC(e){return Math.min(1e3*2**e,3e4)}function Lb(e){return(e??"online")==="online"?Ja.isOnline():!0}var Ku=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fb(e){let t=!1,n=0,r;const s=qu(),o=()=>s.status!=="pending",i=m=>{if(!o()){const y=new Ku(m);f(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},l=()=>lf.isFocused()&&(e.networkMode==="always"||Ja.isOnline())&&e.canRun(),u=()=>Lb(e.networkMode)&&e.canRun(),d=m=>{o()||(r?.(),s.resolve(m))},f=m=>{o()||(r?.(),s.reject(m))},h=()=>new Promise(m=>{r=y=>{(o()||l())&&m(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(o())return;const x=e.retry??(Jr?0:3),_=e.retryDelay??aC,w=typeof _=="function"?_(n,b):_,S=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!S){f(b);return}n++,e.onFail?.(n,b),Qk(w).then(()=>l()?void 0:h()).then(()=>{t?f(b):p()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?p():h().then(p),s)}}var zb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vu(this.gcTime)&&(this.#e=$r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jr?1/0:300*1e3))}clearGcTimeout(){this.#e&&($r.clearTimeout(this.#e),this.#e=void 0)}},cC=class extends zb{#e;#t;#n;#s;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wp(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=wp(this.options);t.data!==void 0&&(this.setState(_p(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Hu(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xa||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Db(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const a=Ib(this.options,t),l=(()=>{const u={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#i=!1,this.options.persister?this.options.persister(a,l,this):a(l)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Fb({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Ku&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ku){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$b(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,..._p(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _p(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var lC=class extends mi{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#i=qu(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#i;#o;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Sp(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Uu(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Ep(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||dr(this.options.staleTime,this.#t)!==dr(t.staleTime,this.#t))&&this.#g();const s=this.#y();r&&(this.#t!==n||Yt(this.options.enabled,this.#t)!==Yt(t.enabled,this.#t)||s!==this.#c)&&this.#b(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dC(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mt)),t}#g(){this.#x();const e=dr(this.options.staleTime,this.#t);if(Jr||this.#s.isStale||!Vu(e))return;const n=Db(this.#s.dataUpdatedAt,e)+1;this.#l=$r.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#_(),this.#c=e,!(Jr||Yt(this.options.enabled,this.#t)===!1||!Vu(this.#c)||this.#c===0)&&(this.#u=$r.setInterval(()=>{(this.options.refetchIntervalInBackground||lf.isFocused())&&this.#d()},this.#c))}#v(){this.#g(),this.#b(this.#y())}#x(){this.#l&&($r.clearTimeout(this.#l),this.#l=void 0)}#_(){this.#u&&($r.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,o=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:l}=e;let u={...l},d=!1,f;if(t._optimisticResults){const E=this.hasListeners(),P=!E&&Sp(e,t),O=E&&Ep(e,n,t,r);(P||O)&&(u={...u,...$b(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:m}=u;f=u.data;let y=!1;if(t.placeholderData!==void 0&&f===void 0&&m==="pending"){let E;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(E=s.data,y=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,E!==void 0&&(m="success",f=Hu(s?.data,E,t),d=!0)}if(t.select&&f!==void 0&&!y)if(s&&f===o?.data&&t.select===this.#m)f=this.#f;else try{this.#m=t.select,f=t.select(f),f=Hu(s?.data,f,t),this.#f=f,this.#o=null}catch(E){this.#o=E}this.#o&&(h=this.#o,f=this.#f,p=Date.now(),m="error");const b=u.fetchStatus==="fetching",x=m==="pending",_=m==="error",w=x&&b,S=f!==void 0,k={status:m,fetchStatus:u.fetchStatus,isPending:x,isSuccess:m==="success",isError:_,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&S,isStale:uf(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Yt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=k.data!==void 0,P=k.status==="error"&&!E,O=j=>{P?j.reject(k.error):E&&j.resolve(k.data)},N=()=>{const j=this.#i=k.promise=qu();O(j)},A=this.#i;switch(A.status){case"pending":e.queryHash===n.queryHash&&O(A);break;case"fulfilled":(P||k.data!==A.value)&&N();break;case"rejected":(!P||k.error!==A.reason)&&N();break}}return k}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Uu(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const o=new Set(s??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(i=>{const a=i;return this.#s[a]!==e[a]&&o.has(a)})};this.#S({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#S(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uC(e,t){return Yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sp(e,t){return uC(e,t)||e.state.data!==void 0&&Zu(e,t,t.refetchOnMount)}function Zu(e,t,n){if(Yt(t.enabled,e)!==!1&&dr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&uf(e,t)}return!1}function Ep(e,t,n,r){return(e!==t||Yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&uf(e,n)}function uf(e,t){return Yt(t.enabled,e)!==!1&&e.isStaleByTime(dr(t.staleTime,e))}function dC(e,t){return!Uu(e.getCurrentResult(),t)}function kp(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=p=>{nC(p,()=>t.signal,()=>u=!0)},f=Ib(t.options,t.fetchOptions),h=async(p,m,y)=>{if(u)return Promise.reject();if(m==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),_=await f(x),{maxPages:w}=t.options,S=y?tC:eC;return{pages:S(p.pages,_,w),pageParams:S(p.pageParams,m,w)}};if(s&&o.length){const p=s==="backward",m=p?fC:Cp,y={pages:o,pageParams:i},b=m(r,y);a=await h(y,b,p)}else{const p=e??o.length;do{const m=c===0?i[0]??r.initialPageParam:Cp(r,a);if(c>0&&m==null)break;a=await h(a,m),c++}while(c<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Cp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function fC(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var hC=class extends zb{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||pC(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Fb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#r({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ut.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function pC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new hC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Bi(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Bi(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Bi(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>bp(t,n))}findAll(e={}){return this.getAll().filter(t=>bp(e,t))}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ut.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mt))))}};function Bi(e){return e.options.scope?.id}var gC=class extends mi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??cf(r,t);let o=this.get(s);return o||(o=new cC({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>yp(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>yp(e,n)):t}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vb=class{#e;#t;#n;#s;#r;#a;#i;#o;constructor(e={}){this.#e=e.queryCache||new gC,this.#t=e.mutationCache||new mC,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=lf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,i=Xk(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ut.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return ut.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ut.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Mt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e.behavior=kp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e.behavior=kp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ja.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Ko(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Zo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ko(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Zo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Xa&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Bb=v.createContext(void 0),yC=e=>{const t=v.useContext(Bb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ub=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Bb.Provider,{value:e,children:t})),Wb=v.createContext(!1),bC=()=>v.useContext(Wb);Wb.Provider;function vC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xC=v.createContext(vC()),_C=()=>v.useContext(xC),wC=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SC=e=>{v.useEffect(()=>{e.clearReset()},[e])},EC=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||jb(n,[e.error,r])),kC=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},CC=(e,t)=>e.isLoading&&e.isFetching&&!t,RC=(e,t)=>e?.suspense&&t.isPending,Rp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PC(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=bC(),s=_C(),o=yC(),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",kC(i),wC(i,s,a),SC(s);const c=!o.getQueryCache().get(i.queryHash),[l]=v.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(f=>{const h=d?l.subscribe(ut.batchCalls(f)):Mt;return l.updateResult(),h},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(i)},[i,l]),RC(i,u))throw Rp(i,l,s);if(EC({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Jr&&CC(u,r)&&(c?Rp(i,l,s):a?.promise)?.catch(Mt).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function Go(e,t){return PC(e,lC)}var Ui={exports:{}},Yl={};var Pp;function OC(){if(Pp)return Yl;Pp=1;var e=T;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return Yl.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},Yl}var Xl={};var Op;function TC(){return Op||(Op=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,s=t.useRef,o=t.useEffect,i=t.useMemo,a=t.useDebugValue;Xl.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=s(null);if(h.current===null){var p={hasValue:!1,value:null};h.current=p}else p=h.current;h=i(function(){function y(S){if(!b){if(b=!0,x=S,S=d(S),f!==void 0&&p.hasValue){var C=p.value;if(f(C,S))return _=C}return _=S}if(C=_,n(x,S))return C;var k=d(S);return f!==void 0&&f(C,k)?(x=S,C):(x=S,_=k)}var b=!1,x,_,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=r(c,h[0],h[1]);return o(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Xl}var Tp;function MC(){return Tp||(Tp=1,process.env.NODE_ENV==="production"?Ui.exports=OC():Ui.exports=TC()),Ui.exports}var AC=MC();function NC(e){e()}function DC(){let e=null,t=null;return{clear(){e=null,t=null},notify(){NC(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Mp={notify(){},get:()=>[]};function IC(e,t){let n,r=Mp,s=0,o=!1;function i(m){u();const y=r.subscribe(m);let b=!1;return()=>{b||(b=!0,y(),d())}}function a(){r.notify()}function c(){p.onStateChange&&p.onStateChange()}function l(){return o}function u(){s++,n||(n=e.subscribe(c),r=DC())}function d(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=Mp)}function f(){o||(o=!0,u())}function h(){o&&(o=!1,d())}const p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return p}var jC=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LC=jC(),FC=()=>typeof navigator<"u"&&navigator.product==="ReactNative",zC=FC(),$C=()=>LC||zC?v.useLayoutEffect:v.useEffect,VC=$C(),BC=Symbol.for("react-redux-context"),UC=typeof globalThis<"u"?globalThis:{};function WC(){if(!v.createContext)return{};const e=UC[BC]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(v.createContext,t)),t}var mr=WC();function HC(e){const{children:t,context:n,serverState:r,store:s}=e,o=v.useMemo(()=>{const c=IC(s),l={store:s,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return l;{const{identityFunctionCheck:u="once",stabilityCheck:d="once"}=e;return Object.assign(l,{stabilityCheck:d,identityFunctionCheck:u})}},[s,r]),i=v.useMemo(()=>s.getState(),[s]);VC(()=>{const{subscription:c}=o;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),i!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[o,i]);const a=n||mr;return v.createElement(a.Provider,{value:o},t)}var Hb=HC;function df(e=mr){return function(){const n=v.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var qb=df();function Kb(e=mr){const t=e===mr?qb:df(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var qC=Kb();function KC(e=mr){const t=e===mr?qC:Kb(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var ZC=KC(),GC=(e,t)=>e===t;function YC(e=mr){const t=e===mr?qb:df(e),n=(r,s={})=>{const{equalityFn:o=GC}=typeof s=="function"?{equalityFn:s}:s;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof o!="function")throw new Error("You must pass a function as an equality function to useSelector")}const i=t(),{store:a,subscription:c,getServerState:l}=i,u=v.useRef(!0),d=v.useCallback({[r.name](h){const p=r(h);if(process.env.NODE_ENV!=="production"){const{devModeChecks:m={}}=typeof s=="function"?{}:s,{identityFunctionCheck:y,stabilityCheck:b}=i,{identityFunctionCheck:x,stabilityCheck:_}={stabilityCheck:b,identityFunctionCheck:y,...m};if(_==="always"||_==="once"&&u.current){const w=r(h);if(!o(p,w)){let S;try{throw new Error}catch(C){({stack:S}=C)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
12
7
|
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:h,selected:p,selected2:w,stack:S})}}if((x==="always"||x==="once"&&u.current)&&p===h){let w;try{throw new Error}catch(S){({stack:w}=S)}console.warn("Selector "+(r.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
|
|
13
|
-
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:w})}u.current&&(u.current=!1)}return p}}[r.name],[r]),f=YO.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,l||a.getState,d,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var gT=mT();const Wv=()=>hT(),Hv=gT;function lt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var yT=typeof Symbol=="function"&&Symbol.observable||"@@observable",mm=yT,su=()=>Math.random().toString(36).substring(7).split("").join("."),bT={INIT:`@@redux/INIT${su()}`,REPLACE:`@@redux/REPLACE${su()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${su()}`},Kr=bT;function wi(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function vT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(wT(e))return"date";if(_T(e))return"error";const n=xT(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function xT(e){return typeof e.constructor=="function"?e.constructor.name:null}function _T(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function wT(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=vT(e)),t}function qv(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?lt(2):`Expected the root reducer to be a function. Instead, received: '${tr(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?lt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?lt(1):`Expected the enhancer to be a function. Instead, received: '${tr(n)}'`);return n(qv)(e,t)}let r=e,s=t,o=new Map,i=o,a=0,c=!1;function l(){i===o&&(i=new Map,o.forEach((y,b)=>{i.set(b,y)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function d(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(4):`Expected the listener to be a function. Instead, received: '${tr(y)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;l();const x=a++;return i.set(x,y),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,l(),i.delete(x),o=null}}}function f(y){if(!wi(y))throw new Error(process.env.NODE_ENV==="production"?lt(7):`Actions must be plain objects. Instead, the actual type was: '${tr(y)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof y.type>"u")throw new Error(process.env.NODE_ENV==="production"?lt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?lt(17):`Action "type" property must be a string. Instead, the actual type was: '${tr(y.type)}'. Value was: '${y.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(9):"Reducers may not dispatch actions.");try{c=!0,s=r(s,y)}finally{c=!1}return(o=i).forEach(x=>{x()}),y}function h(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(10):`Expected the nextReducer to be a function. Instead, received: '${tr(y)}`);r=y,f({type:Kr.REPLACE})}function p(){const y=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?lt(11):`Expected the observer to be an object. Instead, received: '${tr(b)}'`);function x(){const w=b;w.next&&w.next(u())}return x(),{unsubscribe:y(x)}},[mm](){return this}}}return f({type:Kr.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[mm]:p}}function gm(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ST(e,t,n,r){const s=Object.keys(t),o=n&&n.type===Kr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!wi(e))return`The ${o} has unexpected type of "${tr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Kr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function ET(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Kr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Kr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function kT(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&gm(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{ET(n)}catch(i){o=i}return function(a={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=ST(a,n,c,s);d&&gm(d)}let l=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],h=n[f],p=a[f],m=h(p,c);if(typeof m>"u"){const y=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?lt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[f]=m,l=l||m!==p}return l=l||r.length!==Object.keys(a).length,l?u:a}}function sc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function CT(...e){return t=>(n,r)=>{const s=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?lt(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:s.getState,dispatch:(c,...l)=>o(c,...l)},a=e.map(c=>c(i));return o=sc(...a)(s.dispatch),{...s,dispatch:o}}}function Kv(e){return wi(e)&&"type"in e&&typeof e.type=="string"}var Zv=Symbol.for("immer-nothing"),ym=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state"),RT=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Bt(e,...t){if(process.env.NODE_ENV!=="production"){const n=RT[e],r=Lr(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ut=Object,Ks=Ut.getPrototypeOf,oc="constructor",qc="prototype",cd="configurable",ic="enumerable",Ta="writable",Qo="value",Kn=e=>!!e&&!!e[Ct];function hn(e){return e?Gv(e)||Zc(e)||!!e[ym]||!!e[oc]?.[ym]||Gc(e)||Yc(e):!1}var PT=Ut[qc][oc].toString(),bm=new WeakMap;function Gv(e){if(!e||!Tf(e))return!1;const t=Ks(e);if(t===null||t===Ut[qc])return!0;const n=Ut.hasOwnProperty.call(t,oc)&&t[oc];if(n===Object)return!0;if(!Lr(n))return!1;let r=bm.get(n);return r===void 0&&(r=Function.toString.call(n),bm.set(n,r)),r===PT}function Kc(e,t,n=!0){Si(e)===0?(n?Reflect.ownKeys(e):Ut.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function Si(e){const t=e[Ct];return t?t.type_:Zc(e)?1:Gc(e)?2:Yc(e)?3:0}var vm=(e,t,n=Si(e))=>n===2?e.has(t):Ut[qc].hasOwnProperty.call(e,t),ld=(e,t,n=Si(e))=>n===2?e.get(t):e[t],ac=(e,t,n,r=Si(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function OT(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Zc=Array.isArray,Gc=e=>e instanceof Map,Yc=e=>e instanceof Set,Tf=e=>typeof e=="object",Lr=e=>typeof e=="function",ou=e=>typeof e=="boolean";function TT(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var zn=e=>e.copy_||e.base_,Mf=e=>e.modified_?e.copy_:e.base_;function ud(e,t){if(Gc(e))return new Map(e);if(Yc(e))return new Set(e);if(Zc(e))return Array[qc].slice.call(e);const n=Gv(e);if(t===!0||t==="class_only"&&!n){const r=Ut.getOwnPropertyDescriptors(e);delete r[Ct];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){const i=s[o],a=r[i];a[Ta]===!1&&(a[Ta]=!0,a[cd]=!0),(a.get||a.set)&&(r[i]={[cd]:!0,[Ta]:!0,[ic]:a[ic],[Qo]:e[i]})}return Ut.create(Ks(e),r)}else{const r=Ks(e);if(r!==null&&n)return{...e};const s=Ut.create(r);return Ut.assign(s,e)}}function Af(e,t=!1){return Xc(e)||Kn(e)||!hn(e)||(Si(e)>1&&Ut.defineProperties(e,{set:Zi,add:Zi,clear:Zi,delete:Zi}),Ut.freeze(e),t&&Kc(e,(n,r)=>{Af(r,!0)},!1)),e}function MT(){Bt(2)}var Zi={[Qo]:MT};function Xc(e){return e===null||!Tf(e)?!0:Ut.isFrozen(e)}var cc="MapSet",dd="Patches",xm="ArrayMethods",Yv={};function es(e){const t=Yv[e];return t||Bt(0,e),t}var _m=e=>!!Yv[e],ei,Xv=()=>ei,AT=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_m(cc)?es(cc):void 0,arrayMethodsPlugin_:_m(xm)?es(xm):void 0});function wm(e,t){t&&(e.patchPlugin_=es(dd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fd(e){hd(e),e.drafts_.forEach(NT),e.drafts_=null}function hd(e){e===ei&&(ei=e.parent_)}var Sm=e=>ei=AT(ei,e);function NT(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Em(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ct].modified_&&(fd(t),Bt(4)),hn(e)&&(e=km(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[Ct].base_,e,t)}else e=km(t,n);return DT(t,e,!0),fd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zv?e:void 0}function km(e,t){if(Xc(t))return t;const n=t[Ct];if(!n)return lc(t,e.handledSet_,e);if(!Jc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);ex(n,e)}return n.copy_}function DT(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Af(t,n)}function Jv(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Jc=(e,t)=>e.scope_===t,IT=[];function Qv(e,t,n,r){const s=zn(e),o=e.type_;if(r!==void 0&&ld(s,r,o)===t){ac(s,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Kc(s,(c,l)=>{if(Kn(l)){const u=a.get(l)||[];u.push(c),a.set(l,u)}})}const i=e.draftLocations_.get(t)??IT;for(const a of i)ac(s,a,n,o)}function jT(e,t,n){e.callbacks_.push(function(s){const o=t;if(!o||!Jc(o,s))return;s.mapSetPlugin_?.fixSetContents(o);const i=Mf(o);Qv(e,o.draft_??o,i,n),ex(o,s)})}function ex(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const s=r.getPath(e);s&&r.generatePatches_(e,s,t)}Jv(e)}}function LT(e,t,n){const{scope_:r}=e;if(Kn(n)){const s=n[Ct];Jc(s,r)&&s.callbacks_.push(function(){Ma(e);const i=Mf(s);Qv(e,n,i,t)})}else hn(n)&&e.callbacks_.push(function(){const o=zn(e);e.type_===3?o.has(n)&&lc(n,r.handledSet_,r):ld(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&lc(ld(e.copy_,t,e.type_),r.handledSet_,r)})}function lc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Kn(e)||t.has(e)||!hn(e)||Xc(e)||(t.add(e),Kc(e,(r,s)=>{if(Kn(s)){const o=s[Ct];if(Jc(o,n)){const i=Mf(o);ac(e,r,i,e.type_),Jv(o)}}else hn(s)&&lc(s,t,n)})),e}function FT(e,t){const n=Zc(e),r={type_:n?1:0,scope_:t?t.scope_:Xv(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,o=uc;n&&(s=[r],o=ti);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,[a,r]}var uc={get(e,t){if(t===Ct)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const s=zn(e);if(!vm(s,t,e.type_))return zT(e,s,t);const o=s[t];if(e.finalized_||!hn(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&TT(t))return o;if(o===iu(e.base_,t)){Ma(e);const i=e.type_===1?+t:t,a=md(e.scope_,o,e,i);return e.copy_[i]=a}return o},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,n){const r=tx(zn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=iu(zn(e),t),o=s?.[Ct];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(OT(n,s)&&(n!==void 0||vm(e.base_,t,e.type_)))return!0;Ma(e),pd(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),LT(e,t,n)),!0},deleteProperty(e,t){return Ma(e),iu(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ta]:!0,[cd]:e.type_!==1||t!=="length",[ic]:r[ic],[Qo]:n[t]}},defineProperty(){Bt(11)},getPrototypeOf(e){return Ks(e.base_)},setPrototypeOf(){Bt(12)}},ti={};for(let e in uc){let t=uc[e];ti[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ti.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Bt(13),ti.set.call(this,e,t,void 0)};ti.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Bt(14),uc.set.call(this,e[0],t,n,e[0])};function iu(e,t){const n=e[Ct];return(n?zn(n):e)[t]}function zT(e,t,n){const r=tx(t,n);return r?Qo in r?r[Qo]:r.get?.call(e.draft_):void 0}function tx(e,t){if(!(t in e))return;let n=Ks(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ks(n)}}function pd(e){e.modified_||(e.modified_=!0,e.parent_&&pd(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=ud(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $T=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Lr(t)&&!Lr(n)){const o=n;n=t;const i=this;return function(c=o,...l){return i.produce(c,u=>n.call(this,u,...l))}}Lr(n)||Bt(6),r!==void 0&&!Lr(r)&&Bt(7);let s;if(hn(t)){const o=Sm(this),i=md(o,t,void 0);let a=!0;try{s=n(i),a=!1}finally{a?fd(o):hd(o)}return wm(o,r),Em(s,o)}else if(!t||!Tf(t)){if(s=n(t),s===void 0&&(s=t),s===Zv&&(s=void 0),this.autoFreeze_&&Af(s,!0),r){const o=[],i=[];es(dd).generateReplacementPatches_(t,s,{patches_:o,inversePatches_:i}),r(o,i)}return s}else Bt(1,t)},this.produceWithPatches=(t,n)=>{if(Lr(t))return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,s;return[this.produce(t,n,(i,a)=>{r=i,s=a}),r,s]},ou(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ou(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ou(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){hn(e)||Bt(8),Kn(e)&&(e=VT(e));const t=Sm(this),n=md(t,e,void 0);return n[Ct].isManual_=!0,hd(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&Bt(9);const{scope_:r}=n;return wm(r,t),Em(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=es(dd).applyPatches_;return Kn(e)?r(e,t):this.produce(e,s=>r(s,t))}};function md(e,t,n,r){const[s,o]=Gc(t)?es(cc).proxyMap_(t,n):Yc(t)?es(cc).proxySet_(t,n):FT(t,n);return(n?.scope_??Xv()).drafts_.push(s),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?jT(n,o,r):o.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:l}=c;o.modified_&&l&&l.generatePatches_(o,[],c)}),s}function VT(e){return Kn(e)||Bt(10,e),nx(e)}function nx(e){if(!hn(e)||Xc(e))return e;const t=e[Ct];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ud(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ud(e,!0);return Kc(n,(s,o)=>{ac(n,s,nx(o))},r),t&&(t.finalized_=!1),n}var BT=new $T,rx=BT.produce;function sx(e){return({dispatch:n,getState:r})=>s=>o=>typeof o=="function"?o(n,r,e):s(o)}var UT=sx(),WT=sx,HT=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?sc:sc.apply(null,arguments)},ox=e=>e&&typeof e.match=="function";function $o(e,t){function n(...r){if(t){let s=t(...r);if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(0):"prepareAction did not return an object");return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Kv(r)&&r.type===e,n}function qT(e){return typeof e=="function"&&"type"in e&&ox(e)}function KT(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
|
|
14
|
-
|
|
8
|
+
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:w})}u.current&&(u.current=!1)}return p}}[r.name],[r]),f=AC.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,l||a.getState,d,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var XC=YC();function JC(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 QC=e=>{switch(e){case"success":return nR;case"info":return sR;case"warning":return rR;case"error":return oR;default:return null}},eR=Array(12).fill(0),tR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},eR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),nR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),rR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),sR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),oR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),iR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aR=()=>{const[e,t]=T.useState(document.hidden);return T.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Gu=1;class cR{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,...s}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Gu++,i=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},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 s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:r,type:"default",message:l});else if(uR(l)&&!l.ok){o=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(l instanceof Error){o=!1;const d=typeof n.error=="function"?await n.error(l):n.error,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...p})}else if(n.success!==void 0){o=!1;const d=typeof n.success=="function"?await n.success(l):n.success,f=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!T.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:f,...p})}}).catch(async l=>{if(i=["reject",l],n.error!==void 0){o=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,h=typeof u=="object"&&!T.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...h})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Gu++;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 Tt=new cR,lR=(e,t)=>{const n=t?.id||Gu++;return Tt.addToast({title:e,...t,id:n}),n},uR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dR=lR,fR=()=>Tt.toasts,hR=()=>Tt.getActiveToasts(),Ee=Object.assign(dR,{success:Tt.success,info:Tt.info,warning:Tt.warning,error:Tt.error,custom:Tt.custom,message:Tt.message,promise:Tt.promise,dismiss:Tt.dismiss,loading:Tt.loading},{getHistory:fR,getToasts:hR});JC("[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 Wi(e){return e.label!==void 0}const pR=3,mR="24px",gR="16px",Ap=4e3,yR=356,bR=14,vR=45,xR=200;function vn(...e){return e.filter(Boolean).join(" ")}function _R(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const wR=e=>{var t,n,r,s,o,i,a,c,l;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:y,index:b,toasts:x,expanded:_,removeToast:w,defaultRichColors:S,closeButton:C,style:k,cancelButtonStyle:E,actionButtonStyle:P,className:O="",descriptionClassName:N="",duration:A,position:j,gap:$,expandByDefault:q,classNames:D,icons:H,closeButtonAriaLabel:F="Close toast"}=e,[W,se]=T.useState(null),[I,Y]=T.useState(null),[K,Z]=T.useState(!1),[oe,ce]=T.useState(!1),[V,ee]=T.useState(!1),[me,le]=T.useState(!1),[fe,ge]=T.useState(!1),[Ze,_t]=T.useState(0),[rn,qt]=T.useState(0),st=T.useRef(d.duration||A||Ap),Qn=T.useRef(null),ot=T.useRef(null),ps=b===0,R=b+1<=m,M=d.type,z=d.dismissible!==!1,J=d.className||"",G=d.descriptionClassName||"",B=T.useMemo(()=>y.findIndex(he=>he.toastId===d.id)||0,[y,d.id]),Q=T.useMemo(()=>{var he;return(he=d.closeButton)!=null?he:C},[d.closeButton,C]),ue=T.useMemo(()=>d.duration||A||Ap,[d.duration,A]),ve=T.useRef(0),Ue=T.useRef(0),bn=T.useRef(0),wt=T.useRef(null),[Dl,ao]=j.split("-"),ms=T.useMemo(()=>y.reduce((he,it,ft)=>ft>=B?he:he+it.height,0),[y,B]),Ai=aR(),Ni=d.invert||u,co=M==="loading";Ue.current=T.useMemo(()=>B*$+ms,[B,ms]),T.useEffect(()=>{st.current=ue},[ue]),T.useEffect(()=>{Z(!0)},[]),T.useEffect(()=>{const he=ot.current;if(he){const it=he.getBoundingClientRect().height;return qt(it),p(ft=>[{toastId:d.id,height:it,position:d.position},...ft]),()=>p(ft=>ft.filter(Lt=>Lt.toastId!==d.id))}},[p,d.id]),T.useLayoutEffect(()=>{if(!K)return;const he=ot.current,it=he.style.height;he.style.height="auto";const ft=he.getBoundingClientRect().height;he.style.height=it,qt(ft),p(Lt=>Lt.find(ct=>ct.toastId===d.id)?Lt.map(ct=>ct.toastId===d.id?{...ct,height:ft}:ct):[{toastId:d.id,height:ft,position:d.position},...Lt])},[K,d.title,d.description,p,d.id,d.jsx,d.action,d.cancel]);const sn=T.useCallback(()=>{ce(!0),_t(Ue.current),p(he=>he.filter(it=>it.toastId!==d.id)),setTimeout(()=>{w(d)},xR)},[d,w,p,Ue]);T.useEffect(()=>{if(d.promise&&M==="loading"||d.duration===1/0||d.type==="loading")return;let he;return _||h||Ai?(()=>{if(bn.current<ve.current){const Lt=new Date().getTime()-ve.current;st.current=st.current-Lt}bn.current=new Date().getTime()})():st.current!==1/0&&(ve.current=new Date().getTime(),he=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),sn()},st.current)),()=>clearTimeout(he)},[_,h,d,M,Ai,sn]),T.useEffect(()=>{d.delete&&(sn(),d.onDismiss==null||d.onDismiss.call(d,d))},[sn,d.delete]);function rE(){var he;if(H?.loading){var it;return T.createElement("div",{className:vn(D?.loader,d==null||(it=d.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":M==="loading"},H.loading)}return T.createElement(tR,{className:vn(D?.loader,d==null||(he=d.classNames)==null?void 0:he.loader),visible:M==="loading"})}const sE=d.icon||H?.[M]||QC(M);var Fh,zh;return T.createElement("li",{tabIndex:0,ref:ot,className:vn(O,J,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[M],d==null||(n=d.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Fh=d.richColors)!=null?Fh:S,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":K,"data-promise":!!d.promise,"data-swiped":fe,"data-removed":oe,"data-visible":R,"data-y-position":Dl,"data-x-position":ao,"data-index":b,"data-front":ps,"data-swiping":V,"data-dismissible":z,"data-type":M,"data-invert":Ni,"data-swipe-out":me,"data-swipe-direction":I,"data-expanded":!!(_||q&&K),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${oe?Ze:Ue.current}px`,"--initial-height":q?"auto":`${rn}px`,...k,...d.style},onDragEnd:()=>{ee(!1),se(null),wt.current=null},onPointerDown:he=>{he.button!==2&&(co||!z||(Qn.current=new Date,_t(Ue.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(ee(!0),wt.current={x:he.clientX,y:he.clientY})))},onPointerUp:()=>{var he,it,ft;if(me||!z)return;wt.current=null;const Lt=Number(((he=ot.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Di=Number(((it=ot.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((ft=Qn.current)==null?void 0:ft.getTime()),Kt=W==="x"?Lt:Di,Ii=Math.abs(Kt)/ct;if(Math.abs(Kt)>=vR||Ii>.11){_t(Ue.current),d.onDismiss==null||d.onDismiss.call(d,d),Y(W==="x"?Lt>0?"right":"left":Di>0?"down":"up"),sn(),le(!0);return}else{var on,an;(on=ot.current)==null||on.style.setProperty("--swipe-amount-x","0px"),(an=ot.current)==null||an.style.setProperty("--swipe-amount-y","0px")}ge(!1),ee(!1),se(null)},onPointerMove:he=>{var it,ft,Lt;if(!wt.current||!z||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const ct=he.clientY-wt.current.y,Kt=he.clientX-wt.current.x;var Ii;const on=(Ii=e.swipeDirections)!=null?Ii:_R(j);!W&&(Math.abs(Kt)>1||Math.abs(ct)>1)&&se(Math.abs(Kt)>Math.abs(ct)?"x":"y");let an={x:0,y:0};const $h=Or=>1/(1.5+Math.abs(Or)/20);if(W==="y"){if(on.includes("top")||on.includes("bottom"))if(on.includes("top")&&ct<0||on.includes("bottom")&&ct>0)an.y=ct;else{const Or=ct*$h(ct);an.y=Math.abs(Or)<Math.abs(ct)?Or:ct}}else if(W==="x"&&(on.includes("left")||on.includes("right")))if(on.includes("left")&&Kt<0||on.includes("right")&&Kt>0)an.x=Kt;else{const Or=Kt*$h(Kt);an.x=Math.abs(Or)<Math.abs(Kt)?Or:Kt}(Math.abs(an.x)>0||Math.abs(an.y)>0)&&ge(!0),(ft=ot.current)==null||ft.style.setProperty("--swipe-amount-x",`${an.x}px`),(Lt=ot.current)==null||Lt.style.setProperty("--swipe-amount-y",`${an.y}px`)}},Q&&!d.jsx&&M!=="loading"?T.createElement("button",{"aria-label":F,"data-disabled":co,"data-close-button":!0,onClick:co||!z?()=>{}:()=>{sn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:vn(D?.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(zh=H?.close)!=null?zh:iR):null,(M||d.icon||d.promise)&&d.icon!==null&&(H?.[M]!==null||d.icon)?T.createElement("div",{"data-icon":"",className:vn(D?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||rE():null,d.type!=="loading"?sE:null):null,T.createElement("div",{"data-content":"",className:vn(D?.content,d==null||(o=d.classNames)==null?void 0:o.content)},T.createElement("div",{"data-title":"",className:vn(D?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?T.createElement("div",{"data-description":"",className:vn(N,G,D?.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),T.isValidElement(d.cancel)?d.cancel:d.cancel&&Wi(d.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||E,onClick:he=>{Wi(d.cancel)&&z&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,he),sn())},className:vn(D?.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,T.isValidElement(d.action)?d.action:d.action&&Wi(d.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||P,onClick:he=>{Wi(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,he),!he.defaultPrevented&&sn())},className:vn(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function Np(){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 SR(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?gR:mR;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}const ER=T.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:l,offset:u,mobileOffset:d,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:y=pR,toastOptions:b,dir:x=Np(),gap:_=bR,icons:w,containerAriaLabel:S="Notifications"}=t,[C,k]=T.useState([]),E=T.useMemo(()=>r?C.filter(K=>K.toasterId===r):C.filter(K=>!K.toasterId),[C,r]),P=T.useMemo(()=>Array.from(new Set([o].concat(E.filter(K=>K.position).map(K=>K.position)))),[E,o]),[O,N]=T.useState([]),[A,j]=T.useState(!1),[$,q]=T.useState(!1),[D,H]=T.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=T.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),se=T.useRef(null),I=T.useRef(!1),Y=T.useCallback(K=>{k(Z=>{var oe;return(oe=Z.find(ce=>ce.id===K.id))!=null&&oe.delete||Tt.dismiss(K.id),Z.filter(({id:ce})=>ce!==K.id)})},[]);return T.useEffect(()=>Tt.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{k(Z=>Z.map(oe=>oe.id===K.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Dc.flushSync(()=>{k(Z=>{const oe=Z.findIndex(ce=>ce.id===K.id);return oe!==-1?[...Z.slice(0,oe),{...Z[oe],...K},...Z.slice(oe+1)]:[K,...Z]})})})}),[C]),T.useEffect(()=>{if(f!=="system"){H(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:Z})=>{H(Z?"dark":"light")})}catch{K.addListener(({matches:oe})=>{try{H(oe?"dark":"light")}catch(ce){console.error(ce)}})}},[f]),T.useEffect(()=>{C.length<=1&&j(!1)},[C]),T.useEffect(()=>{const K=Z=>{var oe;if(i.every(ee=>Z[ee]||Z.code===ee)){var V;j(!0),(V=F.current)==null||V.focus()}Z.code==="Escape"&&(document.activeElement===F.current||(oe=F.current)!=null&&oe.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),T.useEffect(()=>{if(F.current)return()=>{se.current&&(se.current.focus({preventScroll:!0}),se.current=null,I.current=!1)}},[F.current]),T.createElement("section",{ref:n,"aria-label":`${S} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((K,Z)=>{var oe;const[ce,V]=K.split("-");return E.length?T.createElement("ol",{key:K,dir:x==="auto"?Np():x,tabIndex:-1,ref:F,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ce,"data-x-position":V,style:{"--front-toast-height":`${((oe=O[0])==null?void 0:oe.height)||0}px`,"--width":`${yR}px`,"--gap":`${_}px`,...m,...SR(u,d)},onBlur:ee=>{I.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(I.current=!1,se.current&&(se.current.focus({preventScroll:!0}),se.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I.current||(I.current=!0,se.current=ee.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{$||j(!1)},onDragEnd:()=>j(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},E.filter(ee=>!ee.position&&Z===0||ee.position===K).map((ee,me)=>{var le,fe;return T.createElement(wR,{key:ee.id,icons:w,index:me,toast:ee,defaultRichColors:h,duration:(le=b?.duration)!=null?le:p,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(fe=b?.closeButton)!=null?fe:c,interacting:$,position:K,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:Y,toasts:E.filter(ge=>ge.position==ee.position),heights:O.filter(ge=>ge.position==ee.position),setHeights:N,expandByDefault:a,gap:_,expanded:A,swipeDirections:t.swipeDirections})})):null}))}),Dp=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,s,a);return a},kR=(e=>e?Dp(e):Dp),CR=e=>e;function RR(e,t=CR){const n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),T.useCallback(()=>t(e.getInitialState()),[e,t]));return T.useDebugValue(n),n}const Ip=e=>{const t=kR(e),n=r=>RR(t,r);return Object.assign(n,t),n},Zb=(e=>e?Ip(e):Ip);function PR(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=c=>c===null?null:JSON.parse(c,void 0),a=(o=n.getItem(s))!=null?o:null;return a instanceof Promise?a.then(i):i(a)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const Yu=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yu(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yu(r)(n)}}}},OR=(e,t)=>(n,r,s)=>{let o={storage:PR(()=>localStorage),partialize:y=>y,version:0,merge:(y,b)=>({...b,...y}),...t},i=!1,a=0;const c=new Set,l=new Set;let u=o.storage;if(!u)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,s);const d=()=>{const y=o.partialize({...r()});return u.setItem(o.name,{state:y,version:o.version})},f=s.setState;s.setState=(y,b)=>(f(y,b),d());const h=e((...y)=>(n(...y),d()),r,s);s.getInitialState=()=>h;let p;const m=()=>{var y,b;if(!u)return;const x=++a;i=!1,c.forEach(w=>{var S;return w((S=r())!=null?S:h)});const _=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(y=r())!=null?y:h))||void 0;return Yu(u.getItem.bind(u))(o.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==o.version){if(o.migrate){const S=o.migrate(w.state,w.version);return S instanceof Promise?S.then(C=>[!0,C]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var S;if(x!==a)return;const[C,k]=w;if(p=o.merge(k,(S=r())!=null?S:h),n(p,!0),C)return d()}).then(()=>{x===a&&(_?.(p,void 0),p=r(),i=!0,l.forEach(w=>w(p)))}).catch(w=>{x===a&&_?.(void 0,w)})};return s.persist={setOptions:y=>{o={...o,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},o.skipHydration||m(),p||h},TR=OR;function Gb(e,t){return function(){return e.apply(t,arguments)}}const{toString:MR}=Object.prototype,{getPrototypeOf:ff}=Object,{iterator:zc,toStringTag:Yb}=Symbol,$c=(e=>t=>{const n=MR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gn=e=>(e=e.toLowerCase(),t=>$c(t)===e),Vc=e=>t=>typeof t===e,{isArray:Qs}=Array,qs=Vc("undefined");function gi(e){return e!==null&&!qs(e)&&e.constructor!==null&&!qs(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Xb=gn("ArrayBuffer");function AR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Xb(e.buffer),t}const NR=Vc("string"),Dt=Vc("function"),Jb=Vc("number"),yi=e=>e!==null&&typeof e=="object",DR=e=>e===!0||e===!1,Ra=e=>{if($c(e)!=="object")return!1;const t=ff(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Yb in e)&&!(zc in e)},IR=e=>{if(!yi(e)||gi(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jR=gn("Date"),LR=gn("File"),FR=gn("Blob"),zR=gn("FileList"),$R=e=>yi(e)&&Dt(e.pipe),VR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dt(e.append)&&((t=$c(e))==="formdata"||t==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"))},BR=gn("URLSearchParams"),[UR,WR,HR,qR]=["ReadableStream","Request","Response","Headers"].map(gn),KR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bi(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Qs(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(gi(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Qb(e,t){if(gi(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ev=e=>!qs(e)&&e!==Vr;function Xu(){const{caseless:e,skipUndefined:t}=ev(this)&&this||{},n={},r=(s,o)=>{const i=e&&Qb(n,o)||o;Ra(n[i])&&Ra(s)?n[i]=Xu(n[i],s):Ra(s)?n[i]=Xu({},s):Qs(s)?n[i]=s.slice():(!t||!qs(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&bi(arguments[s],r);return n}const ZR=(e,t,n,{allOwnKeys:r}={})=>(bi(t,(s,o)=>{n&&Dt(s)?Object.defineProperty(e,o,{value:Gb(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),GR=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),YR=(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)},XR=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&ff(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},JR=(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},QR=e=>{if(!e)return null;if(Qs(e))return e;let t=e.length;if(!Jb(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},eP=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ff(Uint8Array)),tP=(e,t)=>{const r=(e&&e[zc]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},nP=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},rP=gn("HTMLFormElement"),sP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),jp=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oP=gn("RegExp"),tv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bi(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},iP=e=>{tv(e,(t,n)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dt(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+"'")})}})},aP=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Qs(e)?r(e):r(String(e).split(t)),n},cP=()=>{},lP=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function uP(e){return!!(e&&Dt(e.append)&&e[Yb]==="FormData"&&e[zc])}const dP=e=>{const t=new Array(10),n=(r,s)=>{if(yi(r)){if(t.indexOf(r)>=0)return;if(gi(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Qs(r)?[]:{};return bi(r,(i,a)=>{const c=n(i,s+1);!qs(c)&&(o[a]=c)}),t[s]=void 0,o}}return r};return n(e,0)},fP=gn("AsyncFunction"),hP=e=>e&&(yi(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),nv=((e,t)=>e?setImmediate:t?((n,r)=>(Vr.addEventListener("message",({source:s,data:o})=>{s===Vr&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Vr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Dt(Vr.postMessage)),pP=typeof queueMicrotask<"u"?queueMicrotask.bind(Vr):typeof process<"u"&&process.nextTick||nv,mP=e=>e!=null&&Dt(e[zc]),L={isArray:Qs,isArrayBuffer:Xb,isBuffer:gi,isFormData:VR,isArrayBufferView:AR,isString:NR,isNumber:Jb,isBoolean:DR,isObject:yi,isPlainObject:Ra,isEmptyObject:IR,isReadableStream:UR,isRequest:WR,isResponse:HR,isHeaders:qR,isUndefined:qs,isDate:jR,isFile:LR,isBlob:FR,isRegExp:oP,isFunction:Dt,isStream:$R,isURLSearchParams:BR,isTypedArray:eP,isFileList:zR,forEach:bi,merge:Xu,extend:ZR,trim:KR,stripBOM:GR,inherits:YR,toFlatObject:XR,kindOf:$c,kindOfTest:gn,endsWith:JR,toArray:QR,forEachEntry:tP,matchAll:nP,isHTMLForm:rP,hasOwnProperty:jp,hasOwnProp:jp,reduceDescriptors:tv,freezeMethods:iP,toObjectSet:aP,toCamelCase:sP,noop:cP,toFiniteNumber:lP,findKey:Qb,global:Vr,isContextDefined:ev,isSpecCompliantForm:uP,toJSONObject:dP,isAsyncFn:fP,isThenable:hP,setImmediate:nv,asap:pP,isIterable:mP};let ae=class rv extends Error{static from(t,n,r,s,o,i){const a=new rv(t.message,n||t.code,r,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.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:L.toJSONObject(this.config),code:this.code,status:this.status}}};ae.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ae.ERR_BAD_OPTION="ERR_BAD_OPTION";ae.ECONNABORTED="ECONNABORTED";ae.ETIMEDOUT="ETIMEDOUT";ae.ERR_NETWORK="ERR_NETWORK";ae.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ae.ERR_DEPRECATED="ERR_DEPRECATED";ae.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ae.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ae.ERR_CANCELED="ERR_CANCELED";ae.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ae.ERR_INVALID_URL="ERR_INVALID_URL";const gP=null;function Ju(e){return L.isPlainObject(e)||L.isArray(e)}function sv(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function Lp(e,t,n){return e?e.concat(t).map(function(s,o){return s=sv(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function yP(e){return L.isArray(e)&&!e.some(Ju)}const bP=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function Bc(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!L.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(L.isDate(p))return p.toISOString();if(L.isBoolean(p))return p.toString();if(!c&&L.isBlob(p))throw new ae("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(p)||L.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let b=p;if(p&&!y&&typeof p=="object"){if(L.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(L.isArray(p)&&yP(p)||(L.isFileList(p)||L.endsWith(m,"[]"))&&(b=L.toArray(p)))return m=sv(m),b.forEach(function(_,w){!(L.isUndefined(_)||_===null)&&t.append(i===!0?Lp([m],w,o):i===null?m:m+"[]",l(_))}),!1}return Ju(p)?!0:(t.append(Lp(y,m,o),l(p)),!1)}const d=[],f=Object.assign(bP,{defaultVisitor:u,convertValue:l,isVisitable:Ju});function h(p,m){if(!L.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),L.forEach(p,function(b,x){(!(L.isUndefined(b)||b===null)&&s.call(t,b,L.isString(x)?x.trim():x,m,f))===!0&&h(b,m?m.concat(x):[x])}),d.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Fp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hf(e,t){this._pairs=[],e&&Bc(e,this,t)}const ov=hf.prototype;ov.append=function(t,n){this._pairs.push([t,n])};ov.toString=function(t){const n=t?function(r){return t.call(this,r,Fp)}:Fp;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function vP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iv(e,t,n){if(!t)return e;const r=n&&n.encode||vP,s=L.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=L.isURLSearchParams(t)?t.toString():new hf(t,s).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class zp{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){L.forEach(this.handlers,function(r){r!==null&&t(r)})}}const av={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xP=typeof URLSearchParams<"u"?URLSearchParams:hf,_P=typeof FormData<"u"?FormData:null,wP=typeof Blob<"u"?Blob:null,SP={isBrowser:!0,classes:{URLSearchParams:xP,FormData:_P,Blob:wP},protocols:["http","https","file","blob","url","data"]},pf=typeof window<"u"&&typeof document<"u",Qu=typeof navigator=="object"&&navigator||void 0,EP=pf&&(!Qu||["ReactNative","NativeScript","NS"].indexOf(Qu.product)<0),kP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CP=pf&&window.location.href||"http://localhost",RP=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pf,hasStandardBrowserEnv:EP,hasStandardBrowserWebWorkerEnv:kP,navigator:Qu,origin:CP},Symbol.toStringTag,{value:"Module"})),yt={...RP,...SP};function PP(e,t){return Bc(e,new yt.classes.URLSearchParams,{visitor:function(n,r,s,o){return yt.isNode&&L.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function OP(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TP(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function cv(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=n.length;return i=!i&&L.isArray(s)?s.length:i,c?(L.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!L.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&L.isArray(s[i])&&(s[i]=TP(s[i])),!a)}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,(r,s)=>{t(OP(r),s,n,0)}),n}return null}function MP(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const vi={transitional:av,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=L.isObject(t);if(o&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return s?JSON.stringify(cv(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return PP(t,this.formSerializer).toString();if((a=L.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Bc(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),MP(t)):t}],transformResponse:[function(t){const n=this.transitional||vi.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?ae.from(a,ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],e=>{vi.headers[e]={}});const AP=L.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"]),NP=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
9
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&AP[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},$p=Symbol("internals");function yo(e){return e&&String(e).trim().toLowerCase()}function Pa(e){return e===!1||e==null?e:L.isArray(e)?e.map(Pa):String(e)}function DP(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 IP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jl(e,t,n,r,s){if(L.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!L.isString(t)){if(L.isString(r))return t.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(t)}}function jP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function LP(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let It=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,c,l){const u=yo(c);if(!u)throw new Error("header name must be a non-empty string");const d=L.findKey(s,u);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||c]=Pa(a))}const i=(a,c)=>L.forEach(a,(l,u)=>o(l,u,c));if(L.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(L.isString(t)&&(t=t.trim())&&!IP(t))i(NP(t),n);else if(L.isObject(t)&&L.isIterable(t)){let a={},c,l;for(const u of t){if(!L.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?L.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=yo(t),t){const r=L.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return DP(s);if(L.isFunction(n))return n.call(this,s,r);if(L.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yo(t),t){const r=L.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Jl(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=yo(i),i){const a=L.findKey(r,i);a&&(!n||Jl(r,r[a],a,n))&&(delete r[a],s=!0)}}return L.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Jl(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return L.forEach(this,(s,o)=>{const i=L.findKey(r,o);if(i){n[i]=Pa(s),delete n[o];return}const a=t?jP(o):String(o).trim();a!==o&&delete n[o],n[a]=Pa(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return L.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&L.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(`
|
|
10
|
+
`)}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(s=>r.set(s)),r}static accessor(t){const r=(this[$p]=this[$p]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=yo(i);r[a]||(LP(s,i),r[a]=!0)}return L.isArray(t)?t.forEach(o):o(t),this}};It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(It.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});L.freezeMethods(It);function Ql(e,t){const n=this||vi,r=t||n,s=It.from(r.headers);let o=r.data;return L.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function lv(e){return!!(e&&e.__CANCEL__)}let xi=class extends ae{constructor(t,n,r){super(t??"canceled",ae.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function uv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ae("Request failed with status code "+n.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function FP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];i||(i=l),n[s]=c,r[s]=l;let d=o,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function $P(e,t){let n=0,r=1e3/t,s,o;const i=(l,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?i(l,u):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Qa=(e,t,n=3)=>{let r=0;const s=zP(50,250);return $P(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,l=s(c),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-i)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Vp=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Bp=e=>(...t)=>L.asap(()=>e(...t)),VP=yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,BP=yt.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];L.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),L.isString(r)&&a.push(`path=${r}`),L.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),L.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.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 UP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function WP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dv(e,t,n){let r=!UP(t);return e&&(r||n==!1)?WP(e,t):t}const Up=e=>e instanceof It?{...e}:e;function Qr(e,t){t=t||{};const n={};function r(l,u,d,f){return L.isPlainObject(l)&&L.isPlainObject(u)?L.merge.call({caseless:f},l,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function s(l,u,d,f){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function o(l,u){if(!L.isUndefined(u))return r(void 0,u)}function i(l,u){if(L.isUndefined(u)){if(!L.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(l,u,d)=>s(Up(l),Up(u),d,!0)};return L.forEach(Object.keys({...e,...t}),function(u){const d=c[u]||s,f=d(e[u],t[u],u);L.isUndefined(f)&&d!==a||(n[u]=f)}),n}const fv=e=>{const t=Qr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=It.from(i),t.url=iv(dv(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),L.isFormData(n)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(L.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([u,d])=>{l.includes(u.toLowerCase())&&i.set(u,d)})}}if(yt.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(t)),r||r!==!1&&VP(t.url))){const c=s&&o&&BP.read(o);c&&i.set(s,c)}return t},HP=typeof XMLHttpRequest<"u",qP=HP&&function(e){return new Promise(function(n,r){const s=fv(e);let o=s.data;const i=It.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function m(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const _=It.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:e,request:y};uv(function(k){n(k),m()},function(k){r(k),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new ae("Request aborted",ae.ECONNABORTED,e,y)),y=null)},y.onerror=function(w){const S=w&&w.message?w.message:"Network Error",C=new ae(S,ae.ERR_NETWORK,e,y);C.event=w||null,r(C),y=null},y.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||av;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new ae(w,S.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&L.forEach(i.toJSON(),function(w,S){y.setRequestHeader(S,w)}),L.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),a&&a!=="json"&&(y.responseType=s.responseType),l&&([f,p]=Qa(l,!0),y.addEventListener("progress",f)),c&&y.upload&&([d,h]=Qa(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=_=>{y&&(r(!_||_.type?new xi(null,e,y):_),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=FP(s.url);if(x&&yt.protocols.indexOf(x)===-1){r(new ae("Unsupported protocol "+x+":",ae.ERR_BAD_REQUEST,e));return}y.send(o||null)})},KP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof ae?u:new xi(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new ae(`timeout of ${t}ms exceeded`,ae.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>L.asap(a),c}},ZP=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},GP=async function*(e,t){for await(const n of YP(e))yield*ZP(n,t)},YP=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()}},Wp=(e,t,n,r)=>{const s=GP(e,t);let o=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=o+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Hp=64*1024,{isFunction:Hi}=L,XP=(({Request:e,Response:t})=>({Request:e,Response:t}))(L.global),{ReadableStream:qp,TextEncoder:Kp}=L.global,Zp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},JP=e=>{e=L.merge.call({skipUndefined:!0},XP,e);const{fetch:t,Request:n,Response:r}=e,s=t?Hi(t):typeof fetch=="function",o=Hi(n),i=Hi(r);if(!s)return!1;const a=s&&Hi(qp),c=s&&(typeof Kp=="function"?(p=>m=>p.encode(m))(new Kp):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=o&&a&&Zp(()=>{let p=!1;const m=new n(yt.origin,{body:new qp,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=i&&a&&Zp(()=>L.isReadableStream(new r("").body)),d={stream:u&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,y)=>{let b=m&&m[p];if(b)return b.call(m);throw new ae(`Response type '${p}' is not supported`,ae.ERR_NOT_SUPPORT,y)})});const f=async p=>{if(p==null)return 0;if(L.isBlob(p))return p.size;if(L.isSpecCompliantForm(p))return(await new n(yt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(L.isArrayBufferView(p)||L.isArrayBuffer(p))return p.byteLength;if(L.isURLSearchParams(p)&&(p=p+""),L.isString(p))return(await c(p)).byteLength},h=async(p,m)=>{const y=L.toFiniteNumber(p.getContentLength());return y??f(m)};return async p=>{let{url:m,method:y,data:b,signal:x,cancelToken:_,timeout:w,onDownloadProgress:S,onUploadProgress:C,responseType:k,headers:E,withCredentials:P="same-origin",fetchOptions:O}=fv(p),N=t||fetch;k=k?(k+"").toLowerCase():"text";let A=KP([x,_&&_.toAbortSignal()],w),j=null;const $=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let q;try{if(C&&l&&y!=="get"&&y!=="head"&&(q=await h(E,b))!==0){let I=new n(m,{method:"POST",body:b,duplex:"half"}),Y;if(L.isFormData(b)&&(Y=I.headers.get("content-type"))&&E.setContentType(Y),I.body){const[K,Z]=Vp(q,Qa(Bp(C)));b=Wp(I.body,Hp,K,Z)}}L.isString(P)||(P=P?"include":"omit");const D=o&&"credentials"in n.prototype,H={...O,signal:A,method:y.toUpperCase(),headers:E.normalize().toJSON(),body:b,duplex:"half",credentials:D?P:void 0};j=o&&new n(m,H);let F=await(o?N(j,O):N(m,H));const W=u&&(k==="stream"||k==="response");if(u&&(S||W&&$)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=F[oe]});const Y=L.toFiniteNumber(F.headers.get("content-length")),[K,Z]=S&&Vp(Y,Qa(Bp(S),!0))||[];F=new r(Wp(F.body,Hp,K,()=>{Z&&Z(),$&&$()}),I)}k=k||"text";let se=await d[L.findKey(d,k)||"text"](F,p);return!W&&$&&$(),await new Promise((I,Y)=>{uv(I,Y,{data:se,headers:It.from(F.headers),status:F.status,statusText:F.statusText,config:p,request:j})})}catch(D){throw $&&$(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new ae("Network Error",ae.ERR_NETWORK,p,j),{cause:D.cause||D}):ae.from(D,D&&D.code,p,j)}}},QP=new Map,hv=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,c,l,u=QP;for(;a--;)c=o[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:JP(t)),u=l;return l};hv();const mf={http:gP,xhr:qP,fetch:{get:hv}};L.forEach(mf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gp=e=>`- ${e}`,eO=e=>L.isFunction(e)||e===null||e===!1;function tO(e,t){e=L.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!eO(r)&&(s=mf[(a=String(r)).toLowerCase()],s===void 0))throw new ae(`Unknown adapter '${a}'`);if(s&&(L.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
11
|
+
`+i.map(Gp).join(`
|
|
12
|
+
`):" "+Gp(i[0]):"as no adapter specified";throw new ae("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const pv={getAdapter:tO,adapters:mf};function eu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xi(null,e)}function Yp(e){return eu(e),e.headers=It.from(e.headers),e.data=Ql.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pv.getAdapter(e.adapter||vi.adapter,e)(e).then(function(r){return eu(e),r.data=Ql.call(e,e.transformResponse,r),r.headers=It.from(r.headers),r},function(r){return lv(r)||(eu(e),r&&r.response&&(r.response.data=Ql.call(e,e.transformResponse,r.response),r.response.headers=It.from(r.response.headers))),Promise.reject(r)})}const mv="1.13.4",Uc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Uc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Xp={};Uc.transitional=function(t,n,r){function s(o,i){return"[Axios v"+mv+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new ae(s(i," has been removed"+(n?" in "+n:"")),ae.ERR_DEPRECATED);return n&&!Xp[i]&&(Xp[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};Uc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function nO(e,t,n){if(typeof e!="object")throw new ae("options must be an object",ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],c=a===void 0||i(a,o,e);if(c!==!0)throw new ae("option "+o+" must be "+c,ae.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ae("Unknown option "+o,ae.ERR_BAD_OPTION)}}const Oa={assertOptions:nO,validators:Uc},xn=Oa.validators;let qr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new zp,response:new zp}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
13
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Qr(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Oa.assertOptions(r,{silentJSONParsing:xn.transitional(xn.boolean),forcedJSONParsing:xn.transitional(xn.boolean),clarifyTimeoutError:xn.transitional(xn.boolean)},!1),s!=null&&(L.isFunction(s)?n.paramsSerializer={serialize:s}:Oa.assertOptions(s,{encode:xn.function,serialize:xn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oa.assertOptions(n,{baseUrl:xn.spelling("baseURL"),withXsrfToken:xn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&L.merge(o.common,o[n.method]);o&&L.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=It.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!c){const p=[Yp.bind(this),void 0];for(p.unshift(...a),p.push(...l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(;d<f;){const p=a[d++],m=a[d++];try{h=p(h)}catch(y){m.call(this,y);break}}try{u=Yp.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Qr(this.defaults,t);const n=dv(t.baseURL,t.url,t.allowAbsoluteUrls);return iv(n,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){qr.prototype[t]=function(n,r){return this.request(Qr(r||{},{method:t,url:n,data:(r||{}).data}))}});L.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(Qr(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}qr.prototype[t]=n(),qr.prototype[t+"Form"]=n(!0)});let rO=class gv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new xi(o,i,a),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 gv(function(s){t=s}),cancel:t}}};function sO(e){return function(n){return e.apply(null,n)}}function oO(e){return L.isObject(e)&&e.isAxiosError===!0}const ed={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(ed).forEach(([e,t])=>{ed[t]=e});function yv(e){const t=new qr(e),n=Gb(qr.prototype.request,t);return L.extend(n,qr.prototype,t,{allOwnKeys:!0}),L.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return yv(Qr(e,s))},n}const qe=yv(vi);qe.Axios=qr;qe.CanceledError=xi;qe.CancelToken=rO;qe.isCancel=lv;qe.VERSION=mv;qe.toFormData=Bc;qe.AxiosError=ae;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=sO;qe.isAxiosError=oO;qe.mergeConfig=Qr;qe.AxiosHeaders=It;qe.formToJSON=e=>cv(L.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=pv.getAdapter;qe.HttpStatusCode=ed;qe.default=qe;const{Axios:TH,AxiosError:MH,CanceledError:AH,isCancel:NH,CancelToken:DH,VERSION:IH,all:jH,Cancel:LH,isAxiosError:FH,spread:zH,toFormData:$H,AxiosHeaders:VH,HttpStatusCode:BH,formToJSON:UH,getAdapter:WH,mergeConfig:HH}=qe,td={apiBase:"http://localhost:3000/api",wsPath:"/ws"},Te=qe.create({baseURL:td.apiBase});function iO(e,t){Te.defaults.baseURL=e,t&&(Te.defaults.headers.common.Authorization=`Bearer ${t}`)}function nd(e){e?Te.defaults.headers.common.Authorization=`Bearer ${e}`:delete Te.defaults.headers.common.Authorization}const Wc=Zb()(TR(e=>({token:null,email:null,setAuth:(t,n)=>{nd(t),e({token:t,email:n})},logout:()=>{nd(null),e({token:null,email:null})}}),{name:"kuma_clone_auth"})),Jp=Wc.getState();Jp.token&&nd(Jp.token);const bv="pulsewatch.theme";function rd(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(bv,e)}const vv=Zb((e,t)=>({mode:"light",setMode:n=>{rd(n),e({mode:n})},toggle:()=>{const n=t().mode==="dark"?"light":"dark";rd(n),e({mode:n})}}));function aO(){const t=localStorage.getItem(bv)==="dark"?"dark":"light";rd(t),vv.setState({mode:t})}var _i=e=>e.type==="checkbox",Br=e=>e instanceof Date,At=e=>e==null;const xv=e=>typeof e=="object";var Je=e=>!At(e)&&!Array.isArray(e)&&xv(e)&&!Br(e),_v=e=>Je(e)&&e.target?_i(e.target)?e.target.checked:e.target.value:e,cO=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wv=(e,t)=>e.has(cO(t)),lO=e=>{const t=e.constructor&&e.constructor.prototype;return Je(t)&&t.hasOwnProperty("isPrototypeOf")},gf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(gf&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Je(e)&&lO(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Ge(e[s]));return r}var Hc=e=>/^\w*$/.test(e),Fe=e=>e===void 0,yf=e=>Array.isArray(e)?e.filter(Boolean):[],bf=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),X=(e,t,n)=>{if(!t||!Je(e))return n;const r=(Hc(t)?[t]:bf(t)).reduce((s,o)=>At(s)?s:s[o],e);return Fe(r)||r===e?Fe(e[t])?n:e[t]:r},zt=e=>typeof e=="boolean",kt=e=>typeof e=="function",ke=(e,t,n)=>{let r=-1;const s=Hc(t)?[t]:bf(t),o=s.length,i=o-1;for(;++r<o;){const a=s[r];let c=n;if(r!==i){const l=e[a];c=Je(l)||Array.isArray(l)?l:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const ec={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},un={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Nn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vf=T.createContext(null);vf.displayName="HookFormControlContext";const xf=()=>T.useContext(vf);var Sv=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==un.all&&(t._proxyFormState[i]=!r||un.all),n&&(n[i]=!0),e[i]}});return s};const _f=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Ev(e){const t=xf(),{control:n=t,disabled:r,name:s,exact:o}=e||{},[i,a]=T.useState(n._formState),c=T.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return _f(()=>n._subscribe({name:s,formState:c.current,exact:o,callback:l=>{!r&&a({...n._formState,...l})}}),[s,r,o]),T.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),T.useMemo(()=>Sv(i,n,c.current,!1),[i,n])}var Vt=e=>typeof e=="string",sd=(e,t,n,r,s)=>Vt(e)?(r&&t.watch.add(e),X(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),X(n,o))):(r&&(t.watchAll=!0),n),od=e=>At(e)||!xv(e);function dn(e,t,n=new WeakSet){if(od(e)||od(t))return Object.is(e,t);if(Br(e)&&Br(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(Br(i)&&Br(a)||Je(i)&&Je(a)||Array.isArray(i)&&Array.isArray(a)?!dn(i,a,n):!Object.is(i,a))return!1}}return!0}function uO(e){const t=xf(),{control:n=t,name:r,defaultValue:s,disabled:o,exact:i,compute:a}=e||{},c=T.useRef(s),l=T.useRef(a),u=T.useRef(void 0),d=T.useRef(n),f=T.useRef(r);l.current=a;const[h,p]=T.useState(()=>{const w=n._getWatch(r,c.current);return l.current?l.current(w):w}),m=T.useCallback(w=>{const S=sd(r,n._names,w||n._formValues,!1,c.current);return l.current?l.current(S):S},[n._formValues,n._names,r]),y=T.useCallback(w=>{if(!o){const S=sd(r,n._names,w||n._formValues,!1,c.current);if(l.current){const C=l.current(S);dn(C,u.current)||(p(C),u.current=C)}else p(S)}},[n._formValues,n._names,o,r]);_f(()=>((d.current!==n||!dn(f.current,r))&&(d.current=n,f.current=r,y()),n._subscribe({name:r,formState:{values:!0},exact:i,callback:w=>{y(w.values)}})),[n,i,r,y]),T.useEffect(()=>n._removeUnmounted());const b=d.current!==n,x=f.current,_=T.useMemo(()=>{if(o)return null;const w=!b&&!dn(x,r);return b||w?m():null},[o,b,r,x,m]);return _!==null?_:h}function dO(e){const t=xf(),{name:n,disabled:r,control:s=t,shouldUnregister:o,defaultValue:i,exact:a=!0}=e,c=wv(s._names.array,n),l=T.useMemo(()=>X(s._formValues,n,X(s._defaultValues,n,i)),[s,n,i]),u=uO({control:s,name:n,defaultValue:l,exact:a}),d=Ev({control:s,name:n,exact:a}),f=T.useRef(e),h=T.useRef(void 0),p=T.useRef(s.register(n,{...e.rules,value:u,...zt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const m=T.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!X(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!X(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!X(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!X(d.validatingFields,n)},error:{enumerable:!0,get:()=>X(d.errors,n)}}),[d,n]),y=T.useCallback(w=>p.current.onChange({target:{value:_v(w),name:n},type:ec.CHANGE}),[n]),b=T.useCallback(()=>p.current.onBlur({target:{value:X(s._formValues,n),name:n},type:ec.BLUR}),[n,s._formValues]),x=T.useCallback(w=>{const S=X(s._fields,n);S&&S._f&&w&&(S._f.ref={focus:()=>kt(w.focus)&&w.focus(),select:()=>kt(w.select)&&w.select(),setCustomValidity:C=>kt(w.setCustomValidity)&&w.setCustomValidity(C),reportValidity:()=>kt(w.reportValidity)&&w.reportValidity()})},[s._fields,n]),_=T.useMemo(()=>({name:n,value:u,...zt(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:y,onBlur:b,ref:x}),[n,r,d.disabled,y,b,x,u]);return T.useEffect(()=>{const w=s._options.shouldUnregister||o,S=h.current;S&&S!==n&&!c&&s.unregister(S),s.register(n,{...f.current.rules,...zt(f.current.disabled)?{disabled:f.current.disabled}:{}});const C=(k,E)=>{const P=X(s._fields,k);P&&P._f&&(P._f.mount=E)};if(C(n,!0),w){const k=Ge(X(s._options.defaultValues,n,f.current.defaultValue));ke(s._defaultValues,n,k),Fe(X(s._formValues,n))&&ke(s._formValues,n,k)}return!c&&s.register(n),h.current=n,()=>{(c?w&&!s._state.action:w)?s.unregister(n):C(n,!1)}},[n,s,c,o]),T.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),T.useMemo(()=>({field:_,formState:d,fieldState:m}),[_,d,m])}const fO=e=>e.render(dO(e)),wf=T.createContext(null);wf.displayName="HookFormContext";const hO=()=>T.useContext(wf),pO=e=>{const{children:t,watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}=e;return T.createElement(wf.Provider,{value:T.useMemo(()=>({watch:n,getValues:r,getFieldState:s,setError:o,clearErrors:i,setValue:a,trigger:c,formState:l,resetField:u,reset:d,handleSubmit:f,unregister:h,control:p,register:m,setFocus:y,subscribe:b}),[i,p,l,s,r,f,m,d,u,o,y,a,b,c,h,n])},T.createElement(vf.Provider,{value:p},t))};var Sf=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Fo=e=>Array.isArray(e)?e:[e],Qp=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function kv(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],o=t[r];if(s&&Je(s)&&o){const i=kv(s,o);Je(i)&&(n[r]=i)}else e[r]&&(n[r]=o)}return n}var Et=e=>Je(e)&&!Object.keys(e).length,Ef=e=>e.type==="file",tc=e=>{if(!gf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Cv=e=>e.type==="select-multiple",kf=e=>e.type==="radio",mO=e=>kf(e)||_i(e),tu=e=>tc(e)&&e.isConnected;function gO(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Fe(e)?r++:e[t[r++]];return e}function yO(e){for(const t in e)if(e.hasOwnProperty(t)&&!Fe(e[t]))return!1;return!0}function Ye(e,t){const n=Array.isArray(t)?t:Hc(t)?[t]:bf(t),r=n.length===1?e:gO(e,n),s=n.length-1,o=n[s];return r&&delete r[o],s!==0&&(Je(r)&&Et(r)||Array.isArray(r)&&yO(r))&&Ye(e,n.slice(0,-1)),e}var bO=e=>{for(const t in e)if(kt(e[t]))return!0;return!1};function Rv(e){return Array.isArray(e)||Je(e)&&!bO(e)}function id(e,t={}){for(const n in e){const r=e[n];Rv(r)?(t[n]=Array.isArray(r)?[]:{},id(r,t[n])):Fe(r)||(t[n]=!0)}return t}function Es(e,t,n){n||(n=id(t));for(const r in e){const s=e[r];if(Rv(s))Fe(t)||od(n[r])?n[r]=id(s,Array.isArray(s)?[]:{}):Es(s,At(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!dn(s,o)}}return n}const em={value:!1,isValid:!1},tm={value:!0,isValid:!0};var Pv=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&&!Fe(e[0].attributes.value)?Fe(e[0].value)||e[0].value===""?tm:{value:e[0].value,isValid:!0}:tm:em}return em},Ov=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Fe(e)?e:t?e===""?NaN:e&&+e:n&&Vt(e)?new Date(e):r?r(e):e;const nm={isValid:!1,value:null};var Tv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,nm):nm;function rm(e){const t=e.ref;return Ef(t)?t.files:kf(t)?Tv(e.refs).value:Cv(t)?[...t.selectedOptions].map(({value:n})=>n):_i(t)?Pv(e.refs).value:Ov(Fe(t.value)?e.ref.value:t.value,e)}var vO=(e,t,n,r)=>{const s={};for(const o of e){const i=X(t,o);i&&ke(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},nc=e=>e instanceof RegExp,bo=e=>Fe(e)?e:nc(e)?e.source:Je(e)?nc(e.value)?e.value.source:e.value:e,sm=e=>({isOnSubmit:!e||e===un.onSubmit,isOnBlur:e===un.onBlur,isOnChange:e===un.onChange,isOnAll:e===un.all,isOnTouch:e===un.onTouched});const om="AsyncFunction";var xO=e=>!!e&&!!e.validate&&!!(kt(e.validate)&&e.validate.constructor.name===om||Je(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===om)),_O=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),im=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const zo=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=X(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(zo(a,t))break}else if(Je(a)&&zo(a,t))break}}};function am(e,t,n){const r=X(e,n);if(r||Hc(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=X(t,o),a=X(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:n}}var wO=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Et(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||un.all))},SO=(e,t,n)=>!e||!t||e===t||Fo(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),EO=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,kO=(e,t)=>!yf(X(e,t)).length&&Ye(e,t),CO=(e,t,n)=>{const r=Fo(X(e,n));return ke(r,"root",t[n]),ke(e,n,r),e};function cm(e,t,n="validate"){if(Vt(e)||Array.isArray(e)&&e.every(Vt)||zt(e)&&!e)return{type:n,message:Vt(e)?e:"",ref:t}}var gs=e=>Je(e)&&!nc(e)?e:{value:e,message:""},lm=async(e,t,n,r,s,o)=>{const{ref:i,refs:a,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:y,mount:b}=e._f,x=X(n,m);if(!b||t.has(m))return{};const _=a?a[0]:i,w=A=>{s&&_.reportValidity&&(_.setCustomValidity(zt(A)?"":A||""),_.reportValidity())},S={},C=kf(i),k=_i(i),E=C||k,P=(y||Ef(i))&&Fe(i.value)&&Fe(x)||tc(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,O=Sf.bind(null,m,r,S),N=(A,j,$,q=Nn.maxLength,D=Nn.minLength)=>{const H=A?j:$;S[m]={type:A?q:D,message:H,ref:i,...O(A?q:D,H)}};if(o?!Array.isArray(x)||!x.length:c&&(!E&&(P||At(x))||zt(x)&&!x||k&&!Pv(a).isValid||C&&!Tv(a).isValid)){const{value:A,message:j}=Vt(c)?{value:!!c,message:c}:gs(c);if(A&&(S[m]={type:Nn.required,message:j,ref:_,...O(Nn.required,j)},!r))return w(j),S}if(!P&&(!At(d)||!At(f))){let A,j;const $=gs(f),q=gs(d);if(!At(x)&&!isNaN(x)){const D=i.valueAsNumber||x&&+x;At($.value)||(A=D>$.value),At(q.value)||(j=D<q.value)}else{const D=i.valueAsDate||new Date(x),H=se=>new Date(new Date().toDateString()+" "+se),F=i.type=="time",W=i.type=="week";Vt($.value)&&x&&(A=F?H(x)>H($.value):W?x>$.value:D>new Date($.value)),Vt(q.value)&&x&&(j=F?H(x)<H(q.value):W?x<q.value:D<new Date(q.value))}if((A||j)&&(N(!!A,$.message,q.message,Nn.max,Nn.min),!r))return w(S[m].message),S}if((l||u)&&!P&&(Vt(x)||o&&Array.isArray(x))){const A=gs(l),j=gs(u),$=!At(A.value)&&x.length>+A.value,q=!At(j.value)&&x.length<+j.value;if(($||q)&&(N($,A.message,j.message),!r))return w(S[m].message),S}if(h&&!P&&Vt(x)){const{value:A,message:j}=gs(h);if(nc(A)&&!x.match(A)&&(S[m]={type:Nn.pattern,message:j,ref:i,...O(Nn.pattern,j)},!r))return w(j),S}if(p){if(kt(p)){const A=await p(x,n),j=cm(A,_);if(j&&(S[m]={...j,...O(Nn.validate,j.message)},!r))return w(j.message),S}else if(Je(p)){let A={};for(const j in p){if(!Et(A)&&!r)break;const $=cm(await p[j](x,n),_,j);$&&(A={...$,...O(j,$.message)},w($.message),r&&(S[m]=A))}if(!Et(A)&&(S[m]={ref:_,...A},!r))return S}}return w(!0),S};const RO={mode:un.onSubmit,reValidateMode:un.onChange,shouldFocusError:!0};function PO(e={}){let t={...RO,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:kt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Je(t.defaultValues)||Je(t.values)?Ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let f={...d};const h={array:Qp(),state:Qp()},p=t.criteriaMode===un.all,m=R=>M=>{clearTimeout(l),l=setTimeout(R,M)},y=async R=>{if(!i.keepIsValid&&!t.disabled&&(d.isValid||f.isValid||R)){let M;t.resolver?(M=Et((await E()).errors),b()):M=await O(r,!0),M!==n.isValid&&h.state.next({isValid:M})}},b=(R,M)=>{!t.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((R||Array.from(a.mount)).forEach(z=>{z&&(M?ke(n.validatingFields,z,M):Ye(n.validatingFields,z))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Et(n.validatingFields)}))},x=(R,M=[],z,J,G=!0,B=!0)=>{if(J&&z&&!t.disabled){if(i.action=!0,B&&Array.isArray(X(r,R))){const Q=z(X(r,R),J.argA,J.argB);G&&ke(r,R,Q)}if(B&&Array.isArray(X(n.errors,R))){const Q=z(X(n.errors,R),J.argA,J.argB);G&&ke(n.errors,R,Q),kO(n.errors,R)}if((d.touchedFields||f.touchedFields)&&B&&Array.isArray(X(n.touchedFields,R))){const Q=z(X(n.touchedFields,R),J.argA,J.argB);G&&ke(n.touchedFields,R,Q)}(d.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Es(s,o)),h.state.next({name:R,isDirty:A(R,M),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ke(o,R,M)},_=(R,M)=>{ke(n.errors,R,M),h.state.next({errors:n.errors})},w=R=>{n.errors=R,h.state.next({errors:n.errors,isValid:!1})},S=(R,M,z,J)=>{const G=X(r,R);if(G){const B=X(o,R,Fe(z)?X(s,R):z);Fe(B)||J&&J.defaultChecked||M?ke(o,R,M?B:rm(G._f)):q(R,B),i.mount&&!i.action&&y()}},C=(R,M,z,J,G)=>{let B=!1,Q=!1;const ue={name:R};if(!t.disabled){if(!z||J){(d.isDirty||f.isDirty)&&(Q=n.isDirty,n.isDirty=ue.isDirty=A(),B=Q!==ue.isDirty);const ve=dn(X(s,R),M);Q=!!X(n.dirtyFields,R),ve?Ye(n.dirtyFields,R):ke(n.dirtyFields,R,!0),ue.dirtyFields=n.dirtyFields,B=B||(d.dirtyFields||f.dirtyFields)&&Q!==!ve}if(z){const ve=X(n.touchedFields,R);ve||(ke(n.touchedFields,R,z),ue.touchedFields=n.touchedFields,B=B||(d.touchedFields||f.touchedFields)&&ve!==z)}B&&G&&h.state.next(ue)}return B?ue:{}},k=(R,M,z,J)=>{const G=X(n.errors,R),B=(d.isValid||f.isValid)&&zt(M)&&n.isValid!==M;if(t.delayError&&z?(c=m(()=>_(R,z)),c(t.delayError)):(clearTimeout(l),c=null,z?ke(n.errors,R,z):Ye(n.errors,R)),(z?!dn(G,z):G)||!Et(J)||B){const Q={...J,...B&&zt(M)?{isValid:M}:{},errors:n.errors,name:R};n={...n,...Q},h.state.next(Q)}},E=async R=>(b(R,!0),await t.resolver(o,t.context,vO(R||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),P=async R=>{const{errors:M}=await E(R);if(b(R),R)for(const z of R){const J=X(M,z);J?ke(n.errors,z,J):Ye(n.errors,z)}else n.errors=M;return M},O=async(R,M,z={valid:!0})=>{for(const J in R){const G=R[J];if(G){const{_f:B,...Q}=G;if(B){const ue=a.array.has(B.name),ve=G._f&&xO(G._f);ve&&d.validatingFields&&b([B.name],!0);const Ue=await lm(G,a.disabled,o,p,t.shouldUseNativeValidation&&!M,ue);if(ve&&d.validatingFields&&b([B.name]),Ue[B.name]&&(z.valid=!1,M||e.shouldUseNativeValidation))break;!M&&(X(Ue,B.name)?ue?CO(n.errors,Ue,B.name):ke(n.errors,B.name,Ue[B.name]):Ye(n.errors,B.name))}!Et(Q)&&await O(Q,M,z)}}return z.valid},N=()=>{for(const R of a.unMount){const M=X(r,R);M&&(M._f.refs?M._f.refs.every(z=>!tu(z)):!tu(M._f.ref))&&ee(R)}a.unMount=new Set},A=(R,M)=>!t.disabled&&(R&&M&&ke(o,R,M),!dn(I(),s)),j=(R,M,z)=>sd(R,a,{...i.mount?o:Fe(M)?s:Vt(R)?{[R]:M}:M},z,M),$=R=>yf(X(i.mount?o:s,R,t.shouldUnregister?X(s,R,[]):[])),q=(R,M,z={})=>{const J=X(r,R);let G=M;if(J){const B=J._f;B&&(!B.disabled&&ke(o,R,Ov(M,B)),G=tc(B.ref)&&At(M)?"":M,Cv(B.ref)?[...B.ref.options].forEach(Q=>Q.selected=G.includes(Q.value)):B.refs?_i(B.ref)?B.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(G)?Q.checked=!!G.find(ue=>ue===Q.value):Q.checked=G===Q.value||!!G)}):B.refs.forEach(Q=>Q.checked=Q.value===G):Ef(B.ref)?B.ref.value="":(B.ref.value=G,B.ref.type||h.state.next({name:R,values:Ge(o)})))}(z.shouldDirty||z.shouldTouch)&&C(R,G,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&se(R)},D=(R,M,z)=>{for(const J in M){if(!M.hasOwnProperty(J))return;const G=M[J],B=R+"."+J,Q=X(r,B);(a.array.has(R)||Je(G)||Q&&!Q._f)&&!Br(G)?D(B,G,z):q(B,G,z)}},H=(R,M,z={})=>{const J=X(r,R),G=a.array.has(R),B=Ge(M);ke(o,R,B),G?(h.array.next({name:R,values:Ge(o)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&z.shouldDirty&&h.state.next({name:R,dirtyFields:Es(s,o),isDirty:A(R,B)})):J&&!J._f&&!At(B)?D(R,B,z):q(R,B,z),im(R,a)?h.state.next({...n,name:R,values:Ge(o)}):h.state.next({name:i.mount?R:void 0,values:Ge(o)})},F=async R=>{i.mount=!0;const M=R.target;let z=M.name,J=!0;const G=X(r,z),B=ve=>{J=Number.isNaN(ve)||Br(ve)&&isNaN(ve.getTime())||dn(ve,X(o,z,ve))},Q=sm(t.mode),ue=sm(t.reValidateMode);if(G){let ve,Ue;const bn=M.type?rm(G._f):_v(R),wt=R.type===ec.BLUR||R.type===ec.FOCUS_OUT,Dl=!_O(G._f)&&!t.resolver&&!X(n.errors,z)&&!G._f.deps||EO(wt,X(n.touchedFields,z),n.isSubmitted,ue,Q),ao=im(z,a,wt);ke(o,z,bn),wt?(!M||!M.readOnly)&&(G._f.onBlur&&G._f.onBlur(R),c&&c(0)):G._f.onChange&&G._f.onChange(R);const ms=C(z,bn,wt),Ai=!Et(ms)||ao;if(!wt&&h.state.next({name:z,type:R.type,values:Ge(o)}),Dl)return(d.isValid||f.isValid)&&(t.mode==="onBlur"?wt&&y():wt||y()),Ai&&h.state.next({name:z,...ao?{}:ms});if(!wt&&ao&&h.state.next({...n}),t.resolver){const{errors:Ni}=await E([z]);if(b([z]),B(bn),J){const co=am(n.errors,r,z),sn=am(Ni,r,co.name||z);ve=sn.error,z=sn.name,Ue=Et(Ni)}}else b([z],!0),ve=(await lm(G,a.disabled,o,p,t.shouldUseNativeValidation))[z],b([z]),B(bn),J&&(ve?Ue=!1:(d.isValid||f.isValid)&&(Ue=await O(r,!0)));J&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&se(G._f.deps),k(z,Ue,ve,ms))}},W=(R,M)=>{if(X(n.errors,M)&&R.focus)return R.focus(),1},se=async(R,M={})=>{let z,J;const G=Fo(R);if(t.resolver){const B=await P(Fe(R)?R:G);z=Et(B),J=R?!G.some(Q=>X(B,Q)):z}else R?(J=(await Promise.all(G.map(async B=>{const Q=X(r,B);return await O(Q&&Q._f?{[B]:Q}:Q)}))).every(Boolean),!(!J&&!n.isValid)&&y()):J=z=await O(r);return h.state.next({...!Vt(R)||(d.isValid||f.isValid)&&z!==n.isValid?{}:{name:R},...t.resolver||!R?{isValid:z}:{},errors:n.errors}),M.shouldFocus&&!J&&zo(r,W,R?G:a.mount),J},I=(R,M)=>{let z={...i.mount?o:s};return M&&(z=kv(M.dirtyFields?n.dirtyFields:n.touchedFields,z)),Fe(R)?z:Vt(R)?X(z,R):R.map(J=>X(z,J))},Y=(R,M)=>({invalid:!!X((M||n).errors,R),isDirty:!!X((M||n).dirtyFields,R),error:X((M||n).errors,R),isValidating:!!X(n.validatingFields,R),isTouched:!!X((M||n).touchedFields,R)}),K=R=>{R&&Fo(R).forEach(M=>Ye(n.errors,M)),h.state.next({errors:R?n.errors:{}})},Z=(R,M,z)=>{const J=(X(r,R,{_f:{}})._f||{}).ref,G=X(n.errors,R)||{},{ref:B,message:Q,type:ue,...ve}=G;ke(n.errors,R,{...ve,...M,ref:J}),h.state.next({name:R,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&J&&J.focus&&J.focus()},oe=(R,M)=>kt(R)?h.state.subscribe({next:z=>"values"in z&&R(j(void 0,M),z)}):j(R,M,!0),ce=R=>h.state.subscribe({next:M=>{SO(R.name,M.name,R.exact)&&wO(M,R.formState||d,Qn,R.reRenderRoot)&&R.callback({values:{...o},...n,...M,defaultValues:s})}}).unsubscribe,V=R=>(i.mount=!0,f={...f,...R.formState},ce({...R,formState:{...u,...R.formState}})),ee=(R,M={})=>{for(const z of R?Fo(R):a.mount)a.mount.delete(z),a.array.delete(z),M.keepValue||(Ye(r,z),Ye(o,z)),!M.keepError&&Ye(n.errors,z),!M.keepDirty&&Ye(n.dirtyFields,z),!M.keepTouched&&Ye(n.touchedFields,z),!M.keepIsValidating&&Ye(n.validatingFields,z),!t.shouldUnregister&&!M.keepDefaultValue&&Ye(s,z);h.state.next({values:Ge(o)}),h.state.next({...n,...M.keepDirty?{isDirty:A()}:{}}),!M.keepIsValid&&y()},me=({disabled:R,name:M})=>{if(zt(R)&&i.mount||R||a.disabled.has(M)){const G=a.disabled.has(M)!==!!R;R?a.disabled.add(M):a.disabled.delete(M),G&&i.mount&&!i.action&&y()}},le=(R,M={})=>{let z=X(r,R);const J=zt(M.disabled)||zt(t.disabled);return ke(r,R,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:R}},name:R,mount:!0,...M}}),a.mount.add(R),z?me({disabled:zt(M.disabled)?M.disabled:t.disabled,name:R}):S(R,!0,M.value),{...J?{disabled:M.disabled||t.disabled}:{},...t.progressive?{required:!!M.required,min:bo(M.min),max:bo(M.max),minLength:bo(M.minLength),maxLength:bo(M.maxLength),pattern:bo(M.pattern)}:{},name:R,onChange:F,onBlur:F,ref:G=>{if(G){le(R,M),z=X(r,R);const B=Fe(G.value)&&G.querySelectorAll&&G.querySelectorAll("input,select,textarea")[0]||G,Q=mO(B),ue=z._f.refs||[];if(Q?ue.find(ve=>ve===B):B===z._f.ref)return;ke(r,R,{_f:{...z._f,...Q?{refs:[...ue.filter(tu),B,...Array.isArray(X(s,R))?[{}]:[]],ref:{type:B.type,name:R}}:{ref:B}}}),S(R,!1,void 0,B)}else z=X(r,R,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||M.shouldUnregister)&&!(wv(a.array,R)&&i.action)&&a.unMount.add(R)}}},fe=()=>t.shouldFocusError&&zo(r,W,a.mount),ge=R=>{zt(R)&&(h.state.next({disabled:R}),zo(r,(M,z)=>{const J=X(r,z);J&&(M.disabled=J._f.disabled||R,Array.isArray(J._f.refs)&&J._f.refs.forEach(G=>{G.disabled=J._f.disabled||R}))},0,!1))},Ze=(R,M)=>async z=>{let J;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let G=Ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:Q}=await E();b(),n.errors=B,G=Ge(Q)}else await O(r);if(a.disabled.size)for(const B of a.disabled)Ye(G,B);if(Ye(n.errors,"root"),Et(n.errors)){h.state.next({errors:{}});try{await R(G,z)}catch(B){J=B}}else M&&await M({...n.errors},z),fe(),setTimeout(fe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Et(n.errors)&&!J,submitCount:n.submitCount+1,errors:n.errors}),J)throw J},_t=(R,M={})=>{X(r,R)&&(Fe(M.defaultValue)?H(R,Ge(X(s,R))):(H(R,M.defaultValue),ke(s,R,Ge(M.defaultValue))),M.keepTouched||Ye(n.touchedFields,R),M.keepDirty||(Ye(n.dirtyFields,R),n.isDirty=M.defaultValue?A(R,Ge(X(s,R))):A()),M.keepError||(Ye(n.errors,R),d.isValid&&y()),h.state.next({...n}))},rn=(R,M={})=>{const z=R?Ge(R):s,J=Ge(z),G=Et(R),B=G?s:J;if(M.keepDefaultValues||(s=z),!M.keepValues){if(M.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Es(s,o))]);for(const ue of Array.from(Q)){const ve=X(n.dirtyFields,ue),Ue=X(o,ue),bn=X(B,ue);ve&&!Fe(Ue)?ke(B,ue,Ue):!ve&&!Fe(bn)&&H(ue,bn)}}else{if(gf&&Fe(R))for(const Q of a.mount){const ue=X(r,Q);if(ue&&ue._f){const ve=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(tc(ve)){const Ue=ve.closest("form");if(Ue){Ue.reset();break}}}}if(M.keepFieldsRef)for(const Q of a.mount)H(Q,X(B,Q));else r={}}o=t.shouldUnregister?M.keepDefaultValues?Ge(s):{}:Ge(B),h.array.next({values:{...B}}),h.state.next({values:{...B}})}a={mount:M.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!M.keepIsValid||!!M.keepDirtyValues||!t.shouldUnregister&&!Et(B),i.watch=!!t.shouldUnregister,i.keepIsValid=!!M.keepIsValid,i.action=!1,M.keepErrors||(n.errors={}),h.state.next({submitCount:M.keepSubmitCount?n.submitCount:0,isDirty:G?!1:M.keepDirty?n.isDirty:!!(M.keepDefaultValues&&!dn(R,s)),isSubmitted:M.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:G?{}:M.keepDirtyValues?M.keepDefaultValues&&o?Es(s,o):n.dirtyFields:M.keepDefaultValues&&R?Es(s,R):M.keepDirty?n.dirtyFields:{},touchedFields:M.keepTouched?n.touchedFields:{},errors:M.keepErrors?n.errors:{},isSubmitSuccessful:M.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},qt=(R,M)=>rn(kt(R)?R(o):R,{...t.resetOptions,...M}),st=(R,M={})=>{const z=X(r,R),J=z&&z._f;if(J){const G=J.refs?J.refs[0]:J.ref;G.focus&&setTimeout(()=>{G.focus(),M.shouldSelect&&kt(G.select)&&G.select()})}},Qn=R=>{n={...n,...R}},ps={control:{register:le,unregister:ee,getFieldState:Y,handleSubmit:Ze,setError:Z,_subscribe:ce,_runSchema:E,_updateIsValidating:b,_focusError:fe,_getWatch:j,_getDirty:A,_setValid:y,_setFieldArray:x,_setDisabledField:me,_setErrors:w,_getFieldArray:$,_reset:rn,_resetDefaultValues:()=>kt(t.defaultValues)&&t.defaultValues().then(R=>{qt(R,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:ge,_subjects:h,_proxyFormState:d,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(R){i=R},get _defaultValues(){return s},get _names(){return a},set _names(R){a=R},get _formState(){return n},get _options(){return t},set _options(R){t={...t,...R}}},subscribe:V,trigger:se,register:le,handleSubmit:Ze,watch:oe,setValue:H,getValues:I,reset:qt,resetField:_t,clearErrors:K,unregister:ee,setError:Z,setFocus:st,getFieldState:Y};return{...ps,formControl:ps}}function Cf(e={}){const t=T.useRef(void 0),n=T.useRef(void 0),[r,s]=T.useState({isDirty:!1,isValidating:!1,isLoading:kt(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:kt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!kt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=PO(e);t.current={...a,formState:r}}const o=t.current.control;return o._options=e,_f(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),T.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),T.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),T.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),T.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),T.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),T.useEffect(()=>{var i;e.values&&!dn(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),T.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=T.useMemo(()=>Sv(r,o),[o,r]),t.current}function Mv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Mv(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rf(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Mv(e))&&(r&&(r+=" "),r+=t);return r}const OO=(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},TO=(e,t)=>({classGroupId:e,validator:t}),Av=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rc="-",um=[],MO="arbitrary..",AO=e=>{const t=DO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return NO(i);const a=i.split(rc),c=a[0]===""&&a.length>1?1:0;return Nv(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],l=n[i];return c?l?OO(l,c):c:l||um}return n[i]||um}}},Nv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const l=Nv(e,t+1,o);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(rc):e.slice(t).join(rc),c=i.length;for(let l=0;l<c;l++){const u=i[l];if(u.validator(a))return u.classGroupId}},NO=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?MO+r:void 0})(),DO=e=>{const{theme:t,classGroups:n}=e;return IO(n,t)},IO=(e,t)=>{const n=Av();for(const r in e){const s=e[r];Pf(s,n,r,t)}return n},Pf=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];jO(i,t,n,r)}},jO=(e,t,n,r)=>{if(typeof e=="string"){LO(e,t,n);return}if(typeof e=="function"){FO(e,t,n,r);return}zO(e,t,n,r)},LO=(e,t,n)=>{const r=e===""?t:Dv(t,e);r.classGroupId=n},FO=(e,t,n,r)=>{if($O(e)){Pf(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(TO(n,e))},zO=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];Pf(c,Dv(t,a),n,r)}},Dv=(e,t)=>{let n=e;const r=t.split(rc),s=r.length;for(let o=0;o<s;o++){const i=r[o];let a=n.nextPart.get(i);a||(a=Av(),n.nextPart.set(i,a)),n=a}return n},$O=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},ad="!",dm=":",BO=[],fm=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),UO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,c=0,l;const u=s.length;for(let m=0;m<u;m++){const y=s[m];if(i===0&&a===0){if(y===dm){o.push(s.slice(c,m)),c=m+1;continue}if(y==="/"){l=m;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const d=o.length===0?s:s.slice(c);let f=d,h=!1;d.endsWith(ad)?(f=d.slice(0,-1),h=!0):d.startsWith(ad)&&(f=d.slice(1),h=!0);const p=l&&l>c?l-c:void 0;return fm(o,h,f,p)};if(t){const s=t+dm,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):fm(BO,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},WO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],a=i[0]==="[",c=t.has(i);a||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},HO=e=>({cache:VO(e.cacheSize),parseClassName:UO(e),sortModifiers:WO(e),...AO(e)}),qO=/\s+/,KO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(qO);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let y=!!m,b=r(y?p.substring(0,m):p);if(!b){if(!y){c=u+(c.length>0?" "+c:c);continue}if(b=r(p),!b){c=u+(c.length>0?" "+c:c);continue}y=!1}const x=f.length===0?"":f.length===1?f[0]:o(f).join(":"),_=h?x+ad:x,w=_+b;if(i.indexOf(w)>-1)continue;i.push(w);const S=s(b,y);for(let C=0;C<S.length;++C){const k=S[C];i.push(_+k)}c=u+(c.length>0?" "+c:c)}return c},ZO=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Iv(n))&&(s&&(s+=" "),s+=r);return s},Iv=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Iv(e[r]))&&(n&&(n+=" "),n+=t);return n},GO=(e,...t)=>{let n,r,s,o;const i=c=>{const l=t.reduce((u,d)=>d(u),e());return n=HO(l),r=n.cache.get,s=n.cache.set,o=a,a(c)},a=c=>{const l=r(c);if(l)return l;const u=KO(c,n);return s(c,u),u};return o=i,(...c)=>o(ZO(...c))},YO=[],tt=e=>{const t=n=>n[e]||YO;return t.isThemeGetter=!0,t},jv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,XO=/^\d+\/\d+$/,JO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QO=/\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$/,eT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=e=>XO.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),er=e=>!!e&&Number.isInteger(Number(e)),nu=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Dn=e=>JO.test(e),rT=()=>!0,sT=e=>QO.test(e)&&!eT.test(e),Fv=()=>!1,oT=e=>tT.test(e),iT=e=>nT.test(e),aT=e=>!te(e)&&!ne(e),cT=e=>eo(e,Vv,Fv),te=e=>jv.test(e),Tr=e=>eo(e,Bv,sT),ru=e=>eo(e,hT,pe),hm=e=>eo(e,zv,Fv),lT=e=>eo(e,$v,iT),qi=e=>eo(e,Uv,oT),ne=e=>Lv.test(e),vo=e=>to(e,Bv),uT=e=>to(e,pT),pm=e=>to(e,zv),dT=e=>to(e,Vv),fT=e=>to(e,$v),Ki=e=>to(e,Uv,!0),eo=(e,t,n)=>{const r=jv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},to=(e,t,n=!1)=>{const r=Lv.exec(e);return r?r[1]?t(r[1]):n:!1},zv=e=>e==="position"||e==="percentage",$v=e=>e==="image"||e==="url",Vv=e=>e==="length"||e==="size"||e==="bg-size",Bv=e=>e==="length",hT=e=>e==="number",pT=e=>e==="family-name",Uv=e=>e==="shadow",mT=()=>{const e=tt("color"),t=tt("font"),n=tt("text"),r=tt("font-weight"),s=tt("tracking"),o=tt("leading"),i=tt("breakpoint"),a=tt("container"),c=tt("spacing"),l=tt("radius"),u=tt("shadow"),d=tt("inset-shadow"),f=tt("text-shadow"),h=tt("drop-shadow"),p=tt("blur"),m=tt("perspective"),y=tt("aspect"),b=tt("ease"),x=tt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...w(),ne,te],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],E=()=>[ne,te,c],P=()=>[ys,"full","auto",...E()],O=()=>[er,"none","subgrid",ne,te],N=()=>["auto",{span:["full",er,ne,te]},er,ne,te],A=()=>[er,"auto",ne,te],j=()=>["auto","min","max","fr",ne,te],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...E()],H=()=>[ys,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],F=()=>[e,ne,te],W=()=>[...w(),pm,hm,{position:[ne,te]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",dT,cT,{size:[ne,te]}],Y=()=>[nu,vo,Tr],K=()=>["","none","full",l,ne,te],Z=()=>["",pe,vo,Tr],oe=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[pe,nu,pm,hm],ee=()=>["","none",p,ne,te],me=()=>["none",pe,ne,te],le=()=>["none",pe,ne,te],fe=()=>[pe,ne,te],ge=()=>[ys,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dn],breakpoint:[Dn],color:[rT],container:[Dn],"drop-shadow":[Dn],ease:["in","out","in-out"],font:[aT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dn],shadow:[Dn],spacing:["px",pe],text:[Dn],"text-shadow":[Dn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ys,te,ne,y]}],container:["container"],columns:[{columns:[pe,te,ne,a]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[er,"auto",ne,te]}],basis:[{basis:[ys,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,ys,"auto","initial","none",te]}],grow:[{grow:["",pe,ne,te]}],shrink:[{shrink:["",pe,ne,te]}],order:[{order:[er,"first","last","none",ne,te]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[a,"screen",...H()]}],"min-w":[{"min-w":[a,"screen","none",...H()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,vo,Tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ne,ru]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nu,te]}],"font-family":[{font:[uT,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ne,te]}],"line-clamp":[{"line-clamp":[pe,"none",ne,ru]}],leading:[{leading:[o,...E()]}],"list-image":[{"list-image":["none",ne,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,te]}],"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:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",ne,Tr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[pe,"auto",ne,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,te]}],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",ne,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},er,ne,te],radial:["",ne,te],conic:[er,ne,te]},fT,lT]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"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-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:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,ne,te]}],"outline-w":[{outline:["",pe,vo,Tr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",u,Ki,qi]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",d,Ki,qi]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[pe,Tr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",f,Ki,qi]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[pe,ne,te]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ne,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"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:W()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,te]}],filter:[{filter:["","none",ne,te]}],blur:[{blur:ee()}],brightness:[{brightness:[pe,ne,te]}],contrast:[{contrast:[pe,ne,te]}],"drop-shadow":[{"drop-shadow":["","none",h,Ki,qi]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",pe,ne,te]}],"hue-rotate":[{"hue-rotate":[pe,ne,te]}],invert:[{invert:["",pe,ne,te]}],saturate:[{saturate:[pe,ne,te]}],sepia:[{sepia:["",pe,ne,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,te]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[pe,ne,te]}],"backdrop-contrast":[{"backdrop-contrast":[pe,ne,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,ne,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,ne,te]}],"backdrop-invert":[{"backdrop-invert":["",pe,ne,te]}],"backdrop-opacity":[{"backdrop-opacity":[pe,ne,te]}],"backdrop-saturate":[{"backdrop-saturate":[pe,ne,te]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,ne,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ne,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",ne,te]}],ease:[{ease:["linear","initial",b,ne,te]}],delay:[{delay:[pe,ne,te]}],animate:[{animate:["none",x,ne,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ne,te]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[ne,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"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",ne,te]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",ne,te]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[pe,vo,Tr,ru]}],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","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Wv=GO(mT);function Of(...e){return Wv(Rf(e))}function Yo(e){return g.jsx("div",{...e,className:Of("rounded-2xl border bg-white shadow-sm",e.className)})}function Xo(e){return g.jsx("div",{...e,className:Of("border-b px-4 py-3",e.className)})}function Jo(e){return g.jsx("div",{...e,className:Of("px-4 py-3",e.className)})}function gT(){const e=ls(),t=Wc(),{register:n,handleSubmit:r,formState:s}=Cf({defaultValues:{email:"admin@example.com",password:"ChangeMe123!"}}),o=r(async i=>{try{const a=await Te.post("/auth/login",i);t.setAuth(a.data.token,a.data.user.email),Ee.success("Logged in"),e({to:"/"})}catch(a){Ee.error(a?.response?.data?.detail??"Login failed")}});return g.jsx("div",{className:"mx-auto max-w-md",children:g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Login"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"Use the admin credentials from your backend env."})]}),g.jsx(Jo,{children:g.jsxs("form",{onSubmit:o,className:"space-y-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Email"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("email",{required:!0})})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm text-neutral-700",children:"Password"}),g.jsx("input",{type:"password",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("password",{required:!0})})]}),g.jsx("button",{disabled:s.isSubmitting,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:s.isSubmitting?"Signing in...":"Sign in"})]})})]})})}function yT(){return g.jsx("div",{className:"flex-1 bg-neutral-50 p-6 dark:bg-neutral-900/40",children:g.jsx(of,{})})}const Hv=()=>ZC(),qv=XC;function lt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bT=typeof Symbol=="function"&&Symbol.observable||"@@observable",mm=bT,su=()=>Math.random().toString(36).substring(7).split("").join("."),vT={INIT:`@@redux/INIT${su()}`,REPLACE:`@@redux/REPLACE${su()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${su()}`},Kr=vT;function wi(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function xT(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(ST(e))return"date";if(wT(e))return"error";const n=_T(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function _T(e){return typeof e.constructor=="function"?e.constructor.name:null}function wT(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ST(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function tr(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=xT(e)),t}function Kv(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?lt(2):`Expected the root reducer to be a function. Instead, received: '${tr(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?lt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?lt(1):`Expected the enhancer to be a function. Instead, received: '${tr(n)}'`);return n(Kv)(e,t)}let r=e,s=t,o=new Map,i=o,a=0,c=!1;function l(){i===o&&(i=new Map,o.forEach((y,b)=>{i.set(b,y)}))}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function d(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(4):`Expected the listener to be a function. Instead, received: '${tr(y)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let b=!0;l();const x=a++;return i.set(x,y),function(){if(b){if(c)throw new Error(process.env.NODE_ENV==="production"?lt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,l(),i.delete(x),o=null}}}function f(y){if(!wi(y))throw new Error(process.env.NODE_ENV==="production"?lt(7):`Actions must be plain objects. Instead, the actual type was: '${tr(y)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof y.type>"u")throw new Error(process.env.NODE_ENV==="production"?lt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof y.type!="string")throw new Error(process.env.NODE_ENV==="production"?lt(17):`Action "type" property must be a string. Instead, the actual type was: '${tr(y.type)}'. Value was: '${y.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?lt(9):"Reducers may not dispatch actions.");try{c=!0,s=r(s,y)}finally{c=!1}return(o=i).forEach(x=>{x()}),y}function h(y){if(typeof y!="function")throw new Error(process.env.NODE_ENV==="production"?lt(10):`Expected the nextReducer to be a function. Instead, received: '${tr(y)}`);r=y,f({type:Kr.REPLACE})}function p(){const y=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(process.env.NODE_ENV==="production"?lt(11):`Expected the observer to be an object. Instead, received: '${tr(b)}'`);function x(){const w=b;w.next&&w.next(u())}return x(),{unsubscribe:y(x)}},[mm](){return this}}}return f({type:Kr.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[mm]:p}}function gm(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ET(e,t,n,r){const s=Object.keys(t),o=n&&n.type===Kr.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!wi(e))return`The ${o} has unexpected type of "${tr(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Kr.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function kT(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Kr.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?lt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Kr.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function CT(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&gm(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{kT(n)}catch(i){o=i}return function(a={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=ET(a,n,c,s);d&&gm(d)}let l=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],h=n[f],p=a[f],m=h(p,c);if(typeof m>"u"){const y=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?lt(14):`When called with an action of type ${y?`"${String(y)}"`:"(unknown type)"}, the slice reducer for key "${f}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[f]=m,l=l||m!==p}return l=l||r.length!==Object.keys(a).length,l?u:a}}function sc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function RT(...e){return t=>(n,r)=>{const s=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?lt(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:s.getState,dispatch:(c,...l)=>o(c,...l)},a=e.map(c=>c(i));return o=sc(...a)(s.dispatch),{...s,dispatch:o}}}function Zv(e){return wi(e)&&"type"in e&&typeof e.type=="string"}var Gv=Symbol.for("immer-nothing"),ym=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state"),PT=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Bt(e,...t){if(process.env.NODE_ENV!=="production"){const n=PT[e],r=Lr(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ut=Object,Ks=Ut.getPrototypeOf,oc="constructor",qc="prototype",cd="configurable",ic="enumerable",Ta="writable",Qo="value",Kn=e=>!!e&&!!e[Ct];function hn(e){return e?Yv(e)||Zc(e)||!!e[ym]||!!e[oc]?.[ym]||Gc(e)||Yc(e):!1}var OT=Ut[qc][oc].toString(),bm=new WeakMap;function Yv(e){if(!e||!Tf(e))return!1;const t=Ks(e);if(t===null||t===Ut[qc])return!0;const n=Ut.hasOwnProperty.call(t,oc)&&t[oc];if(n===Object)return!0;if(!Lr(n))return!1;let r=bm.get(n);return r===void 0&&(r=Function.toString.call(n),bm.set(n,r)),r===OT}function Kc(e,t,n=!0){Si(e)===0?(n?Reflect.ownKeys(e):Ut.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function Si(e){const t=e[Ct];return t?t.type_:Zc(e)?1:Gc(e)?2:Yc(e)?3:0}var vm=(e,t,n=Si(e))=>n===2?e.has(t):Ut[qc].hasOwnProperty.call(e,t),ld=(e,t,n=Si(e))=>n===2?e.get(t):e[t],ac=(e,t,n,r=Si(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function TT(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Zc=Array.isArray,Gc=e=>e instanceof Map,Yc=e=>e instanceof Set,Tf=e=>typeof e=="object",Lr=e=>typeof e=="function",ou=e=>typeof e=="boolean";function MT(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var zn=e=>e.copy_||e.base_,Mf=e=>e.modified_?e.copy_:e.base_;function ud(e,t){if(Gc(e))return new Map(e);if(Yc(e))return new Set(e);if(Zc(e))return Array[qc].slice.call(e);const n=Yv(e);if(t===!0||t==="class_only"&&!n){const r=Ut.getOwnPropertyDescriptors(e);delete r[Ct];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){const i=s[o],a=r[i];a[Ta]===!1&&(a[Ta]=!0,a[cd]=!0),(a.get||a.set)&&(r[i]={[cd]:!0,[Ta]:!0,[ic]:a[ic],[Qo]:e[i]})}return Ut.create(Ks(e),r)}else{const r=Ks(e);if(r!==null&&n)return{...e};const s=Ut.create(r);return Ut.assign(s,e)}}function Af(e,t=!1){return Xc(e)||Kn(e)||!hn(e)||(Si(e)>1&&Ut.defineProperties(e,{set:Zi,add:Zi,clear:Zi,delete:Zi}),Ut.freeze(e),t&&Kc(e,(n,r)=>{Af(r,!0)},!1)),e}function AT(){Bt(2)}var Zi={[Qo]:AT};function Xc(e){return e===null||!Tf(e)?!0:Ut.isFrozen(e)}var cc="MapSet",dd="Patches",xm="ArrayMethods",Xv={};function es(e){const t=Xv[e];return t||Bt(0,e),t}var _m=e=>!!Xv[e],ei,Jv=()=>ei,NT=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_m(cc)?es(cc):void 0,arrayMethodsPlugin_:_m(xm)?es(xm):void 0});function wm(e,t){t&&(e.patchPlugin_=es(dd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fd(e){hd(e),e.drafts_.forEach(DT),e.drafts_=null}function hd(e){e===ei&&(ei=e.parent_)}var Sm=e=>ei=NT(ei,e);function DT(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Em(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ct].modified_&&(fd(t),Bt(4)),hn(e)&&(e=km(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[Ct].base_,e,t)}else e=km(t,n);return IT(t,e,!0),fd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Gv?e:void 0}function km(e,t){if(Xc(t))return t;const n=t[Ct];if(!n)return lc(t,e.handledSet_,e);if(!Jc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);tx(n,e)}return n.copy_}function IT(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Af(t,n)}function Qv(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Jc=(e,t)=>e.scope_===t,jT=[];function ex(e,t,n,r){const s=zn(e),o=e.type_;if(r!==void 0&&ld(s,r,o)===t){ac(s,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Kc(s,(c,l)=>{if(Kn(l)){const u=a.get(l)||[];u.push(c),a.set(l,u)}})}const i=e.draftLocations_.get(t)??jT;for(const a of i)ac(s,a,n,o)}function LT(e,t,n){e.callbacks_.push(function(s){const o=t;if(!o||!Jc(o,s))return;s.mapSetPlugin_?.fixSetContents(o);const i=Mf(o);ex(e,o.draft_??o,i,n),tx(o,s)})}function tx(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const s=r.getPath(e);s&&r.generatePatches_(e,s,t)}Qv(e)}}function FT(e,t,n){const{scope_:r}=e;if(Kn(n)){const s=n[Ct];Jc(s,r)&&s.callbacks_.push(function(){Ma(e);const i=Mf(s);ex(e,n,i,t)})}else hn(n)&&e.callbacks_.push(function(){const o=zn(e);e.type_===3?o.has(n)&&lc(n,r.handledSet_,r):ld(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&lc(ld(e.copy_,t,e.type_),r.handledSet_,r)})}function lc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Kn(e)||t.has(e)||!hn(e)||Xc(e)||(t.add(e),Kc(e,(r,s)=>{if(Kn(s)){const o=s[Ct];if(Jc(o,n)){const i=Mf(o);ac(e,r,i,e.type_),Qv(o)}}else hn(s)&&lc(s,t,n)})),e}function zT(e,t){const n=Zc(e),r={type_:n?1:0,scope_:t?t.scope_:Jv(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,o=uc;n&&(s=[r],o=ti);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,[a,r]}var uc={get(e,t){if(t===Ct)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const s=zn(e);if(!vm(s,t,e.type_))return $T(e,s,t);const o=s[t];if(e.finalized_||!hn(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&MT(t))return o;if(o===iu(e.base_,t)){Ma(e);const i=e.type_===1?+t:t,a=md(e.scope_,o,e,i);return e.copy_[i]=a}return o},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,n){const r=nx(zn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=iu(zn(e),t),o=s?.[Ct];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(TT(n,s)&&(n!==void 0||vm(e.base_,t,e.type_)))return!0;Ma(e),pd(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),FT(e,t,n)),!0},deleteProperty(e,t){return Ma(e),iu(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ta]:!0,[cd]:e.type_!==1||t!=="length",[ic]:r[ic],[Qo]:n[t]}},defineProperty(){Bt(11)},getPrototypeOf(e){return Ks(e.base_)},setPrototypeOf(){Bt(12)}},ti={};for(let e in uc){let t=uc[e];ti[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ti.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Bt(13),ti.set.call(this,e,t,void 0)};ti.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Bt(14),uc.set.call(this,e[0],t,n,e[0])};function iu(e,t){const n=e[Ct];return(n?zn(n):e)[t]}function $T(e,t,n){const r=nx(t,n);return r?Qo in r?r[Qo]:r.get?.call(e.draft_):void 0}function nx(e,t){if(!(t in e))return;let n=Ks(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ks(n)}}function pd(e){e.modified_||(e.modified_=!0,e.parent_&&pd(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=ud(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VT=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Lr(t)&&!Lr(n)){const o=n;n=t;const i=this;return function(c=o,...l){return i.produce(c,u=>n.call(this,u,...l))}}Lr(n)||Bt(6),r!==void 0&&!Lr(r)&&Bt(7);let s;if(hn(t)){const o=Sm(this),i=md(o,t,void 0);let a=!0;try{s=n(i),a=!1}finally{a?fd(o):hd(o)}return wm(o,r),Em(s,o)}else if(!t||!Tf(t)){if(s=n(t),s===void 0&&(s=t),s===Gv&&(s=void 0),this.autoFreeze_&&Af(s,!0),r){const o=[],i=[];es(dd).generateReplacementPatches_(t,s,{patches_:o,inversePatches_:i}),r(o,i)}return s}else Bt(1,t)},this.produceWithPatches=(t,n)=>{if(Lr(t))return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,s;return[this.produce(t,n,(i,a)=>{r=i,s=a}),r,s]},ou(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ou(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ou(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){hn(e)||Bt(8),Kn(e)&&(e=BT(e));const t=Sm(this),n=md(t,e,void 0);return n[Ct].isManual_=!0,hd(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&Bt(9);const{scope_:r}=n;return wm(r,t),Em(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=es(dd).applyPatches_;return Kn(e)?r(e,t):this.produce(e,s=>r(s,t))}};function md(e,t,n,r){const[s,o]=Gc(t)?es(cc).proxyMap_(t,n):Yc(t)?es(cc).proxySet_(t,n):zT(t,n);return(n?.scope_??Jv()).drafts_.push(s),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?LT(n,o,r):o.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:l}=c;o.modified_&&l&&l.generatePatches_(o,[],c)}),s}function BT(e){return Kn(e)||Bt(10,e),rx(e)}function rx(e){if(!hn(e)||Xc(e))return e;const t=e[Ct];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ud(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ud(e,!0);return Kc(n,(s,o)=>{ac(n,s,rx(o))},r),t&&(t.finalized_=!1),n}var UT=new VT,sx=UT.produce;function ox(e){return({dispatch:n,getState:r})=>s=>o=>typeof o=="function"?o(n,r,e):s(o)}var WT=ox(),HT=ox,qT=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?sc:sc.apply(null,arguments)},ix=e=>e&&typeof e.match=="function";function $o(e,t){function n(...r){if(t){let s=t(...r);if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(0):"prepareAction did not return an object");return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Zv(r)&&r.type===e,n}function KT(e){return typeof e=="function"&&"type"in e&&ix(e)}function ZT(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
|
|
14
|
+
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function GT(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=KT}=e;return()=>n=>r=>(t(r)&&console.warn(ZT(r.type)),n(r))}function ax(e,t){let n=0;return{measureTime(r){const s=Date.now();try{return r()}finally{const o=Date.now();n+=o-s}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
|
|
15
15
|
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
|
|
16
|
-
It is disabled in production builds, so you don't need to worry about that.`)}}}var
|
|
16
|
+
It is disabled in production builds, so you don't need to worry about that.`)}}}var cx=class Ro extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ro.prototype)}static get[Symbol.species](){return Ro}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ro(...t[0].concat(this)):new Ro(...t.concat(this))}};function Cm(e){return hn(e)?sx(e,()=>{}):e}function Gi(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function YT(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function XT(e,t,n){const r=lx(e,t,n);return{detectMutations(){return ux(e,t,r,n)}}}function lx(e,t=[],n,r="",s=new Set){const o={value:n};if(!e(n)&&!s.has(n)){s.add(n),o.children={};const i=t.length>0;for(const a in n){const c=r?r+"."+a:a;i&&t.some(u=>u instanceof RegExp?u.test(c):c===u)||(o.children[a]=lx(e,t,n[a],c))}}return o}function ux(e,t=[],n,r,s=!1,o=""){const i=n?n.value:void 0,a=i===r;if(s&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:o};if(e(i)||e(r))return{wasMutated:!1};const c={};for(let u in n.children)c[u]=!0;for(let u in r)c[u]=!0;const l=t.length>0;for(let u in c){const d=o?o+"."+u:u;if(l&&t.some(p=>p instanceof RegExp?p.test(d):d===p))continue;const f=ux(e,t,n.children[u],r[u],a,d);if(f.wasMutated)return f}return{wasMutated:!1}}function JT(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(a,c,l,u){return JSON.stringify(a,n(c,u),l)},n=function(a,c){let l=[],u=[];return c||(c=function(d,f){return l[0]===f?"[Circular ~]":"[Circular ~."+u.slice(0,l.indexOf(f)).join(".")+"]"}),function(d,f){if(l.length>0){var h=l.indexOf(this);~h?l.splice(h+1):l.push(this),~h?u.splice(h,1/0,d):u.push(d),~l.indexOf(f)&&(f=c.call(this,d,f))}else l.push(f);return a==null?f:a.call(this,d,f)}},{isImmutable:r=YT,ignoredPaths:s,warnAfter:o=32}=e;const i=XT.bind(null,r,s);return({getState:a})=>{let c=a(),l=i(c),u;return d=>f=>{const h=ax(o,"ImmutableStateInvariantMiddleware");h.measureTime(()=>{if(c=a(),u=l.detectMutations(),l=i(c),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Oe(19):`A state mutation was detected between dispatches, in the path '${u.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const p=d(f);return h.measureTime(()=>{if(c=a(),u=l.detectMutations(),l=i(c),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?Oe(20):`A state mutation was detected inside a dispatch, in the path: ${u.path||""}. Take a look at the reducer(s) handling the action ${t(f)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),h.warnIfExceeded(),p}}}}function dx(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||wi(e)}function gd(e,t="",n=dx,r,s=[],o){let i;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o?.has(e))return!1;const a=r!=null?r(e):Object.entries(e),c=s.length>0;for(const[l,u]of a){const d=t?t+"."+l:l;if(!(c&&s.some(h=>h instanceof RegExp?h.test(d):d===h))){if(!n(u))return{keyPath:d,value:u};if(typeof u=="object"&&(i=gd(u,d,n,r,s,o),i))return i}}return o&&fx(e)&&o.add(e),!1}function fx(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!fx(t))return!1;return!0}function QT(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=dx,getEntries:n,ignoredActions:r=[],ignoredActionPaths:s=["meta.arg","meta.baseQueryMeta"],ignoredPaths:o=[],warnAfter:i=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:l=!1}=e,u=!l&&WeakSet?new WeakSet:void 0;return d=>f=>h=>{if(!Zv(h))return f(h);const p=f(h),m=ax(i,"SerializableStateInvariantMiddleware");return!c&&!(r.length&&r.indexOf(h.type)!==-1)&&m.measureTime(()=>{const y=gd(h,"",t,n,s,u);if(y){const{keyPath:b,value:x}=y;console.error(`A non-serializable value was detected in an action, in the path: \`${b}\`. Value:`,x,`
|
|
17
17
|
Take a look at the logic that dispatched this action: `,h,`
|
|
18
18
|
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
|
|
19
19
|
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(m.measureTime(()=>{const y=d.getState(),b=gd(y,"",t,n,o,u);if(b){const{keyPath:x,value:_}=b;console.error(`A non-serializable value was detected in the state, in the path: \`${x}\`. Value:`,_,`
|
|
20
20
|
Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
21
|
-
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),m.warnIfExceeded()),p}}}function Yi(e){return typeof e=="boolean"}var QT=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:o=!0}=t??{};let i=new ax;if(n&&(Yi(n)?i.push(UT):i.push(WT(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Yi(r)||(a=r),i.unshift(XT(a))}if(s){let a={};Yi(s)||(a=s),i.push(JT(a))}if(o){let a={};Yi(o)||(a=o),i.unshift(ZT(a))}}return i},eM="RTK_autoBatch",Rm=e=>t=>{setTimeout(t,e)},tM=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rm(10):e.type==="callback"?e.queueNotification:Rm(e.timeout),l=()=>{i=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>s&&u(),f=r.subscribe(d);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){try{return s=!u?.meta?.[eM],o=!s,o&&(i||(i=!0,c(l))),r.dispatch(u)}finally{s=!0}}})},nM=e=>function(n){const{autoBatch:r=!0}=n??{};let s=new ax(e);return r&&s.push(tM(typeof r=="object"?r:void 0)),s};function rM(e){const t=QT(),{reducer:n=void 0,middleware:r,devTools:s=!0,duplicateMiddlewareCheck:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(wi(n))c=kT(n);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let m=new Set;l.forEach(y=>{if(m.has(y))throw new Error(process.env.NODE_ENV==="production"?Oe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");m.add(y)})}let u=sc;s&&(u=HT({trace:process.env.NODE_ENV!=="production",...typeof s=="object"&&s}));const d=CT(...l),f=nM(d);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let h=typeof a=="function"?a(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!h.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=u(...h);return qv(c,i,p)}function fx(e){const t={},n=[];let r;const s={addCase(o,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof o=="string"?o:o.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,s},addAsyncThunk(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return i.pending&&(t[o.pending.type]=i.pending),i.rejected&&(t[o.rejected.type]=i.rejected),i.fulfilled&&(t[o.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:o.settled,reducer:i.settled}),s},addMatcher(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:i}),s},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return r=o,s}};return e(s),[t,n,r]}function sM(e){return typeof e=="function"}function oM(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,s]=fx(t),o;if(sM(e))o=()=>Cm(e());else{const a=Cm(e);o=()=>a}function i(a=o(),c){let l=[n[c.type],...r.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[s]),l.reduce((u,d)=>{if(d)if(Kn(u)){const h=d(u,c);return h===void 0?u:h}else{if(hn(u))return rx(u,f=>d(f,c));{const f=d(u,c);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},a)}return i.getInitialState=o,i}var iM=(e,t)=>ox(e)?e.match(t):e(t);function aM(...e){return t=>e.some(n=>iM(n,t))}var cM="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lM=(e=21)=>{let t="",n=e;for(;n--;)t+=cM[Math.random()*64|0];return t},uM=["name","message","stack","code"],au=class{constructor(e,t){this.payload=e,this.meta=t}_type},Pm=class{constructor(e,t){this.payload=e,this.meta=t}_type},dM=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of uM)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Om="External signal was aborted",xr=(()=>{function e(t,n,r){const s=$o(t+"/fulfilled",(c,l,u,d)=>({payload:c,meta:{...d||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),o=$o(t+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),i=$o(t+"/rejected",(c,l,u,d,f)=>({payload:d,error:(r&&r.serializeError||dM)(c||"Rejected"),meta:{...f||{},arg:u,requestId:l,rejectedWithValue:!!d,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function a(c,{signal:l}={}){return(u,d,f)=>{const h=r?.idGenerator?r.idGenerator(c):lM(),p=new AbortController;let m,y;function b(_){y=_,p.abort()}l&&(l.aborted?b(Om):l.addEventListener("abort",()=>b(Om),{once:!0}));const x=(async function(){let _;try{let S=r?.condition?.(c,{getState:d,extra:f});if(hM(S)&&(S=await S),S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const C=new Promise((k,E)=>{m=()=>{E({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",m,{once:!0})});u(o(h,c,r?.getPendingMeta?.({requestId:h,arg:c},{getState:d,extra:f}))),_=await Promise.race([C,Promise.resolve(n(c,{dispatch:u,getState:d,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:(k,E)=>new au(k,E),fulfillWithValue:(k,E)=>new Pm(k,E)})).then(k=>{if(k instanceof au)throw k;return k instanceof Pm?s(k.payload,h,c,k.meta):s(k,h,c)})])}catch(S){_=S instanceof au?i(null,h,c,S.payload,S.meta):i(S,h,c)}finally{m&&p.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&i.match(_)&&_.meta.condition||u(_),_})();return Object.assign(x,{abort:b,requestId:h,arg:c,unwrap(){return x.then(fM)}})}}return Object.assign(a,{pending:o,rejected:i,fulfilled:s,settled:aM(i,s),typePrefix:t})}return e.withTypes=()=>e,e})();function fM(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function hM(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pM=Symbol.for("rtk-slice-createasyncthunk");function mM(e,t){return`${e}/${t}`}function gM({creators:e}={}){const t=e?.asyncThunk?.[pM];return function(r){const{name:s,reducerPath:o=s}=r;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const i=(typeof r.reducers=="function"?r.reducers(vM()):r.reducers)||{},a=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(_,w){const S=typeof _=="string"?_:_.type;if(!S)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(S in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+S);return c.sliceCaseReducersByType[S]=w,l},addMatcher(_,w){return c.sliceMatchers.push({matcher:_,reducer:w}),l},exposeAction(_,w){return c.actionCreators[_]=w,l},exposeCaseReducer(_,w){return c.sliceCaseReducersByName[_]=w,l}};a.forEach(_=>{const w=i[_],S={reducerName:_,type:mM(s,_),createNotation:typeof r.reducers=="function"};_M(w)?SM(S,w,l,t):xM(S,w,l)});function u(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[_={},w=[],S=void 0]=typeof r.extraReducers=="function"?fx(r.extraReducers):[r.extraReducers],C={..._,...c.sliceCaseReducersByType};return oM(r.initialState,k=>{for(let E in C)k.addCase(E,C[E]);for(let E of c.sliceMatchers)k.addMatcher(E.matcher,E.reducer);for(let E of w)k.addMatcher(E.matcher,E.reducer);S&&k.addDefaultCase(S)})}const d=_=>_,f=new Map,h=new WeakMap;let p;function m(_,w){return p||(p=u()),p(_,w)}function y(){return p||(p=u()),p.getInitialState()}function b(_,w=!1){function S(k){let E=k[_];if(typeof E>"u"){if(w)E=Gi(h,S,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return E}function C(k=d){const E=Gi(f,w,()=>new WeakMap);return Gi(E,k,()=>{const P={};for(const[O,N]of Object.entries(r.selectors??{}))P[O]=yM(N,k,()=>Gi(h,k,y),w);return P})}return{reducerPath:_,getSelectors:C,get selectors(){return C(S)},selectSlice:S}}const x={name:s,reducer:m,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(_,{reducerPath:w,...S}={}){const C=w??o;return _.inject({reducerPath:C,reducer:m},S),{...x,...b(C,!0)}}};return x}}function yM(e,t,n,r){function s(o,...i){let a=t(o);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return s.unwrapped=e,s}var bM=gM();function vM(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function xM({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!wM(r))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?$o(e,i):$o(e))}function _M(e){return e._reducerDefinitionType==="asyncThunk"}function wM(e){return e._reducerDefinitionType==="reducerWithPrepare"}function SM({type:e,reducerName:t},n,r,s){if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:i,pending:a,rejected:c,settled:l,options:u}=n,d=s(e,o,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Xi,pending:a||Xi,rejected:c||Xi,settled:l||Xi})}function Xi(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const _r={getSummary:(e=60)=>Te.get(`/monitors/summary?bars=${e}`).then(t=>t.data.rows),getList:()=>Te.get("/monitors").then(e=>e.data.monitors),getResults:(e,t=180)=>Te.get(`/monitors/${e}/results?limit=${t}`).then(n=>n.data.results),create:e=>Te.post("/monitors",e).then(t=>t.data),update:(e,t)=>Te.put(`/monitors/${e}`,t).then(n=>n.data),delete:e=>Te.delete(`/monitors/${e}`).then(t=>t.data),togglePause:(e,t)=>Te.post(`/monitors/${e}/pause`,{paused:t}).then(n=>n.data)},EM={data:[],list:[],current:null,currentResults:[],loading:!1,error:null,actionLoading:!1},Aa=xr("monitors/fetchResults",async(e,{rejectWithValue:t})=>{try{return await _r.getResults(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch results")}}),Ur=xr("monitors/fetchSummary",async(e=60,{rejectWithValue:t})=>{try{return await _r.getSummary(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch summary")}}),Na=xr("monitors/fetchAll",async(e,{rejectWithValue:t})=>{try{return await _r.getList()}catch(n){return t(n.response?.data?.message||"Failed to fetch monitors")}}),ks=xr("monitors/fetchOne",async(e,{rejectWithValue:t})=>{try{const r=(await _r.getList()).find(s=>s.id===e);if(!r)throw new Error("Monitor not found");return r}catch(n){return t(n.message||n.response?.data?.message||"Failed to fetch monitor")}}),dc=xr("monitors/pause",async({id:e,paused:t},{rejectWithValue:n})=>{try{return await _r.togglePause(e,t),{id:e,paused:t}}catch(r){return n(r.response?.data?.message||"Failed to toggle pause")}}),Nf=xr("monitors/delete",async(e,{rejectWithValue:t})=>{try{return await _r.delete(e),e}catch(n){return t(n.response?.data?.message||"Failed to delete monitor")}}),hx=xr("monitors/create",async(e,{rejectWithValue:t})=>{try{return await _r.create(e)}catch(n){return t(n.response?.data?.message||"Failed to create monitor")}}),Df=xr("monitors/update",async({id:e,data:t},{rejectWithValue:n})=>{try{return await _r.update(e,t)}catch(r){return n(r.response?.data?.message||"Failed to update monitor")}}),px=bM({name:"monitors",initialState:EM,reducers:{clearError:e=>{e.error=null},setCurrentMonitor:(e,t)=>{e.current=t.payload}},extraReducers:e=>{e.addCase(Ur.pending,t=>{t.loading=!0,t.error=null}),e.addCase(Ur.fulfilled,(t,n)=>{t.loading=!1,t.data=n.payload}),e.addCase(Ur.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(Na.pending,t=>{t.loading=!0}),e.addCase(Na.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}),e.addCase(Na.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(ks.pending,t=>{t.loading=!0}),e.addCase(ks.fulfilled,(t,n)=>{t.loading=!1,t.current=n.payload}),e.addCase(Aa.fulfilled,(t,n)=>{t.currentResults=n.payload}),e.addCase(dc.pending,t=>{t.actionLoading=!0}),e.addCase(dc.fulfilled,(t,n)=>{t.actionLoading=!1;const r=t.data.find(o=>o.monitor.id===n.payload.id);r&&(r.monitor.isPaused=n.payload.paused);const s=t.list.find(o=>o.id===n.payload.id);s&&(s.isPaused=n.payload.paused),t.current?.id===n.payload.id&&(t.current.isPaused=n.payload.paused)}),e.addCase(Nf.fulfilled,(t,n)=>{t.data=t.data.filter(r=>r.monitor.id!==n.payload),t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}),e.addCase(hx.fulfilled,(t,n)=>{t.list.push(n.payload.monitor)}),e.addCase(Df.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.monitor.id);r!==-1&&(t.list[r]=n.payload.monitor);const s=t.data.findIndex(o=>o.monitor.id===n.payload.monitor.id);s!==-1&&(t.data[s].monitor=n.payload.monitor),t.current?.id===n.payload.monitor.id&&(t.current=n.payload.monitor)})}}),{clearError:qH,setCurrentMonitor:KH}=px.actions,kM=px.reducer;const CM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),RM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Tm=e=>{const t=RM(e);return t.charAt(0).toUpperCase()+t.slice(1)},mx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),PM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var OM={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 TM=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>T.createElement("svg",{ref:c,...OM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:mx("lucide",s),...!o&&!PM(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>T.createElement(l,u)),...Array.isArray(o)?o:[o]]));const Ke=(e,t)=>{const n=T.forwardRef(({className:r,...s},o)=>T.createElement(TM,{ref:o,iconNode:t,className:mx(`lucide-${CM(Tm(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Tm(e),n};const MM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],cu=Ke("activity",MM);const AM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],gx=Ke("arrow-left",AM);const NM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yx=Ke("check",NM);const DM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bx=Ke("chevron-down",DM);const IM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jM=Ke("chevron-up",IM);const LM=[["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"}]],vx=Ke("copy",LM);const FM=[["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"}]],zM=Ke("database",FM);const $M=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],VM=Ke("ellipsis",$M);const BM=[["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"}]],UM=Ke("globe",BM);const WM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],If=Ke("loader-circle",WM);const HM=[["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"}]],qM=Ke("package",HM);const KM=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],xx=Ke("pause",KM);const ZM=[["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"}]],_x=Ke("pencil",ZM);const GM=[["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"}]],wx=Ke("play",GM);const YM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mm=Ke("plus",YM);const XM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Sx=Ke("search",XM);const JM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],QM=Ke("send",JM);const e1=[["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"}]],t1=Ke("server",e1);const n1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],r1=Ke("terminal",n1);const s1=[["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"}]],jf=Ke("trash-2",s1);const o1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],i1=Ke("x",o1);function Am(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yn(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Am(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Am(e[s],null)}}}}function Pe(...e){return v.useCallback(Yn(...e),e)}var a1=Symbol.for("react.lazy"),fc=v[" use ".trim().toString()];function c1(e){return typeof e=="object"&&e!==null&&"then"in e}function Ex(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===a1&&"_payload"in e&&c1(e._payload)}function kx(e){const t=l1(e),n=v.forwardRef((r,s)=>{let{children:o,...i}=r;Ex(o)&&typeof fc=="function"&&(o=fc(o._payload));const a=v.Children.toArray(o),c=a.find(d1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var Lf=kx("Slot");function l1(e){const t=v.forwardRef((n,r)=>{let{children:s,...o}=n;if(Ex(s)&&typeof fc=="function"&&(s=fc(s._payload)),v.isValidElement(s)){const i=h1(s),a=f1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u1=Symbol("radix.slottable");function d1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u1}function f1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function h1(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 Nm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dm=Cf,Cx=(e,t)=>n=>{var r;if(t?.variants==null)return Dm(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(l=>{const u=n?.[l],d=o?.[l];if(u===null)return null;const f=Nm(u)||Nm(d);return s[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...o,...a}[m]):{...o,...a}[m]===y})?[...l,d,f]:l},[]);return Dm(e,i,c,n?.class,n?.className)};function Se(...e){return Vv(Cf(e))}const p1=Cx("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 gt({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?Lf:"button";return g.jsx(o,{"data-slot":"button",className:Se(p1({variant:t,size:n,className:e})),...s})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function m1(e,t){const n=v.createContext(t),r=o=>{const{children:i,...a}=o,c=v.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function s(o){const i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function wr(e,t=[]){let n=[];function r(o,i){const a=v.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:f,children:h,...p}=d,m=f?.[e]?.[c]||a,y=v.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:y,children:h})};l.displayName=o+"Provider";function u(d,f){const h=f?.[e]?.[c]||a,p=v.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[l,u]}const s=()=>{const o=n.map(i=>v.createContext(i));return function(a){const c=a?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,g1(s,...t)]}function g1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var vt=globalThis?.document?v.useLayoutEffect:()=>{},y1=v[" useInsertionEffect ".trim().toString()]||vt;function Zs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=b1({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"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.`),u.current=a},[a,r])}const l=v.useCallback(u=>{if(a){const d=v1(u)?u(e):u;d!==e&&i.current?.(d)}else o(u)},[a,e,o,i]);return[c,l]}function b1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),s=v.useRef(n),o=v.useRef(t);return y1(()=>{o.current=t},[t]),v.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function v1(e){return typeof e=="function"}function x1(e){const t=_1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(S1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function _1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=k1(s),a=E1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var w1=Symbol("radix.slottable");function S1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===w1}function E1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function k1(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 C1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=C1.reduce((e,t)=>{const n=x1(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Rx(e,t){e&&Ic.flushSync(()=>e.dispatchEvent(t))}function Im(e){const t=R1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(O1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function R1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=M1(s),a=T1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var P1=Symbol("radix.slottable");function O1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===P1}function T1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function M1(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 Ff(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:b}=m,x=T.useRef(null),_=T.useRef(new Map).current;return g.jsx(s,{scope:y,itemMap:_,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",c=Im(a),l=T.forwardRef((m,y)=>{const{scope:b,children:x}=m,_=o(a,b),w=Pe(y,_.collectionRef);return g.jsx(c,{ref:w,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Im(u),h=T.forwardRef((m,y)=>{const{scope:b,children:x,..._}=m,w=T.useRef(null),S=Pe(y,w),C=o(u,b);return T.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>{C.itemMap.delete(w)})),g.jsx(f,{[d]:"",ref:S,children:x})});h.displayName=u;function p(m){const y=o(e+"CollectionConsumer",m);return T.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,k)=>_.indexOf(C.ref.current)-_.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},p,r]}var A1=v.createContext(void 0);function zf(e){const t=v.useContext(A1);return e||t||"ltr"}function On(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function N1(e,t=globalThis?.document){const n=On(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var D1="DismissableLayer",yd="dismissableLayer.update",I1="dismissableLayer.pointerDownOutside",j1="dismissableLayer.focusOutside",jm,Px=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,l=v.useContext(Px),[u,d]=v.useState(null),f=u?.ownerDocument??globalThis?.document,[,h]=v.useState({}),p=Pe(t,k=>d(k)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=u?m.indexOf(u):-1,_=l.layersWithOutsidePointerEventsDisabled.size>0,w=x>=b,S=z1(k=>{const E=k.target,P=[...l.branches].some(O=>O.contains(E));!w||P||(s?.(k),i?.(k),k.defaultPrevented||a?.())},f),C=$1(k=>{const E=k.target;[...l.branches].some(O=>O.contains(E))||(o?.(k),i?.(k),k.defaultPrevented||a?.())},f);return N1(k=>{x===l.layers.size-1&&(r?.(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(jm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Lm(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jm)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Lm())},[u,l]),v.useEffect(()=>{const k=()=>h({});return document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)},[]),g.jsx(be.div,{...c,ref:p,style:{pointerEvents:_?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,C.onFocusCapture),onBlurCapture:re(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});Qc.displayName=D1;var L1="DismissableLayerBranch",F1=v.forwardRef((e,t)=>{const n=v.useContext(Px),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(be.div,{...e,ref:s})});F1.displayName=L1;function z1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){Ox(I1,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&Ox(j1,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lm(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function Ox(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Rx(s,o):s.dispatchEvent(o)}var lu=0;function $f(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fm()),document.body.insertAdjacentElement("beforeend",e[1]??Fm()),lu++,()=>{lu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lu--}},[])}function Fm(){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 uu="focusScope.autoFocusOnMount",du="focusScope.autoFocusOnUnmount",zm={bubbles:!1,cancelable:!0},V1="FocusScope",el=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=v.useState(null),l=On(s),u=On(o),d=v.useRef(null),f=Pe(t,m=>c(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(_){if(h.paused||!a)return;const w=_.target;a.contains(w)?d.current=w:nr(d.current,{select:!0})},y=function(_){if(h.paused||!a)return;const w=_.relatedTarget;w!==null&&(a.contains(w)||nr(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&nr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,h.paused]),v.useEffect(()=>{if(a){Vm.add(h);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(uu,zm);a.addEventListener(uu,l),a.dispatchEvent(b),b.defaultPrevented||(B1(K1(Tx(a)),{select:!0}),document.activeElement===m&&nr(a))}return()=>{a.removeEventListener(uu,l),setTimeout(()=>{const b=new CustomEvent(du,zm);a.addEventListener(du,u),a.dispatchEvent(b),b.defaultPrevented||nr(m??document.body,{select:!0}),a.removeEventListener(du,u),Vm.remove(h)},0)}}},[a,l,u,h]);const p=v.useCallback(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[_,w]=U1(x);_&&w?!m.shiftKey&&b===w?(m.preventDefault(),n&&nr(_,{select:!0})):m.shiftKey&&b===_&&(m.preventDefault(),n&&nr(w,{select:!0})):b===x&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...i,ref:f,onKeyDown:p})});el.displayName=V1;function B1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==n)return}function U1(e){const t=Tx(e),n=$m(t,e),r=$m(t.reverse(),e);return[n,r]}function Tx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $m(e,t){for(const n of e)if(!W1(n,{upTo:t}))return n}function W1(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 H1(e){return e instanceof HTMLInputElement&&"select"in e}function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&H1(e)&&t&&e.select()}}var Vm=q1();function q1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bm(e,t),e.unshift(t)},remove(t){e=Bm(e,t),e[0]?.resume()}}}function Bm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function K1(e){return e.filter(t=>t.tagName!=="A")}var Z1=v[" useId ".trim().toString()]||(()=>{}),G1=0;function Hn(e){const[t,n]=v.useState(Z1());return vt(()=>{n(r=>r??String(G1++))},[e]),e||(t?`radix-${t}`:"")}const Y1=["top","right","bottom","left"],gr=Math.min,$t=Math.max,hc=Math.round,Ji=Math.floor,kn=e=>({x:e,y:e}),X1={left:"right",right:"left",bottom:"top",top:"bottom"},J1={start:"end",end:"start"};function bd(e,t,n){return $t(e,gr(t,n))}function Zn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Vf(e){return e==="x"?"y":"x"}function Bf(e){return e==="y"?"height":"width"}const Q1=new Set(["top","bottom"]);function En(e){return Q1.has(Gn(e))?"y":"x"}function Uf(e){return Vf(En(e))}function eA(e,t,n){n===void 0&&(n=!1);const r=no(e),s=Uf(e),o=Bf(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=pc(i)),[i,pc(i)]}function tA(e){const t=pc(e);return[vd(e),t,vd(t)]}function vd(e){return e.replace(/start|end/g,t=>J1[t])}const Um=["left","right"],Wm=["right","left"],nA=["top","bottom"],rA=["bottom","top"];function sA(e,t,n){switch(e){case"top":case"bottom":return n?t?Wm:Um:t?Um:Wm;case"left":case"right":return t?nA:rA;default:return[]}}function oA(e,t,n,r){const s=no(e);let o=sA(Gn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(vd)))),o}function pc(e){return e.replace(/left|right|bottom|top/g,t=>X1[t])}function iA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mx(e){return typeof e!="number"?iA(e):{top:e,right:e,bottom:e,left:e}}function mc(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Hm(e,t,n){let{reference:r,floating:s}=e;const o=En(t),i=Uf(t),a=Bf(i),c=Gn(t),l=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-s.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(no(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function aA(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Zn(t,e),p=Mx(h),y=a[f?d==="floating"?"reference":"floating":d],b=mc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),x=d==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},S=mc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:c}):x);return{top:(b.top-S.top+p.top)/w.y,bottom:(S.bottom-b.bottom+p.bottom)/w.y,left:(b.left-S.left+p.left)/w.x,right:(S.right-b.right+p.right)/w.x}}const cA=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Hm(l,r,c),f=r,h={},p=0;for(let y=0;y<a.length;y++){var m;const{name:b,fn:x}=a[y],{x:_,y:w,data:S,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:l,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:aA},elements:{reference:e,floating:t}});u=_??u,d=w??d,h={...h,[b]:{...h[b],...S}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:u,y:d}=Hm(l,f,c)),y=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}},lA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Zn(e,t)||{};if(l==null)return{};const d=Mx(u),f={x:n,y:r},h=Uf(s),p=Bf(h),m=await i.getDimensions(l),y=h==="y",b=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[h]-f[h]-o.floating[p],S=f[h]-o.reference[h],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=C?C[_]:0;(!k||!await(i.isElement==null?void 0:i.isElement(C)))&&(k=a.floating[_]||o.floating[p]);const E=w/2-S/2,P=k/2-m[p]/2-1,O=gr(d[b],P),N=gr(d[x],P),A=O,j=k-m[p]-N,$=k/2-m[p]/2+E,q=bd(A,$,j),D=!c.arrow&&no(s)!=null&&$!==q&&o.reference[p]/2-($<A?O:N)-m[p]/2<0,H=D?$<A?$-A:$-j:0;return{[h]:f[h]+H,data:{[h]:q,centerOffset:$-q-H,...D&&{alignmentOffset:H}},reset:D}}}),uA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=Zn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Gn(s),x=En(a),_=Gn(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(_||!m?[pc(a)]:tA(a)),C=p!=="none";!f&&C&&S.push(...oA(a,m,p,w));const k=[a,...S],E=await c.detectOverflow(t,y),P=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(E[b]),d){const $=eA(s,i,w);P.push(E[$[0]],E[$[1]])}if(O=[...O,{placement:s,overflows:P}],!P.every($=>$<=0)){var N,A;const $=(((N=o.flip)==null?void 0:N.index)||0)+1,q=k[$];if(q&&(!(d==="alignment"?x!==En(q):!1)||O.every(F=>En(F.placement)===x?F.overflows[0]>0:!0)))return{data:{index:$,overflows:O},reset:{placement:q}};let D=(A=O.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(h){case"bestFit":{var j;const H=(j=O.filter(F=>{if(C){const W=En(F.placement);return W===x||W==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(W=>W>0).reduce((W,se)=>W+se,0)]).sort((F,W)=>F[1]-W[1])[0])==null?void 0:j[0];H&&(D=H);break}case"initialPlacement":D=a;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function qm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Km(e){return Y1.some(t=>e[t]>=0)}const dA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=Zn(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=qm(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Km(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),a=qm(i,n.floating);return{data:{escapedOffsets:a,escaped:Km(a)}}}default:return{}}}}},Ax=new Set(["left","top"]);async function fA(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Gn(n),a=no(n),c=En(n)==="y",l=Ax.has(i)?-1:1,u=o&&c?-1:1,d=Zn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const hA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await fA(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},pA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x,y:_}=b;return{x,y:_}}},...l}=Zn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,l),f=En(Gn(s)),h=Vf(f);let p=u[h],m=u[f];if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=p+d[b],w=p-d[x];p=bd(_,p,w)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=m+d[b],w=m-d[x];m=bd(_,m,w)}const y=c.fn({...t,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[f]:a}}}}}},mA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Zn(e,t),u={x:n,y:r},d=En(s),f=Vf(d);let h=u[f],p=u[d];const m=Zn(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const _=f==="y"?"height":"width",w=o.reference[f]-o.floating[_]+y.mainAxis,S=o.reference[f]+o.reference[_]-y.mainAxis;h<w?h=w:h>S&&(h=S)}if(l){var b,x;const _=f==="y"?"width":"height",w=Ax.has(Gn(s)),S=o.reference[d]-o.floating[_]+(w&&((b=i.offset)==null?void 0:b[d])||0)+(w?0:y.crossAxis),C=o.reference[d]+o.reference[_]+(w?0:((x=i.offset)==null?void 0:x[d])||0)-(w?y.crossAxis:0);p<S?p=S:p>C&&(p=C)}return{[f]:h,[d]:p}}}},gA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Zn(e,t),u=await i.detectOverflow(t,l),d=Gn(s),f=no(s),h=En(s)==="y",{width:p,height:m}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const x=m-u.top-u.bottom,_=p-u.left-u.right,w=gr(m-u[y],x),S=gr(p-u[b],_),C=!t.middlewareData.shift;let k=w,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!f){const O=$t(u.left,0),N=$t(u.right,0),A=$t(u.top,0),j=$t(u.bottom,0);h?E=p-2*(O!==0||N!==0?O+N:$t(u.left,u.right)):k=m-2*(A!==0||j!==0?A+j:$t(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const P=await i.getDimensions(a.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function tl(){return typeof window<"u"}function ro(e){return Nx(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function An(e){var t;return(t=(Nx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nx(e){return tl()?e instanceof Node||e instanceof Ht(e).Node:!1}function pn(e){return tl()?e instanceof Element||e instanceof Ht(e).Element:!1}function Tn(e){return tl()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:!1}function Zm(e){return!tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}const yA=new Set(["inline","contents"]);function Ei(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!yA.has(s)}const bA=new Set(["table","td","th"]);function vA(e){return bA.has(ro(e))}const xA=[":popover-open",":modal"];function nl(e){return xA.some(t=>{try{return e.matches(t)}catch{return!1}})}const _A=["transform","translate","scale","rotate","perspective"],wA=["transform","translate","scale","rotate","perspective","filter"],SA=["paint","layout","strict","content"];function Wf(e){const t=Hf(),n=pn(e)?mn(e):e;return _A.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||wA.some(r=>(n.willChange||"").includes(r))||SA.some(r=>(n.contain||"").includes(r))}function EA(e){let t=yr(e);for(;Tn(t)&&!Gs(t);){if(Wf(t))return t;if(nl(t))return null;t=yr(t)}return null}function Hf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kA=new Set(["html","body","#document"]);function Gs(e){return kA.has(ro(e))}function mn(e){return Ht(e).getComputedStyle(e)}function rl(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yr(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zm(e)&&e.host||An(e);return Zm(t)?t.host:t}function Dx(e){const t=yr(e);return Gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(t)&&Ei(t)?t:Dx(t)}function ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Dx(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Ht(s);if(o){const a=xd(i);return t.concat(i,i.visualViewport||[],Ei(s)?s:[],a&&n?ni(a):[])}return t.concat(s,ni(s,[],n))}function xd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ix(e){const t=mn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Tn(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=hc(n)!==o||hc(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function qf(e){return pn(e)?e:e.contextElement}function Ns(e){const t=qf(e);if(!Tn(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Ix(t);let i=(o?hc(n.width):n.width)/r,a=(o?hc(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const CA=kn(0);function jx(e){const t=Ht(e);return!Hf()||!t.visualViewport?CA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ht(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=qf(e);let i=kn(1);t&&(r?pn(r)&&(i=Ns(r)):i=Ns(e));const a=RA(o,n,r)?jx(o):kn(0);let c=(s.left+a.x)/i.x,l=(s.top+a.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o){const f=Ht(o),h=r&&pn(r)?Ht(r):r;let p=f,m=xd(p);for(;m&&r&&h!==p;){const y=Ns(m),b=m.getBoundingClientRect(),x=mn(m),_=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,w=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=_,l+=w,p=Ht(m),m=xd(p)}}return mc({width:u,height:d,x:c,y:l})}function sl(e,t){const n=rl(e).scrollLeft;return t?t.left+n:ts(An(e)).left+n}function Lx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function PA(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=An(r),a=t?nl(t.floating):!1;if(r===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=kn(1);const u=kn(0),d=Tn(r);if((d||!d&&!o)&&((ro(r)!=="body"||Ei(i))&&(c=rl(r)),Tn(r))){const h=ts(r);l=Ns(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!o?Lx(i,c):kn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function OA(e){return Array.from(e.getClientRects())}function TA(e){const t=An(e),n=rl(e),r=e.ownerDocument.body,s=$t(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=$t(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+sl(e);const a=-n.scrollTop;return mn(r).direction==="rtl"&&(i+=$t(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}const Gm=25;function MA(e,t){const n=Ht(e),r=An(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const u=Hf();(!u||u&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const l=sl(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-h);p<=Gm&&(o-=p)}else l<=Gm&&(o+=l);return{width:o,height:i,x:a,y:c}}const AA=new Set(["absolute","fixed"]);function NA(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Tn(e)?Ns(e):kn(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,l=r*o.y;return{width:i,height:a,x:c,y:l}}function Ym(e,t,n){let r;if(t==="viewport")r=MA(e,n);else if(t==="document")r=TA(An(e));else if(pn(t))r=NA(t,n);else{const s=jx(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return mc(r)}function Fx(e,t){const n=yr(e);return n===t||!pn(n)||Gs(n)?!1:mn(n).position==="fixed"||Fx(n,t)}function DA(e,t){const n=t.get(e);if(n)return n;let r=ni(e,[],!1).filter(a=>pn(a)&&ro(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?yr(e):e;for(;pn(i)&&!Gs(i);){const a=mn(i),c=Wf(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&AA.has(s.position)||Ei(i)&&!c&&Fx(e,i))?r=r.filter(u=>u!==i):s=a,i=yr(i)}return t.set(e,r),r}function IA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?nl(t)?[]:DA(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=Ym(t,u,s);return l.top=$t(d.top,l.top),l.right=gr(d.right,l.right),l.bottom=gr(d.bottom,l.bottom),l.left=$t(d.left,l.left),l},Ym(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function jA(e){const{width:t,height:n}=Ix(e);return{width:t,height:n}}function LA(e,t,n){const r=Tn(t),s=An(t),o=n==="fixed",i=ts(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=kn(0);function l(){c.x=sl(s)}if(r||!r&&!o)if((ro(t)!=="body"||Ei(s))&&(a=rl(t)),r){const h=ts(t,!0,o,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else s&&l();o&&!r&&s&&l();const u=s&&!r&&!o?Lx(s,a):kn(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function fu(e){return mn(e).position==="static"}function Xm(e,t){if(!Tn(e)||mn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return An(e)===n&&(n=n.ownerDocument.body),n}function zx(e,t){const n=Ht(e);if(nl(e))return n;if(!Tn(e)){let s=yr(e);for(;s&&!Gs(s);){if(pn(s)&&!fu(s))return s;s=yr(s)}return n}let r=Xm(e,t);for(;r&&vA(r)&&fu(r);)r=Xm(r,t);return r&&Gs(r)&&fu(r)&&!Wf(r)?n:r||EA(e)||n}const FA=async function(e){const t=this.getOffsetParent||zx,n=this.getDimensions,r=await n(e.floating);return{reference:LA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zA(e){return mn(e).direction==="rtl"}const $A={convertOffsetParentRelativeRectToViewportRelativeRect:PA,getDocumentElement:An,getClippingRect:IA,getOffsetParent:zx,getElementRects:FA,getClientRects:OA,getDimensions:jA,getScale:Ns,isElement:pn,isRTL:zA};function $x(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VA(e,t){let n=null,r;const s=An(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const p=Ji(d),m=Ji(s.clientWidth-(u+f)),y=Ji(s.clientHeight-(d+h)),b=Ji(u),_={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:$t(0,gr(1,c))||1};let w=!0;function S(C){const k=C[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!$x(l,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(S,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,_)}n.observe(e)}return i(!0),o}function BA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=qf(e),u=s||o?[...l?ni(l):[],...ni(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=l&&a?VA(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let p,m=c?ts(e):null;c&&y();function y(){const b=ts(e);m&&!$x(m,b)&&n(),m=b,p=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(x=>{s&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const UA=hA,WA=pA,HA=uA,qA=gA,KA=dA,Jm=lA,ZA=mA,GA=(e,t,n)=>{const r=new Map,s={platform:$A,...n},o={...s.platform,_c:r};return cA(e,t,{...s,platform:o})};var YA=typeof document<"u",XA=function(){},Da=YA?T.useLayoutEffect:XA;function gc(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,s;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(!gc(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!gc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Vx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(e,t){const n=Vx(e);return Math.round(t*n)/n}function hu(e){const t=v.useRef(e);return Da(()=>{t.current=e}),t}function JA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);gc(f,r)||h(r);const[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(F=>{F!==C.current&&(C.current=F,m(F))},[]),_=v.useCallback(F=>{F!==k.current&&(k.current=F,b(F))},[]),w=o||p,S=i||y,C=v.useRef(null),k=v.useRef(null),E=v.useRef(u),P=c!=null,O=hu(c),N=hu(s),A=hu(l),j=v.useCallback(()=>{if(!C.current||!k.current)return;const F={placement:t,strategy:n,middleware:f};N.current&&(F.platform=N.current),GA(C.current,k.current,F).then(W=>{const se={...W,isPositioned:A.current!==!1};$.current&&!gc(E.current,se)&&(E.current=se,Ic.flushSync(()=>{d(se)}))})},[f,t,n,N,A]);Da(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[l]);const $=v.useRef(!1);Da(()=>($.current=!0,()=>{$.current=!1}),[]),Da(()=>{if(w&&(C.current=w),S&&(k.current=S),w&&S){if(O.current)return O.current(w,S,j);j()}},[w,S,j,O,P]);const q=v.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:_}),[x,_]),D=v.useMemo(()=>({reference:w,floating:S}),[w,S]),H=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!D.floating)return F;const W=Qm(D.floating,u.x),se=Qm(D.floating,u.y);return a?{...F,transform:"translate("+W+"px, "+se+"px)",...Vx(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:se}},[n,a,D.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:q,elements:D,floatingStyles:H}),[u,j,q,D,H])}const QA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Jm({element:r.current,padding:s}).fn(n):{}:r?Jm({element:r,padding:s}).fn(n):{}}}},eN=(e,t)=>({...UA(e),options:[e,t]}),tN=(e,t)=>({...WA(e),options:[e,t]}),nN=(e,t)=>({...ZA(e),options:[e,t]}),rN=(e,t)=>({...HA(e),options:[e,t]}),sN=(e,t)=>({...qA(e),options:[e,t]}),oN=(e,t)=>({...KA(e),options:[e,t]}),iN=(e,t)=>({...QA(e),options:[e,t]});var aN="Arrow",Bx=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return g.jsx(be.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bx.displayName=aN;var cN=Bx;function Ux(e){const[t,n]=v.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Kf="Popper",[Wx,ol]=wr(Kf),[lN,Hx]=Wx(Kf),qx=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return g.jsx(lN,{scope:t,anchor:r,onAnchorChange:s,children:n})};qx.displayName=Kf;var Kx="PopperAnchor",Zx=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=Hx(Kx,n),i=v.useRef(null),a=Pe(t,i),c=v.useRef(null);return v.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&o.onAnchorChange(c.current)}),r?null:g.jsx(be.div,{...s,ref:a})});Zx.displayName=Kx;var Zf="PopperContent",[uN,dN]=Wx(Zf),Gx=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,y=Hx(Zf,n),[b,x]=v.useState(null),_=Pe(t,V=>x(V)),[w,S]=v.useState(null),C=Ux(w),k=C?.width??0,E=C?.height??0,P=r+(o!=="center"?"-"+o:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(l)?l:[l],A=N.length>0,j={padding:O,boundary:N.filter(hN),altBoundary:A},{refs:$,floatingStyles:q,placement:D,isPositioned:H,middlewareData:F}=JA({strategy:"fixed",placement:P,whileElementsMounted:(...V)=>BA(...V,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[eN({mainAxis:s+E,alignmentAxis:i}),c&&tN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?nN():void 0,...j}),c&&rN({...j}),sN({...j,apply:({elements:V,rects:ee,availableWidth:me,availableHeight:le})=>{const{width:fe,height:ge}=ee.reference,Ze=V.floating.style;Ze.setProperty("--radix-popper-available-width",`${me}px`),Ze.setProperty("--radix-popper-available-height",`${le}px`),Ze.setProperty("--radix-popper-anchor-width",`${fe}px`),Ze.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),w&&iN({element:w,padding:a}),pN({arrowWidth:k,arrowHeight:E}),f&&oN({strategy:"referenceHidden",...j})]}),[W,se]=Jx(D),I=On(p);vt(()=>{H&&I?.()},[H,I]);const Y=F.arrow?.x,K=F.arrow?.y,Z=F.arrow?.centerOffset!==0,[oe,ce]=v.useState();return vt(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),g.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(uN,{scope:n,placedSide:W,onArrowChange:S,arrowX:Y,arrowY:K,shouldHideArrow:Z,children:g.jsx(be.div,{"data-side":W,"data-align":se,...m,ref:_,style:{...m.style,animation:H?void 0:"none"}})})})});Gx.displayName=Zf;var Yx="PopperArrow",fN={top:"bottom",right:"left",bottom:"top",left:"right"},Xx=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=dN(Yx,r),i=fN[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(cN,{...s,ref:n,style:{...s.style,display:"block"}})})});Xx.displayName=Yx;function hN(e){return e!==null}var pN=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Jx(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(s.arrow?.x??0)+a/2,h=(s.arrow?.y??0)+c/2;let p="",m="";return l==="bottom"?(p=i?d:`${f}px`,m=`${-c}px`):l==="top"?(p=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(p=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(p=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:p,y:m}}}});function Jx(e){const[t,n="center"]=e.split("-");return[t,n]}var Qx=qx,e_=Zx,t_=Gx,n_=Xx,mN="Portal",il=v.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=v.useState(!1);vt(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?Dc.createPortal(g.jsx(be.div,{...r,ref:t}),i):null});il.displayName=mN;function gN(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Xn=e=>{const{present:t,children:n}=e,r=yN(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Pe(r.ref,bN(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};Xn.displayName="Presence";function yN(e){const[t,n]=v.useState(),r=v.useRef(null),s=v.useRef(e),o=v.useRef("none"),i=e?"mounted":"unmounted",[a,c]=gN(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Qi(r.current);o.current=a==="mounted"?l:"none"},[a]),vt(()=>{const l=r.current,u=s.current;if(u!==e){const f=o.current,h=Qi(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),vt(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Qi(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=h=>{h.target===t&&(o.current=Qi(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qi(e){return e?.animationName||"none"}function bN(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 pu="rovingFocusGroup.onEntryFocus",vN={bubbles:!1,cancelable:!0},ki="RovingFocusGroup",[_d,r_,xN]=Ff(ki),[_N,s_]=wr(ki,[xN]),[wN,SN]=_N(ki),o_=v.forwardRef((e,t)=>g.jsx(_d.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(_d.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(EN,{...e,ref:t})})}));o_.displayName=ki;var EN=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),h=Pe(t,f),p=zf(o),[m,y]=Zs({prop:i,defaultProp:a??null,onChange:c,caller:ki}),[b,x]=v.useState(!1),_=On(l),w=r_(n),S=v.useRef(!1),[C,k]=v.useState(0);return v.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(pu,_),()=>E.removeEventListener(pu,_)},[_]),g.jsx(wN,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(E=>y(E),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:v.useCallback(()=>k(E=>E-1),[]),children:g.jsx(be.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const P=!S.current;if(E.target===E.currentTarget&&P&&!b){const O=new CustomEvent(pu,vN);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const N=w().filter(D=>D.focusable),A=N.find(D=>D.active),j=N.find(D=>D.id===m),q=[A,j,...N].filter(Boolean).map(D=>D.ref.current);c_(q,u)}}S.current=!1}),onBlur:re(e.onBlur,()=>x(!1))})})}),i_="RovingFocusGroupItem",a_=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...a}=e,c=Hn(),l=o||c,u=SN(i_,n),d=u.currentTabStopId===l,f=r_(n),{onFocusableItemAdd:h,onFocusableItemRemove:p,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),g.jsx(_d.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:g.jsx(be.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:re(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=RN(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=f().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")_.reverse();else if(b==="prev"||b==="next"){b==="prev"&&_.reverse();const w=_.indexOf(y.currentTarget);_=u.loop?PN(_,w+1):_.slice(w+1)}setTimeout(()=>c_(_))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});a_.displayName=i_;var kN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function RN(e,t,n){const r=CN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kN[r]}function c_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function PN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ON=o_,TN=a_;function MN(e){const t=AN(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(DN);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function AN(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=jN(s),a=IN(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NN=Symbol("radix.slottable");function DN(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NN}function IN(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function jN(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 LN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bs=new WeakMap,ea=new WeakMap,ta={},mu=0,l_=function(e){return e&&(e.host||l_(e.parentNode))},FN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=l_(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})},zN=function(e,t,n,r){var s=FN(t,Array.isArray(e)?e:[e]);ta[n]||(ta[n]=new WeakMap);var o=ta[n],i=[],a=new Set,c=new Set(s),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};s.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(bs.get(f)||0)+1,y=(o.get(f)||0)+1;bs.set(f,m),o.set(f,y),i.push(f),m===1&&p&&ea.set(f,!0),y===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return u(t),a.clear(),mu++,function(){i.forEach(function(d){var f=bs.get(d)-1,h=o.get(d)-1;bs.set(d,f),o.set(d,h),f||(ea.has(d)||d.removeAttribute(r),ea.delete(d)),h||d.removeAttribute(n)}),mu--,mu||(bs=new WeakMap,bs=new WeakMap,ea=new WeakMap,ta={})}},Gf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=LN(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),zN(r,s,n,"aria-hidden")):function(){return null}},Sn=function(){return Sn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Sn.apply(this,arguments)};function u_(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function $N(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ia="right-scroll-bar-position",ja="width-before-scroll-bar",VN="with-scroll-bars-hidden",BN="--removed-body-scroll-bar-size";function gu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function UN(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var WN=typeof window<"u"?v.useLayoutEffect:v.useEffect,eg=new WeakMap;function HN(e,t){var n=UN(null,function(r){return e.forEach(function(s){return gu(s,r)})});return WN(function(){var r=eg.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||gu(a,null)}),o.forEach(function(a){s.has(a)||gu(a,i)})}eg.set(n,e)},[e]),n}function qN(e){return e}function KN(e,t){t===void 0&&(t=qN);var n=[],r=!1,s={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(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var c=function(){var u=i;i=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return s}function ZN(e){e===void 0&&(e={});var t=KN(null);return t.options=Sn({async:!0,ssr:!1},e),t}var d_=function(e){var t=e.sideCar,n=u_(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 v.createElement(r,Sn({},n))};d_.isSideCarExport=!0;function GN(e,t){return e.useMedium(t),d_}var f_=ZN(),yu=function(){},al=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:yu,onWheelCapture:yu,onTouchMoveCapture:yu}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,_=e.gapMode,w=u_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=HN([n,t]),k=Sn(Sn({},w),s);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:f_,removeScrollBar:l,shards:d,noRelative:h,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:_}),i?v.cloneElement(v.Children.only(a),Sn(Sn({},k),{ref:C})):v.createElement(x,Sn({},k,{className:c,ref:C}),a))});al.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};al.classNames={fullWidth:ja,zeroRight:Ia};var YN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YN();return t&&e.setAttribute("nonce",t),e}function JN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function QN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XN())&&(JN(t,n),QN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tD=function(){var e=eD();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},h_=function(){var e=tD(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},nD={left:0,top:0,right:0,gap:0},bu=function(e){return parseInt(e||"",10)||0},rD=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[bu(n),bu(r),bu(s)]},sD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nD;var t=rD(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])}},oD=h_(),Ds="data-scroll-locked",iD=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
22
|
-
.`.concat(
|
|
21
|
+
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),m.warnIfExceeded()),p}}}function Yi(e){return typeof e=="boolean"}var eM=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:o=!0}=t??{};let i=new cx;if(n&&(Yi(n)?i.push(WT):i.push(HT(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};Yi(r)||(a=r),i.unshift(JT(a))}if(s){let a={};Yi(s)||(a=s),i.push(QT(a))}if(o){let a={};Yi(o)||(a=o),i.unshift(GT(a))}}return i},tM="RTK_autoBatch",Rm=e=>t=>{setTimeout(t,e)},nM=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rm(10):e.type==="callback"?e.queueNotification:Rm(e.timeout),l=()=>{i=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>s&&u(),f=r.subscribe(d);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){try{return s=!u?.meta?.[tM],o=!s,o&&(i||(i=!0,c(l))),r.dispatch(u)}finally{s=!0}}})},rM=e=>function(n){const{autoBatch:r=!0}=n??{};let s=new cx(e);return r&&s.push(nM(typeof r=="object"?r:void 0)),s};function sM(e){const t=eM(),{reducer:n=void 0,middleware:r,devTools:s=!0,duplicateMiddlewareCheck:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(wi(n))c=CT(n);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let m=new Set;l.forEach(y=>{if(m.has(y))throw new Error(process.env.NODE_ENV==="production"?Oe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");m.add(y)})}let u=sc;s&&(u=qT({trace:process.env.NODE_ENV!=="production",...typeof s=="object"&&s}));const d=RT(...l),f=rM(d);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let h=typeof a=="function"?a(f):f();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(m=>typeof m!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!h.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=u(...h);return Kv(c,i,p)}function hx(e){const t={},n=[];let r;const s={addCase(o,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof o=="string"?o:o.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,s},addAsyncThunk(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return i.pending&&(t[o.pending.type]=i.pending),i.rejected&&(t[o.rejected.type]=i.rejected),i.fulfilled&&(t[o.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:o.settled,reducer:i.settled}),s},addMatcher(o,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:i}),s},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return r=o,s}};return e(s),[t,n,r]}function oM(e){return typeof e=="function"}function iM(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,s]=hx(t),o;if(oM(e))o=()=>Cm(e());else{const a=Cm(e);o=()=>a}function i(a=o(),c){let l=[n[c.type],...r.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[s]),l.reduce((u,d)=>{if(d)if(Kn(u)){const h=d(u,c);return h===void 0?u:h}else{if(hn(u))return sx(u,f=>d(f,c));{const f=d(u,c);if(f===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return u},a)}return i.getInitialState=o,i}var aM=(e,t)=>ix(e)?e.match(t):e(t);function cM(...e){return t=>e.some(n=>aM(n,t))}var lM="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",uM=(e=21)=>{let t="",n=e;for(;n--;)t+=lM[Math.random()*64|0];return t},dM=["name","message","stack","code"],au=class{constructor(e,t){this.payload=e,this.meta=t}_type},Pm=class{constructor(e,t){this.payload=e,this.meta=t}_type},fM=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of dM)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Om="External signal was aborted",xr=(()=>{function e(t,n,r){const s=$o(t+"/fulfilled",(c,l,u,d)=>({payload:c,meta:{...d||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),o=$o(t+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),i=$o(t+"/rejected",(c,l,u,d,f)=>({payload:d,error:(r&&r.serializeError||fM)(c||"Rejected"),meta:{...f||{},arg:u,requestId:l,rejectedWithValue:!!d,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function a(c,{signal:l}={}){return(u,d,f)=>{const h=r?.idGenerator?r.idGenerator(c):uM(),p=new AbortController;let m,y;function b(_){y=_,p.abort()}l&&(l.aborted?b(Om):l.addEventListener("abort",()=>b(Om),{once:!0}));const x=(async function(){let _;try{let S=r?.condition?.(c,{getState:d,extra:f});if(pM(S)&&(S=await S),S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const C=new Promise((k,E)=>{m=()=>{E({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",m,{once:!0})});u(o(h,c,r?.getPendingMeta?.({requestId:h,arg:c},{getState:d,extra:f}))),_=await Promise.race([C,Promise.resolve(n(c,{dispatch:u,getState:d,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:(k,E)=>new au(k,E),fulfillWithValue:(k,E)=>new Pm(k,E)})).then(k=>{if(k instanceof au)throw k;return k instanceof Pm?s(k.payload,h,c,k.meta):s(k,h,c)})])}catch(S){_=S instanceof au?i(null,h,c,S.payload,S.meta):i(S,h,c)}finally{m&&p.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&i.match(_)&&_.meta.condition||u(_),_})();return Object.assign(x,{abort:b,requestId:h,arg:c,unwrap(){return x.then(hM)}})}}return Object.assign(a,{pending:o,rejected:i,fulfilled:s,settled:cM(i,s),typePrefix:t})}return e.withTypes=()=>e,e})();function hM(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function pM(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mM=Symbol.for("rtk-slice-createasyncthunk");function gM(e,t){return`${e}/${t}`}function yM({creators:e}={}){const t=e?.asyncThunk?.[mM];return function(r){const{name:s,reducerPath:o=s}=r;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&r.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const i=(typeof r.reducers=="function"?r.reducers(xM()):r.reducers)||{},a=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(_,w){const S=typeof _=="string"?_:_.type;if(!S)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(S in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+S);return c.sliceCaseReducersByType[S]=w,l},addMatcher(_,w){return c.sliceMatchers.push({matcher:_,reducer:w}),l},exposeAction(_,w){return c.actionCreators[_]=w,l},exposeCaseReducer(_,w){return c.sliceCaseReducersByName[_]=w,l}};a.forEach(_=>{const w=i[_],S={reducerName:_,type:gM(s,_),createNotation:typeof r.reducers=="function"};wM(w)?EM(S,w,l,t):_M(S,w,l)});function u(){if(process.env.NODE_ENV!=="production"&&typeof r.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[_={},w=[],S=void 0]=typeof r.extraReducers=="function"?hx(r.extraReducers):[r.extraReducers],C={..._,...c.sliceCaseReducersByType};return iM(r.initialState,k=>{for(let E in C)k.addCase(E,C[E]);for(let E of c.sliceMatchers)k.addMatcher(E.matcher,E.reducer);for(let E of w)k.addMatcher(E.matcher,E.reducer);S&&k.addDefaultCase(S)})}const d=_=>_,f=new Map,h=new WeakMap;let p;function m(_,w){return p||(p=u()),p(_,w)}function y(){return p||(p=u()),p.getInitialState()}function b(_,w=!1){function S(k){let E=k[_];if(typeof E>"u"){if(w)E=Gi(h,S,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return E}function C(k=d){const E=Gi(f,w,()=>new WeakMap);return Gi(E,k,()=>{const P={};for(const[O,N]of Object.entries(r.selectors??{}))P[O]=bM(N,k,()=>Gi(h,k,y),w);return P})}return{reducerPath:_,getSelectors:C,get selectors(){return C(S)},selectSlice:S}}const x={name:s,reducer:m,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(_,{reducerPath:w,...S}={}){const C=w??o;return _.inject({reducerPath:C,reducer:m},S),{...x,...b(C,!0)}}};return x}}function bM(e,t,n,r){function s(o,...i){let a=t(o);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return s.unwrapped=e,s}var vM=yM();function xM(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function _M({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!SM(r))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?$o(e,i):$o(e))}function wM(e){return e._reducerDefinitionType==="asyncThunk"}function SM(e){return e._reducerDefinitionType==="reducerWithPrepare"}function EM({type:e,reducerName:t},n,r,s){if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:i,pending:a,rejected:c,settled:l,options:u}=n,d=s(e,o,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Xi,pending:a||Xi,rejected:c||Xi,settled:l||Xi})}function Xi(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const _r={getSummary:(e=60)=>Te.get(`/monitors/summary?bars=${e}`).then(t=>t.data.rows),getList:()=>Te.get("/monitors").then(e=>e.data.monitors),getResults:(e,t=180)=>Te.get(`/monitors/${e}/results?limit=${t}`).then(n=>n.data.results),create:e=>Te.post("/monitors",e).then(t=>t.data),update:(e,t)=>Te.put(`/monitors/${e}`,t).then(n=>n.data),delete:e=>Te.delete(`/monitors/${e}`).then(t=>t.data),togglePause:(e,t)=>Te.post(`/monitors/${e}/pause`,{paused:t}).then(n=>n.data)},kM={data:[],list:[],current:null,currentResults:[],loading:!1,error:null,actionLoading:!1},Aa=xr("monitors/fetchResults",async(e,{rejectWithValue:t})=>{try{return await _r.getResults(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch results")}}),Ur=xr("monitors/fetchSummary",async(e=60,{rejectWithValue:t})=>{try{return await _r.getSummary(e)}catch(n){return t(n.response?.data?.message||"Failed to fetch summary")}}),Na=xr("monitors/fetchAll",async(e,{rejectWithValue:t})=>{try{return await _r.getList()}catch(n){return t(n.response?.data?.message||"Failed to fetch monitors")}}),ks=xr("monitors/fetchOne",async(e,{rejectWithValue:t})=>{try{const r=(await _r.getList()).find(s=>s.id===e);if(!r)throw new Error("Monitor not found");return r}catch(n){return t(n.message||n.response?.data?.message||"Failed to fetch monitor")}}),dc=xr("monitors/pause",async({id:e,paused:t},{rejectWithValue:n})=>{try{return await _r.togglePause(e,t),{id:e,paused:t}}catch(r){return n(r.response?.data?.message||"Failed to toggle pause")}}),Nf=xr("monitors/delete",async(e,{rejectWithValue:t})=>{try{return await _r.delete(e),e}catch(n){return t(n.response?.data?.message||"Failed to delete monitor")}}),px=xr("monitors/create",async(e,{rejectWithValue:t})=>{try{return await _r.create(e)}catch(n){return t(n.response?.data?.message||"Failed to create monitor")}}),Df=xr("monitors/update",async({id:e,data:t},{rejectWithValue:n})=>{try{return await _r.update(e,t)}catch(r){return n(r.response?.data?.message||"Failed to update monitor")}}),mx=vM({name:"monitors",initialState:kM,reducers:{clearError:e=>{e.error=null},setCurrentMonitor:(e,t)=>{e.current=t.payload}},extraReducers:e=>{e.addCase(Ur.pending,t=>{t.loading=!0,t.error=null}),e.addCase(Ur.fulfilled,(t,n)=>{t.loading=!1,t.data=n.payload}),e.addCase(Ur.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(Na.pending,t=>{t.loading=!0}),e.addCase(Na.fulfilled,(t,n)=>{t.loading=!1,t.list=n.payload}),e.addCase(Na.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}),e.addCase(ks.pending,t=>{t.loading=!0}),e.addCase(ks.fulfilled,(t,n)=>{t.loading=!1,t.current=n.payload}),e.addCase(Aa.fulfilled,(t,n)=>{t.currentResults=n.payload}),e.addCase(dc.pending,t=>{t.actionLoading=!0}),e.addCase(dc.fulfilled,(t,n)=>{t.actionLoading=!1;const r=t.data.find(o=>o.monitor.id===n.payload.id);r&&(r.monitor.isPaused=n.payload.paused);const s=t.list.find(o=>o.id===n.payload.id);s&&(s.isPaused=n.payload.paused),t.current?.id===n.payload.id&&(t.current.isPaused=n.payload.paused)}),e.addCase(Nf.fulfilled,(t,n)=>{t.data=t.data.filter(r=>r.monitor.id!==n.payload),t.list=t.list.filter(r=>r.id!==n.payload),t.current?.id===n.payload&&(t.current=null)}),e.addCase(px.fulfilled,(t,n)=>{t.list.push(n.payload.monitor)}),e.addCase(Df.fulfilled,(t,n)=>{const r=t.list.findIndex(o=>o.id===n.payload.monitor.id);r!==-1&&(t.list[r]=n.payload.monitor);const s=t.data.findIndex(o=>o.monitor.id===n.payload.monitor.id);s!==-1&&(t.data[s].monitor=n.payload.monitor),t.current?.id===n.payload.monitor.id&&(t.current=n.payload.monitor)})}}),{clearError:qH,setCurrentMonitor:KH}=mx.actions,CM=mx.reducer;const RM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Tm=e=>{const t=PM(e);return t.charAt(0).toUpperCase()+t.slice(1)},gx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),OM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var TM={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 MM=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>T.createElement("svg",{ref:c,...TM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gx("lucide",s),...!o&&!OM(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>T.createElement(l,u)),...Array.isArray(o)?o:[o]]));const Ke=(e,t)=>{const n=T.forwardRef(({className:r,...s},o)=>T.createElement(MM,{ref:o,iconNode:t,className:gx(`lucide-${RM(Tm(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Tm(e),n};const AM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],cu=Ke("activity",AM);const NM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yx=Ke("arrow-left",NM);const DM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bx=Ke("check",DM);const IM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vx=Ke("chevron-down",IM);const jM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],LM=Ke("chevron-up",jM);const FM=[["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"}]],xx=Ke("copy",FM);const zM=[["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"}]],$M=Ke("database",zM);const VM=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],BM=Ke("ellipsis",VM);const UM=[["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"}]],WM=Ke("globe",UM);const HM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],If=Ke("loader-circle",HM);const qM=[["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"}]],KM=Ke("package",qM);const ZM=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],_x=Ke("pause",ZM);const GM=[["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"}]],wx=Ke("pencil",GM);const YM=[["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"}]],Sx=Ke("play",YM);const XM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mm=Ke("plus",XM);const JM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ex=Ke("search",JM);const QM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],e1=Ke("send",QM);const t1=[["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"}]],n1=Ke("server",t1);const r1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],s1=Ke("terminal",r1);const o1=[["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"}]],jf=Ke("trash-2",o1);const i1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],a1=Ke("x",i1);function Am(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yn(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Am(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Am(e[s],null)}}}}function Pe(...e){return v.useCallback(Yn(...e),e)}var c1=Symbol.for("react.lazy"),fc=v[" use ".trim().toString()];function l1(e){return typeof e=="object"&&e!==null&&"then"in e}function kx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===c1&&"_payload"in e&&l1(e._payload)}function Cx(e){const t=u1(e),n=v.forwardRef((r,s)=>{let{children:o,...i}=r;kx(o)&&typeof fc=="function"&&(o=fc(o._payload));const a=v.Children.toArray(o),c=a.find(f1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var Lf=Cx("Slot");function u1(e){const t=v.forwardRef((n,r)=>{let{children:s,...o}=n;if(kx(s)&&typeof fc=="function"&&(s=fc(s._payload)),v.isValidElement(s)){const i=p1(s),a=h1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d1=Symbol("radix.slottable");function f1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function h1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function p1(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 Nm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dm=Rf,Rx=(e,t)=>n=>{var r;if(t?.variants==null)return Dm(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(l=>{const u=n?.[l],d=o?.[l];if(u===null)return null;const f=Nm(u)||Nm(d);return s[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,y]=p;return Array.isArray(y)?y.includes({...o,...a}[m]):{...o,...a}[m]===y})?[...l,d,f]:l},[]);return Dm(e,i,c,n?.class,n?.className)};function Se(...e){return Wv(Rf(e))}const m1=Rx("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 gt({className:e,variant:t,size:n,asChild:r=!1,...s}){const o=r?Lf:"button";return g.jsx(o,{"data-slot":"button",className:Se(m1({variant:t,size:n,className:e})),...s})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function g1(e,t){const n=v.createContext(t),r=o=>{const{children:i,...a}=o,c=v.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function s(o){const i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function wr(e,t=[]){let n=[];function r(o,i){const a=v.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:f,children:h,...p}=d,m=f?.[e]?.[c]||a,y=v.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:y,children:h})};l.displayName=o+"Provider";function u(d,f){const h=f?.[e]?.[c]||a,p=v.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[l,u]}const s=()=>{const o=n.map(i=>v.createContext(i));return function(a){const c=a?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,y1(s,...t)]}function y1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var vt=globalThis?.document?v.useLayoutEffect:()=>{},b1=v[" useInsertionEffect ".trim().toString()]||vt;function Zs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=v1({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"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.`),u.current=a},[a,r])}const l=v.useCallback(u=>{if(a){const d=x1(u)?u(e):u;d!==e&&i.current?.(d)}else o(u)},[a,e,o,i]);return[c,l]}function v1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),s=v.useRef(n),o=v.useRef(t);return b1(()=>{o.current=t},[t]),v.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function x1(e){return typeof e=="function"}function _1(e){const t=w1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(E1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function w1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=C1(s),a=k1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S1=Symbol("radix.slottable");function E1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S1}function k1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function C1(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 R1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],be=R1.reduce((e,t)=>{const n=_1(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Px(e,t){e&&Ic.flushSync(()=>e.dispatchEvent(t))}function Im(e){const t=P1(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(T1);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function P1(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=A1(s),a=M1(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O1=Symbol("radix.slottable");function T1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O1}function M1(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function A1(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 Ff(e){const t=e+"CollectionProvider",[n,r]=wr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:b}=m,x=T.useRef(null),_=T.useRef(new Map).current;return g.jsx(s,{scope:y,itemMap:_,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",c=Im(a),l=T.forwardRef((m,y)=>{const{scope:b,children:x}=m,_=o(a,b),w=Pe(y,_.collectionRef);return g.jsx(c,{ref:w,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Im(u),h=T.forwardRef((m,y)=>{const{scope:b,children:x,..._}=m,w=T.useRef(null),S=Pe(y,w),C=o(u,b);return T.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>{C.itemMap.delete(w)})),g.jsx(f,{[d]:"",ref:S,children:x})});h.displayName=u;function p(m){const y=o(e+"CollectionConsumer",m);return T.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,k)=>_.indexOf(C.ref.current)-_.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},p,r]}var N1=v.createContext(void 0);function zf(e){const t=v.useContext(N1);return e||t||"ltr"}function On(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function D1(e,t=globalThis?.document){const n=On(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var I1="DismissableLayer",yd="dismissableLayer.update",j1="dismissableLayer.pointerDownOutside",L1="dismissableLayer.focusOutside",jm,Ox=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qc=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...c}=e,l=v.useContext(Ox),[u,d]=v.useState(null),f=u?.ownerDocument??globalThis?.document,[,h]=v.useState({}),p=Pe(t,k=>d(k)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=u?m.indexOf(u):-1,_=l.layersWithOutsidePointerEventsDisabled.size>0,w=x>=b,S=$1(k=>{const E=k.target,P=[...l.branches].some(O=>O.contains(E));!w||P||(s?.(k),i?.(k),k.defaultPrevented||a?.())},f),C=V1(k=>{const E=k.target;[...l.branches].some(O=>O.contains(E))||(o?.(k),i?.(k),k.defaultPrevented||a?.())},f);return D1(k=>{x===l.layers.size-1&&(r?.(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(jm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Lm(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jm)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Lm())},[u,l]),v.useEffect(()=>{const k=()=>h({});return document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)},[]),g.jsx(be.div,{...c,ref:p,style:{pointerEvents:_?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,C.onFocusCapture),onBlurCapture:re(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,S.onPointerDownCapture)})});Qc.displayName=I1;var F1="DismissableLayerBranch",z1=v.forwardRef((e,t)=>{const n=v.useContext(Ox),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(be.div,{...e,ref:s})});z1.displayName=F1;function $1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){Tx(j1,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function V1(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&Tx(L1,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lm(){const e=new CustomEvent(yd);document.dispatchEvent(e)}function Tx(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Px(s,o):s.dispatchEvent(o)}var lu=0;function $f(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fm()),document.body.insertAdjacentElement("beforeend",e[1]??Fm()),lu++,()=>{lu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lu--}},[])}function Fm(){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 uu="focusScope.autoFocusOnMount",du="focusScope.autoFocusOnUnmount",zm={bubbles:!1,cancelable:!0},B1="FocusScope",el=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,c]=v.useState(null),l=On(s),u=On(o),d=v.useRef(null),f=Pe(t,m=>c(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(_){if(h.paused||!a)return;const w=_.target;a.contains(w)?d.current=w:nr(d.current,{select:!0})},y=function(_){if(h.paused||!a)return;const w=_.relatedTarget;w!==null&&(a.contains(w)||nr(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&nr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,h.paused]),v.useEffect(()=>{if(a){Vm.add(h);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(uu,zm);a.addEventListener(uu,l),a.dispatchEvent(b),b.defaultPrevented||(U1(Z1(Mx(a)),{select:!0}),document.activeElement===m&&nr(a))}return()=>{a.removeEventListener(uu,l),setTimeout(()=>{const b=new CustomEvent(du,zm);a.addEventListener(du,u),a.dispatchEvent(b),b.defaultPrevented||nr(m??document.body,{select:!0}),a.removeEventListener(du,u),Vm.remove(h)},0)}}},[a,l,u,h]);const p=v.useCallback(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[_,w]=W1(x);_&&w?!m.shiftKey&&b===w?(m.preventDefault(),n&&nr(_,{select:!0})):m.shiftKey&&b===_&&(m.preventDefault(),n&&nr(w,{select:!0})):b===x&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...i,ref:f,onKeyDown:p})});el.displayName=B1;function U1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==n)return}function W1(e){const t=Mx(e),n=$m(t,e),r=$m(t.reverse(),e);return[n,r]}function Mx(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $m(e,t){for(const n of e)if(!H1(n,{upTo:t}))return n}function H1(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 q1(e){return e instanceof HTMLInputElement&&"select"in e}function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&q1(e)&&t&&e.select()}}var Vm=K1();function K1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bm(e,t),e.unshift(t)},remove(t){e=Bm(e,t),e[0]?.resume()}}}function Bm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Z1(e){return e.filter(t=>t.tagName!=="A")}var G1=v[" useId ".trim().toString()]||(()=>{}),Y1=0;function Hn(e){const[t,n]=v.useState(G1());return vt(()=>{n(r=>r??String(Y1++))},[e]),e||(t?`radix-${t}`:"")}const X1=["top","right","bottom","left"],gr=Math.min,$t=Math.max,hc=Math.round,Ji=Math.floor,kn=e=>({x:e,y:e}),J1={left:"right",right:"left",bottom:"top",top:"bottom"},Q1={start:"end",end:"start"};function bd(e,t,n){return $t(e,gr(t,n))}function Zn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Vf(e){return e==="x"?"y":"x"}function Bf(e){return e==="y"?"height":"width"}const eA=new Set(["top","bottom"]);function En(e){return eA.has(Gn(e))?"y":"x"}function Uf(e){return Vf(En(e))}function tA(e,t,n){n===void 0&&(n=!1);const r=no(e),s=Uf(e),o=Bf(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=pc(i)),[i,pc(i)]}function nA(e){const t=pc(e);return[vd(e),t,vd(t)]}function vd(e){return e.replace(/start|end/g,t=>Q1[t])}const Um=["left","right"],Wm=["right","left"],rA=["top","bottom"],sA=["bottom","top"];function oA(e,t,n){switch(e){case"top":case"bottom":return n?t?Wm:Um:t?Um:Wm;case"left":case"right":return t?rA:sA;default:return[]}}function iA(e,t,n,r){const s=no(e);let o=oA(Gn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(vd)))),o}function pc(e){return e.replace(/left|right|bottom|top/g,t=>J1[t])}function aA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ax(e){return typeof e!="number"?aA(e):{top:e,right:e,bottom:e,left:e}}function mc(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Hm(e,t,n){let{reference:r,floating:s}=e;const o=En(t),i=Uf(t),a=Bf(i),c=Gn(t),l=o==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-s.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(no(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function cA(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Zn(t,e),p=Ax(h),y=a[f?d==="floating"?"reference":"floating":d],b=mc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),x=d==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},S=mc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:c}):x);return{top:(b.top-S.top+p.top)/w.y,bottom:(S.bottom-b.bottom+p.bottom)/w.y,left:(b.left-S.left+p.left)/w.x,right:(S.right-b.right+p.right)/w.x}}const lA=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Hm(l,r,c),f=r,h={},p=0;for(let y=0;y<a.length;y++){var m;const{name:b,fn:x}=a[y],{x:_,y:w,data:S,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:l,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:cA},elements:{reference:e,floating:t}});u=_??u,d=w??d,h={...h,[b]:{...h[b],...S}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:u,y:d}=Hm(l,f,c)),y=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}},uA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Zn(e,t)||{};if(l==null)return{};const d=Ax(u),f={x:n,y:r},h=Uf(s),p=Bf(h),m=await i.getDimensions(l),y=h==="y",b=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[h]-f[h]-o.floating[p],S=f[h]-o.reference[h],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=C?C[_]:0;(!k||!await(i.isElement==null?void 0:i.isElement(C)))&&(k=a.floating[_]||o.floating[p]);const E=w/2-S/2,P=k/2-m[p]/2-1,O=gr(d[b],P),N=gr(d[x],P),A=O,j=k-m[p]-N,$=k/2-m[p]/2+E,q=bd(A,$,j),D=!c.arrow&&no(s)!=null&&$!==q&&o.reference[p]/2-($<A?O:N)-m[p]/2<0,H=D?$<A?$-A:$-j:0;return{[h]:f[h]+H,data:{[h]:q,centerOffset:$-q-H,...D&&{alignmentOffset:H}},reset:D}}}),dA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=Zn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Gn(s),x=En(a),_=Gn(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(_||!m?[pc(a)]:nA(a)),C=p!=="none";!f&&C&&S.push(...iA(a,m,p,w));const k=[a,...S],E=await c.detectOverflow(t,y),P=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(E[b]),d){const $=tA(s,i,w);P.push(E[$[0]],E[$[1]])}if(O=[...O,{placement:s,overflows:P}],!P.every($=>$<=0)){var N,A;const $=(((N=o.flip)==null?void 0:N.index)||0)+1,q=k[$];if(q&&(!(d==="alignment"?x!==En(q):!1)||O.every(F=>En(F.placement)===x?F.overflows[0]>0:!0)))return{data:{index:$,overflows:O},reset:{placement:q}};let D=(A=O.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(h){case"bestFit":{var j;const H=(j=O.filter(F=>{if(C){const W=En(F.placement);return W===x||W==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(W=>W>0).reduce((W,se)=>W+se,0)]).sort((F,W)=>F[1]-W[1])[0])==null?void 0:j[0];H&&(D=H);break}case"initialPlacement":D=a;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function qm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Km(e){return X1.some(t=>e[t]>=0)}const fA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=Zn(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=qm(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Km(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),a=qm(i,n.floating);return{data:{escapedOffsets:a,escaped:Km(a)}}}default:return{}}}}},Nx=new Set(["left","top"]);async function hA(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Gn(n),a=no(n),c=En(n)==="y",l=Nx.has(i)?-1:1,u=o&&c?-1:1,d=Zn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const pA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,c=await hA(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:i}}}}},mA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x,y:_}=b;return{x,y:_}}},...l}=Zn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,l),f=En(Gn(s)),h=Vf(f);let p=u[h],m=u[f];if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=p+d[b],w=p-d[x];p=bd(_,p,w)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=m+d[b],w=m-d[x];m=bd(_,m,w)}const y=c.fn({...t,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[f]:a}}}}}},gA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Zn(e,t),u={x:n,y:r},d=En(s),f=Vf(d);let h=u[f],p=u[d];const m=Zn(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const _=f==="y"?"height":"width",w=o.reference[f]-o.floating[_]+y.mainAxis,S=o.reference[f]+o.reference[_]-y.mainAxis;h<w?h=w:h>S&&(h=S)}if(l){var b,x;const _=f==="y"?"width":"height",w=Nx.has(Gn(s)),S=o.reference[d]-o.floating[_]+(w&&((b=i.offset)==null?void 0:b[d])||0)+(w?0:y.crossAxis),C=o.reference[d]+o.reference[_]+(w?0:((x=i.offset)==null?void 0:x[d])||0)-(w?y.crossAxis:0);p<S?p=S:p>C&&(p=C)}return{[f]:h,[d]:p}}}},yA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Zn(e,t),u=await i.detectOverflow(t,l),d=Gn(s),f=no(s),h=En(s)==="y",{width:p,height:m}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const x=m-u.top-u.bottom,_=p-u.left-u.right,w=gr(m-u[y],x),S=gr(p-u[b],_),C=!t.middlewareData.shift;let k=w,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!f){const O=$t(u.left,0),N=$t(u.right,0),A=$t(u.top,0),j=$t(u.bottom,0);h?E=p-2*(O!==0||N!==0?O+N:$t(u.left,u.right)):k=m-2*(A!==0||j!==0?A+j:$t(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const P=await i.getDimensions(a.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function tl(){return typeof window<"u"}function ro(e){return Dx(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function An(e){var t;return(t=(Dx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dx(e){return tl()?e instanceof Node||e instanceof Ht(e).Node:!1}function pn(e){return tl()?e instanceof Element||e instanceof Ht(e).Element:!1}function Tn(e){return tl()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:!1}function Zm(e){return!tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}const bA=new Set(["inline","contents"]);function Ei(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bA.has(s)}const vA=new Set(["table","td","th"]);function xA(e){return vA.has(ro(e))}const _A=[":popover-open",":modal"];function nl(e){return _A.some(t=>{try{return e.matches(t)}catch{return!1}})}const wA=["transform","translate","scale","rotate","perspective"],SA=["transform","translate","scale","rotate","perspective","filter"],EA=["paint","layout","strict","content"];function Wf(e){const t=Hf(),n=pn(e)?mn(e):e;return wA.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||SA.some(r=>(n.willChange||"").includes(r))||EA.some(r=>(n.contain||"").includes(r))}function kA(e){let t=yr(e);for(;Tn(t)&&!Gs(t);){if(Wf(t))return t;if(nl(t))return null;t=yr(t)}return null}function Hf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CA=new Set(["html","body","#document"]);function Gs(e){return CA.has(ro(e))}function mn(e){return Ht(e).getComputedStyle(e)}function rl(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yr(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zm(e)&&e.host||An(e);return Zm(t)?t.host:t}function Ix(e){const t=yr(e);return Gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(t)&&Ei(t)?t:Ix(t)}function ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Ix(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=Ht(s);if(o){const a=xd(i);return t.concat(i,i.visualViewport||[],Ei(s)?s:[],a&&n?ni(a):[])}return t.concat(s,ni(s,[],n))}function xd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jx(e){const t=mn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Tn(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=hc(n)!==o||hc(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function qf(e){return pn(e)?e:e.contextElement}function Ns(e){const t=qf(e);if(!Tn(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=jx(t);let i=(o?hc(n.width):n.width)/r,a=(o?hc(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const RA=kn(0);function Lx(e){const t=Ht(e);return!Hf()||!t.visualViewport?RA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ht(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=qf(e);let i=kn(1);t&&(r?pn(r)&&(i=Ns(r)):i=Ns(e));const a=PA(o,n,r)?Lx(o):kn(0);let c=(s.left+a.x)/i.x,l=(s.top+a.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o){const f=Ht(o),h=r&&pn(r)?Ht(r):r;let p=f,m=xd(p);for(;m&&r&&h!==p;){const y=Ns(m),b=m.getBoundingClientRect(),x=mn(m),_=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,w=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=_,l+=w,p=Ht(m),m=xd(p)}}return mc({width:u,height:d,x:c,y:l})}function sl(e,t){const n=rl(e).scrollLeft;return t?t.left+n:ts(An(e)).left+n}function Fx(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function OA(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=An(r),a=t?nl(t.floating):!1;if(r===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=kn(1);const u=kn(0),d=Tn(r);if((d||!d&&!o)&&((ro(r)!=="body"||Ei(i))&&(c=rl(r)),Tn(r))){const h=ts(r);l=Ns(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!o?Fx(i,c):kn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function TA(e){return Array.from(e.getClientRects())}function MA(e){const t=An(e),n=rl(e),r=e.ownerDocument.body,s=$t(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=$t(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+sl(e);const a=-n.scrollTop;return mn(r).direction==="rtl"&&(i+=$t(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}const Gm=25;function AA(e,t){const n=Ht(e),r=An(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;const u=Hf();(!u||u&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const l=sl(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-h);p<=Gm&&(o-=p)}else l<=Gm&&(o+=l);return{width:o,height:i,x:a,y:c}}const NA=new Set(["absolute","fixed"]);function DA(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Tn(e)?Ns(e):kn(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=s*o.x,l=r*o.y;return{width:i,height:a,x:c,y:l}}function Ym(e,t,n){let r;if(t==="viewport")r=AA(e,n);else if(t==="document")r=MA(An(e));else if(pn(t))r=DA(t,n);else{const s=Lx(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return mc(r)}function zx(e,t){const n=yr(e);return n===t||!pn(n)||Gs(n)?!1:mn(n).position==="fixed"||zx(n,t)}function IA(e,t){const n=t.get(e);if(n)return n;let r=ni(e,[],!1).filter(a=>pn(a)&&ro(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?yr(e):e;for(;pn(i)&&!Gs(i);){const a=mn(i),c=Wf(i);!c&&a.position==="fixed"&&(s=null),(o?!c&&!s:!c&&a.position==="static"&&!!s&&NA.has(s.position)||Ei(i)&&!c&&zx(e,i))?r=r.filter(u=>u!==i):s=a,i=yr(i)}return t.set(e,r),r}function jA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?nl(t)?[]:IA(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=Ym(t,u,s);return l.top=$t(d.top,l.top),l.right=gr(d.right,l.right),l.bottom=gr(d.bottom,l.bottom),l.left=$t(d.left,l.left),l},Ym(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function LA(e){const{width:t,height:n}=jx(e);return{width:t,height:n}}function FA(e,t,n){const r=Tn(t),s=An(t),o=n==="fixed",i=ts(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=kn(0);function l(){c.x=sl(s)}if(r||!r&&!o)if((ro(t)!=="body"||Ei(s))&&(a=rl(t)),r){const h=ts(t,!0,o,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else s&&l();o&&!r&&s&&l();const u=s&&!r&&!o?Fx(s,a):kn(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function fu(e){return mn(e).position==="static"}function Xm(e,t){if(!Tn(e)||mn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return An(e)===n&&(n=n.ownerDocument.body),n}function $x(e,t){const n=Ht(e);if(nl(e))return n;if(!Tn(e)){let s=yr(e);for(;s&&!Gs(s);){if(pn(s)&&!fu(s))return s;s=yr(s)}return n}let r=Xm(e,t);for(;r&&xA(r)&&fu(r);)r=Xm(r,t);return r&&Gs(r)&&fu(r)&&!Wf(r)?n:r||kA(e)||n}const zA=async function(e){const t=this.getOffsetParent||$x,n=this.getDimensions,r=await n(e.floating);return{reference:FA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $A(e){return mn(e).direction==="rtl"}const VA={convertOffsetParentRelativeRectToViewportRelativeRect:OA,getDocumentElement:An,getClippingRect:jA,getOffsetParent:$x,getElementRects:zA,getClientRects:TA,getDimensions:LA,getScale:Ns,isElement:pn,isRTL:$A};function Vx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function BA(e,t){let n=null,r;const s=An(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const p=Ji(d),m=Ji(s.clientWidth-(u+f)),y=Ji(s.clientHeight-(d+h)),b=Ji(u),_={rootMargin:-p+"px "+-m+"px "+-y+"px "+-b+"px",threshold:$t(0,gr(1,c))||1};let w=!0;function S(C){const k=C[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Vx(l,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(S,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,_)}n.observe(e)}return i(!0),o}function UA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=qf(e),u=s||o?[...l?ni(l):[],...ni(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=l&&a?BA(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let p,m=c?ts(e):null;c&&y();function y(){const b=ts(e);m&&!Vx(m,b)&&n(),m=b,p=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(x=>{s&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const WA=pA,HA=mA,qA=dA,KA=yA,ZA=fA,Jm=uA,GA=gA,YA=(e,t,n)=>{const r=new Map,s={platform:VA,...n},o={...s.platform,_c:r};return lA(e,t,{...s,platform:o})};var XA=typeof document<"u",JA=function(){},Da=XA?T.useLayoutEffect:JA;function gc(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,s;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(!gc(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!gc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Bx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(e,t){const n=Bx(e);return Math.round(t*n)/n}function hu(e){const t=v.useRef(e);return Da(()=>{t.current=e}),t}function QA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);gc(f,r)||h(r);const[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(F=>{F!==C.current&&(C.current=F,m(F))},[]),_=v.useCallback(F=>{F!==k.current&&(k.current=F,b(F))},[]),w=o||p,S=i||y,C=v.useRef(null),k=v.useRef(null),E=v.useRef(u),P=c!=null,O=hu(c),N=hu(s),A=hu(l),j=v.useCallback(()=>{if(!C.current||!k.current)return;const F={placement:t,strategy:n,middleware:f};N.current&&(F.platform=N.current),YA(C.current,k.current,F).then(W=>{const se={...W,isPositioned:A.current!==!1};$.current&&!gc(E.current,se)&&(E.current=se,Ic.flushSync(()=>{d(se)}))})},[f,t,n,N,A]);Da(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[l]);const $=v.useRef(!1);Da(()=>($.current=!0,()=>{$.current=!1}),[]),Da(()=>{if(w&&(C.current=w),S&&(k.current=S),w&&S){if(O.current)return O.current(w,S,j);j()}},[w,S,j,O,P]);const q=v.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:_}),[x,_]),D=v.useMemo(()=>({reference:w,floating:S}),[w,S]),H=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!D.floating)return F;const W=Qm(D.floating,u.x),se=Qm(D.floating,u.y);return a?{...F,transform:"translate("+W+"px, "+se+"px)",...Bx(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:se}},[n,a,D.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:q,elements:D,floatingStyles:H}),[u,j,q,D,H])}const eN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Jm({element:r.current,padding:s}).fn(n):{}:r?Jm({element:r,padding:s}).fn(n):{}}}},tN=(e,t)=>({...WA(e),options:[e,t]}),nN=(e,t)=>({...HA(e),options:[e,t]}),rN=(e,t)=>({...GA(e),options:[e,t]}),sN=(e,t)=>({...qA(e),options:[e,t]}),oN=(e,t)=>({...KA(e),options:[e,t]}),iN=(e,t)=>({...ZA(e),options:[e,t]}),aN=(e,t)=>({...eN(e),options:[e,t]});var cN="Arrow",Ux=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return g.jsx(be.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ux.displayName=cN;var lN=Ux;function Wx(e){const[t,n]=v.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Kf="Popper",[Hx,ol]=wr(Kf),[uN,qx]=Hx(Kf),Kx=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return g.jsx(uN,{scope:t,anchor:r,onAnchorChange:s,children:n})};Kx.displayName=Kf;var Zx="PopperAnchor",Gx=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=qx(Zx,n),i=v.useRef(null),a=Pe(t,i),c=v.useRef(null);return v.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&o.onAnchorChange(c.current)}),r?null:g.jsx(be.div,{...s,ref:a})});Gx.displayName=Zx;var Zf="PopperContent",[dN,fN]=Hx(Zf),Yx=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,y=qx(Zf,n),[b,x]=v.useState(null),_=Pe(t,V=>x(V)),[w,S]=v.useState(null),C=Wx(w),k=C?.width??0,E=C?.height??0,P=r+(o!=="center"?"-"+o:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(l)?l:[l],A=N.length>0,j={padding:O,boundary:N.filter(pN),altBoundary:A},{refs:$,floatingStyles:q,placement:D,isPositioned:H,middlewareData:F}=QA({strategy:"fixed",placement:P,whileElementsMounted:(...V)=>UA(...V,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[tN({mainAxis:s+E,alignmentAxis:i}),c&&nN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?rN():void 0,...j}),c&&sN({...j}),oN({...j,apply:({elements:V,rects:ee,availableWidth:me,availableHeight:le})=>{const{width:fe,height:ge}=ee.reference,Ze=V.floating.style;Ze.setProperty("--radix-popper-available-width",`${me}px`),Ze.setProperty("--radix-popper-available-height",`${le}px`),Ze.setProperty("--radix-popper-anchor-width",`${fe}px`),Ze.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),w&&aN({element:w,padding:a}),mN({arrowWidth:k,arrowHeight:E}),f&&iN({strategy:"referenceHidden",...j})]}),[W,se]=Qx(D),I=On(p);vt(()=>{H&&I?.()},[H,I]);const Y=F.arrow?.x,K=F.arrow?.y,Z=F.arrow?.centerOffset!==0,[oe,ce]=v.useState();return vt(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),g.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(dN,{scope:n,placedSide:W,onArrowChange:S,arrowX:Y,arrowY:K,shouldHideArrow:Z,children:g.jsx(be.div,{"data-side":W,"data-align":se,...m,ref:_,style:{...m.style,animation:H?void 0:"none"}})})})});Yx.displayName=Zf;var Xx="PopperArrow",hN={top:"bottom",right:"left",bottom:"top",left:"right"},Jx=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=fN(Xx,r),i=hN[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(lN,{...s,ref:n,style:{...s.style,display:"block"}})})});Jx.displayName=Xx;function pN(e){return e!==null}var mN=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Qx(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(s.arrow?.x??0)+a/2,h=(s.arrow?.y??0)+c/2;let p="",m="";return l==="bottom"?(p=i?d:`${f}px`,m=`${-c}px`):l==="top"?(p=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(p=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(p=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:p,y:m}}}});function Qx(e){const[t,n="center"]=e.split("-");return[t,n]}var e_=Kx,t_=Gx,n_=Yx,r_=Jx,gN="Portal",il=v.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=v.useState(!1);vt(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?Dc.createPortal(g.jsx(be.div,{...r,ref:t}),i):null});il.displayName=gN;function yN(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Xn=e=>{const{present:t,children:n}=e,r=bN(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Pe(r.ref,vN(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};Xn.displayName="Presence";function bN(e){const[t,n]=v.useState(),r=v.useRef(null),s=v.useRef(e),o=v.useRef("none"),i=e?"mounted":"unmounted",[a,c]=yN(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Qi(r.current);o.current=a==="mounted"?l:"none"},[a]),vt(()=>{const l=r.current,u=s.current;if(u!==e){const f=o.current,h=Qi(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),vt(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Qi(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=h=>{h.target===t&&(o.current=Qi(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qi(e){return e?.animationName||"none"}function vN(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 pu="rovingFocusGroup.onEntryFocus",xN={bubbles:!1,cancelable:!0},ki="RovingFocusGroup",[_d,s_,_N]=Ff(ki),[wN,o_]=wr(ki,[_N]),[SN,EN]=wN(ki),i_=v.forwardRef((e,t)=>g.jsx(_d.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(_d.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(kN,{...e,ref:t})})}));i_.displayName=ki;var kN=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),h=Pe(t,f),p=zf(o),[m,y]=Zs({prop:i,defaultProp:a??null,onChange:c,caller:ki}),[b,x]=v.useState(!1),_=On(l),w=s_(n),S=v.useRef(!1),[C,k]=v.useState(0);return v.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(pu,_),()=>E.removeEventListener(pu,_)},[_]),g.jsx(SN,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(E=>y(E),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:v.useCallback(()=>k(E=>E-1),[]),children:g.jsx(be.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const P=!S.current;if(E.target===E.currentTarget&&P&&!b){const O=new CustomEvent(pu,xN);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const N=w().filter(D=>D.focusable),A=N.find(D=>D.active),j=N.find(D=>D.id===m),q=[A,j,...N].filter(Boolean).map(D=>D.ref.current);l_(q,u)}}S.current=!1}),onBlur:re(e.onBlur,()=>x(!1))})})}),a_="RovingFocusGroupItem",c_=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...a}=e,c=Hn(),l=o||c,u=EN(a_,n),d=u.currentTabStopId===l,f=s_(n),{onFocusableItemAdd:h,onFocusableItemRemove:p,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),g.jsx(_d.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:g.jsx(be.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:re(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=PN(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let _=f().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")_.reverse();else if(b==="prev"||b==="next"){b==="prev"&&_.reverse();const w=_.indexOf(y.currentTarget);_=u.loop?ON(_,w+1):_.slice(w+1)}setTimeout(()=>l_(_))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});c_.displayName=a_;var CN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PN(e,t,n){const r=RN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CN[r]}function l_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ON(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TN=i_,MN=c_;function AN(e){const t=NN(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(IN);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function NN(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=LN(s),a=jN(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DN=Symbol("radix.slottable");function IN(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DN}function jN(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function LN(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 FN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bs=new WeakMap,ea=new WeakMap,ta={},mu=0,u_=function(e){return e&&(e.host||u_(e.parentNode))},zN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=u_(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})},$N=function(e,t,n,r){var s=zN(t,Array.isArray(e)?e:[e]);ta[n]||(ta[n]=new WeakMap);var o=ta[n],i=[],a=new Set,c=new Set(s),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};s.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(bs.get(f)||0)+1,y=(o.get(f)||0)+1;bs.set(f,m),o.set(f,y),i.push(f),m===1&&p&&ea.set(f,!0),y===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return u(t),a.clear(),mu++,function(){i.forEach(function(d){var f=bs.get(d)-1,h=o.get(d)-1;bs.set(d,f),o.set(d,h),f||(ea.has(d)||d.removeAttribute(r),ea.delete(d)),h||d.removeAttribute(n)}),mu--,mu||(bs=new WeakMap,bs=new WeakMap,ea=new WeakMap,ta={})}},Gf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=FN(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),$N(r,s,n,"aria-hidden")):function(){return null}},Sn=function(){return Sn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Sn.apply(this,arguments)};function d_(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function VN(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ia="right-scroll-bar-position",ja="width-before-scroll-bar",BN="with-scroll-bars-hidden",UN="--removed-body-scroll-bar-size";function gu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WN(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var HN=typeof window<"u"?v.useLayoutEffect:v.useEffect,eg=new WeakMap;function qN(e,t){var n=WN(null,function(r){return e.forEach(function(s){return gu(s,r)})});return HN(function(){var r=eg.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||gu(a,null)}),o.forEach(function(a){s.has(a)||gu(a,i)})}eg.set(n,e)},[e]),n}function KN(e){return e}function ZN(e,t){t===void 0&&(t=KN);var n=[],r=!1,s={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(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var c=function(){var u=i;i=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return s}function GN(e){e===void 0&&(e={});var t=ZN(null);return t.options=Sn({async:!0,ssr:!1},e),t}var f_=function(e){var t=e.sideCar,n=d_(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 v.createElement(r,Sn({},n))};f_.isSideCarExport=!0;function YN(e,t){return e.useMedium(t),f_}var h_=GN(),yu=function(){},al=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:yu,onWheelCapture:yu,onTouchMoveCapture:yu}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,_=e.gapMode,w=d_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=qN([n,t]),k=Sn(Sn({},w),s);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:h_,removeScrollBar:l,shards:d,noRelative:h,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:_}),i?v.cloneElement(v.Children.only(a),Sn(Sn({},k),{ref:C})):v.createElement(x,Sn({},k,{className:c,ref:C}),a))});al.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};al.classNames={fullWidth:ja,zeroRight:Ia};var XN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XN();return t&&e.setAttribute("nonce",t),e}function QN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JN())&&(QN(t,n),eD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nD=function(){var e=tD();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},p_=function(){var e=nD(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},rD={left:0,top:0,right:0,gap:0},bu=function(e){return parseInt(e||"",10)||0},sD=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[bu(n),bu(r),bu(s)]},oD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rD;var t=sD(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])}},iD=p_(),Ds="data-scroll-locked",aD=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
22
|
+
.`.concat(BN,` {
|
|
23
23
|
overflow: hidden `).concat(r,`;
|
|
24
24
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
25
25
|
}
|
|
@@ -53,14 +53,14 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
body[`).concat(Ds,`] {
|
|
56
|
-
`).concat(
|
|
56
|
+
`).concat(UN,": ").concat(a,`px;
|
|
57
57
|
}
|
|
58
|
-
`)},tg=function(){var e=parseInt(document.body.getAttribute(Ds)||"0",10);return isFinite(e)?e:0},
|
|
58
|
+
`)},tg=function(){var e=parseInt(document.body.getAttribute(Ds)||"0",10);return isFinite(e)?e:0},cD=function(){v.useEffect(function(){return document.body.setAttribute(Ds,(tg()+1).toString()),function(){var e=tg()-1;e<=0?document.body.removeAttribute(Ds):document.body.setAttribute(Ds,e.toString())}},[])},lD=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;cD();var o=v.useMemo(function(){return oD(s)},[s]);return v.createElement(iD,{styles:aD(o,!t,s,n?"":"!important")})},wd=!1;if(typeof window<"u")try{var na=Object.defineProperty({},"passive",{get:function(){return wd=!0,!0}});window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{wd=!1}var vs=wd?{passive:!1}:!1,uD=function(e){return e.tagName==="TEXTAREA"},m_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uD(e)&&n[t]==="visible")},dD=function(e){return m_(e,"overflowY")},fD=function(e){return m_(e,"overflowX")},ng=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=g_(e,r);if(s){var o=y_(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hD=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pD=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},g_=function(e,t){return e==="v"?dD(t):fD(t)},y_=function(e,t){return e==="v"?hD(t):pD(t)},mD=function(e,t){return e==="h"&&t==="rtl"?-1:1},gD=function(e,t,n,r,s){var o=mD(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=y_(e,a),p=h[0],m=h[1],y=h[2],b=m-y-o*p;(p||b)&&g_(e,a)&&(d+=b,f+=p);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},ra=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rg=function(e){return[e.deltaX,e.deltaY]},sg=function(e){return e&&"current"in e?e.current:e},yD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bD=function(e){return`
|
|
59
59
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
60
60
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
61
|
-
`)},bD=0,xs=[];function vD(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(bD++)[0],o=v.useState(h_)[0],i=v.useRef(e);v.useEffect(function(){i.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=$N([e.lockRef.current],(e.shards||[]).map(sg),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var b=ra(m),x=n.current,_="deltaX"in m?m.deltaX:x[0]-b[0],w="deltaY"in m?m.deltaY:x[1]-b[1],S,C=m.target,k=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in m&&k==="h"&&C.type==="range")return!1;var E=window.getSelection(),P=E&&E.anchorNode,O=P?P===C||P.contains(C):!1;if(O)return!1;var N=ng(k,C);if(!N)return!0;if(N?S=k:(S=k==="v"?"h":"v",N=ng(k,C)),!N)return!1;if(!r.current&&"changedTouches"in m&&(_||w)&&(r.current=S),!S)return!0;var A=r.current||S;return mD(A,y,m,A==="h"?_:w)},[]),c=v.useCallback(function(m){var y=m;if(!(!xs.length||xs[xs.length-1]!==o)){var b="deltaY"in y?rg(y):ra(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&gD(S.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(sg).filter(Boolean).filter(function(S){return S.contains(y.target)}),w=_.length>0?a(y,_[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),l=v.useCallback(function(m,y,b,x){var _={name:m,delta:y,target:b,should:x,shadowParent:xD(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),u=v.useCallback(function(m){n.current=ra(m),r.current=void 0},[]),d=v.useCallback(function(m){l(m.type,rg(m),m.target,a(m,e.lockRef.current))},[]),f=v.useCallback(function(m){l(m.type,ra(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return xs.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,vs),document.addEventListener("touchmove",c,vs),document.addEventListener("touchstart",u,vs),function(){xs=xs.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,vs),document.removeEventListener("touchmove",c,vs),document.removeEventListener("touchstart",u,vs)}},[]);var h=e.removeScrollBar,p=e.inert;return v.createElement(v.Fragment,null,p?v.createElement(o,{styles:yD(s)}):null,h?v.createElement(cD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _D=GN(f_,vD);var cl=v.forwardRef(function(e,t){return v.createElement(al,Sn({},e,{ref:t,sideCar:_D}))});cl.classNames=al.classNames;var Sd=["Enter"," "],wD=["ArrowDown","PageUp","Home"],y_=["ArrowUp","PageDown","End"],SD=[...wD,...y_],ED={ltr:[...Sd,"ArrowRight"],rtl:[...Sd,"ArrowLeft"]},kD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ci="Menu",[ri,CD,RD]=Ff(Ci),[us,b_]=wr(Ci,[RD,ol,s_]),ll=ol(),v_=s_(),[PD,ds]=us(Ci),[OD,Ri]=us(Ci),x_=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,a=ll(t),[c,l]=v.useState(null),u=v.useRef(!1),d=On(o),f=zf(s);return v.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(Qx,{...a,children:g.jsx(PD,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:g.jsx(OD,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};x_.displayName=Ci;var TD="MenuAnchor",Yf=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(e_,{...s,...r,ref:t})});Yf.displayName=TD;var Xf="MenuPortal",[MD,__]=us(Xf,{forceMount:void 0}),w_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ds(Xf,t);return g.jsx(MD,{scope:t,forceMount:n,children:g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:r})})})};w_.displayName=Xf;var en="MenuContent",[AD,Jf]=us(en),S_=v.forwardRef((e,t)=>{const n=__(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:i.modal?g.jsx(ND,{...s,ref:t}):g.jsx(DD,{...s,ref:t})})})})}),ND=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(Qf,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DD=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu);return g.jsx(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ID=MN("MenuContent.ScrollLock"),Qf=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,y=ds(en,n),b=Ri(en,n),x=ll(n),_=v_(n),w=CD(n),[S,C]=v.useState(null),k=v.useRef(null),E=Pe(t,k,y.onContentChange),P=v.useRef(0),O=v.useRef(""),N=v.useRef(0),A=v.useRef(null),j=v.useRef("right"),$=v.useRef(0),q=p?cl:v.Fragment,D=p?{as:ID,allowPinchZoom:!0}:void 0,H=W=>{const se=O.current+W,I=w().filter(V=>!V.disabled),Y=document.activeElement,K=I.find(V=>V.ref.current===Y)?.textValue,Z=I.map(V=>V.textValue),oe=KD(Z,se,K),ce=I.find(V=>V.textValue===oe)?.ref.current;(function V(ee){O.current=ee,window.clearTimeout(P.current),ee!==""&&(P.current=window.setTimeout(()=>V(""),1e3))})(se),ce&&setTimeout(()=>ce.focus())};v.useEffect(()=>()=>window.clearTimeout(P.current),[]),$f();const F=v.useCallback(W=>j.current===A.current?.side&&GD(W,A.current?.area),[]);return g.jsx(AD,{scope:n,searchRef:O,onItemEnter:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),onItemLeave:v.useCallback(W=>{F(W)||(k.current?.focus(),C(null))},[F]),onTriggerLeave:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),pointerGraceTimerRef:N,onPointerGraceIntentChange:v.useCallback(W=>{A.current=W},[]),children:g.jsx(q,{...D,children:g.jsx(el,{asChild:!0,trapped:s,onMountAutoFocus:re(o,W=>{W.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(ON,{asChild:!0,..._,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:re(c,W=>{b.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(t_,{role:"menu","aria-orientation":"vertical","data-state":z_(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:re(m.onKeyDown,W=>{const I=W.target.closest("[data-radix-menu-content]")===W.currentTarget,Y=W.ctrlKey||W.altKey||W.metaKey,K=W.key.length===1;I&&(W.key==="Tab"&&W.preventDefault(),!Y&&K&&H(W.key));const Z=k.current;if(W.target!==Z||!SD.includes(W.key))return;W.preventDefault();const ce=w().filter(V=>!V.disabled).map(V=>V.ref.current);y_.includes(W.key)&&ce.reverse(),HD(ce)}),onBlur:re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(P.current),O.current="")}),onPointerMove:re(e.onPointerMove,si(W=>{const se=W.target,I=$.current!==W.clientX;if(W.currentTarget.contains(se)&&I){const Y=W.clientX>$.current?"right":"left";j.current=Y,$.current=W.clientX}}))})})})})})})});S_.displayName=en;var jD="MenuGroup",eh=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"group",...r,ref:t})});eh.displayName=jD;var LD="MenuLabel",E_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{...r,ref:t})});E_.displayName=LD;var yc="MenuItem",og="menu.itemSelect",ul=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),i=Ri(yc,e.__scopeMenu),a=Jf(yc,e.__scopeMenu),c=Pe(t,o),l=v.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(og,{bubbles:!0,cancelable:!0});d.addEventListener(og,h=>r?.(h),{once:!0}),Rx(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return g.jsx(k_,{...s,ref:c,disabled:n,onClick:re(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:re(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:re(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Sd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ul.displayName=yc;var k_=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=Jf(yc,n),a=v_(n),c=v.useRef(null),l=Pe(t,c),[u,d]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const p=c.current;p&&h((p.textContent??"").trim())},[o.children]),g.jsx(ri.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:g.jsx(TN,{asChild:!0,...a,focusable:!r,children:g.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:re(e.onPointerMove,si(p=>{r?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,si(p=>i.onItemLeave(p))),onFocus:re(e.onFocus,()=>d(!0)),onBlur:re(e.onBlur,()=>d(!1))})})})}),FD="MenuCheckboxItem",C_=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(M_,{scope:e.__scopeMenu,checked:n,children:g.jsx(ul,{role:"menuitemcheckbox","aria-checked":bc(n)?"mixed":n,...s,ref:t,"data-state":nh(n),onSelect:re(s.onSelect,()=>r?.(bc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C_.displayName=FD;var R_="MenuRadioGroup",[zD,$D]=us(R_,{value:void 0,onValueChange:()=>{}}),P_=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=On(r);return g.jsx(zD,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(eh,{...s,ref:t})})});P_.displayName=R_;var O_="MenuRadioItem",T_=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=$D(O_,e.__scopeMenu),o=n===s.value;return g.jsx(M_,{scope:e.__scopeMenu,checked:o,children:g.jsx(ul,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":nh(o),onSelect:re(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});T_.displayName=O_;var th="MenuItemIndicator",[M_,VD]=us(th,{checked:!1}),A_=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=VD(th,n);return g.jsx(Xn,{present:r||bc(o.checked)||o.checked===!0,children:g.jsx(be.span,{...s,ref:t,"data-state":nh(o.checked)})})});A_.displayName=th;var BD="MenuSeparator",N_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});N_.displayName=BD;var UD="MenuArrow",D_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(n_,{...s,...r,ref:t})});D_.displayName=UD;var WD="MenuSub",[ZH,I_]=us(WD),Po="MenuSubTrigger",j_=v.forwardRef((e,t)=>{const n=ds(Po,e.__scopeMenu),r=Ri(Po,e.__scopeMenu),s=I_(Po,e.__scopeMenu),o=Jf(Po,e.__scopeMenu),i=v.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,l={__scopeMenu:e.__scopeMenu},u=v.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),g.jsx(Yf,{asChild:!0,...l,children:g.jsx(k_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":z_(n.open),...e,ref:Yn(t,s.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,si(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:re(e.onPointerLeave,si(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,p=h==="right",m=p?-5:5,y=f[p?"left":"right"],b=f[p?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:y,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:y,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,d=>{const f=o.searchRef.current!=="";e.disabled||f&&d.key===" "||ED[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});j_.displayName=Po;var L_="MenuSubContent",F_=v.forwardRef((e,t)=>{const n=__(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu),a=I_(L_,e.__scopeMenu),c=v.useRef(null),l=Pe(t,c);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:g.jsx(Qf,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&c.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:re(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:re(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=kD[i.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});F_.displayName=L_;function z_(e){return e?"open":"closed"}function bc(e){return e==="indeterminate"}function nh(e){return bc(e)?"indeterminate":e?"checked":"unchecked"}function HD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function KD(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=qD(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ZD(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],c=t[i],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(s=!s)}return s}function GD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ZD(n,t)}function si(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YD=x_,XD=Yf,JD=w_,QD=S_,eI=eh,tI=E_,nI=ul,rI=C_,sI=P_,oI=T_,iI=A_,aI=N_,cI=D_,lI=j_,uI=F_,dl="DropdownMenu",[dI]=wr(dl,[b_]),Rt=b_(),[fI,$_]=dI(dl),V_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,c=Rt(t),l=v.useRef(null),[u,d]=Zs({prop:s,defaultProp:o??!1,onChange:i,caller:dl});return g.jsx(fI,{scope:t,triggerId:Hn(),triggerRef:l,contentId:Hn(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:a,children:g.jsx(YD,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};V_.displayName=dl;var B_="DropdownMenuTrigger",U_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=$_(B_,n),i=Rt(n);return g.jsx(XD,{asChild:!0,...i,children:g.jsx(be.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Yn(t,o.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});U_.displayName=B_;var hI="DropdownMenuPortal",W_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Rt(t);return g.jsx(JD,{...r,...n})};W_.displayName=hI;var H_="DropdownMenuContent",q_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=$_(H_,n),o=Rt(n),i=v.useRef(!1);return g.jsx(QD,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{i.current||s.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!s.modal||u)&&(i.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)"}})});q_.displayName=H_;var pI="DropdownMenuGroup",mI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(eI,{...s,...r,ref:t})});mI.displayName=pI;var gI="DropdownMenuLabel",yI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(tI,{...s,...r,ref:t})});yI.displayName=gI;var bI="DropdownMenuItem",K_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(nI,{...s,...r,ref:t})});K_.displayName=bI;var vI="DropdownMenuCheckboxItem",xI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(rI,{...s,...r,ref:t})});xI.displayName=vI;var _I="DropdownMenuRadioGroup",wI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(sI,{...s,...r,ref:t})});wI.displayName=_I;var SI="DropdownMenuRadioItem",EI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(oI,{...s,...r,ref:t})});EI.displayName=SI;var kI="DropdownMenuItemIndicator",CI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(iI,{...s,...r,ref:t})});CI.displayName=kI;var RI="DropdownMenuSeparator",PI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(aI,{...s,...r,ref:t})});PI.displayName=RI;var OI="DropdownMenuArrow",TI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(cI,{...s,...r,ref:t})});TI.displayName=OI;var MI="DropdownMenuSubTrigger",AI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(lI,{...s,...r,ref:t})});AI.displayName=MI;var NI="DropdownMenuSubContent",DI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(uI,{...s,...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)"}})});DI.displayName=NI;var II=V_,jI=U_,LI=W_,FI=q_,zI=K_;function $I({...e}){return g.jsx(II,{"data-slot":"dropdown-menu",...e})}function VI({...e}){return g.jsx(jI,{"data-slot":"dropdown-menu-trigger",...e})}function BI({className:e,sideOffset:t=4,...n}){return g.jsx(LI,{children:g.jsx(FI,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Se("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 sa({className:e,inset:t,variant:n="default",...r}){return g.jsx(zI,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Se("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})}const UI=e=>{switch(e.toLowerCase()){case"http":return g.jsx(UM,{size:20});case"ping":return g.jsx(cu,{size:20});case"tcp":return g.jsx(r1,{size:20});case"dns":return g.jsx(t1,{size:20});case"keyword":return g.jsx(Sx,{size:20});case"json_query":return g.jsx(zM,{size:20});case"push":return g.jsx(QM,{size:20});case"steam":return g.jsx(cu,{size:20});default:return g.jsx(cu,{size:20})}},WI=T.memo(function({summary:t,onEdit:n,onDelete:r,onPause:s,onClone:o,onDetails:i}){const{monitor:a,latest:c,bars:l,uptimePct:u}=t,d=c?.status??"unknown",f=d==="up"?"text-emerald-500":d==="down"?"text-red-500":"text-muted-foreground",h=d==="up"?"hover:border-emerald-500/50":d==="down"?"hover:border-red-500/50":"hover:border-neutral-500/50";return g.jsxs("div",{className:Se("bg-card hover:bg-muted/50 relative cursor-pointer rounded-lg border p-4 transition-all duration-200 hover:shadow-sm flex flex-col justify-between",h),onClick:()=>i(a),children:[g.jsxs("div",{className:"flex items-start justify-between mb-4",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"bg-muted flex size-10 items-center justify-center rounded-lg p-2 text-muted-foreground",children:UI(a.type)}),g.jsxs("div",{children:[g.jsx("h3",{className:"font-semibold line-clamp-1",children:a.name}),g.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[g.jsx("span",{className:"uppercase",children:a.type}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[a.intervalSeconds,"s"]})]})]})]}),g.jsxs($I,{children:[g.jsx(VI,{asChild:!0,children:g.jsx(gt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground",onClick:p=>p.stopPropagation(),children:g.jsx(VM,{className:"h-4 w-4"})})}),g.jsxs(BI,{align:"end",children:[g.jsxs(sa,{onClick:p=>{p.stopPropagation(),n(a)},children:[g.jsx(_x,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),o(a)},children:[g.jsx(vx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),s(a)},children:[a.isPaused?g.jsx(wx,{className:"mr-2 h-4 w-4"}):g.jsx(xx,{className:"mr-2 h-4 w-4"}),a.isPaused?"Resume":"Pause"]}),g.jsxs(sa,{className:"text-red-600",onClick:p=>{p.stopPropagation(),r(a)},children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),g.jsxs("div",{className:"space-y-4 mb-2",children:[g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Status"}),g.jsxs("div",{className:Se("font-medium flex items-center gap-2",f),children:[g.jsx("span",{className:Se("h-2 w-2 rounded-full",d==="up"?"bg-emerald-500":d==="down"?"bg-red-500":"bg-neutral-400")}),a.isPaused?"Paused":d.toUpperCase()]})]}),g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Response"}),g.jsx("div",{className:"font-medium",children:c?.pingMs?`${c.pingMs} ms`:"—"})]}),g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[g.jsx("span",{children:"Uptime (24h)"}),g.jsxs("span",{className:u>=98?"text-emerald-500":"text-yellow-500",children:[Math.round(u),"%"]})]}),g.jsx("div",{className:"flex gap-[2px] h-6 items-end",children:l.slice(-20).map((p,m)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-80",p==="up"?"bg-emerald-500 h-4":p==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-700 h-4")},m))})]})]})]})}),ig=(e,t,n)=>{if(e&&"reportValidity"in e){const r=X(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ed=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?ig(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>ig(s,n,e))}},ag=(e,t)=>{t.shouldUseNativeValidation&&Ed(e,t);const n={};for(const r in e){const s=X(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(HI(t.names||Object.keys(e),r)){const i=Object.assign({},X(n,r));ke(i,"root",o),ke(n,r,i)}else ke(n,r,o)}return n},HI=(e,t)=>{const n=cg(t);return e.some(r=>cg(r).match(`^${n}\\.\\d+`))};function cg(e){return e.replace(/\]|\[/g,"")}function U(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d];f in a||(a[f]=l[f].bind(a))}}const s=n?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const l=n?.Parent?new o:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Is extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Z_ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const G_={};function ns(e){return G_}function Y_(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function kd(e,t){return typeof t=="bigint"?t.toString():t}function rh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sh(e){return e==null}function oh(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qI(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=n>s?n:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const lg=Symbol("evaluating");function Re(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lg)return r===void 0&&(r=lg,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function fs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Sr(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ug(e){return JSON.stringify(e)}function KI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ZI=rh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oi(e){if(vc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(vc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function J_(e){return oi(e)?{...e}:Array.isArray(e)?[...e]:e}const GI=new Set(["string","number","symbol"]);function fl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(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 YI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const XI={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 JI(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 o=Sr(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function QI(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 o=Sr(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function ej(e,t){if(!oi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Sr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return fs(this,"shape",o),o}});return Er(e,s)}function tj(e,t){if(!oi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fs(this,"shape",r),r}});return Er(e,n)}function nj(e,t){const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fs(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Er(e,n)}function rj(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Sr(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return fs(this,"shape",c),c},checks:[]});return Er(t,i)}function sj(e,t,n){const r=Sr(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return fs(this,"shape",o),o}});return Er(t,r)}function Cs(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 Q_(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function oa(e){return typeof e=="string"?e:e?.message}function rs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=oa(e.inst?._zod.def?.error?.(e))??oa(t?.error?.(e))??oa(n.customError?.(e))??oa(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ih(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ii(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ew=(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,kd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ah=U("$ZodError",ew),hl=U("$ZodError",ew,{Parent:Error});function oj(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function ij(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>r({issues:i}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let i=n,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const pl=e=>(t,n,r,s)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Is;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw X_(a,s?.callee),a}return i.value},aj=pl(hl),ml=e=>async(t,n,r,s)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw X_(a,s?.callee),a}return i.value},cj=ml(hl),gl=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Is;return o.issues.length?{success:!1,error:new(e??ah)(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},lj=gl(hl),yl=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},uj=yl(hl),dj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pl(e)(t,n,s)},fj=e=>(t,n,r)=>pl(e)(t,n,r),hj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ml(e)(t,n,s)},pj=e=>async(t,n,r)=>ml(e)(t,n,r),mj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gl(e)(t,n,s)},gj=e=>(t,n,r)=>gl(e)(t,n,r),yj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yl(e)(t,n,s)},bj=e=>async(t,n,r)=>yl(e)(t,n,r),vj=/^[cC][^\s-]{8,}$/,xj=/^[0-9a-z]+$/,_j=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wj=/^[0-9a-vA-V]{20}$/,Sj=/^[A-Za-z0-9]{27}$/,Ej=/^[a-zA-Z0-9_-]{21}$/,kj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Cj=/^([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})$/,dg=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)$/,Rj=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Pj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Oj(){return new RegExp(Pj,"u")}const Tj=/^(?:(?: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])$/,Mj=/^(([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}|:))$/,Aj=/^((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])$/,Nj=/^(([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])$/,Dj=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tw=/^[A-Za-z0-9_-]*$/,Ij=/^\+[1-9]\d{6,14}$/,nw="(?:(?:\\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])))",jj=new RegExp(`^${nw}$`);function rw(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 Lj(e){return new RegExp(`^${rw(e)}$`)}function Fj(e){const t=rw({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(`^${nw}T(?:${r})$`)}const zj=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$j=/^-?\d+$/,Vj=/^-?\d+(?:\.\d+)?$/,Bj=/^[^A-Z]*$/,Uj=/^[^a-z]*$/,jt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sw={number:"number",bigint:"bigint",object:"date"},ow=U("$ZodCheckLessThan",(e,t)=>{jt.init(e,t);const n=sw[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.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})}}),iw=U("$ZodCheckGreaterThan",(e,t)=>{jt.init(e,t);const n=sw[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.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})}}),Wj=U("$ZodCheckMultipleOf",(e,t)=>{jt.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):qI(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})}}),Hj=U("$ZodCheckNumberFormat",(e,t)=>{jt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,o]=XI[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,n&&(a.pattern=$j)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,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}):i.issues.push({input:a,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}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),qj=U("$ZodCheckMaxLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=ih(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Kj=U("$ZodCheckMinLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=ih(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zj=U("$ZodCheckLengthEquals",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=ih(s),a=o>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;jt.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gj=U("$ZodCheckRegex",(e,t)=>{bl.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})}}),Yj=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bj),bl.init(e,t)}),Xj=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Uj),bl.init(e,t)}),Jj=U("$ZodCheckIncludes",(e,t)=>{jt.init(e,t);const n=fl(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Qj=U("$ZodCheckStartsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`^${fl(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),eL=U("$ZodCheckEndsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`.*${fl(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),tL=U("$ZodCheckOverwrite",(e,t)=>{jt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class nL{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(`
|
|
61
|
+
`)},vD=0,xs=[];function xD(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(vD++)[0],o=v.useState(p_)[0],i=v.useRef(e);v.useEffect(function(){i.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=VN([e.lockRef.current],(e.shards||[]).map(sg),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var b=ra(m),x=n.current,_="deltaX"in m?m.deltaX:x[0]-b[0],w="deltaY"in m?m.deltaY:x[1]-b[1],S,C=m.target,k=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in m&&k==="h"&&C.type==="range")return!1;var E=window.getSelection(),P=E&&E.anchorNode,O=P?P===C||P.contains(C):!1;if(O)return!1;var N=ng(k,C);if(!N)return!0;if(N?S=k:(S=k==="v"?"h":"v",N=ng(k,C)),!N)return!1;if(!r.current&&"changedTouches"in m&&(_||w)&&(r.current=S),!S)return!0;var A=r.current||S;return gD(A,y,m,A==="h"?_:w)},[]),c=v.useCallback(function(m){var y=m;if(!(!xs.length||xs[xs.length-1]!==o)){var b="deltaY"in y?rg(y):ra(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&yD(S.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(sg).filter(Boolean).filter(function(S){return S.contains(y.target)}),w=_.length>0?a(y,_[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),l=v.useCallback(function(m,y,b,x){var _={name:m,delta:y,target:b,should:x,shadowParent:_D(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),u=v.useCallback(function(m){n.current=ra(m),r.current=void 0},[]),d=v.useCallback(function(m){l(m.type,rg(m),m.target,a(m,e.lockRef.current))},[]),f=v.useCallback(function(m){l(m.type,ra(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return xs.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,vs),document.addEventListener("touchmove",c,vs),document.addEventListener("touchstart",u,vs),function(){xs=xs.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,vs),document.removeEventListener("touchmove",c,vs),document.removeEventListener("touchstart",u,vs)}},[]);var h=e.removeScrollBar,p=e.inert;return v.createElement(v.Fragment,null,p?v.createElement(o,{styles:bD(s)}):null,h?v.createElement(lD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _D(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wD=YN(h_,xD);var cl=v.forwardRef(function(e,t){return v.createElement(al,Sn({},e,{ref:t,sideCar:wD}))});cl.classNames=al.classNames;var Sd=["Enter"," "],SD=["ArrowDown","PageUp","Home"],b_=["ArrowUp","PageDown","End"],ED=[...SD,...b_],kD={ltr:[...Sd,"ArrowRight"],rtl:[...Sd,"ArrowLeft"]},CD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ci="Menu",[ri,RD,PD]=Ff(Ci),[us,v_]=wr(Ci,[PD,ol,o_]),ll=ol(),x_=o_(),[OD,ds]=us(Ci),[TD,Ri]=us(Ci),__=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,a=ll(t),[c,l]=v.useState(null),u=v.useRef(!1),d=On(o),f=zf(s);return v.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(e_,{...a,children:g.jsx(OD,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:g.jsx(TD,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};__.displayName=Ci;var MD="MenuAnchor",Yf=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(t_,{...s,...r,ref:t})});Yf.displayName=MD;var Xf="MenuPortal",[AD,w_]=us(Xf,{forceMount:void 0}),S_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ds(Xf,t);return g.jsx(AD,{scope:t,forceMount:n,children:g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:r})})})};S_.displayName=Xf;var en="MenuContent",[ND,Jf]=us(en),E_=v.forwardRef((e,t)=>{const n=w_(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:i.modal?g.jsx(DD,{...s,ref:t}):g.jsx(ID,{...s,ref:t})})})})}),DD=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu),r=v.useRef(null),s=Pe(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(Qf,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ID=v.forwardRef((e,t)=>{const n=ds(en,e.__scopeMenu);return g.jsx(Qf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),jD=AN("MenuContent.ScrollLock"),Qf=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,y=ds(en,n),b=Ri(en,n),x=ll(n),_=x_(n),w=RD(n),[S,C]=v.useState(null),k=v.useRef(null),E=Pe(t,k,y.onContentChange),P=v.useRef(0),O=v.useRef(""),N=v.useRef(0),A=v.useRef(null),j=v.useRef("right"),$=v.useRef(0),q=p?cl:v.Fragment,D=p?{as:jD,allowPinchZoom:!0}:void 0,H=W=>{const se=O.current+W,I=w().filter(V=>!V.disabled),Y=document.activeElement,K=I.find(V=>V.ref.current===Y)?.textValue,Z=I.map(V=>V.textValue),oe=ZD(Z,se,K),ce=I.find(V=>V.textValue===oe)?.ref.current;(function V(ee){O.current=ee,window.clearTimeout(P.current),ee!==""&&(P.current=window.setTimeout(()=>V(""),1e3))})(se),ce&&setTimeout(()=>ce.focus())};v.useEffect(()=>()=>window.clearTimeout(P.current),[]),$f();const F=v.useCallback(W=>j.current===A.current?.side&&YD(W,A.current?.area),[]);return g.jsx(ND,{scope:n,searchRef:O,onItemEnter:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),onItemLeave:v.useCallback(W=>{F(W)||(k.current?.focus(),C(null))},[F]),onTriggerLeave:v.useCallback(W=>{F(W)&&W.preventDefault()},[F]),pointerGraceTimerRef:N,onPointerGraceIntentChange:v.useCallback(W=>{A.current=W},[]),children:g.jsx(q,{...D,children:g.jsx(el,{asChild:!0,trapped:s,onMountAutoFocus:re(o,W=>{W.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(TN,{asChild:!0,..._,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:re(c,W=>{b.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(n_,{role:"menu","aria-orientation":"vertical","data-state":$_(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:E,style:{outline:"none",...m.style},onKeyDown:re(m.onKeyDown,W=>{const I=W.target.closest("[data-radix-menu-content]")===W.currentTarget,Y=W.ctrlKey||W.altKey||W.metaKey,K=W.key.length===1;I&&(W.key==="Tab"&&W.preventDefault(),!Y&&K&&H(W.key));const Z=k.current;if(W.target!==Z||!ED.includes(W.key))return;W.preventDefault();const ce=w().filter(V=>!V.disabled).map(V=>V.ref.current);b_.includes(W.key)&&ce.reverse(),qD(ce)}),onBlur:re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(P.current),O.current="")}),onPointerMove:re(e.onPointerMove,si(W=>{const se=W.target,I=$.current!==W.clientX;if(W.currentTarget.contains(se)&&I){const Y=W.clientX>$.current?"right":"left";j.current=Y,$.current=W.clientX}}))})})})})})})});E_.displayName=en;var LD="MenuGroup",eh=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"group",...r,ref:t})});eh.displayName=LD;var FD="MenuLabel",k_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{...r,ref:t})});k_.displayName=FD;var yc="MenuItem",og="menu.itemSelect",ul=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),i=Ri(yc,e.__scopeMenu),a=Jf(yc,e.__scopeMenu),c=Pe(t,o),l=v.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(og,{bubbles:!0,cancelable:!0});d.addEventListener(og,h=>r?.(h),{once:!0}),Px(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return g.jsx(C_,{...s,ref:c,disabled:n,onClick:re(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:re(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:re(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Sd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ul.displayName=yc;var C_=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=Jf(yc,n),a=x_(n),c=v.useRef(null),l=Pe(t,c),[u,d]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const p=c.current;p&&h((p.textContent??"").trim())},[o.children]),g.jsx(ri.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:g.jsx(MN,{asChild:!0,...a,focusable:!r,children:g.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:re(e.onPointerMove,si(p=>{r?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,si(p=>i.onItemLeave(p))),onFocus:re(e.onFocus,()=>d(!0)),onBlur:re(e.onBlur,()=>d(!1))})})})}),zD="MenuCheckboxItem",R_=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return g.jsx(A_,{scope:e.__scopeMenu,checked:n,children:g.jsx(ul,{role:"menuitemcheckbox","aria-checked":bc(n)?"mixed":n,...s,ref:t,"data-state":nh(n),onSelect:re(s.onSelect,()=>r?.(bc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});R_.displayName=zD;var P_="MenuRadioGroup",[$D,VD]=us(P_,{value:void 0,onValueChange:()=>{}}),O_=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=On(r);return g.jsx($D,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(eh,{...s,ref:t})})});O_.displayName=P_;var T_="MenuRadioItem",M_=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=VD(T_,e.__scopeMenu),o=n===s.value;return g.jsx(A_,{scope:e.__scopeMenu,checked:o,children:g.jsx(ul,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":nh(o),onSelect:re(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});M_.displayName=T_;var th="MenuItemIndicator",[A_,BD]=us(th,{checked:!1}),N_=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=BD(th,n);return g.jsx(Xn,{present:r||bc(o.checked)||o.checked===!0,children:g.jsx(be.span,{...s,ref:t,"data-state":nh(o.checked)})})});N_.displayName=th;var UD="MenuSeparator",D_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});D_.displayName=UD;var WD="MenuArrow",I_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ll(n);return g.jsx(r_,{...s,...r,ref:t})});I_.displayName=WD;var HD="MenuSub",[ZH,j_]=us(HD),Po="MenuSubTrigger",L_=v.forwardRef((e,t)=>{const n=ds(Po,e.__scopeMenu),r=Ri(Po,e.__scopeMenu),s=j_(Po,e.__scopeMenu),o=Jf(Po,e.__scopeMenu),i=v.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,l={__scopeMenu:e.__scopeMenu},u=v.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),g.jsx(Yf,{asChild:!0,...l,children:g.jsx(C_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":$_(n.open),...e,ref:Yn(t,s.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,si(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:re(e.onPointerLeave,si(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const h=n.content?.dataset.side,p=h==="right",m=p?-5:5,y=f[p?"left":"right"],b=f[p?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:y,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:y,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,d=>{const f=o.searchRef.current!=="";e.disabled||f&&d.key===" "||kD[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});L_.displayName=Po;var F_="MenuSubContent",z_=v.forwardRef((e,t)=>{const n=w_(en,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ds(en,e.__scopeMenu),i=Ri(en,e.__scopeMenu),a=j_(F_,e.__scopeMenu),c=v.useRef(null),l=Pe(t,c);return g.jsx(ri.Provider,{scope:e.__scopeMenu,children:g.jsx(Xn,{present:r||o.open,children:g.jsx(ri.Slot,{scope:e.__scopeMenu,children:g.jsx(Qf,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&c.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:re(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:re(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=CD[i.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});z_.displayName=F_;function $_(e){return e?"open":"closed"}function bc(e){return e==="indeterminate"}function nh(e){return bc(e)?"indeterminate":e?"checked":"unchecked"}function qD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function KD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ZD(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=KD(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function GD(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],c=t[i],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(s=!s)}return s}function YD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GD(n,t)}function si(e){return t=>t.pointerType==="mouse"?e(t):void 0}var XD=__,JD=Yf,QD=S_,eI=E_,tI=eh,nI=k_,rI=ul,sI=R_,oI=O_,iI=M_,aI=N_,cI=D_,lI=I_,uI=L_,dI=z_,dl="DropdownMenu",[fI]=wr(dl,[v_]),Rt=v_(),[hI,V_]=fI(dl),B_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,c=Rt(t),l=v.useRef(null),[u,d]=Zs({prop:s,defaultProp:o??!1,onChange:i,caller:dl});return g.jsx(hI,{scope:t,triggerId:Hn(),triggerRef:l,contentId:Hn(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:a,children:g.jsx(XD,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};B_.displayName=dl;var U_="DropdownMenuTrigger",W_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=V_(U_,n),i=Rt(n);return g.jsx(JD,{asChild:!0,...i,children:g.jsx(be.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Yn(t,o.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});W_.displayName=U_;var pI="DropdownMenuPortal",H_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Rt(t);return g.jsx(QD,{...r,...n})};H_.displayName=pI;var q_="DropdownMenuContent",K_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=V_(q_,n),o=Rt(n),i=v.useRef(!1);return g.jsx(eI,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{i.current||s.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!s.modal||u)&&(i.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)"}})});K_.displayName=q_;var mI="DropdownMenuGroup",gI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(tI,{...s,...r,ref:t})});gI.displayName=mI;var yI="DropdownMenuLabel",bI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(nI,{...s,...r,ref:t})});bI.displayName=yI;var vI="DropdownMenuItem",Z_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(rI,{...s,...r,ref:t})});Z_.displayName=vI;var xI="DropdownMenuCheckboxItem",_I=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(sI,{...s,...r,ref:t})});_I.displayName=xI;var wI="DropdownMenuRadioGroup",SI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(oI,{...s,...r,ref:t})});SI.displayName=wI;var EI="DropdownMenuRadioItem",kI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(iI,{...s,...r,ref:t})});kI.displayName=EI;var CI="DropdownMenuItemIndicator",RI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(aI,{...s,...r,ref:t})});RI.displayName=CI;var PI="DropdownMenuSeparator",OI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(cI,{...s,...r,ref:t})});OI.displayName=PI;var TI="DropdownMenuArrow",MI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(lI,{...s,...r,ref:t})});MI.displayName=TI;var AI="DropdownMenuSubTrigger",NI=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(uI,{...s,...r,ref:t})});NI.displayName=AI;var DI="DropdownMenuSubContent",II=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Rt(n);return g.jsx(dI,{...s,...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)"}})});II.displayName=DI;var jI=B_,LI=W_,FI=H_,zI=K_,$I=Z_;function VI({...e}){return g.jsx(jI,{"data-slot":"dropdown-menu",...e})}function BI({...e}){return g.jsx(LI,{"data-slot":"dropdown-menu-trigger",...e})}function UI({className:e,sideOffset:t=4,...n}){return g.jsx(FI,{children:g.jsx(zI,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Se("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 sa({className:e,inset:t,variant:n="default",...r}){return g.jsx($I,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Se("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})}const WI=e=>{switch(e.toLowerCase()){case"http":return g.jsx(WM,{size:20});case"ping":return g.jsx(cu,{size:20});case"tcp":return g.jsx(s1,{size:20});case"dns":return g.jsx(n1,{size:20});case"keyword":return g.jsx(Ex,{size:20});case"json_query":return g.jsx($M,{size:20});case"push":return g.jsx(e1,{size:20});case"steam":return g.jsx(cu,{size:20});default:return g.jsx(cu,{size:20})}},HI=T.memo(function({summary:t,onEdit:n,onDelete:r,onPause:s,onClone:o,onDetails:i}){const{monitor:a,latest:c,bars:l,uptimePct:u}=t,d=c?.status??"unknown",f=d==="up"?"text-emerald-500":d==="down"?"text-red-500":"text-muted-foreground",h=d==="up"?"hover:border-emerald-500/50":d==="down"?"hover:border-red-500/50":"hover:border-neutral-500/50";return g.jsxs("div",{className:Se("bg-card hover:bg-muted/50 relative cursor-pointer rounded-lg border p-4 transition-all duration-200 hover:shadow-sm flex flex-col justify-between",h),onClick:()=>i(a),children:[g.jsxs("div",{className:"flex items-start justify-between mb-4",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"bg-muted flex size-10 items-center justify-center rounded-lg p-2 text-muted-foreground",children:WI(a.type)}),g.jsxs("div",{children:[g.jsx("h3",{className:"font-semibold line-clamp-1",children:a.name}),g.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[g.jsx("span",{className:"uppercase",children:a.type}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[a.intervalSeconds,"s"]})]})]})]}),g.jsxs(VI,{children:[g.jsx(BI,{asChild:!0,children:g.jsx(gt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground",onClick:p=>p.stopPropagation(),children:g.jsx(BM,{className:"h-4 w-4"})})}),g.jsxs(UI,{align:"end",children:[g.jsxs(sa,{onClick:p=>{p.stopPropagation(),n(a)},children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),o(a)},children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(sa,{onClick:p=>{p.stopPropagation(),s(a)},children:[a.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),a.isPaused?"Resume":"Pause"]}),g.jsxs(sa,{className:"text-red-600",onClick:p=>{p.stopPropagation(),r(a)},children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]})]}),g.jsxs("div",{className:"space-y-4 mb-2",children:[g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Status"}),g.jsxs("div",{className:Se("font-medium flex items-center gap-2",f),children:[g.jsx("span",{className:Se("h-2 w-2 rounded-full",d==="up"?"bg-emerald-500":d==="down"?"bg-red-500":"bg-neutral-400")}),a.isPaused?"Paused":d.toUpperCase()]})]}),g.jsxs("div",{className:"flex justify-between items-end text-sm",children:[g.jsx("div",{className:"text-muted-foreground",children:"Response"}),g.jsx("div",{className:"font-medium",children:c?.pingMs?`${c.pingMs} ms`:"—"})]}),g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[g.jsx("span",{children:"Uptime (24h)"}),g.jsxs("span",{className:u>=98?"text-emerald-500":"text-yellow-500",children:[Math.round(u),"%"]})]}),g.jsx("div",{className:"flex gap-[2px] h-6 items-end",children:l.slice(-20).map((p,m)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-80",p==="up"?"bg-emerald-500 h-4":p==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-700 h-4")},m))})]})]})]})}),ig=(e,t,n)=>{if(e&&"reportValidity"in e){const r=X(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Ed=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?ig(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>ig(s,n,e))}},ag=(e,t)=>{t.shouldUseNativeValidation&&Ed(e,t);const n={};for(const r in e){const s=X(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(qI(t.names||Object.keys(e),r)){const i=Object.assign({},X(n,r));ke(i,"root",o),ke(n,r,i)}else ke(n,r,o)}return n},qI=(e,t)=>{const n=cg(t);return e.some(r=>cg(r).match(`^${n}\\.\\d+`))};function cg(e){return e.replace(/\]|\[/g,"")}function U(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d];f in a||(a[f]=l[f].bind(a))}}const s=n?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const l=n?.Parent?new o:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Is extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G_ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Y_={};function ns(e){return Y_}function X_(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function kd(e,t){return typeof t=="bigint"?t.toString():t}function rh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sh(e){return e==null}function oh(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function KI(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=n>s?n:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const lg=Symbol("evaluating");function Re(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lg)return r===void 0&&(r=lg,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function fs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Sr(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ug(e){return JSON.stringify(e)}function ZI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const J_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GI=rh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oi(e){if(vc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(vc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Q_(e){return oi(e)?{...e}:Array.isArray(e)?[...e]:e}const YI=new Set(["string","number","symbol"]);function fl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(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 XI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const JI={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 QI(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 o=Sr(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function ej(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 o=Sr(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return fs(this,"shape",i),i},checks:[]});return Er(e,o)}function tj(e,t){if(!oi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Sr(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return fs(this,"shape",o),o}});return Er(e,s)}function nj(e,t){if(!oi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fs(this,"shape",r),r}});return Er(e,n)}function rj(e,t){const n=Sr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fs(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Er(e,n)}function sj(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Sr(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return fs(this,"shape",c),c},checks:[]});return Er(t,i)}function oj(e,t,n){const r=Sr(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return fs(this,"shape",o),o}});return Er(t,r)}function Cs(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 ew(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function oa(e){return typeof e=="string"?e:e?.message}function rs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=oa(e.inst?._zod.def?.error?.(e))??oa(t?.error?.(e))??oa(n.customError?.(e))??oa(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ih(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ii(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const tw=(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,kd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ah=U("$ZodError",tw),hl=U("$ZodError",tw,{Parent:Error});function ij(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function aj(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>r({issues:i}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let i=n,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const pl=e=>(t,n,r,s)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Is;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw J_(a,s?.callee),a}return i.value},cj=pl(hl),ml=e=>async(t,n,r,s)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>rs(c,o,ns())));throw J_(a,s?.callee),a}return i.value},lj=ml(hl),gl=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Is;return o.issues.length?{success:!1,error:new(e??ah)(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},uj=gl(hl),yl=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>rs(i,s,ns())))}:{success:!0,data:o.value}},dj=yl(hl),fj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pl(e)(t,n,s)},hj=e=>(t,n,r)=>pl(e)(t,n,r),pj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ml(e)(t,n,s)},mj=e=>async(t,n,r)=>ml(e)(t,n,r),gj=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gl(e)(t,n,s)},yj=e=>(t,n,r)=>gl(e)(t,n,r),bj=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yl(e)(t,n,s)},vj=e=>async(t,n,r)=>yl(e)(t,n,r),xj=/^[cC][^\s-]{8,}$/,_j=/^[0-9a-z]+$/,wj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sj=/^[0-9a-vA-V]{20}$/,Ej=/^[A-Za-z0-9]{27}$/,kj=/^[a-zA-Z0-9_-]{21}$/,Cj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rj=/^([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})$/,dg=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)$/,Pj=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tj(){return new RegExp(Oj,"u")}const Mj=/^(?:(?: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])$/,Aj=/^(([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}|:))$/,Nj=/^((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])$/,Dj=/^(([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])$/,Ij=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nw=/^[A-Za-z0-9_-]*$/,jj=/^\+[1-9]\d{6,14}$/,rw="(?:(?:\\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])))",Lj=new RegExp(`^${rw}$`);function sw(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 Fj(e){return new RegExp(`^${sw(e)}$`)}function zj(e){const t=sw({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(`^${rw}T(?:${r})$`)}const $j=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vj=/^-?\d+$/,Bj=/^-?\d+(?:\.\d+)?$/,Uj=/^[^A-Z]*$/,Wj=/^[^a-z]*$/,jt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ow={number:"number",bigint:"bigint",object:"date"},iw=U("$ZodCheckLessThan",(e,t)=>{jt.init(e,t);const n=ow[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.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})}}),aw=U("$ZodCheckGreaterThan",(e,t)=>{jt.init(e,t);const n=ow[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.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})}}),Hj=U("$ZodCheckMultipleOf",(e,t)=>{jt.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):KI(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})}}),qj=U("$ZodCheckNumberFormat",(e,t)=>{jt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,o]=JI[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,n&&(a.pattern=Vj)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,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}):i.issues.push({input:a,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}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Kj=U("$ZodCheckMaxLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=ih(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zj=U("$ZodCheckMinLength",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=ih(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Gj=U("$ZodCheckLengthEquals",(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!sh(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,o=s.length;if(o===t.length)return;const i=ih(s),a=o>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;jt.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yj=U("$ZodCheckRegex",(e,t)=>{bl.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})}}),Xj=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Uj),bl.init(e,t)}),Jj=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wj),bl.init(e,t)}),Qj=U("$ZodCheckIncludes",(e,t)=>{jt.init(e,t);const n=fl(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),eL=U("$ZodCheckStartsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`^${fl(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),tL=U("$ZodCheckEndsWith",(e,t)=>{jt.init(e,t);const n=new RegExp(`.*${fl(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),nL=U("$ZodCheckOverwrite",(e,t)=>{jt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class rL{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(`
|
|
62
62
|
`).filter(i=>i),s=Math.min(...r.map(i=>i.length-i.trimStart().length)),o=r.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,s.join(`
|
|
63
|
-
`))}}const
|
|
63
|
+
`))}}const sL={major:4,minor:3,patch:6},Qe=U("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sL;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const o of s._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,a,c)=>{let l=Cs(i),u;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(i))continue}else if(l)continue;const f=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new Is;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,i.issues.length!==f&&(l||(l=Cs(i,f)))});else{if(i.issues.length===f)continue;l||(l=Cs(i,f))}}return u?u.then(()=>i):i},o=(i,a,c)=>{if(Cs(i))return i.aborted=!0,i;const l=s(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Is;return l.then(u=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,i,a)):o(l,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Is;return c.then(l=>s(l,r,a))}return s(c,r,a)}}Re(e,"~standard",()=>({validate:s=>{try{const o=uj(e,s);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return dj(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),ch=U("$ZodString",(e,t)=>{Qe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$j(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}}),Ve=U("$ZodStringFormat",(e,t)=>{bl.init(e,t),ch.init(e,t)}),oL=U("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Rj),Ve.init(e,t)}),iL=U("$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=dg(r))}else t.pattern??(t.pattern=dg());Ve.init(e,t)}),aL=U("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Pj),Ve.init(e,t)}),cL=U("$ZodURL",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lL=U("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tj()),Ve.init(e,t)}),uL=U("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kj),Ve.init(e,t)}),dL=U("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xj),Ve.init(e,t)}),fL=U("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_j),Ve.init(e,t)}),hL=U("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wj),Ve.init(e,t)}),pL=U("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Sj),Ve.init(e,t)}),mL=U("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ej),Ve.init(e,t)}),gL=U("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zj(t)),Ve.init(e,t)}),yL=U("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Lj),Ve.init(e,t)}),bL=U("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Fj(t)),Ve.init(e,t)}),vL=U("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cj),Ve.init(e,t)}),xL=U("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Mj),Ve.init(e,t),e._zod.bag.format="ipv4"}),_L=U("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Aj),Ve.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})}}}),wL=U("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Nj),Ve.init(e,t)}),SL=U("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Dj),Ve.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,o]=r;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function cw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const EL=U("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ij),Ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{cw(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function kL(e){if(!nw.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return cw(n)}const CL=U("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nw),Ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{kL(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),RL=U("$ZodE164",(e,t)=>{t.pattern??(t.pattern=jj),Ve.init(e,t)});function PL(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const OL=U("$ZodJWT",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{PL(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),lw=U("$ZodNumber",(e,t)=>{Qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Bj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),n}}),TL=U("$ZodNumberFormat",(e,t)=>{qj.init(e,t),lw.init(e,t)}),ML=U("$ZodUnknown",(e,t)=>{Qe.init(e,t),e._zod.parse=n=>n}),AL=U("$ZodNever",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function fg(e,t,n){e.issues.length&&t.issues.push(...ew(n,e.issues)),t.value[n]=e.value}const NL=U("$ZodArray",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const o=[];for(let i=0;i<s.length;i++){const a=s[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?o.push(c.then(l=>fg(l,n,i))):fg(c,n,i)}return o.length?Promise.all(o).then(()=>n):n}});function xc(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...ew(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function uw(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=XI(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function dw(e,t,n,r,s,o){const i=[],a=s.keySet,c=s.catchall._zod,l=c.def.type,u=c.optout==="optional";for(const d in t){if(a.has(d))continue;if(l==="never"){i.push(d);continue}const f=c.run({value:t[d],issues:[]},r);f instanceof Promise?e.push(f.then(h=>xc(h,n,d,t,u))):xc(f,n,d,t,u)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const DL=U("$ZodObject",(e,t)=>{if(Qe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=rh(()=>uw(t));Re(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const d of u.values)c[l].add(d)}}return c});const s=vc,o=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],d=i.shape;for(const f of i.keys){const h=d[f],p=h._zod.optout==="optional",m=h._zod.run({value:l[f],issues:[]},c);m instanceof Promise?u.push(m.then(y=>xc(y,a,f,l,p))):xc(m,a,f,l,p)}return o?dw(u,l,a,c,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),IL=U("$ZodObjectJIT",(e,t)=>{DL.init(e,t);const n=e._zod.parse,r=rh(()=>uw(t)),s=f=>{const h=new rL(["shape","payload","ctx"]),p=r.value,m=_=>{const w=ug(_);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let b=0;for(const _ of p.keys)y[_]=`key_${b++}`;h.write("const newResult = {};");for(const _ of p.keys){const w=y[_],S=ug(_),k=f[_]?._zod?.optout==="optional";h.write(`const ${w} = ${m(_)};`),k?h.write(`
|
|
64
64
|
if (${w}.issues.length) {
|
|
65
65
|
if (${S} in input) {
|
|
66
66
|
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
@@ -94,12 +94,12 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
94
94
|
newResult[${S}] = ${w}.value;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(_,w)=>x(f,_,w)};let o;const i=vc,a=!G_.jitless,l=a&&ZI.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const p=f.value;return i(p)?a&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),f=o(f,h),u?uw([],p,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function hg(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Cs(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>rs(i,r,ns())))}),t)}const IL=U("$ZodUnion",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Re(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Re(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Re(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>oh(o.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(n)return r(s,o);let i=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:s.value,issues:[]},o);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>hg(c,s,e,o)):hg(a,s,e,o)}}),jL=U("$ZodIntersection",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,o=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,l])=>pg(n,c,l)):pg(n,o,i)}});function Cd(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(oi(e)&&oi(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),s={...e,...t};for(const o of r){const i=Cd(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}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 s=e[r],o=t[r],i=Cd(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pg(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),Cs(e))return e;const i=Cd(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const LL=U("$ZodEnum",(e,t)=>{Qe.init(e,t);const n=Y_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>GI.has(typeof s)).map(s=>typeof s=="string"?fl(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),FL=U("$ZodTransform",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Z_(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n));if(s instanceof Promise)throw new Is;return n.value=s,n}});function mg(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const dw=U("$ZodOptional",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>mg(o,n.value)):mg(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),zL=U("$ZodExactOptional",(e,t)=>{dw.init(e,t),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),$L=U("$ZodNullable",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)}|null)$`):void 0}),Re(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)}),VL=U("$ZodDefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(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 s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>gg(o,t)):gg(s,t)}});function gg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const BL=U("$ZodPrefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(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))}),UL=U("$ZodNonOptional",(e,t)=>{Qe.init(e,t),Re(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 s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>yg(o,e)):yg(s,e)}});function yg(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 WL=U("$ZodCatch",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>rs(i,r,ns()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>rs(o,r,ns()))},input:n.value}),n.issues=[]),n)}}),HL=U("$ZodPipe",(e,t)=>{Qe.init(e,t),Re(e._zod,"values",()=>t.in._zod.values),Re(e._zod,"optin",()=>t.in._zod.optin),Re(e._zod,"optout",()=>t.out._zod.optout),Re(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(i=>ia(i,t.in,r)):ia(o,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(o=>ia(o,t.out,r)):ia(s,t.out,r)}});function ia(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const qL=U("$ZodReadonly",(e,t)=>{Qe.init(e,t),Re(e._zod,"propValues",()=>t.innerType._zod.propValues),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"optin",()=>t.innerType?._zod?.optin),Re(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(bg):bg(s)}});function bg(e){return e.value=Object.freeze(e.value),e}const KL=U("$ZodCustom",(e,t)=>{jt.init(e,t),Qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(o=>vg(o,n,r,e));vg(s,n,r,e)}});function vg(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ii(s))}}var xg;class ZL{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 s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GL(){return new ZL}(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=GL());const Oo=globalThis.__zod_globalRegistry;function YL(e,t){return new e({type:"string",...ie(t)})}function XL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function _g(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function JL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function QL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function eF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function tF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function nF(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function rF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function sF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function oF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function iF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function aF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function cF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function lF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function uF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function dF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function fF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function hF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function pF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function mF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function gF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function yF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function bF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function vF(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function xF(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function _F(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function wF(e,t){return new e({type:"number",coerce:!0,checks:[],...ie(t)})}function SF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function EF(e){return new e({type:"unknown"})}function kF(e,t){return new e({type:"never",...ie(t)})}function wg(e,t){return new ow({check:"less_than",...ie(t),value:e,inclusive:!1})}function vu(e,t){return new ow({check:"less_than",...ie(t),value:e,inclusive:!0})}function Sg(e,t){return new iw({check:"greater_than",...ie(t),value:e,inclusive:!1})}function xu(e,t){return new iw({check:"greater_than",...ie(t),value:e,inclusive:!0})}function Eg(e,t){return new Wj({check:"multiple_of",...ie(t),value:e})}function fw(e,t){return new qj({check:"max_length",...ie(t),maximum:e})}function _c(e,t){return new Kj({check:"min_length",...ie(t),minimum:e})}function hw(e,t){return new Zj({check:"length_equals",...ie(t),length:e})}function CF(e,t){return new Gj({check:"string_format",format:"regex",...ie(t),pattern:e})}function RF(e){return new Yj({check:"string_format",format:"lowercase",...ie(e)})}function PF(e){return new Xj({check:"string_format",format:"uppercase",...ie(e)})}function OF(e,t){return new Jj({check:"string_format",format:"includes",...ie(t),includes:e})}function TF(e,t){return new Qj({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function MF(e,t){return new eL({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function so(e){return new tL({check:"overwrite",tx:e})}function AF(e){return so(t=>t.normalize(e))}function NF(){return so(e=>e.trim())}function DF(){return so(e=>e.toLowerCase())}function IF(){return so(e=>e.toUpperCase())}function jF(){return so(e=>KI(e))}function LF(e,t,n){return new e({type:"array",element:t,...ie(n)})}function FF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}function zF(e){const t=$F(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ii(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(ii(s))}},e(n.value,n)));return t}function $F(e,t){const n=new jt({check:"custom",...ie(t)});return n._zod.check=e,n}function pw(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??Oo,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 dt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const f=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,u)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),dt(d,t,u),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&St(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function mw(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 i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,f=e.external.uri??(p=>p);if(d)return{ref:f(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=s(i);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
97
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(_,w)=>x(f,_,w)};let o;const i=vc,a=!Y_.jitless,l=a&&GI.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const p=f.value;return i(p)?a&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),f=o(f,h),u?dw([],p,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function hg(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Cs(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>rs(i,r,ns())))}),t)}const jL=U("$ZodUnion",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Re(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Re(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Re(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>oh(o.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(n)return r(s,o);let i=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:s.value,issues:[]},o);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>hg(c,s,e,o)):hg(a,s,e,o)}}),LL=U("$ZodIntersection",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,o=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,l])=>pg(n,c,l)):pg(n,o,i)}});function Cd(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(oi(e)&&oi(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),s={...e,...t};for(const o of r){const i=Cd(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}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 s=e[r],o=t[r],i=Cd(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pg(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),Cs(e))return e;const i=Cd(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const FL=U("$ZodEnum",(e,t)=>{Qe.init(e,t);const n=X_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>YI.has(typeof s)).map(s=>typeof s=="string"?fl(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),zL=U("$ZodTransform",(e,t)=>{Qe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G_(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n));if(s instanceof Promise)throw new Is;return n.value=s,n}});function mg(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const fw=U("$ZodOptional",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>mg(o,n.value)):mg(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),$L=U("$ZodExactOptional",(e,t)=>{fw.init(e,t),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),VL=U("$ZodNullable",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oh(n.source)}|null)$`):void 0}),Re(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)}),BL=U("$ZodDefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(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 s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>gg(o,t)):gg(s,t)}});function gg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const UL=U("$ZodPrefault",(e,t)=>{Qe.init(e,t),e._zod.optin="optional",Re(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))}),WL=U("$ZodNonOptional",(e,t)=>{Qe.init(e,t),Re(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 s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>yg(o,e)):yg(s,e)}});function yg(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 HL=U("$ZodCatch",(e,t)=>{Qe.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>rs(i,r,ns()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>rs(o,r,ns()))},input:n.value}),n.issues=[]),n)}}),qL=U("$ZodPipe",(e,t)=>{Qe.init(e,t),Re(e._zod,"values",()=>t.in._zod.values),Re(e._zod,"optin",()=>t.in._zod.optin),Re(e._zod,"optout",()=>t.out._zod.optout),Re(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(i=>ia(i,t.in,r)):ia(o,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(o=>ia(o,t.out,r)):ia(s,t.out,r)}});function ia(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const KL=U("$ZodReadonly",(e,t)=>{Qe.init(e,t),Re(e._zod,"propValues",()=>t.innerType._zod.propValues),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"optin",()=>t.innerType?._zod?.optin),Re(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(bg):bg(s)}});function bg(e){return e.value=Object.freeze(e.value),e}const ZL=U("$ZodCustom",(e,t)=>{jt.init(e,t),Qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(o=>vg(o,n,r,e));vg(s,n,r,e)}});function vg(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ii(s))}}var xg;class GL{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 s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function YL(){return new GL}(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=YL());const Oo=globalThis.__zod_globalRegistry;function XL(e,t){return new e({type:"string",...ie(t)})}function JL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function _g(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function QL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function eF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function tF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function nF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function rF(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function sF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function oF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function iF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function aF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function cF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function lF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function uF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function dF(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function fF(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function hF(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function pF(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function mF(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function gF(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function yF(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function bF(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function vF(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function xF(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function _F(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function wF(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function SF(e,t){return new e({type:"number",coerce:!0,checks:[],...ie(t)})}function EF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function kF(e){return new e({type:"unknown"})}function CF(e,t){return new e({type:"never",...ie(t)})}function wg(e,t){return new iw({check:"less_than",...ie(t),value:e,inclusive:!1})}function vu(e,t){return new iw({check:"less_than",...ie(t),value:e,inclusive:!0})}function Sg(e,t){return new aw({check:"greater_than",...ie(t),value:e,inclusive:!1})}function xu(e,t){return new aw({check:"greater_than",...ie(t),value:e,inclusive:!0})}function Eg(e,t){return new Hj({check:"multiple_of",...ie(t),value:e})}function hw(e,t){return new Kj({check:"max_length",...ie(t),maximum:e})}function _c(e,t){return new Zj({check:"min_length",...ie(t),minimum:e})}function pw(e,t){return new Gj({check:"length_equals",...ie(t),length:e})}function RF(e,t){return new Yj({check:"string_format",format:"regex",...ie(t),pattern:e})}function PF(e){return new Xj({check:"string_format",format:"lowercase",...ie(e)})}function OF(e){return new Jj({check:"string_format",format:"uppercase",...ie(e)})}function TF(e,t){return new Qj({check:"string_format",format:"includes",...ie(t),includes:e})}function MF(e,t){return new eL({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function AF(e,t){return new tL({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function so(e){return new nL({check:"overwrite",tx:e})}function NF(e){return so(t=>t.normalize(e))}function DF(){return so(e=>e.trim())}function IF(){return so(e=>e.toLowerCase())}function jF(){return so(e=>e.toUpperCase())}function LF(){return so(e=>ZI(e))}function FF(e,t,n){return new e({type:"array",element:t,...ie(n)})}function zF(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}function $F(e){const t=VF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ii(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(ii(s))}},e(n.value,n)));return t}function VF(e,t){const n=new jt({check:"custom",...ie(t)});return n._zod.check=e,n}function mw(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??Oo,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 dt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const f=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,u)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),dt(d,t,u),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&St(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function gw(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 i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,f=e.external.uri??(p=>p);if(d)return{ref:f(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=s(i);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
98
98
|
|
|
99
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function gw(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){r(u);const f=e.seen.get(u),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,l),i._zod.parent===u)for(const m in c)m==="$ref"||m==="allOf"||m in l||delete c[m];if(h.$ref&&f.def)for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}const d=i._zod.parent;if(d&&d!==u){r(d);const f=e.seen.get(d);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,n.def??n.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:wc(t,"input",e.processors),output:wc(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function St(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 St(r.element,n);if(r.type==="set")return St(r.valueType,n);if(r.type==="lazy")return St(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 St(r.innerType,n);if(r.type==="intersection")return St(r.left,n)||St(r.right,n);if(r.type==="record"||r.type==="map")return St(r.keyType,n)||St(r.valueType,n);if(r.type==="pipe")return St(r.in,n)||St(r.out,n);if(r.type==="object"){for(const s in r.shape)if(St(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(St(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(St(s,n))return!0;return!!(r.rest&&St(r.rest,n))}return!1}const VF=(e,t={})=>n=>{const r=pw({...n,processors:t});return dt(e,r),mw(r,e),gw(r,e)},wc=(e,t,n={})=>r=>{const{libraryOptions:s,target:o}=r??{},i=pw({...s??{},target:o,io:t,processors:n});return dt(e,i),mw(i,e),gw(i,e)},BF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},UF=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=BF[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},WF=(e,t,n,r)=>{const s=n,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u),typeof o=="number"&&(s.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof i=="number"&&(s.maximum=i,typeof l=="number"&&t.target!=="draft-04"&&(l<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},HF=(e,t,n,r)=>{n.not={}},qF=(e,t,n,r)=>{},KF=(e,t,n,r)=>{const s=e._zod.def,o=Y_(s.entries);o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},ZF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},GF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},YF=(e,t,n,r)=>{const s=n,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=dt(o.element,t,{...r,path:[...r.path,"items"]})},XF=(e,t,n,r)=>{const s=n,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const l in i)s.properties[l]=dt(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const u=o.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=dt(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},JF=(e,t,n,r)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>dt(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=i:n.anyOf=i},QF=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.left,t,{...r,path:[...r.path,"allOf",0]}),i=dt(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];n.allOf=c},e2=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},t2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType},n2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},r2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},s2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},o2=(e,t,n,r)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;dt(o,t,r);const i=t.seen.get(e);i.ref=o},i2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},yw=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType};function kg(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function a2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=wf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function c2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(u){return u.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=wf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function bw(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,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ag(a2(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve((n.mode==="sync"?aj:cj)(e,r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof ah})(i))return{values:{},errors:ag(c2(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const l2=U("ZodISODateTime",(e,t)=>{mL.init(e,t),Be.init(e,t)});function u2(e){return bF(l2,e)}const d2=U("ZodISODate",(e,t)=>{gL.init(e,t),Be.init(e,t)});function f2(e){return vF(d2,e)}const h2=U("ZodISOTime",(e,t)=>{yL.init(e,t),Be.init(e,t)});function p2(e){return xF(h2,e)}const m2=U("ZodISODuration",(e,t)=>{bL.init(e,t),Be.init(e,t)});function g2(e){return _F(m2,e)}const y2=(e,t)=>{ah.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ij(e,n)},flatten:{value:n=>oj(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kd,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kd,2)}},isEmpty:{get(){return e.issues.length===0}}})},nn=U("ZodError",y2,{Parent:Error}),b2=pl(nn),v2=ml(nn),x2=gl(nn),_2=yl(nn),w2=dj(nn),S2=fj(nn),E2=hj(nn),k2=pj(nn),C2=mj(nn),R2=gj(nn),P2=yj(nn),O2=bj(nn),et=U("ZodType",(e,t)=>(Qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wc(e,"input"),output:wc(e,"output")}}),e.toJSONSchema=VF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Sr(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)=>Er(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>b2(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>x2(e,n,r),e.parseAsync=async(n,r)=>v2(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>_2(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>w2(e,n,r),e.decode=(n,r)=>S2(e,n,r),e.encodeAsync=async(n,r)=>E2(e,n,r),e.decodeAsync=async(n,r)=>k2(e,n,r),e.safeEncode=(n,r)=>C2(e,n,r),e.safeDecode=(n,r)=>R2(e,n,r),e.safeEncodeAsync=async(n,r)=>P2(e,n,r),e.safeDecodeAsync=async(n,r)=>O2(e,n,r),e.refine=(n,r)=>e.check(_z(n,r)),e.superRefine=n=>e.check(wz(n)),e.overwrite=n=>e.check(so(n)),e.optional=()=>Og(e),e.exactOptional=()=>cz(e),e.nullable=()=>Tg(e),e.nullish=()=>Og(Tg(e)),e.nonoptional=n=>pz(e,n),e.array=()=>Q2(e),e.or=n=>nz([e,n]),e.and=n=>sz(e,n),e.transform=n=>Mg(e,iz(n)),e.default=n=>dz(e,n),e.prefault=n=>hz(e,n),e.catch=n=>gz(e,n),e.pipe=n=>Mg(e,n),e.readonly=()=>vz(e),e.describe=n=>{const r=e.clone();return Oo.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Oo.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oo.get(e);const r=e.clone();return Oo.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),vw=U("_ZodString",(e,t)=>{ch.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>UF(e,r,s);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(CF(...r)),e.includes=(...r)=>e.check(OF(...r)),e.startsWith=(...r)=>e.check(TF(...r)),e.endsWith=(...r)=>e.check(MF(...r)),e.min=(...r)=>e.check(_c(...r)),e.max=(...r)=>e.check(fw(...r)),e.length=(...r)=>e.check(hw(...r)),e.nonempty=(...r)=>e.check(_c(1,...r)),e.lowercase=r=>e.check(RF(r)),e.uppercase=r=>e.check(PF(r)),e.trim=()=>e.check(NF()),e.normalize=(...r)=>e.check(AF(...r)),e.toLowerCase=()=>e.check(DF()),e.toUpperCase=()=>e.check(IF()),e.slugify=()=>e.check(jF())}),T2=U("ZodString",(e,t)=>{ch.init(e,t),vw.init(e,t),e.email=n=>e.check(XL(M2,n)),e.url=n=>e.check(nF(A2,n)),e.jwt=n=>e.check(yF(K2,n)),e.emoji=n=>e.check(rF(N2,n)),e.guid=n=>e.check(_g(Cg,n)),e.uuid=n=>e.check(JL(aa,n)),e.uuidv4=n=>e.check(QL(aa,n)),e.uuidv6=n=>e.check(eF(aa,n)),e.uuidv7=n=>e.check(tF(aa,n)),e.nanoid=n=>e.check(sF(D2,n)),e.guid=n=>e.check(_g(Cg,n)),e.cuid=n=>e.check(oF(I2,n)),e.cuid2=n=>e.check(iF(j2,n)),e.ulid=n=>e.check(aF(L2,n)),e.base64=n=>e.check(pF(W2,n)),e.base64url=n=>e.check(mF(H2,n)),e.xid=n=>e.check(cF(F2,n)),e.ksuid=n=>e.check(lF(z2,n)),e.ipv4=n=>e.check(uF($2,n)),e.ipv6=n=>e.check(dF(V2,n)),e.cidrv4=n=>e.check(fF(B2,n)),e.cidrv6=n=>e.check(hF(U2,n)),e.e164=n=>e.check(gF(q2,n)),e.datetime=n=>e.check(u2(n)),e.date=n=>e.check(f2(n)),e.time=n=>e.check(p2(n)),e.duration=n=>e.check(g2(n))});function pt(e){return YL(T2,e)}const Be=U("ZodStringFormat",(e,t)=>{Ve.init(e,t),vw.init(e,t)}),M2=U("ZodEmail",(e,t)=>{iL.init(e,t),Be.init(e,t)}),Cg=U("ZodGUID",(e,t)=>{sL.init(e,t),Be.init(e,t)}),aa=U("ZodUUID",(e,t)=>{oL.init(e,t),Be.init(e,t)}),A2=U("ZodURL",(e,t)=>{aL.init(e,t),Be.init(e,t)}),N2=U("ZodEmoji",(e,t)=>{cL.init(e,t),Be.init(e,t)}),D2=U("ZodNanoID",(e,t)=>{lL.init(e,t),Be.init(e,t)}),I2=U("ZodCUID",(e,t)=>{uL.init(e,t),Be.init(e,t)}),j2=U("ZodCUID2",(e,t)=>{dL.init(e,t),Be.init(e,t)}),L2=U("ZodULID",(e,t)=>{fL.init(e,t),Be.init(e,t)}),F2=U("ZodXID",(e,t)=>{hL.init(e,t),Be.init(e,t)}),z2=U("ZodKSUID",(e,t)=>{pL.init(e,t),Be.init(e,t)}),$2=U("ZodIPv4",(e,t)=>{vL.init(e,t),Be.init(e,t)}),V2=U("ZodIPv6",(e,t)=>{xL.init(e,t),Be.init(e,t)}),B2=U("ZodCIDRv4",(e,t)=>{_L.init(e,t),Be.init(e,t)}),U2=U("ZodCIDRv6",(e,t)=>{wL.init(e,t),Be.init(e,t)}),W2=U("ZodBase64",(e,t)=>{SL.init(e,t),Be.init(e,t)}),H2=U("ZodBase64URL",(e,t)=>{kL.init(e,t),Be.init(e,t)}),q2=U("ZodE164",(e,t)=>{CL.init(e,t),Be.init(e,t)}),K2=U("ZodJWT",(e,t)=>{PL.init(e,t),Be.init(e,t)}),xw=U("ZodNumber",(e,t)=>{cw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>WF(e,r,s),e.gt=(r,s)=>e.check(Sg(r,s)),e.gte=(r,s)=>e.check(xu(r,s)),e.min=(r,s)=>e.check(xu(r,s)),e.lt=(r,s)=>e.check(wg(r,s)),e.lte=(r,s)=>e.check(vu(r,s)),e.max=(r,s)=>e.check(vu(r,s)),e.int=r=>e.check(Rg(r)),e.safe=r=>e.check(Rg(r)),e.positive=r=>e.check(Sg(0,r)),e.nonnegative=r=>e.check(xu(0,r)),e.negative=r=>e.check(wg(0,r)),e.nonpositive=r=>e.check(vu(0,r)),e.multipleOf=(r,s)=>e.check(Eg(r,s)),e.step=(r,s)=>e.check(Eg(r,s)),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}),Z2=U("ZodNumberFormat",(e,t)=>{OL.init(e,t),xw.init(e,t)});function Rg(e){return SF(Z2,e)}const G2=U("ZodUnknown",(e,t)=>{TL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qF()});function Pg(){return EF(G2)}const Y2=U("ZodNever",(e,t)=>{ML.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>HF(e,n,r)});function X2(e){return kF(Y2,e)}const J2=U("ZodArray",(e,t)=>{AL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>YF(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(_c(n,r)),e.nonempty=n=>e.check(_c(1,n)),e.max=(n,r)=>e.check(fw(n,r)),e.length=(n,r)=>e.check(hw(n,r)),e.unwrap=()=>e.element});function Q2(e,t){return LF(J2,e,t)}const ez=U("ZodObject",(e,t)=>{DL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>XF(e,n,r,s),Re(e,"shape",()=>t.shape),e.keyof=()=>lh(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pg()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pg()}),e.strict=()=>e.clone({...e._zod.def,catchall:X2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ej(e,n),e.safeExtend=n=>tj(e,n),e.merge=n=>nj(e,n),e.pick=n=>JI(e,n),e.omit=n=>QI(e,n),e.partial=(...n)=>rj(ww,e,n[0]),e.required=(...n)=>sj(Sw,e,n[0])});function _w(e,t){const n={type:"object",shape:e??{},...ie(t)};return new ez(n)}const tz=U("ZodUnion",(e,t)=>{IL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>JF(e,n,r,s),e.options=t.options});function nz(e,t){return new tz({type:"union",options:e,...ie(t)})}const rz=U("ZodIntersection",(e,t)=>{jL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>QF(e,n,r,s)});function sz(e,t){return new rz({type:"intersection",left:e,right:t})}const Rd=U("ZodEnum",(e,t)=>{LL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>KF(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const o={};for(const i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})},e.exclude=(r,s)=>{const o={...t.entries};for(const i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})}});function lh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Rd({type:"enum",entries:n,...ie(t)})}const oz=U("ZodTransform",(e,t)=>{FL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>GF(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Z_(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(ii(o,n.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ii(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n)):(n.value=s,n)}});function iz(e){return new oz({type:"transform",transform:e})}const ww=U("ZodOptional",(e,t)=>{dw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Og(e){return new ww({type:"optional",innerType:e})}const az=U("ZodExactOptional",(e,t)=>{zL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function cz(e){return new az({type:"optional",innerType:e})}const lz=U("ZodNullable",(e,t)=>{$L.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>e2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new lz({type:"nullable",innerType:e})}const uz=U("ZodDefault",(e,t)=>{VL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>n2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dz(e,t){return new uz({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():J_(t)}})}const fz=U("ZodPrefault",(e,t)=>{BL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>r2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function hz(e,t){return new fz({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():J_(t)}})}const Sw=U("ZodNonOptional",(e,t)=>{UL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>t2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pz(e,t){return new Sw({type:"nonoptional",innerType:e,...ie(t)})}const mz=U("ZodCatch",(e,t)=>{WL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>s2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gz(e,t){return new mz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const yz=U("ZodPipe",(e,t)=>{HL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>o2(e,n,r,s),e.in=t.in,e.out=t.out});function Mg(e,t){return new yz({type:"pipe",in:e,out:t})}const bz=U("ZodReadonly",(e,t)=>{qL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>i2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function vz(e){return new bz({type:"readonly",innerType:e})}const xz=U("ZodCustom",(e,t)=>{KL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ZF(e,n)});function _z(e,t={}){return FF(xz,e,t)}function wz(e){return zF(e)}function js(e){return wF(xw,e)}function nt({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:Se("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})}function Ag(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sz(e){const t=Ez(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(Cz);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Ez(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=Pz(s),a=Rz(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kz=Symbol("radix.slottable");function Cz(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kz}function Rz(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Pz(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 Ew(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var kw=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"}),Oz="VisuallyHidden",Tz=v.forwardRef((e,t)=>g.jsx(be.span,{...e,ref:t,style:{...kw,...e.style}}));Tz.displayName=Oz;var Mz=[" ","Enter","ArrowUp","ArrowDown"],Az=[" ","Enter"],ss="Select",[vl,xl,Nz]=Ff(ss),[oo]=wr(ss,[Nz,ol]),_l=ol(),[Dz,kr]=oo(ss),[Iz,jz]=oo(ss),Cw=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=_l(t),[y,b]=v.useState(null),[x,_]=v.useState(null),[w,S]=v.useState(!1),C=zf(l),[k,E]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:ss}),[P,O]=Zs({prop:i,defaultProp:a,onChange:c,caller:ss}),N=v.useRef(null),A=y?p||!!y.closest("form"):!0,[j,$]=v.useState(new Set),q=Array.from(j).map(D=>D.props.value).join(";");return g.jsx(Qx,{...m,children:g.jsxs(Dz,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Hn(),value:P,onValueChange:O,open:k,onOpenChange:E,dir:C,triggerPointerDownPosRef:N,disabled:f,children:[g.jsx(vl.Provider,{scope:t,children:g.jsx(Iz,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{$(H=>new Set(H).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{$(H=>{const F=new Set(H);return F.delete(D),F})},[]),children:n})}),A?g.jsxs(Zw,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:D=>O(D.target.value),disabled:f,form:p,children:[P===void 0?g.jsx("option",{value:""}):null,Array.from(j)]},q):null]})})};Cw.displayName=ss;var Rw="SelectTrigger",Pw=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=_l(n),i=kr(Rw,n),a=i.disabled||r,c=Pe(t,i.onTriggerChange),l=xl(n),u=v.useRef("touch"),[d,f,h]=Yw(m=>{const y=l().filter(_=>!_.disabled),b=y.find(_=>_.value===i.value),x=Xw(y,m,b);x!==void 0&&i.onValueChange(x.value)}),p=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(e_,{asChild:!0,...o,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Gw(i.value)?"":void 0,...s,ref:c,onClick:re(s.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:re(s.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:re(s.onKeyDown,m=>{const y=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(y&&m.key===" ")&&Mz.includes(m.key)&&(p(),m.preventDefault())})})})});Pw.displayName=Rw;var Ow="SelectValue",Tw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=kr(Ow,n),{onValueNodeHasChildrenChange:l}=c,u=o!==void 0,d=Pe(t,c.onValueNodeChange);return vt(()=>{l(u)},[l,u]),g.jsx(be.span,{...a,ref:d,style:{pointerEvents:"none"},children:Gw(c.value)?g.jsx(g.Fragment,{children:i}):o})});Tw.displayName=Ow;var Lz="SelectIcon",Mw=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(be.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Mw.displayName=Lz;var Fz="SelectPortal",Aw=e=>g.jsx(il,{asChild:!0,...e});Aw.displayName=Fz;var os="SelectContent",Nw=v.forwardRef((e,t)=>{const n=kr(os,e.__scopeSelect),[r,s]=v.useState();if(vt(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ic.createPortal(g.jsx(Dw,{scope:e.__scopeSelect,children:g.jsx(vl.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(Iw,{...e,ref:t})});Nw.displayName=os;var cn=10,[Dw,Cr]=oo(os),zz="SelectContentImpl",$z=Sz("SelectContent.RemoveScroll"),Iw=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y,...b}=e,x=kr(os,n),[_,w]=v.useState(null),[S,C]=v.useState(null),k=Pe(t,V=>w(V)),[E,P]=v.useState(null),[O,N]=v.useState(null),A=xl(n),[j,$]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(_)return Gf(_)},[_]),$f();const D=v.useCallback(V=>{const[ee,...me]=A().map(ge=>ge.ref.current),[le]=me.slice(-1),fe=document.activeElement;for(const ge of V)if(ge===fe||(ge?.scrollIntoView({block:"nearest"}),ge===ee&&S&&(S.scrollTop=0),ge===le&&S&&(S.scrollTop=S.scrollHeight),ge?.focus(),document.activeElement!==fe))return},[A,S]),H=v.useCallback(()=>D([E,_]),[D,E,_]);v.useEffect(()=>{j&&H()},[j,H]);const{onOpenChange:F,triggerPointerDownPosRef:W}=x;v.useEffect(()=>{if(_){let V={x:0,y:0};const ee=le=>{V={x:Math.abs(Math.round(le.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(W.current?.y??0))}},me=le=>{V.x<=10&&V.y<=10?le.preventDefault():_.contains(le.target)||F(!1),document.removeEventListener("pointermove",ee),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",me,{capture:!0})}}},[_,F,W]),v.useEffect(()=>{const V=()=>F(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[F]);const[se,I]=Yw(V=>{const ee=A().filter(fe=>!fe.disabled),me=ee.find(fe=>fe.ref.current===document.activeElement),le=Xw(ee,V,me);le&&setTimeout(()=>le.ref.current.focus())}),Y=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&(P(V),le&&(q.current=!0))},[x.value]),K=v.useCallback(()=>_?.focus(),[_]),Z=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&N(V)},[x.value]),oe=r==="popper"?Pd:jw,ce=oe===Pd?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y}:{};return g.jsx(Dw,{scope:n,content:_,viewport:S,onViewportChange:C,itemRefCallback:Y,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:j,searchRef:se,children:g.jsx(cl,{as:$z,allowPinchZoom:!0,children:g.jsx(el,{asChild:!0,trapped:x.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:re(s,V=>{x.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(oe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:V=>V.preventDefault(),...b,...ce,onPlaced:()=>$(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:re(b.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&I(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let le=A().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(V.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const fe=V.target,ge=le.indexOf(fe);le=le.slice(ge+1)}setTimeout(()=>D(le)),V.preventDefault()}})})})})})})});Iw.displayName=zz;var Vz="SelectItemAlignedPosition",jw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=kr(os,n),i=Cr(os,n),[a,c]=v.useState(null),[l,u]=v.useState(null),d=Pe(t,k=>u(k)),f=xl(n),h=v.useRef(!1),p=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=i,_=v.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&l&&m&&y&&b){const k=o.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(o.dir!=="rtl"){const fe=O.left-E.left,ge=P.left-fe,Ze=k.left-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.left=st+"px"}else{const fe=E.right-O.right,ge=window.innerWidth-P.right-fe,Ze=window.innerWidth-k.right-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.right=st+"px"}const N=f(),A=window.innerHeight-cn*2,j=m.scrollHeight,$=window.getComputedStyle(l),q=parseInt($.borderTopWidth,10),D=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),F=parseInt($.paddingBottom,10),W=q+D+j+F+H,se=Math.min(y.offsetHeight*5,W),I=window.getComputedStyle(m),Y=parseInt(I.paddingTop,10),K=parseInt(I.paddingBottom,10),Z=k.top+k.height/2-cn,oe=A-Z,ce=y.offsetHeight/2,V=y.offsetTop+ce,ee=q+D+V,me=W-ee;if(ee<=Z){const fe=N.length>0&&y===N[N.length-1].ref.current;a.style.bottom="0px";const ge=l.clientHeight-m.offsetTop-m.offsetHeight,Ze=Math.max(oe,ce+(fe?K:0)+ge+H),_t=ee+Ze;a.style.height=_t+"px"}else{const fe=N.length>0&&y===N[0].ref.current;a.style.top="0px";const Ze=Math.max(Z,q+m.offsetTop+(fe?Y:0)+ce)+me;a.style.height=Ze+"px",m.scrollTop=ee-Z+m.offsetTop}a.style.margin=`${cn}px 0`,a.style.minHeight=se+"px",a.style.maxHeight=A+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,l,m,y,b,o.dir,r]);vt(()=>_(),[_]);const[w,S]=v.useState();vt(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(k=>{k&&p.current===!0&&(_(),x?.(),p.current=!1)},[_,x]);return g.jsx(Uz,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:g.jsx(be.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});jw.displayName=Vz;var Bz="SelectPopperPosition",Pd=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=cn,...o}=e,i=_l(n);return g.jsx(t_,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Pd.displayName=Bz;var[Uz,uh]=oo(os,{}),Od="SelectViewport",Lw=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Cr(Od,n),i=uh(Od,n),a=Pe(t,o.onViewportChange),c=v.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(vl.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:re(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f?.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const p=window.innerHeight-cn*2,m=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(m,y);if(b<p){const x=b+h,_=Math.min(p,x),w=x-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Lw.displayName=Od;var Fw="SelectGroup",[Wz,Hz]=oo(Fw),qz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hn();return g.jsx(Wz,{scope:n,id:s,children:g.jsx(be.div,{role:"group","aria-labelledby":s,...r,ref:t})})});qz.displayName=Fw;var zw="SelectLabel",Kz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hz(zw,n);return g.jsx(be.div,{id:s.id,...r,ref:t})});Kz.displayName=zw;var Sc="SelectItem",[Zz,$w]=oo(Sc),Vw=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=kr(Sc,n),c=Cr(Sc,n),l=a.value===r,[u,d]=v.useState(o??""),[f,h]=v.useState(!1),p=Pe(t,x=>c.itemRefCallback?.(x,r,s)),m=Hn(),y=v.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.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 g.jsx(Zz,{scope:n,value:r,disabled:s,textId:m,isSelected:l,onItemTextChange:v.useCallback(x=>{d(_=>_||(x?.textContent??"").trim())},[]),children:g.jsx(vl.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:p,onFocus:re(i.onFocus,()=>h(!0)),onBlur:re(i.onBlur,()=>h(!1)),onClick:re(i.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:re(i.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:re(i.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:re(i.onPointerMove,x=>{y.current=x.pointerType,s?c.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:re(i.onKeyDown,x=>{c.searchRef?.current!==""&&x.key===" "||(Az.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Vw.displayName=Sc;var To="SelectItemText",Bw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=kr(To,n),a=Cr(To,n),c=$w(To,n),l=jz(To,n),[u,d]=v.useState(null),f=Pe(t,b=>d(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=u?.textContent,p=v.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=l;return vt(()=>(m(p),()=>y(p)),[m,y,p]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:c.textId,...o,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ic.createPortal(o.children,i.valueNode):null]})});Bw.displayName=To;var Uw="SelectItemIndicator",Ww=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return $w(Uw,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Ww.displayName=Uw;var Td="SelectScrollUpButton",Hw=v.forwardRef((e,t)=>{const n=Cr(Td,e.__scopeSelect),r=uh(Td,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;o(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Kw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Hw.displayName=Td;var Md="SelectScrollDownButton",qw=v.forwardRef((e,t)=>{const n=Cr(Md,e.__scopeSelect),r=uh(Md,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Kw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});qw.displayName=Md;var Kw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Cr("SelectScrollButton",n),i=v.useRef(null),a=xl(n),c=v.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),vt(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(be.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:re(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:re(s.onPointerMove,()=>{o.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:re(s.onPointerLeave,()=>{c()})})}),Gz="SelectSeparator",Yz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});Yz.displayName=Gz;var Ad="SelectArrow",Xz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_l(n),o=kr(Ad,n),i=Cr(Ad,n);return o.open&&i.position==="popper"?g.jsx(n_,{...s,...r,ref:t}):null});Xz.displayName=Ad;var Jz="SelectBubbleInput",Zw=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=v.useRef(null),o=Pe(r,s),i=Ew(t);return v.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx(be.select,{...n,style:{...kw,...n.style},ref:o,defaultValue:t})});Zw.displayName=Jz;function Gw(e){return e===""||e===void 0}function Yw(e){const t=On(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function Xw(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=Qz(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Qz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var e$=Cw,t$=Pw,n$=Tw,r$=Mw,s$=Aw,o$=Nw,i$=Lw,a$=Vw,c$=Bw,l$=Ww,u$=Hw,d$=qw;function Ls({...e}){return g.jsx(e$,{"data-slot":"select",...e})}function Fs({...e}){return g.jsx(n$,{"data-slot":"select-value",...e})}function zs({className:e,size:t="default",children:n,...r}){return g.jsxs(t$,{"data-slot":"select-trigger","data-size":t,className:Se("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,g.jsx(r$,{asChild:!0,children:g.jsx(bx,{className:"size-4 opacity-50"})})]})}function $s({className:e,children:t,position:n="popper",...r}){return g.jsx(s$,{children:g.jsxs(o$,{"data-slot":"select-content",className:Se("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:[g.jsx(f$,{}),g.jsx(i$,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(h$,{})]})})}function Vs({className:e,children:t,...n}){return g.jsxs(a$,{"data-slot":"select-item",className:Se("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:[g.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:g.jsx(l$,{children:g.jsx(yx,{className:"size-4"})})}),g.jsx(c$,{children:t})]})}function f$({className:e,...t}){return g.jsx(u$,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(jM,{className:"size-4"})})}function h$({className:e,...t}){return g.jsx(d$,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(bx,{className:"size-4"})})}var p$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m$=p$.reduce((e,t)=>{const n=kx(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),g$="Label",Jw=v.forwardRef((e,t)=>g.jsx(m$.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Jw.displayName=g$;var y$=Jw;function Qw({className:e,...t}){return g.jsx(y$,{"data-slot":"label",className:Se("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})}const e0=UP,t0=v.createContext({}),Ne=({...e})=>g.jsx(t0.Provider,{value:{name:e.name},children:g.jsx(VP,{...e})}),dh=()=>{const e=v.useContext(t0),t=v.useContext(n0),{getFieldState:n}=BP(),r=_v({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},n0=v.createContext({});function De({className:e,...t}){const n=v.useId();return g.jsx(n0.Provider,{value:{id:n},children:g.jsx("div",{"data-slot":"form-item",className:Se("grid gap-2",e),...t})})}function Ie({className:e,children:t,required:n,...r}){const{error:s,formItemId:o}=dh();return g.jsxs(Qw,{"data-slot":"form-label","data-error":!!s,className:e,htmlFor:o,...r,children:[t,n&&g.jsx("span",{className:"text-destructive",children:"*"})]})}function je({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=dh();return g.jsx(Lf,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Le({className:e,...t}){const{error:n,formMessageId:r}=dh(),s=n?String(n?.message??""):t.children;return s?g.jsx("p",{"data-slot":"form-message",id:r,className:Se("text-destructive text-sm",e),...t,children:s}):null}function b$(e){const t=v$(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(_$);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function v$(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=S$(s),a=w$(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var x$=Symbol("radix.slottable");function _$(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===x$}function w$(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function S$(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 wl="Dialog",[r0]=wr(wl),[E$,yn]=r0(wl),s0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=v.useRef(null),c=v.useRef(null),[l,u]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:wl});return g.jsx(E$,{scope:t,triggerRef:a,contentRef:c,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};s0.displayName=wl;var o0="DialogTrigger",k$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(o0,n),o=Pe(t,s.triggerRef);return g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ph(s.open),...r,ref:o,onClick:re(e.onClick,s.onOpenToggle)})});k$.displayName=o0;var fh="DialogPortal",[C$,i0]=r0(fh,{forceMount:void 0}),a0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=yn(fh,t);return g.jsx(C$,{scope:t,forceMount:n,children:v.Children.map(r,i=>g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:i})}))})};a0.displayName=fh;var Ec="DialogOverlay",c0=v.forwardRef((e,t)=>{const n=i0(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(Ec,e.__scopeDialog);return o.modal?g.jsx(Xn,{present:r||o.open,children:g.jsx(P$,{...s,ref:t})}):null});c0.displayName=Ec;var R$=b$("DialogOverlay.RemoveScroll"),P$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(Ec,n);return g.jsx(cl,{as:R$,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(be.div,{"data-state":ph(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),is="DialogContent",l0=v.forwardRef((e,t)=>{const n=i0(is,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(is,e.__scopeDialog);return g.jsx(Xn,{present:r||o.open,children:o.modal?g.jsx(O$,{...s,ref:t}):g.jsx(T$,{...s,ref:t})})});l0.displayName=is;var O$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(null),s=Pe(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(u0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault())})}),T$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return g.jsx(u0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),u0=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=yn(is,n),c=v.useRef(null),l=Pe(t,c);return $f(),g.jsxs(g.Fragment,{children:[g.jsx(el,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Qc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ph(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(M$,{titleId:a.titleId}),g.jsx(N$,{contentRef:c,descriptionId:a.descriptionId})]})]})}),hh="DialogTitle",d0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(hh,n);return g.jsx(be.h2,{id:s.titleId,...r,ref:t})});d0.displayName=hh;var f0="DialogDescription",h0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(f0,n);return g.jsx(be.p,{id:s.descriptionId,...r,ref:t})});h0.displayName=f0;var p0="DialogClose",m0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(p0,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>s.onOpenChange(!1))})});m0.displayName=p0;function ph(e){return e?"open":"closed"}var g0="DialogTitleWarning",[GH,y0]=m1(g0,{contentName:is,titleName:hh,docsSlug:"dialog"}),M$=({titleId:e})=>{const t=y0(g0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
99
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function yw(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){r(u);const f=e.seen.get(u),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,l),i._zod.parent===u)for(const m in c)m==="$ref"||m==="allOf"||m in l||delete c[m];if(h.$ref&&f.def)for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}const d=i._zod.parent;if(d&&d!==u){r(d);const f=e.seen.get(d);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,n.def??n.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:wc(t,"input",e.processors),output:wc(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function St(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 St(r.element,n);if(r.type==="set")return St(r.valueType,n);if(r.type==="lazy")return St(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 St(r.innerType,n);if(r.type==="intersection")return St(r.left,n)||St(r.right,n);if(r.type==="record"||r.type==="map")return St(r.keyType,n)||St(r.valueType,n);if(r.type==="pipe")return St(r.in,n)||St(r.out,n);if(r.type==="object"){for(const s in r.shape)if(St(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(St(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(St(s,n))return!0;return!!(r.rest&&St(r.rest,n))}return!1}const BF=(e,t={})=>n=>{const r=mw({...n,processors:t});return dt(e,r),gw(r,e),yw(r,e)},wc=(e,t,n={})=>r=>{const{libraryOptions:s,target:o}=r??{},i=mw({...s??{},target:o,io:t,processors:n});return dt(e,i),gw(i,e),yw(i,e)},UF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},WF=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=UF[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},HF=(e,t,n,r)=>{const s=n,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u),typeof o=="number"&&(s.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof i=="number"&&(s.maximum=i,typeof l=="number"&&t.target!=="draft-04"&&(l<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},qF=(e,t,n,r)=>{n.not={}},KF=(e,t,n,r)=>{},ZF=(e,t,n,r)=>{const s=e._zod.def,o=X_(s.entries);o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},GF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},YF=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},XF=(e,t,n,r)=>{const s=n,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=dt(o.element,t,{...r,path:[...r.path,"items"]})},JF=(e,t,n,r)=>{const s=n,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const l in i)s.properties[l]=dt(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const u=o.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=dt(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},QF=(e,t,n,r)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>dt(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=i:n.anyOf=i},e2=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.left,t,{...r,path:[...r.path,"allOf",0]}),i=dt(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];n.allOf=c},t2=(e,t,n,r)=>{const s=e._zod.def,o=dt(s.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},n2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType},r2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},s2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},o2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},i2=(e,t,n,r)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;dt(o,t,r);const i=t.seen.get(e);i.ref=o},a2=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},bw=(e,t,n,r)=>{const s=e._zod.def;dt(s.innerType,t,r);const o=t.seen.get(e);o.ref=s.innerType};function kg(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function c2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Sf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function l2(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(u){return u.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Sf(i,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function vw(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,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:ag(c2(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,o){try{return Promise.resolve(kg(function(){return Promise.resolve((n.mode==="sync"?cj:lj)(e,r,t)).then(function(i){return o.shouldUseNativeValidation&&Ed({},o),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof ah})(i))return{values:{},errors:ag(l2(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const u2=U("ZodISODateTime",(e,t)=>{gL.init(e,t),Be.init(e,t)});function d2(e){return vF(u2,e)}const f2=U("ZodISODate",(e,t)=>{yL.init(e,t),Be.init(e,t)});function h2(e){return xF(f2,e)}const p2=U("ZodISOTime",(e,t)=>{bL.init(e,t),Be.init(e,t)});function m2(e){return _F(p2,e)}const g2=U("ZodISODuration",(e,t)=>{vL.init(e,t),Be.init(e,t)});function y2(e){return wF(g2,e)}const b2=(e,t)=>{ah.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>aj(e,n)},flatten:{value:n=>ij(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kd,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kd,2)}},isEmpty:{get(){return e.issues.length===0}}})},nn=U("ZodError",b2,{Parent:Error}),v2=pl(nn),x2=ml(nn),_2=gl(nn),w2=yl(nn),S2=fj(nn),E2=hj(nn),k2=pj(nn),C2=mj(nn),R2=gj(nn),P2=yj(nn),O2=bj(nn),T2=vj(nn),et=U("ZodType",(e,t)=>(Qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wc(e,"input"),output:wc(e,"output")}}),e.toJSONSchema=BF(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Sr(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)=>Er(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>v2(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>_2(e,n,r),e.parseAsync=async(n,r)=>x2(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>w2(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>S2(e,n,r),e.decode=(n,r)=>E2(e,n,r),e.encodeAsync=async(n,r)=>k2(e,n,r),e.decodeAsync=async(n,r)=>C2(e,n,r),e.safeEncode=(n,r)=>R2(e,n,r),e.safeDecode=(n,r)=>P2(e,n,r),e.safeEncodeAsync=async(n,r)=>O2(e,n,r),e.safeDecodeAsync=async(n,r)=>T2(e,n,r),e.refine=(n,r)=>e.check(wz(n,r)),e.superRefine=n=>e.check(Sz(n)),e.overwrite=n=>e.check(so(n)),e.optional=()=>Og(e),e.exactOptional=()=>lz(e),e.nullable=()=>Tg(e),e.nullish=()=>Og(Tg(e)),e.nonoptional=n=>mz(e,n),e.array=()=>ez(e),e.or=n=>rz([e,n]),e.and=n=>oz(e,n),e.transform=n=>Mg(e,az(n)),e.default=n=>fz(e,n),e.prefault=n=>pz(e,n),e.catch=n=>yz(e,n),e.pipe=n=>Mg(e,n),e.readonly=()=>xz(e),e.describe=n=>{const r=e.clone();return Oo.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Oo.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oo.get(e);const r=e.clone();return Oo.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xw=U("_ZodString",(e,t)=>{ch.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>WF(e,r,s);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(RF(...r)),e.includes=(...r)=>e.check(TF(...r)),e.startsWith=(...r)=>e.check(MF(...r)),e.endsWith=(...r)=>e.check(AF(...r)),e.min=(...r)=>e.check(_c(...r)),e.max=(...r)=>e.check(hw(...r)),e.length=(...r)=>e.check(pw(...r)),e.nonempty=(...r)=>e.check(_c(1,...r)),e.lowercase=r=>e.check(PF(r)),e.uppercase=r=>e.check(OF(r)),e.trim=()=>e.check(DF()),e.normalize=(...r)=>e.check(NF(...r)),e.toLowerCase=()=>e.check(IF()),e.toUpperCase=()=>e.check(jF()),e.slugify=()=>e.check(LF())}),M2=U("ZodString",(e,t)=>{ch.init(e,t),xw.init(e,t),e.email=n=>e.check(JL(A2,n)),e.url=n=>e.check(rF(N2,n)),e.jwt=n=>e.check(bF(Z2,n)),e.emoji=n=>e.check(sF(D2,n)),e.guid=n=>e.check(_g(Cg,n)),e.uuid=n=>e.check(QL(aa,n)),e.uuidv4=n=>e.check(eF(aa,n)),e.uuidv6=n=>e.check(tF(aa,n)),e.uuidv7=n=>e.check(nF(aa,n)),e.nanoid=n=>e.check(oF(I2,n)),e.guid=n=>e.check(_g(Cg,n)),e.cuid=n=>e.check(iF(j2,n)),e.cuid2=n=>e.check(aF(L2,n)),e.ulid=n=>e.check(cF(F2,n)),e.base64=n=>e.check(mF(H2,n)),e.base64url=n=>e.check(gF(q2,n)),e.xid=n=>e.check(lF(z2,n)),e.ksuid=n=>e.check(uF($2,n)),e.ipv4=n=>e.check(dF(V2,n)),e.ipv6=n=>e.check(fF(B2,n)),e.cidrv4=n=>e.check(hF(U2,n)),e.cidrv6=n=>e.check(pF(W2,n)),e.e164=n=>e.check(yF(K2,n)),e.datetime=n=>e.check(d2(n)),e.date=n=>e.check(h2(n)),e.time=n=>e.check(m2(n)),e.duration=n=>e.check(y2(n))});function pt(e){return XL(M2,e)}const Be=U("ZodStringFormat",(e,t)=>{Ve.init(e,t),xw.init(e,t)}),A2=U("ZodEmail",(e,t)=>{aL.init(e,t),Be.init(e,t)}),Cg=U("ZodGUID",(e,t)=>{oL.init(e,t),Be.init(e,t)}),aa=U("ZodUUID",(e,t)=>{iL.init(e,t),Be.init(e,t)}),N2=U("ZodURL",(e,t)=>{cL.init(e,t),Be.init(e,t)}),D2=U("ZodEmoji",(e,t)=>{lL.init(e,t),Be.init(e,t)}),I2=U("ZodNanoID",(e,t)=>{uL.init(e,t),Be.init(e,t)}),j2=U("ZodCUID",(e,t)=>{dL.init(e,t),Be.init(e,t)}),L2=U("ZodCUID2",(e,t)=>{fL.init(e,t),Be.init(e,t)}),F2=U("ZodULID",(e,t)=>{hL.init(e,t),Be.init(e,t)}),z2=U("ZodXID",(e,t)=>{pL.init(e,t),Be.init(e,t)}),$2=U("ZodKSUID",(e,t)=>{mL.init(e,t),Be.init(e,t)}),V2=U("ZodIPv4",(e,t)=>{xL.init(e,t),Be.init(e,t)}),B2=U("ZodIPv6",(e,t)=>{_L.init(e,t),Be.init(e,t)}),U2=U("ZodCIDRv4",(e,t)=>{wL.init(e,t),Be.init(e,t)}),W2=U("ZodCIDRv6",(e,t)=>{SL.init(e,t),Be.init(e,t)}),H2=U("ZodBase64",(e,t)=>{EL.init(e,t),Be.init(e,t)}),q2=U("ZodBase64URL",(e,t)=>{CL.init(e,t),Be.init(e,t)}),K2=U("ZodE164",(e,t)=>{RL.init(e,t),Be.init(e,t)}),Z2=U("ZodJWT",(e,t)=>{OL.init(e,t),Be.init(e,t)}),_w=U("ZodNumber",(e,t)=>{lw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>HF(e,r,s),e.gt=(r,s)=>e.check(Sg(r,s)),e.gte=(r,s)=>e.check(xu(r,s)),e.min=(r,s)=>e.check(xu(r,s)),e.lt=(r,s)=>e.check(wg(r,s)),e.lte=(r,s)=>e.check(vu(r,s)),e.max=(r,s)=>e.check(vu(r,s)),e.int=r=>e.check(Rg(r)),e.safe=r=>e.check(Rg(r)),e.positive=r=>e.check(Sg(0,r)),e.nonnegative=r=>e.check(xu(0,r)),e.negative=r=>e.check(wg(0,r)),e.nonpositive=r=>e.check(vu(0,r)),e.multipleOf=(r,s)=>e.check(Eg(r,s)),e.step=(r,s)=>e.check(Eg(r,s)),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}),G2=U("ZodNumberFormat",(e,t)=>{TL.init(e,t),_w.init(e,t)});function Rg(e){return EF(G2,e)}const Y2=U("ZodUnknown",(e,t)=>{ML.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>KF()});function Pg(){return kF(Y2)}const X2=U("ZodNever",(e,t)=>{AL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qF(e,n,r)});function J2(e){return CF(X2,e)}const Q2=U("ZodArray",(e,t)=>{NL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>XF(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(_c(n,r)),e.nonempty=n=>e.check(_c(1,n)),e.max=(n,r)=>e.check(hw(n,r)),e.length=(n,r)=>e.check(pw(n,r)),e.unwrap=()=>e.element});function ez(e,t){return FF(Q2,e,t)}const tz=U("ZodObject",(e,t)=>{IL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>JF(e,n,r,s),Re(e,"shape",()=>t.shape),e.keyof=()=>lh(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pg()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pg()}),e.strict=()=>e.clone({...e._zod.def,catchall:J2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tj(e,n),e.safeExtend=n=>nj(e,n),e.merge=n=>rj(e,n),e.pick=n=>QI(e,n),e.omit=n=>ej(e,n),e.partial=(...n)=>sj(Sw,e,n[0]),e.required=(...n)=>oj(Ew,e,n[0])});function ww(e,t){const n={type:"object",shape:e??{},...ie(t)};return new tz(n)}const nz=U("ZodUnion",(e,t)=>{jL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>QF(e,n,r,s),e.options=t.options});function rz(e,t){return new nz({type:"union",options:e,...ie(t)})}const sz=U("ZodIntersection",(e,t)=>{LL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>e2(e,n,r,s)});function oz(e,t){return new sz({type:"intersection",left:e,right:t})}const Rd=U("ZodEnum",(e,t)=>{FL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(r,s,o)=>ZF(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const o={};for(const i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})},e.exclude=(r,s)=>{const o={...t.entries};for(const i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new Rd({...t,checks:[],...ie(s),entries:o})}});function lh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Rd({type:"enum",entries:n,...ie(t)})}const iz=U("ZodTransform",(e,t)=>{zL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>YF(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G_(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(ii(o,n.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ii(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n)):(n.value=s,n)}});function az(e){return new iz({type:"transform",transform:e})}const Sw=U("ZodOptional",(e,t)=>{fw.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Og(e){return new Sw({type:"optional",innerType:e})}const cz=U("ZodExactOptional",(e,t)=>{$L.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bw(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function lz(e){return new cz({type:"optional",innerType:e})}const uz=U("ZodNullable",(e,t)=>{VL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>t2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new uz({type:"nullable",innerType:e})}const dz=U("ZodDefault",(e,t)=>{BL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>r2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fz(e,t){return new dz({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Q_(t)}})}const hz=U("ZodPrefault",(e,t)=>{UL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>s2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pz(e,t){return new hz({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Q_(t)}})}const Ew=U("ZodNonOptional",(e,t)=>{WL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>n2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function mz(e,t){return new Ew({type:"nonoptional",innerType:e,...ie(t)})}const gz=U("ZodCatch",(e,t)=>{HL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>o2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yz(e,t){return new gz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bz=U("ZodPipe",(e,t)=>{qL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>i2(e,n,r,s),e.in=t.in,e.out=t.out});function Mg(e,t){return new bz({type:"pipe",in:e,out:t})}const vz=U("ZodReadonly",(e,t)=>{KL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>a2(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function xz(e){return new vz({type:"readonly",innerType:e})}const _z=U("ZodCustom",(e,t)=>{ZL.init(e,t),et.init(e,t),e._zod.processJSONSchema=(n,r,s)=>GF(e,n)});function wz(e,t={}){return zF(_z,e,t)}function Sz(e){return $F(e)}function js(e){return SF(_w,e)}function nt({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:Se("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})}function Ag(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ez(e){const t=kz(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(Rz);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function kz(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=Oz(s),a=Pz(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cz=Symbol("radix.slottable");function Rz(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cz}function Pz(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Oz(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 kw(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cw=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"}),Tz="VisuallyHidden",Mz=v.forwardRef((e,t)=>g.jsx(be.span,{...e,ref:t,style:{...Cw,...e.style}}));Mz.displayName=Tz;var Az=[" ","Enter","ArrowUp","ArrowDown"],Nz=[" ","Enter"],ss="Select",[vl,xl,Dz]=Ff(ss),[oo]=wr(ss,[Dz,ol]),_l=ol(),[Iz,kr]=oo(ss),[jz,Lz]=oo(ss),Rw=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=_l(t),[y,b]=v.useState(null),[x,_]=v.useState(null),[w,S]=v.useState(!1),C=zf(l),[k,E]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:ss}),[P,O]=Zs({prop:i,defaultProp:a,onChange:c,caller:ss}),N=v.useRef(null),A=y?p||!!y.closest("form"):!0,[j,$]=v.useState(new Set),q=Array.from(j).map(D=>D.props.value).join(";");return g.jsx(e_,{...m,children:g.jsxs(Iz,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Hn(),value:P,onValueChange:O,open:k,onOpenChange:E,dir:C,triggerPointerDownPosRef:N,disabled:f,children:[g.jsx(vl.Provider,{scope:t,children:g.jsx(jz,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{$(H=>new Set(H).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{$(H=>{const F=new Set(H);return F.delete(D),F})},[]),children:n})}),A?g.jsxs(Gw,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:D=>O(D.target.value),disabled:f,form:p,children:[P===void 0?g.jsx("option",{value:""}):null,Array.from(j)]},q):null]})})};Rw.displayName=ss;var Pw="SelectTrigger",Ow=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=_l(n),i=kr(Pw,n),a=i.disabled||r,c=Pe(t,i.onTriggerChange),l=xl(n),u=v.useRef("touch"),[d,f,h]=Xw(m=>{const y=l().filter(_=>!_.disabled),b=y.find(_=>_.value===i.value),x=Jw(y,m,b);x!==void 0&&i.onValueChange(x.value)}),p=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(t_,{asChild:!0,...o,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Yw(i.value)?"":void 0,...s,ref:c,onClick:re(s.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:re(s.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:re(s.onKeyDown,m=>{const y=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(y&&m.key===" ")&&Az.includes(m.key)&&(p(),m.preventDefault())})})})});Ow.displayName=Pw;var Tw="SelectValue",Mw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=kr(Tw,n),{onValueNodeHasChildrenChange:l}=c,u=o!==void 0,d=Pe(t,c.onValueNodeChange);return vt(()=>{l(u)},[l,u]),g.jsx(be.span,{...a,ref:d,style:{pointerEvents:"none"},children:Yw(c.value)?g.jsx(g.Fragment,{children:i}):o})});Mw.displayName=Tw;var Fz="SelectIcon",Aw=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return g.jsx(be.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Aw.displayName=Fz;var zz="SelectPortal",Nw=e=>g.jsx(il,{asChild:!0,...e});Nw.displayName=zz;var os="SelectContent",Dw=v.forwardRef((e,t)=>{const n=kr(os,e.__scopeSelect),[r,s]=v.useState();if(vt(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ic.createPortal(g.jsx(Iw,{scope:e.__scopeSelect,children:g.jsx(vl.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(jw,{...e,ref:t})});Dw.displayName=os;var cn=10,[Iw,Cr]=oo(os),$z="SelectContentImpl",Vz=Ez("SelectContent.RemoveScroll"),jw=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y,...b}=e,x=kr(os,n),[_,w]=v.useState(null),[S,C]=v.useState(null),k=Pe(t,V=>w(V)),[E,P]=v.useState(null),[O,N]=v.useState(null),A=xl(n),[j,$]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(_)return Gf(_)},[_]),$f();const D=v.useCallback(V=>{const[ee,...me]=A().map(ge=>ge.ref.current),[le]=me.slice(-1),fe=document.activeElement;for(const ge of V)if(ge===fe||(ge?.scrollIntoView({block:"nearest"}),ge===ee&&S&&(S.scrollTop=0),ge===le&&S&&(S.scrollTop=S.scrollHeight),ge?.focus(),document.activeElement!==fe))return},[A,S]),H=v.useCallback(()=>D([E,_]),[D,E,_]);v.useEffect(()=>{j&&H()},[j,H]);const{onOpenChange:F,triggerPointerDownPosRef:W}=x;v.useEffect(()=>{if(_){let V={x:0,y:0};const ee=le=>{V={x:Math.abs(Math.round(le.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(W.current?.y??0))}},me=le=>{V.x<=10&&V.y<=10?le.preventDefault():_.contains(le.target)||F(!1),document.removeEventListener("pointermove",ee),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",me,{capture:!0})}}},[_,F,W]),v.useEffect(()=>{const V=()=>F(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[F]);const[se,I]=Xw(V=>{const ee=A().filter(fe=>!fe.disabled),me=ee.find(fe=>fe.ref.current===document.activeElement),le=Jw(ee,V,me);le&&setTimeout(()=>le.ref.current.focus())}),Y=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&(P(V),le&&(q.current=!0))},[x.value]),K=v.useCallback(()=>_?.focus(),[_]),Z=v.useCallback((V,ee,me)=>{const le=!q.current&&!me;(x.value!==void 0&&x.value===ee||le)&&N(V)},[x.value]),oe=r==="popper"?Pd:Lw,ce=oe===Pd?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:y}:{};return g.jsx(Iw,{scope:n,content:_,viewport:S,onViewportChange:C,itemRefCallback:Y,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:j,searchRef:se,children:g.jsx(cl,{as:Vz,allowPinchZoom:!0,children:g.jsx(el,{asChild:!0,trapped:x.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:re(s,V=>{x.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:g.jsx(Qc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:g.jsx(oe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:V=>V.preventDefault(),...b,...ce,onPlaced:()=>$(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:re(b.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&I(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let le=A().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(V.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const fe=V.target,ge=le.indexOf(fe);le=le.slice(ge+1)}setTimeout(()=>D(le)),V.preventDefault()}})})})})})})});jw.displayName=$z;var Bz="SelectItemAlignedPosition",Lw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=kr(os,n),i=Cr(os,n),[a,c]=v.useState(null),[l,u]=v.useState(null),d=Pe(t,k=>u(k)),f=xl(n),h=v.useRef(!1),p=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=i,_=v.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&l&&m&&y&&b){const k=o.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(o.dir!=="rtl"){const fe=O.left-E.left,ge=P.left-fe,Ze=k.left-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.left=st+"px"}else{const fe=E.right-O.right,ge=window.innerWidth-P.right-fe,Ze=window.innerWidth-k.right-ge,_t=k.width+Ze,rn=Math.max(_t,E.width),qt=window.innerWidth-cn,st=Ag(ge,[cn,Math.max(cn,qt-rn)]);a.style.minWidth=_t+"px",a.style.right=st+"px"}const N=f(),A=window.innerHeight-cn*2,j=m.scrollHeight,$=window.getComputedStyle(l),q=parseInt($.borderTopWidth,10),D=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),F=parseInt($.paddingBottom,10),W=q+D+j+F+H,se=Math.min(y.offsetHeight*5,W),I=window.getComputedStyle(m),Y=parseInt(I.paddingTop,10),K=parseInt(I.paddingBottom,10),Z=k.top+k.height/2-cn,oe=A-Z,ce=y.offsetHeight/2,V=y.offsetTop+ce,ee=q+D+V,me=W-ee;if(ee<=Z){const fe=N.length>0&&y===N[N.length-1].ref.current;a.style.bottom="0px";const ge=l.clientHeight-m.offsetTop-m.offsetHeight,Ze=Math.max(oe,ce+(fe?K:0)+ge+H),_t=ee+Ze;a.style.height=_t+"px"}else{const fe=N.length>0&&y===N[0].ref.current;a.style.top="0px";const Ze=Math.max(Z,q+m.offsetTop+(fe?Y:0)+ce)+me;a.style.height=Ze+"px",m.scrollTop=ee-Z+m.offsetTop}a.style.margin=`${cn}px 0`,a.style.minHeight=se+"px",a.style.maxHeight=A+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,l,m,y,b,o.dir,r]);vt(()=>_(),[_]);const[w,S]=v.useState();vt(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(k=>{k&&p.current===!0&&(_(),x?.(),p.current=!1)},[_,x]);return g.jsx(Wz,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:g.jsx(be.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Lw.displayName=Bz;var Uz="SelectPopperPosition",Pd=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=cn,...o}=e,i=_l(n);return g.jsx(n_,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Pd.displayName=Uz;var[Wz,uh]=oo(os,{}),Od="SelectViewport",Fw=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Cr(Od,n),i=uh(Od,n),a=Pe(t,o.onViewportChange),c=v.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(vl.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:re(s.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f?.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const p=window.innerHeight-cn*2,m=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(m,y);if(b<p){const x=b+h,_=Math.min(p,x),w=x-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Fw.displayName=Od;var zw="SelectGroup",[Hz,qz]=oo(zw),Kz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hn();return g.jsx(Hz,{scope:n,id:s,children:g.jsx(be.div,{role:"group","aria-labelledby":s,...r,ref:t})})});Kz.displayName=zw;var $w="SelectLabel",Zz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=qz($w,n);return g.jsx(be.div,{id:s.id,...r,ref:t})});Zz.displayName=$w;var Sc="SelectItem",[Gz,Vw]=oo(Sc),Bw=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=kr(Sc,n),c=Cr(Sc,n),l=a.value===r,[u,d]=v.useState(o??""),[f,h]=v.useState(!1),p=Pe(t,x=>c.itemRefCallback?.(x,r,s)),m=Hn(),y=v.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.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 g.jsx(Gz,{scope:n,value:r,disabled:s,textId:m,isSelected:l,onItemTextChange:v.useCallback(x=>{d(_=>_||(x?.textContent??"").trim())},[]),children:g.jsx(vl.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:p,onFocus:re(i.onFocus,()=>h(!0)),onBlur:re(i.onBlur,()=>h(!1)),onClick:re(i.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:re(i.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:re(i.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:re(i.onPointerMove,x=>{y.current=x.pointerType,s?c.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:re(i.onKeyDown,x=>{c.searchRef?.current!==""&&x.key===" "||(Nz.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Bw.displayName=Sc;var To="SelectItemText",Uw=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=kr(To,n),a=Cr(To,n),c=Vw(To,n),l=Lz(To,n),[u,d]=v.useState(null),f=Pe(t,b=>d(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=u?.textContent,p=v.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=l;return vt(()=>(m(p),()=>y(p)),[m,y,p]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:c.textId,...o,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ic.createPortal(o.children,i.valueNode):null]})});Uw.displayName=To;var Ww="SelectItemIndicator",Hw=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vw(Ww,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Hw.displayName=Ww;var Td="SelectScrollUpButton",qw=v.forwardRef((e,t)=>{const n=Cr(Td,e.__scopeSelect),r=uh(Td,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;o(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Zw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});qw.displayName=Td;var Md="SelectScrollDownButton",Kw=v.forwardRef((e,t)=>{const n=Cr(Md,e.__scopeSelect),r=uh(Md,e.__scopeSelect),[s,o]=v.useState(!1),i=Pe(t,r.onScrollButtonChange);return vt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Zw,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Kw.displayName=Md;var Zw=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Cr("SelectScrollButton",n),i=v.useRef(null),a=xl(n),c=v.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),vt(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),g.jsx(be.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:re(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:re(s.onPointerMove,()=>{o.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:re(s.onPointerLeave,()=>{c()})})}),Yz="SelectSeparator",Xz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});Xz.displayName=Yz;var Ad="SelectArrow",Jz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_l(n),o=kr(Ad,n),i=Cr(Ad,n);return o.open&&i.position==="popper"?g.jsx(r_,{...s,...r,ref:t}):null});Jz.displayName=Ad;var Qz="SelectBubbleInput",Gw=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=v.useRef(null),o=Pe(r,s),i=kw(t);return v.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),g.jsx(be.select,{...n,style:{...Cw,...n.style},ref:o,defaultValue:t})});Gw.displayName=Qz;function Yw(e){return e===""||e===void 0}function Xw(e){const t=On(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(i=>{const a=n.current+i;t(a),(function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function Jw(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=e$(e,Math.max(o,0));s.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function e$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var t$=Rw,n$=Ow,r$=Mw,s$=Aw,o$=Nw,i$=Dw,a$=Fw,c$=Bw,l$=Uw,u$=Hw,d$=qw,f$=Kw;function Ls({...e}){return g.jsx(t$,{"data-slot":"select",...e})}function Fs({...e}){return g.jsx(r$,{"data-slot":"select-value",...e})}function zs({className:e,size:t="default",children:n,...r}){return g.jsxs(n$,{"data-slot":"select-trigger","data-size":t,className:Se("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,g.jsx(s$,{asChild:!0,children:g.jsx(vx,{className:"size-4 opacity-50"})})]})}function $s({className:e,children:t,position:n="popper",...r}){return g.jsx(o$,{children:g.jsxs(i$,{"data-slot":"select-content",className:Se("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:[g.jsx(h$,{}),g.jsx(a$,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(p$,{})]})})}function Vs({className:e,children:t,...n}){return g.jsxs(c$,{"data-slot":"select-item",className:Se("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:[g.jsx("span",{className:"absolute end-2 flex size-3.5 items-center justify-center",children:g.jsx(u$,{children:g.jsx(bx,{className:"size-4"})})}),g.jsx(l$,{children:t})]})}function h$({className:e,...t}){return g.jsx(d$,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(LM,{className:"size-4"})})}function p$({className:e,...t}){return g.jsx(f$,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(vx,{className:"size-4"})})}var m$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],g$=m$.reduce((e,t)=>{const n=Cx(`Primitive.${t}`),r=v.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),y$="Label",Qw=v.forwardRef((e,t)=>g.jsx(g$.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Qw.displayName=y$;var b$=Qw;function e0({className:e,...t}){return g.jsx(b$,{"data-slot":"label",className:Se("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})}const t0=pO,n0=v.createContext({}),Ne=({...e})=>g.jsx(n0.Provider,{value:{name:e.name},children:g.jsx(fO,{...e})}),dh=()=>{const e=v.useContext(n0),t=v.useContext(r0),{getFieldState:n}=hO(),r=Ev({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},r0=v.createContext({});function De({className:e,...t}){const n=v.useId();return g.jsx(r0.Provider,{value:{id:n},children:g.jsx("div",{"data-slot":"form-item",className:Se("grid gap-2",e),...t})})}function Ie({className:e,children:t,required:n,...r}){const{error:s,formItemId:o}=dh();return g.jsxs(e0,{"data-slot":"form-label","data-error":!!s,className:e,htmlFor:o,...r,children:[t,n&&g.jsx("span",{className:"text-destructive",children:"*"})]})}function je({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=dh();return g.jsx(Lf,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Le({className:e,...t}){const{error:n,formMessageId:r}=dh(),s=n?String(n?.message??""):t.children;return s?g.jsx("p",{"data-slot":"form-message",id:r,className:Se("text-destructive text-sm",e),...t,children:s}):null}function v$(e){const t=x$(e),n=v.forwardRef((r,s)=>{const{children:o,...i}=r,a=v.Children.toArray(o),c=a.find(w$);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:s,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function x$(e){const t=v.forwardRef((n,r)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const i=E$(s),a=S$(o,s.props);return s.type!==v.Fragment&&(a.ref=r?Yn(r,i):i),v.cloneElement(s,a)}return v.Children.count(s)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _$=Symbol("radix.slottable");function w$(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_$}function S$(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function E$(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 wl="Dialog",[s0]=wr(wl),[k$,yn]=s0(wl),o0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=v.useRef(null),c=v.useRef(null),[l,u]=Zs({prop:r,defaultProp:s??!1,onChange:o,caller:wl});return g.jsx(k$,{scope:t,triggerRef:a,contentRef:c,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};o0.displayName=wl;var i0="DialogTrigger",C$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(i0,n),o=Pe(t,s.triggerRef);return g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ph(s.open),...r,ref:o,onClick:re(e.onClick,s.onOpenToggle)})});C$.displayName=i0;var fh="DialogPortal",[R$,a0]=s0(fh,{forceMount:void 0}),c0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=yn(fh,t);return g.jsx(R$,{scope:t,forceMount:n,children:v.Children.map(r,i=>g.jsx(Xn,{present:n||o.open,children:g.jsx(il,{asChild:!0,container:s,children:i})}))})};c0.displayName=fh;var Ec="DialogOverlay",l0=v.forwardRef((e,t)=>{const n=a0(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(Ec,e.__scopeDialog);return o.modal?g.jsx(Xn,{present:r||o.open,children:g.jsx(O$,{...s,ref:t})}):null});l0.displayName=Ec;var P$=v$("DialogOverlay.RemoveScroll"),O$=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(Ec,n);return g.jsx(cl,{as:P$,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(be.div,{"data-state":ph(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),is="DialogContent",u0=v.forwardRef((e,t)=>{const n=a0(is,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=yn(is,e.__scopeDialog);return g.jsx(Xn,{present:r||o.open,children:o.modal?g.jsx(T$,{...s,ref:t}):g.jsx(M$,{...s,ref:t})})});u0.displayName=is;var T$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(null),s=Pe(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Gf(o)},[]),g.jsx(d0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:re(e.onFocusOutside,o=>o.preventDefault())})}),M$=v.forwardRef((e,t)=>{const n=yn(is,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return g.jsx(d0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),d0=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=yn(is,n),c=v.useRef(null),l=Pe(t,c);return $f(),g.jsxs(g.Fragment,{children:[g.jsx(el,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Qc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ph(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(A$,{titleId:a.titleId}),g.jsx(D$,{contentRef:c,descriptionId:a.descriptionId})]})]})}),hh="DialogTitle",f0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(hh,n);return g.jsx(be.h2,{id:s.titleId,...r,ref:t})});f0.displayName=hh;var h0="DialogDescription",p0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(h0,n);return g.jsx(be.p,{id:s.descriptionId,...r,ref:t})});p0.displayName=h0;var m0="DialogClose",g0=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=yn(m0,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>s.onOpenChange(!1))})});g0.displayName=m0;function ph(e){return e?"open":"closed"}var y0="DialogTitleWarning",[GH,b0]=g1(y0,{contentName:is,titleName:hh,docsSlug:"dialog"}),A$=({titleId:e})=>{const t=b0(y0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
100
100
|
|
|
101
101
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
102
102
|
|
|
103
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},A$="DialogDescriptionWarning",N$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${y0(A$).contentName}}.`;return v.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},D$=s0,I$=a0,j$=c0,L$=l0,F$=d0,z$=h0,$$=m0;function b0({...e}){return g.jsx(D$,{"data-slot":"dialog",...e})}function V$({...e}){return g.jsx(I$,{"data-slot":"dialog-portal",...e})}function B$({className:e,...t}){return g.jsx(j$,{"data-slot":"dialog-overlay",className:Se("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 v0({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(V$,{"data-slot":"dialog-portal",children:[g.jsx(B$,{}),g.jsxs(L$,{"data-slot":"dialog-content",className:Se("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&&g.jsxs($$,{"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:[g.jsx(i1,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function x0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col gap-2 text-center sm:text-start",e),...t})}function _0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function w0({className:e,...t}){return g.jsx(F$,{"data-slot":"dialog-title",className:Se("text-lg leading-none font-semibold",e),...t})}function S0({className:e,...t}){return g.jsx(z$,{"data-slot":"dialog-description",className:Se("text-muted-foreground text-sm",e),...t})}const U$=_w({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Nd({open:e,onOpenChange:t,monitor:n,onSubmit:r}){const s=!!n,[o,i]=v.useState(!1),a=kf({resolver:bw(U$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}});v.useEffect(()=>{e&&(n?a.reset({name:n.name,type:n.type,intervalSeconds:n.intervalSeconds,timeoutMs:n.timeoutMs,url:n.url??"",host:n.host??"",port:n.port,method:n.method??"GET",keyword:n.keyword??"",jsonQuery:n.jsonQuery??"",expectedValue:n.expectedValue??"",dnsRecordType:n.dnsRecordType??""}):a.reset({name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}))},[e,n,a]);const c=a.watch("type"),l=async u=>{i(!0);try{await r(u),t(!1)}catch(d){console.error(d)}finally{i(!1)}};return g.jsx(b0,{open:e,onOpenChange:t,children:g.jsxs(v0,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[g.jsxs(x0,{children:[g.jsx(w0,{children:s?"Edit Monitor":"New Monitor"}),g.jsx(S0,{children:s?"Update monitor configuration.":"Configure parameters for a new uptime monitor."})]}),g.jsx(e0,{...a,children:g.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"name",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"type",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(d=>g.jsx(Vs,{value:d,children:d.toUpperCase()},d))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"intervalSeconds",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"timeoutMs",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})})]}),(c==="http"||c==="keyword"||c==="json_query"||c==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"url",render:({field:u})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...u})}),g.jsx(Le,{})]})}),c!=="websocket"&&g.jsx(Ne,{control:a.control,name:"method",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),(c==="tcp"||c==="ping"||c==="dns"||c==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"host",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...u})}),g.jsx(Le,{})]})}),(c==="tcp"||c==="steam")&&g.jsx(Ne,{control:a.control,name:"port",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),c==="dns"&&g.jsx(Ne,{control:a.control,name:"dnsRecordType",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),c==="keyword"&&g.jsx(Ne,{control:a.control,name:"keyword",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...u})}),g.jsx(Le,{})]})}),c==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"jsonQuery",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"expectedValue",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...u})}),g.jsx(Le,{})]})})]}),c==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs(_0,{children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),g.jsxs(gt,{type:"submit",disabled:o,children:[o&&g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Update":"Create"]})]})]})})]})})}function E0({open:e,onOpenChange:t,monitor:n,onConfirm:r}){const[s,o]=T.useState(!1);async function i(){o(!0);try{await r(),t(!1)}catch(a){console.error(a)}finally{o(!1)}}return g.jsx(b0,{open:e,onOpenChange:t,children:g.jsxs(v0,{className:"sm:max-w-md",children:[g.jsxs(x0,{children:[g.jsx(w0,{children:"Delete Monitor"}),g.jsxs(S0,{children:["Are you sure you want to delete ",g.jsx("span",{className:"font-semibold text-foreground",children:n?.name}),"? This action cannot be undone and will delete all historical data for this monitor."]})]}),g.jsxs(_0,{children:[g.jsx(gt,{variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),g.jsxs(gt,{variant:"destructive",onClick:i,disabled:s,children:[s?g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}):g.jsx(jf,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})}function W$(){const e=Wv(),t=ls(),{data:n,loading:r}=Hv(k=>k.monitors),[s,o]=v.useState(""),[i,a]=v.useState(!1),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(null);v.useEffect(()=>{e(Ur(60));const k=setInterval(()=>e(Ur(60)),3e4);return()=>clearInterval(k)},[e]);const p=v.useMemo(()=>{if(!s)return n;const k=s.toLowerCase();return n.filter(E=>E.monitor.name.toLowerCase().includes(k)||E.monitor.host?.toLowerCase().includes(k))},[n,s]),m=async k=>{try{await e(hx(k)).unwrap(),Ee.success("Monitor created"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to create monitor"),E}},y=async k=>{if(f)try{await e(Df({id:f.id,data:k})).unwrap(),Ee.success("Monitor updated"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to update monitor"),E}},b=async()=>{if(f)try{await e(Nf(f.id)).unwrap(),Ee.success("Monitor deleted")}catch(k){throw Ee.error(k||"Failed to delete monitor"),k}},x=async k=>{try{await e(dc({id:k.id,paused:!k.isPaused})).unwrap(),Ee.success(k.isPaused?"Resumed":"Paused")}catch(E){Ee.error(E||"Failed to toggle pause")}},_=async k=>{Ee.info("Clone feature coming soon")},w=k=>{h(k),l(!0)},S=k=>{h(k),d(!0)},C=k=>{t({to:"/monitors/$id",params:{id:k.id}})};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Monitors"}),g.jsx("p",{className:"text-muted-foreground",children:"Manage your uptime monitors and status checks."})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"relative w-full md:w-auto",children:[g.jsx(Sx,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),g.jsx(nt,{placeholder:"Search monitors...",value:s,onChange:k=>o(k.target.value),className:"pl-8 w-full md:w-[250px]"})]}),g.jsxs(gt,{onClick:()=>{h(null),a(!0)},children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]})]}),r&&n.length===0?g.jsx("div",{className:"flex h-64 items-center justify-center",children:g.jsx(If,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center animate-in fade-in-50",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:g.jsx(qM,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No monitors found"}),g.jsx("p",{className:"mb-4 mt-2 text-sm text-muted-foreground",children:s?"Try adjusting your search terms.":"Get started by adding your first monitor."}),!s&&g.jsxs(gt,{onClick:()=>a(!0),children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map(k=>g.jsx(WI,{summary:k,onEdit:w,onDelete:S,onPause:x,onClone:_,onDetails:C},k.monitor.id))}),g.jsx(Nd,{open:i,onOpenChange:a,onSubmit:m}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:f,onSubmit:y}),g.jsx(E0,{open:u,onOpenChange:d,monitor:f,onConfirm:b})]})}function Rs({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:Se("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function Ps({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:Se("@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 Os({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:Se("leading-none font-semibold",e),...t})}function k0({className:e,...t}){return g.jsx("div",{"data-slot":"card-description",className:Se("text-muted-foreground text-sm",e),...t})}function Ts({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:Se("px-6",e),...t})}const H$=_w({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Ng(){const e=ls(),n=pi({strict:!1})?.id,r=kf({resolver:bw(H$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}}),{reset:s,watch:o,control:i}=r;v.useEffect(()=>{n&&(async()=>{try{const u=(await Te.get("/monitors")).data.monitors.find(d=>d.id===n);u&&s({...u,intervalSeconds:u.intervalSeconds,timeoutMs:u.timeoutMs})}catch{Ee.error("Failed to load monitor")}})()},[n,s]);const a=o("type"),c=async l=>{try{const u={...l};n?(await Te.put(`/monitors/${n}`,u),Ee.success("Monitor updated")):(await Te.post("/monitors",u),Ee.success("Monitor created")),e({to:"/"})}catch(u){Ee.error(u?.response?.data?.detail??"Save failed")}};return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",onClick:()=>e({to:"/"}),children:g.jsx(gx,{className:"h-4 w-4"})}),g.jsx("h2",{className:"text-xl font-semibold",children:n?"Edit Monitor":"New Monitor"})]}),g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Monitor Configuration"}),g.jsx(k0,{children:"Configure the settings for your uptime monitor."})]}),g.jsx(Ts,{children:g.jsx(e0,{...r,children:g.jsxs("form",{onSubmit:r.handleSubmit(c),className:"space-y-6",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"name",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"type",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>g.jsx(Vs,{value:u,children:u.toUpperCase()},u))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"intervalSeconds",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"timeoutMs",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})})]}),(a==="http"||a==="keyword"||a==="json_query"||a==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"url",render:({field:l})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...l})}),g.jsx(Le,{})]})}),a!=="websocket"&&g.jsx(Ne,{control:i,name:"method",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),(a==="tcp"||a==="ping"||a==="dns"||a==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"host",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...l})}),g.jsx(Le,{})]})}),(a==="tcp"||a==="steam")&&g.jsx(Ne,{control:i,name:"port",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),a==="dns"&&g.jsx(Ne,{control:i,name:"dnsRecordType",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),a==="keyword"&&g.jsx(Ne,{control:i,name:"keyword",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...l})}),g.jsx(Le,{})]})}),a==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"jsonQuery",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"expectedValue",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...l})}),g.jsx(Le,{})]})})]}),a==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>e({to:"/"}),children:"Cancel"}),g.jsx(gt,{type:"submit",disabled:r.formState.isSubmitting,children:r.formState.isSubmitting?"Saving...":"Save Monitor"})]})]})})})]})]})}const Mn=Object.create(null);Mn.open="0";Mn.close="1";Mn.ping="2";Mn.pong="3";Mn.message="4";Mn.upgrade="5";Mn.noop="6";const La=Object.create(null);Object.keys(Mn).forEach(e=>{La[Mn[e]]=e});const Dd={type:"error",data:"parser error"},C0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",R0=typeof ArrayBuffer=="function",P0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,mh=({type:e,data:t},n,r)=>C0&&t instanceof Blob?n?r(t):Dg(t,r):R0&&(t instanceof ArrayBuffer||P0(t))?n?r(t):Dg(new Blob([t]),r):r(Mn[e]+(t||"")),Dg=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ig(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function q$(e,t){if(C0&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ig).then(t);if(R0&&(e.data instanceof ArrayBuffer||P0(e.data)))return t(Ig(e.data));mh(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jg.length;e++)Mo[jg.charCodeAt(e)]=e;const K$=e=>{let t=e.length*.75,n=e.length,r,s=0,o,i,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=Mo[e.charCodeAt(r)],i=Mo[e.charCodeAt(r+1)],a=Mo[e.charCodeAt(r+2)],c=Mo[e.charCodeAt(r+3)],u[s++]=o<<2|i>>4,u[s++]=(i&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return l},Z$=typeof ArrayBuffer=="function",gh=(e,t)=>{if(typeof e!="string")return{type:"message",data:O0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:G$(e.substring(1),t)}:La[n]?e.length>1?{type:La[n],data:e.substring(1)}:{type:La[n]}:Dd},G$=(e,t)=>{if(Z$){const n=K$(e);return O0(n,t)}else return{base64:!0,data:e}},O0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,T0="",Y$=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,i)=>{mh(o,!1,a=>{r[i]=a,++s===n&&t(r.join(T0))})})},X$=(e,t)=>{const n=e.split(T0),r=[];for(let s=0;s<n.length;s++){const o=gh(n[s],t);if(r.push(o),o.type==="error")break}return r};function J$(){return new TransformStream({transform(e,t){q$(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function ca(e){return e.reduce((t,n)=>t+n.length,0)}function la(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Q$(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(ca(n)<1)break;const c=la(n,1);o=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(ca(n)<2)break;const c=la(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ca(n)<8)break;const c=la(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Dd);break}s=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ca(n)<s)break;const c=la(n,s);a.enqueue(gh(o?c:wu.decode(c),t)),r=0}if(s===0||s>e){a.enqueue(Dd);break}}}})}const M0=4;function Xe(e){if(e)return eV(e)}function eV(e){for(var t in Xe.prototype)e[t]=Xe.prototype[t];return e}Xe.prototype.on=Xe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Xe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Xe.prototype.emitReserved=Xe.prototype.emit;Xe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Xe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),tV="arraybuffer";function A0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const nV=Xt.setTimeout,rV=Xt.clearTimeout;function El(e,t){t.useNativeTimers?(e.setTimeoutFn=nV.bind(Xt),e.clearTimeoutFn=rV.bind(Xt)):(e.setTimeoutFn=Xt.setTimeout.bind(Xt),e.clearTimeoutFn=Xt.clearTimeout.bind(Xt))}const sV=1.33;function oV(e){return typeof e=="string"?iV(e):Math.ceil((e.byteLength||e.size)*sV)}function iV(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function N0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function aV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function cV(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class lV extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yh extends Xe{constructor(t){super(),this.writable=!1,El(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new lV(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=aV(t);return n.length?"?"+n:""}}class uV extends yh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};X$(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Y$(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=N0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let D0=!1;try{D0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dV=D0;function fV(){}class hV extends uV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Cn extends Xe{constructor(t,n,r){super(),this.createRequest=t,El(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=A0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Cn.requestsCount++,Cn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Cn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Cn.requestsCount=0;Cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lg);else if(typeof addEventListener=="function"){const e="onpagehide"in Xt?"pagehide":"unload";addEventListener(e,Lg,!1)}}function Lg(){for(let e in Cn.requests)Cn.requests.hasOwnProperty(e)&&Cn.requests[e].abort()}const pV=(function(){const e=I0({xdomain:!1});return e&&e.responseType!==null})();class mV extends hV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=pV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Cn(I0,this.uri(),t)}}function I0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||dV))return new XMLHttpRequest}catch{}if(!t)try{return new Xt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const j0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class gV extends yh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=j0?{}:A0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;mh(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=N0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Su=Xt.WebSocket||Xt.MozWebSocket;class yV extends gV{createSocket(t,n,r){return j0?new Su(t,n,r):n?new Su(t,n):new Su(t)}doWrite(t,n){this.ws.send(n)}}class bV extends yh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Q$(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=J$();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const vV={websocket:yV,webtransport:bV,polling:mV},xV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,_V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Id(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=xV.exec(e||""),o={},i=14;for(;i--;)o[_V[i]]=s[i]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=wV(o,o.path),o.queryKey=SV(o,o.query),o}function wV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function SV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const jd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fa=[];jd&&addEventListener("offline",()=>{Fa.forEach(e=>e())},!1);class fr extends Xe{constructor(t,n){if(super(),this.binaryType=tV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Id(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Id(n.host).host);El(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cV(this.opts.query)),jd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=M0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&fr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",fr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=oV(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(fr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fa.indexOf(this._offlineEventListener);r!==-1&&Fa.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}fr.protocol=M0;class EV extends fr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;fr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;fr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const i=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){i("transport closed")}function c(){i("socket closed")}function l(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",i),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",s),n.once("error",i),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let kV=class extends EV{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>vV[s]).filter(s=>!!s)),super(t,r)}};function CV(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Id(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const RV=typeof ArrayBuffer=="function",PV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,L0=Object.prototype.toString,OV=typeof Blob=="function"||typeof Blob<"u"&&L0.call(Blob)==="[object BlobConstructor]",TV=typeof File=="function"||typeof File<"u"&&L0.call(File)==="[object FileConstructor]";function bh(e){return RV&&(e instanceof ArrayBuffer||PV(e))||OV&&e instanceof Blob||TV&&e instanceof File}function za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(za(e[n]))return!0;return!1}if(bh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&za(e[n]))return!0;return!1}function MV(e){const t=[],n=e.data,r=e;return r.data=Ld(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ld(e,t){if(!e)return e;if(bh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ld(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ld(e[r],t));return n}return e}function AV(e,t){return e.data=Fd(e.data,t),delete e.attachments,e}function Fd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fd(e[n],t));return e}const NV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class DV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&za(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=MV(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class vh extends Xe{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new IV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(o,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(vh.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return Fg(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||Fg(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&NV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class IV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=AV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Fg(e){return Object.prototype.toString.call(e)==="[object Object]"}const jV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vh,Encoder:DV,get PacketType(){return _e}},Symbol.toStringTag,{value:"Module"}));function ln(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const LV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class F0 extends Xe{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ln(t,"open",this.onopen.bind(this)),ln(t,"packet",this.onpacket.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(LV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:_e.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),i.id=u}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),i=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(i,a)=>i?s(i):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:_e.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};io.prototype.reset=function(){this.attempts=0};io.prototype.setMin=function(e){this.ms=e};io.prototype.setMax=function(e){this.max=e};io.prototype.setJitter=function(e){this.jitter=e};class zd extends Xe{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,El(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new io({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||jV;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new kV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=ln(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=ln(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ln(t,"ping",this.onping.bind(this)),ln(t,"data",this.ondata.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this)),ln(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new F0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const xo={};function $a(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=CV(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=xo[s]&&o in xo[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let c;return a?c=new zd(r,t):(xo[s]||(xo[s]=new zd(r,t)),c=xo[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($a,{Manager:zd,Socket:F0,io:$a,connect:$a});function Pi(e){return e+.5|0}const ir=(e,t,n)=>Math.max(Math.min(e,n),t);function Ao(e){return ir(Pi(e*2.55),0,255)}function hr(e){return ir(Pi(e*255),0,255)}function $n(e){return ir(Pi(e/2.55)/100,0,1)}function zg(e){return ir(Pi(e*100),0,100)}const Zt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$d=[..."0123456789ABCDEF"],FV=e=>$d[e&15],zV=e=>$d[(e&240)>>4]+$d[e&15],ua=e=>(e&240)>>4===(e&15),$V=e=>ua(e.r)&&ua(e.g)&&ua(e.b)&&ua(e.a);function VV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Zt[e[1]]*17,g:255&Zt[e[2]]*17,b:255&Zt[e[3]]*17,a:t===5?Zt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Zt[e[1]]<<4|Zt[e[2]],g:Zt[e[3]]<<4|Zt[e[4]],b:Zt[e[5]]<<4|Zt[e[6]],a:t===9?Zt[e[7]]<<4|Zt[e[8]]:255})),n}const BV=(e,t)=>e<255?t(e):"";function UV(e){var t=$V(e)?FV:zV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+BV(e.a,t):void 0}const WV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function z0(e,t,n){const r=t*Math.min(n,1-n),s=(o,i=(o+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function HV(e,t,n){const r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function qV(e,t,n){const r=z0(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function KV(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function xh(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let c,l,u;return o!==i&&(u=o-i,l=a>.5?u/(2-o-i):u/(o+i),c=KV(n,r,s,u,o),c=c*60+.5),[c|0,l||0,a]}function _h(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(hr)}function wh(e,t,n){return _h(z0,e,t,n)}function ZV(e,t,n){return _h(qV,e,t,n)}function GV(e,t,n){return _h(HV,e,t,n)}function $0(e){return(e%360+360)%360}function YV(e){const t=WV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ao(+t[5]):hr(+t[5]));const s=$0(+t[2]),o=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?r=ZV(s,o,i):t[1]==="hsv"?r=GV(s,o,i):r=wh(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function XV(e,t){var n=xh(e);n[0]=$0(n[0]+t),n=wh(n),e.r=n[0],e.g=n[1],e.b=n[2]}function JV(e){if(!e)return;const t=xh(e),n=t[0],r=zg(t[1]),s=zg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${$n(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const $g={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function QV(){const e={},t=Object.keys(Vg),n=Object.keys($g);let r,s,o,i,a;for(r=0;r<t.length;r++){for(i=a=t[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,$g[o]);o=parseInt(Vg[i],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let da;function eB(e){da||(da=QV(),da.transparent=[0,0,0,0]);const t=da[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const tB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function nB(e){const t=tB.exec(e);let n=255,r,s,o;if(t){if(t[7]!==r){const i=+t[7];n=t[8]?Ao(i):ir(i*255,0,255)}return r=+t[1],s=+t[3],o=+t[5],r=255&(t[2]?Ao(r):ir(r,0,255)),s=255&(t[4]?Ao(s):ir(s,0,255)),o=255&(t[6]?Ao(o):ir(o,0,255)),{r,g:s,b:o,a:n}}}function rB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_s=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function sB(e,t,n){const r=_s($n(e.r)),s=_s($n(e.g)),o=_s($n(e.b));return{r:hr(Eu(r+n*(_s($n(t.r))-r))),g:hr(Eu(s+n*(_s($n(t.g))-s))),b:hr(Eu(o+n*(_s($n(t.b))-o))),a:e.a+n*(t.a-e.a)}}function fa(e,t,n){if(e){let r=xh(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=wh(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function V0(e,t){return e&&Object.assign(t||{},e)}function Bg(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=hr(e[3]))):(t=V0(e,{r:0,g:0,b:0,a:1}),t.a=hr(t.a)),t}function oB(e){return e.charAt(0)==="r"?nB(e):YV(e)}class ai{constructor(t){if(t instanceof ai)return t;const n=typeof t;let r;n==="object"?r=Bg(t):n==="string"&&(r=VV(t)||eB(t)||oB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=V0(this._rgb);return t&&(t.a=$n(t.a)),t}set rgb(t){this._rgb=Bg(t)}rgbString(){return this._valid?rB(this._rgb):void 0}hexString(){return this._valid?UV(this._rgb):void 0}hslString(){return this._valid?JV(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let o;const i=n===o?.5:n,a=2*i-1,c=r.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,r.r=255&l*r.r+o*s.r+.5,r.g=255&l*r.g+o*s.g+.5,r.b=255&l*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=sB(this._rgb,t._rgb,n)),this}clone(){return new ai(this.rgb)}alpha(t){return this._rgb.a=hr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Pi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fa(this._rgb,2,t),this}darken(t){return fa(this._rgb,2,-t),this}saturate(t){return fa(this._rgb,1,t),this}desaturate(t){return fa(this._rgb,1,-t),this}rotate(t){return XV(this._rgb,t),this}}function In(){}const iB=(()=>{let e=0;return()=>e++})();function ye(e){return e==null}function ze(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function xe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function We(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ft(e,t){return We(e)?e:t}function de(e,t){return typeof e>"u"?t:e}const aB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,B0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Me(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ce(e,t,n,r){let s,o,i;if(ze(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(xe(e))for(i=Object.keys(e),o=i.length,s=0;s<o;s++)t.call(n,e[i[s]],i[s])}function kc(e,t){let n,r,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Cc(e){if(ze(e))return e.map(Cc);if(xe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=Cc(e[n[s]]);return t}return e}function U0(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function cB(e,t,n,r){if(!U0(e))return;const s=t[e],o=n[e];xe(s)&&xe(o)?ci(s,o,r):t[e]=Cc(o)}function ci(e,t,n){const r=ze(t)?t:[t],s=r.length;if(!xe(e))return e;n=n||{};const o=n.merger||cB;let i;for(let a=0;a<s;++a){if(i=r[a],!xe(i))continue;const c=Object.keys(i);for(let l=0,u=c.length;l<u;++l)o(c[l],e,i,n)}return e}function Vo(e,t){return ci(e,t,{merger:lB})}function lB(e,t,n){if(!U0(e))return;const r=t[e],s=n[e];xe(r)&&xe(s)?Vo(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Cc(s))}const Ug={"":e=>e,x:e=>e.x,y:e=>e.y};function uB(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function dB(e){const t=uB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function br(e,t){return(Ug[t]||(Ug[t]=dB(t)))(e)}function Sh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const li=e=>typeof e<"u",vr=e=>typeof e=="function",Wg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function fB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const we=Math.PI,Ae=2*we,hB=Ae+we,Rc=Number.POSITIVE_INFINITY,pB=we/180,He=we/2,Mr=we/4,Hg=we*2/3,ar=Math.log10,Rn=Math.sign;function Bo(e,t,n){return Math.abs(e-t)<n}function qg(e){const t=Math.round(e);e=Bo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ar(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function mB(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function gB(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ys(e){return!gB(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function yB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function W0(e,t,n){let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function fn(e){return e*(we/180)}function Eh(e){return e*(180/we)}function Kg(e){if(!We(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function H0(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*we&&(o+=Ae),{angle:o,distance:s}}function Vd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function bB(e,t){return(e-t+hB)%Ae-we}function mt(e){return(e%Ae+Ae)%Ae}function ui(e,t,n,r){const s=mt(e),o=mt(t),i=mt(n),a=mt(o-s),c=mt(i-s),l=mt(s-o),u=mt(s-i);return s===o||s===i||r&&o===i||a>c&&l<u}function at(e,t,n){return Math.max(t,Math.min(n,e))}function vB(e){return at(e,-32768,32767)}function Bn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function kh(e,t,n){n=n||(i=>e[i]<t);let r=e.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Un=(e,t,n,r)=>kh(e,n,r?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),xB=(e,t,n)=>kh(e,n,r=>e[r][t]>=n);function _B(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const q0=["push","pop","shift","splice","unshift"];function wB(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),q0.forEach(n=>{const r="_onData"+Sh(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Zg(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(q0.forEach(o=>{delete e[o]}),delete e._chartjs)}function K0(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Z0=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function G0(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,Z0.call(window,()=>{r=!1,e.apply(t,n)}))}}function SB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ch=e=>e==="start"?"left":e==="end"?"right":"center",ht=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,EB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function Y0(e,t,n){const r=t.length;let s=0,o=r;if(e._sorted){const{iScale:i,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:d,max:f,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(s=Math.min(Un(c,u,d).lo,n?r:Un(t,u,i.getPixelForValue(d)).lo),l){const m=c.slice(0,s+1).reverse().findIndex(y=>!ye(y[a.axis]));s-=Math.max(0,m)}s=at(s,0,r-1)}if(p){let m=Math.max(Un(c,i.axis,f,!0).hi+1,n?0:Un(t,u,i.getPixelForValue(f),!0).hi+1);if(l){const y=c.slice(m-1).findIndex(b=>!ye(b[a.axis]));m+=Math.max(0,y)}o=at(m,s,r)-s}else o=r-s}return{start:s,count:o}}function X0(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=s,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,s),o}const ha=e=>e===0||e===1,Gg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ae/n)),Yg=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ae/n)+1,Uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*He)+1,easeOutSine:e=>Math.sin(e*He),easeInOutSine:e=>-.5*(Math.cos(we*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ha(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ha(e)?e:Gg(e,.075,.3),easeOutElastic:e=>ha(e)?e:Yg(e,.075,.3),easeInOutElastic(e){return ha(e)?e:e<.5?.5*Gg(e*2,.1125,.45):.5+.5*Yg(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Uo.easeInBounce(e*2)*.5:Uo.easeOutBounce(e*2-1)*.5+.5};function Rh(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Xg(e){return Rh(e)?e:new ai(e)}function ku(e){return Rh(e)?e:new ai(e).saturate(.5).darken(.1).hexString()}const kB=["x","y","borderWidth","radius","tension"],CB=["color","borderColor","backgroundColor"];function RB(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:CB},numbers:{type:"number",properties:kB}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function PB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jg=new Map;function OB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Jg.get(n);return r||(r=new Intl.NumberFormat(e,t),Jg.set(n,r)),r}function Oi(e,t,n){return OB(t,n).format(e)}const J0={values(e){return ze(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,o=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=TB(e,n)}const i=ar(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Oi(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ar(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?J0.numeric.call(this,e,t,n):""}};function TB(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var kl={formatters:J0};function MB(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:kl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const as=Object.create(null),Bd=Object.create(null);function Wo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Cu(e,t,n){return typeof t=="string"?ci(Wo(e,t),n):ci(Wo(e,""),t)}class AB{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>ku(s.backgroundColor),this.hoverBorderColor=(r,s)=>ku(s.borderColor),this.hoverColor=(r,s)=>ku(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Cu(this,t,n)}get(t){return Wo(this,t)}describe(t,n){return Cu(Bd,t,n)}override(t,n){return Cu(as,t,n)}route(t,n,r,s){const o=Wo(this,t),i=Wo(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],l=i[s];return xe(c)?Object.assign({},l,c):de(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var $e=new AB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[RB,PB,MB]);function NB(e){return!e||ye(e.size)||ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Pc(e,t,n,r,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>r&&(r=o),r}function DB(e,t,n,r){r=r||{};let s=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(s=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const a=n.length;let c,l,u,d,f;for(c=0;c<a;c++)if(d=n[c],d!=null&&!ze(d))i=Pc(e,s,o,i,d);else if(ze(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!ze(f)&&(i=Pc(e,s,o,i,f));e.restore();const h=o.length/2;if(h>n.length){for(c=0;c<h;c++)delete s[o[c]];o.splice(0,h)}return i}function Ar(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function Qg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ud(e,t,n,r){Q0(e,t,n,r,null)}function Q0(e,t,n,r,s){let o,i,a,c,l,u,d,f;const h=t.pointStyle,p=t.rotation,m=t.radius;let y=(p||0)*pB;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,r,s/2,m,0,0,Ae):e.arc(n,r,m,0,Ae),e.closePath();break;case"triangle":u=s?s/2:m,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),e.closePath();break;case"rectRounded":l=m*.516,c=m-l,i=Math.cos(y+Mr)*c,d=Math.cos(y+Mr)*(s?s/2-l:c),a=Math.sin(y+Mr)*c,f=Math.sin(y+Mr)*(s?s/2-l:c),e.arc(n-d,r-a,l,y-we,y-He),e.arc(n+f,r-i,l,y-He,y),e.arc(n+d,r+a,l,y,y+He),e.arc(n-f,r+i,l,y+He,y+we),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*m,u=s?s/2:c,e.rect(n-u,r-c,2*u,2*c);break}y+=Mr;case"rectRot":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-i),e.lineTo(n+d,r+a),e.lineTo(n-f,r+i),e.closePath();break;case"crossRot":y+=Mr;case"cross":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"star":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i),y+=Mr,d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*m,a=Math.sin(y)*m,e.moveTo(n-i,r-a),e.lineTo(n+i,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(s?s/2:m),r+Math.sin(y)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Cl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Rl(e){e.restore()}function IB(e,t,n,r,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function jB(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function LB(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ye(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function FB(e,t,n,r,s){if(s.strikethrough||s.underline){const o=e.measureText(r),i=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(i,u),e.lineTo(a,u),e.stroke()}}function zB(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function cs(e,t,n,r,s,o={}){const i=ze(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(e.save(),e.font=s.string,LB(e,o),c=0;c<i.length;++c)l=i[c],o.backdrop&&zB(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),ye(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(l,n,r,o.maxWidth)),e.fillText(l,n,r,o.maxWidth),FB(e,n,r,l,o),r+=Number(s.lineHeight);e.restore()}function di(e,t){const{x:n,y:r,w:s,h:o,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*we,we,!0),e.lineTo(n,r+o-i.bottomLeft),e.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,we,He,!0),e.lineTo(n+s-i.bottomRight,r+o),e.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,He,0,!0),e.lineTo(n+s,r+i.topRight),e.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-He,!0),e.lineTo(n+i.topLeft,r)}const $B=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,VB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function BB(e,t){const n=(""+e).match($B);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const UB=e=>+e||0;function Ph(e,t){const n={},r=xe(t),s=r?Object.keys(t):t,o=xe(e)?r?i=>de(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of s)n[i]=UB(o(i));return n}function eS(e){return Ph(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Zr(e){return Ph(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(e){const t=eS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function rt(e,t){e=e||{},t=t||$e.font;let n=de(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=de(e.style,t.style);r&&!(""+r).match(VB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:de(e.family,t.family),lineHeight:BB(de(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:de(e.weight,t.weight),string:""};return s.string=NB(s),s}function No(e,t,n,r){let s,o,i;for(s=0,o=e.length;s<o;++s)if(i=e[s],i!==void 0&&i!==void 0)return i}function WB(e,t,n){const{min:r,max:s}=e,o=B0(t,(s-r)/2),i=(a,c)=>n&&a===0?0:a+c;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function Rr(e,t){return Object.assign(Object.create(e),t)}function Oh(e,t=[""],n,r,s=()=>e[0]){const o=n||e;typeof r>"u"&&(r=sS("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>Oh([a,...e],t,o,r)};return new Proxy(i,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return nS(a,c,()=>JB(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return ty(a).includes(c)},ownKeys(a){return ty(a)},set(a,c,l){const u=a._storage||(a._storage=s());return a[c]=u[c]=l,delete a._keys,!0}})}function Xs(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:tS(e,r),setContext:o=>Xs(e,o,n,r),override:o=>Xs(e.override(o),t,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete e[i],!0},get(o,i,a){return nS(o,i,()=>qB(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(o,i,a){return e[i]=a,delete o[i],!0}})}function tS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:vr(n)?n:()=>n,isIndexable:vr(r)?r:()=>r}}const HB=(e,t)=>e?e+Sh(t):t,Th=(e,t)=>xe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function nS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function qB(e,t,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=e;let a=r[t];return vr(a)&&i.isScriptable(t)&&(a=KB(t,a,e,n)),ze(a)&&a.length&&(a=ZB(t,a,e,i.isIndexable)),Th(t,a)&&(a=Xs(a,s,o&&o[t],i)),a}function KB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,i||r);return a.delete(e),Th(e,c)&&(c=Mh(s._scopes,s,e,c)),c}function ZB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(xe(t[0])){const c=t,l=s._scopes.filter(u=>u!==c);t=[];for(const u of c){const d=Mh(l,s,e,u);t.push(Xs(d,o,i&&i[e],a))}}return t}function rS(e,t,n){return vr(e)?e(t,n):e}const GB=(e,t)=>e===!0?t:typeof e=="string"?br(t,e):void 0;function YB(e,t,n,r,s){for(const o of t){const i=GB(n,o);if(i){e.add(i);const a=rS(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function Mh(e,t,n,r){const s=t._rootScopes,o=rS(t._fallback,n,r),i=[...e,...s],a=new Set;a.add(r);let c=ey(a,i,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=ey(a,i,o,c,r),c===null)?!1:Oh(Array.from(a),[""],s,o,()=>XB(t,n,r))}function ey(e,t,n,r,s){for(;n;)n=YB(e,t,n,r,s);return n}function XB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return ze(s)&&xe(n)?n:s||{}}function JB(e,t,n,r){let s;for(const o of t)if(s=sS(HB(o,e),n),typeof s<"u")return Th(e,s)?Mh(n,r,e,s):s}function sS(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function ty(e){let t=e._keys;return t||(t=e._keys=QB(e._scopes)),t}function QB(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function oS(e,t,n,r){const{iScale:s}=e,{key:o="r"}=this._parsing,i=new Array(r);let a,c,l,u;for(a=0,c=r;a<c;++a)l=a+n,u=t[l],i[a]={r:s.parse(br(u,o),l)};return i}const eU=Number.EPSILON||1e-14,Js=(e,t)=>t<e.length&&!e[t].skip&&e[t],iS=e=>e==="x"?"y":"x";function tU(e,t,n,r){const s=e.skip?t:e,o=t,i=n.skip?t:n,a=Vd(o,s),c=Vd(i,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const d=r*l,f=r*u;return{previous:{x:o.x-d*(i.x-s.x),y:o.y-d*(i.y-s.y)},next:{x:o.x+f*(i.x-s.x),y:o.y+f*(i.y-s.y)}}}function nU(e,t,n){const r=e.length;let s,o,i,a,c,l=Js(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Js(e,u+1),!(!c||!l)){if(Bo(t[u],0,eU)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(i=3/Math.sqrt(a),n[u]=s*i*t[u],n[u+1]=o*i*t[u])}}function rU(e,t,n="x"){const r=iS(n),s=e.length;let o,i,a,c=Js(e,0);for(let l=0;l<s;++l){if(i=a,a=c,c=Js(e,l+1),!a)continue;const u=a[n],d=a[r];i&&(o=(u-i[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[l]),c&&(o=(c[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[l])}}function sU(e,t="x"){const n=iS(t),r=e.length,s=Array(r).fill(0),o=Array(r);let i,a,c,l=Js(e,0);for(i=0;i<r;++i)if(a=c,c=l,l=Js(e,i+1),!!c){if(l){const u=l[t]-c[t];s[i]=u!==0?(l[n]-c[n])/u:0}o[i]=a?l?Rn(s[i-1])!==Rn(s[i])?0:(s[i-1]+s[i])/2:s[i-1]:s[i]}nU(e,s,o),rU(e,o,t)}function pa(e,t,n){return Math.max(Math.min(e,n),t)}function oU(e,t){let n,r,s,o,i,a=Wn(e[0],t);for(n=0,r=e.length;n<r;++n)i=o,o=a,a=n<r-1&&Wn(e[n+1],t),o&&(s=e[n],i&&(s.cp1x=pa(s.cp1x,t.left,t.right),s.cp1y=pa(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=pa(s.cp2x,t.left,t.right),s.cp2y=pa(s.cp2y,t.top,t.bottom)))}function iU(e,t,n,r,s){let o,i,a,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")sU(e,s);else{let l=r?e[e.length-1]:e[0];for(o=0,i=e.length;o<i;++o)a=e[o],c=tU(l,a,e[Math.min(o+1,i-(r?0:1))%i],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&oU(e,n)}function Ah(){return typeof window<"u"&&typeof document<"u"}function Nh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Oc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Pl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function aU(e,t){return Pl(e).getPropertyValue(t)}const cU=["top","right","bottom","left"];function Gr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=cU[s];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const lU=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function uU(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=r;let i=!1,a,c;if(lU(s,o,e.target))a=s,c=o;else{const l=t.getBoundingClientRect();a=r.clientX-l.left,c=r.clientY-l.top,i=!0}return{x:a,y:c,box:i}}function Ir(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Pl(n),o=s.boxSizing==="border-box",i=Gr(s,"padding"),a=Gr(s,"border","width"),{x:c,y:l,box:u}=uU(e,n),d=i.left+(u&&a.left),f=i.top+(u&&a.top);let{width:h,height:p}=t;return o&&(h-=i.width+a.width,p-=i.height+a.height),{x:Math.round((c-d)/h*n.width/r),y:Math.round((l-f)/p*n.height/r)}}function dU(e,t,n){let r,s;if(t===void 0||n===void 0){const o=e&&Nh(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const i=o.getBoundingClientRect(),a=Pl(o),c=Gr(a,"border","width"),l=Gr(a,"padding");t=i.width-l.width-c.width,n=i.height-l.height-c.height,r=Oc(a.maxWidth,o,"clientWidth"),s=Oc(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Rc,maxHeight:s||Rc}}const cr=e=>Math.round(e*10)/10;function fU(e,t,n,r){const s=Pl(e),o=Gr(s,"margin"),i=Oc(s.maxWidth,e,"clientWidth")||Rc,a=Oc(s.maxHeight,e,"clientHeight")||Rc,c=dU(e,t,n);let{width:l,height:u}=c;if(s.boxSizing==="content-box"){const f=Gr(s,"border","width"),h=Gr(s,"padding");l-=h.width+f.width,u-=h.height+f.height}return l=Math.max(0,l-o.width),u=Math.max(0,r?l/r:u-o.height),l=cr(Math.min(l,i,c.maxWidth)),u=cr(Math.min(u,a,c.maxHeight)),l&&!u&&(u=cr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=cr(Math.floor(u*r))),{width:l,height:u}}function ny(e,t,n){const r=t||1,s=cr(e.height*r),o=cr(e.width*r);e.height=cr(e.height),e.width=cr(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(e.currentDevicePixelRatio=r,i.height=s,i.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const hU=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Ah()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function ry(e,t){const n=aU(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pU(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function mU(e,t,n,r){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},i=jr(e,s,n),a=jr(s,o,n),c=jr(o,t,n),l=jr(i,a,n),u=jr(a,c,n);return jr(l,u,n)}const gU=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},yU=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Bs(e,t,n){return e?gU(t,n):yU()}function aS(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function cS(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function lS(e){return e==="angle"?{between:ui,compare:bB,normalize:mt}:{between:Bn,compare:(t,n)=>t-n,normalize:t=>t}}function sy({start:e,end:t,count:n,loop:r,style:s}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:s}}function bU(e,t,n){const{property:r,start:s,end:o}=n,{between:i,normalize:a}=lS(r),c=t.length;let{start:l,end:u,loop:d}=e,f,h;if(d){for(l+=c,u+=c,f=0,h=c;f<h&&i(a(t[l%c][r]),s,o);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function uS(e,t,n){if(!n)return[e];const{property:r,start:s,end:o}=n,i=t.length,{compare:a,between:c,normalize:l}=lS(r),{start:u,end:d,loop:f,style:h}=bU(e,t,n),p=[];let m=!1,y=null,b,x,_;const w=()=>c(s,_,b)&&a(s,_)!==0,S=()=>a(o,b)===0||c(o,_,b),C=()=>m||w(),k=()=>!m||S();for(let E=u,P=u;E<=d;++E)x=t[E%i],!x.skip&&(b=l(x[r]),b!==_&&(m=c(b,s,o),y===null&&C()&&(y=a(b,s)===0?E:P),y!==null&&k()&&(p.push(sy({start:y,end:E,loop:f,count:i,style:h})),y=null),P=E,_=b));return y!==null&&p.push(sy({start:y,end:d,loop:f,count:i,style:h})),p}function dS(e,t){const n=[],r=e.segments;for(let s=0;s<r.length;s++){const o=uS(r[s],e.points,t);o.length&&n.push(...o)}return n}function vU(e,t,n,r){let s=0,o=t-1;if(n&&!r)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function xU(e,t,n,r){const s=e.length,o=[];let i=t,a=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%s];l.skip||l.stop?a.skip||(r=!1,o.push({start:t%s,end:(c-1)%s,loop:r}),t=i=l.stop?c:null):(i=c,a.skip&&(t=c)),a=l}return i!==null&&o.push({start:t%s,end:i%s,loop:r}),o}function _U(e,t){const n=e.points,r=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:i,end:a}=vU(n,s,o,r);if(r===!0)return oy(e,[{start:i,end:a,loop:o}],n,t);const c=a<i?a+s:a,l=!!e._fullLoop&&i===0&&a===s-1;return oy(e,xU(n,i,c,l),n,t)}function oy(e,t,n,r){return!r||!r.setContext||!n?t:wU(e,t,n,r)}function wU(e,t,n,r){const s=e._chart.getContext(),o=iy(e.options),{_datasetIndex:i,options:{spanGaps:a}}=e,c=n.length,l=[];let u=o,d=t[0].start,f=d;function h(p,m,y,b){const x=a?-1:1;if(p!==m){for(p+=c;n[p%c].skip;)p-=x;for(;n[m%c].skip;)m+=x;p%c!==m%c&&(l.push({start:p%c,end:m%c,loop:y,style:b}),u=b,d=m%c)}}for(const p of t){d=a?d:p.start;let m=n[d%c],y;for(f=d+1;f<=p.end;f++){const b=n[f%c];y=iy(r.setContext(Rr(s,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:i}))),SU(y,u)&&h(d,f-1,p.loop,u),m=b,u=y}d<f-1&&h(d,f-1,p.loop,u)}return l}function iy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function SU(e,t){if(!t)return!1;const n=[],r=function(s,o){return Rh(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ma(e,t,n){return e.options.clip?e[n]:t[n]}function EU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ma(n,t,"left"),right:ma(n,t,"right"),top:ma(r,t,"top"),bottom:ma(r,t,"bottom")}:t}function fS(e,t){const n=t._clip;if(n.disabled)return!1;const r=EU(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class kU{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Z0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,c;for(;i>=0;--i)c=o[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ln=new kU;const ay="transparent",CU={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Xg(e||ay),s=r.valid&&Xg(t||ay);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class RU{constructor(t,n,r,s){const o=n[r];s=No([t.to,s,o,t.from]);const i=No([t.from,o,s]);this._active=!0,this._fn=t.fn||CU[t.type||typeof i],this._easing=Uo[t.easing]||Uo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=No([t.to,n,s,t.from]),this._from=No([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let c;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class hS{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!xe(t))return;const n=Object.keys($e.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!xe(o))return;const i={};for(const a of n)i[a]=o[a];(ze(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=OU(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&PU(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let c;for(c=i.length-1;c>=0;--c){const l=i[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[l];let d=o[l];const f=r.get(l);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[l]=u;continue}o[l]=d=new RU(f,t,l,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ln.add(this._chart,r),!0}}function PU(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function OU(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function cy(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function TU(e,t,n){if(n===!1)return!1;const r=cy(e,n),s=cy(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function MU(e){let t,n,r,s;return xe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function pS(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function ly(e,t,n,r={}){const s=e.keys,o=r.mode==="single";let i,a,c,l;if(t===null)return;let u=!1;for(i=0,a=s.length;i<a;++i){if(c=+s[i],c===n){if(u=!0,r.all)continue;break}l=e.values[c],We(l)&&(o||t===0||Rn(t)===Rn(l))&&(t+=l)}return!u&&!r.all?0:t}function AU(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(e),a=new Array(i.length);let c,l,u;for(c=0,l=i.length;c<l;++c)u=i[c],a[c]={[s]:u,[o]:e[u]};return a}function Ru(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function NU(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function DU(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function IU(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function uy(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function dy(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,c=o.axis,l=i.axis,u=NU(o,i,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[c]:m,[l]:y}=p,b=p._stacks||(p._stacks={});f=b[l]=IU(s,u,m),f[a]=y,f._top=uy(f,i,!0,r.type),f._bottom=uy(f,i,!1,r.type);const x=f._visualValues||(f._visualValues={});x[a]=y}}function Pu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function jU(e,t){return Rr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function LU(e,t,n){return Rr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _o(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Ou=e=>e==="reset"||e==="none",fy=(e,t)=>t?e:Object.assign({},e),FU=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:pS(n,!0),values:null};class Pr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ru(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_o(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,o=n.xAxisID=de(r.xAxisID,Pu(t,"x")),i=n.yAxisID=de(r.yAxisID,Pu(t,"y")),a=n.rAxisID=de(r.rAxisID,Pu(t,"r")),c=n.indexAxis,l=n.iAxisID=s(c,o,i,a),u=n.vAxisID=s(c,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(l),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Zg(this._data,this),t._stacked&&_o(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(xe(n)){const s=this._cachedMeta;this._data=AU(n,s)}else if(r!==n){if(r){Zg(r,this);const s=this._cachedMeta;_o(s),s._parsed=[]}n&&Object.isExtensible(n)&&wB(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Ru(n.vScale,n),n.stack!==r.stack&&(s=!0,_o(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(dy(this,n._parsed),n._stacked=Ru(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let c=t===0&&n===s.length?!0:r._sorted,l=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{ze(s[t])?f=this.parseArrayData(r,s,t,n):xe(s[t])?f=this.parseObjectData(r,s,t,n):f=this.parsePrimitiveData(r,s,t,n);const h=()=>d[a]===null||l&&d[a]<l[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],c&&(h()&&(c=!1),l=d);r._sorted=c}i&&dy(this,f)}parsePrimitiveData(t,n,r,s){const{iScale:o,vScale:i}=t,a=o.axis,c=i.axis,l=o.getLabels(),u=o===i,d=new Array(s);let f,h,p;for(f=0,h=s;f<h;++f)p=f+r,d[f]={[a]:u||o.parse(l[p],p),[c]:i.parse(n[p],p)};return d}parseArrayData(t,n,r,s){const{xScale:o,yScale:i}=t,a=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+r,d=n[u],a[c]={x:o.parse(d[0],u),y:i.parse(d[1],u)};return a}parseObjectData(t,n,r,s){const{xScale:o,yScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s);let u,d,f,h;for(u=0,d=s;u<d;++u)f=u+r,h=n[f],l[u]={x:o.parse(br(h,a),f),y:i.parse(br(h,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,o=this._cachedMeta,i=n[t.axis],a={keys:pS(s,!0),values:n._stacks[t.axis]._visualValues};return ly(a,i,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=ly(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,i=s.length,a=this._getOtherScale(t),c=FU(n,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=DU(a);let f,h;function p(){h=s[f];const m=h[a.axis];return!We(h[t.axis])||u>m||d<m}for(f=0;f<i&&!(!p()&&(this.updateRangeFromParsed(l,t,h,c),o));++f);if(o){for(f=i-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,h,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][t.axis],We(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=MU(de(this.options.clip,TU(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,c),u=a;u<a+c;++u){const d=s[u];d.hidden||(d.active&&l?i.push(d):d.draw(t,o))}for(u=0;u<i.length;++u)i[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];o=i.$context||(i.$context=LU(this.getContext(),t,i)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=jU(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=t+"-"+n,a=o[i],c=this.enableOptionSharing&&li(r);if(a)return fy(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),h=Object.keys($e.elements[t]),p=()=>this.getContext(r,s,n),m=l.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=c,o[i]=Object.freeze(fy(m,c))),m}_resolveAnimations(t,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let c;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);c=u.createResolver(f,this.getContext(t,r,n))}const l=new hS(s,c&&c.animations);return c&&c._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ou(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(t,n,r,s){Ou(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Ou(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){const s=this._cachedMeta,o=s.data,i=t+n;let a;const c=l=>{for(l.length+=n,a=l.length-1;a>=i;a--)l[a]=l[a-n]};for(c(o),a=t;a<i;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&_o(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function zU(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=K0(r.sort((s,o)=>s-o))}return e._cache.$bar}function $U(e){const t=e.iScale,n=zU(t,e.type);let r=t._length,s,o,i,a;const c=()=>{i===32767||i===-32768||(li(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=t.getPixelForValue(n[s]),c();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)i=t.getPixelForTick(s),c();return r}function VU(e,t,n,r){const s=n.barThickness;let o,i;return ye(s)?(o=t.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:t.pixels[e]-o/2}}function BU(e,t,n,r){const s=t.pixels,o=s[e];let i=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const c=n.categoryPercentage;i===null&&(i=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-i);const l=o-(o-Math.min(i,a))/2*c;return{chunk:Math.abs(a-i)/2*c/r,ratio:n.barPercentage,start:l}}function UU(e,t,n,r){const s=n.parse(e[0],r),o=n.parse(e[1],r),i=Math.min(s,o),a=Math.max(s,o);let c=i,l=a;Math.abs(i)>Math.abs(a)&&(c=a,l=i),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:s,end:o,min:i,max:a}}function mS(e,t,n,r){return ze(e)?UU(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hy(e,t,n,r){const s=e.iScale,o=e.vScale,i=s.getLabels(),a=s===o,c=[];let l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[s.axis]=a||s.parse(i[l],l),c.push(mS(f,d,o,l));return c}function Tu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function WU(e,t,n){return e!==0?Rn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function HU(e){let t,n,r,s,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:t,top:s,bottom:o}}function qU(e,t,n,r){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:c,top:l,bottom:u}=HU(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=l:(n._bottom||0)===r?s=u:(o[py(u,i,a,c)]=!0,s=l)),o[py(s,i,a,c)]=!0,e.borderSkipped=o}function py(e,t,n,r){return r?(e=KU(e,t,n),e=my(e,n,t)):e=my(e,t,n),e}function KU(e,t,n){return e===t?n:e===n?t:e}function my(e,t,n){return e==="start"?t:e==="end"?n:e}function ZU(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class GU extends Pr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,s){return hy(t,n,r,s)}parseArrayData(t,n,r,s){return hy(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:o,vScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=i.axis==="x"?a:c,d=[];let f,h,p,m;for(f=r,h=r+s;f<h;++f)m=n[f],p={},p[o.axis]=o.parse(br(m,l),f),d.push(mS(br(m,u),p,i,f));return d}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(t),i=o._custom,a=Tu(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,s);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=o||ye(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),b=(p._stacks||{})[a.axis],x={horizontal:l,base:m.base,enableBorderRadius:!b||Tu(p._custom)||i===b._top||i===b._bottom,x:l?m.head:y.center,y:l?y.center:m.head,height:l?y.size:Math.abs(m.size),width:l?Math.abs(m.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(h,t[h].active?"active":s));const _=x.options||t[h].options;qU(x,_,b,i),ZU(x,_,u.ratio),this.updateElement(t[h],h,x,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),c=a&&a[r.axis],l=u=>{const d=u._parsed.find(h=>h[r.axis]===c),f=d&&d[u.vScale.axis];if(ye(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&l(u))&&((o===!1||i.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[de(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||$U(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,c=this.getParsed(t),l=c._custom,u=Tu(l);let d=c[n.axis],f=0,h=r?this.applyStack(n,c,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=l.barStart,h=l.barEnd-l.barStart,d!==0&&Rn(d)!==Rn(l.barEnd)&&(f=0),f+=d);const y=!ye(o)&&!u?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=b,m=p-b,Math.abs(m)<i){m=WU(m,n,a)*i,d===a&&(b-=m/2);const x=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),w=Math.min(x,_),S=Math.max(x,_);b=Math.max(Math.min(b,S),w),p=b+m,r&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=Rn(m)*n.getLineWidthForValue(a)/2;b+=x,m-=x}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,o=s.skipNull,i=de(s.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=s.barThickness==="flex"?BU(t,n,s,u*l):VU(t,n,s,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(de(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;a=d.start+d.chunk*p+d.chunk/2,c=Math.min(i,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),c=Math.min(i,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}class YU extends Pr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,s){const o=super.parsePrimitiveData(t,n,r,s);for(let i=0;i<o.length;i++)o[i]._custom=this.resolveDataElementOptions(i+r).radius;return o}parseArrayData(t,n,r,s){const o=super.parseArrayData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a[2],this.resolveDataElementOptions(i+r).radius)}return o}parseObjectData(t,n,r,s){const o=super.parseObjectData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a&&a.r&&+a.r,this.resolveDataElementOptions(i+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y),l=i._custom;return{label:r[t]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,s),u=i.axis,d=a.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!o&&this.getParsed(f),m={},y=m[u]=o?i.getPixelForDecimal(.5):i.getPixelForValue(p[u]),b=m[d]=o?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(b),l&&(m.options=c||this.resolveDataElementOptions(f,h.active?"active":s),o&&(m.options.radius=0)),this.updateElement(h,f,m,s)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=de(r&&r._custom,o),s}}function XU(e,t,n){let r=1,s=1,o=0,i=0;if(t<Ae){const a=e,c=a+t,l=Math.cos(a),u=Math.sin(a),d=Math.cos(c),f=Math.sin(c),h=(_,w,S)=>ui(_,a,c,!0)?1:Math.max(w,w*n,S,S*n),p=(_,w,S)=>ui(_,a,c,!0)?-1:Math.min(w,w*n,S,S*n),m=h(0,l,d),y=h(He,u,f),b=p(we,l,d),x=p(we+He,u,f);r=(m-b)/2,s=(y-x)/2,o=-(m+b)/2,i=-(y+x)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class Dh extends Pr{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,l)=>{const d=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||d.borderRadius),index:l}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(xe(r[t])){const{key:c="value"}=this._parsing;o=l=>+br(r[l],c)}let i,a;for(i=t,a=t+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return fn(this.options.rotation-90)}_getCircumference(){return fn(this.options.circumference)}_getRotationExtents(){let t=Ae,n=-Ae;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+i)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(aB(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=XU(d,u,c),y=(r.width-i)/f,b=(r.height-i)/h,x=Math.max(Math.min(y,b)/2,0),_=B0(this.options.radius,x),w=Math.max(_*c,0),S=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Ae)}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,l=i.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&l.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+r;++x){const _=this._circumference(x,o),w=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:h};y&&(S.options=m||this.resolveDataElementOptions(x,w.active?"active":s)),b+=_,this.updateElement(w,x,S,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ae*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,o,i,a,c;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),t=i.data,a=i.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class gS extends Pr{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:s=[],_dataset:o}=n,i=this.chart._animationsDisabled;let{start:a,count:c}=Y0(n,s,i);this._drawStart=a,this._drawCount=c,X0(n)&&(a=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=i.axis,h=a.axis,{spanGaps:p,segment:m}=this.options,y=Ys(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+r,_=t.length;let w=n>0&&this.getParsed(n-1);for(let S=0;S<_;++S){const C=t[S],k=b?C:{};if(S<n||S>=x){k.skip=!0;continue}const E=this.getParsed(S),P=ye(E[h]),O=k[f]=i.getPixelForValue(E[f],S),N=k[h]=o||P?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,E,c):E[h],S);k.skip=isNaN(O)||isNaN(N)||P,k.stop=S>0&&Math.abs(E[f]-w[f])>y,m&&(k.parsed=E,k.raw=l.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":s)),b||this.updateElement(C,S,k,s),w=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return r;const o=s[0].size(this.resolveDataElementOptions(0)),i=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class yS extends Pr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:s}}=t.legend.options;return n.labels.map((o,i)=>{const c=t.getDatasetMeta(0).controller.getStyle(i);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t].r,r.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,r,s){return oS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),i=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-i)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,c=i.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,d=l.yCenter,f=l.getIndexAngle(0)-.5*we;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,s,m);for(p=n;p<n+r;p++){const y=t[p];let b=h,x=h+this._computeAngle(p,s,m),_=i.getDataVisibility(p)?l.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=x,o&&(c.animateScale&&(_=0),c.animateRotate&&(b=x=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,w,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?fn(this.resolveDataElementOptions(t,n).angle||r):0}}class JU extends Dh{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class QU extends Pr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,s){return oS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,t!=="resize"){const i=this.resolveDatasetElementOptions(t);this.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:i};this.updateElement(r,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,r,s){const o=this._cachedMeta.rScale,i=s==="reset";for(let a=n;a<n+r;a++){const c=t[a],l=this.resolveDataElementOptions(a,c.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=i?o.xCenter:u.x,f=i?o.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:l};this.updateElement(c,a,h,s)}}}class e5 extends Pr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y);return{label:r[t]||"",value:"("+a+", "+c+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:i}=Y0(n,r,s);if(this._drawStart=o,this._drawCount=i,X0(n)&&(o=0,i=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=r;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,i,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),h=i.axis,p=a.axis,{spanGaps:m,segment:y}=this.options,b=Ys(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let _=n>0&&this.getParsed(n-1);for(let w=n;w<n+r;++w){const S=t[w],C=this.getParsed(w),k=x?S:{},E=ye(C[p]),P=k[h]=i.getPixelForValue(C[h],w),O=k[p]=o||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[p],w);k.skip=isNaN(P)||isNaN(O)||E,k.stop=w>0&&Math.abs(C[h]-_[h])>b,y&&(k.parsed=C,k.raw=l.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,S.active?"active":s)),x||this.updateElement(S,w,k,s),_=C}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const r=t.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),i=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,i)/2}}var t5=Object.freeze({__proto__:null,BarController:GU,BubbleController:YU,DoughnutController:Dh,LineController:gS,PieController:JU,PolarAreaController:yS,RadarController:QU,ScatterController:e5});function Nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ih{static override(t){Object.assign(Ih.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Nr()}parse(){return Nr()}format(){return Nr()}add(){return Nr()}diff(){return Nr()}startOf(){return Nr()}endOf(){return Nr()}}var n5={_date:Ih};function r5(e,t,n,r){const{controller:s,data:o,_sorted:i}=e,a=s._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&i&&o.length){const l=a._reversePixels?xB:Un;if(r){if(s._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=l(o,t,n-d),h=l(o,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=l(o,t,n);if(c){const{vScale:d}=s._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!ye(m[d.axis]));u.lo-=Math.max(0,h);const p=f.slice(u.hi).findIndex(m=>!ye(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Ol(e,t,n,r,s){const o=e.getSortedVisibleDatasetMetas(),i=n[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:d,hi:f}=r5(o[a],t,i,s);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,l,h)}}}function s5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const o=t?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function Mu(e,t,n,r,s){const o=[];return!s&&!e.isPointInArea(t)||Ol(e,n,t,function(a,c,l){!s&&!Wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function o5(e,t,n,r){let s=[];function o(i,a,c){const{startAngle:l,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:d}=H0(i,{x:t.x,y:t.y});ui(d,l,u)&&s.push({element:i,datasetIndex:a,index:c})}return Ol(e,n,t,o),s}function i5(e,t,n,r,s,o){let i=[];const a=s5(n);let c=Number.POSITIVE_INFINITY;function l(u,d,f){const h=u.inRange(t.x,t.y,s);if(r&&!h)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!h)return;const y=a(t,p);y<c?(i=[{element:u,datasetIndex:d,index:f}],c=y):y===c&&i.push({element:u,datasetIndex:d,index:f})}return Ol(e,n,t,l),i}function Au(e,t,n,r,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?o5(e,t,n,s):i5(e,t,n,r,s,o)}function gy(e,t,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return Ol(e,n,t,(c,l,u)=>{c[i]&&c[i](t[n],s)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(t.x,t.y,s))}),r&&!a?[]:o}var a5={modes:{index(e,t,n,r){const s=Ir(t,e),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i);if(a.length>0){const c=a[0].datasetIndex,l=e.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Mu(e,s,o,r,i)},nearest(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Au(e,s,o,n.intersect,r,i)},x(e,t,n,r){const s=Ir(t,e);return gy(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=Ir(t,e);return gy(e,s,"y",n.intersect,r)}}};const bS=["left","top","right","bottom"];function wo(e,t){return e.filter(n=>n.pos===t)}function yy(e,t){return e.filter(n=>bS.indexOf(n.pos)===-1&&n.box.axis===t)}function So(e,t){return e.sort((n,r)=>{const s=t?r:n,o=t?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function c5(e){const t=[];let n,r,s,o,i,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return t}function l5(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!bS.includes(s))continue;const i=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function u5(e,t){const n=l5(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let o,i,a;for(o=0,i=e.length;o<i;++o){a=e[o];const{fullSize:c}=a.box,l=n[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*r:c&&t.availableWidth,a.height=s):(a.width=r,a.height=u?u*s:c&&t.availableHeight)}return n}function d5(e){const t=c5(e),n=So(t.filter(l=>l.box.fullSize),!0),r=So(wo(t,"left"),!0),s=So(wo(t,"right")),o=So(wo(t,"top"),!0),i=So(wo(t,"bottom")),a=yy(t,"x"),c=yy(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(c).concat(i).concat(a),chartArea:wo(t,"chartArea"),vertical:r.concat(s).concat(c),horizontal:o.concat(i).concat(a)}}function by(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function vS(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function f5(e,t,n,r){const{pos:s,box:o}=n,i=e.maxPadding;if(!xe(s)){n.size&&(e[s]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&vS(i,o.getPadding());const a=Math.max(0,t.outerWidth-by(i,e,"left","right")),c=Math.max(0,t.outerHeight-by(i,e,"top","bottom")),l=a!==e.w,u=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function h5(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function p5(e,t){const n=t.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(t[i],n[i])}),o}return r(e?["left","right"]:["top","bottom"])}function Do(e,t,n,r){const s=[];let o,i,a,c,l,u;for(o=0,i=e.length,l=0;o<i;++o){a=e[o],c=a.box,c.update(a.width||t.w,a.height||t.h,p5(a.horizontal,t));const{same:d,other:f}=f5(t,n,a,r);l|=d&&s.length,u=u||f,c.fullSize||s.push(a)}return l&&Do(s,t,n,r)||u}function ga(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function vy(e,t,n,r){const s=n.padding;let{x:o,y:i}=t;for(const a of e){const c=a.box,l=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const d=t.w*u,f=l.size||c.height;li(l.start)&&(i=l.start),c.fullSize?ga(c,s.left,i,n.outerWidth-s.right-s.left,f):ga(c,t.left+l.placed,i,d,f),l.start=i,l.placed+=d,i=c.bottom}else{const d=t.h*u,f=l.size||c.width;li(l.start)&&(o=l.start),c.fullSize?ga(c,o,s.top,f,n.outerHeight-s.bottom-s.top):ga(c,o,t.top+l.placed,f,d),l.start=o,l.placed+=d,o=c.right}}t.x=o,t.y=i}var bt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=xt(e.options.layout.padding),o=Math.max(t-s.width,0),i=Math.max(n-s.height,0),a=d5(e.boxes),c=a.vertical,l=a.horizontal;Ce(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/u,hBoxMaxHeight:i/2}),f=Object.assign({},s);vS(f,xt(r));const h=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),p=u5(c.concat(l),d);Do(a.fullSize,h,d,p),Do(c,h,d,p),Do(l,h,d,p)&&Do(c,h,d,p),h5(h),vy(a.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,vy(a.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ce(a.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class xS{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class m5 extends xS{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Va="$chartjs",g5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xy=e=>e===null||e==="";function y5(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Va]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",xy(s)){const o=ry(e,"width");o!==void 0&&(e.width=o)}if(xy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ry(e,"height");o!==void 0&&(e.height=o)}return e}const _S=hU?{passive:!0}:!1;function b5(e,t,n){e&&e.addEventListener(t,n,_S)}function v5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,_S)}function x5(e,t){const n=g5[e.type]||e.type,{x:r,y:s}=Ir(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Tc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function _5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.addedNodes,r),i=i&&!Tc(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function w5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.removedNodes,r),i=i&&!Tc(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fi=new Map;let _y=0;function wS(){const e=window.devicePixelRatio;e!==_y&&(_y=e,fi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function S5(e,t){fi.size||window.addEventListener("resize",wS),fi.set(e,t)}function E5(e){fi.delete(e),fi.size||window.removeEventListener("resize",wS)}function k5(e,t,n){const r=e.canvas,s=r&&Nh(r);if(!s)return;const o=G0((a,c)=>{const l=s.clientWidth;n(a,c),l<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return i.observe(s),S5(e,o),i}function Nu(e,t,n){n&&n.disconnect(),t==="resize"&&E5(e)}function C5(e,t,n){const r=e.canvas,s=G0(o=>{e.ctx!==null&&n(x5(o,e))},e);return b5(r,t,s),s}class R5 extends xS{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(y5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Va])return!1;const r=n[Va].initial;["height","width"].forEach(o=>{const i=r[o];ye(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Va],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),i={attach:_5,detach:w5,resize:k5}[n]||C5;s[n]=i(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Nu,detach:Nu,resize:Nu}[n]||v5)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return fU(t,n,r,s)}isAttached(t){const n=t&&Nh(t);return!!(n&&n.isConnected)}}function P5(e){return!Ah()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?m5:R5}let Jn=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ys(this.x)&&Ys(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}};function O5(e,t){const n=e.options.ticks,r=T5(e),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?A5(t):[],i=o.length,a=o[0],c=o[i-1],l=[];if(i>s)return N5(t,l,o,i/s),l;const u=M5(o,t,s);if(i>0){let d,f;const h=i>1?Math.round((c-a)/(i-1)):null;for(ya(t,l,u,ye(h)?0:a-h,a),d=0,f=i-1;d<f;d++)ya(t,l,u,o[d],o[d+1]);return ya(t,l,u,c,ye(h)?t.length:c+h),l}return ya(t,l,u),l}function T5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function M5(e,t,n){const r=D5(e),s=t.length/n;if(!r)return Math.max(s,1);const o=mB(r);for(let i=0,a=o.length-1;i<a;i++){const c=o[i];if(c>s)return c}return Math.max(s,1)}function A5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function N5(e,t,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<e.length;i++)i===o&&(t.push(e[i]),s++,o=n[s*r])}function ya(e,t,n,r,s){const o=de(r,0),i=Math.min(de(s,e.length),e.length);let a=0,c,l,u;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(l=Math.max(o,0);l<i;l++)l===u&&(t.push(e[l]),a++,u=Math.round(o+a*n))}function D5(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const I5=e=>e==="left"?"right":e==="right"?"left":e,wy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Sy=(e,t)=>Math.min(t||e,e);function Ey(e,t){const n=[],r=e.length/t,s=e.length;let o=0;for(;o<s;o+=r)n.push(e[Math.floor(o)]);return n}function j5(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),o=e._startPixel,i=e._endPixel,a=1e-6;let c=e.getPixelForTick(s),l;if(!(n&&(r===1?l=Math.max(c-o,i-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>i+a)))return c}function L5(e,t){Ce(e,n=>{const r=n.gc,s=r.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Eo(e){return e.drawTicks?e.tickLength:0}function ky(e,t){if(!e.display)return 0;const n=rt(e.font,t),r=xt(e.padding);return(ze(e.text)?e.text.length:1)*n.lineHeight+r.height}function F5(e,t){return Rr(e,{scale:t,type:"scale"})}function z5(e,t,n){return Rr(e,{tick:n,index:t,type:"tick"})}function $5(e,t,n){let r=Ch(e);return(n&&t!=="right"||!n&&t==="right")&&(r=I5(r)),r}function V5(e,t,n,r){const{top:s,left:o,bottom:i,right:a,chart:c}=e,{chartArea:l,scales:u}=c;let d=0,f,h,p;const m=i-s,y=a-o;if(e.isHorizontal()){if(h=ht(r,o,a),xe(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+m-t}else n==="center"?p=(l.bottom+l.top)/2+m-t:p=wy(e,n,t);f=a-o}else{if(xe(n)){const b=Object.keys(n)[0],x=n[b];h=u[b].getPixelForValue(x)-y+t}else n==="center"?h=(l.left+l.right)/2-y+t:h=wy(e,n,t);p=ht(r,i,s),d=n==="left"?-He:He}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class hs extends Jn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Ft(t,Number.POSITIVE_INFINITY),n=Ft(n,Number.NEGATIVE_INFINITY),r=Ft(r,Number.POSITIVE_INFINITY),s=Ft(s,Number.NEGATIVE_INFINITY),{min:Ft(t,r),max:Ft(n,s),minDefined:We(t),maxDefined:We(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)i=a[c].controller.getMinMax(this,t),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Ft(n,Ft(r,n)),max:Ft(r,Ft(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Me(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=WB(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Ey(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=O5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Me(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Me(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r],o.label=Me(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Sy(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,c,l;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=at(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),c=this.maxHeight-Eo(t.grid)-n.padding-ky(t.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),i=Eh(Math.min(Math.asin(at((u.highest.height+6)/a,-1,1)),Math.asin(at(c/l,-1,1))-Math.asin(at(f/l,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const c=ky(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Eo(o)+c):(t.height=this.maxHeight,t.width=Eo(o)+c),r.display&&this.ticks.length){const{first:l,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=fn(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const b=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(l,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;c?l?(f=s*t.width,h=r*n.height):(f=r*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+i)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+i,this.paddingBottom=d+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Me(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ey(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],c=Math.floor(n/Sy(n,r));let l=0,u=0,d,f,h,p,m,y,b,x,_,w,S;for(d=0;d<n;d+=c){if(p=t[d].label,m=this._resolveTickFontOptions(d),s.font=y=m.string,b=o[y]=o[y]||{data:{},gc:[]},x=m.lineHeight,_=w=0,!ye(p)&&!ze(p))_=Pc(s,b.data,b.gc,_,p),w=x;else if(ze(p))for(f=0,h=p.length;f<h;++f)S=p[f],!ye(S)&&!ze(S)&&(_=Pc(s,b.data,b.gc,_,S),w+=x);i.push(_),a.push(w),l=Math.max(_,l),u=Math.max(w,u)}L5(o,n);const C=i.indexOf(l),k=a.indexOf(u),E=P=>({width:i[P]||0,height:a[P]||0});return{first:E(0),last:E(n-1),widest:E(C),highest:E(k),widths:i,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return vB(this._alignToPixels?Ar(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=z5(this.getContext(),t,r))}return this.$context||(this.$context=F5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=fn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=t.autoSkipPadding||0,a=o?o.widest.width+i:0,c=o?o.highest.height+i:0;return this.isHorizontal()?c*r>a*s?a/r:c/s:c*s<a*r?c/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=Eo(o),h=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,b=function(D){return Ar(r,D,m)};let x,_,w,S,C,k,E,P,O,N,A,j;if(i==="top")x=b(this.bottom),k=this.bottom-f,P=x-y,N=b(t.top)+y,j=t.bottom;else if(i==="bottom")x=b(this.top),N=t.top,j=b(t.bottom)-y,k=x+y,P=this.top+f;else if(i==="left")x=b(this.right),C=this.right-f,E=x-y,O=b(t.left)+y,A=t.right;else if(i==="right")x=b(this.left),O=t.left,A=b(t.right)-y,C=x+y,E=this.left+f;else if(n==="x"){if(i==="center")x=b((t.top+t.bottom)/2+.5);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}N=t.top,j=t.bottom,k=x+y,P=k+f}else if(n==="y"){if(i==="center")x=b((t.left+t.right)/2);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}C=x-y,E=C-f,O=t.left,A=t.right}const $=de(s.ticks.maxTicksLimit,d),q=Math.max(1,Math.ceil(d/$));for(_=0;_<d;_+=q){const D=this.getContext(_),H=o.setContext(D),F=a.setContext(D),W=H.lineWidth,se=H.color,I=F.dash||[],Y=F.dashOffset,K=H.tickWidth,Z=H.tickColor,oe=H.tickBorderDash||[],ce=H.tickBorderDashOffset;w=j5(this,_,c),w!==void 0&&(S=Ar(r,w,W),l?C=E=O=A=S:k=P=N=j=S,h.push({tx1:C,ty1:k,tx2:E,ty2:P,x1:O,y1:N,x2:A,y2:j,width:W,color:se,borderDash:I,borderDashOffset:Y,tickWidth:K,tickColor:Z,tickBorderDash:oe,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:d}=o,f=Eo(r.grid),h=f+u,p=d?-u:h,m=-fn(this.labelRotation),y=[];let b,x,_,w,S,C,k,E,P,O,N,A,j="middle";if(s==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(n==="x"){if(s==="center")C=(t.top+t.bottom)/2+h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];C=this.chart.scales[q].getPixelForValue(D)+h}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(t.left+t.right)/2-h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];S=this.chart.scales[q].getPixelForValue(D)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?j="top":c==="end"&&(j="bottom"));const $=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){_=a[b],w=_.label;const q=o.setContext(this.getContext(b));E=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,N=ze(w)?w.length:1;const D=N/2,H=q.color,F=q.textStrokeColor,W=q.textStrokeWidth;let se=k;i?(S=E,k==="inner"&&(b===x-1?se=this.options.reverse?"left":"right":b===0?se=this.options.reverse?"right":"left":se="center"),s==="top"?l==="near"||m!==0?A=-N*O+O/2:l==="center"?A=-$.highest.height/2-D*O+O:A=-$.highest.height+O/2:l==="near"||m!==0?A=O/2:l==="center"?A=$.highest.height/2-D*O:A=$.highest.height-N*O,d&&(A*=-1),m!==0&&!q.showLabelBackdrop&&(S+=O/2*Math.sin(m))):(C=E,A=(1-N)*O/2);let I;if(q.showLabelBackdrop){const Y=xt(q.backdropPadding),K=$.heights[b],Z=$.widths[b];let oe=A-Y.top,ce=0-Y.left;switch(j){case"middle":oe-=K/2;break;case"bottom":oe-=K;break}switch(k){case"center":ce-=Z/2;break;case"right":ce-=Z;break;case"inner":b===x-1?ce-=Z:b>0&&(ce-=Z/2);break}I={left:ce,top:oe,width:Z+Y.width,height:K+Y.height,color:q.backdropColor}}y.push({label:w,font:P,textOffset:A,options:{rotation:m,color:H,strokeColor:F,strokeWidth:W,textAlign:se,textBaseline:j,translation:[S,C],backdrop:I}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-fn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=t+o,c=i.widest.width;let l,u;return n==="left"?s?(u=this.right+o,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?s?(u=this.left+o,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,o,i),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,i;const a=(c,l,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(l.x,l.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const c=s[o];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,d,f;this.isHorizontal()?(l=Ar(t,this.left,i)-i/2,u=Ar(t,this.right,a)+a/2,d=f=c):(d=Ar(t,this.top,i)-i/2,f=Ar(t,this.bottom,a)+a/2,l=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(l,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Cl(r,s);const o=this.getLabelItems(t);for(const i of o){const a=i.options,c=i.font,l=i.label,u=i.textOffset;cs(r,l,0,u,c,a)}s&&Rl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=rt(r.font),i=xt(r.padding),a=r.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||xe(n)?(c+=i.bottom,ze(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:l,titleY:u,maxWidth:d,rotation:f}=V5(this,c,n,a);cs(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:$5(a,n,s),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),s=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return rt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ba{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;W5(n)&&(r=this.register(n));const s=this.items,o=t.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,B5(t,i,r),this.override&&$e.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in $e[s]&&(delete $e[s][r],this.override&&delete as[r])}}function B5(e,t,n){const r=ci(Object.create(null),[n?$e.get(n):{},$e.get(t),e.defaults]);$e.set(t,r),e.defaultRoutes&&U5(t,e.defaultRoutes),e.descriptors&&$e.describe(t,e.descriptors)}function U5(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),o=[e].concat(r).join("."),i=t[n].split("."),a=i.pop(),c=i.join(".");$e.route(o,s,c,a)})}function W5(e){return"id"in e&&"defaults"in e}class H5{constructor(){this.controllers=new ba(Pr,"datasets",!0),this.elements=new ba(Jn,"elements"),this.plugins=new ba(Object,"plugins"),this.scales=new ba(hs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Ce(s,i=>{const a=r||this._getRegistryForType(i);this._exec(t,a,i)})})}_exec(t,n,r){const s=Sh(t);Me(r["before"+s],[],r),n[t](r),Me(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var wn=new H5;class q5{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,n,r,s){s=s||{};for(const o of t){const i=o.plugin,a=i[r],c=[n,s,o.options];if(Me(a,c,i)===!1&&s.cancelable)return!1}return!0}invalidate(){ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=de(r.options&&r.options.plugins,{}),o=K5(r);return s===!1&&!n?[]:G5(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(c=>a.plugin.id===c.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function K5(e){const t={},n=[],r=Object.keys(wn.plugins.items);for(let o=0;o<r.length;o++)n.push(wn.getPlugin(r[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}function Z5(e,t){return!t&&e===!1?null:e===!0?{}:e}function G5(e,{plugins:t,localIds:n},r,s){const o=[],i=e.getContext();for(const a of t){const c=a.id,l=Z5(r[c],s);l!==null&&o.push({plugin:a,options:Y5(e.config,{plugin:a,local:n[c]},l,i)})}return o}function Y5(e,{plugin:t,local:n},r,s){const o=e.pluginScopeKeys(t),i=e.getOptionScopes(r,o);return n&&t.defaults&&i.push(t.defaults),e.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wd(e,t){const n=$e.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function X5(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function J5(e,t){return e===t?"_index_":"_value_"}function Cy(e){if(e==="x"||e==="y"||e==="r")return e}function Q5(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hd(e,...t){if(Cy(e))return e;for(const n of t){const r=n.axis||Q5(n.position)||e.length>1&&Cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ry(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function eW(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ry(e,"x",n[0])||Ry(e,"y",n[0])}return{}}function tW(e,t){const n=as[e.type]||{scales:{}},r=t.scales||{},s=Wd(e.type,t),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Hd(i,a,eW(i,e),$e.scales[a.type]),l=J5(c,s),u=n.scales||{};o[i]=Vo(Object.create(null),[{axis:c},a,u[c],u[l]])}),e.data.datasets.forEach(i=>{const a=i.type||e.type,c=i.indexAxis||Wd(a,t),u=(as[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=X5(d,c),h=i[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),Vo(o[h],[{axis:f},r[h],u[d]])})}),Object.keys(o).forEach(i=>{const a=o[i];Vo(a,[$e.scales[a.type],$e.scale])}),o}function SS(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=tW(e,t)}function ES(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function nW(e){return e=e||{},e.data=ES(e.data),SS(e),e}const Py=new Map,kS=new Set;function va(e,t){let n=Py.get(e);return n||(n=t(),Py.set(e,n),kS.add(n)),n}const ko=(e,t,n)=>{const r=br(t,n);r!==void 0&&e.add(r)};class rW{constructor(t){this._config=nW(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ES(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),SS(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return va(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return va(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return va(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return va(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:o}=this,i=this._cachedScopes(t,r),a=i.get(n);if(a)return a;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(d=>ko(c,t,d))),u.forEach(d=>ko(c,s,d)),u.forEach(d=>ko(c,as[o]||{},d)),u.forEach(d=>ko(c,$e,d)),u.forEach(d=>ko(c,Bd,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),kS.has(n)&&i.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,as[n]||{},$e.datasets[n]||{},{type:n},$e,Bd]}resolveNamedOptions(t,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=Oy(this._resolverCache,t,s);let c=i;if(oW(i,n)){o.$shared=!1,r=vr(r)?r():r;const l=this.createResolver(t,r,a);c=Xs(i,r,l)}for(const l of n)o[l]=c[l];return o}createResolver(t,n,r=[""],s){const{resolver:o}=Oy(this._resolverCache,t,r);return xe(n)?Xs(o,n,void 0,s):o}}function Oy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let o=r.get(s);return o||(o={resolver:Oh(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const sW=e=>xe(e)&&Object.getOwnPropertyNames(e).some(t=>vr(e[t]));function oW(e,t){const{isScriptable:n,isIndexable:r}=tS(e);for(const s of t){const o=n(s),i=r(s),a=(i||o)&&e[s];if(o&&(vr(a)||sW(a))||i&&ze(a))return!0}return!1}var iW="4.5.1";const aW=["top","bottom","left","right","chartArea"];function Ty(e,t){return e==="top"||e==="bottom"||aW.indexOf(e)===-1&&t==="x"}function My(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ay(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Me(n&&n.onComplete,[e],t)}function cW(e){const t=e.chart,n=t.options.animation;Me(n&&n.onProgress,[e],t)}function CS(e){return Ah()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ba={},Ny=e=>{const t=CS(e);return Object.values(Ba).filter(n=>n.canvas===t).pop()};function lW(e,t,n){const r=Object.keys(e);for(const s of r){const o=+s;if(o>=t){const i=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=i)}}}function uW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Ti=class{static defaults=$e;static instances=Ba;static overrides=as;static registry=wn;static version=iW;static getChart=Ny;static register(...t){wn.add(...t),Dy()}static unregister(...t){wn.remove(...t),Dy()}constructor(t,n){const r=this.config=new rW(n),s=CS(t),o=Ny(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||P5(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=iB(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new q5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=SB(d=>this.update(d),i.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ln.listen(this,"complete",Ay),Ln.listen(this,"progress",cW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return ye(t)?n&&o?o:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return wn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ny(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qg(this.canvas,this.ctx),this}stop(){return Ln.stop(this),this}resize(t,n){Ln.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,ny(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),Me(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ce(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],c=Hd(i,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Ce(o,i=>{const a=i.options,c=a.id,l=Hd(c,a),u=de(a.type,i.dtype);(a.position===void 0||Ty(a.position,l)!==Ty(i.dposition))&&(a.position=i.dposition),s[c]=!0;let d=null;if(c in r&&r[c].type===u)d=r[c];else{const f=wn.getScale(u);d=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ce(s,(i,a)=>{i||delete r[a]}),Ce(r,i=>{bt.configure(this,i,i.options),bt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(My("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||Wd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=wn.getController(a),{datasetElementType:l,dataElementType:u}=$e.datasets[a];Object.assign(c,{dataElementType:wn.getElement(u),datasetElementType:l&&wn.getElement(l)}),i.controller=new c(this,r),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Ce(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:d}=this.getDatasetMeta(l),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),i=Math.max(+d.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||Ce(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(My("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ce(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;lW(t,s,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Wg(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ce(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ln.has(this)?this.attached&&!Ln.running(this)&&Ln.start(this):(this.draw(),Ay({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=fS(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Cl(n,s),t.controller.draw(),s&&Rl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const o=a5.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=Rr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(t),i=o.controller._resolveAnimations(void 0,s);li(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ln.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),t[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};Ce(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){Ce(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ce(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let o,i,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){i=t[a];const l=i&&this.getDatasetMeta(i.datasetIndex).controller;l&&l[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!kc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),i=o(n,t),a=r?t:o(t,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(t,s,r,i),c=fB(t),l=uW(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Me(o.onHover,[t,a,this],this),c&&Me(o.onClick,[t,a,this],this));const u=!kc(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=l,u}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Dy(){return Ce(Ti.instances,e=>e._plugins.invalidate())}function dW(e,t,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/i,mt(r-n));if(e.beginPath(),e.arc(s,o,i-l/2,r+d/2,n-d/2),a>0){const f=Math.min(l/a,mt(r-n));e.arc(s,o,a+l/2,n-f/2,r+f/2,!0)}else{const f=Math.min(l/2,i*mt(r-n));if(u==="round")e.arc(s,o,f,n-we/2,r+we/2,!0);else if(u==="bevel"){const h=2*f*f,p=-h*Math.cos(n+we/2)+s,m=-h*Math.sin(n+we/2)+o,y=h*Math.cos(r+we/2)+s,b=h*Math.sin(r+we/2)+o;e.lineTo(p,m),e.lineTo(y,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function fW(e,t,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:c}=t;let l=s/a;e.beginPath(),e.arc(o,i,a,r-l,n+l),c>s?(l=s/c,e.arc(o,i,c,n+l,r-l,!0)):e.arc(o,i,s,n+He,r-He),e.closePath(),e.clip()}function hW(e){return Ph(e,["outerStart","outerEnd","innerStart","innerEnd"])}function pW(e,t,n,r){const s=hW(e.options.borderRadius),o=(n-t)/2,i=Math.min(o,r*t/2),a=c=>{const l=(n-Math.min(o,c))*r/2;return at(c,0,Math.min(o,l))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:at(s.innerStart,0,i),innerEnd:at(s.innerEnd,0,i)}}function ws(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Mc(e,t,n,r,s,o){const{x:i,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0;let h=0;const p=s-c;if(r){const q=u>0?u-r:0,D=d>0?d-r:0,H=(q+D)/2,F=H!==0?p*H/(H+r):p;h=(p-F)/2}const m=Math.max(.001,p*d-n/we)/d,y=(p-m)/2,b=c+y+h,x=s-y-h,{outerStart:_,outerEnd:w,innerStart:S,innerEnd:C}=pW(t,f,d,x-b),k=d-_,E=d-w,P=b+_/k,O=x-w/E,N=f+S,A=f+C,j=b+S/N,$=x-C/A;if(e.beginPath(),o){const q=(P+O)/2;if(e.arc(i,a,d,P,q),e.arc(i,a,d,q,O),w>0){const W=ws(E,O,i,a);e.arc(W.x,W.y,w,O,x+He)}const D=ws(A,x,i,a);if(e.lineTo(D.x,D.y),C>0){const W=ws(A,$,i,a);e.arc(W.x,W.y,C,x+He,$+Math.PI)}const H=(x-C/f+(b+S/f))/2;if(e.arc(i,a,f,x-C/f,H,!0),e.arc(i,a,f,H,b+S/f,!0),S>0){const W=ws(N,j,i,a);e.arc(W.x,W.y,S,j+Math.PI,b-He)}const F=ws(k,b,i,a);if(e.lineTo(F.x,F.y),_>0){const W=ws(k,P,i,a);e.arc(W.x,W.y,_,b-He,P)}}else{e.moveTo(i,a);const q=Math.cos(P)*d+i,D=Math.sin(P)*d+a;e.lineTo(q,D);const H=Math.cos(O)*d+i,F=Math.sin(O)*d+a;e.lineTo(H,F)}e.closePath()}function mW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=t;let c=t.endAngle;if(o){Mc(e,t,n,r,c,s);for(let l=0;l<o;++l)e.fill();isNaN(a)||(c=i+(a%Ae||Ae))}return Mc(e,t,n,r,c,s),e.fill(),c}function gW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:h}=c,p=c.borderAlign==="inner";if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,p?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Mc(e,t,n,r,m,s);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(m=i+(a%Ae||Ae))}p&&fW(e,t,m),c.selfJoin&&m-i>=we&&h===0&&u!=="miter"&&dW(e,t,m),o||(Mc(e,t,n,r,m,s),e.stroke())}class yW extends Jn{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.getProps(["x","y"],r),{angle:o,distance:i}=H0(s,{x:t,y:n}),{startAngle:a,endAngle:c,innerRadius:l,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,h=de(d,c-a),p=ui(o,a,c)&&a!==c,m=h>=Ae||p,y=Bn(i,l+f,u+f);return m&&y}getCenterPoint(t){const{x:n,y:r,startAngle:s,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:l}=this.options,u=(s+o)/2,d=(i+a+l+c)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,i=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Ae?Math.floor(r/Ae):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const c=1-Math.sin(Math.min(we,r||0)),l=s*c;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,mW(t,this,l,o,i),gW(t,this,l,o,i),t.restore()}}function RS(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function bW(e,t,n){e.lineTo(n.x,n.y)}function vW(e){return e.stepped?IB:e.tension||e.cubicInterpolationMode==="monotone"?jB:bW}function PS(e,t,n={}){const r=e.length,{start:s=0,end:o=r-1}=n,{start:i,end:a}=t,c=Math.max(s,i),l=Math.min(o,a),u=s<i&&o<i||s>a&&o>a;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function xW(e,t,n,r){const{points:s,options:o}=t,{count:i,start:a,loop:c,ilen:l}=PS(s,n,r),u=vW(o);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=l;++h)p=s[(a+(f?l-h:h))%i],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,o.stepped),m=p);return c&&(p=s[(a+(f?l:0))%i],u(e,m,p,f,o.stepped)),!!c}function _W(e,t,n,r){const s=t.points,{count:o,start:i,ilen:a}=PS(s,n,r),{move:c=!0,reverse:l}=r||{};let u=0,d=0,f,h,p,m,y,b;const x=w=>(i+(l?a-w:w))%o,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,b))};for(c&&(h=s[x(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=s[x(f)],h.skip)continue;const w=h.x,S=h.y,C=w|0;C===p?(S<m?m=S:S>y&&(y=S),u=(d*u+w)/++d):(_(),e.lineTo(w,S),p=C,d=0,m=y=S),b=S}_()}function qd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?_W:xW}function wW(e){return e.stepped?pU:e.tension||e.cubicInterpolationMode==="monotone"?mU:jr}function SW(e,t,n,r){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,r)&&s.closePath()),RS(e,t.options),e.stroke(s)}function EW(e,t,n,r){const{segments:s,options:o}=t,i=qd(t);for(const a of s)RS(e,o,a.style),e.beginPath(),i(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const kW=typeof Path2D=="function";function CW(e,t,n,r){kW&&!t.options.segment?SW(e,t,n,r):EW(e,t,n,r)}class Mi extends Jn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const s=r.spanGaps?this._loop:this._fullLoop;iU(this._points,r,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_U(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,s=t[n],o=this.points,i=dS(this,{property:n,start:s,end:s});if(!i.length)return;const a=[],c=wW(r);let l,u;for(l=0,u=i.length;l<u;++l){const{start:d,end:f}=i[l],h=o[d],p=o[f];if(h===p){a.push(h);continue}const m=Math.abs((s-h[n])/(p[n]-h[n])),y=c(h,p,m,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return qd(this)(t,this,n,r)}path(t,n,r){const s=this.segments,o=qd(this);let i=this._loop;n=n||0,r=r||this.points.length-n;for(const a of s)i&=o(t,this,a,{start:n,end:n+r-1});return!!i}draw(t,n,r,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),CW(t,this,r,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Iy(e,t,n,r){const s=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<s.radius+s.hitRadius}class OS extends Jn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.options,{x:o,y:i}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-i,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Iy(this,t,"x",n)}inYRange(t,n){return Iy(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!Wn(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,Ud(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function TS(e,t){const{x:n,y:r,base:s,width:o,height:i}=e.getProps(["x","y","base","width","height"],t);let a,c,l,u,d;return e.horizontal?(d=i/2,a=Math.min(n,s),c=Math.max(n,s),l=r-d,u=r+d):(d=o/2,a=n-d,c=n+d,l=Math.min(r,s),u=Math.max(r,s)),{left:a,top:l,right:c,bottom:u}}function lr(e,t,n,r){return e?0:at(t,n,r)}function RW(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,o=eS(r);return{t:lr(s.top,o.top,0,n),r:lr(s.right,o.right,0,t),b:lr(s.bottom,o.bottom,0,n),l:lr(s.left,o.left,0,t)}}function PW(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Zr(s),i=Math.min(t,n),a=e.borderSkipped,c=r||xe(s);return{topLeft:lr(!c||a.top||a.left,o.topLeft,0,i),topRight:lr(!c||a.top||a.right,o.topRight,0,i),bottomLeft:lr(!c||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:lr(!c||a.bottom||a.right,o.bottomRight,0,i)}}function OW(e){const t=TS(e),n=t.right-t.left,r=t.bottom-t.top,s=RW(e,n/2,r/2),o=PW(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Du(e,t,n,r){const s=t===null,o=n===null,a=e&&!(s&&o)&&TS(e,r);return a&&(s||Bn(t,a.left,a.right))&&(o||Bn(n,a.top,a.bottom))}function TW(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function MW(e,t){e.rect(t.x,t.y,t.w,t.h)}function Iu(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+o,h:e.h+i,radius:e.radius}}class AW extends Jn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=OW(this),a=TW(i.radius)?di:MW;t.save(),(i.w!==o.w||i.h!==o.h)&&(t.beginPath(),a(t,Iu(i,n,o)),t.clip(),a(t,Iu(o,-n,i)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Iu(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Du(this,t,n,r)}inXRange(t,n){return Du(this,t,null,n)}inYRange(t,n){return Du(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var NW=Object.freeze({__proto__:null,ArcElement:yW,BarElement:AW,LineElement:Mi,PointElement:OS});const Kd=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],jy=Kd.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function MS(e){return Kd[e%Kd.length]}function AS(e){return jy[e%jy.length]}function DW(e,t){return e.borderColor=MS(t),e.backgroundColor=AS(t),++t}function IW(e,t){return e.backgroundColor=e.data.map(()=>MS(t++)),t}function jW(e,t){return e.backgroundColor=e.data.map(()=>AS(t++)),t}function LW(e){let t=0;return(n,r)=>{const s=e.getDatasetMeta(r).controller;s instanceof Dh?t=IW(n,t):s instanceof yS?t=jW(n,t):s&&(t=DW(n,t))}}function Ly(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function FW(e){return e&&(e.borderColor||e.backgroundColor)}function zW(){return $e.borderColor!=="rgba(0,0,0,0.1)"||$e.backgroundColor!=="rgba(0,0,0,0.1)"}var $W={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:s}=e.config,{elements:o}=s,i=Ly(r)||FW(s)||o&&Ly(o)||zW();if(!n.forceOverride&&i)return;const a=LW(e);r.forEach(a)}};function VW(e,t,n,r,s){const o=s.samples||r;if(o>=n)return e.slice(t,t+n);const i=[],a=(n-2)/(o-2);let c=0;const l=t+n-1;let u=t,d,f,h,p,m;for(i[c++]=e[u],d=0;d<o-2;d++){let y=0,b=0,x;const _=Math.floor((d+1)*a)+1+t,w=Math.min(Math.floor((d+2)*a)+1,n)+t,S=w-_;for(x=_;x<w;x++)y+=e[x].x,b+=e[x].y;y/=S,b/=S;const C=Math.floor(d*a)+1+t,k=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:E,y:P}=e[u];for(h=p=-1,x=C;x<k;x++)p=.5*Math.abs((E-y)*(e[x].y-P)-(E-e[x].x)*(b-P)),p>h&&(h=p,f=e[x],m=x);i[c++]=f,u=m}return i[c++]=e[l],i}function BW(e,t,n,r){let s=0,o=0,i,a,c,l,u,d,f,h,p,m;const y=[],b=t+n-1,x=e[t].x,w=e[b].x-x;for(i=t;i<t+n;++i){a=e[i],c=(a.x-x)/w*r,l=a.y;const S=c|0;if(S===u)l<p?(p=l,d=i):l>m&&(m=l,f=i),s=(o*s+a.x)/++o;else{const C=i-1;if(!ye(d)&&!ye(f)){const k=Math.min(d,f),E=Math.max(d,f);k!==h&&k!==C&&y.push({...e[k],x:s}),E!==h&&E!==C&&y.push({...e[E],x:s})}i>0&&C!==h&&y.push(e[C]),y.push(a),u=S,o=0,p=m=l,d=f=h=i}}return y}function NS(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Fy(e){e.data.datasets.forEach(t=>{NS(t)})}function UW(e,t){const n=t.length;let r=0,s;const{iScale:o}=e,{min:i,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(r=at(Un(t,o.axis,i).lo,0,n-1)),l?s=at(Un(t,o.axis,a).hi+1,r,n)-r:s=n-r,{start:r,count:s}}var WW={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Fy(e);return}const r=e.width;e.data.datasets.forEach((s,o)=>{const{_data:i,indexAxis:a}=s,c=e.getDatasetMeta(o),l=i||s.data;if(No([a,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=UW(c,l);const h=n.threshold||4*r;if(f<=h){NS(s);return}ye(i)&&(s._data=l,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=VW(l,d,f,r,n);break;case"min-max":p=BW(l,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Fy(e)}};function HW(e,t,n){const r=e.segments,s=e.points,o=t.points,i=[];for(const a of r){let{start:c,end:l}=a;l=Tl(c,l,s);const u=Zd(n,s[c],s[l],a.loop);if(!t.segments){i.push({source:a,target:u,start:s[c],end:s[l]});continue}const d=dS(t,u);for(const f of d){const h=Zd(n,o[f.start],o[f.end],f.loop),p=uS(a,s,h);for(const m of p)i.push({source:m,target:f,start:{[n]:zy(u,h,"start",Math.max)},end:{[n]:zy(u,h,"end",Math.min)}})}}return i}function Zd(e,t,n,r){if(r)return;let s=t[e],o=n[e];return e==="angle"&&(s=mt(s),o=mt(o)),{property:e,start:s,end:o}}function qW(e,t){const{x:n=null,y:r=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:i,end:a})=>{a=Tl(i,a,s);const c=s[i],l=s[a];r!==null?(o.push({x:c.x,y:r}),o.push({x:l.x,y:r})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:l.y}))}),o}function Tl(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function DS(e,t){let n=[],r=!1;return ze(e)?(r=!0,n=e):n=qW(e,t),n.length?new Mi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function $y(e){return e&&e.fill!==!1}function KW(e,t,n){let s=e[t].fill;const o=[t];let i;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!We(s))return s;if(i=e[s],!i)return!1;if(i.visible)return s;o.push(s),s=i.fill}return!1}function ZW(e,t,n){const r=JW(e);if(xe(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return We(s)&&Math.floor(s)===s?GW(r[0],t,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function GW(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function YW(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:xe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function XW(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:xe(e)?r=e.value:r=t.getBaseValue(),r}function JW(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function QW(e){const{scale:t,index:n,line:r}=e,s=[],o=r.segments,i=r.points,a=e4(t,n);a.push(DS({x:null,y:t.bottom},r));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)t4(s,i[u],a)}return new Mi({points:s,options:{}})}function e4(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const o=r[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function t4(e,t,n){const r=[];for(let s=0;s<n.length;s++){const o=n[s],{first:i,last:a,point:c}=n4(o,t,"x");if(!(!c||i&&a)){if(i)r.unshift(c);else if(e.push(c),!a)break}}e.push(...r)}function n4(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const s=r[n],o=e.segments,i=e.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],d=i[u.start][n],f=i[u.end][n];if(Bn(s,d,f)){a=s===d,c=s===f;break}}return{first:a,last:c,point:r}}class IS{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:s,y:o,radius:i}=this;return n=n||{start:0,end:Ae},t.arc(s,o,i,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:r+Math.sin(o)*s,angle:o}}}function r4(e){const{chart:t,fill:n,line:r}=e;if(We(n))return s4(t,n);if(n==="stack")return QW(e);if(n==="shape")return!0;const s=o4(e);return s instanceof IS?s:DS(s,r)}function s4(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function o4(e){return(e.scale||{}).getPointPositionForValue?a4(e):i4(e)}function i4(e){const{scale:t={},fill:n}=e,r=YW(n,t);if(We(r)){const s=t.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function a4(e){const{scale:t,fill:n}=e,r=t.options,s=t.getLabels().length,o=r.reverse?t.max:t.min,i=XW(n,t,o),a=[];if(r.grid.circular){const c=t.getPointPositionForValue(0,o);return new IS({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<s;++c)a.push(t.getPointPositionForValue(c,i));return a}function ju(e,t,n){const r=r4(t),{chart:s,index:o,line:i,scale:a,axis:c}=t,l=i.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:h=d}=u||{},p=s.getDatasetMeta(o),m=fS(s,p);r&&i.points.length&&(Cl(e,n),c4(e,{line:i,target:r,above:f,below:h,area:n,scale:a,axis:c,clip:m}),Rl(e))}function c4(e,t){const{line:n,target:r,above:s,below:o,area:i,scale:a,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(l==="x"?(Vy(e,r,i.top),Lu(e,{line:n,target:r,color:s,scale:a,property:l,clip:c}),e.restore(),e.save(),Vy(e,r,i.bottom)):l==="y"&&(By(e,r,i.left),Lu(e,{line:n,target:r,color:o,scale:a,property:l,clip:c}),e.restore(),e.save(),By(e,r,i.right),u=s)),Lu(e,{line:n,target:r,color:u,scale:a,property:l,clip:c}),e.restore()}function Vy(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function By(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Lu(e,t){const{line:n,target:r,property:s,color:o,scale:i,clip:a}=t,c=HW(n,r,s);for(const{source:l,target:u,start:d,end:f}of c){const{style:{backgroundColor:h=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,l4(e,i,a,p&&Zd(s,d,f)),e.beginPath();const m=!!n.pathSegment(e,l);let y;if(p){m?e.closePath():Uy(e,r,f,s);const b=!!r.pathSegment(e,u,{move:m,reverse:!0});y=m&&b,y||Uy(e,r,d,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function l4(e,t,n,r){const s=t.chart.chartArea,{property:o,start:i,end:a}=r||{};if(o==="x"||o==="y"){let c,l,u,d;o==="x"?(c=i,l=s.top,u=a,d=s.bottom):(c=s.left,l=i,u=s.right,d=a),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),d=Math.min(d,n.bottom)),e.rect(c,l,u-c,d-l),e.clip()}}function Uy(e,t,n,r){const s=t.interpolate(n,r);s&&e.lineTo(s.x,s.y)}var jS={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,s=[];let o,i,a,c;for(i=0;i<r;++i)o=e.getDatasetMeta(i),a=o.dataset,c=null,a&&a.options&&a instanceof Mi&&(c={visible:e.isDatasetVisible(i),index:i,fill:ZW(a,i,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,s.push(c);for(i=0;i<r;++i)c=s[i],!(!c||c.fill===!1)&&(c.fill=KW(s,i,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let i=s.length-1;i>=0;--i){const a=s[i].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&ju(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;$y(o)&&ju(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!$y(r)||n.drawTime!=="beforeDatasetDraw"||ju(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},u4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Hy extends Jn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Me(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=rt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Wy(r,o);let l,u;n.font=s.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(i,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(i,s,a,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+o.measureText(p.text).width;(m===0||l[l.length-1]+y+2*a>i)&&(d+=u,l[l.length-(m>0?0:1)]=0,h+=u,f++),c[m]={left:0,top:h,row:f,width:y,height:s},l[l.length-1]+=y+a}),d}_fitCols(t,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=i-t;let d=a,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:_}=d4(r,n,o,y,s);b>0&&h+_+2*a>u&&(d+=f+a,l.push({width:f,height:h}),p+=f+a,m++,f=h=0),c[b]={left:p,top:h,col:m,width:x,height:_},f=Math.max(f,x),h+=_+a}),d+=f,l.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=Bs(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=ht(r,this.left+s,this.right-this.lineWidths[a]);for(const l of n)a!==l.row&&(a=l.row,c=ht(r,this.left+s,this.right-this.lineWidths[a])),l.top+=this.top+t+s,l.left=i.leftForLtr(i.x(c),l.width),c+=l.width+s}else{let a=0,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const l of n)l.col!==a&&(a=l.col,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+s,l.left=i.leftForLtr(i.x(l.left),l.width),c+=l.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Cl(t,this),this._draw(),Rl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=t,a=$e.color,c=Bs(t.rtl,this.left,this.width),l=rt(i.font),{padding:u}=i,d=l.size,f=d/2;let h;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=Wy(i,d),b=function(C,k,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=de(E.lineWidth,1);if(s.fillStyle=de(E.fillStyle,a),s.lineCap=de(E.lineCap,"butt"),s.lineDashOffset=de(E.lineDashOffset,0),s.lineJoin=de(E.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=de(E.strokeStyle,a),s.setLineDash(de(E.lineDash,[])),i.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:P},N=c.xPlus(C,p/2),A=k+f;Q0(s,O,N,A,i.pointStyleWidth&&p)}else{const O=k+Math.max((d-m)/2,0),N=c.leftForLtr(C,p),A=Zr(E.borderRadius);s.beginPath(),Object.values(A).some(j=>j!==0)?di(s,{x:N,y:O,w:p,h:m,radius:A}):s.rect(N,O,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},x=function(C,k,E){cs(s,E.text,C,k+y/2,l,{strikethrough:E.hidden,textAlign:c.textAlign(E.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?h={x:ht(o,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:ht(o,this.top+w+u,this.bottom-n[0].height),line:0},aS(this.ctx,t.textDirection);const S=y+u;this.legendItems.forEach((C,k)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const E=s.measureText(C.text).width,P=c.textAlign(C.textAlign||(C.textAlign=i.textAlign)),O=p+f+E;let N=h.x,A=h.y;c.setWidth(this.width),_?k>0&&N+O+u>this.right&&(A=h.y+=S,h.line++,N=h.x=ht(o,this.left+u,this.right-r[h.line])):k>0&&A+S>this.bottom&&(N=h.x=N+n[h.line].width+u,h.line++,A=h.y=ht(o,this.top+w+u,this.bottom-n[h.line].height));const j=c.x(N);if(b(j,A,C),N=EB(P,N+p+f,_?N+O:this.right,t.rtl),x(c.x(N),A,C),_)h.x+=O+u;else if(typeof C.text!="string"){const $=l.lineHeight;h.y+=LS(C,$)+u}else h.y+=S}),cS(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=rt(n.font),s=xt(n.padding);if(!n.display)return;const o=Bs(t.rtl,this.left,this.width),i=this.ctx,a=n.position,c=r.size/2,l=s.top+c;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,d=ht(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=l+ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=ht(a,d,d+f);i.textAlign=o.textAlign(Ch(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,cs(i,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=rt(t.font),r=xt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,o;if(Bn(t,this.left,this.right)&&Bn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Bn(t,s.left,s.left+s.width)&&Bn(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!p4(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=u4(s,r);s&&!o&&Me(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!o&&Me(n.onHover,[t,r,this],this)}else r&&Me(n.onClick,[t,r,this],this)}}function d4(e,t,n,r,s){const o=f4(r,e,t,n),i=h4(s,r,t.lineHeight);return{itemWidth:o,itemHeight:i}}function f4(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),t+n.size/2+r.measureText(s).width}function h4(e,t,n){let r=e;return typeof t.text!="string"&&(r=LS(t,n)),r}function LS(e,t){const n=e.text?e.text.length:0;return t*n}function p4(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FS={id:"legend",_element:Hy,start(e,t,n){const r=e.legend=new Hy({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r)},stop(e){bt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=xt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:i&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class jh extends Jn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ze(r.text)?r.text.length:1;this._padding=xt(r.padding);const o=s*rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let c=0,l,u,d;return this.isHorizontal()?(u=ht(a,r,o),d=n+t,l=o-r):(i.position==="left"?(u=r+t,d=ht(a,s,n),c=we*-.5):(u=o-t,d=ht(a,n,s),c=we*.5),l=s-n),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=rt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);cs(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:l,textAlign:Ch(n.align),textBaseline:"middle",translation:[i,a]})}}function m4(e,t){const n=new jh({ctx:e.ctx,options:t,chart:e});bt.configure(e,n,t),bt.addBox(e,n),e.titleBlock=n}var g4={id:"title",_element:jh,start(e,t,n){m4(e,n)},stop(e){const t=e.titleBlock;bt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const xa=new WeakMap;var y4={id:"subtitle",start(e,t,n){const r=new jh({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r),xa.set(e,r)},stop(e){bt.removeBox(e,xa.get(e)),xa.delete(e)},beforeUpdate(e,t,n){const r=xa.get(e);bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Io={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),s+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,c)=>a+c)/r.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=e.length;o<i;++o){const c=e[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=Vd(t,l);u<s&&(s=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function _n(e,t){return t&&(ze(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Fn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
103
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},N$="DialogDescriptionWarning",D$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b0(N$).contentName}}.`;return v.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},I$=o0,j$=c0,L$=l0,F$=u0,z$=f0,$$=p0,V$=g0;function v0({...e}){return g.jsx(I$,{"data-slot":"dialog",...e})}function B$({...e}){return g.jsx(j$,{"data-slot":"dialog-portal",...e})}function U$({className:e,...t}){return g.jsx(L$,{"data-slot":"dialog-overlay",className:Se("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 x0({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(B$,{"data-slot":"dialog-portal",children:[g.jsx(U$,{}),g.jsxs(F$,{"data-slot":"dialog-content",className:Se("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&&g.jsxs(V$,{"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:[g.jsx(a1,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col gap-2 text-center sm:text-start",e),...t})}function w0({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function S0({className:e,...t}){return g.jsx(z$,{"data-slot":"dialog-title",className:Se("text-lg leading-none font-semibold",e),...t})}function E0({className:e,...t}){return g.jsx($$,{"data-slot":"dialog-description",className:Se("text-muted-foreground text-sm",e),...t})}const W$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Nd({open:e,onOpenChange:t,monitor:n,onSubmit:r}){const s=!!n,[o,i]=v.useState(!1),a=Cf({resolver:vw(W$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}});v.useEffect(()=>{e&&(n?a.reset({name:n.name,type:n.type,intervalSeconds:n.intervalSeconds,timeoutMs:n.timeoutMs,url:n.url??"",host:n.host??"",port:n.port,method:n.method??"GET",keyword:n.keyword??"",jsonQuery:n.jsonQuery??"",expectedValue:n.expectedValue??"",dnsRecordType:n.dnsRecordType??""}):a.reset({name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}))},[e,n,a]);const c=a.watch("type"),l=async u=>{i(!0);try{await r(u),t(!1)}catch(d){console.error(d)}finally{i(!1)}};return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:s?"Edit Monitor":"New Monitor"}),g.jsx(E0,{children:s?"Update monitor configuration.":"Configure parameters for a new uptime monitor."})]}),g.jsx(t0,{...a,children:g.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"name",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"type",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(d=>g.jsx(Vs,{value:d,children:d.toUpperCase()},d))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"intervalSeconds",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"timeoutMs",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})})]}),(c==="http"||c==="keyword"||c==="json_query"||c==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"url",render:({field:u})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...u})}),g.jsx(Le,{})]})}),c!=="websocket"&&g.jsx(Ne,{control:a.control,name:"method",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),(c==="tcp"||c==="ping"||c==="dns"||c==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"host",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...u})}),g.jsx(Le,{})]})}),(c==="tcp"||c==="steam")&&g.jsx(Ne,{control:a.control,name:"port",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...u})}),g.jsx(Le,{})]})}),c==="dns"&&g.jsx(Ne,{control:a.control,name:"dnsRecordType",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:u.onChange,defaultValue:u.value,value:u.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(d=>g.jsx(Vs,{value:d,children:d},d))})]}),g.jsx(Le,{})]})})]}),c==="keyword"&&g.jsx(Ne,{control:a.control,name:"keyword",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...u})}),g.jsx(Le,{})]})}),c==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:a.control,name:"jsonQuery",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...u})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:a.control,name:"expectedValue",render:({field:u})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...u})}),g.jsx(Le,{})]})})]}),c==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs(w0,{children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),g.jsxs(gt,{type:"submit",disabled:o,children:[o&&g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Update":"Create"]})]})]})})]})})}function k0({open:e,onOpenChange:t,monitor:n,onConfirm:r}){const[s,o]=T.useState(!1);async function i(){o(!0);try{await r(),t(!1)}catch(a){console.error(a)}finally{o(!1)}}return g.jsx(v0,{open:e,onOpenChange:t,children:g.jsxs(x0,{className:"sm:max-w-md",children:[g.jsxs(_0,{children:[g.jsx(S0,{children:"Delete Monitor"}),g.jsxs(E0,{children:["Are you sure you want to delete ",g.jsx("span",{className:"font-semibold text-foreground",children:n?.name}),"? This action cannot be undone and will delete all historical data for this monitor."]})]}),g.jsxs(w0,{children:[g.jsx(gt,{variant:"outline",onClick:()=>t(!1),disabled:s,children:"Cancel"}),g.jsxs(gt,{variant:"destructive",onClick:i,disabled:s,children:[s?g.jsx(If,{className:"mr-2 h-4 w-4 animate-spin"}):g.jsx(jf,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})}function H$(){const e=Hv(),t=ls(),{data:n,loading:r}=qv(k=>k.monitors),[s,o]=v.useState(""),[i,a]=v.useState(!1),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(null);v.useEffect(()=>{e(Ur(60));const k=setInterval(()=>e(Ur(60)),3e4);return()=>clearInterval(k)},[e]);const p=v.useMemo(()=>{if(!s)return n;const k=s.toLowerCase();return n.filter(E=>E.monitor.name.toLowerCase().includes(k)||E.monitor.host?.toLowerCase().includes(k))},[n,s]),m=async k=>{try{await e(px(k)).unwrap(),Ee.success("Monitor created"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to create monitor"),E}},y=async k=>{if(f)try{await e(Df({id:f.id,data:k})).unwrap(),Ee.success("Monitor updated"),e(Ur(60))}catch(E){throw Ee.error(E||"Failed to update monitor"),E}},b=async()=>{if(f)try{await e(Nf(f.id)).unwrap(),Ee.success("Monitor deleted")}catch(k){throw Ee.error(k||"Failed to delete monitor"),k}},x=async k=>{try{await e(dc({id:k.id,paused:!k.isPaused})).unwrap(),Ee.success(k.isPaused?"Resumed":"Paused")}catch(E){Ee.error(E||"Failed to toggle pause")}},_=async k=>{Ee.info("Clone feature coming soon")},w=k=>{h(k),l(!0)},S=k=>{h(k),d(!0)},C=k=>{t({to:"/monitors/$id",params:{id:k.id}})};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Monitors"}),g.jsx("p",{className:"text-muted-foreground",children:"Manage your uptime monitors and status checks."})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("div",{className:"relative w-full md:w-auto",children:[g.jsx(Ex,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),g.jsx(nt,{placeholder:"Search monitors...",value:s,onChange:k=>o(k.target.value),className:"pl-8 w-full md:w-[250px]"})]}),g.jsxs(gt,{onClick:()=>{h(null),a(!0)},children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]})]}),r&&n.length===0?g.jsx("div",{className:"flex h-64 items-center justify-center",children:g.jsx(If,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center animate-in fade-in-50",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:g.jsx(KM,{className:"h-6 w-6 text-muted-foreground"})}),g.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No monitors found"}),g.jsx("p",{className:"mb-4 mt-2 text-sm text-muted-foreground",children:s?"Try adjusting your search terms.":"Get started by adding your first monitor."}),!s&&g.jsxs(gt,{onClick:()=>a(!0),children:[g.jsx(Mm,{className:"mr-2 h-4 w-4"})," Add Monitor"]})]}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:p.map(k=>g.jsx(HI,{summary:k,onEdit:w,onDelete:S,onPause:x,onClone:_,onDetails:C},k.monitor.id))}),g.jsx(Nd,{open:i,onOpenChange:a,onSubmit:m}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:f,onSubmit:y}),g.jsx(k0,{open:u,onOpenChange:d,monitor:f,onConfirm:b})]})}function Rs({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:Se("bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-6 shadow-sm",e),...t})}function Ps({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:Se("@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 Os({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:Se("leading-none font-semibold",e),...t})}function C0({className:e,...t}){return g.jsx("div",{"data-slot":"card-description",className:Se("text-muted-foreground text-sm",e),...t})}function Ts({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:Se("px-6",e),...t})}const q$=ww({name:pt().min(1,"Name is required"),type:lh(["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"]),intervalSeconds:js().min(1,"Interval must be at least 1s"),timeoutMs:js().min(100,"Timeout must be at least 100ms"),url:pt().optional(),host:pt().optional(),port:js().optional(),method:pt().optional(),keyword:pt().optional(),jsonQuery:pt().optional(),expectedValue:pt().optional(),dnsRecordType:pt().optional()});function Ng(){const e=ls(),n=pi({strict:!1})?.id,r=Cf({resolver:vw(q$),defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET",url:"",host:"",keyword:"",jsonQuery:"",expectedValue:""}}),{reset:s,watch:o,control:i}=r;v.useEffect(()=>{n&&(async()=>{try{const u=(await Te.get("/monitors")).data.monitors.find(d=>d.id===n);u&&s({...u,intervalSeconds:u.intervalSeconds,timeoutMs:u.timeoutMs})}catch{Ee.error("Failed to load monitor")}})()},[n,s]);const a=o("type"),c=async l=>{try{const u={...l};n?(await Te.put(`/monitors/${n}`,u),Ee.success("Monitor updated")):(await Te.post("/monitors",u),Ee.success("Monitor created")),e({to:"/"})}catch(u){Ee.error(u?.response?.data?.detail??"Save failed")}};return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",onClick:()=>e({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsx("h2",{className:"text-xl font-semibold",children:n?"Edit Monitor":"New Monitor"})]}),g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Monitor Configuration"}),g.jsx(C0,{children:"Configure the settings for your uptime monitor."})]}),g.jsx(Ts,{children:g.jsx(t0,{...r,children:g.jsxs("form",{onSubmit:r.handleSubmit(c),className:"space-y-6",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"name",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Name"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"My Website",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"type",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select type"})})}),g.jsx($s,{children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>g.jsx(Vs,{value:u,children:u.toUpperCase()},u))})]}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"intervalSeconds",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Interval (s)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"timeoutMs",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Timeout (ms)"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})})]}),(a==="http"||a==="keyword"||a==="json_query"||a==="websocket")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"url",render:({field:l})=>g.jsxs(De,{className:"sm:col-span-2",children:[g.jsx(Ie,{children:"URL"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"https://example.com",...l})}),g.jsx(Le,{})]})}),a!=="websocket"&&g.jsx(Ne,{control:i,name:"method",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Method"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select method"})})}),g.jsx($s,{children:["GET","POST","PUT","DELETE"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),(a==="tcp"||a==="ping"||a==="dns"||a==="steam")&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"host",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Host"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"example.com",...l})}),g.jsx(Le,{})]})}),(a==="tcp"||a==="steam")&&g.jsx(Ne,{control:i,name:"port",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Port"}),g.jsx(je,{children:g.jsx(nt,{type:"number",...l})}),g.jsx(Le,{})]})}),a==="dns"&&g.jsx(Ne,{control:i,name:"dnsRecordType",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Record Type"}),g.jsxs(Ls,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[g.jsx(je,{children:g.jsx(zs,{children:g.jsx(Fs,{placeholder:"Select Record Type"})})}),g.jsx($s,{children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>g.jsx(Vs,{value:u,children:u},u))})]}),g.jsx(Le,{})]})})]}),a==="keyword"&&g.jsx(Ne,{control:i,name:"keyword",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Keyword"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"Search string...",...l})}),g.jsx(Le,{})]})}),a==="json_query"&&g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Ne,{control:i,name:"jsonQuery",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"JSON Query (jq)"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"$.data.status",...l})}),g.jsx(Le,{})]})}),g.jsx(Ne,{control:i,name:"expectedValue",render:({field:l})=>g.jsxs(De,{children:[g.jsx(Ie,{children:"Expected Value"}),g.jsx(je,{children:g.jsx(nt,{placeholder:"healthy",...l})}),g.jsx(Le,{})]})})]}),a==="push"&&g.jsx("div",{className:"rounded-lg border bg-muted p-4 text-sm text-muted-foreground",children:"Push monitors generate a token on create. You will see the Push URL in the monitor details after saving."}),g.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[g.jsx(gt,{type:"button",variant:"outline",onClick:()=>e({to:"/"}),children:"Cancel"}),g.jsx(gt,{type:"submit",disabled:r.formState.isSubmitting,children:r.formState.isSubmitting?"Saving...":"Save Monitor"})]})]})})})]})]})}const Mn=Object.create(null);Mn.open="0";Mn.close="1";Mn.ping="2";Mn.pong="3";Mn.message="4";Mn.upgrade="5";Mn.noop="6";const La=Object.create(null);Object.keys(Mn).forEach(e=>{La[Mn[e]]=e});const Dd={type:"error",data:"parser error"},R0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",P0=typeof ArrayBuffer=="function",O0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,mh=({type:e,data:t},n,r)=>R0&&t instanceof Blob?n?r(t):Dg(t,r):P0&&(t instanceof ArrayBuffer||O0(t))?n?r(t):Dg(new Blob([t]),r):r(Mn[e]+(t||"")),Dg=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ig(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function K$(e,t){if(R0&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ig).then(t);if(P0&&(e.data instanceof ArrayBuffer||O0(e.data)))return t(Ig(e.data));mh(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jg.length;e++)Mo[jg.charCodeAt(e)]=e;const Z$=e=>{let t=e.length*.75,n=e.length,r,s=0,o,i,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)o=Mo[e.charCodeAt(r)],i=Mo[e.charCodeAt(r+1)],a=Mo[e.charCodeAt(r+2)],c=Mo[e.charCodeAt(r+3)],u[s++]=o<<2|i>>4,u[s++]=(i&15)<<4|a>>2,u[s++]=(a&3)<<6|c&63;return l},G$=typeof ArrayBuffer=="function",gh=(e,t)=>{if(typeof e!="string")return{type:"message",data:T0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Y$(e.substring(1),t)}:La[n]?e.length>1?{type:La[n],data:e.substring(1)}:{type:La[n]}:Dd},Y$=(e,t)=>{if(G$){const n=Z$(e);return T0(n,t)}else return{base64:!0,data:e}},T0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,M0="",X$=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,i)=>{mh(o,!1,a=>{r[i]=a,++s===n&&t(r.join(M0))})})},J$=(e,t)=>{const n=e.split(M0),r=[];for(let s=0;s<n.length;s++){const o=gh(n[s],t);if(r.push(o),o.type==="error")break}return r};function Q$(){return new TransformStream({transform(e,t){K$(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function ca(e){return e.reduce((t,n)=>t+n.length,0)}function la(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function eV(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(r===0){if(ca(n)<1)break;const c=la(n,1);o=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(ca(n)<2)break;const c=la(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(ca(n)<8)break;const c=la(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Dd);break}s=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(ca(n)<s)break;const c=la(n,s);a.enqueue(gh(o?c:wu.decode(c),t)),r=0}if(s===0||s>e){a.enqueue(Dd);break}}}})}const A0=4;function Xe(e){if(e)return tV(e)}function tV(e){for(var t in Xe.prototype)e[t]=Xe.prototype[t];return e}Xe.prototype.on=Xe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Xe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Xe.prototype.emitReserved=Xe.prototype.emit;Xe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Xe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nV="arraybuffer";function N0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const rV=Xt.setTimeout,sV=Xt.clearTimeout;function El(e,t){t.useNativeTimers?(e.setTimeoutFn=rV.bind(Xt),e.clearTimeoutFn=sV.bind(Xt)):(e.setTimeoutFn=Xt.setTimeout.bind(Xt),e.clearTimeoutFn=Xt.clearTimeout.bind(Xt))}const oV=1.33;function iV(e){return typeof e=="string"?aV(e):Math.ceil((e.byteLength||e.size)*oV)}function aV(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function D0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function lV(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class uV extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yh extends Xe{constructor(t){super(),this.writable=!1,El(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new uV(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=cV(t);return n.length?"?"+n:""}}class dV extends yh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};J$(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,X$(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=D0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let I0=!1;try{I0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const fV=I0;function hV(){}class pV extends dV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Cn extends Xe{constructor(t,n,r){super(),this.createRequest=t,El(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=N0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Cn.requestsCount++,Cn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Cn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Cn.requestsCount=0;Cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lg);else if(typeof addEventListener=="function"){const e="onpagehide"in Xt?"pagehide":"unload";addEventListener(e,Lg,!1)}}function Lg(){for(let e in Cn.requests)Cn.requests.hasOwnProperty(e)&&Cn.requests[e].abort()}const mV=(function(){const e=j0({xdomain:!1});return e&&e.responseType!==null})();class gV extends pV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=mV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Cn(j0,this.uri(),t)}}function j0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||fV))return new XMLHttpRequest}catch{}if(!t)try{return new Xt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const L0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yV extends yh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=L0?{}:N0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;mh(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=D0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Su=Xt.WebSocket||Xt.MozWebSocket;class bV extends yV{createSocket(t,n,r){return L0?new Su(t,n,r):n?new Su(t,n):new Su(t)}doWrite(t,n){this.ws.send(n)}}class vV extends yh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=eV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Q$();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),o())}).catch(a=>{})};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Sl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xV={websocket:bV,webtransport:vV,polling:gV},_V=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Id(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=_V.exec(e||""),o={},i=14;for(;i--;)o[wV[i]]=s[i]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=SV(o,o.path),o.queryKey=EV(o,o.query),o}function SV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function EV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const jd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Fa=[];jd&&addEventListener("offline",()=>{Fa.forEach(e=>e())},!1);class fr extends Xe{constructor(t,n){if(super(),this.binaryType=nV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Id(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Id(n.host).host);El(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=lV(this.opts.query)),jd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Fa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=A0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&fr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",fr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=iV(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Sl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(fr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Fa.indexOf(this._offlineEventListener);r!==-1&&Fa.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}fr.protocol=A0;class kV extends fr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;fr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;fr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const i=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){i("transport closed")}function c(){i("socket closed")}function l(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",i),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",s),n.once("error",i),n.once("close",a),this.once("close",c),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let CV=class extends kV{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>xV[s]).filter(s=>!!s)),super(t,r)}};function RV(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Id(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const PV=typeof ArrayBuffer=="function",OV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,F0=Object.prototype.toString,TV=typeof Blob=="function"||typeof Blob<"u"&&F0.call(Blob)==="[object BlobConstructor]",MV=typeof File=="function"||typeof File<"u"&&F0.call(File)==="[object FileConstructor]";function bh(e){return PV&&(e instanceof ArrayBuffer||OV(e))||TV&&e instanceof Blob||MV&&e instanceof File}function za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(za(e[n]))return!0;return!1}if(bh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&za(e[n]))return!0;return!1}function AV(e){const t=[],n=e.data,r=e;return r.data=Ld(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ld(e,t){if(!e)return e;if(bh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ld(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ld(e[r],t));return n}return e}function NV(e,t){return e.data=Fd(e.data,t),delete e.attachments,e}function Fd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fd(e[n],t));return e}const DV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class IV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&za(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=AV(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class vh extends Xe{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new jV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(bh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const i=t.substring(o,n);if(i!=Number(i)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(i)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const i=t.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(vh.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return Fg(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||Fg(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&DV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class jV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=NV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Fg(e){return Object.prototype.toString.call(e)==="[object Object]"}const LV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vh,Encoder:IV,get PacketType(){return _e}},Symbol.toStringTag,{value:"Module"}));function ln(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const FV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class z0 extends Xe{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ln(t,"open",this.onopen.bind(this)),ln(t,"packet",this.onpacket.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(FV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:_e.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),i.id=u}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),i=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};i.withError=!0,this.acks[t]=i}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(i,a)=>i?s(i):r(a);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:_e.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function io(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}io.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};io.prototype.reset=function(){this.attempts=0};io.prototype.setMin=function(e){this.ms=e};io.prototype.setMax=function(e){this.max=e};io.prototype.setJitter=function(e){this.jitter=e};class zd extends Xe{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,El(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new io({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||LV;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new CV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=ln(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},i=ln(n,"error",o);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(i),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ln(t,"ping",this.onping.bind(this)),ln(t,"data",this.ondata.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this)),ln(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Sl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new z0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const xo={};function $a(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=RV(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=xo[s]&&o in xo[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||i;let c;return a?c=new zd(r,t):(xo[s]||(xo[s]=new zd(r,t)),c=xo[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign($a,{Manager:zd,Socket:z0,io:$a,connect:$a});function Pi(e){return e+.5|0}const ir=(e,t,n)=>Math.max(Math.min(e,n),t);function Ao(e){return ir(Pi(e*2.55),0,255)}function hr(e){return ir(Pi(e*255),0,255)}function $n(e){return ir(Pi(e/2.55)/100,0,1)}function zg(e){return ir(Pi(e*100),0,100)}const Zt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$d=[..."0123456789ABCDEF"],zV=e=>$d[e&15],$V=e=>$d[(e&240)>>4]+$d[e&15],ua=e=>(e&240)>>4===(e&15),VV=e=>ua(e.r)&&ua(e.g)&&ua(e.b)&&ua(e.a);function BV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Zt[e[1]]*17,g:255&Zt[e[2]]*17,b:255&Zt[e[3]]*17,a:t===5?Zt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Zt[e[1]]<<4|Zt[e[2]],g:Zt[e[3]]<<4|Zt[e[4]],b:Zt[e[5]]<<4|Zt[e[6]],a:t===9?Zt[e[7]]<<4|Zt[e[8]]:255})),n}const UV=(e,t)=>e<255?t(e):"";function WV(e){var t=VV(e)?zV:$V;return e?"#"+t(e.r)+t(e.g)+t(e.b)+UV(e.a,t):void 0}const HV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $0(e,t,n){const r=t*Math.min(n,1-n),s=(o,i=(o+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function qV(e,t,n){const r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function KV(e,t,n){const r=$0(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function ZV(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function xh(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let c,l,u;return o!==i&&(u=o-i,l=a>.5?u/(2-o-i):u/(o+i),c=ZV(n,r,s,u,o),c=c*60+.5),[c|0,l||0,a]}function _h(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(hr)}function wh(e,t,n){return _h($0,e,t,n)}function GV(e,t,n){return _h(KV,e,t,n)}function YV(e,t,n){return _h(qV,e,t,n)}function V0(e){return(e%360+360)%360}function XV(e){const t=HV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ao(+t[5]):hr(+t[5]));const s=V0(+t[2]),o=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?r=GV(s,o,i):t[1]==="hsv"?r=YV(s,o,i):r=wh(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function JV(e,t){var n=xh(e);n[0]=V0(n[0]+t),n=wh(n),e.r=n[0],e.g=n[1],e.b=n[2]}function QV(e){if(!e)return;const t=xh(e),n=t[0],r=zg(t[1]),s=zg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${$n(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const $g={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vg={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function eB(){const e={},t=Object.keys(Vg),n=Object.keys($g);let r,s,o,i,a;for(r=0;r<t.length;r++){for(i=a=t[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,$g[o]);o=parseInt(Vg[i],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let da;function tB(e){da||(da=eB(),da.transparent=[0,0,0,0]);const t=da[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const nB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rB(e){const t=nB.exec(e);let n=255,r,s,o;if(t){if(t[7]!==r){const i=+t[7];n=t[8]?Ao(i):ir(i*255,0,255)}return r=+t[1],s=+t[3],o=+t[5],r=255&(t[2]?Ao(r):ir(r,0,255)),s=255&(t[4]?Ao(s):ir(s,0,255)),o=255&(t[6]?Ao(o):ir(o,0,255)),{r,g:s,b:o,a:n}}}function sB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_s=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function oB(e,t,n){const r=_s($n(e.r)),s=_s($n(e.g)),o=_s($n(e.b));return{r:hr(Eu(r+n*(_s($n(t.r))-r))),g:hr(Eu(s+n*(_s($n(t.g))-s))),b:hr(Eu(o+n*(_s($n(t.b))-o))),a:e.a+n*(t.a-e.a)}}function fa(e,t,n){if(e){let r=xh(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=wh(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function B0(e,t){return e&&Object.assign(t||{},e)}function Bg(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=hr(e[3]))):(t=B0(e,{r:0,g:0,b:0,a:1}),t.a=hr(t.a)),t}function iB(e){return e.charAt(0)==="r"?rB(e):XV(e)}class ai{constructor(t){if(t instanceof ai)return t;const n=typeof t;let r;n==="object"?r=Bg(t):n==="string"&&(r=BV(t)||tB(t)||iB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=B0(this._rgb);return t&&(t.a=$n(t.a)),t}set rgb(t){this._rgb=Bg(t)}rgbString(){return this._valid?sB(this._rgb):void 0}hexString(){return this._valid?WV(this._rgb):void 0}hslString(){return this._valid?QV(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let o;const i=n===o?.5:n,a=2*i-1,c=r.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,r.r=255&l*r.r+o*s.r+.5,r.g=255&l*r.g+o*s.g+.5,r.b=255&l*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=oB(this._rgb,t._rgb,n)),this}clone(){return new ai(this.rgb)}alpha(t){return this._rgb.a=hr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Pi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fa(this._rgb,2,t),this}darken(t){return fa(this._rgb,2,-t),this}saturate(t){return fa(this._rgb,1,t),this}desaturate(t){return fa(this._rgb,1,-t),this}rotate(t){return JV(this._rgb,t),this}}function In(){}const aB=(()=>{let e=0;return()=>e++})();function ye(e){return e==null}function ze(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function xe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function We(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ft(e,t){return We(e)?e:t}function de(e,t){return typeof e>"u"?t:e}const cB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,U0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Me(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ce(e,t,n,r){let s,o,i;if(ze(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(xe(e))for(i=Object.keys(e),o=i.length,s=0;s<o;s++)t.call(n,e[i[s]],i[s])}function kc(e,t){let n,r,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Cc(e){if(ze(e))return e.map(Cc);if(xe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=Cc(e[n[s]]);return t}return e}function W0(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function lB(e,t,n,r){if(!W0(e))return;const s=t[e],o=n[e];xe(s)&&xe(o)?ci(s,o,r):t[e]=Cc(o)}function ci(e,t,n){const r=ze(t)?t:[t],s=r.length;if(!xe(e))return e;n=n||{};const o=n.merger||lB;let i;for(let a=0;a<s;++a){if(i=r[a],!xe(i))continue;const c=Object.keys(i);for(let l=0,u=c.length;l<u;++l)o(c[l],e,i,n)}return e}function Vo(e,t){return ci(e,t,{merger:uB})}function uB(e,t,n){if(!W0(e))return;const r=t[e],s=n[e];xe(r)&&xe(s)?Vo(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Cc(s))}const Ug={"":e=>e,x:e=>e.x,y:e=>e.y};function dB(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function fB(e){const t=dB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function br(e,t){return(Ug[t]||(Ug[t]=fB(t)))(e)}function Sh(e){return e.charAt(0).toUpperCase()+e.slice(1)}const li=e=>typeof e<"u",vr=e=>typeof e=="function",Wg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const we=Math.PI,Ae=2*we,pB=Ae+we,Rc=Number.POSITIVE_INFINITY,mB=we/180,He=we/2,Mr=we/4,Hg=we*2/3,ar=Math.log10,Rn=Math.sign;function Bo(e,t,n){return Math.abs(e-t)<n}function qg(e){const t=Math.round(e);e=Bo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ar(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function gB(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function yB(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ys(e){return!yB(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function bB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function H0(e,t,n){let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function fn(e){return e*(we/180)}function Eh(e){return e*(180/we)}function Kg(e){if(!We(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function q0(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*we&&(o+=Ae),{angle:o,distance:s}}function Vd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function vB(e,t){return(e-t+pB)%Ae-we}function mt(e){return(e%Ae+Ae)%Ae}function ui(e,t,n,r){const s=mt(e),o=mt(t),i=mt(n),a=mt(o-s),c=mt(i-s),l=mt(s-o),u=mt(s-i);return s===o||s===i||r&&o===i||a>c&&l<u}function at(e,t,n){return Math.max(t,Math.min(n,e))}function xB(e){return at(e,-32768,32767)}function Bn(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function kh(e,t,n){n=n||(i=>e[i]<t);let r=e.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Un=(e,t,n,r)=>kh(e,n,r?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),_B=(e,t,n)=>kh(e,n,r=>e[r][t]>=n);function wB(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const K0=["push","pop","shift","splice","unshift"];function SB(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K0.forEach(n=>{const r="_onData"+Sh(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Zg(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(K0.forEach(o=>{delete e[o]}),delete e._chartjs)}function Z0(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const G0=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Y0(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,G0.call(window,()=>{r=!1,e.apply(t,n)}))}}function EB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ch=e=>e==="start"?"left":e==="end"?"right":"center",ht=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,kB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function X0(e,t,n){const r=t.length;let s=0,o=r;if(e._sorted){const{iScale:i,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:d,max:f,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(s=Math.min(Un(c,u,d).lo,n?r:Un(t,u,i.getPixelForValue(d)).lo),l){const m=c.slice(0,s+1).reverse().findIndex(y=>!ye(y[a.axis]));s-=Math.max(0,m)}s=at(s,0,r-1)}if(p){let m=Math.max(Un(c,i.axis,f,!0).hi+1,n?0:Un(t,u,i.getPixelForValue(f),!0).hi+1);if(l){const y=c.slice(m-1).findIndex(b=>!ye(b[a.axis]));m+=Math.max(0,y)}o=at(m,s,r)-s}else o=r-s}return{start:s,count:o}}function J0(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=s,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,s),o}const ha=e=>e===0||e===1,Gg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ae/n)),Yg=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ae/n)+1,Uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*He)+1,easeOutSine:e=>Math.sin(e*He),easeInOutSine:e=>-.5*(Math.cos(we*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ha(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ha(e)?e:Gg(e,.075,.3),easeOutElastic:e=>ha(e)?e:Yg(e,.075,.3),easeInOutElastic(e){return ha(e)?e:e<.5?.5*Gg(e*2,.1125,.45):.5+.5*Yg(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Uo.easeInBounce(e*2)*.5:Uo.easeOutBounce(e*2-1)*.5+.5};function Rh(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Xg(e){return Rh(e)?e:new ai(e)}function ku(e){return Rh(e)?e:new ai(e).saturate(.5).darken(.1).hexString()}const CB=["x","y","borderWidth","radius","tension"],RB=["color","borderColor","backgroundColor"];function PB(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:RB},numbers:{type:"number",properties:CB}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function OB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jg=new Map;function TB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Jg.get(n);return r||(r=new Intl.NumberFormat(e,t),Jg.set(n,r)),r}function Oi(e,t,n){return TB(t,n).format(e)}const Q0={values(e){return ze(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,o=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=MB(e,n)}const i=ar(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Oi(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ar(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Q0.numeric.call(this,e,t,n):""}};function MB(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var kl={formatters:Q0};function AB(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:kl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const as=Object.create(null),Bd=Object.create(null);function Wo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Cu(e,t,n){return typeof t=="string"?ci(Wo(e,t),n):ci(Wo(e,""),t)}class NB{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>ku(s.backgroundColor),this.hoverBorderColor=(r,s)=>ku(s.borderColor),this.hoverColor=(r,s)=>ku(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Cu(this,t,n)}get(t){return Wo(this,t)}describe(t,n){return Cu(Bd,t,n)}override(t,n){return Cu(as,t,n)}route(t,n,r,s){const o=Wo(this,t),i=Wo(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],l=i[s];return xe(c)?Object.assign({},l,c):de(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var $e=new NB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[PB,OB,AB]);function DB(e){return!e||ye(e.size)||ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Pc(e,t,n,r,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>r&&(r=o),r}function IB(e,t,n,r){r=r||{};let s=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(s=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const a=n.length;let c,l,u,d,f;for(c=0;c<a;c++)if(d=n[c],d!=null&&!ze(d))i=Pc(e,s,o,i,d);else if(ze(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!ze(f)&&(i=Pc(e,s,o,i,f));e.restore();const h=o.length/2;if(h>n.length){for(c=0;c<h;c++)delete s[o[c]];o.splice(0,h)}return i}function Ar(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function Qg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ud(e,t,n,r){eS(e,t,n,r,null)}function eS(e,t,n,r,s){let o,i,a,c,l,u,d,f;const h=t.pointStyle,p=t.rotation,m=t.radius;let y=(p||0)*mB;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,r,s/2,m,0,0,Ae):e.arc(n,r,m,0,Ae),e.closePath();break;case"triangle":u=s?s/2:m,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=Hg,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),e.closePath();break;case"rectRounded":l=m*.516,c=m-l,i=Math.cos(y+Mr)*c,d=Math.cos(y+Mr)*(s?s/2-l:c),a=Math.sin(y+Mr)*c,f=Math.sin(y+Mr)*(s?s/2-l:c),e.arc(n-d,r-a,l,y-we,y-He),e.arc(n+f,r-i,l,y-He,y),e.arc(n+d,r+a,l,y,y+He),e.arc(n-f,r+i,l,y+He,y+we),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*m,u=s?s/2:c,e.rect(n-u,r-c,2*u,2*c);break}y+=Mr;case"rectRot":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-i),e.lineTo(n+d,r+a),e.lineTo(n-f,r+i),e.closePath();break;case"crossRot":y+=Mr;case"cross":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"star":d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i),y+=Mr,d=Math.cos(y)*(s?s/2:m),i=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(s?s/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*m,a=Math.sin(y)*m,e.moveTo(n-i,r-a),e.lineTo(n+i,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(s?s/2:m),r+Math.sin(y)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Wn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Cl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Rl(e){e.restore()}function jB(e,t,n,r,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function LB(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function FB(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ye(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function zB(e,t,n,r,s){if(s.strikethrough||s.underline){const o=e.measureText(r),i=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(i,u),e.lineTo(a,u),e.stroke()}}function $B(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function cs(e,t,n,r,s,o={}){const i=ze(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(e.save(),e.font=s.string,FB(e,o),c=0;c<i.length;++c)l=i[c],o.backdrop&&$B(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),ye(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(l,n,r,o.maxWidth)),e.fillText(l,n,r,o.maxWidth),zB(e,n,r,l,o),r+=Number(s.lineHeight);e.restore()}function di(e,t){const{x:n,y:r,w:s,h:o,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*we,we,!0),e.lineTo(n,r+o-i.bottomLeft),e.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,we,He,!0),e.lineTo(n+s-i.bottomRight,r+o),e.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,He,0,!0),e.lineTo(n+s,r+i.topRight),e.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-He,!0),e.lineTo(n+i.topLeft,r)}const VB=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,BB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UB(e,t){const n=(""+e).match(VB);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const WB=e=>+e||0;function Ph(e,t){const n={},r=xe(t),s=r?Object.keys(t):t,o=xe(e)?r?i=>de(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of s)n[i]=WB(o(i));return n}function tS(e){return Ph(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Zr(e){return Ph(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(e){const t=tS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function rt(e,t){e=e||{},t=t||$e.font;let n=de(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=de(e.style,t.style);r&&!(""+r).match(BB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:de(e.family,t.family),lineHeight:UB(de(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:de(e.weight,t.weight),string:""};return s.string=DB(s),s}function No(e,t,n,r){let s,o,i;for(s=0,o=e.length;s<o;++s)if(i=e[s],i!==void 0&&i!==void 0)return i}function HB(e,t,n){const{min:r,max:s}=e,o=U0(t,(s-r)/2),i=(a,c)=>n&&a===0?0:a+c;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function Rr(e,t){return Object.assign(Object.create(e),t)}function Oh(e,t=[""],n,r,s=()=>e[0]){const o=n||e;typeof r>"u"&&(r=oS("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>Oh([a,...e],t,o,r)};return new Proxy(i,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return rS(a,c,()=>QB(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return ty(a).includes(c)},ownKeys(a){return ty(a)},set(a,c,l){const u=a._storage||(a._storage=s());return a[c]=u[c]=l,delete a._keys,!0}})}function Xs(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:nS(e,r),setContext:o=>Xs(e,o,n,r),override:o=>Xs(e.override(o),t,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete e[i],!0},get(o,i,a){return rS(o,i,()=>KB(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(o,i,a){return e[i]=a,delete o[i],!0}})}function nS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:vr(n)?n:()=>n,isIndexable:vr(r)?r:()=>r}}const qB=(e,t)=>e?e+Sh(t):t,Th=(e,t)=>xe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function rS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function KB(e,t,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=e;let a=r[t];return vr(a)&&i.isScriptable(t)&&(a=ZB(t,a,e,n)),ze(a)&&a.length&&(a=GB(t,a,e,i.isIndexable)),Th(t,a)&&(a=Xs(a,s,o&&o[t],i)),a}function ZB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,i||r);return a.delete(e),Th(e,c)&&(c=Mh(s._scopes,s,e,c)),c}function GB(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(xe(t[0])){const c=t,l=s._scopes.filter(u=>u!==c);t=[];for(const u of c){const d=Mh(l,s,e,u);t.push(Xs(d,o,i&&i[e],a))}}return t}function sS(e,t,n){return vr(e)?e(t,n):e}const YB=(e,t)=>e===!0?t:typeof e=="string"?br(t,e):void 0;function XB(e,t,n,r,s){for(const o of t){const i=YB(n,o);if(i){e.add(i);const a=sS(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function Mh(e,t,n,r){const s=t._rootScopes,o=sS(t._fallback,n,r),i=[...e,...s],a=new Set;a.add(r);let c=ey(a,i,n,o||n,r);return c===null||typeof o<"u"&&o!==n&&(c=ey(a,i,o,c,r),c===null)?!1:Oh(Array.from(a),[""],s,o,()=>JB(t,n,r))}function ey(e,t,n,r,s){for(;n;)n=XB(e,t,n,r,s);return n}function JB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return ze(s)&&xe(n)?n:s||{}}function QB(e,t,n,r){let s;for(const o of t)if(s=oS(qB(o,e),n),typeof s<"u")return Th(e,s)?Mh(n,r,e,s):s}function oS(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function ty(e){let t=e._keys;return t||(t=e._keys=eU(e._scopes)),t}function eU(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function iS(e,t,n,r){const{iScale:s}=e,{key:o="r"}=this._parsing,i=new Array(r);let a,c,l,u;for(a=0,c=r;a<c;++a)l=a+n,u=t[l],i[a]={r:s.parse(br(u,o),l)};return i}const tU=Number.EPSILON||1e-14,Js=(e,t)=>t<e.length&&!e[t].skip&&e[t],aS=e=>e==="x"?"y":"x";function nU(e,t,n,r){const s=e.skip?t:e,o=t,i=n.skip?t:n,a=Vd(o,s),c=Vd(i,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const d=r*l,f=r*u;return{previous:{x:o.x-d*(i.x-s.x),y:o.y-d*(i.y-s.y)},next:{x:o.x+f*(i.x-s.x),y:o.y+f*(i.y-s.y)}}}function rU(e,t,n){const r=e.length;let s,o,i,a,c,l=Js(e,0);for(let u=0;u<r-1;++u)if(c=l,l=Js(e,u+1),!(!c||!l)){if(Bo(t[u],0,tU)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(i=3/Math.sqrt(a),n[u]=s*i*t[u],n[u+1]=o*i*t[u])}}function sU(e,t,n="x"){const r=aS(n),s=e.length;let o,i,a,c=Js(e,0);for(let l=0;l<s;++l){if(i=a,a=c,c=Js(e,l+1),!a)continue;const u=a[n],d=a[r];i&&(o=(u-i[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[l]),c&&(o=(c[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[l])}}function oU(e,t="x"){const n=aS(t),r=e.length,s=Array(r).fill(0),o=Array(r);let i,a,c,l=Js(e,0);for(i=0;i<r;++i)if(a=c,c=l,l=Js(e,i+1),!!c){if(l){const u=l[t]-c[t];s[i]=u!==0?(l[n]-c[n])/u:0}o[i]=a?l?Rn(s[i-1])!==Rn(s[i])?0:(s[i-1]+s[i])/2:s[i-1]:s[i]}rU(e,s,o),sU(e,o,t)}function pa(e,t,n){return Math.max(Math.min(e,n),t)}function iU(e,t){let n,r,s,o,i,a=Wn(e[0],t);for(n=0,r=e.length;n<r;++n)i=o,o=a,a=n<r-1&&Wn(e[n+1],t),o&&(s=e[n],i&&(s.cp1x=pa(s.cp1x,t.left,t.right),s.cp1y=pa(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=pa(s.cp2x,t.left,t.right),s.cp2y=pa(s.cp2y,t.top,t.bottom)))}function aU(e,t,n,r,s){let o,i,a,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")oU(e,s);else{let l=r?e[e.length-1]:e[0];for(o=0,i=e.length;o<i;++o)a=e[o],c=nU(l,a,e[Math.min(o+1,i-(r?0:1))%i],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&iU(e,n)}function Ah(){return typeof window<"u"&&typeof document<"u"}function Nh(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Oc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Pl=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function cU(e,t){return Pl(e).getPropertyValue(t)}const lU=["top","right","bottom","left"];function Gr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=lU[s];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const uU=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function dU(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=r;let i=!1,a,c;if(uU(s,o,e.target))a=s,c=o;else{const l=t.getBoundingClientRect();a=r.clientX-l.left,c=r.clientY-l.top,i=!0}return{x:a,y:c,box:i}}function Ir(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Pl(n),o=s.boxSizing==="border-box",i=Gr(s,"padding"),a=Gr(s,"border","width"),{x:c,y:l,box:u}=dU(e,n),d=i.left+(u&&a.left),f=i.top+(u&&a.top);let{width:h,height:p}=t;return o&&(h-=i.width+a.width,p-=i.height+a.height),{x:Math.round((c-d)/h*n.width/r),y:Math.round((l-f)/p*n.height/r)}}function fU(e,t,n){let r,s;if(t===void 0||n===void 0){const o=e&&Nh(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const i=o.getBoundingClientRect(),a=Pl(o),c=Gr(a,"border","width"),l=Gr(a,"padding");t=i.width-l.width-c.width,n=i.height-l.height-c.height,r=Oc(a.maxWidth,o,"clientWidth"),s=Oc(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Rc,maxHeight:s||Rc}}const cr=e=>Math.round(e*10)/10;function hU(e,t,n,r){const s=Pl(e),o=Gr(s,"margin"),i=Oc(s.maxWidth,e,"clientWidth")||Rc,a=Oc(s.maxHeight,e,"clientHeight")||Rc,c=fU(e,t,n);let{width:l,height:u}=c;if(s.boxSizing==="content-box"){const f=Gr(s,"border","width"),h=Gr(s,"padding");l-=h.width+f.width,u-=h.height+f.height}return l=Math.max(0,l-o.width),u=Math.max(0,r?l/r:u-o.height),l=cr(Math.min(l,i,c.maxWidth)),u=cr(Math.min(u,a,c.maxHeight)),l&&!u&&(u=cr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=cr(Math.floor(u*r))),{width:l,height:u}}function ny(e,t,n){const r=t||1,s=cr(e.height*r),o=cr(e.width*r);e.height=cr(e.height),e.width=cr(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(e.currentDevicePixelRatio=r,i.height=s,i.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const pU=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Ah()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function ry(e,t){const n=cU(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function jr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function mU(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function gU(e,t,n,r){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},i=jr(e,s,n),a=jr(s,o,n),c=jr(o,t,n),l=jr(i,a,n),u=jr(a,c,n);return jr(l,u,n)}const yU=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},bU=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Bs(e,t,n){return e?yU(t,n):bU()}function cS(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function lS(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function uS(e){return e==="angle"?{between:ui,compare:vB,normalize:mt}:{between:Bn,compare:(t,n)=>t-n,normalize:t=>t}}function sy({start:e,end:t,count:n,loop:r,style:s}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:s}}function vU(e,t,n){const{property:r,start:s,end:o}=n,{between:i,normalize:a}=uS(r),c=t.length;let{start:l,end:u,loop:d}=e,f,h;if(d){for(l+=c,u+=c,f=0,h=c;f<h&&i(a(t[l%c][r]),s,o);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:e.style}}function dS(e,t,n){if(!n)return[e];const{property:r,start:s,end:o}=n,i=t.length,{compare:a,between:c,normalize:l}=uS(r),{start:u,end:d,loop:f,style:h}=vU(e,t,n),p=[];let m=!1,y=null,b,x,_;const w=()=>c(s,_,b)&&a(s,_)!==0,S=()=>a(o,b)===0||c(o,_,b),C=()=>m||w(),k=()=>!m||S();for(let E=u,P=u;E<=d;++E)x=t[E%i],!x.skip&&(b=l(x[r]),b!==_&&(m=c(b,s,o),y===null&&C()&&(y=a(b,s)===0?E:P),y!==null&&k()&&(p.push(sy({start:y,end:E,loop:f,count:i,style:h})),y=null),P=E,_=b));return y!==null&&p.push(sy({start:y,end:d,loop:f,count:i,style:h})),p}function fS(e,t){const n=[],r=e.segments;for(let s=0;s<r.length;s++){const o=dS(r[s],e.points,t);o.length&&n.push(...o)}return n}function xU(e,t,n,r){let s=0,o=t-1;if(n&&!r)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function _U(e,t,n,r){const s=e.length,o=[];let i=t,a=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%s];l.skip||l.stop?a.skip||(r=!1,o.push({start:t%s,end:(c-1)%s,loop:r}),t=i=l.stop?c:null):(i=c,a.skip&&(t=c)),a=l}return i!==null&&o.push({start:t%s,end:i%s,loop:r}),o}function wU(e,t){const n=e.points,r=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:i,end:a}=xU(n,s,o,r);if(r===!0)return oy(e,[{start:i,end:a,loop:o}],n,t);const c=a<i?a+s:a,l=!!e._fullLoop&&i===0&&a===s-1;return oy(e,_U(n,i,c,l),n,t)}function oy(e,t,n,r){return!r||!r.setContext||!n?t:SU(e,t,n,r)}function SU(e,t,n,r){const s=e._chart.getContext(),o=iy(e.options),{_datasetIndex:i,options:{spanGaps:a}}=e,c=n.length,l=[];let u=o,d=t[0].start,f=d;function h(p,m,y,b){const x=a?-1:1;if(p!==m){for(p+=c;n[p%c].skip;)p-=x;for(;n[m%c].skip;)m+=x;p%c!==m%c&&(l.push({start:p%c,end:m%c,loop:y,style:b}),u=b,d=m%c)}}for(const p of t){d=a?d:p.start;let m=n[d%c],y;for(f=d+1;f<=p.end;f++){const b=n[f%c];y=iy(r.setContext(Rr(s,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:i}))),EU(y,u)&&h(d,f-1,p.loop,u),m=b,u=y}d<f-1&&h(d,f-1,p.loop,u)}return l}function iy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function EU(e,t){if(!t)return!1;const n=[],r=function(s,o){return Rh(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ma(e,t,n){return e.options.clip?e[n]:t[n]}function kU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ma(n,t,"left"),right:ma(n,t,"right"),top:ma(r,t,"top"),bottom:ma(r,t,"bottom")}:t}function hS(e,t){const n=t._clip;if(n.disabled)return!1;const r=kU(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class CU{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=G0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,c;for(;i>=0;--i)c=o[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ln=new CU;const ay="transparent",RU={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Xg(e||ay),s=r.valid&&Xg(t||ay);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class PU{constructor(t,n,r,s){const o=n[r];s=No([t.to,s,o,t.from]);const i=No([t.from,o,s]);this._active=!0,this._fn=t.fn||RU[t.type||typeof i],this._easing=Uo[t.easing]||Uo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=No([t.to,n,s,t.from]),this._from=No([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let c;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class pS{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!xe(t))return;const n=Object.keys($e.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!xe(o))return;const i={};for(const a of n)i[a]=o[a];(ze(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=TU(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&OU(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let c;for(c=i.length-1;c>=0;--c){const l=i[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[l];let d=o[l];const f=r.get(l);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[l]=u;continue}o[l]=d=new PU(f,t,l,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ln.add(this._chart,r),!0}}function OU(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function TU(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function cy(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function MU(e,t,n){if(n===!1)return!1;const r=cy(e,n),s=cy(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function AU(e){let t,n,r,s;return xe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function mS(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function ly(e,t,n,r={}){const s=e.keys,o=r.mode==="single";let i,a,c,l;if(t===null)return;let u=!1;for(i=0,a=s.length;i<a;++i){if(c=+s[i],c===n){if(u=!0,r.all)continue;break}l=e.values[c],We(l)&&(o||t===0||Rn(t)===Rn(l))&&(t+=l)}return!u&&!r.all?0:t}function NU(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(e),a=new Array(i.length);let c,l,u;for(c=0,l=i.length;c<l;++c)u=i[c],a[c]={[s]:u,[o]:e[u]};return a}function Ru(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function DU(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function IU(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function jU(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function uy(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function dy(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,c=o.axis,l=i.axis,u=DU(o,i,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[c]:m,[l]:y}=p,b=p._stacks||(p._stacks={});f=b[l]=jU(s,u,m),f[a]=y,f._top=uy(f,i,!0,r.type),f._bottom=uy(f,i,!1,r.type);const x=f._visualValues||(f._visualValues={});x[a]=y}}function Pu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function LU(e,t){return Rr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function FU(e,t,n){return Rr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _o(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Ou=e=>e==="reset"||e==="none",fy=(e,t)=>t?e:Object.assign({},e),zU=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:mS(n,!0),values:null};class Pr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ru(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_o(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,o=n.xAxisID=de(r.xAxisID,Pu(t,"x")),i=n.yAxisID=de(r.yAxisID,Pu(t,"y")),a=n.rAxisID=de(r.rAxisID,Pu(t,"r")),c=n.indexAxis,l=n.iAxisID=s(c,o,i,a),u=n.vAxisID=s(c,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(l),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Zg(this._data,this),t._stacked&&_o(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(xe(n)){const s=this._cachedMeta;this._data=NU(n,s)}else if(r!==n){if(r){Zg(r,this);const s=this._cachedMeta;_o(s),s._parsed=[]}n&&Object.isExtensible(n)&&SB(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Ru(n.vScale,n),n.stack!==r.stack&&(s=!0,_o(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(dy(this,n._parsed),n._stacked=Ru(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let c=t===0&&n===s.length?!0:r._sorted,l=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{ze(s[t])?f=this.parseArrayData(r,s,t,n):xe(s[t])?f=this.parseObjectData(r,s,t,n):f=this.parsePrimitiveData(r,s,t,n);const h=()=>d[a]===null||l&&d[a]<l[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],c&&(h()&&(c=!1),l=d);r._sorted=c}i&&dy(this,f)}parsePrimitiveData(t,n,r,s){const{iScale:o,vScale:i}=t,a=o.axis,c=i.axis,l=o.getLabels(),u=o===i,d=new Array(s);let f,h,p;for(f=0,h=s;f<h;++f)p=f+r,d[f]={[a]:u||o.parse(l[p],p),[c]:i.parse(n[p],p)};return d}parseArrayData(t,n,r,s){const{xScale:o,yScale:i}=t,a=new Array(s);let c,l,u,d;for(c=0,l=s;c<l;++c)u=c+r,d=n[u],a[c]={x:o.parse(d[0],u),y:i.parse(d[1],u)};return a}parseObjectData(t,n,r,s){const{xScale:o,yScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s);let u,d,f,h;for(u=0,d=s;u<d;++u)f=u+r,h=n[f],l[u]={x:o.parse(br(h,a),f),y:i.parse(br(h,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,o=this._cachedMeta,i=n[t.axis],a={keys:mS(s,!0),values:n._stacks[t.axis]._visualValues};return ly(a,i,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=ly(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,i=s.length,a=this._getOtherScale(t),c=zU(n,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=IU(a);let f,h;function p(){h=s[f];const m=h[a.axis];return!We(h[t.axis])||u>m||d<m}for(f=0;f<i&&!(!p()&&(this.updateRangeFromParsed(l,t,h,c),o));++f);if(o){for(f=i-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(l,t,h,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][t.axis],We(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=AU(de(this.options.clip,MU(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,c),u=a;u<a+c;++u){const d=s[u];d.hidden||(d.active&&l?i.push(d):d.draw(t,o))}for(u=0;u<i.length;++u)i[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];o=i.$context||(i.$context=FU(this.getContext(),t,i)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=LU(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=t+"-"+n,a=o[i],c=this.enableOptionSharing&&li(r);if(a)return fy(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),h=Object.keys($e.elements[t]),p=()=>this.getContext(r,s,n),m=l.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=c,o[i]=Object.freeze(fy(m,c))),m}_resolveAnimations(t,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let c;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);c=u.createResolver(f,this.getContext(t,r,n))}const l=new pS(s,c&&c.animations);return c&&c._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Ou(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(t,n,r,s){Ou(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Ou(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){const s=this._cachedMeta,o=s.data,i=t+n;let a;const c=l=>{for(l.length+=n,a=l.length-1;a>=i;a--)l[a]=l[a-n]};for(c(o),a=t;a<i;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&_o(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function $U(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=Z0(r.sort((s,o)=>s-o))}return e._cache.$bar}function VU(e){const t=e.iScale,n=$U(t,e.type);let r=t._length,s,o,i,a;const c=()=>{i===32767||i===-32768||(li(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=t.getPixelForValue(n[s]),c();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)i=t.getPixelForTick(s),c();return r}function BU(e,t,n,r){const s=n.barThickness;let o,i;return ye(s)?(o=t.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:t.pixels[e]-o/2}}function UU(e,t,n,r){const s=t.pixels,o=s[e];let i=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const c=n.categoryPercentage;i===null&&(i=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-i);const l=o-(o-Math.min(i,a))/2*c;return{chunk:Math.abs(a-i)/2*c/r,ratio:n.barPercentage,start:l}}function WU(e,t,n,r){const s=n.parse(e[0],r),o=n.parse(e[1],r),i=Math.min(s,o),a=Math.max(s,o);let c=i,l=a;Math.abs(i)>Math.abs(a)&&(c=a,l=i),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:s,end:o,min:i,max:a}}function gS(e,t,n,r){return ze(e)?WU(e,t,n,r):t[n.axis]=n.parse(e,r),t}function hy(e,t,n,r){const s=e.iScale,o=e.vScale,i=s.getLabels(),a=s===o,c=[];let l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[s.axis]=a||s.parse(i[l],l),c.push(gS(f,d,o,l));return c}function Tu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function HU(e,t,n){return e!==0?Rn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function qU(e){let t,n,r,s,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:t,top:s,bottom:o}}function KU(e,t,n,r){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:c,top:l,bottom:u}=qU(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=l:(n._bottom||0)===r?s=u:(o[py(u,i,a,c)]=!0,s=l)),o[py(s,i,a,c)]=!0,e.borderSkipped=o}function py(e,t,n,r){return r?(e=ZU(e,t,n),e=my(e,n,t)):e=my(e,t,n),e}function ZU(e,t,n){return e===t?n:e===n?t:e}function my(e,t,n){return e==="start"?t:e==="end"?n:e}function GU(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class YU extends Pr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,s){return hy(t,n,r,s)}parseArrayData(t,n,r,s){return hy(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:o,vScale:i}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=i.axis==="x"?a:c,d=[];let f,h,p,m;for(f=r,h=r+s;f<h;++f)m=n[f],p={},p[o.axis]=o.parse(br(m,l),f),d.push(gS(br(m,u),p,i,f));return d}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(t),i=o._custom,a=Tu(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,s);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=o||ye(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),b=(p._stacks||{})[a.axis],x={horizontal:l,base:m.base,enableBorderRadius:!b||Tu(p._custom)||i===b._top||i===b._bottom,x:l?m.head:y.center,y:l?y.center:m.head,height:l?y.size:Math.abs(m.size),width:l?Math.abs(m.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(h,t[h].active?"active":s));const _=x.options||t[h].options;KU(x,_,b,i),GU(x,_,u.ratio),this.updateElement(t[h],h,x,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),c=a&&a[r.axis],l=u=>{const d=u._parsed.find(h=>h[r.axis]===c),f=d&&d[u.vScale.axis];if(ye(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&l(u))&&((o===!1||i.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[de(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||VU(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,c=this.getParsed(t),l=c._custom,u=Tu(l);let d=c[n.axis],f=0,h=r?this.applyStack(n,c,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=l.barStart,h=l.barEnd-l.barStart,d!==0&&Rn(d)!==Rn(l.barEnd)&&(f=0),f+=d);const y=!ye(o)&&!u?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=b,m=p-b,Math.abs(m)<i){m=HU(m,n,a)*i,d===a&&(b-=m/2);const x=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),w=Math.min(x,_),S=Math.max(x,_);b=Math.max(Math.min(b,S),w),p=b+m,r&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=Rn(m)*n.getLineWidthForValue(a)/2;b+=x,m-=x}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,o=s.skipNull,i=de(s.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=s.barThickness==="flex"?UU(t,n,s,u*l):BU(t,n,s,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(de(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;a=d.start+d.chunk*p+d.chunk/2,c=Math.min(i,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),c=Math.min(i,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}class XU extends Pr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,s){const o=super.parsePrimitiveData(t,n,r,s);for(let i=0;i<o.length;i++)o[i]._custom=this.resolveDataElementOptions(i+r).radius;return o}parseArrayData(t,n,r,s){const o=super.parseArrayData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a[2],this.resolveDataElementOptions(i+r).radius)}return o}parseObjectData(t,n,r,s){const o=super.parseObjectData(t,n,r,s);for(let i=0;i<o.length;i++){const a=n[r+i];o[i]._custom=de(a&&a.r&&+a.r,this.resolveDataElementOptions(i+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y),l=i._custom;return{label:r[t]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,s),u=i.axis,d=a.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!o&&this.getParsed(f),m={},y=m[u]=o?i.getPixelForDecimal(.5):i.getPixelForValue(p[u]),b=m[d]=o?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(b),l&&(m.options=c||this.resolveDataElementOptions(f,h.active?"active":s),o&&(m.options.radius=0)),this.updateElement(h,f,m,s)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=de(r&&r._custom,o),s}}function JU(e,t,n){let r=1,s=1,o=0,i=0;if(t<Ae){const a=e,c=a+t,l=Math.cos(a),u=Math.sin(a),d=Math.cos(c),f=Math.sin(c),h=(_,w,S)=>ui(_,a,c,!0)?1:Math.max(w,w*n,S,S*n),p=(_,w,S)=>ui(_,a,c,!0)?-1:Math.min(w,w*n,S,S*n),m=h(0,l,d),y=h(He,u,f),b=p(we,l,d),x=p(we+He,u,f);r=(m-b)/2,s=(y-x)/2,o=-(m+b)/2,i=-(y+x)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class Dh extends Pr{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,l)=>{const d=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||d.borderRadius),index:l}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=c=>+r[c];if(xe(r[t])){const{key:c="value"}=this._parsing;o=l=>+br(r[l],c)}let i,a;for(i=t,a=t+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return fn(this.options.rotation-90)}_getCircumference(){return fn(this.options.circumference)}_getRotationExtents(){let t=Ae,n=-Ae;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+i)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(cB(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=JU(d,u,c),y=(r.width-i)/f,b=(r.height-i)/h,x=Math.max(Math.min(y,b)/2,0),_=U0(this.options.radius,x),w=Math.max(_*c,0),S=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,s.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Ae)}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,l=i.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&l.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+r;++x){const _=this._circumference(x,o),w=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:h};y&&(S.options=m||this.resolveDataElementOptions(x,w.active?"active":s)),b+=_,this.updateElement(w,x,S,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ae*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,o,i,a,c;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),t=i.data,a=i.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yS extends Pr{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:s=[],_dataset:o}=n,i=this.chart._animationsDisabled;let{start:a,count:c}=X0(n,s,i);this._drawStart=a,this._drawCount=c,J0(n)&&(a=0,c=s.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=i.axis,h=a.axis,{spanGaps:p,segment:m}=this.options,y=Ys(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+r,_=t.length;let w=n>0&&this.getParsed(n-1);for(let S=0;S<_;++S){const C=t[S],k=b?C:{};if(S<n||S>=x){k.skip=!0;continue}const E=this.getParsed(S),P=ye(E[h]),O=k[f]=i.getPixelForValue(E[f],S),N=k[h]=o||P?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,E,c):E[h],S);k.skip=isNaN(O)||isNaN(N)||P,k.stop=S>0&&Math.abs(E[f]-w[f])>y,m&&(k.parsed=E,k.raw=l.data[S]),d&&(k.options=u||this.resolveDataElementOptions(S,C.active?"active":s)),b||this.updateElement(C,S,k,s),w=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return r;const o=s[0].size(this.resolveDataElementOptions(0)),i=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(r,o,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class bS extends Pr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:s}}=t.legend.options;return n.labels.map((o,i)=>{const c=t.getDatasetMeta(0).controller.getStyle(i);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Oi(n._parsed[t].r,r.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),i=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-i)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,c=i.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,d=l.yCenter,f=l.getIndexAngle(0)-.5*we;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,s,m);for(p=n;p<n+r;p++){const y=t[p];let b=h,x=h+this._computeAngle(p,s,m),_=i.getDataVisibility(p)?l.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=x,o&&(c.animateScale&&(_=0),c.animateRotate&&(b=x=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,w,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?fn(this.resolveDataElementOptions(t,n).angle||r):0}}class QU extends Dh{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class e5 extends Pr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,s){return iS.bind(this)(t,n,r,s)}update(t){const n=this._cachedMeta,r=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(r.points=s,t!=="resize"){const i=this.resolveDatasetElementOptions(t);this.options.showLine||(i.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:i};this.updateElement(r,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,r,s){const o=this._cachedMeta.rScale,i=s==="reset";for(let a=n;a<n+r;a++){const c=t[a],l=this.resolveDataElementOptions(a,c.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=i?o.xCenter:u.x,f=i?o.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:l};this.updateElement(c,a,h,s)}}}class t5 extends Pr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:s,yScale:o}=n,i=this.getParsed(t),a=s.getLabelForValue(i.x),c=o.getLabelForValue(i.y);return{label:r[t]||"",value:"("+a+", "+c+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:i}=X0(n,r,s);if(this._drawStart=o,this._drawCount=i,J0(n)&&(o=0,i=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=r;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,i,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,s){const o=s==="reset",{iScale:i,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),h=i.axis,p=a.axis,{spanGaps:m,segment:y}=this.options,b=Ys(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let _=n>0&&this.getParsed(n-1);for(let w=n;w<n+r;++w){const S=t[w],C=this.getParsed(w),k=x?S:{},E=ye(C[p]),P=k[h]=i.getPixelForValue(C[h],w),O=k[p]=o||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[p],w);k.skip=isNaN(P)||isNaN(O)||E,k.stop=w>0&&Math.abs(C[h]-_[h])>b,y&&(k.parsed=C,k.raw=l.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,S.active?"active":s)),x||this.updateElement(S,w,k,s),_=C}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const r=t.dataset,s=r.options&&r.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),i=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,i)/2}}var n5=Object.freeze({__proto__:null,BarController:YU,BubbleController:XU,DoughnutController:Dh,LineController:yS,PieController:QU,PolarAreaController:bS,RadarController:e5,ScatterController:t5});function Nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ih{static override(t){Object.assign(Ih.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Nr()}parse(){return Nr()}format(){return Nr()}add(){return Nr()}diff(){return Nr()}startOf(){return Nr()}endOf(){return Nr()}}var r5={_date:Ih};function s5(e,t,n,r){const{controller:s,data:o,_sorted:i}=e,a=s._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&i&&o.length){const l=a._reversePixels?_B:Un;if(r){if(s._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=l(o,t,n-d),h=l(o,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=l(o,t,n);if(c){const{vScale:d}=s._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!ye(m[d.axis]));u.lo-=Math.max(0,h);const p=f.slice(u.hi).findIndex(m=>!ye(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Ol(e,t,n,r,s){const o=e.getSortedVisibleDatasetMetas(),i=n[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:d,hi:f}=s5(o[a],t,i,s);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,l,h)}}}function o5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const o=t?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function Mu(e,t,n,r,s){const o=[];return!s&&!e.isPointInArea(t)||Ol(e,n,t,function(a,c,l){!s&&!Wn(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function i5(e,t,n,r){let s=[];function o(i,a,c){const{startAngle:l,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:d}=q0(i,{x:t.x,y:t.y});ui(d,l,u)&&s.push({element:i,datasetIndex:a,index:c})}return Ol(e,n,t,o),s}function a5(e,t,n,r,s,o){let i=[];const a=o5(n);let c=Number.POSITIVE_INFINITY;function l(u,d,f){const h=u.inRange(t.x,t.y,s);if(r&&!h)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!h)return;const y=a(t,p);y<c?(i=[{element:u,datasetIndex:d,index:f}],c=y):y===c&&i.push({element:u,datasetIndex:d,index:f})}return Ol(e,n,t,l),i}function Au(e,t,n,r,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?i5(e,t,n,s):a5(e,t,n,r,s,o)}function gy(e,t,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return Ol(e,n,t,(c,l,u)=>{c[i]&&c[i](t[n],s)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(t.x,t.y,s))}),r&&!a?[]:o}var c5={modes:{index(e,t,n,r){const s=Ir(t,e),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?Mu(e,s,o,r,i):Au(e,s,o,!1,r,i);if(a.length>0){const c=a[0].datasetIndex,l=e.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Mu(e,s,o,r,i)},nearest(e,t,n,r){const s=Ir(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Au(e,s,o,n.intersect,r,i)},x(e,t,n,r){const s=Ir(t,e);return gy(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=Ir(t,e);return gy(e,s,"y",n.intersect,r)}}};const vS=["left","top","right","bottom"];function wo(e,t){return e.filter(n=>n.pos===t)}function yy(e,t){return e.filter(n=>vS.indexOf(n.pos)===-1&&n.box.axis===t)}function So(e,t){return e.sort((n,r)=>{const s=t?r:n,o=t?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function l5(e){const t=[];let n,r,s,o,i,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return t}function u5(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!vS.includes(s))continue;const i=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function d5(e,t){const n=u5(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let o,i,a;for(o=0,i=e.length;o<i;++o){a=e[o];const{fullSize:c}=a.box,l=n[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*r:c&&t.availableWidth,a.height=s):(a.width=r,a.height=u?u*s:c&&t.availableHeight)}return n}function f5(e){const t=l5(e),n=So(t.filter(l=>l.box.fullSize),!0),r=So(wo(t,"left"),!0),s=So(wo(t,"right")),o=So(wo(t,"top"),!0),i=So(wo(t,"bottom")),a=yy(t,"x"),c=yy(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(c).concat(i).concat(a),chartArea:wo(t,"chartArea"),vertical:r.concat(s).concat(c),horizontal:o.concat(i).concat(a)}}function by(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function xS(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function h5(e,t,n,r){const{pos:s,box:o}=n,i=e.maxPadding;if(!xe(s)){n.size&&(e[s]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&xS(i,o.getPadding());const a=Math.max(0,t.outerWidth-by(i,e,"left","right")),c=Math.max(0,t.outerHeight-by(i,e,"top","bottom")),l=a!==e.w,u=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function p5(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function m5(e,t){const n=t.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(t[i],n[i])}),o}return r(e?["left","right"]:["top","bottom"])}function Do(e,t,n,r){const s=[];let o,i,a,c,l,u;for(o=0,i=e.length,l=0;o<i;++o){a=e[o],c=a.box,c.update(a.width||t.w,a.height||t.h,m5(a.horizontal,t));const{same:d,other:f}=h5(t,n,a,r);l|=d&&s.length,u=u||f,c.fullSize||s.push(a)}return l&&Do(s,t,n,r)||u}function ga(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function vy(e,t,n,r){const s=n.padding;let{x:o,y:i}=t;for(const a of e){const c=a.box,l=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const d=t.w*u,f=l.size||c.height;li(l.start)&&(i=l.start),c.fullSize?ga(c,s.left,i,n.outerWidth-s.right-s.left,f):ga(c,t.left+l.placed,i,d,f),l.start=i,l.placed+=d,i=c.bottom}else{const d=t.h*u,f=l.size||c.width;li(l.start)&&(o=l.start),c.fullSize?ga(c,o,s.top,f,n.outerHeight-s.bottom-s.top):ga(c,o,t.top+l.placed,f,d),l.start=o,l.placed+=d,o=c.right}}t.x=o,t.y=i}var bt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=xt(e.options.layout.padding),o=Math.max(t-s.width,0),i=Math.max(n-s.height,0),a=f5(e.boxes),c=a.vertical,l=a.horizontal;Ce(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/u,hBoxMaxHeight:i/2}),f=Object.assign({},s);xS(f,xt(r));const h=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),p=d5(c.concat(l),d);Do(a.fullSize,h,d,p),Do(c,h,d,p),Do(l,h,d,p)&&Do(c,h,d,p),p5(h),vy(a.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,vy(a.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ce(a.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class _S{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class g5 extends _S{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Va="$chartjs",y5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xy=e=>e===null||e==="";function b5(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Va]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",xy(s)){const o=ry(e,"width");o!==void 0&&(e.width=o)}if(xy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ry(e,"height");o!==void 0&&(e.height=o)}return e}const wS=pU?{passive:!0}:!1;function v5(e,t,n){e&&e.addEventListener(t,n,wS)}function x5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,wS)}function _5(e,t){const n=y5[e.type]||e.type,{x:r,y:s}=Ir(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Tc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function w5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.addedNodes,r),i=i&&!Tc(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function S5(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Tc(a.removedNodes,r),i=i&&!Tc(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fi=new Map;let _y=0;function SS(){const e=window.devicePixelRatio;e!==_y&&(_y=e,fi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function E5(e,t){fi.size||window.addEventListener("resize",SS),fi.set(e,t)}function k5(e){fi.delete(e),fi.size||window.removeEventListener("resize",SS)}function C5(e,t,n){const r=e.canvas,s=r&&Nh(r);if(!s)return;const o=Y0((a,c)=>{const l=s.clientWidth;n(a,c),l<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return i.observe(s),E5(e,o),i}function Nu(e,t,n){n&&n.disconnect(),t==="resize"&&k5(e)}function R5(e,t,n){const r=e.canvas,s=Y0(o=>{e.ctx!==null&&n(_5(o,e))},e);return v5(r,t,s),s}class P5 extends _S{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(b5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Va])return!1;const r=n[Va].initial;["height","width"].forEach(o=>{const i=r[o];ye(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Va],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),i={attach:w5,detach:S5,resize:C5}[n]||R5;s[n]=i(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Nu,detach:Nu,resize:Nu}[n]||x5)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return hU(t,n,r,s)}isAttached(t){const n=t&&Nh(t);return!!(n&&n.isConnected)}}function O5(e){return!Ah()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?g5:P5}let Jn=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ys(this.x)&&Ys(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}};function T5(e,t){const n=e.options.ticks,r=M5(e),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?N5(t):[],i=o.length,a=o[0],c=o[i-1],l=[];if(i>s)return D5(t,l,o,i/s),l;const u=A5(o,t,s);if(i>0){let d,f;const h=i>1?Math.round((c-a)/(i-1)):null;for(ya(t,l,u,ye(h)?0:a-h,a),d=0,f=i-1;d<f;d++)ya(t,l,u,o[d],o[d+1]);return ya(t,l,u,c,ye(h)?t.length:c+h),l}return ya(t,l,u),l}function M5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function A5(e,t,n){const r=I5(e),s=t.length/n;if(!r)return Math.max(s,1);const o=gB(r);for(let i=0,a=o.length-1;i<a;i++){const c=o[i];if(c>s)return c}return Math.max(s,1)}function N5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function D5(e,t,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<e.length;i++)i===o&&(t.push(e[i]),s++,o=n[s*r])}function ya(e,t,n,r,s){const o=de(r,0),i=Math.min(de(s,e.length),e.length);let a=0,c,l,u;for(n=Math.ceil(n),s&&(c=s-r,n=c/Math.floor(c/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(l=Math.max(o,0);l<i;l++)l===u&&(t.push(e[l]),a++,u=Math.round(o+a*n))}function I5(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const j5=e=>e==="left"?"right":e==="right"?"left":e,wy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Sy=(e,t)=>Math.min(t||e,e);function Ey(e,t){const n=[],r=e.length/t,s=e.length;let o=0;for(;o<s;o+=r)n.push(e[Math.floor(o)]);return n}function L5(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),o=e._startPixel,i=e._endPixel,a=1e-6;let c=e.getPixelForTick(s),l;if(!(n&&(r===1?l=Math.max(c-o,i-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>i+a)))return c}function F5(e,t){Ce(e,n=>{const r=n.gc,s=r.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Eo(e){return e.drawTicks?e.tickLength:0}function ky(e,t){if(!e.display)return 0;const n=rt(e.font,t),r=xt(e.padding);return(ze(e.text)?e.text.length:1)*n.lineHeight+r.height}function z5(e,t){return Rr(e,{scale:t,type:"scale"})}function $5(e,t,n){return Rr(e,{tick:n,index:t,type:"tick"})}function V5(e,t,n){let r=Ch(e);return(n&&t!=="right"||!n&&t==="right")&&(r=j5(r)),r}function B5(e,t,n,r){const{top:s,left:o,bottom:i,right:a,chart:c}=e,{chartArea:l,scales:u}=c;let d=0,f,h,p;const m=i-s,y=a-o;if(e.isHorizontal()){if(h=ht(r,o,a),xe(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+m-t}else n==="center"?p=(l.bottom+l.top)/2+m-t:p=wy(e,n,t);f=a-o}else{if(xe(n)){const b=Object.keys(n)[0],x=n[b];h=u[b].getPixelForValue(x)-y+t}else n==="center"?h=(l.left+l.right)/2-y+t:h=wy(e,n,t);p=ht(r,i,s),d=n==="left"?-He:He}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class hs extends Jn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Ft(t,Number.POSITIVE_INFINITY),n=Ft(n,Number.NEGATIVE_INFINITY),r=Ft(r,Number.POSITIVE_INFINITY),s=Ft(s,Number.NEGATIVE_INFINITY),{min:Ft(t,r),max:Ft(n,s),minDefined:We(t),maxDefined:We(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)i=a[c].controller.getMinMax(this,t),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Ft(n,Ft(r,n)),max:Ft(r,Ft(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Me(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=HB(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Ey(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=T5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Me(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Me(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r],o.label=Me(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Sy(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,c,l;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=at(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),c=this.maxHeight-Eo(t.grid)-n.padding-ky(t.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),i=Eh(Math.min(Math.asin(at((u.highest.height+6)/a,-1,1)),Math.asin(at(c/l,-1,1))-Math.asin(at(f/l,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const c=ky(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Eo(o)+c):(t.height=this.maxHeight,t.width=Eo(o)+c),r.display&&this.ticks.length){const{first:l,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=fn(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const b=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(l,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;c?l?(f=s*t.width,h=r*n.height):(f=r*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+i)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+i,this.paddingBottom=d+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Me(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ey(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],c=Math.floor(n/Sy(n,r));let l=0,u=0,d,f,h,p,m,y,b,x,_,w,S;for(d=0;d<n;d+=c){if(p=t[d].label,m=this._resolveTickFontOptions(d),s.font=y=m.string,b=o[y]=o[y]||{data:{},gc:[]},x=m.lineHeight,_=w=0,!ye(p)&&!ze(p))_=Pc(s,b.data,b.gc,_,p),w=x;else if(ze(p))for(f=0,h=p.length;f<h;++f)S=p[f],!ye(S)&&!ze(S)&&(_=Pc(s,b.data,b.gc,_,S),w+=x);i.push(_),a.push(w),l=Math.max(_,l),u=Math.max(w,u)}F5(o,n);const C=i.indexOf(l),k=a.indexOf(u),E=P=>({width:i[P]||0,height:a[P]||0});return{first:E(0),last:E(n-1),widest:E(C),highest:E(k),widths:i,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return xB(this._alignToPixels?Ar(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=$5(this.getContext(),t,r))}return this.$context||(this.$context=z5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=fn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=t.autoSkipPadding||0,a=o?o.widest.width+i:0,c=o?o.highest.height+i:0;return this.isHorizontal()?c*r>a*s?a/r:c/s:c*s<a*r?c/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=Eo(o),h=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,b=function(D){return Ar(r,D,m)};let x,_,w,S,C,k,E,P,O,N,A,j;if(i==="top")x=b(this.bottom),k=this.bottom-f,P=x-y,N=b(t.top)+y,j=t.bottom;else if(i==="bottom")x=b(this.top),N=t.top,j=b(t.bottom)-y,k=x+y,P=this.top+f;else if(i==="left")x=b(this.right),C=this.right-f,E=x-y,O=b(t.left)+y,A=t.right;else if(i==="right")x=b(this.left),O=t.left,A=b(t.right)-y,C=x+y,E=this.left+f;else if(n==="x"){if(i==="center")x=b((t.top+t.bottom)/2+.5);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}N=t.top,j=t.bottom,k=x+y,P=k+f}else if(n==="y"){if(i==="center")x=b((t.left+t.right)/2);else if(xe(i)){const D=Object.keys(i)[0],H=i[D];x=b(this.chart.scales[D].getPixelForValue(H))}C=x-y,E=C-f,O=t.left,A=t.right}const $=de(s.ticks.maxTicksLimit,d),q=Math.max(1,Math.ceil(d/$));for(_=0;_<d;_+=q){const D=this.getContext(_),H=o.setContext(D),F=a.setContext(D),W=H.lineWidth,se=H.color,I=F.dash||[],Y=F.dashOffset,K=H.tickWidth,Z=H.tickColor,oe=H.tickBorderDash||[],ce=H.tickBorderDashOffset;w=L5(this,_,c),w!==void 0&&(S=Ar(r,w,W),l?C=E=O=A=S:k=P=N=j=S,h.push({tx1:C,ty1:k,tx2:E,ty2:P,x1:O,y1:N,x2:A,y2:j,width:W,color:se,borderDash:I,borderDashOffset:Y,tickWidth:K,tickColor:Z,tickBorderDash:oe,tickBorderDashOffset:ce}))}return this._ticksLength=d,this._borderValue=x,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:d}=o,f=Eo(r.grid),h=f+u,p=d?-u:h,m=-fn(this.labelRotation),y=[];let b,x,_,w,S,C,k,E,P,O,N,A,j="middle";if(s==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(s==="right"){const q=this._getYAxisLabelAlignment(f);k=q.textAlign,S=q.x}else if(n==="x"){if(s==="center")C=(t.top+t.bottom)/2+h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];C=this.chart.scales[q].getPixelForValue(D)+h}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(t.left+t.right)/2-h;else if(xe(s)){const q=Object.keys(s)[0],D=s[q];S=this.chart.scales[q].getPixelForValue(D)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?j="top":c==="end"&&(j="bottom"));const $=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){_=a[b],w=_.label;const q=o.setContext(this.getContext(b));E=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),O=P.lineHeight,N=ze(w)?w.length:1;const D=N/2,H=q.color,F=q.textStrokeColor,W=q.textStrokeWidth;let se=k;i?(S=E,k==="inner"&&(b===x-1?se=this.options.reverse?"left":"right":b===0?se=this.options.reverse?"right":"left":se="center"),s==="top"?l==="near"||m!==0?A=-N*O+O/2:l==="center"?A=-$.highest.height/2-D*O+O:A=-$.highest.height+O/2:l==="near"||m!==0?A=O/2:l==="center"?A=$.highest.height/2-D*O:A=$.highest.height-N*O,d&&(A*=-1),m!==0&&!q.showLabelBackdrop&&(S+=O/2*Math.sin(m))):(C=E,A=(1-N)*O/2);let I;if(q.showLabelBackdrop){const Y=xt(q.backdropPadding),K=$.heights[b],Z=$.widths[b];let oe=A-Y.top,ce=0-Y.left;switch(j){case"middle":oe-=K/2;break;case"bottom":oe-=K;break}switch(k){case"center":ce-=Z/2;break;case"right":ce-=Z;break;case"inner":b===x-1?ce-=Z:b>0&&(ce-=Z/2);break}I={left:ce,top:oe,width:Z+Y.width,height:K+Y.height,color:q.backdropColor}}y.push({label:w,font:P,textOffset:A,options:{rotation:m,color:H,strokeColor:F,strokeWidth:W,textAlign:se,textBaseline:j,translation:[S,C],backdrop:I}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-fn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=t+o,c=i.widest.width;let l,u;return n==="left"?s?(u=this.right+o,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?s?(u=this.left+o,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,o,i),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,i;const a=(c,l,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(l.x,l.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const c=s[o];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,d,f;this.isHorizontal()?(l=Ar(t,this.left,i)-i/2,u=Ar(t,this.right,a)+a/2,d=f=c):(d=Ar(t,this.top,i)-i/2,f=Ar(t,this.bottom,a)+a/2,l=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(l,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Cl(r,s);const o=this.getLabelItems(t);for(const i of o){const a=i.options,c=i.font,l=i.label,u=i.textOffset;cs(r,l,0,u,c,a)}s&&Rl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=rt(r.font),i=xt(r.padding),a=r.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||xe(n)?(c+=i.bottom,ze(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:l,titleY:u,maxWidth:d,rotation:f}=B5(this,c,n,a);cs(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:V5(a,n,s),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),s=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return rt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ba{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;H5(n)&&(r=this.register(n));const s=this.items,o=t.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,U5(t,i,r),this.override&&$e.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in $e[s]&&(delete $e[s][r],this.override&&delete as[r])}}function U5(e,t,n){const r=ci(Object.create(null),[n?$e.get(n):{},$e.get(t),e.defaults]);$e.set(t,r),e.defaultRoutes&&W5(t,e.defaultRoutes),e.descriptors&&$e.describe(t,e.descriptors)}function W5(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),o=[e].concat(r).join("."),i=t[n].split("."),a=i.pop(),c=i.join(".");$e.route(o,s,c,a)})}function H5(e){return"id"in e&&"defaults"in e}class q5{constructor(){this.controllers=new ba(Pr,"datasets",!0),this.elements=new ba(Jn,"elements"),this.plugins=new ba(Object,"plugins"),this.scales=new ba(hs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Ce(s,i=>{const a=r||this._getRegistryForType(i);this._exec(t,a,i)})})}_exec(t,n,r){const s=Sh(t);Me(r["before"+s],[],r),n[t](r),Me(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var wn=new q5;class K5{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,n,r,s){s=s||{};for(const o of t){const i=o.plugin,a=i[r],c=[n,s,o.options];if(Me(a,c,i)===!1&&s.cancelable)return!1}return!0}invalidate(){ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=de(r.options&&r.options.plugins,{}),o=Z5(r);return s===!1&&!n?[]:Y5(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(c=>a.plugin.id===c.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function Z5(e){const t={},n=[],r=Object.keys(wn.plugins.items);for(let o=0;o<r.length;o++)n.push(wn.getPlugin(r[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}function G5(e,t){return!t&&e===!1?null:e===!0?{}:e}function Y5(e,{plugins:t,localIds:n},r,s){const o=[],i=e.getContext();for(const a of t){const c=a.id,l=G5(r[c],s);l!==null&&o.push({plugin:a,options:X5(e.config,{plugin:a,local:n[c]},l,i)})}return o}function X5(e,{plugin:t,local:n},r,s){const o=e.pluginScopeKeys(t),i=e.getOptionScopes(r,o);return n&&t.defaults&&i.push(t.defaults),e.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wd(e,t){const n=$e.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function J5(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Q5(e,t){return e===t?"_index_":"_value_"}function Cy(e){if(e==="x"||e==="y"||e==="r")return e}function eW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hd(e,...t){if(Cy(e))return e;for(const n of t){const r=n.axis||eW(n.position)||e.length>1&&Cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ry(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function tW(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ry(e,"x",n[0])||Ry(e,"y",n[0])}return{}}function nW(e,t){const n=as[e.type]||{scales:{}},r=t.scales||{},s=Wd(e.type,t),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Hd(i,a,tW(i,e),$e.scales[a.type]),l=Q5(c,s),u=n.scales||{};o[i]=Vo(Object.create(null),[{axis:c},a,u[c],u[l]])}),e.data.datasets.forEach(i=>{const a=i.type||e.type,c=i.indexAxis||Wd(a,t),u=(as[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=J5(d,c),h=i[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),Vo(o[h],[{axis:f},r[h],u[d]])})}),Object.keys(o).forEach(i=>{const a=o[i];Vo(a,[$e.scales[a.type],$e.scale])}),o}function ES(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=nW(e,t)}function kS(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function rW(e){return e=e||{},e.data=kS(e.data),ES(e),e}const Py=new Map,CS=new Set;function va(e,t){let n=Py.get(e);return n||(n=t(),Py.set(e,n),CS.add(n)),n}const ko=(e,t,n)=>{const r=br(t,n);r!==void 0&&e.add(r)};class sW{constructor(t){this._config=rW(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=kS(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ES(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return va(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return va(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return va(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return va(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:o}=this,i=this._cachedScopes(t,r),a=i.get(n);if(a)return a;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(d=>ko(c,t,d))),u.forEach(d=>ko(c,s,d)),u.forEach(d=>ko(c,as[o]||{},d)),u.forEach(d=>ko(c,$e,d)),u.forEach(d=>ko(c,Bd,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),CS.has(n)&&i.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,as[n]||{},$e.datasets[n]||{},{type:n},$e,Bd]}resolveNamedOptions(t,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=Oy(this._resolverCache,t,s);let c=i;if(iW(i,n)){o.$shared=!1,r=vr(r)?r():r;const l=this.createResolver(t,r,a);c=Xs(i,r,l)}for(const l of n)o[l]=c[l];return o}createResolver(t,n,r=[""],s){const{resolver:o}=Oy(this._resolverCache,t,r);return xe(n)?Xs(o,n,void 0,s):o}}function Oy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let o=r.get(s);return o||(o={resolver:Oh(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const oW=e=>xe(e)&&Object.getOwnPropertyNames(e).some(t=>vr(e[t]));function iW(e,t){const{isScriptable:n,isIndexable:r}=nS(e);for(const s of t){const o=n(s),i=r(s),a=(i||o)&&e[s];if(o&&(vr(a)||oW(a))||i&&ze(a))return!0}return!1}var aW="4.5.1";const cW=["top","bottom","left","right","chartArea"];function Ty(e,t){return e==="top"||e==="bottom"||cW.indexOf(e)===-1&&t==="x"}function My(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Ay(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Me(n&&n.onComplete,[e],t)}function lW(e){const t=e.chart,n=t.options.animation;Me(n&&n.onProgress,[e],t)}function RS(e){return Ah()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ba={},Ny=e=>{const t=RS(e);return Object.values(Ba).filter(n=>n.canvas===t).pop()};function uW(e,t,n){const r=Object.keys(e);for(const s of r){const o=+s;if(o>=t){const i=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=i)}}}function dW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Ti=class{static defaults=$e;static instances=Ba;static overrides=as;static registry=wn;static version=aW;static getChart=Ny;static register(...t){wn.add(...t),Dy()}static unregister(...t){wn.remove(...t),Dy()}constructor(t,n){const r=this.config=new sW(n),s=RS(t),o=Ny(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||O5(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=aB(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new K5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=EB(d=>this.update(d),i.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ln.listen(this,"complete",Ay),Ln.listen(this,"progress",lW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return ye(t)?n&&o?o:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return wn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ny(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qg(this.canvas,this.ctx),this}stop(){return Ln.stop(this),this}resize(t,n){Ln.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,ny(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),Me(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ce(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],c=Hd(i,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Ce(o,i=>{const a=i.options,c=a.id,l=Hd(c,a),u=de(a.type,i.dtype);(a.position===void 0||Ty(a.position,l)!==Ty(i.dposition))&&(a.position=i.dposition),s[c]=!0;let d=null;if(c in r&&r[c].type===u)d=r[c];else{const f=wn.getScale(u);d=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ce(s,(i,a)=>{i||delete r[a]}),Ce(r,i=>{bt.configure(this,i,i.options),bt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(My("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||Wd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=wn.getController(a),{datasetElementType:l,dataElementType:u}=$e.datasets[a];Object.assign(c,{dataElementType:wn.getElement(u),datasetElementType:l&&wn.getElement(l)}),i.controller=new c(this,r),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Ce(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:d}=this.getDatasetMeta(l),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),i=Math.max(+d.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||Ce(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(My("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ce(this.scales,t=>{bt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Wg(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;uW(t,s,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Wg(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;bt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ce(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ln.has(this)?this.attached&&!Ln.running(this)&&Ln.start(this):(this.draw(),Ay({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=hS(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Cl(n,s),t.controller.draw(),s&&Rl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const o=c5.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=Rr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(t),i=o.controller._resolveAnimations(void 0,s);li(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ln.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),t[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};Ce(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){Ce(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ce(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let o,i,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){i=t[a];const l=i&&this.getDatasetMeta(i.datasetIndex).controller;l&&l[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!kc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),i=o(n,t),a=r?t:o(t,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(t,s,r,i),c=hB(t),l=dW(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Me(o.onHover,[t,a,this],this),c&&Me(o.onClick,[t,a,this],this));const u=!kc(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=l,u}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Dy(){return Ce(Ti.instances,e=>e._plugins.invalidate())}function fW(e,t,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/i,mt(r-n));if(e.beginPath(),e.arc(s,o,i-l/2,r+d/2,n-d/2),a>0){const f=Math.min(l/a,mt(r-n));e.arc(s,o,a+l/2,n-f/2,r+f/2,!0)}else{const f=Math.min(l/2,i*mt(r-n));if(u==="round")e.arc(s,o,f,n-we/2,r+we/2,!0);else if(u==="bevel"){const h=2*f*f,p=-h*Math.cos(n+we/2)+s,m=-h*Math.sin(n+we/2)+o,y=h*Math.cos(r+we/2)+s,b=h*Math.sin(r+we/2)+o;e.lineTo(p,m),e.lineTo(y,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function hW(e,t,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:c}=t;let l=s/a;e.beginPath(),e.arc(o,i,a,r-l,n+l),c>s?(l=s/c,e.arc(o,i,c,n+l,r-l,!0)):e.arc(o,i,s,n+He,r-He),e.closePath(),e.clip()}function pW(e){return Ph(e,["outerStart","outerEnd","innerStart","innerEnd"])}function mW(e,t,n,r){const s=pW(e.options.borderRadius),o=(n-t)/2,i=Math.min(o,r*t/2),a=c=>{const l=(n-Math.min(o,c))*r/2;return at(c,0,Math.min(o,l))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:at(s.innerStart,0,i),innerEnd:at(s.innerEnd,0,i)}}function ws(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Mc(e,t,n,r,s,o){const{x:i,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0;let h=0;const p=s-c;if(r){const q=u>0?u-r:0,D=d>0?d-r:0,H=(q+D)/2,F=H!==0?p*H/(H+r):p;h=(p-F)/2}const m=Math.max(.001,p*d-n/we)/d,y=(p-m)/2,b=c+y+h,x=s-y-h,{outerStart:_,outerEnd:w,innerStart:S,innerEnd:C}=mW(t,f,d,x-b),k=d-_,E=d-w,P=b+_/k,O=x-w/E,N=f+S,A=f+C,j=b+S/N,$=x-C/A;if(e.beginPath(),o){const q=(P+O)/2;if(e.arc(i,a,d,P,q),e.arc(i,a,d,q,O),w>0){const W=ws(E,O,i,a);e.arc(W.x,W.y,w,O,x+He)}const D=ws(A,x,i,a);if(e.lineTo(D.x,D.y),C>0){const W=ws(A,$,i,a);e.arc(W.x,W.y,C,x+He,$+Math.PI)}const H=(x-C/f+(b+S/f))/2;if(e.arc(i,a,f,x-C/f,H,!0),e.arc(i,a,f,H,b+S/f,!0),S>0){const W=ws(N,j,i,a);e.arc(W.x,W.y,S,j+Math.PI,b-He)}const F=ws(k,b,i,a);if(e.lineTo(F.x,F.y),_>0){const W=ws(k,P,i,a);e.arc(W.x,W.y,_,b-He,P)}}else{e.moveTo(i,a);const q=Math.cos(P)*d+i,D=Math.sin(P)*d+a;e.lineTo(q,D);const H=Math.cos(O)*d+i,F=Math.sin(O)*d+a;e.lineTo(H,F)}e.closePath()}function gW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=t;let c=t.endAngle;if(o){Mc(e,t,n,r,c,s);for(let l=0;l<o;++l)e.fill();isNaN(a)||(c=i+(a%Ae||Ae))}return Mc(e,t,n,r,c,s),e.fill(),c}function yW(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:h}=c,p=c.borderAlign==="inner";if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,p?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Mc(e,t,n,r,m,s);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(m=i+(a%Ae||Ae))}p&&hW(e,t,m),c.selfJoin&&m-i>=we&&h===0&&u!=="miter"&&fW(e,t,m),o||(Mc(e,t,n,r,m,s),e.stroke())}class bW extends Jn{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.getProps(["x","y"],r),{angle:o,distance:i}=q0(s,{x:t,y:n}),{startAngle:a,endAngle:c,innerRadius:l,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,h=de(d,c-a),p=ui(o,a,c)&&a!==c,m=h>=Ae||p,y=Bn(i,l+f,u+f);return m&&y}getCenterPoint(t){const{x:n,y:r,startAngle:s,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:l}=this.options,u=(s+o)/2,d=(i+a+l+c)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,i=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Ae?Math.floor(r/Ae):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const c=1-Math.sin(Math.min(we,r||0)),l=s*c;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,gW(t,this,l,o,i),yW(t,this,l,o,i),t.restore()}}function PS(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function vW(e,t,n){e.lineTo(n.x,n.y)}function xW(e){return e.stepped?jB:e.tension||e.cubicInterpolationMode==="monotone"?LB:vW}function OS(e,t,n={}){const r=e.length,{start:s=0,end:o=r-1}=n,{start:i,end:a}=t,c=Math.max(s,i),l=Math.min(o,a),u=s<i&&o<i||s>a&&o>a;return{count:r,start:c,loop:t.loop,ilen:l<c&&!u?r+l-c:l-c}}function _W(e,t,n,r){const{points:s,options:o}=t,{count:i,start:a,loop:c,ilen:l}=OS(s,n,r),u=xW(o);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=l;++h)p=s[(a+(f?l-h:h))%i],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,o.stepped),m=p);return c&&(p=s[(a+(f?l:0))%i],u(e,m,p,f,o.stepped)),!!c}function wW(e,t,n,r){const s=t.points,{count:o,start:i,ilen:a}=OS(s,n,r),{move:c=!0,reverse:l}=r||{};let u=0,d=0,f,h,p,m,y,b;const x=w=>(i+(l?a-w:w))%o,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,b))};for(c&&(h=s[x(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=s[x(f)],h.skip)continue;const w=h.x,S=h.y,C=w|0;C===p?(S<m?m=S:S>y&&(y=S),u=(d*u+w)/++d):(_(),e.lineTo(w,S),p=C,d=0,m=y=S),b=S}_()}function qd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?wW:_W}function SW(e){return e.stepped?mU:e.tension||e.cubicInterpolationMode==="monotone"?gU:jr}function EW(e,t,n,r){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,r)&&s.closePath()),PS(e,t.options),e.stroke(s)}function kW(e,t,n,r){const{segments:s,options:o}=t,i=qd(t);for(const a of s)PS(e,o,a.style),e.beginPath(),i(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const CW=typeof Path2D=="function";function RW(e,t,n,r){CW&&!t.options.segment?EW(e,t,n,r):kW(e,t,n,r)}class Mi extends Jn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const s=r.spanGaps?this._loop:this._fullLoop;aU(this._points,r,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=wU(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,s=t[n],o=this.points,i=fS(this,{property:n,start:s,end:s});if(!i.length)return;const a=[],c=SW(r);let l,u;for(l=0,u=i.length;l<u;++l){const{start:d,end:f}=i[l],h=o[d],p=o[f];if(h===p){a.push(h);continue}const m=Math.abs((s-h[n])/(p[n]-h[n])),y=c(h,p,m,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return qd(this)(t,this,n,r)}path(t,n,r){const s=this.segments,o=qd(this);let i=this._loop;n=n||0,r=r||this.points.length-n;for(const a of s)i&=o(t,this,a,{start:n,end:n+r-1});return!!i}draw(t,n,r,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),RW(t,this,r,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Iy(e,t,n,r){const s=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<s.radius+s.hitRadius}class TS extends Jn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const s=this.options,{x:o,y:i}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-i,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Iy(this,t,"x",n)}inYRange(t,n){return Iy(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!Wn(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,Ud(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function MS(e,t){const{x:n,y:r,base:s,width:o,height:i}=e.getProps(["x","y","base","width","height"],t);let a,c,l,u,d;return e.horizontal?(d=i/2,a=Math.min(n,s),c=Math.max(n,s),l=r-d,u=r+d):(d=o/2,a=n-d,c=n+d,l=Math.min(r,s),u=Math.max(r,s)),{left:a,top:l,right:c,bottom:u}}function lr(e,t,n,r){return e?0:at(t,n,r)}function PW(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,o=tS(r);return{t:lr(s.top,o.top,0,n),r:lr(s.right,o.right,0,t),b:lr(s.bottom,o.bottom,0,n),l:lr(s.left,o.left,0,t)}}function OW(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Zr(s),i=Math.min(t,n),a=e.borderSkipped,c=r||xe(s);return{topLeft:lr(!c||a.top||a.left,o.topLeft,0,i),topRight:lr(!c||a.top||a.right,o.topRight,0,i),bottomLeft:lr(!c||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:lr(!c||a.bottom||a.right,o.bottomRight,0,i)}}function TW(e){const t=MS(e),n=t.right-t.left,r=t.bottom-t.top,s=PW(e,n/2,r/2),o=OW(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Du(e,t,n,r){const s=t===null,o=n===null,a=e&&!(s&&o)&&MS(e,r);return a&&(s||Bn(t,a.left,a.right))&&(o||Bn(n,a.top,a.bottom))}function MW(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function AW(e,t){e.rect(t.x,t.y,t.w,t.h)}function Iu(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+o,h:e.h+i,radius:e.radius}}class NW extends Jn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=TW(this),a=MW(i.radius)?di:AW;t.save(),(i.w!==o.w||i.h!==o.h)&&(t.beginPath(),a(t,Iu(i,n,o)),t.clip(),a(t,Iu(o,-n,i)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Iu(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Du(this,t,n,r)}inXRange(t,n){return Du(this,t,null,n)}inYRange(t,n){return Du(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var DW=Object.freeze({__proto__:null,ArcElement:bW,BarElement:NW,LineElement:Mi,PointElement:TS});const Kd=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],jy=Kd.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function AS(e){return Kd[e%Kd.length]}function NS(e){return jy[e%jy.length]}function IW(e,t){return e.borderColor=AS(t),e.backgroundColor=NS(t),++t}function jW(e,t){return e.backgroundColor=e.data.map(()=>AS(t++)),t}function LW(e,t){return e.backgroundColor=e.data.map(()=>NS(t++)),t}function FW(e){let t=0;return(n,r)=>{const s=e.getDatasetMeta(r).controller;s instanceof Dh?t=jW(n,t):s instanceof bS?t=LW(n,t):s&&(t=IW(n,t))}}function Ly(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function zW(e){return e&&(e.borderColor||e.backgroundColor)}function $W(){return $e.borderColor!=="rgba(0,0,0,0.1)"||$e.backgroundColor!=="rgba(0,0,0,0.1)"}var VW={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:s}=e.config,{elements:o}=s,i=Ly(r)||zW(s)||o&&Ly(o)||$W();if(!n.forceOverride&&i)return;const a=FW(e);r.forEach(a)}};function BW(e,t,n,r,s){const o=s.samples||r;if(o>=n)return e.slice(t,t+n);const i=[],a=(n-2)/(o-2);let c=0;const l=t+n-1;let u=t,d,f,h,p,m;for(i[c++]=e[u],d=0;d<o-2;d++){let y=0,b=0,x;const _=Math.floor((d+1)*a)+1+t,w=Math.min(Math.floor((d+2)*a)+1,n)+t,S=w-_;for(x=_;x<w;x++)y+=e[x].x,b+=e[x].y;y/=S,b/=S;const C=Math.floor(d*a)+1+t,k=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:E,y:P}=e[u];for(h=p=-1,x=C;x<k;x++)p=.5*Math.abs((E-y)*(e[x].y-P)-(E-e[x].x)*(b-P)),p>h&&(h=p,f=e[x],m=x);i[c++]=f,u=m}return i[c++]=e[l],i}function UW(e,t,n,r){let s=0,o=0,i,a,c,l,u,d,f,h,p,m;const y=[],b=t+n-1,x=e[t].x,w=e[b].x-x;for(i=t;i<t+n;++i){a=e[i],c=(a.x-x)/w*r,l=a.y;const S=c|0;if(S===u)l<p?(p=l,d=i):l>m&&(m=l,f=i),s=(o*s+a.x)/++o;else{const C=i-1;if(!ye(d)&&!ye(f)){const k=Math.min(d,f),E=Math.max(d,f);k!==h&&k!==C&&y.push({...e[k],x:s}),E!==h&&E!==C&&y.push({...e[E],x:s})}i>0&&C!==h&&y.push(e[C]),y.push(a),u=S,o=0,p=m=l,d=f=h=i}}return y}function DS(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Fy(e){e.data.datasets.forEach(t=>{DS(t)})}function WW(e,t){const n=t.length;let r=0,s;const{iScale:o}=e,{min:i,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(r=at(Un(t,o.axis,i).lo,0,n-1)),l?s=at(Un(t,o.axis,a).hi+1,r,n)-r:s=n-r,{start:r,count:s}}var HW={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Fy(e);return}const r=e.width;e.data.datasets.forEach((s,o)=>{const{_data:i,indexAxis:a}=s,c=e.getDatasetMeta(o),l=i||s.data;if(No([a,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=WW(c,l);const h=n.threshold||4*r;if(f<=h){DS(s);return}ye(i)&&(s._data=l,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=BW(l,d,f,r,n);break;case"min-max":p=UW(l,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Fy(e)}};function qW(e,t,n){const r=e.segments,s=e.points,o=t.points,i=[];for(const a of r){let{start:c,end:l}=a;l=Tl(c,l,s);const u=Zd(n,s[c],s[l],a.loop);if(!t.segments){i.push({source:a,target:u,start:s[c],end:s[l]});continue}const d=fS(t,u);for(const f of d){const h=Zd(n,o[f.start],o[f.end],f.loop),p=dS(a,s,h);for(const m of p)i.push({source:m,target:f,start:{[n]:zy(u,h,"start",Math.max)},end:{[n]:zy(u,h,"end",Math.min)}})}}return i}function Zd(e,t,n,r){if(r)return;let s=t[e],o=n[e];return e==="angle"&&(s=mt(s),o=mt(o)),{property:e,start:s,end:o}}function KW(e,t){const{x:n=null,y:r=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:i,end:a})=>{a=Tl(i,a,s);const c=s[i],l=s[a];r!==null?(o.push({x:c.x,y:r}),o.push({x:l.x,y:r})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:l.y}))}),o}function Tl(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function zy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function IS(e,t){let n=[],r=!1;return ze(e)?(r=!0,n=e):n=KW(e,t),n.length?new Mi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function $y(e){return e&&e.fill!==!1}function ZW(e,t,n){let s=e[t].fill;const o=[t];let i;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!We(s))return s;if(i=e[s],!i)return!1;if(i.visible)return s;o.push(s),s=i.fill}return!1}function GW(e,t,n){const r=QW(e);if(xe(r))return isNaN(r.value)?!1:r;let s=parseFloat(r);return We(s)&&Math.floor(s)===s?YW(r[0],t,s,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function YW(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function XW(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:xe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function JW(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:xe(e)?r=e.value:r=t.getBaseValue(),r}function QW(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function e4(e){const{scale:t,index:n,line:r}=e,s=[],o=r.segments,i=r.points,a=t4(t,n);a.push(IS({x:null,y:t.bottom},r));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)n4(s,i[u],a)}return new Mi({points:s,options:{}})}function t4(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let s=0;s<r.length;s++){const o=r[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function n4(e,t,n){const r=[];for(let s=0;s<n.length;s++){const o=n[s],{first:i,last:a,point:c}=r4(o,t,"x");if(!(!c||i&&a)){if(i)r.unshift(c);else if(e.push(c),!a)break}}e.push(...r)}function r4(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const s=r[n],o=e.segments,i=e.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],d=i[u.start][n],f=i[u.end][n];if(Bn(s,d,f)){a=s===d,c=s===f;break}}return{first:a,last:c,point:r}}class jS{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:s,y:o,radius:i}=this;return n=n||{start:0,end:Ae},t.arc(s,o,i,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:r+Math.sin(o)*s,angle:o}}}function s4(e){const{chart:t,fill:n,line:r}=e;if(We(n))return o4(t,n);if(n==="stack")return e4(e);if(n==="shape")return!0;const s=i4(e);return s instanceof jS?s:IS(s,r)}function o4(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function i4(e){return(e.scale||{}).getPointPositionForValue?c4(e):a4(e)}function a4(e){const{scale:t={},fill:n}=e,r=XW(n,t);if(We(r)){const s=t.isHorizontal();return{x:s?r:null,y:s?null:r}}return null}function c4(e){const{scale:t,fill:n}=e,r=t.options,s=t.getLabels().length,o=r.reverse?t.max:t.min,i=JW(n,t,o),a=[];if(r.grid.circular){const c=t.getPointPositionForValue(0,o);return new jS({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<s;++c)a.push(t.getPointPositionForValue(c,i));return a}function ju(e,t,n){const r=s4(t),{chart:s,index:o,line:i,scale:a,axis:c}=t,l=i.options,u=l.fill,d=l.backgroundColor,{above:f=d,below:h=d}=u||{},p=s.getDatasetMeta(o),m=hS(s,p);r&&i.points.length&&(Cl(e,n),l4(e,{line:i,target:r,above:f,below:h,area:n,scale:a,axis:c,clip:m}),Rl(e))}function l4(e,t){const{line:n,target:r,above:s,below:o,area:i,scale:a,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(l==="x"?(Vy(e,r,i.top),Lu(e,{line:n,target:r,color:s,scale:a,property:l,clip:c}),e.restore(),e.save(),Vy(e,r,i.bottom)):l==="y"&&(By(e,r,i.left),Lu(e,{line:n,target:r,color:o,scale:a,property:l,clip:c}),e.restore(),e.save(),By(e,r,i.right),u=s)),Lu(e,{line:n,target:r,color:u,scale:a,property:l,clip:c}),e.restore()}function Vy(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function By(e,t,n){const{segments:r,points:s}=t;let o=!0,i=!1;e.beginPath();for(const a of r){const{start:c,end:l}=a,u=s[c],d=s[Tl(c,l,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,a,{move:i}),i?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Lu(e,t){const{line:n,target:r,property:s,color:o,scale:i,clip:a}=t,c=qW(n,r,s);for(const{source:l,target:u,start:d,end:f}of c){const{style:{backgroundColor:h=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,u4(e,i,a,p&&Zd(s,d,f)),e.beginPath();const m=!!n.pathSegment(e,l);let y;if(p){m?e.closePath():Uy(e,r,f,s);const b=!!r.pathSegment(e,u,{move:m,reverse:!0});y=m&&b,y||Uy(e,r,d,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function u4(e,t,n,r){const s=t.chart.chartArea,{property:o,start:i,end:a}=r||{};if(o==="x"||o==="y"){let c,l,u,d;o==="x"?(c=i,l=s.top,u=a,d=s.bottom):(c=s.left,l=i,u=s.right,d=a),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),d=Math.min(d,n.bottom)),e.rect(c,l,u-c,d-l),e.clip()}}function Uy(e,t,n,r){const s=t.interpolate(n,r);s&&e.lineTo(s.x,s.y)}var LS={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,s=[];let o,i,a,c;for(i=0;i<r;++i)o=e.getDatasetMeta(i),a=o.dataset,c=null,a&&a.options&&a instanceof Mi&&(c={visible:e.isDatasetVisible(i),index:i,fill:GW(a,i,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,s.push(c);for(i=0;i<r;++i)c=s[i],!(!c||c.fill===!1)&&(c.fill=ZW(s,i,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let i=s.length-1;i>=0;--i){const a=s[i].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&ju(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;$y(o)&&ju(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!$y(r)||n.drawTime!=="beforeDatasetDraw"||ju(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Wy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},d4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Hy extends Jn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Me(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=rt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Wy(r,o);let l,u;n.font=s.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(i,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(i,s,a,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+o.measureText(p.text).width;(m===0||l[l.length-1]+y+2*a>i)&&(d+=u,l[l.length-(m>0?0:1)]=0,h+=u,f++),c[m]={left:0,top:h,row:f,width:y,height:s},l[l.length-1]+=y+a}),d}_fitCols(t,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=i-t;let d=a,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:_}=f4(r,n,o,y,s);b>0&&h+_+2*a>u&&(d+=f+a,l.push({width:f,height:h}),p+=f+a,m++,f=h=0),c[b]={left:p,top:h,col:m,width:x,height:_},f=Math.max(f,x),h+=_+a}),d+=f,l.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=Bs(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=ht(r,this.left+s,this.right-this.lineWidths[a]);for(const l of n)a!==l.row&&(a=l.row,c=ht(r,this.left+s,this.right-this.lineWidths[a])),l.top+=this.top+t+s,l.left=i.leftForLtr(i.x(c),l.width),c+=l.width+s}else{let a=0,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const l of n)l.col!==a&&(a=l.col,c=ht(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+s,l.left=i.leftForLtr(i.x(l.left),l.width),c+=l.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Cl(t,this),this._draw(),Rl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=t,a=$e.color,c=Bs(t.rtl,this.left,this.width),l=rt(i.font),{padding:u}=i,d=l.size,f=d/2;let h;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=Wy(i,d),b=function(C,k,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=de(E.lineWidth,1);if(s.fillStyle=de(E.fillStyle,a),s.lineCap=de(E.lineCap,"butt"),s.lineDashOffset=de(E.lineDashOffset,0),s.lineJoin=de(E.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=de(E.strokeStyle,a),s.setLineDash(de(E.lineDash,[])),i.usePointStyle){const O={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:P},N=c.xPlus(C,p/2),A=k+f;eS(s,O,N,A,i.pointStyleWidth&&p)}else{const O=k+Math.max((d-m)/2,0),N=c.leftForLtr(C,p),A=Zr(E.borderRadius);s.beginPath(),Object.values(A).some(j=>j!==0)?di(s,{x:N,y:O,w:p,h:m,radius:A}):s.rect(N,O,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},x=function(C,k,E){cs(s,E.text,C,k+y/2,l,{strikethrough:E.hidden,textAlign:c.textAlign(E.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?h={x:ht(o,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:ht(o,this.top+w+u,this.bottom-n[0].height),line:0},cS(this.ctx,t.textDirection);const S=y+u;this.legendItems.forEach((C,k)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const E=s.measureText(C.text).width,P=c.textAlign(C.textAlign||(C.textAlign=i.textAlign)),O=p+f+E;let N=h.x,A=h.y;c.setWidth(this.width),_?k>0&&N+O+u>this.right&&(A=h.y+=S,h.line++,N=h.x=ht(o,this.left+u,this.right-r[h.line])):k>0&&A+S>this.bottom&&(N=h.x=N+n[h.line].width+u,h.line++,A=h.y=ht(o,this.top+w+u,this.bottom-n[h.line].height));const j=c.x(N);if(b(j,A,C),N=kB(P,N+p+f,_?N+O:this.right,t.rtl),x(c.x(N),A,C),_)h.x+=O+u;else if(typeof C.text!="string"){const $=l.lineHeight;h.y+=FS(C,$)+u}else h.y+=S}),lS(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=rt(n.font),s=xt(n.padding);if(!n.display)return;const o=Bs(t.rtl,this.left,this.width),i=this.ctx,a=n.position,c=r.size/2,l=s.top+c;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,d=ht(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=l+ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=ht(a,d,d+f);i.textAlign=o.textAlign(Ch(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,cs(i,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=rt(t.font),r=xt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,o;if(Bn(t,this.left,this.right)&&Bn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Bn(t,s.left,s.left+s.width)&&Bn(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!m4(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=d4(s,r);s&&!o&&Me(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!o&&Me(n.onHover,[t,r,this],this)}else r&&Me(n.onClick,[t,r,this],this)}}function f4(e,t,n,r,s){const o=h4(r,e,t,n),i=p4(s,r,t.lineHeight);return{itemWidth:o,itemHeight:i}}function h4(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),t+n.size/2+r.measureText(s).width}function p4(e,t,n){let r=e;return typeof t.text!="string"&&(r=FS(t,n)),r}function FS(e,t){const n=e.text?e.text.length:0;return t*n}function m4(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var zS={id:"legend",_element:Hy,start(e,t,n){const r=e.legend=new Hy({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r)},stop(e){bt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;bt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=xt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:i&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class jh extends Jn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ze(r.text)?r.text.length:1;this._padding=xt(r.padding);const o=s*rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let c=0,l,u,d;return this.isHorizontal()?(u=ht(a,r,o),d=n+t,l=o-r):(i.position==="left"?(u=r+t,d=ht(a,s,n),c=we*-.5):(u=o-t,d=ht(a,n,s),c=we*.5),l=s-n),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=rt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);cs(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:l,textAlign:Ch(n.align),textBaseline:"middle",translation:[i,a]})}}function g4(e,t){const n=new jh({ctx:e.ctx,options:t,chart:e});bt.configure(e,n,t),bt.addBox(e,n),e.titleBlock=n}var y4={id:"title",_element:jh,start(e,t,n){g4(e,n)},stop(e){const t=e.titleBlock;bt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const xa=new WeakMap;var b4={id:"subtitle",start(e,t,n){const r=new jh({ctx:e.ctx,options:n,chart:e});bt.configure(e,r,n),bt.addBox(e,r),xa.set(e,r)},stop(e){bt.removeBox(e,xa.get(e)),xa.delete(e)},beforeUpdate(e,t,n){const r=xa.get(e);bt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Io={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),s+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,c)=>a+c)/r.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=e.length;o<i;++o){const c=e[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=Vd(t,l);u<s&&(s=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,r=c.y}return{x:n,y:r}}};function _n(e,t){return t&&(ze(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Fn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
104
104
|
`)>-1?e.split(`
|
|
105
|
-
`):e}function b4(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function qy(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,c=rt(t.bodyFont),l=rt(t.titleFont),u=rt(t.footerFont),d=o.length,f=s.length,h=r.length,p=xt(t.padding);let m=p.height,y=0,b=r.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*w+(b-h)*c.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){y=Math.max(y,n.measureText(w).width+x)};return n.save(),n.font=l.string,Ce(e.title,_),n.font=c.string,Ce(e.beforeBody.concat(e.afterBody),_),x=t.displayColors?i+2+t.boxPadding:0,Ce(r,w=>{Ce(w.before,_),Ce(w.lines,_),Ce(w.after,_)}),x=0,n.font=u.string,Ce(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function v4(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function x4(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function _4(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:c}}=e;let l="center";return r==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=i-o/2&&(l="right"),x4(l,e,t,n)&&(l="center"),l}function Ky(e,t,n){const r=n.yAlign||t.yAlign||v4(e,n);return{xAlign:n.xAlign||t.xAlign||_4(e,t,n,r),yAlign:r}}function w4(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function S4(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function Zy(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:c}=n,l=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Zr(i);let p=w4(t,a);const m=S4(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,h)+s),{x:at(p,0,r.width-t.width),y:at(m,0,r.height-t.height)}}function _a(e,t,n){const r=xt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Gy(e){return _n([],Fn(e))}function E4(e,t,n){return Rr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const zS={beforeTitle:In,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:In,beforeBody:In,beforeLabel:In,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:In,afterBody:In,beforeFooter:In,footer:In,afterFooter:In};function Pt(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?zS[t].call(n,r):s}class Xy extends Jn{static positioners=Io;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new hS(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=E4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Pt(r,"beforeTitle",this,t),o=Pt(r,"title",this,t),i=Pt(r,"afterTitle",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}getBeforeBody(t,n){return Gy(Pt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Ce(t,o=>{const i={before:[],lines:[],after:[]},a=Yy(r,o);_n(i.before,Fn(Pt(a,"beforeLabel",this,o))),_n(i.lines,Pt(a,"label",this,o)),_n(i.after,Fn(Pt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return Gy(Pt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Pt(r,"beforeFooter",this,t),o=Pt(r,"footer",this,t),i=Pt(r,"afterFooter",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(b4(this.chart,n[c]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ce(a,u=>{const d=Yy(t.callbacks,u);s.push(Pt(d,"labelColor",this,u)),o.push(Pt(d,"labelPointStyle",this,u)),i.push(Pt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Io[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=qy(this,r),l=Object.assign({},a,c),u=Ky(this.chart,r,l),d=Zy(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Zr(a),{x:f,y:h}=t,{width:p,height:m}=n;let y,b,x,_,w,S;return o==="center"?(w=h+m/2,s==="left"?(y=f,b=y-i,_=w+i,S=w-i):(y=f+p,b=y+i,_=w-i,S=w+i),x=y):(s==="left"?b=f+Math.max(c,u)+i:s==="right"?b=f+p-Math.max(l,d)-i:b=this.caretX,o==="top"?(_=h,w=_-i,y=b-i,x=b+i):(_=h+m,w=_+i,y=b+i,x=b-i),S=_),{x1:y,x2:b,x3:x,y1:_,y2:w,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,c;if(o){const l=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.titleAlign,r),n.textAlign=l.textAlign(r.titleAlign),n.textBaseline="middle",i=rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<o;++c)n.fillText(s[c],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,c+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=rt(o.bodyFont),d=_a(this,"left",o),f=s.x(d),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ud(t,m,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Ud(t,m,y,b)}else{t.lineWidth=xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const m=s.leftForLtr(f,l),y=s.leftForLtr(s.xPlus(f,1),l-2),b=Zr(i.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:m,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),di(t,{x:y,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,l,c),t.strokeRect(m,p,l,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=rt(r.bodyFont);let f=d.lineHeight,h=0;const p=Bs(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+o},y=p.textAlign(i);let b,x,_,w,S,C,k;for(n.textAlign=i,n.textBaseline="middle",n.font=d.string,t.x=_a(this,y,r),n.fillStyle=r.bodyColor,Ce(this.beforeBody,m),h=a&&y!=="right"?i==="center"?l/2+u:l+2+u:0,w=0,C=s.length;w<C;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,Ce(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,w,p,r),f=Math.max(d.lineHeight,c)),S=0,k=_.length;S<k;++S)m(_[S]),f=d.lineHeight;Ce(b.after,m)}h=0,f=d.lineHeight,Ce(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const c=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:c}=t,{width:l,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Zr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,c),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+l-f,c),n.quadraticCurveTo(a+l,c,a+l,c+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,c+d),n.quadraticCurveTo(a,c,a+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Io[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=qy(this,t),c=Object.assign({},i,this._size),l=Ky(n,t,c),u=Zy(t,c,l,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),aS(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),cS(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!kc(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),c=n||!kc(i,o)||a;return c&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Io[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}var $S={id:"tooltip",_element:Xy,positioners:Io,afterInit(e,t,n){n&&(e.tooltip=new Xy({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:zS},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},k4=Object.freeze({__proto__:null,Colors:$W,Decimation:WW,Filler:jS,Legend:FS,SubTitle:y4,Title:g4,Tooltip:$S});const C4=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function R4(e,t,n,r){const s=e.indexOf(t);if(s===-1)return C4(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const P4=(e,t)=>e===null?null:at(Math.round(e),0,t);function Jy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class VS extends hs{static id="category";static defaults={ticks:{callback:Jy}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:R4(r,t,de(n,t),this._addedLabels),P4(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return Jy.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function O4(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=o||1,p=u-1,{min:m,max:y}=t,b=!ye(i),x=!ye(a),_=!ye(l),w=(y-m)/(d+1);let S=qg((y-m)/p/h)*h,C,k,E,P;if(S<1e-14&&!b&&!x)return[{value:m},{value:y}];P=Math.ceil(y/S)-Math.floor(m/S),P>p&&(S=qg(P*S/p/h)*h),ye(c)||(C=Math.pow(10,c),S=Math.ceil(S*C)/C),s==="ticks"?(k=Math.floor(m/S)*S,E=Math.ceil(y/S)*S):(k=m,E=y),b&&x&&o&&yB((a-i)/o,S/1e3)?(P=Math.round(Math.min((a-i)/S,u)),S=(a-i)/P,k=i,E=a):_?(k=b?i:k,E=x?a:E,P=l-1,S=(E-k)/P):(P=(E-k)/S,Bo(P,Math.round(P),S/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Kg(S),Kg(k));C=Math.pow(10,ye(c)?O:c),k=Math.round(k*C)/C,E=Math.round(E*C)/C;let N=0;for(b&&(f&&k!==i?(n.push({value:i}),k<i&&N++,Bo(Math.round((k+N*S)*C)/C,i,Qy(i,w,e))&&N++):k<i&&N++);N<P;++N){const A=Math.round((k+N*S)*C)/C;if(x&&A>a)break;n.push({value:A})}return x&&f&&E!==a?n.length&&Bo(n[n.length-1].value,a,Qy(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||E===a)&&n.push({value:E}),n}function Qy(e,t,{horizontal:n,minRotation:r}){const s=fn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class Ac extends hs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=c=>s=n?s:c,a=c=>o=r?o:c;if(t){const c=Rn(s),l=Rn(o);c<0&&l<0?a(0):c>0&&l>0&&i(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||i(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=O4(s,o);return t.bounds==="ticks"&&W0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class BS extends Ac{static id="linear";static defaults={ticks:{callback:kl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?t:0,this.max=We(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=fn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hi=e=>Math.floor(ar(e)),Dr=(e,t)=>Math.pow(10,hi(e)+t);function eb(e){return e/Math.pow(10,hi(e))===1}function tb(e,t,n){const r=Math.pow(10,n),s=Math.floor(e/r);return Math.ceil(t/r)-s}function T4(e,t){const n=t-e;let r=hi(n);for(;tb(e,t,r)>10;)r++;for(;tb(e,t,r)<10;)r--;return Math.min(r,hi(e))}function M4(e,{min:t,max:n}){t=Ft(e.min,t);const r=[],s=hi(t);let o=T4(t,n),i=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*i)/i,u=Math.floor((t-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),f=Ft(e.min,Math.round((c+u+d*Math.pow(10,o))*i)/i);for(;f<n;)r.push({value:f,major:eb(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,i=o>=0?1:i),f=Math.round((c+u+d*Math.pow(10,o))*i)/i;const h=Ft(e.max,f);return r.push({value:h,major:eb(h),significand:d}),r}class A4 extends hs{static id="logarithmic";static defaults={ticks:{callback:kl.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ac.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return We(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?Math.max(0,t):null,this.max=We(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!We(this._userMin)&&(this.min=t===Dr(this.min,0)?Dr(this.min,-1):Dr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=a=>r=t?r:a,i=a=>s=n?s:a;r===s&&(r<=0?(o(1),i(10)):(o(Dr(r,-1)),i(Dr(s,1)))),r<=0&&o(Dr(s,-1)),s<=0&&i(Dr(r,1)),this.min=r,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=M4(n,this);return t.bounds==="ticks"&&W0(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Oi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ar(t),this._valueRange=ar(this.max)-ar(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ar(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Gd(e){const t=e.ticks;if(t.display&&e.display){const n=xt(t.backdropPadding);return de(t.font&&t.font.size,$e.font.size)+n.height}return 0}function N4(e,t,n){return n=ze(n)?n:[n],{w:DB(e,t.string,n),h:n.length*t.lineHeight}}function nb(e,t,n,r,s){return e===r||e===s?{start:t-n/2,end:t+n/2}:e<r||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function D4(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],s=[],o=e._pointLabels.length,i=e.options.pointLabels,a=i.centerPointLabels?we/o:0;for(let c=0;c<o;c++){const l=i.setContext(e.getPointLabelContext(c));s[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+s[c],a),d=rt(l.font),f=N4(e.ctx,d,e._pointLabels[c]);r[c]=f;const h=mt(e.getIndexAngle(c)+a),p=Math.round(Eh(h)),m=nb(p,u.x,f.w,0,180),y=nb(p,u.y,f.h,90,270);I4(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=F4(e,r,s)}function I4(e,t,n,r,s){const o=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let a=0,c=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(c=(t.t-s.start)/i,e.t=Math.min(e.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/i,e.b=Math.max(e.b,t.b+c))}function j4(e,t,n){const r=e.drawingArea,{extra:s,additionalAngle:o,padding:i,size:a}=n,c=e.getPointPosition(t,r+s+i,o),l=Math.round(Eh(mt(c.angle+He))),u=V4(c.y,a.h,l),d=z4(l),f=$4(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function L4(e,t){if(!t)return!0;const{left:n,top:r,right:s,bottom:o}=e;return!(Wn({x:n,y:r},t)||Wn({x:n,y:o},t)||Wn({x:s,y:r},t)||Wn({x:s,y:o},t))}function F4(e,t,n){const r=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:i,display:a}=o.pointLabels,c={extra:Gd(o)/2,additionalAngle:i?we/s:0};let l;for(let u=0;u<s;u++){c.padding=n[u],c.size=t[u];const d=j4(e,u,c);r.push(d),a==="auto"&&(d.visible=L4(d,l),d.visible&&(l=d))}return r}function z4(e){return e===0||e===180?"center":e<180?"left":"right"}function $4(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function V4(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function B4(e,t,n){const{left:r,top:s,right:o,bottom:i}=n,{backdropColor:a}=t;if(!ye(a)){const c=Zr(t.borderRadius),l=xt(t.backdropPadding);e.fillStyle=a;const u=r-l.left,d=s-l.top,f=o-r+l.width,h=i-s+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:d,w:f,h,radius:c}),e.fill()):e.fillRect(u,d,f,h)}}function U4(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const i=r.setContext(e.getPointLabelContext(s));B4(n,i,o);const a=rt(i.font),{x:c,y:l,textAlign:u}=o;cs(n,e._pointLabels[s],c,l+a.lineHeight/2,a,{color:i.color,textAlign:u,textBaseline:"middle"})}}function US(e,t,n,r){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ae);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let i=1;i<r;i++)o=e.getPointPosition(i,t),s.lineTo(o.x,o.y)}}function W4(e,t,n,r,s){const o=e.ctx,i=t.circular,{color:a,lineWidth:c}=t;!i&&!r||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),US(e,n,i,r),o.closePath(),o.stroke(),o.restore())}function H4(e,t,n){return Rr(e,{label:n,index:t,type:"pointLabel"})}class q4 extends Ac{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xt(Gd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=We(t)&&!isNaN(t)?t:0,this.max=We(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gd(this.options))}generateTickLabels(t){Ac.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const s=Me(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?D4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,s))}getIndexAngle(t){const n=Ae/(this._pointLabels.length||1),r=this.options.startAngle||0;return mt(t*n+fn(r))}getDistanceFromCenterForValue(t){if(ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return H4(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const s=this.getIndexAngle(t)-He+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),US(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,i=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&U4(this,i),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=s.setContext(f),p=o.setContext(f);W4(this,h,c,i,p)}}),r.display){for(t.save(),a=i-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,i;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=r.setContext(this.getContext(c)),u=rt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,i=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const d=xt(l.backdropPadding);t.fillRect(-i/2-d.left,-o-u.size/2-d.top,i+d.width,u.size+d.height)}cs(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ml={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nt=Object.keys(Ml);function rb(e,t){return e-t}function sb(e,t){if(ye(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),We(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(Ys(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ob(e,t,n,r){const s=Nt.length;for(let o=Nt.indexOf(e);o<s-1;++o){const i=Ml[Nt[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return Nt[o]}return Nt[s-1]}function K4(e,t,n,r,s){for(let o=Nt.length-1;o>=Nt.indexOf(n);o--){const i=Nt[o];if(Ml[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return Nt[n?Nt.indexOf(n):0]}function Z4(e){for(let t=Nt.indexOf(e)+1,n=Nt.length;t<n;++t)if(Ml[Nt[t]].common)return Nt[t]}function ib(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=kh(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function G4(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,c;for(a=o;a<=i;a=+s.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function ab(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:G4(e,r,s,n)}class Nc extends hs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new n5._date(t.adapters.date);s.init(n),Vo(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:sb(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function c(l){!i&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!i||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=We(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=We(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=_B(s,o,i);return this._unit=n.unit||(r.autoSkip?ob(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):K4(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Z4(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ab(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=at(n,0,i),r=at(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ob(o.minUnit,n,r,this._getLabelCapacity(n)),a=de(s.ticks.stepSize,1),c=i==="week"?o.isoWeekday:!1,l=Ys(c)||c===!0,u={};let d=n,f,h;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,i),h++)ib(u,f,p);return(f===r||s.bounds==="ticks"||h===1)&&ib(u,f,p),Object.keys(u).sort(rb).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return Me(i,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],f=r[n],h=l&&d&&f&&f.major;return this._adapter.format(t,s||(h?d:u))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=fn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,ab(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(sb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return K0(t.sort(rb))}}function wa(e,t,n){let r=0,s=e.length-1,o,i,a,c;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Un(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:c}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Un(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:c}=e[s]);const l=i-o;return l?a+(c-a)*(t-o)/l:a}class Y4 extends Nc{static id="timeseries";static defaults=Nc.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=wa(n,this.min),this._tableRange=wa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,c,l,u;for(i=0,a=t.length;i<a;++i)l=t[i],l>=n&&l<=r&&s.push(l);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)u=s[i+1],c=s[i-1],l=s[i],Math.round((u+c)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(wa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wa(this._table,r*this._tableRange+this._minPos,!0)}}var X4=Object.freeze({__proto__:null,CategoryScale:VS,LinearScale:BS,LogarithmicScale:A4,RadialLinearScale:q4,TimeScale:Nc,TimeSeriesScale:Y4});const J4=[t5,NW,k4,X4],WS="label";function cb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Q4(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function HS(e,t){e.labels=t}function qS(e,t,n=WS){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function eH(e,t=WS){const n={labels:[],datasets:[]};return HS(n,e.labels),qS(n,e.datasets,t),n}function tH(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,h=T.useRef(null),p=T.useRef(null),m=()=>{h.current&&(p.current=new Ti(h.current,{type:i,data:eH(a,o),options:c&&{...c},plugins:l}),cb(t,p.current))},y=()=>{cb(t,null),p.current&&(p.current.destroy(),p.current=null)};return T.useEffect(()=>{!s&&p.current&&c&&Q4(p.current,c)},[s,c]),T.useEffect(()=>{!s&&p.current&&HS(p.current.config.data,a.labels)},[s,a.labels]),T.useEffect(()=>{!s&&p.current&&a.datasets&&qS(p.current.config.data,a.datasets,o)},[s,a.datasets]),T.useEffect(()=>{p.current&&(s?(y(),setTimeout(m)):p.current.update(d))},[s,c,a.labels,a.datasets,d]),T.useEffect(()=>{p.current&&(y(),setTimeout(m))},[i]),T.useEffect(()=>(m(),()=>y()),[]),g.jsx("canvas",{ref:h,role:"img",height:n,width:r,...f,children:u})}const nH=T.forwardRef(tH);function rH(e,t){return Ti.register(t),T.forwardRef((n,r)=>g.jsx(nH,{...n,ref:r,type:e}))}const sH=rH("line",gS);Ti.register(...J4);Ti.register(VS,BS,OS,Mi,jS,$S,FS,Nc);const oH={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:n,data:r}=e;if(!n)return;r?.datasets?.[0]?.meta?.raw;const s=r?.datasets?.[0]?.status??[];if(!Array.isArray(s)||s.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const o=e.scales.x;for(let i=0;i<s.length;i++){if(s[i]!=="down")continue;const a=o.getPixelForValue(i-.5),c=o.getPixelForValue(i+.5);t.fillRect(a,n.top,c-a,n.bottom-n.top)}t.restore()}};function iH({points:e}){const t=e.map(i=>new Date(i.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),n=e.map(i=>i.status==="down"?null:i.ping),r=e.map(i=>i.status),s={labels:t,datasets:[{label:"Ping (ms)",data:n,tension:.25,pointRadius:0,fill:!0,status:r}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>{const a=i.dataIndex;if(r[a]==="down")return"Down";const l=i.parsed.y;return l!=null?`${l} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return g.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[g.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),g.jsx("div",{className:"h-[220px]",children:g.jsx(sH,{data:s,options:o,plugins:[oH]})})]})}const aH=Cx("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 cH({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lf:"span";return g.jsx(s,{"data-slot":"badge",className:Se(aH({variant:t}),e),...r})}var Al="Checkbox",[lH]=wr(Al),[uH,Lh]=lH(Al);function dH(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Zs({prop:n,defaultProp:s??!1,onChange:c,caller:Al}),[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),_=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:o,setChecked:h,control:p,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:pr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:b};return g.jsx(uH,{scope:t,...w,children:fH(d)?d(w):r})}var KS="CheckboxTrigger",ZS=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:p}=Lh(KS,e),m=Pe(s,u),y=v.useRef(c);return v.useEffect(()=>{const b=o?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[o,d]),g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":pr(c)?"mixed":c,"aria-required":l,"data-state":eE(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:re(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:re(n,b=>{d(x=>pr(x)?!0:!x),p&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});ZS.displayName=KS;var GS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(dH,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(ZS,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(QS,{__scopeCheckbox:n})]})})});GS.displayName=Al;var YS="CheckboxIndicator",XS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=Lh(YS,n);return g.jsx(Xn,{present:r||pr(o.checked)||o.checked===!0,children:g.jsx(be.span,{"data-state":eE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});XS.displayName=YS;var JS="CheckboxBubbleInput",QS=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Lh(JS,e),p=Pe(n,h),m=Ew(o),y=Ux(r);v.useEffect(()=>{const x=f;if(!x)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(m!==o&&S){const k=new Event("click",{bubbles:C});x.indeterminate=pr(o),S.call(x,pr(o)?!1:o),x.dispatchEvent(k)}},[f,m,o,s]);const b=v.useRef(pr(o)?!1:o);return g.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});QS.displayName=JS;function fH(e){return typeof e=="function"}function pr(e){return e==="indeterminate"}function eE(e){return pr(e)?"indeterminate":e?"checked":"unchecked"}function hH({className:e,...t}){return g.jsx(GS,{"data-slot":"checkbox",className:Se("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(XS,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(yx,{className:"size-3.5"})})})}function pH(){const{id:e}=pi({strict:!1}),t=ls(),n=Wv(),{current:r,currentResults:s,loading:o}=Hv(O=>O.monitors),[i,a]=v.useState(!1),[c,l]=v.useState(!1);v.useEffect(()=>{if(!e)return;n(ks(e)),n(Aa(e));const O=setInterval(()=>{n(Aa(e)),n(ks(e))},3e4);return()=>clearInterval(O)},[e,n]);const[u,d]=v.useState(null);if(v.useEffect(()=>{if(!e)return;let O=null;return O=$a(td.apiBase,{path:td.wsPath,transports:["websocket"]}),O.on("monitor:update",N=>{N.monitorId===e&&(d(N),n(Aa(e)),n(ks(e)))}),()=>{O?.disconnect()}},[e,n]),!r)return g.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[g.jsx("div",{children:o?"Loading...":"Monitor not found."}),g.jsx(gt,{variant:"link",onClick:()=>t({to:"/"}),children:"Back to Monitors"})]});const f=(s??[]).slice().reverse(),h=f.slice(-40).map(O=>O.status),p=u??s?.[0]??null,m=p?.status??"unknown",y=m==="up"?"text-emerald-500":m==="down"?"text-red-500":"text-muted-foreground",b=m==="up"?"bg-emerald-500":m==="down"?"bg-red-500":"bg-neutral-400",x=f.map(O=>({t:new Date(O.checkedAt).getTime(),ping:O.pingMs??null,status:O.status??"unknown"})),_=f.filter(O=>O.status==="up"||O.status==="down"),w=_.length?_.filter(O=>O.status==="up").length/_.length*100:0,S=(()=>{const O=f.map(N=>N.pingMs).filter(N=>typeof N=="number");return O.length?Math.round(O.reduce((N,A)=>N+A,0)/O.length):null})();async function C(){if(r)try{await n(dc({id:e,paused:!r.isPaused})).unwrap(),Ee.success(r.isPaused?"Resumed":"Paused")}catch(O){Ee.error(O??"Failed")}}async function k(){try{const N=(await Te.post(`/monitors/${e}/clone`)).data.monitor.id;Ee.success("Cloned (paused)"),n(Na()),t({to:"/monitors/$id",params:{id:N}})}catch(O){Ee.error(O?.response?.data?.detail??"Clone failed")}}async function E(){try{await n(Nf(e)).unwrap(),Ee.success("Deleted"),t({to:"/"})}catch(O){Ee.error(O??"Delete failed")}}const P=async O=>{try{await n(Df({id:r.id,data:O})).unwrap(),Ee.success("Monitor updated"),n(ks(e))}catch(N){throw Ee.error(N||"Failed to update monitor"),N}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",className:"-ml-2 h-8 w-8 text-muted-foreground",onClick:()=>t({to:"/"}),children:g.jsx(gx,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:Se("h-3 w-3 rounded-full",b)}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r.name}),r.isPaused&&g.jsx(cH,{variant:"secondary",children:"Paused"})]})]}),g.jsxs("div",{className:"text-sm text-muted-foreground ml-10",children:[r.type.toUpperCase()," • Interval: ",r.intervalSeconds,"s • ",r.url||r.host||"No target"]}),g.jsx("div",{className:"ml-10 pt-1",children:g.jsxs("div",{className:"flex gap-[2px] items-end h-6",children:[h.map((O,N)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-90 transition-all hover:scale-110 hover:opacity-100",O==="up"?"bg-emerald-500 h-4":O==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-800 h-4"),title:O},N)),h.length===0&&g.jsx("div",{className:"text-xs text-muted-foreground",children:"No data yet"})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs(gt,{variant:"outline",size:"sm",onClick:C,children:[r.isPaused?g.jsx(wx,{className:"mr-2 h-4 w-4"}):g.jsx(xx,{className:"mr-2 h-4 w-4"}),r.isPaused?"Resume":"Pause"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:()=>l(!0),children:[g.jsx(_x,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:k,children:[g.jsx(vx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(gt,{variant:"destructive",size:"sm",onClick:()=>a(!0),children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Status"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:`text-2xl font-bold ${y}`,children:m.toUpperCase()}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p?.message??"—"})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Uptime (24h)"})}),g.jsxs(Ts,{children:[g.jsxs("div",{className:"text-2xl font-bold",children:[w.toFixed(1),"%"]}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last ",s.length," checks"]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Avg Response"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:"text-2xl font-bold",children:S!=null?`${S} ms`:"—"}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Latest: ",p?.pingMs!=null?`${p.pingMs} ms`:"—"]})]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{children:g.jsx(Os,{children:"Response Time History"})}),g.jsx(Ts,{children:g.jsx(iH,{points:x.slice(-120)})})]}),g.jsx(mH,{monitorId:e}),g.jsx(E0,{open:i,onOpenChange:a,monitor:r,onConfirm:E}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:r,onSubmit:P})]})}function mH({monitorId:e}){const{data:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),{data:n,refetch:r}=Go({queryKey:["monitor-notifications",e],queryFn:async()=>(await Te.get(`/notifications/monitor/${e}`)).data.links}),s=new Set((n??[]).map(i=>i.notificationId));async function o(i){await Te.post(`/notifications/monitor/${e}`,{notificationIds:i}),Ee.success("Notifications updated"),await r()}return g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Notifications"}),g.jsx(k0,{children:"Select which notification channels to alert when this monitor goes down."})]}),g.jsx(Ts,{children:!t||t.length===0?g.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications configured. Go to Settings → Notifications to add channels."}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(i=>g.jsxs("div",{className:"flex items-start space-x-2 rounded-md border p-3",children:[g.jsx(hH,{id:i.id,checked:s.has(i.id),onCheckedChange:a=>{const c=new Set(s);a?c.add(i.id):c.delete(i.id),o(Array.from(c))}}),g.jsxs("div",{className:"grid gap-1.5 leading-none",children:[g.jsx(Qw,{htmlFor:i.id,className:"font-medium cursor-pointer",children:i.name}),g.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[200px]",title:i.webhookUrl,children:i.webhookUrl})]})]},i.id))})})]})}function gH(){const e=Go({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Go({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=v.useState(!1),[r,s]=v.useState("My Status Page"),[o,i]=v.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:o,domains:[]}),Ee.success("Created"),e.refetch()}catch(c){Ee.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{className:"font-semibold",children:"Create"}),g.jsxs(Jo,{className:"grid gap-3 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>s(c.target.value)})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Slug"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:o,onChange:c=>i(c.target.value)})]}),g.jsx("div",{className:"flex items-end",children:g.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),g.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>g.jsxs(Yo,{children:[g.jsxs(Xo,{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),g.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),g.jsxs(Jo,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",g.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function yH(){const{data:e,refetch:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=v.useState(""),[s,o]=v.useState("");async function i(){if(!n.trim()||!s.trim()){Ee.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:s}),r(""),o(""),Ee.success("Notification created"),await t()}catch(c){Ee.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),Ee.success("Deleted"),await t()}catch(l){Ee.error(l?.response?.data?.detail??"Delete failed")}}return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),g.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),g.jsxs(Jo,{children:[g.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:"text-sm",children:"Webhook URL"}),g.jsx("input",{value:s,onChange:c=>o(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{children:g.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),g.jsx(Jo,{children:(e??[]).length===0?g.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):g.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),g.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function bH(){return Wc(),gv(),g.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[g.jsx("main",{className:"min-h-screen",children:g.jsx(of,{})}),g.jsx(QC,{richColors:!0})]})}const Sa=jk({component:bH}),vH=()=>{const{token:e}=Wc.getState();if(!e)throw yb({to:"/login"})};function Nl(e=!0){const t=jn({getParentRoute:()=>Sa,id:"workspace",beforeLoad:e?vH:void 0,component:qO}),n=t.addChildren([jn({getParentRoute:()=>t,path:"/",component:W$}),jn({getParentRoute:()=>t,path:"/monitors/new",component:Ng}),jn({getParentRoute:()=>t,path:"/monitors/$id",component:pH}),jn({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Ng}),jn({getParentRoute:()=>t,path:"/status-pages",component:gH}),jn({getParentRoute:()=>t,path:"/settings/notifications",component:yH})]);if(e){const r=jn({getParentRoute:()=>Sa,path:"/login",component:HO});return Sa.addChildren([n,r])}else return Sa.addChildren([n])}af({routeTree:Nl(!0)});const xH=rM({reducer:{monitors:kM}}),_H=new Vb;function wH({apiBase:e,token:t,basePath:n}){T.useEffect(()=>{IP(e,t)},[e,t]);const r=T.useMemo(()=>af({routeTree:Nl(!1),basepath:n||"/"}),[n]);return g.jsx(uT,{store:xH,children:g.jsx(Ub,{client:_H,children:g.jsx(Nb,{router:r})})})}const SH=new Vb;function EH({apiBase:e}){T.useEffect(()=>{e&&(Te.defaults.baseURL=e),jP()},[e]);const t=T.useMemo(()=>af({routeTree:Nl(!1)}),[]);return g.jsx(Ub,{client:SH,children:g.jsx(Nb,{router:t})})}const kH=[{title:"Monitors",url:"/monitors",icon:"Activity"},{title:"Status Pages",url:"/status-pages",icon:"Globe"},{title:"Notifications",url:"/settings/notifications",icon:"Bell"}];exports.PulsePage=wH;exports.PulseWatch=EH;exports.api=Te;exports.createRouteTree=Nl;exports.pulseNavItems=kH;
|
|
105
|
+
`):e}function v4(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function qy(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,c=rt(t.bodyFont),l=rt(t.titleFont),u=rt(t.footerFont),d=o.length,f=s.length,h=r.length,p=xt(t.padding);let m=p.height,y=0,b=r.reduce((w,S)=>w+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*w+(b-h)*c.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){y=Math.max(y,n.measureText(w).width+x)};return n.save(),n.font=l.string,Ce(e.title,_),n.font=c.string,Ce(e.beforeBody.concat(e.afterBody),_),x=t.displayColors?i+2+t.boxPadding:0,Ce(r,w=>{Ce(w.before,_),Ce(w.lines,_),Ce(w.after,_)}),x=0,n.font=u.string,Ce(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function x4(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function _4(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function w4(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:c}}=e;let l="center";return r==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=i-o/2&&(l="right"),_4(l,e,t,n)&&(l="center"),l}function Ky(e,t,n){const r=n.yAlign||t.yAlign||x4(e,n);return{xAlign:n.xAlign||t.xAlign||w4(e,t,n,r),yAlign:r}}function S4(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function E4(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function Zy(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:c}=n,l=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Zr(i);let p=S4(t,a);const m=E4(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,h)+s),{x:at(p,0,r.width-t.width),y:at(m,0,r.height-t.height)}}function _a(e,t,n){const r=xt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Gy(e){return _n([],Fn(e))}function k4(e,t,n){return Rr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $S={beforeTitle:In,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:In,beforeBody:In,beforeLabel:In,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:In,afterBody:In,beforeFooter:In,footer:In,afterFooter:In};function Pt(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?$S[t].call(n,r):s}class Xy extends Jn{static positioners=Io;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new pS(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=k4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Pt(r,"beforeTitle",this,t),o=Pt(r,"title",this,t),i=Pt(r,"afterTitle",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}getBeforeBody(t,n){return Gy(Pt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Ce(t,o=>{const i={before:[],lines:[],after:[]},a=Yy(r,o);_n(i.before,Fn(Pt(a,"beforeLabel",this,o))),_n(i.lines,Pt(a,"label",this,o)),_n(i.after,Fn(Pt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return Gy(Pt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Pt(r,"beforeFooter",this,t),o=Pt(r,"footer",this,t),i=Pt(r,"afterFooter",this,t);let a=[];return a=_n(a,Fn(s)),a=_n(a,Fn(o)),a=_n(a,Fn(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(v4(this.chart,n[c]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ce(a,u=>{const d=Yy(t.callbacks,u);s.push(Pt(d,"labelColor",this,u)),o.push(Pt(d,"labelPointStyle",this,u)),i.push(Pt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Io[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=qy(this,r),l=Object.assign({},a,c),u=Ky(this.chart,r,l),d=Zy(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Zr(a),{x:f,y:h}=t,{width:p,height:m}=n;let y,b,x,_,w,S;return o==="center"?(w=h+m/2,s==="left"?(y=f,b=y-i,_=w+i,S=w-i):(y=f+p,b=y+i,_=w-i,S=w+i),x=y):(s==="left"?b=f+Math.max(c,u)+i:s==="right"?b=f+p-Math.max(l,d)-i:b=this.caretX,o==="top"?(_=h,w=_-i,y=b-i,x=b+i):(_=h+m,w=_+i,y=b+i,x=b-i),S=_),{x1:y,x2:b,x3:x,y1:_,y2:w,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,c;if(o){const l=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.titleAlign,r),n.textAlign=l.textAlign(r.titleAlign),n.textBaseline="middle",i=rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,c=0;c<o;++c)n.fillText(s[c],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,c+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=rt(o.bodyFont),d=_a(this,"left",o),f=s.x(d),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ud(t,m,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Ud(t,m,y,b)}else{t.lineWidth=xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const m=s.leftForLtr(f,l),y=s.leftForLtr(s.xPlus(f,1),l-2),b=Zr(i.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,di(t,{x:m,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),di(t,{x:y,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,l,c),t.strokeRect(m,p,l,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=rt(r.bodyFont);let f=d.lineHeight,h=0;const p=Bs(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+o},y=p.textAlign(i);let b,x,_,w,S,C,k;for(n.textAlign=i,n.textBaseline="middle",n.font=d.string,t.x=_a(this,y,r),n.fillStyle=r.bodyColor,Ce(this.beforeBody,m),h=a&&y!=="right"?i==="center"?l/2+u:l+2+u:0,w=0,C=s.length;w<C;++w){for(b=s[w],x=this.labelTextColors[w],n.fillStyle=x,Ce(b.before,m),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,w,p,r),f=Math.max(d.lineHeight,c)),S=0,k=_.length;S<k;++S)m(_[S]),f=d.lineHeight;Ce(b.after,m)}h=0,f=d.lineHeight,Ce(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const c=Bs(r.rtl,this.x,this.width);for(t.x=_a(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",i=rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:c}=t,{width:l,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Zr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,c),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+l-f,c),n.quadraticCurveTo(a+l,c,a+l,c+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,c+d),n.quadraticCurveTo(a,c,a+d,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Io[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=qy(this,t),c=Object.assign({},i,this._size),l=Ky(n,t,c),u=Zy(t,c,l,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),cS(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),lS(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!kc(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),c=n||!kc(i,o)||a;return c&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Io[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}var VS={id:"tooltip",_element:Xy,positioners:Io,afterInit(e,t,n){n&&(e.tooltip=new Xy({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$S},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},C4=Object.freeze({__proto__:null,Colors:VW,Decimation:HW,Filler:LS,Legend:zS,SubTitle:b4,Title:y4,Tooltip:VS});const R4=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function P4(e,t,n,r){const s=e.indexOf(t);if(s===-1)return R4(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const O4=(e,t)=>e===null?null:at(Math.round(e),0,t);function Jy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class BS extends hs{static id="category";static defaults={ticks:{callback:Jy}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:P4(r,t,de(n,t),this._addedLabels),O4(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return Jy.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function T4(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=o||1,p=u-1,{min:m,max:y}=t,b=!ye(i),x=!ye(a),_=!ye(l),w=(y-m)/(d+1);let S=qg((y-m)/p/h)*h,C,k,E,P;if(S<1e-14&&!b&&!x)return[{value:m},{value:y}];P=Math.ceil(y/S)-Math.floor(m/S),P>p&&(S=qg(P*S/p/h)*h),ye(c)||(C=Math.pow(10,c),S=Math.ceil(S*C)/C),s==="ticks"?(k=Math.floor(m/S)*S,E=Math.ceil(y/S)*S):(k=m,E=y),b&&x&&o&&bB((a-i)/o,S/1e3)?(P=Math.round(Math.min((a-i)/S,u)),S=(a-i)/P,k=i,E=a):_?(k=b?i:k,E=x?a:E,P=l-1,S=(E-k)/P):(P=(E-k)/S,Bo(P,Math.round(P),S/1e3)?P=Math.round(P):P=Math.ceil(P));const O=Math.max(Kg(S),Kg(k));C=Math.pow(10,ye(c)?O:c),k=Math.round(k*C)/C,E=Math.round(E*C)/C;let N=0;for(b&&(f&&k!==i?(n.push({value:i}),k<i&&N++,Bo(Math.round((k+N*S)*C)/C,i,Qy(i,w,e))&&N++):k<i&&N++);N<P;++N){const A=Math.round((k+N*S)*C)/C;if(x&&A>a)break;n.push({value:A})}return x&&f&&E!==a?n.length&&Bo(n[n.length-1].value,a,Qy(a,w,e))?n[n.length-1].value=a:n.push({value:a}):(!x||E===a)&&n.push({value:E}),n}function Qy(e,t,{horizontal:n,minRotation:r}){const s=fn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class Ac extends hs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=c=>s=n?s:c,a=c=>o=r?o:c;if(t){const c=Rn(s),l=Rn(o);c<0&&l<0?a(0):c>0&&l>0&&i(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||i(s-c)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=T4(s,o);return t.bounds==="ticks"&&H0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class US extends Ac{static id="linear";static defaults={ticks:{callback:kl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?t:0,this.max=We(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=fn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hi=e=>Math.floor(ar(e)),Dr=(e,t)=>Math.pow(10,hi(e)+t);function eb(e){return e/Math.pow(10,hi(e))===1}function tb(e,t,n){const r=Math.pow(10,n),s=Math.floor(e/r);return Math.ceil(t/r)-s}function M4(e,t){const n=t-e;let r=hi(n);for(;tb(e,t,r)>10;)r++;for(;tb(e,t,r)<10;)r--;return Math.min(r,hi(e))}function A4(e,{min:t,max:n}){t=Ft(e.min,t);const r=[],s=hi(t);let o=M4(t,n),i=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*i)/i,u=Math.floor((t-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),f=Ft(e.min,Math.round((c+u+d*Math.pow(10,o))*i)/i);for(;f<n;)r.push({value:f,major:eb(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,i=o>=0?1:i),f=Math.round((c+u+d*Math.pow(10,o))*i)/i;const h=Ft(e.max,f);return r.push({value:h,major:eb(h),significand:d}),r}class N4 extends hs{static id="logarithmic";static defaults={ticks:{callback:kl.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ac.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return We(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=We(t)?Math.max(0,t):null,this.max=We(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!We(this._userMin)&&(this.min=t===Dr(this.min,0)?Dr(this.min,-1):Dr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const o=a=>r=t?r:a,i=a=>s=n?s:a;r===s&&(r<=0?(o(1),i(10)):(o(Dr(r,-1)),i(Dr(s,1)))),r<=0&&o(Dr(s,-1)),s<=0&&i(Dr(r,1)),this.min=r,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=A4(n,this);return t.bounds==="ticks"&&H0(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Oi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ar(t),this._valueRange=ar(this.max)-ar(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ar(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Gd(e){const t=e.ticks;if(t.display&&e.display){const n=xt(t.backdropPadding);return de(t.font&&t.font.size,$e.font.size)+n.height}return 0}function D4(e,t,n){return n=ze(n)?n:[n],{w:IB(e,t.string,n),h:n.length*t.lineHeight}}function nb(e,t,n,r,s){return e===r||e===s?{start:t-n/2,end:t+n/2}:e<r||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function I4(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],s=[],o=e._pointLabels.length,i=e.options.pointLabels,a=i.centerPointLabels?we/o:0;for(let c=0;c<o;c++){const l=i.setContext(e.getPointLabelContext(c));s[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+s[c],a),d=rt(l.font),f=D4(e.ctx,d,e._pointLabels[c]);r[c]=f;const h=mt(e.getIndexAngle(c)+a),p=Math.round(Eh(h)),m=nb(p,u.x,f.w,0,180),y=nb(p,u.y,f.h,90,270);j4(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=z4(e,r,s)}function j4(e,t,n,r,s){const o=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));let a=0,c=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(c=(t.t-s.start)/i,e.t=Math.min(e.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/i,e.b=Math.max(e.b,t.b+c))}function L4(e,t,n){const r=e.drawingArea,{extra:s,additionalAngle:o,padding:i,size:a}=n,c=e.getPointPosition(t,r+s+i,o),l=Math.round(Eh(mt(c.angle+He))),u=B4(c.y,a.h,l),d=$4(l),f=V4(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function F4(e,t){if(!t)return!0;const{left:n,top:r,right:s,bottom:o}=e;return!(Wn({x:n,y:r},t)||Wn({x:n,y:o},t)||Wn({x:s,y:r},t)||Wn({x:s,y:o},t))}function z4(e,t,n){const r=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:i,display:a}=o.pointLabels,c={extra:Gd(o)/2,additionalAngle:i?we/s:0};let l;for(let u=0;u<s;u++){c.padding=n[u],c.size=t[u];const d=L4(e,u,c);r.push(d),a==="auto"&&(d.visible=F4(d,l),d.visible&&(l=d))}return r}function $4(e){return e===0||e===180?"center":e<180?"left":"right"}function V4(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function B4(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function U4(e,t,n){const{left:r,top:s,right:o,bottom:i}=n,{backdropColor:a}=t;if(!ye(a)){const c=Zr(t.borderRadius),l=xt(t.backdropPadding);e.fillStyle=a;const u=r-l.left,d=s-l.top,f=o-r+l.width,h=i-s+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),di(e,{x:u,y:d,w:f,h,radius:c}),e.fill()):e.fillRect(u,d,f,h)}}function W4(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const i=r.setContext(e.getPointLabelContext(s));U4(n,i,o);const a=rt(i.font),{x:c,y:l,textAlign:u}=o;cs(n,e._pointLabels[s],c,l+a.lineHeight/2,a,{color:i.color,textAlign:u,textBaseline:"middle"})}}function WS(e,t,n,r){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ae);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let i=1;i<r;i++)o=e.getPointPosition(i,t),s.lineTo(o.x,o.y)}}function H4(e,t,n,r,s){const o=e.ctx,i=t.circular,{color:a,lineWidth:c}=t;!i&&!r||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),WS(e,n,i,r),o.closePath(),o.stroke(),o.restore())}function q4(e,t,n){return Rr(e,{label:n,index:t,type:"pointLabel"})}class K4 extends Ac{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xt(Gd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=We(t)&&!isNaN(t)?t:0,this.max=We(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gd(this.options))}generateTickLabels(t){Ac.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const s=Me(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?I4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,s))}getIndexAngle(t){const n=Ae/(this._pointLabels.length||1),r=this.options.startAngle||0;return mt(t*n+fn(r))}getDistanceFromCenterForValue(t){if(ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return q4(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const s=this.getIndexAngle(t)-He+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),WS(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:s,border:o}=n,i=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&W4(this,i),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=s.setContext(f),p=o.setContext(f);H4(this,h,c,i,p)}}),r.display){for(t.save(),a=i-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let o,i;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=r.setContext(this.getContext(c)),u=rt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,i=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const d=xt(l.backdropPadding);t.fillRect(-i/2-d.left,-o-u.size/2-d.top,i+d.width,u.size+d.height)}cs(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ml={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nt=Object.keys(Ml);function rb(e,t){return e-t}function sb(e,t){if(ye(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),We(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(Ys(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ob(e,t,n,r){const s=Nt.length;for(let o=Nt.indexOf(e);o<s-1;++o){const i=Ml[Nt[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return Nt[o]}return Nt[s-1]}function Z4(e,t,n,r,s){for(let o=Nt.length-1;o>=Nt.indexOf(n);o--){const i=Nt[o];if(Ml[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return Nt[n?Nt.indexOf(n):0]}function G4(e){for(let t=Nt.indexOf(e)+1,n=Nt.length;t<n;++t)if(Ml[Nt[t]].common)return Nt[t]}function ib(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=kh(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function Y4(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,c;for(a=o;a<=i;a=+s.add(a,1,r))c=n[a],c>=0&&(t[c].major=!0);return t}function ab(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:Y4(e,r,s,n)}class Nc extends hs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new r5._date(t.adapters.date);s.init(n),Vo(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:sb(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function c(l){!i&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!i||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=We(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=We(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=wB(s,o,i);return this._unit=n.unit||(r.autoSkip?ob(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Z4(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:G4(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ab(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=at(n,0,i),r=at(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ob(o.minUnit,n,r,this._getLabelCapacity(n)),a=de(s.ticks.stepSize,1),c=i==="week"?o.isoWeekday:!1,l=Ys(c)||c===!0,u={};let d=n,f,h;if(l&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,l?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,i),h++)ib(u,f,p);return(f===r||s.bounds==="ticks"||h===1)&&ib(u,f,p),Object.keys(u).sort(rb).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return Me(i,[t,n,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],f=r[n],h=l&&d&&f&&f.major;return this._adapter.format(t,s||(h?d:u))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=fn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,ab(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(sb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Z0(t.sort(rb))}}function wa(e,t,n){let r=0,s=e.length-1,o,i,a,c;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Un(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:c}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Un(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:c}=e[s]);const l=i-o;return l?a+(c-a)*(t-o)/l:a}class X4 extends Nc{static id="timeseries";static defaults=Nc.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=wa(n,this.min),this._tableRange=wa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,c,l,u;for(i=0,a=t.length;i<a;++i)l=t[i],l>=n&&l<=r&&s.push(l);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)u=s[i+1],c=s[i-1],l=s[i],Math.round((u+c)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(wa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wa(this._table,r*this._tableRange+this._minPos,!0)}}var J4=Object.freeze({__proto__:null,CategoryScale:BS,LinearScale:US,LogarithmicScale:N4,RadialLinearScale:K4,TimeScale:Nc,TimeSeriesScale:X4});const Q4=[n5,DW,C4,J4],HS="label";function cb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function eH(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function qS(e,t){e.labels=t}function KS(e,t,n=HS){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function tH(e,t=HS){const n={labels:[],datasets:[]};return qS(n,e.labels),KS(n,e.datasets,t),n}function nH(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,h=T.useRef(null),p=T.useRef(null),m=()=>{h.current&&(p.current=new Ti(h.current,{type:i,data:tH(a,o),options:c&&{...c},plugins:l}),cb(t,p.current))},y=()=>{cb(t,null),p.current&&(p.current.destroy(),p.current=null)};return T.useEffect(()=>{!s&&p.current&&c&&eH(p.current,c)},[s,c]),T.useEffect(()=>{!s&&p.current&&qS(p.current.config.data,a.labels)},[s,a.labels]),T.useEffect(()=>{!s&&p.current&&a.datasets&&KS(p.current.config.data,a.datasets,o)},[s,a.datasets]),T.useEffect(()=>{p.current&&(s?(y(),setTimeout(m)):p.current.update(d))},[s,c,a.labels,a.datasets,d]),T.useEffect(()=>{p.current&&(y(),setTimeout(m))},[i]),T.useEffect(()=>(m(),()=>y()),[]),g.jsx("canvas",{ref:h,role:"img",height:n,width:r,...f,children:u})}const rH=T.forwardRef(nH);function sH(e,t){return Ti.register(t),T.forwardRef((n,r)=>g.jsx(rH,{...n,ref:r,type:e}))}const oH=sH("line",yS);Ti.register(...Q4);Ti.register(BS,US,TS,Mi,LS,VS,zS,Nc);const iH={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:n,data:r}=e;if(!n)return;r?.datasets?.[0]?.meta?.raw;const s=r?.datasets?.[0]?.status??[];if(!Array.isArray(s)||s.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const o=e.scales.x;for(let i=0;i<s.length;i++){if(s[i]!=="down")continue;const a=o.getPixelForValue(i-.5),c=o.getPixelForValue(i+.5);t.fillRect(a,n.top,c-a,n.bottom-n.top)}t.restore()}};function aH({points:e}){const t=e.map(i=>new Date(i.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),n=e.map(i=>i.status==="down"?null:i.ping),r=e.map(i=>i.status),s={labels:t,datasets:[{label:"Ping (ms)",data:n,tension:.25,pointRadius:0,fill:!0,status:r}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>{const a=i.dataIndex;if(r[a]==="down")return"Down";const l=i.parsed.y;return l!=null?`${l} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return g.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[g.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),g.jsx("div",{className:"h-[220px]",children:g.jsx(oH,{data:s,options:o,plugins:[iH]})})]})}const cH=Rx("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 lH({className:e,variant:t,asChild:n=!1,...r}){const s=n?Lf:"span";return g.jsx(s,{"data-slot":"badge",className:Se(cH({variant:t}),e),...r})}var Al="Checkbox",[uH]=wr(Al),[dH,Lh]=uH(Al);function fH(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,h]=Zs({prop:n,defaultProp:s??!1,onChange:c,caller:Al}),[p,m]=v.useState(null),[y,b]=v.useState(null),x=v.useRef(!1),_=p?!!i||!!p.closest("form"):!0,w={checked:f,disabled:o,setChecked:h,control:p,setControl:m,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:pr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:b};return g.jsx(dH,{scope:t,...w,children:hH(d)?d(w):r})}var ZS="CheckboxTrigger",GS=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:p}=Lh(ZS,e),m=Pe(s,u),y=v.useRef(c);return v.useEffect(()=>{const b=o?.form;if(b){const x=()=>d(y.current);return b.addEventListener("reset",x),()=>b.removeEventListener("reset",x)}},[o,d]),g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":pr(c)?"mixed":c,"aria-required":l,"data-state":tE(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:re(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:re(n,b=>{d(x=>pr(x)?!0:!x),p&&h&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});GS.displayName=ZS;var YS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return g.jsx(fH,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>g.jsxs(g.Fragment,{children:[g.jsx(GS,{...d,ref:t,__scopeCheckbox:n}),f&&g.jsx(eE,{__scopeCheckbox:n})]})})});YS.displayName=Al;var XS="CheckboxIndicator",JS=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=Lh(XS,n);return g.jsx(Xn,{present:r||pr(o.checked)||o.checked===!0,children:g.jsx(be.span,{"data-state":tE(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});JS.displayName=XS;var QS="CheckboxBubbleInput",eE=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:h}=Lh(QS,e),p=Pe(n,h),m=kw(o),y=Wx(r);v.useEffect(()=>{const x=f;if(!x)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(m!==o&&S){const k=new Event("click",{bubbles:C});x.indeterminate=pr(o),S.call(x,pr(o)?!1:o),x.dispatchEvent(k)}},[f,m,o,s]);const b=v.useRef(pr(o)?!1:o);return g.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});eE.displayName=QS;function hH(e){return typeof e=="function"}function pr(e){return e==="indeterminate"}function tE(e){return pr(e)?"indeterminate":e?"checked":"unchecked"}function pH({className:e,...t}){return g.jsx(YS,{"data-slot":"checkbox",className:Se("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(JS,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(bx,{className:"size-3.5"})})})}function mH(){const{id:e}=pi({strict:!1}),t=ls(),n=Hv(),{current:r,currentResults:s,loading:o}=qv(O=>O.monitors),[i,a]=v.useState(!1),[c,l]=v.useState(!1);v.useEffect(()=>{if(!e)return;n(ks(e)),n(Aa(e));const O=setInterval(()=>{n(Aa(e)),n(ks(e))},3e4);return()=>clearInterval(O)},[e,n]);const[u,d]=v.useState(null);if(v.useEffect(()=>{if(!e)return;let O=null;return O=$a(td.apiBase,{path:td.wsPath,transports:["websocket"]}),O.on("monitor:update",N=>{N.monitorId===e&&(d(N),n(Aa(e)),n(ks(e)))}),()=>{O?.disconnect()}},[e,n]),!r)return g.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[g.jsx("div",{children:o?"Loading...":"Monitor not found."}),g.jsx(gt,{variant:"link",onClick:()=>t({to:"/"}),children:"Back to Monitors"})]});const f=(s??[]).slice().reverse(),h=f.slice(-40).map(O=>O.status),p=u??s?.[0]??null,m=p?.status??"unknown",y=m==="up"?"text-emerald-500":m==="down"?"text-red-500":"text-muted-foreground",b=m==="up"?"bg-emerald-500":m==="down"?"bg-red-500":"bg-neutral-400",x=f.map(O=>({t:new Date(O.checkedAt).getTime(),ping:O.pingMs??null,status:O.status??"unknown"})),_=f.filter(O=>O.status==="up"||O.status==="down"),w=_.length?_.filter(O=>O.status==="up").length/_.length*100:0,S=(()=>{const O=f.map(N=>N.pingMs).filter(N=>typeof N=="number");return O.length?Math.round(O.reduce((N,A)=>N+A,0)/O.length):null})();async function C(){if(r)try{await n(dc({id:e,paused:!r.isPaused})).unwrap(),Ee.success(r.isPaused?"Resumed":"Paused")}catch(O){Ee.error(O??"Failed")}}async function k(){try{const N=(await Te.post(`/monitors/${e}/clone`)).data.monitor.id;Ee.success("Cloned (paused)"),n(Na()),t({to:"/monitors/$id",params:{id:N}})}catch(O){Ee.error(O?.response?.data?.detail??"Clone failed")}}async function E(){try{await n(Nf(e)).unwrap(),Ee.success("Deleted"),t({to:"/"})}catch(O){Ee.error(O??"Delete failed")}}const P=async O=>{try{await n(Df({id:r.id,data:O})).unwrap(),Ee.success("Monitor updated"),n(ks(e))}catch(N){throw Ee.error(N||"Failed to update monitor"),N}};return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gt,{variant:"ghost",size:"icon",className:"-ml-2 h-8 w-8 text-muted-foreground",onClick:()=>t({to:"/"}),children:g.jsx(yx,{className:"h-4 w-4"})}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:Se("h-3 w-3 rounded-full",b)}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r.name}),r.isPaused&&g.jsx(lH,{variant:"secondary",children:"Paused"})]})]}),g.jsxs("div",{className:"text-sm text-muted-foreground ml-10",children:[r.type.toUpperCase()," • Interval: ",r.intervalSeconds,"s • ",r.url||r.host||"No target"]}),g.jsx("div",{className:"ml-10 pt-1",children:g.jsxs("div",{className:"flex gap-[2px] items-end h-6",children:[h.map((O,N)=>g.jsx("div",{className:Se("w-1.5 rounded-sm opacity-90 transition-all hover:scale-110 hover:opacity-100",O==="up"?"bg-emerald-500 h-4":O==="down"?"bg-red-500 h-4":"bg-neutral-300 dark:bg-neutral-800 h-4"),title:O},N)),h.length===0&&g.jsx("div",{className:"text-xs text-muted-foreground",children:"No data yet"})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs(gt,{variant:"outline",size:"sm",onClick:C,children:[r.isPaused?g.jsx(Sx,{className:"mr-2 h-4 w-4"}):g.jsx(_x,{className:"mr-2 h-4 w-4"}),r.isPaused?"Resume":"Pause"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:()=>l(!0),children:[g.jsx(wx,{className:"mr-2 h-4 w-4"})," Edit"]}),g.jsxs(gt,{variant:"outline",size:"sm",onClick:k,children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Clone"]}),g.jsxs(gt,{variant:"destructive",size:"sm",onClick:()=>a(!0),children:[g.jsx(jf,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Status"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:`text-2xl font-bold ${y}`,children:m.toUpperCase()}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p?.message??"—"})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Uptime (24h)"})}),g.jsxs(Ts,{children:[g.jsxs("div",{className:"text-2xl font-bold",children:[w.toFixed(1),"%"]}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last ",s.length," checks"]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{className:"pb-2",children:g.jsx(Os,{className:"text-sm font-medium text-muted-foreground",children:"Avg Response"})}),g.jsxs(Ts,{children:[g.jsx("div",{className:"text-2xl font-bold",children:S!=null?`${S} ms`:"—"}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Latest: ",p?.pingMs!=null?`${p.pingMs} ms`:"—"]})]})]})]}),g.jsxs(Rs,{children:[g.jsx(Ps,{children:g.jsx(Os,{children:"Response Time History"})}),g.jsx(Ts,{children:g.jsx(aH,{points:x.slice(-120)})})]}),g.jsx(gH,{monitorId:e}),g.jsx(k0,{open:i,onOpenChange:a,monitor:r,onConfirm:E}),g.jsx(Nd,{open:c,onOpenChange:l,monitor:r,onSubmit:P})]})}function gH({monitorId:e}){const{data:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),{data:n,refetch:r}=Go({queryKey:["monitor-notifications",e],queryFn:async()=>(await Te.get(`/notifications/monitor/${e}`)).data.links}),s=new Set((n??[]).map(i=>i.notificationId));async function o(i){await Te.post(`/notifications/monitor/${e}`,{notificationIds:i}),Ee.success("Notifications updated"),await r()}return g.jsxs(Rs,{children:[g.jsxs(Ps,{children:[g.jsx(Os,{children:"Notifications"}),g.jsx(C0,{children:"Select which notification channels to alert when this monitor goes down."})]}),g.jsx(Ts,{children:!t||t.length===0?g.jsx("div",{className:"text-sm text-muted-foreground",children:"No notifications configured. Go to Settings → Notifications to add channels."}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(i=>g.jsxs("div",{className:"flex items-start space-x-2 rounded-md border p-3",children:[g.jsx(pH,{id:i.id,checked:s.has(i.id),onCheckedChange:a=>{const c=new Set(s);a?c.add(i.id):c.delete(i.id),o(Array.from(c))}}),g.jsxs("div",{className:"grid gap-1.5 leading-none",children:[g.jsx(e0,{htmlFor:i.id,className:"font-medium cursor-pointer",children:i.name}),g.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[200px]",title:i.webhookUrl,children:i.webhookUrl})]})]},i.id))})})]})}function yH(){const e=Go({queryKey:["statusPages"],queryFn:async()=>(await Te.get("/status-pages")).data.statusPages});Go({queryKey:["monitors"],queryFn:async()=>(await Te.get("/monitors")).data.monitors});const[t,n]=v.useState(!1),[r,s]=v.useState("My Status Page"),[o,i]=v.useState("my-status");async function a(){n(!0);try{await Te.post("/status-pages",{name:r,slug:o,domains:[]}),Ee.success("Created"),e.refetch()}catch(c){Ee.error(c?.response?.data?.detail??"Create failed")}finally{n(!1)}}return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),g.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{className:"font-semibold",children:"Create"}),g.jsxs(Jo,{className:"grid gap-3 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:c=>s(c.target.value)})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Slug"}),g.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:o,onChange:c=>i(c.target.value)})]}),g.jsx("div",{className:"flex items-end",children:g.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),g.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(c=>g.jsxs(Yo,{children:[g.jsxs(Xo,{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",c.slug]})]}),g.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${c.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),g.jsxs(Jo,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",g.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},c.id))})]})}function bH(){const{data:e,refetch:t}=Go({queryKey:["notifications"],queryFn:async()=>(await Te.get("/notifications")).data.notifications}),[n,r]=v.useState(""),[s,o]=v.useState("");async function i(){if(!n.trim()||!s.trim()){Ee.error("Name and webhook URL required");return}try{await Te.post("/notifications",{name:n,webhookUrl:s}),r(""),o(""),Ee.success("Notification created"),await t()}catch(c){Ee.error(c?.response?.data?.detail??"Failed")}}async function a(c){if(confirm("Delete this notification?"))try{await Te.delete(`/notifications/${c}`),Ee.success("Deleted"),await t()}catch(l){Ee.error(l?.response?.data?.detail??"Delete failed")}}return g.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[g.jsxs(Yo,{children:[g.jsxs(Xo,{children:[g.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),g.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),g.jsxs(Jo,{children:[g.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:"text-sm",children:"Name"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:"text-sm",children:"Webhook URL"}),g.jsx("input",{value:s,onChange:c=>o(c.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx("button",{onClick:i,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),g.jsxs(Yo,{children:[g.jsx(Xo,{children:g.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),g.jsx(Jo,{children:(e??[]).length===0?g.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):g.jsx("div",{className:"space-y-2",children:(e??[]).map(c=>g.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"font-semibold",children:c.name}),g.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:c.webhookUrl})]}),g.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(c.id),children:"Delete"})]},c.id))})})]})]})}function vH(){return Wc(),vv(),g.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[g.jsx("main",{className:"min-h-screen",children:g.jsx(of,{})}),g.jsx(ER,{richColors:!0})]})}const Sa=Fk({component:vH}),xH=()=>{const{token:e}=Wc.getState();if(!e)throw yb({to:"/login"})};function Nl(e=!0){const t=jn({getParentRoute:()=>Sa,id:"workspace",beforeLoad:e?xH:void 0,component:yT}),n=t.addChildren([jn({getParentRoute:()=>t,path:"/",component:H$}),jn({getParentRoute:()=>t,path:"/monitors/new",component:Ng}),jn({getParentRoute:()=>t,path:"/monitors/$id",component:mH}),jn({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Ng}),jn({getParentRoute:()=>t,path:"/status-pages",component:yH}),jn({getParentRoute:()=>t,path:"/settings/notifications",component:bH})]);if(e){const r=jn({getParentRoute:()=>Sa,path:"/login",component:gT});return Sa.addChildren([n,r])}else return Sa.addChildren([n])}af({routeTree:Nl(!0)});const nE=sM({reducer:{monitors:CM}}),_H=new Vb;function wH({apiBase:e,token:t,basePath:n}){T.useEffect(()=>{iO(e,t)},[e,t]);const r=T.useMemo(()=>af({routeTree:Nl(!1),basepath:n||"/"}),[n]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:_H,children:g.jsx(Nb,{router:r})})})}const SH=new Vb;function EH({apiBase:e}){T.useEffect(()=>{e&&(Te.defaults.baseURL=e),aO()},[e]);const t=T.useMemo(()=>af({routeTree:Nl(!1)}),[]);return g.jsx(Hb,{store:nE,children:g.jsx(Ub,{client:SH,children:g.jsx(Nb,{router:t})})})}const kH=[{title:"Monitors",url:"/monitors",icon:"Activity"},{title:"Status Pages",url:"/status-pages",icon:"Globe"},{title:"Notifications",url:"/settings/notifications",icon:"Bell"}];exports.PulsePage=wH;exports.PulseWatch=EH;exports.api=Te;exports.createRouteTree=Nl;exports.pulseNavItems=kH;
|