meyi-insight-ui-dev 1.0.0
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/InsightPage.d.ts +7 -0
- package/dist/api.d.ts +2 -0
- package/dist/components/common/InsightPagination.d.ts +11 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +21 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/features/alerts/components/AlertDeleteDialog.d.ts +6 -0
- package/dist/features/alerts/components/AlertStatusBadge.d.ts +4 -0
- package/dist/features/alerts/components/InsightAlertCard.d.ts +10 -0
- package/dist/features/alerts/components/InsightAlertTable.d.ts +10 -0
- package/dist/features/alerts/components/InsightSeverityBadge.d.ts +4 -0
- package/dist/features/alerts/components/PromoteDialog.d.ts +8 -0
- package/dist/features/alerts/index.d.ts +5 -0
- package/dist/features/connectors/components/InsightConnectorCard.d.ts +11 -0
- package/dist/features/connectors/components/InsightConnectorDeleteDialog.d.ts +9 -0
- package/dist/features/connectors/components/InsightConnectorForm.d.ts +17 -0
- package/dist/features/connectors/components/WebhookSuccessModal.d.ts +6 -0
- package/dist/features/connectors/index.d.ts +1 -0
- package/dist/features/incidents/components/InsightIncidentCard.d.ts +7 -0
- package/dist/features/incidents/components/InsightIncidentTable.d.ts +8 -0
- package/dist/features/incidents/components/InsightRcaResult.d.ts +9 -0
- package/dist/features/incidents/components/InsightStatusBadge.d.ts +3 -0
- package/dist/features/incidents/detail.d.ts +7 -0
- package/dist/features/incidents/index.d.ts +5 -0
- package/dist/features/projects/components/DeleteDialog.d.ts +7 -0
- package/dist/features/projects/components/InsightProjectCard.d.ts +8 -0
- package/dist/features/projects/components/InsightProjectTable.d.ts +8 -0
- package/dist/features/projects/components/ProjectForm.d.ts +18 -0
- package/dist/features/projects/index.d.ts +1 -0
- package/dist/features/settings/components/SettingsForm.d.ts +13 -0
- package/dist/features/settings/index.d.ts +1 -0
- package/dist/hooks/useInsightPolling.d.ts +18 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +63 -0
- package/dist/index.mjs +17545 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/router.d.ts +1 -0
- package/dist/services/insight.d.ts +128 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +173 -0
- package/package.json +61 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),to=require("react-dom");function wc(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 g=wc(R),Sc=wc(to);var lr={exports:{}},Tn={};var La;function xf(){if(La)return Tn;La=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return Tn.Fragment=t,Tn.jsx=n,Tn.jsxs=n,Tn}var On={};var Fa;function yf(){return Fa||(Fa=1,process.env.NODE_ENV!=="production"&&(function(){function e(k){if(k==null)return null;if(typeof k=="function")return k.$$typeof===M?null:k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case y:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case E:return"Suspense";case C:return"SuspenseList";case T:return"Activity"}if(typeof k=="object")switch(typeof k.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),k.$$typeof){case m:return"Portal";case w:return k.displayName||"Context";case S:return(k._context.displayName||"Context")+".Consumer";case _:var Y=k.render;return k=k.displayName,k||(k=Y.displayName||Y.name||"",k=k!==""?"ForwardRef("+k+")":"ForwardRef"),k;case N:return Y=k.displayName||null,Y!==null?Y:e(k.type)||"Memo";case P:Y=k._payload,k=k._init;try{return e(k(Y))}catch{}}return null}function t(k){return""+k}function n(k){try{t(k);var Y=!1}catch{Y=!0}if(Y){Y=console;var A=Y.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&k[Symbol.toStringTag]||k.constructor.name||"Object";return A.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),t(k)}}function r(k){if(k===y)return"<>";if(typeof k=="object"&&k!==null&&k.$$typeof===P)return"<...>";try{var Y=e(k);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function o(){var k=D.A;return k===null?null:k.getOwner()}function s(){return Error("react-stack-top-frame")}function i(k){if(G.call(k,"key")){var Y=Object.getOwnPropertyDescriptor(k,"key").get;if(Y&&Y.isReactWarning)return!1}return k.key!==void 0}function c(k,Y){function A(){F||(F=!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))}A.isReactWarning=!0,Object.defineProperty(k,"key",{get:A,configurable:!0})}function u(){var k=e(this.type);return W[k]||(W[k]=!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.")),k=this.props.ref,k!==void 0?k:null}function d(k,Y,A,z,B,J){var q=A.ref;return k={$$typeof:x,type:k,key:Y,props:A,_owner:z},(q!==void 0?q:null)!==null?Object.defineProperty(k,"ref",{enumerable:!1,get:u}):Object.defineProperty(k,"ref",{enumerable:!1,value:null}),k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(k,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(k,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.defineProperty(k,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k}function f(k,Y,A,z,B,J){var q=Y.children;if(q!==void 0)if(z)if(I(q)){for(z=0;z<q.length;z++)l(q[z]);Object.freeze&&Object.freeze(q)}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 l(q);if(G.call(Y,"key")){q=e(k);var U=Object.keys(Y).filter(function(he){return he!=="key"});z=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",O[q+z]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,z,q,U,q),O[q+z]=!0)}if(q=null,A!==void 0&&(n(A),q=""+A),i(Y)&&(n(Y.key),q=""+Y.key),"key"in Y){A={};for(var te in Y)te!=="key"&&(A[te]=Y[te])}else A=Y;return q&&c(A,typeof k=="function"?k.displayName||k.name||"Unknown":k),d(k,q,A,o(),B,J)}function l(k){p(k)?k._store&&(k._store.validated=1):typeof k=="object"&&k!==null&&k.$$typeof===P&&(k._payload.status==="fulfilled"?p(k._payload.value)&&k._payload.value._store&&(k._payload.value._store.validated=1):k._store&&(k._store.validated=1))}function p(k){return typeof k=="object"&&k!==null&&k.$$typeof===x}var h=R,x=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),w=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),D=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,I=Array.isArray,$=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(k){return k()}};var F,W={},V=h.react_stack_bottom_frame.bind(h,s)(),L=$(r(s)),O={};On.Fragment=y,On.jsx=function(k,Y,A){var z=1e4>D.recentlyCreatedOwnerStacks++;return f(k,Y,A,!1,z?Error("react-stack-top-frame"):V,z?$(r(k)):L)},On.jsxs=function(k,Y,A){var z=1e4>D.recentlyCreatedOwnerStacks++;return f(k,Y,A,!0,z?Error("react-stack-top-frame"):V,z?$(r(k)):L)}})()),On}var Ba;function vf(){return Ba||(Ba=1,process.env.NODE_ENV==="production"?lr.exports=xf():lr.exports=yf()),lr.exports}var a=vf(),vn=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Do(e){const t=g.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function bf(e,t,n={},r={}){g.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function wf(e){const t=g.useRef(null);return g.useImperativeHandle(e,()=>t.current,[]),t}const Nc=!1;function Un(e){return e[e.length-1]}function Sf(e){return typeof e=="function"}function jt(e,t){return Sf(e)?e(t):e}const Rc=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable;function Cc(e){for(const t in e)if(Rc.call(e,t))return!0;return!1}const Nf=()=>Object.create(null),zt=(e,t)=>Wt(e,t,Nf);function Wt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const o=t,s=Va(e)&&Va(o);if(!s&&!(Rn(e)&&Rn(o)))return o;const i=s?e:za(e);if(!i)return o;const c=s?o:za(o);if(!c)return o;const u=i.length,d=c.length,f=s?new Array(d):n();let l=0;for(let p=0;p<d;p++){const h=s?p:c[p],x=e[h],m=o[h];if(x===m){f[h]=x,(s?p<u:Rc.call(e,h))&&l++;continue}if(x===null||m===null||typeof x!="object"||typeof m!="object"){f[h]=m;continue}const y=Wt(x,m,n,r+1);f[h]=y,y===x&&l++}return u===d&&l===u?e:f}function za(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!$a.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!$a.call(e,o))return!1;r.push(o)}return r}function Rn(e){if(!Ua(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Ua(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ua(e){return Object.prototype.toString.call(e)==="[object Object]"}function Va(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yt(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,o=e.length;r<o;r++)if(!Yt(e[r],t[r],n))return!1;return!0}if(Rn(e)&&Rn(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const i in t)if((!r||t[i]!==void 0)&&!Yt(e[i],t[i],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&o++;let s=0;for(const i in t)if((!r||t[i]!==void 0)&&(s++,s>o||!Yt(e[i],t[i],n)))return!1;return o===s}return!1}function Cn(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function Vn(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Wa(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(t(r))return r}}function Rf(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Ha(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 Rf(t)}const Cf=["http:","https:","mailto:","tel:"];function Dr(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Mn(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=Ha(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+Ha(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function jf(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Ef(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ht(){throw new Error("Invariant failed")}function Wn(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=t.get(s);if(i)return o(i),i.value},set(s,i){if(t.size>=e&&n){const u=n;t.delete(u.key),u.next&&(n=u.next,u.next.prev=void 0),u===r&&(r=void 0)}const c=t.get(s);if(c)c.value=i,o(c);else{const u={key:s,value:i,prev:r};r&&(r.next=u),r=u,n||(n=u),t.set(s,u)}},clear(){t.clear(),n=void 0,r=void 0}}}const Et=4,jc=5;function _f(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 Ec(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const i=_f(s);if(i){const[c,u]=i,d=s.charCodeAt(c+1);if(d===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){const f=c+3,l=u;if(f<l)return n[0]=3,n[1]=t+c,n[2]=t+f,n[3]=t+l,n[4]=t+u+1,n[5]=o,n}}else if(d===36){const f=c+1,l=c+2;return l===u?(n[0]=2,n[1]=t+c,n[2]=t+f,n[3]=t+l,n[4]=t+u+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+l,n[3]=t+u,n[4]=t+u+1,n[5]=o,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function no(e,t,n,r,o,s,i){i?.(n);let c=r;{const u=n.fullPath??n.from,d=u.length,f=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;c<d;){const h=Ec(u,c,t);let x;const m=c,y=h[5];switch(c=y+1,s++,h[0]){case 0:{const v=u.substring(h[2],h[3]);if(f){const b=o.static?.get(v);if(b)x=b;else{o.static??=new Map;const S=Ht(n.fullPath??n.from);S.parent=o,S.depth=s,x=S,o.static.set(v,S)}}else{const b=v.toLowerCase(),S=o.staticInsensitive?.get(b);if(S)x=S;else{o.staticInsensitive??=new Map;const w=Ht(n.fullPath??n.from);w.parent=o,w.depth=s,x=w,o.staticInsensitive.set(b,w)}}break}case 1:{const v=u.substring(m,h[1]),b=u.substring(h[4],y),S=f&&!!(v||b),w=v?S?v:v.toLowerCase():void 0,_=b?S?b:b.toLowerCase():void 0,E=!l&&o.dynamic?.find(C=>!C.parse&&C.caseSensitive===S&&C.prefix===w&&C.suffix===_);if(E)x=E;else{const C=Fo(1,n.fullPath??n.from,S,w,_);x=C,C.depth=s,C.parent=o,o.dynamic??=[],o.dynamic.push(C)}break}case 3:{const v=u.substring(m,h[1]),b=u.substring(h[4],y),S=f&&!!(v||b),w=v?S?v:v.toLowerCase():void 0,_=b?S?b:b.toLowerCase():void 0,E=!l&&o.optional?.find(C=>!C.parse&&C.caseSensitive===S&&C.prefix===w&&C.suffix===_);if(E)x=E;else{const C=Fo(3,n.fullPath??n.from,S,w,_);x=C,C.parent=o,C.depth=s,o.optional??=[],o.optional.push(C)}break}case 2:{const v=u.substring(m,h[1]),b=u.substring(h[4],y),S=f&&!!(v||b),w=v?S?v:v.toLowerCase():void 0,_=b?S?b:b.toLowerCase():void 0,E=Fo(2,n.fullPath??n.from,S,w,_);x=E,E.parent=o,E.depth=s,o.wildcard??=[],o.wildcard.push(E)}}o=x}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const h=Ht(n.fullPath??n.from);h.kind=jc,h.parent=o,s++,h.depth=s,o.pathless??=[],o.pathless.push(h),o=h}const p=(n.path||!n.children)&&!n.isRoot;if(p&&u.endsWith("/")){const h=Ht(n.fullPath??n.from);h.kind=Et,h.parent=o,s++,h.depth=s,o.index=h,o=h}o.parse=l??null,p&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const u of n.children)no(e,t,u,c,o,s,i)}function Lo(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;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 Ct(e){if(e.pathless)for(const t of e.pathless)Ct(t);if(e.static)for(const t of e.static.values())Ct(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ct(t);if(e.dynamic?.length){e.dynamic.sort(Lo);for(const t of e.dynamic)Ct(t)}if(e.optional?.length){e.optional.sort(Lo);for(const t of e.optional)Ct(t)}if(e.wildcard?.length){e.wildcard.sort(Lo);for(const t of e.wildcard)Ct(t)}}function Ht(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Fo(e,t,n,r,o){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,caseSensitive:n,prefix:r,suffix:o}}function kf(e,t){const n=Ht("/"),r=new Uint16Array(6);for(const o of e)no(!1,r,o,1,n,0);Ct(n),t.masksTree=n,t.flatCache=Wn(1e3)}function Pf(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=As(e,t.masksTree);return t.flatCache.set(e,r),r}function Af(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let i=o.singleCache.get(s);return i||(i=Ht("/"),no(t,new Uint16Array(6),{from:e},1,i,0),o.singleCache.set(s,i)),As(r,i,n)}function Tf(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=As(e,t.segmentTree,n)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=kc(s.route)),t.matchCache.set(r,s),s}function Of(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Mf(e,t=!1,n){const r=Ht(e.fullPath),o=new Uint16Array(6),s={},i={};let c=0;return no(t,o,e,1,r,0,u=>{if(n?.(u,c),u.id in s){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Duplicate routes found with id: ${String(u.id)}`);ht()}if(s[u.id]=u,c!==0&&u.path){const d=Of(u.fullPath);(!i[d]||u.fullPath.endsWith("/"))&&(i[d]=u)}c++}),Ct(r),{processedTree:{segmentTree:r,singleCache:Wn(1e3),matchCache:Wn(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function As(e,t,n=!1){const r=e.split("/"),o=Df(e,r,t,n);if(!o)return null;const[s]=_c(e,r,o);return{route:o.node.route,rawParams:s}}function _c(e,t,n){const r=If(n.node);let o=null;const s=Object.create(null);let i=n.extract?.part??0,c=n.extract?.node??0,u=n.extract?.path??0,d=n.extract?.segment??0;for(;c<r.length;i++,c++,u++,d++){const f=r[c];if(f.kind===Et)break;if(f.kind===jc){d--,i--,u--;continue}const l=t[i],p=u;if(l&&(u+=l.length),f.kind===1){o??=n.node.fullPath.split("/");const h=o[d],x=f.prefix?.length??0;if(h.charCodeAt(x)===123){const m=f.suffix?.length??0,y=h.substring(x+2,h.length-m-1),v=l.substring(x,l.length-m);s[y]=decodeURIComponent(v)}else{const m=h.substring(1);s[m]=decodeURIComponent(l)}}else if(f.kind===3){if(n.skipped&1<<c){i--,u=p-1;continue}o??=n.node.fullPath.split("/");const h=o[d],x=f.prefix?.length??0,m=f.suffix?.length??0,y=h.substring(x+3,h.length-m-1),v=f.suffix||f.prefix?l.substring(x,l.length-m):l;v&&(s[y]=decodeURIComponent(v))}else if(f.kind===2){const h=f,x=e.substring(p+(h.prefix?.length??0),e.length-(h.suffix?.length??0)),m=decodeURIComponent(x);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:i,node:c,path:u,segment:d}]}function kc(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function If(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Df(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!Un(t),s=o&&e!=="/",i=t.length-(o?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let u=null,d=null;for(;c.length;){const f=c.pop(),{node:l,index:p,skipped:h,depth:x,statics:m,dynamics:y,optionals:v}=f;let{extract:b,rawParams:S}=f;if(l.kind===2&&l.route&&!ur(d,f))continue;if(l.parse){if(!Ka(e,t,f))continue;S=f.rawParams,b=f.extract}r&&l.route&&l.kind!==Et&&ur(u,f)&&(u=f);const w=p===i;if(w&&(l.route&&(!s||l.kind===Et||l.kind===2)&&ur(d,f)&&(d=f),!l.optional&&!l.wildcard&&!l.index&&!l.pathless))continue;const _=w?void 0:t[p];let E;if(w&&l.index){const C={node:l.index,index:p,skipped:h,depth:x+1,statics:m,dynamics:y,optionals:v,extract:b,rawParams:S};let N=!0;if(l.index.parse&&(Ka(e,t,C)||(N=!1)),N){if(!y&&!v&&!h&&Lf(m,i))return C;ur(d,C)&&(d=C)}}if(l.wildcard)for(let C=l.wildcard.length-1;C>=0;C--){const N=l.wildcard[C],{prefix:P,suffix:T}=N;if(!(P&&(w||!(N.caseSensitive?_:E??=_.toLowerCase()).startsWith(P)))){if(T){if(w)continue;const M=t.slice(p).join("/").slice(-T.length);if((N.caseSensitive?M:M.toLowerCase())!==T)continue}c.push({node:N,index:i,skipped:h,depth:x+1,statics:m,dynamics:y,optionals:v,extract:b,rawParams:S})}}if(l.optional){const C=h|1<<x,N=x+1;for(let P=l.optional.length-1;P>=0;P--){const T=l.optional[P];c.push({node:T,index:p,skipped:C,depth:N,statics:m,dynamics:y,optionals:v,extract:b,rawParams:S})}if(!w)for(let P=l.optional.length-1;P>=0;P--){const T=l.optional[P],{prefix:M,suffix:D}=T;if(M||D){const G=T.caseSensitive?_:E??=_.toLowerCase();if(M&&!G.startsWith(M)||D&&!G.endsWith(D))continue}c.push({node:T,index:p+1,skipped:h,depth:N,statics:m,dynamics:y,optionals:v+dr(i,p),extract:b,rawParams:S})}}if(!w&&l.dynamic&&_)for(let C=l.dynamic.length-1;C>=0;C--){const N=l.dynamic[C],{prefix:P,suffix:T}=N;if(P||T){const M=N.caseSensitive?_:E??=_.toLowerCase();if(P&&!M.startsWith(P)||T&&!M.endsWith(T))continue}c.push({node:N,index:p+1,skipped:h,depth:x+1,statics:m,dynamics:y+dr(i,p),optionals:v,extract:b,rawParams:S})}if(!w&&l.staticInsensitive){const C=l.staticInsensitive.get(E??=_.toLowerCase());C&&c.push({node:C,index:p+1,skipped:h,depth:x+1,statics:m+dr(i,p),dynamics:y,optionals:v,extract:b,rawParams:S})}if(!w&&l.static){const C=l.static.get(_);C&&c.push({node:C,index:p+1,skipped:h,depth:x+1,statics:m+dr(i,p),dynamics:y,optionals:v,extract:b,rawParams:S})}if(l.pathless){const C=x+1;for(let N=l.pathless.length-1;N>=0;N--){const P=l.pathless[N];c.push({node:P,index:p,skipped:h,depth:C,statics:m,dynamics:y,optionals:v,extract:b,rawParams:S})}}}if(d)return d;if(r&&u){let f=u.index;for(let p=0;p<u.index;p++)f+=t[p].length;const l=f===e.length?"/":e.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(l),u}return null}function dr(e,t){return 2**(e-t-1)}function Lf(e,t){return e===2**(t-1)-1}function Ka(e,t,n){let r,o;try{[r,o]=_c(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ur(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===Et)>(e.node.kind===Et)||t.node.kind===Et==(e.node.kind===Et)&&t.depth>e.depth))):!0}function jr(e){return Ts(e.filter(t=>t!==void 0).join("/"))}function Ts(e){return e.replace(/\/{2,}/g,"/")}function Pc(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ft(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Ac(e){return ft(Pc(e))}function Lr(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Ff(e,t,n){return Lr(e,n)===Lr(t,n)}function Bf({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let i;if(r){i=o?t:s?e:e+"\0"+t;const d=r.get(i);if(d)return d}let c;if(s)c=e.split("/");else if(o)c=t.split("/");else{for(c=e.split("/");c.length>1&&Un(c)==="";)c.pop();const d=t.split("/");for(let f=0,l=d.length;f<l;f++){const p=d[f];p===""?f?f===l-1&&c.push(p):c=[p]:p===".."?c.pop():p==="."||c.push(p)}}c.length>1&&(Un(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));const u=Ts(c.join("/"))||"/";return i&&r&&r.set(i,u),u}function $f(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function Bo(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>qa(o,n)).join("/"):qa(r,n)}function Ga({path:e,params:t,decoder:n,...r}){let o=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const i=e.length;let c=0,u,d="";for(;c<i;){const f=c;u=Ec(e,f,u);const l=u[5];if(c=l+1,f===l)continue;const p=u[0];if(p===0){d+="/"+e.substring(f,l);continue}if(p===2){const h=t._splat;s._splat=h,s["*"]=h;const x=e.substring(f,u[1]),m=e.substring(u[4],l);if(!h){o=!0,(x||m)&&(d+="/"+x+m);continue}const y=Bo("_splat",t,n);d+="/"+x+y+m;continue}if(p===1){const h=e.substring(u[2],u[3]);!o&&!(h in t)&&(o=!0),s[h]=t[h];const x=e.substring(f,u[1]),m=e.substring(u[4],l),y=Bo(h,t,n)??"undefined";d+="/"+x+y+m;continue}if(p===3){const h=e.substring(u[2],u[3]),x=t[h];if(x==null)continue;s[h]=x;const m=e.substring(f,u[1]),y=e.substring(u[4],l),v=Bo(h,t,n)??"";d+="/"+m+v+y;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:o}}function qa(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ke(e){return e?.isNotFound===!0}function zf(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const Uf="tsr-scroll-restoration-v1_3";function Vf(){const e=zf();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Rn(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=jt(r,t)||t},persist:()=>{try{e.setItem(Uf,JSON.stringify(t))}catch{process.env.NODE_ENV!=="production"&&console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ya=Vf(),Wf=e=>e.state.__TSR_key||e.href;function Hf(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 fr=!1;const In="window",Xa="data-scroll-restoration-id";function Kf(e,t){if(!Ya)return;const n=Ya;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,fr=!1;const r=e.options.getScrollRestorationKey||Wf,o=new Map;window.history.scrollRestoration="manual";const s=c=>{if(!(fr||!e.isScrollRestoring))if(c.target===document||c.target===window)o.set(In,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const u=c.target;o.set(u,{scrollX:u.scrollLeft||0,scrollY:u.scrollTop||0})}},i=c=>{if(!e.isScrollRestoring||!c||o.size===0||!n)return;const u=n.state[c]||={};for(const[d,f]of o){let l;if(d===In)l=In;else if(d.isConnected){const p=d.getAttribute(Xa);l=p?`[${Xa}="${p}"]`:Hf(d)}l&&(u[l]=f)}};document.addEventListener("scroll",s,!0),e.subscribe("onBeforeLoad",c=>{i(c.fromLocation?r(c.fromLocation):void 0),o.clear()}),window.addEventListener("pagehide",()=>{i(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",c=>{const u=r(c.toLocation),d=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors;if(o.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){fr=!0;try{const l=e.isScrollRestoring?n.state[u]:void 0;let p=!1;if(l)for(const h in l){const x=l[h];if(!Rn(x))continue;const{scrollX:m,scrollY:y}=x;if(!(!Number.isFinite(m)||!Number.isFinite(y))){if(h===In)window.scrollTo({top:y,left:m,behavior:d}),p=!0;else if(h){let v;try{v=document.querySelector(h)}catch{continue}v&&(v.scrollLeft=m,v.scrollTop=y,p=!0)}}}if(!p){const h=e.history.location.hash.slice(1);if(h){const x=window.history.state?.__hashScrollIntoViewOptions??!0;if(x){const m=document.getElementById(h);m&&m.scrollIntoView(x)}}else{const x={top:0,left:0,behavior:d};if(window.scrollTo(x),f)for(const m of f){if(m===In)continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(x)}}}}finally{fr=!1}e.isScrollRestoring&&n.set(l=>(l[u]||={},l))}})}function Gf(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function $o(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function qf(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=$o(o):Array.isArray(s)?s.push($o(o)):n[r]=[s,$o(o)]}return n}const Yf=Jf(JSON.parse),Xf=Zf(JSON.stringify,JSON.parse);function Jf(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=qf(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function Zf(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=Gf(o,r);return s?`?${s}`:""}}const Xt="__root__";function Qf(e){if(e.statusCode=e.statusCode||e.code||307,!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 De(e){return e instanceof Response&&!!e.options}function eh(e){return{input:({url:t})=>{for(const n of e)t=ds(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Tc(e[n],t);return t}}}function th(e){const t=Ac(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{const c=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===o?i.pathname="/":c.startsWith(s)&&(i.pathname=i.pathname.slice(n.length)),i},output:({url:i})=>(i.pathname=jr(["/",t,i.pathname]),i)}}function ds(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 Tc(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 nh(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:o,init:s}=t,i=new Map,c=new Map,u=new Map,d=n(e.status),f=n(e.loadedAt),l=n(e.isLoading),p=n(e.isTransitioning),h=n(e.location),x=n(e.resolvedLocation),m=n(e.statusCode),y=n(e.redirect),v=n([]),b=n([]),S=n([]),w=r(()=>zo(i,v.get())),_=r(()=>zo(c,b.get())),E=r(()=>zo(u,S.get())),C=r(()=>v.get()[0]),N=r(()=>v.get().some(W=>i.get(W)?.get().status==="pending")),P=r(()=>({locationHref:h.get().href,resolvedLocationHref:x.get()?.href,status:d.get()})),T=r(()=>({status:d.get(),loadedAt:f.get(),isLoading:l.get(),isTransitioning:p.get(),matches:w.get(),location:h.get(),resolvedLocation:x.get(),statusCode:m.get(),redirect:y.get()})),M=Wn(64);function D(W){let V=M.get(W);return V||(V=r(()=>{const L=v.get();for(const O of L){const k=i.get(O);if(k&&k.routeId===W)return k.get()}}),M.set(W,V)),V}const G={status:d,loadedAt:f,isLoading:l,isTransitioning:p,location:h,resolvedLocation:x,statusCode:m,redirect:y,matchesId:v,pendingIds:b,cachedIds:S,matches:w,pendingMatches:_,cachedMatches:E,firstId:C,hasPending:N,matchRouteDeps:P,matchStores:i,pendingMatchStores:c,cachedMatchStores:u,__store:T,getRouteMatchStore:D,setMatches:I,setPending:$,setCached:F};I(e.matches),s?.(G);function I(W){Uo(W,i,v,n,o)}function $(W){Uo(W,c,b,n,o)}function F(W){Uo(W,u,S,n,o)}return G}function zo(e,t){const n=[];for(const r of t){const o=e.get(r);o&&n.push(o.get())}return n}function Uo(e,t,n,r,o){const s=e.map(c=>c.id),i=new Set(s);o(()=>{for(const c of t.keys())i.has(c)||t.delete(c);for(const c of e){const u=t.get(c.id);if(!u){const d=r(c);d.routeId=c.routeId,t.set(c.id,d);continue}u.routeId=c.routeId,u.get()!==c&&u.set(c)}Ef(n.get(),s)||n.set(s)})}const us=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},rh=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),ro=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Jt=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const i=e.matches[s];if(!i)continue;const c=e.router.getMatch(i.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},Ja=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(i=>i.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(i=>i.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let i=s;i>=0;i--){const c=e.matches[i];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return i}return n?s:o},_t=(e,t,n)=>{if(!(!De(n)&&!ke(n)))throw De(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:De(n)?"redirected":ke(n)?"notFound":r.status==="pending"?"success":r.status,context:Jt(e,t.index),isFetching:!1,error:n})),ke(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),De(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Oc=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Za=(e,t,n)=>{const r=Jt(e,n);e.updateMatch(t,o=>({...o,context:r}))},Dn=(e,t,n,r)=>{const{id:o,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,_t(e,e.router.getMatch(o),n);try{i.options.onError?.(n)}catch(c){n=c,_t(e,e.router.getMatch(o),n)}e.updateMatch(o,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!De(n)&&!ke(n)&&(e.serialError??=n)},Mc=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!ro(e,t)&&(n.options.loader||n.options.beforeLoad||Dc(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{us(e)},o);r._nonReactive.pendingTimeout=s}},oh=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Mc(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&_t(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},sh=(e,t,n,r)=>{const o=e.router.getMatch(t);let s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Cn(()=>{s?.resolve(),s=void 0});const{paramsError:i,searchError:c}=o;i&&Dn(e,n,i,"PARSE_PARAMS"),c&&Dn(e,n,c,"VALIDATE_SEARCH"),Mc(e,t,r,o);const u=new AbortController;let d=!1;const f=()=>{d||(d=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:u})))},l=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,w=>({...w,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),l()});return}o._nonReactive.beforeLoadPromise=Cn();const p={...Jt(e,n,!1),...o.__routeContext},{search:h,params:x,cause:m}=o,y=ro(e,t),v={search:h,abortController:u,params:x,preload:y,context:p,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":m,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=w=>{if(w===void 0){e.router.batch(()=>{f(),l()});return}(De(w)||ke(w))&&(f(),Dn(e,n,w,"BEFORE_LOAD")),e.router.batch(()=>{f(),e.updateMatch(t,_=>({..._,__beforeLoadContext:w})),l()})};let S;try{if(S=r.options.beforeLoad(v),Vn(S))return f(),S.catch(w=>{Dn(e,n,w,"BEFORE_LOAD")}).then(b)}catch(w){f(),Dn(e,n,w,"BEFORE_LOAD")}b(S)},ah=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>c(),i=()=>sh(e,n,t,o),c=()=>{if(Oc(e,n))return;const u=oh(e,n,o);return Vn(u)?u.then(i):i()};return s()},ih=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,i,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:i,styles:s?.styles}))},Ic=(e,t,n,r,o)=>{const s=t[r-1],{params:i,loaderDeps:c,abortController:u,cause:d}=e.router.getMatch(n),f=Jt(e,r),l=ro(e,n);return{params:i,deps:c,preload:!!l,parentMatchPromise:s,abortController:u,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:l?"preload":d,route:o,...e.router.options.additionalContext}},Qa=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(Nc??e.router.isServer)||s.ssr===!0)&&Hn(o);const i=o.options.loader,c=typeof i=="function"?i:i?.handler,u=c?.(Ic(e,t,n,r,o)),d=!!c&&Vn(u);if((d||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,l=>({...l,isFetching:"loader"})),c){const l=d?await u:u;_t(e,e.router.getMatch(n),l),l!==void 0&&e.updateMatch(n,p=>({...p,loaderData:l}))}o._lazyPromise&&await o._lazyPromise;const f=s._nonReactive.minPendingPromise;f&&await f,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,l=>({...l,error:void 0,context:Jt(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let c=i;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:Jt(e,r)}));return}const u=s._nonReactive.minPendingPromise;u&&await u,ke(i)&&await o.options.notFoundComponent?.preload?.(),_t(e,e.router.getMatch(n),i);try{o.options.onError?.(i)}catch(d){c=d,_t(e,e.router.getMatch(n),d)}!De(c)&&!ke(c)&&await Hn(o,["errorComponent"]),e.updateMatch(n,d=>({...d,error:c,context:Jt(e,r),status:"error",isFetching:!1}))}}catch(s){const i=e.router.getMatch(n);i&&(i._nonReactive.loaderPromise=void 0),_t(e,i,s)}},ch=async(e,t,n)=>{async function r(h,x,m,y,v){const b=Date.now()-x.updatedAt,S=h?v.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??e.router.options.defaultStaleTime??0,w=v.options.shouldReload,_=typeof w=="function"?w(Ic(e,t,o,n,v)):w,{status:E,invalid:C}=y,N=b>=S&&(!!e.forceStaleReload||y.cause==="enter"||m!==void 0&&m!==y.id);i=E==="success"&&(C||(_??N)),h&&v.options.preload===!1||(i&&!e.sync&&f?(c=!0,(async()=>{try{await Qa(e,t,o,n,v);const P=e.router.getMatch(o);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){De(P)&&await e.router.navigate(P.options)}})()):E!=="success"||i?await Qa(e,t,o,n,v):Za(e,o,n))}const{id:o,routeId:s}=e.matches[n];let i=!1,c=!1;const u=e.router.looseRoutesById[s],d=u.options.loader,f=((typeof d=="function"?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Oc(e,o)){if(!e.router.getMatch(o))return e.matches[n];Za(e,o,n)}else{const h=e.router.getMatch(o),x=e.router.stores.matchesId.get()[n],m=(x&&e.router.stores.matchStores.get(x)||null)?.routeId===s?x:e.router.stores.matches.get().find(v=>v.routeId===s)?.id,y=ro(e,o);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload&&f)return h;await h._nonReactive.loaderPromise;const v=e.router.getMatch(o),b=v._nonReactive.error||v.error;b&&_t(e,v,b),v.status==="pending"&&await r(y,h,m,v,u)}else{const v=y&&!e.router.stores.matchStores.has(o),b=e.router.getMatch(o);b._nonReactive.loaderPromise=Cn(),v!==b.preload&&e.updateMatch(o,S=>({...S,preload:v})),await r(y,h,m,b,u)}}const l=e.router.getMatch(o);c||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve(),l._nonReactive.loadPromise=void 0),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,c||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const p=c?l.isFetching:!1;return p!==l.isFetching||l.invalid!==!1?(e.updateMatch(o,h=>({...h,isFetching:p,invalid:!1})),e.router.getMatch(o)):l};async function ei(e){const t=e,n=[];rh(t.router)&&us(t);let r;for(let p=0;p<t.matches.length;p++){try{const h=ah(t,p);Vn(h)&&await h}catch(h){if(De(h))throw h;if(ke(h))r=h;else if(!t.preload)throw h;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Ja(t,r):void 0,i=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let c,u;for(let p=0;p<i;p++)n.push(ch(t,n,p));try{await Promise.all(n)}catch{const p=await Promise.allSettled(n);for(const h of p){if(h.status!=="rejected")continue;const x=h.reason;if(De(x))throw x;ke(x)?c??=x:u??=x}if(u!==void 0)throw u}const d=c??(r&&!t.preload?r:void 0);let f=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!d&&r&&t.preload)return t.matches;if(d){const p=Ja(t,d);if(p===void 0){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Could not find match for notFound boundary");ht()}const h=t.matches[p],x=t.router.looseRoutesById[h.routeId],m=t.router.options?.defaultNotFoundComponent;!x.options.notFoundComponent&&m&&(x.options.notFoundComponent=m),d.routeId=h.routeId;const y=h.routeId===t.router.routeTree.id;t.updateMatch(h.id,v=>({...v,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),f=p,await Hn(x,["notFoundComponent"])}else if(!t.preload){const p=t.matches[0];p.globalNotFound||t.router.getMatch(p.id)?.globalNotFound&&t.updateMatch(p.id,h=>({...h,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const p=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Hn(p,["errorComponent"])}for(let p=0;p<=f;p++){const{id:h,routeId:x}=t.matches[p],m=t.router.looseRoutesById[x];try{const y=ih(t,h,m);if(y){const v=await y;t.updateMatch(h,b=>({...b,...v}))}}catch(y){console.error(`Error executing head for route ${x}:`,y)}}const l=us(t);if(Vn(l)&&await l,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function ti(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Hn(e,t=Er){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:o,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Er?(()=>{if(e._componentsPromise===void 0){const r=ti(e,Er);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ti(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Dc(e){for(const t of Er)if(e.options[t]?.preload)return!0;return!1}const Er=["component","errorComponent","pendingComponent","notFoundComponent"];var kt="__TSR_index",ni="popstate",ri="beforeunload";function lh(e){let t=e.getLocation();const n=new Set,r=i=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:i}))},o=i=>{e.notifyOnIndexChange??!0?r(i):t=e.getLocation()},s=async({task:i,navigateOpts:c,...u})=>{if(c?.ignoreBlocker??!1){i();return}const d=e.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const l of d){const p=Fr(u.path,u.state);if(await l.blockerFn({currentLocation:t,nextLocation:p,action:u.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,c,u)=>{const d=t.state[kt];c=oi(d+1,c),s({task:()=>{e.pushState(i,c),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:i,state:c})},replace:(i,c,u)=>{const d=t.state[kt];c=oi(d,c),s({task:()=>{e.replaceState(i,c),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:i,state:c})},go:(i,c)=>{s({task:()=>{e.go(i),o({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{s({task:()=>{e.back(i?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{e.forward(i?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>t.state[kt]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,i]),()=>{const u=e.getBlockers?.()??[];e.setBlockers?.(u.filter(d=>d!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function oi(e,t){t||(t={});const n=Os();return{...t,key:n,__TSR_key:n,[kt]:e}}function dh(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,i=N=>o=N,c=(N=>N),u=(()=>Fr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const N=Os();t.history.replaceState({[kt]:0,key:N,__TSR_key:N},"")}let d=u(),f,l=!1,p=!1,h=!1,x=!1;const m=()=>d;let y,v;const b=()=>{y&&(C._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),C._ignoreSubscribers=!1,y=void 0,v=void 0,f=void 0)},S=(N,P,T)=>{const M=c(P);v||(f=d),d=Fr(P,T),y={href:M,state:T,isPush:y?.isPush||N==="push"},v||(v=Promise.resolve().then(()=>b()))},w=N=>{d=u(),C.notify({type:N})},_=async()=>{if(p){p=!1;return}const N=u(),P=N.state[kt]-d.state[kt],T=P===1,M=P===-1,D=!T&&!M||l;l=!1;const G=D?"GO":M?"BACK":"FORWARD",I=D?{type:"GO",index:P}:{type:M?"BACK":"FORWARD"};if(h)h=!1;else{const $=s();if(typeof document<"u"&&$.length){for(const F of $)if(await F.blockerFn({currentLocation:d,nextLocation:N,action:G})){p=!0,t.history.go(1),C.notify(I);return}}}d=u(),C.notify(I)},E=N=>{if(x){x=!1;return}let P=!1;const T=s();if(typeof document<"u"&&T.length)for(const M of T){const D=M.enableBeforeUnload??!0;if(D===!0){P=!0;break}if(typeof D=="function"&&D()===!0){P=!0;break}}if(P)return N.preventDefault(),N.returnValue=""},C=lh({getLocation:m,getLength:()=>t.history.length,pushState:(N,P)=>S("push",N,P),replaceState:(N,P)=>S("replace",N,P),back:N=>(N&&(h=!0),x=!0,t.history.back()),forward:N=>{N&&(h=!0),x=!0,t.history.forward()},go:N=>{l=!0,t.history.go(N)},createHref:N=>c(N),flush:b,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ri,E,{capture:!0}),t.removeEventListener(ni,_)},onBlocked:()=>{f&&d!==f&&(d=f)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return t.addEventListener(ri,E,{capture:!0}),t.addEventListener(ni,_),t.history.pushState=function(...N){const P=n.apply(t.history,N);return C._ignoreSubscribers||w("PUSH"),P},t.history.replaceState=function(...N){const P=r.apply(t.history,N);return C._ignoreSubscribers||w("REPLACE"),P},C}function uh(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Fr(e,t){const n=uh(e),r=n.indexOf("#"),o=n.indexOf("?"),s=Os();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[kt]:0,key:s,__TSR_key:s}}}function Os(){return(Math.random()+1).toString(36).substring(7)}function bn(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var fh=class{constructor(e,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.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{process.env.NODE_ENV!=="production"&&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,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=$f(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=dh()),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=Wn(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=nh(ph(this.latestLocation),f),Kf(this)}let c=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(s||o!==u||i!==d){this.basepath=u;const f=[],l=Ac(u);l&&l!=="/"&&f.push(th({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:eh(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(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=Mf(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&kf(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:u,search:d,hash:f,href:l,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const v=this.options.parseSearch(d),b=this.options.stringifySearch(v);return{href:u+b+f,publicHref:u+b+f,pathname:Mn(u).path,external:!1,searchStr:b,search:zt(r?.search,v),hash:Mn(f.slice(1)).path,state:Wt(r?.state,p)}}const h=new URL(l,this.origin),x=ds(this.rewrite,h),m=this.options.parseSearch(x.search),y=this.options.stringifySearch(m);return x.search=y,{href:x.href.replace(x.origin,""),publicHref:l,pathname:Mn(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:y,search:zt(r?.search,m),hash:Mn(x.hash.slice(1)).path,state:Wt(r?.state,p)}},s=o(n),{__tempLocation:i,__tempKey:c}=s.state;if(i&&(!c||c===this.tempLocationKey)){const u=o(i);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Bf({base:n,to:r.includes("//")?Ts(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>mh({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=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(s={})=>{const i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(i);if(s.from&&process.env.NODE_ENV!=="production"&&s._isNavigate){const M=this.getMatchedRoutes(s.from).matchedRoutes,D=Wa(c.matchedRoutes,I=>ai(I.fullPath,s.from)),G=Wa(M,I=>ai(I.fullPath,c.fullPath));!D&&!G&&console.warn(`Could not find match for from: ${s.from}`)}const u=s.unsafeRelative==="path"?i.pathname:s.from??c.fullPath,d=s.to?`${s.to}`:void 0,f=c.search,l=Object.assign(Object.create(null),c.params),p=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(u,"."),h=d?this.resolvePathWithBase(p,d):p,x=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?l:Object.assign(l,jt(s.params,l)),m=this.routesByPath[ft(h)];let y;if(m)y=this.getRouteBranch(m);else if(h.includes("$"))y=[];else{const M=this.getMatchedRoutes(h);y=M.matchedRoutes,this.options.notFoundRoute&&(!M.foundRoute||M.foundRoute.path!=="/"&&M.routeParams["**"])&&(y=[...y,this.options.notFoundRoute])}if(y.length&&Cc(x))for(const M of y){const D=M.options.params?.stringify??M.options.stringifyParams;if(D)try{Object.assign(x,D(x))}catch{}}const v=n.leaveParams?h:Mn(Ga({path:h,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(process.env.NODE_ENV!=="production"&&m&&!n.leaveParams)try{this.getMatchedRoutes(v).foundRoute?.id!==m.id&&console.warn(`Generated path "${v}" for route "${m.id}" did not match the same route after params.stringify.`)}catch{}let b=f;if(n._includeValidateSearch&&this.options.search?.strict){const M={};y.forEach(D=>{if(D.options.validateSearch)try{Object.assign(M,_r(D.options.validateSearch,{...M,...b}))}catch{}}),b=M}b=gh({search:b,dest:s,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),b=zt(f,b);const S=this.options.stringifySearch(b),w=s.hash===!0?i.hash:s.hash?jt(s.hash,i.hash):void 0,_=w?`#${w}`:"";let E=s.state===!0?i.state:s.state?jt(s.state,i.state):{};E=Wt(i.state,E);const C=`${v}${S}${_}`;let N,P,T=!1;if(this.rewrite){const M=new URL(C,this.origin),D=Tc(this.rewrite,M);N=M.href.replace(M.origin,""),D.origin!==this.origin?(P=D.href,T=!0):P=D.pathname+D.search+D.hash}else N=jf(C),P=N;return{publicHref:P,href:N,pathname:v,search:b,searchStr:S,state:E,hash:w??"",external:T,unmaskOnReload:s.unmaskOnReload}},o=(s={},i)=>{const c=r(s);let u=i?r(i):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=Pf(c.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:l,params:p,...h}=f.route,x=p===!1||p===null?Object.create(null):(p??!0)===!0?d:Object.assign(d,jt(p,d));i={from:n.from,...h,params:x},u=r(i)}}}return u&&(c.maskedLocation=u),c};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const s=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{o.state[f]=this.latestLocation.state[f]});const d=Yt(o.state,this.latestLocation.state);return u.forEach(f=>{delete o.state[f]}),d},i=ft(this.latestLocation.href)===ft(o.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=Cn(()=>{c?.resolve(),c=void 0}),i&&s())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=o;u&&(f={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:i,href:c,...u}={})=>{if(c){const l=this.history.location.state.__TSR_index,p=Fr(c,{__TSR_index:n?l:l+1}),h=new URL(p.pathname,this.origin);u.to=ds(this.rewrite,h).pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...i})=>{let c=!1;if(o)try{new URL(`${o}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(n!==void 0||!o){const d=this.buildLocation({to:n,...i});o=o??d.publicHref,s=s??d.publicHref}const u=!c&&s?s:o;if(Dr(u,this.protocolAllowlist))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${u}`),Promise.resolve();if(!i.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...i,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(o=>!n.some(s=>s.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,o,s;const i=this.stores.resolvedLocation.get()??this.stores.location.get();for(s=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=bn(d,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await ei({router:this,sync:n?.sync,forceStaleReload:i.href===d.href,matches:this.stores.pendingMatches.get(),location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let l=null,p=null,h=null,x=null;this.batch(()=>{const m=this.stores.pendingMatches.get(),y=m.length,v=this.stores.matches.get();l=y?v.filter(w=>!this.stores.pendingMatchStores.has(w.id)):null;const b=new Set;for(const w of this.stores.pendingMatchStores.values())w.routeId&&b.add(w.routeId);const S=new Set;for(const w of this.stores.matchStores.values())w.routeId&&S.add(w.routeId);p=y?v.filter(w=>!b.has(w.routeId)):null,h=y?m.filter(w=>!S.has(w.routeId)):null,x=y?m.filter(w=>S.has(w.routeId)):v,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),y&&(this.stores.setMatches(m),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...l.filter(w=>w.status!=="error"&&w.status!=="notFound"&&w.status!=="redirected")]),this.clearExpiredCache())});for(const[m,y]of[[p,"onLeave"],[h,"onEnter"],[x,"onStay"]])if(m)for(const v of m)this.looseRoutesById[v.routeId].options[y]?.(v)})})}})}catch(d){De(d)?(r=d,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):ke(d)&&(o=d);const f=r?r.status:o?404:this.stores.matches.get().some(l=>l.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(u=>u.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},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 o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(bn(s,i)):r.types;if(c===!1){n();return}o={update:n,types:c}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(n);if(o){o.set(r);return}const s=this.stores.matchStores.get(n);if(s){s.set(r);return}const i=this.stores.cachedMatchStores.get(n);if(i){const c=r(i.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(u=>u.filter(d=>d!==n)):i.set(c)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().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 o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&Dr(n.options.href,this.protocolAllowlist))throw new Error(process.env.NODE_ENV!=="production"?`Redirect blocked: unsafe protocol in href "${n.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`:"Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!r(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=o=>{const s=this.looseRoutesById[o.routeId];if(!s.options.loader)return!0;const i=(o.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:n-o.updatedAt>=i};this.clearCache({filter:r})},this.loadRouteChunk=Hn,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...s,...this.stores.cachedIds.get()]),c=o.filter(u=>!i.has(u.id));if(c.length){const u=this.stores.cachedMatches.get();this.stores.setCached([...u,...c])}try{return o=await ei({router:this,matches:o,location:r,preload:!0,updateMatch:(u,d)=>{s.has(u)?o=o.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)}}),o}catch(u){if(De(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});ke(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const i=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=Af(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!c||n.params&&!Yt(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Yt(i.search,s.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Xf,parseSearch:e.parseSearch??Yf,protocolAllowlist:e.protocolAllowlist??Cf}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=kc(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:o}=n;let{matchedRoutes:s}=n,i=!1;(r?r.path!=="/"&&o["**"]:ft(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:i=!0);const c=i?yh(this.options.notFoundMode,s):void 0,u=new Array(s.length),d=new Map;for(const f of this.stores.matchStores.values())f.routeId&&d.set(f.routeId,f.get());for(let f=0;f<s.length;f++){const l=s[f],p=u[f-1];let h,x,m;{const D=p?.search??e.search,G=p?._strictSearch??void 0;try{const I=_r(l.options.validateSearch,{...D})??void 0;h={...D,...I},x={...G,...I},m=void 0}catch(I){let $=I;if(I instanceof Br||($=new Br(I.message,{cause:I})),t?.throwOnError)throw $;h=D,x={},m=$}}const y=l.options.loaderDeps?.({search:h})??"",v=y?JSON.stringify(y):"",{interpolatedPath:b,usedParams:S}=Ga({path:l.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),w=l.id+b+v,_=this.getMatch(w),E=d.get(l.id),C=_?._strictParams??S;let N;if(!_)try{ii(l,C)}catch(D){if(ke(D)||De(D)?N=D:N=new hh(D.message,{cause:D}),t?.throwOnError)throw N}Object.assign(o,C);const P=E?"stay":"enter";let T;if(_)T={..._,cause:P,params:E?.params??o,_strictParams:C,search:zt(E?E.search:_.search,h),_strictSearch:x};else{const D=l.options.loader||l.options.beforeLoad||l.lazyFn||Dc(l)?"pending":"success";T={id:w,ssr:l.options.ssr,index:f,routeId:l.id,params:E?.params??o,_strictParams:C,pathname:b,updatedAt:Date.now(),search:E?zt(E.search,h):h,_strictSearch:x,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Cn()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:E?Wt(E.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}t?.preload||(T.globalNotFound=c===l.id),T.searchError=m;const M=this.getParentContext(p);T.context={...M,...T.__routeContext,...T.__beforeLoadContext},u[f]=T}for(let f=0;f<u.length;f++){const l=u[f],p=this.looseRoutesById[l.routeId],h=this.getMatch(l.id),x=d.get(l.routeId);if(l.params=x?zt(x.params,o):o,!h){const m=u[f-1],y=this.getParentContext(m);if(p.options.context){const v={deps:l.loaderDeps,params:l.params,context:y??{},location:e,navigate:b=>this.navigate({...b,_fromLocation:e}),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:u,routeId:p.id};l.__routeContext=p.options.context(v)??void 0}l.context={...y,...l.__routeContext,...l.__beforeLoadContext}}}return u}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=Un(t),o={...e.search};for(const d of t)try{Object.assign(o,_r(d.options.validateSearch,o))}catch{}const s=Un(this.stores.matchesId.get()),i=s&&this.stores.matchStores.get(s)?.get(),c=i&&i.routeId===r.id&&i.pathname===e.pathname;let u;if(c)u=i.params;else{const d=Object.assign(Object.create(null),n);for(const f of t)try{ii(f,d)}catch{}u=d}return{matchedRoutes:t,fullPath:r.fullPath,search:o,params:u}}},Br=class extends Error{},hh=class extends Error{};const si=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function ai(e,t){return si(e)===si(t)}function ph(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function _r(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Br("Async validation not supported");if(n.issues)throw new Br(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 mh({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),o=ft(e);let s;const i=Tf(o,n,!0);return i&&(s=i.route,Object.assign(r,i.rawParams)),{matchedRoutes:i?.branch||[t.__root__],routeParams:r,foundRoute:s}}function gh({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return xh(n)(e,t,r??!1)}function xh(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const s=({search:i,next:c})=>{let u=i;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(u=o.options.preSearchFilters.reduce((f,l)=>l(f),i));const d=c(u);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((f,l)=>l(f),d):d};t.middlewares.push(s)}if(o.options.validateSearch){const s=({search:i,next:c})=>{const u=c(i);if(!t._includeValidateSearch)return u;try{return{...u,..._r(o.options.validateSearch,u)??void 0}}catch{return u}};t.middlewares.push(s)}}const n=({search:o})=>{const s=t.dest;return s.search?s.search===!0?o:jt(s.search,o):{}};t.middlewares.push(n);const r=(o,s,i)=>{if(o>=i.length)return s;const c=i[o];return c({search:s,next:d=>r(o+1,d,i)})};return function(s,i,c){return t.dest=i,t._includeValidateSearch=c,r(0,s,t.middlewares)}}function yh(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 Xt}function ii(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const vh="Error preloading route! ☝️";var Lc=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;if(this.parentRoute=this.options.getParentRoute?.(),r)this._path=Xt;else if(!this.parentRoute){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");ht()}let o=r?Xt:n?.path;o&&o!=="/"&&(o=Pc(o));const s=n?.id||o;let i=r?Xt:jr([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),i!=="__root__"&&(i=jr(["/",i]));const c=i==="__root__"?"/":jr([this.parentRoute.fullPath,o]);this._path=o,this._id=i,this._fullPath=c,this._to=ft(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Qf({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},bh=class extends Lc{constructor(e){super(e)}};function wh(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function Ms(e){const t=e.errorComponent??Is;return a.jsx(Sh,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?g.createElement(t,{error:n,reset:r}):e.children})}var Sh=class extends g.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Is({error:e}){const[t,n]=g.useState(process.env.NODE_ENV!=="production");return a.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[a.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),a.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"})]}),a.jsx("div",{style:{height:".25rem"}}),t?a.jsx("div",{children:a.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?a.jsx("code",{children:e.message}):null})}):null]})}function Nh({children:e,fallback:t=null}){return Fc()?a.jsx(R.Fragment,{children:e}):a.jsx(R.Fragment,{children:t})}function Fc(){return R.useSyncExternalStore(Rh,()=>!0,()=>!1)}function Rh(){return()=>{}}var Bc=g.createContext(null);function Ve(e){const t=g.useContext(Bc);return process.env.NODE_ENV!=="production"&&(t||console.warn("Warning: useRouter must be used inside a <RouterProvider> component!")),t}var oo=g.createContext(void 0),Ch=g.createContext(void 0),ce=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(ce||{});function jh({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:i,shallowPropagate:c};function r(d,f,l){const p=f.depsTail;if(p!==void 0&&p.dep===d)return;const h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===d){h.version=l,f.depsTail=h;return}const x=d.subsTail;if(x!==void 0&&x.version===l&&x.sub===f)return;const m=f.depsTail=d.subsTail={version:l,dep:d,sub:f,prevDep:p,nextDep:h,prevSub:x,nextSub:void 0};h!==void 0&&(h.prevDep=m),p!==void 0?p.nextDep=m:f.deps=m,x!==void 0?x.nextSub=m:d.subs=m}function o(d,f=d.sub){const l=d.dep,p=d.prevDep,h=d.nextDep,x=d.nextSub,m=d.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,x!==void 0?x.prevSub=m:l.subsTail=m,m!==void 0?m.nextSub=x:(l.subs=x)===void 0&&n(l),h}function s(d){let f=d.nextSub,l;e:do{const p=d.sub;let h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(d,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&t(p),h&1){const x=p.subs;if(x!==void 0){const m=(d=x).nextSub;m!==void 0&&(l={value:f,prev:l},f=m);continue}}if((d=f)!==void 0){f=d.nextSub;continue}for(;l!==void 0;)if(d=l.value,l=l.prev,d!==void 0){f=d.nextSub;continue e}break}while(!0)}function i(d,f){let l,p=0,h=!1;e:do{const x=d.dep,m=x.flags;if(f.flags&16)h=!0;else if((m&17)===17){if(e(x)){const y=x.subs;y.nextSub!==void 0&&c(y),h=!0}}else if((m&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(l={value:d,prev:l}),d=x.deps,f=x,++p;continue}if(!h){const y=d.nextDep;if(y!==void 0){d=y;continue}}for(;p--;){const y=f.subs,v=y.nextSub!==void 0;if(v?(d=l.value,l=l.prev):d=y,h){if(e(f)){v&&c(y),f=d.sub;continue}h=!1}else f.flags&=-33;f=d.sub;const b=d.nextDep;if(b!==void 0){d=b;continue e}}return h}while(!0)}function c(d){do{const f=d.sub,l=f.flags;(l&48)===32&&(f.flags=l|16,(l&6)===2&&t(f))}while((d=d.nextSub)!==void 0)}function u(d,f){let l=f.depsTail;for(;l!==void 0;){if(l===d)return!0;l=l.prevDep}return!1}}function Eh(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const fs=[];let kr=0;const{link:ci,unlink:_h,propagate:kh,checkDirty:$c,shallowPropagate:li}=jh({update(e){return e._update()},notify(e){fs[hs++]=e,e.flags&=~ce.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ce.Mutable|ce.Dirty,$r(e))}});let hr=0,hs=0,nt,ps=0;function zc(e){try{++ps,e()}finally{--ps||Uc()}}function $r(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=_h(n,e)}function Uc(){if(!(ps>0)){for(;hr<hs;){const e=fs[hr];fs[hr++]=void 0,e.notify()}hr=0,hs=0}}function di(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?ce.None:ce.Mutable,get(){return nt!==void 0&&ci(o,nt,kr),o._snapshot},subscribe(s){const i=Eh(s),c={current:!1},u=Ph(()=>{o.get(),c.current?i.next?.(o._snapshot):c.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(s){const i=nt,c=t?.compare??Object.is;if(n)nt=o,++kr,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=ce.Mutable|ce.RecursedCheck);try{const u=o._snapshot,d=typeof s=="function"?s(u):s===void 0&&n?r(u):s;return u===void 0||!c(u,d)?(o._snapshot=d,!0):!1}finally{nt=i,n&&(o.flags&=~ce.RecursedCheck),$r(o)}}};return n?(o.flags=ce.Mutable|ce.Dirty,o.get=function(){const s=o.flags;if(s&ce.Dirty||s&ce.Pending&&$c(o.deps,o)){if(o._update()){const i=o.subs;i!==void 0&&li(i)}}else s&ce.Pending&&(o.flags=s&~ce.Pending);return nt!==void 0&&ci(o,nt,kr),o._snapshot}):o.set=function(s){if(o._update(s)){const i=o.subs;i!==void 0&&(kh(i),li(i),Uc())}},o}function Ph(e){const t=()=>{const r=nt;nt=n,++kr,n.depsTail=void 0,n.flags=ce.Watching|ce.RecursedCheck;try{return e()}finally{nt=r,n.flags&=~ce.RecursedCheck,$r(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ce.Watching|ce.RecursedCheck,notify(){const r=this.flags;r&ce.Dirty||r&ce.Pending&&$c(this.deps,this)?t():this.flags=ce.Watching},stop(){this.flags=ce.None,this.depsTail=void 0,$r(this)}};return t(),n}var pr={exports:{}},Vo={},mr={exports:{}},Wo={};var ui;function Ah(){if(ui)return Wo;ui=1;var e=R;function t(l,p){return l===p&&(l!==0||1/l===1/p)||l!==l&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(l,p){var h=p(),x=r({inst:{value:h,getSnapshot:p}}),m=x[0].inst,y=x[1];return s(function(){m.value=h,m.getSnapshot=p,u(m)&&y({inst:m})},[l,h,p]),o(function(){return u(m)&&y({inst:m}),l(function(){u(m)&&y({inst:m})})},[l]),i(h),h}function u(l){var p=l.getSnapshot;l=l.value;try{var h=p();return!n(l,h)}catch{return!0}}function d(l,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Wo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Wo}var Ho={};var fi;function Th(){return fi||(fi=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}function t(h,x){f||o.startTransition===void 0||(f=!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=x();if(!l){var y=x();s(m,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}y=i({inst:{value:m,getSnapshot:x}});var v=y[0].inst,b=y[1];return u(function(){v.value=m,v.getSnapshot=x,n(v)&&b({inst:v})},[h,m,x]),c(function(){return n(v)&&b({inst:v}),h(function(){n(v)&&b({inst:v})})},[h]),d(m),m}function n(h){var x=h.getSnapshot;h=h.value;try{var m=x();return!s(h,m)}catch{return!0}}function r(h,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=R,s=typeof Object.is=="function"?Object.is:e,i=o.useState,c=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,f=!1,l=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Ho.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ho}var hi;function Vc(){return hi||(hi=1,process.env.NODE_ENV==="production"?mr.exports=Ah():mr.exports=Th()),mr.exports}var pi;function Oh(){if(pi)return Vo;pi=1;var e=R,t=Vc();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Vo.useSyncExternalStoreWithSelector=function(d,f,l,p,h){var x=s(null);if(x.current===null){var m={hasValue:!1,value:null};x.current=m}else m=x.current;x=c(function(){function v(E){if(!b){if(b=!0,S=E,E=p(E),h!==void 0&&m.hasValue){var C=m.value;if(h(C,E))return w=C}return w=E}if(C=w,r(S,E))return C;var N=p(E);return h!==void 0&&h(C,N)?(S=E,C):(S=E,w=N)}var b=!1,S,w,_=l===void 0?null:l;return[function(){return v(f())},_===null?void 0:function(){return v(_())}]},[f,l,p,h]);var y=o(d,x[0],x[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),u(y),y},Vo}var Ko={};var mi;function Mh(){return mi||(mi=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=R,n=Vc(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,c=t.useMemo,u=t.useDebugValue;Ko.useSyncExternalStoreWithSelector=function(d,f,l,p,h){var x=s(null);if(x.current===null){var m={hasValue:!1,value:null};x.current=m}else m=x.current;x=c(function(){function v(E){if(!b){if(b=!0,S=E,E=p(E),h!==void 0&&m.hasValue){var C=m.value;if(h(C,E))return w=C}return w=E}if(C=w,r(S,E))return C;var N=p(E);return h!==void 0&&h(C,N)?(S=E,C):(S=E,w=N)}var b=!1,S,w,_=l===void 0?null:l;return[function(){return v(f())},_===null?void 0:function(){return v(_())}]},[f,l,p,h]);var y=o(d,x[0],x[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),u(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ko}var gi;function Ih(){return gi||(gi=1,process.env.NODE_ENV==="production"?pr.exports=Oh():pr.exports=Mh()),pr.exports}var Dh=Ih();function Lh(e,t){return e===t}function Ue(e,t,n=Lh){const r=R.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(i);return c},[e]),o=R.useCallback(()=>e?.get(),[e]);return Dh.useSyncExternalStoreWithSelector(r,o,o,t,n)}var Fh={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function on(e){const t=Ve(),n=g.useContext(e.from?Ch:oo),r=e.from??n,o=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,s=g.useRef(void 0);return Ue(o??Fh,i=>{if((e.shouldThrow??!0)&&!i){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`);ht()}if(i===void 0)return;const c=e.select?e.select(i):i;if(e.structuralSharing??t.options.defaultStructuralSharing){const u=Wt(s.current,c);return s.current=u,u}return c})}function Wc(e){return on({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Hc(e){const{select:t,...n}=e;return on({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ds(e){return on({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 Kc(e){return on({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wn(e){const t=Ve();return g.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Bh(e){const t=Ve(),n=wn(),r=g.useRef(null);return vn(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Gc(e){return on({...e,select:t=>e.select?e.select(t.context):t.context})}function $h(e,t){const n=Ve(),r=wf(t),{activeProps:o,inactiveProps:s,activeOptions:i,to:c,preload:u,preloadDelay:d,preloadIntentProximity:f,hashScrollIntoView:l,replace:p,startTransition:h,resetScroll:x,viewTransition:m,children:y,target:v,disabled:b,style:S,className:w,onClick:_,onBlur:E,onFocus:C,onMouseEnter:N,onMouseLeave:P,onTouchStart:T,ignoreBlocker:M,params:D,search:G,hash:I,state:$,mask:F,reloadDocument:W,unsafeRelative:V,from:L,_fromLocation:O,...k}=e,Y=Fc(),A=g.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),z=Ue(n.stores.location,ae=>ae,(ae,xe)=>ae.href===xe.href),B=g.useMemo(()=>{const ae={_fromLocation:z,...A};return n.buildLocation(ae)},[n,z,A]),J=B.maskedLocation?B.maskedLocation.publicHref:B.publicHref,q=B.maskedLocation?B.maskedLocation.external:B.external,U=g.useMemo(()=>Kh(J,q,n.history,b),[b,q,J,n.history]),te=g.useMemo(()=>{if(U?.external){if(Dr(U.href,n.protocolAllowlist)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${U.href}`);return}return U.href}if(!Gh(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{if(new URL(c),Dr(c,n.protocolAllowlist)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${c}`);return}return c}catch{}},[c,U,n.protocolAllowlist]),he=g.useMemo(()=>{if(te)return!1;if(i?.exact){if(!Ff(z.pathname,B.pathname,n.basepath))return!1}else{const ae=Lr(z.pathname,n.basepath),xe=Lr(B.pathname,n.basepath);if(!(ae.startsWith(xe)&&(ae.length===xe.length||ae[xe.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Yt(z.search,B.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?Y&&z.hash===B.hash:!0},[i?.exact,i?.explicitUndefined,i?.includeHash,i?.includeSearch,z,te,Y,B.hash,B.pathname,B.search,n.basepath]),de=he?jt(o,{})??zh:Go,ue=he?Go:jt(s,{})??Go,Pe=[w,de.className,ue.className].filter(Boolean).join(" "),we=(S||de.style||ue.style)&&{...S,...de.style,...ue.style},[To,An]=g.useState(!1),vt=g.useRef(!1),ct=e.reloadDocument||te?!1:u??n.options.defaultPreload,Fe=d??n.options.defaultPreloadDelay??0,lt=g.useCallback(()=>{n.preloadRoute({...A,_builtLocation:B}).catch(ae=>{console.warn(ae),console.warn(vh)})},[n,A,B]);bf(r,g.useCallback(ae=>{ae?.isIntersecting&<()},[lt]),Hh,{disabled:!!b||ct!=="viewport"}),g.useEffect(()=>{vt.current||!b&&ct==="render"&&(lt(),vt.current=!0)},[b,lt,ct]);const Oo=ae=>{const xe=ae.currentTarget.getAttribute("target"),dt=v!==void 0?v:xe;if(!b&&!qh(ae)&&!ae.defaultPrevented&&(!dt||dt==="_self")&&ae.button===0){ae.preventDefault(),to.flushSync(()=>{An(!0)});const ar=n.subscribe("onResolved",()=>{ar(),An(!1)});n.navigate({...A,replace:p,resetScroll:x,hashScrollIntoView:l,startTransition:h,viewTransition:m,ignoreBlocker:M})}};if(te)return{...k,ref:r,href:te,...y&&{children:y},...v&&{target:v},...b&&{disabled:b},...S&&{style:S},...w&&{className:w},..._&&{onClick:_},...E&&{onBlur:E},...C&&{onFocus:C},...N&&{onMouseEnter:N},...P&&{onMouseLeave:P},...T&&{onTouchStart:T}};const je=ae=>{if(b||ct!=="intent")return;if(!Fe){lt();return}const xe=ae.currentTarget;if(Ln.has(xe))return;const dt=setTimeout(()=>{Ln.delete(xe),lt()},Fe);Ln.set(xe,dt)},bt=ae=>{b||ct!=="intent"||lt()},sr=ae=>{if(b||!ct||!Fe)return;const xe=ae.currentTarget,dt=Ln.get(xe);dt&&(clearTimeout(dt),Ln.delete(xe))};return{...k,...de,...ue,href:U?.href,ref:r,onClick:hn([_,Oo]),onBlur:hn([E,sr]),onFocus:hn([C,je]),onMouseEnter:hn([N,je]),onMouseLeave:hn([P,sr]),onTouchStart:hn([T,bt]),disabled:!!b,target:v,...we&&{style:we},...Pe&&{className:Pe},...b&&Uh,...he&&Vh,...Y&&To&&Wh}}var Go={},zh={className:"active"},Uh={role:"link","aria-disabled":!0},Vh={"data-status":"active","aria-current":"page"},Wh={"data-transitioning":"transitioning"},Ln=new WeakMap,Hh={rootMargin:"100px"},hn=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Kh(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Gh(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var qc=g.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=$h(r,t),i=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...u}=s;return g.createElement("a",u,i)}return g.createElement(n,s,i)});function qh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Yh=class extends Lc{constructor(e){super(e),this.useMatch=t=>on({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Gc({...t,from:this.id}),this.useSearch=t=>Kc({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ds({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hc({...t,from:this.id}),this.useLoaderData=t=>Wc({...t,from:this.id}),this.useNavigate=()=>wn({from:this.fullPath}),this.Link=R.forwardRef((t,n)=>a.jsx(qc,{ref:n,from:this.fullPath,...t}))}};function St(e){return new Yh(e)}var Xh=class extends bh{constructor(e){super(e),this.useMatch=t=>on({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Gc({...t,from:this.id}),this.useSearch=t=>Kc({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ds({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Hc({...t,from:this.id}),this.useLoaderData=t=>Wc({...t,from:this.id}),this.useNavigate=()=>wn({from:this.fullPath}),this.Link=R.forwardRef((t,n)=>a.jsx(qc,{ref:n,from:this.fullPath,...t}))}};function Jh(e){return new Xh(e)}function Zh(e){const t=Ve(),n=`not-found-${Ue(t.stores.location,r=>r.pathname)}-${Ue(t.stores.status,r=>r)}`;return a.jsx(Ms,{getResetKey:()=>n,onCatch:(r,o)=>{if(ke(r))e.onCatch?.(r,o);else throw r},errorComponent:({error:r})=>{if(ke(r))return e.fallback?.(r);throw r},children:e.children})}function Qh(){return a.jsx("p",{children:"Not Found"})}function yn(e){return a.jsx(a.Fragment,{children:e.children})}function Yc(e,t,n){return t.options.notFoundComponent?a.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?a.jsx(e.options.defaultNotFoundComponent,{...n}):(process.env.NODE_ENV!=="production"&&(t.options.notFoundComponent||console.warn(`Warning: 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>)`)),a.jsx(Qh,{}))}function ep(e){return null}function tp(){return ep(Ve()),null}var Xc=g.memo(function({matchId:t}){const n=Ve(),r=n.stores.matchStores.get(t);if(!r){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find match for matchId "${t}". Please file an issue!`);ht()}const o=Ue(n.stores.loadedAt,i=>i),s=Ue(r,i=>i);return a.jsx(np,{router:n,matchId:t,resetKey:o,matchState:g.useMemo(()=>{const i=s.routeId,c=n.routesById[i].parentRoute?.id;return{routeId:i,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:c}},[s._displayPending,s.routeId,s.ssr,n.routesById])})});function np({router:e,matchId:t,resetKey:n,matchState:r}){const o=e.routesById[r.routeId],s=o.options.pendingComponent??e.options.defaultPendingComponent,i=s?a.jsx(s,{}):null,c=o.options.errorComponent??e.options.defaultErrorComponent,u=o.options.onCatch??e.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",l=(!o.isRoot||o.options.wrapInSuspense||f)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||f))?g.Suspense:yn,p=c?Ms:yn,h=d?Zh:yn;return a.jsxs(o.isRoot?o.options.shellComponent??yn:yn,{children:[a.jsx(oo.Provider,{value:t,children:a.jsx(l,{fallback:i,children:a.jsx(p,{getResetKey:()=>n,errorComponent:c||Is,onCatch:(x,m)=>{if(ke(x))throw x.routeId??=r.routeId,x;process.env.NODE_ENV!=="production"&&console.warn(`Warning: Error in route match: ${t}`),u?.(x,m)},children:a.jsx(h,{fallback:x=>{if(x.routeId??=r.routeId,!d||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!o.isRoot)throw x;return g.createElement(d,x)},children:f||r._displayPending?a.jsx(Nh,{fallback:i,children:a.jsx(xi,{matchId:t})}):a.jsx(xi,{matchId:t})})})})}),r.parentRouteId===Xt?a.jsxs(a.Fragment,{children:[a.jsx(rp,{resetKey:n}),e.options.scrollRestoration&&Nc?a.jsx(tp,{}):null]}):null]})}function rp({resetKey:e}){const t=Ve(),n=g.useRef(void 0);return vn(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...bn(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var xi=g.memo(function({matchId:t}){const n=Ve(),r=(f,l)=>n.getMatch(f.id)?._nonReactive[l]??f._nonReactive[l],o=n.stores.matchStores.get(t);if(!o){if(process.env.NODE_ENV!=="production")throw new Error(`Invariant failed: Could not find match for matchId "${t}". Please file an issue!`);ht()}const s=Ue(o,f=>f),i=s.routeId,c=n.routesById[i],u=g.useMemo(()=>{const f=(n.routesById[i].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:i,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return f?JSON.stringify(f):void 0},[i,s.loaderDeps,s._strictParams,s._strictSearch,n.options.defaultRemountDeps,n.routesById]),d=g.useMemo(()=>{const f=c.options.component??n.options.defaultComponent;return f?a.jsx(f,{},u):a.jsx(Ls,{})},[u,c.options.component,n.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){const f=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const l=n.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise){const p=Cn();l._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),l._nonReactive.minPendingPromise=void 0},f)}}throw r(s,"loadPromise")}if(s.status==="notFound"){if(!ke(s.error)){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Expected a notFound error");ht()}return Yc(n,c,s.error)}if(s.status==="redirected"){if(!De(s.error)){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Expected a redirect error");ht()}throw r(s,"loadPromise")}if(s.status==="error")throw s.error;return d}),Ls=g.memo(function(){const t=Ve(),n=g.useContext(oo);let r,o=!1,s;{const d=n?t.stores.matchStores.get(n):void 0;[r,o]=Ue(d,f=>[f?.routeId,f?.globalNotFound??!1]),s=Ue(t.stores.matchesId,f=>f[f.findIndex(l=>l===n)+1])}const i=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?a.jsx(t.options.defaultPendingComponent,{}):null;if(o){if(!i){if(process.env.NODE_ENV!=="production")throw new Error("Invariant failed: Could not resolve route for Outlet render");ht()}return Yc(t,i,void 0)}if(!s)return null;const u=a.jsx(Xc,{matchId:s});return r===Xt?a.jsx(g.Suspense,{fallback:c,children:u}):u});function op(){const e=Ve(),t=g.useRef({router:e,mounted:!1}),[n,r]=g.useState(!1),o=Ue(e.stores.isLoading,l=>l),s=Ue(e.stores.hasPending,l=>l),i=Do(o),c=o||n||s,u=Do(c),d=o||s,f=Do(d);return e.startTransition=l=>{r(!0),g.startTransition(()=>{l(),r(!1)})},g.useEffect(()=>{const l=e.history.subscribe(e.load),p=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ft(e.latestLocation.publicHref)!==ft(p.publicHref)&&e.commitLocation({...p,replace:!0}),()=>{l()}},[e,e.history]),vn(()=>{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(p){console.error(p)}})()},[e]),vn(()=>{i&&!o&&e.emit({type:"onLoad",...bn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[i,e,o]),vn(()=>{f&&!d&&e.emit({type:"onBeforeRouteMount",...bn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[d,f,e]),vn(()=>{if(u&&!c){const l=bn(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...l}),zc(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),l.hrefChanged&&wh(e)}},[c,u,e]),null}function sp(){const e=Ve(),t=e.routesById[Xt].options.pendingComponent??e.options.defaultPendingComponent,n=t?a.jsx(t,{}):null,r=a.jsxs(typeof document<"u"&&e.ssr?yn:g.Suspense,{fallback:n,children:[a.jsx(op,{}),a.jsx(ap,{})]});return e.options.InnerWrap?a.jsx(e.options.InnerWrap,{children:r}):r}function ap(){const e=Ve(),t=Ue(e.stores.firstId,o=>o),n=Ue(e.stores.loadedAt,o=>o),r=t?a.jsx(Xc,{matchId:t}):null;return a.jsx(oo.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:a.jsx(Ms,{getResetKey:()=>n,errorComponent:Is,onCatch:process.env.NODE_ENV!=="production"?o=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${o.message||o.toString()}`)}:void 0,children:r})})}var ip=e=>({createMutableStore:di,createReadonlyStore:di,batch:zc}),cp=e=>new lp(e),lp=class extends fh{constructor(e){super(e,ip)}};function dp({router:e,children:t,...n}){Cc(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=a.jsx(Bc.Provider,{value:e,children:t});return e.options.Wrap?a.jsx(e.options.Wrap,{children:r}):r}function up({router:e,...t}){return a.jsx(dp,{router:e,...t,children:a.jsx(sp,{})})}function Jc(e,t){return function(){return e.apply(t,arguments)}}const{toString:fp}=Object.prototype,{getPrototypeOf:so}=Object,{iterator:ao,toStringTag:Zc}=Symbol,io=(e=>t=>{const n=fp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ze=e=>(e=e.toLowerCase(),t=>io(t)===e),co=e=>t=>typeof t===e,{isArray:_n}=Array,jn=co("undefined");function Yn(e){return e!==null&&!jn(e)&&e.constructor!==null&&!jn(e.constructor)&&Le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qc=Ze("ArrayBuffer");function hp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Qc(e.buffer),t}const pp=co("string"),Le=co("function"),el=co("number"),Xn=e=>e!==null&&typeof e=="object",mp=e=>e===!0||e===!1,Pr=e=>{if(io(e)!=="object")return!1;const t=so(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Zc in e)&&!(ao in e)},gp=e=>{if(!Xn(e)||Yn(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},xp=Ze("Date"),yp=Ze("File"),vp=e=>!!(e&&typeof e.uri<"u"),bp=e=>e&&typeof e.getParts<"u",wp=Ze("Blob"),Sp=Ze("FileList"),Np=e=>Xn(e)&&Le(e.pipe);function Rp(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const yi=Rp(),vi=typeof yi.FormData<"u"?yi.FormData:void 0,Cp=e=>{if(!e)return!1;if(vi&&e instanceof vi)return!0;const t=so(e);if(!t||t===Object.prototype||!Le(e.append))return!1;const n=io(e);return n==="formdata"||n==="object"&&Le(e.toString)&&e.toString()==="[object FormData]"},jp=Ze("URLSearchParams"),[Ep,_p,kp,Pp]=["ReadableStream","Request","Response","Headers"].map(Ze),Ap=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),_n(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Yn(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let c;for(r=0;r<i;r++)c=s[r],t.call(null,e[c],c,e)}}function tl(e,t){if(Yn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Kt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nl=e=>!jn(e)&&e!==Kt;function ms(...e){const{caseless:t,skipUndefined:n}=nl(this)&&this||{},r={},o=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const c=t&&tl(r,i)||i,u=gs(r,c)?r[c]:void 0;Pr(u)&&Pr(s)?r[c]=ms(u,s):Pr(s)?r[c]=ms({},s):_n(s)?r[c]=s.slice():(!n||!jn(s))&&(r[c]=s)};for(let s=0,i=e.length;s<i;s++)e[s]&&Jn(e[s],o);return r}const Tp=(e,t,n,{allOwnKeys:r}={})=>(Jn(t,(o,s)=>{n&&Le(o)?Object.defineProperty(e,s,{__proto__:null,value:Jc(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Op=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mp=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Ip=(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&so(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Dp=(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},Lp=e=>{if(!e)return null;if(_n(e))return e;let t=e.length;if(!el(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Fp=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&so(Uint8Array)),Bp=(e,t)=>{const r=(e&&e[ao]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},$p=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zp=Ze("HTMLFormElement"),Up=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),gs=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vp=Ze("RegExp"),rl=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Jn(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Wp=e=>{rl(e,(t,n)=>{if(Le(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(Le(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+"'")})}})},Hp=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return _n(e)?r(e):r(String(e).split(t)),n},Kp=()=>{},Gp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qp(e){return!!(e&&Le(e.append)&&e[Zc]==="FormData"&&e[ao])}const Yp=e=>{const t=new WeakSet,n=r=>{if(Xn(r)){if(t.has(r))return;if(Yn(r))return r;if(!("toJSON"in r)){t.add(r);const o=_n(r)?[]:{};return Jn(r,(s,i)=>{const c=n(s);!jn(c)&&(o[i]=c)}),t.delete(r),o}}return r};return n(e)},Xp=Ze("AsyncFunction"),Jp=e=>e&&(Xn(e)||Le(e))&&Le(e.then)&&Le(e.catch),ol=((e,t)=>e?setImmediate:t?((n,r)=>(Kt.addEventListener("message",({source:o,data:s})=>{o===Kt&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Kt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Le(Kt.postMessage)),Zp=typeof queueMicrotask<"u"?queueMicrotask.bind(Kt):typeof process<"u"&&process.nextTick||ol,Qp=e=>e!=null&&Le(e[ao]),j={isArray:_n,isArrayBuffer:Qc,isBuffer:Yn,isFormData:Cp,isArrayBufferView:hp,isString:pp,isNumber:el,isBoolean:mp,isObject:Xn,isPlainObject:Pr,isEmptyObject:gp,isReadableStream:Ep,isRequest:_p,isResponse:kp,isHeaders:Pp,isUndefined:jn,isDate:xp,isFile:yp,isReactNativeBlob:vp,isReactNative:bp,isBlob:wp,isRegExp:Vp,isFunction:Le,isStream:Np,isURLSearchParams:jp,isTypedArray:Fp,isFileList:Sp,forEach:Jn,merge:ms,extend:Tp,trim:Ap,stripBOM:Op,inherits:Mp,toFlatObject:Ip,kindOf:io,kindOfTest:Ze,endsWith:Dp,toArray:Lp,forEachEntry:Bp,matchAll:$p,isHTMLForm:zp,hasOwnProperty:gs,hasOwnProp:gs,reduceDescriptors:rl,freezeMethods:Wp,toObjectSet:Hp,toCamelCase:Up,noop:Kp,toFiniteNumber:Gp,findKey:tl,global:Kt,isContextDefined:nl,isSpecCompliantForm:qp,toJSONObject:Yp,isAsyncFn:Xp,isThenable:Jp,setImmediate:ol,asap:Zp,isIterable:Qp},em=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tm=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
7
|
+
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&em[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};function nm(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const rm=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),om=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Fs(e,t){return j.isArray(e)?e.map(n=>Fs(n,t)):nm(String(e).replace(t,""))}const sm=e=>Fs(e,rm),am=e=>Fs(e,om);function sl(e){const t=Object.create(null);return j.forEach(e.toJSON(),(n,r)=>{t[r]=am(n)}),t}const bi=Symbol("internals");function Fn(e){return e&&String(e).trim().toLowerCase()}function Ar(e){return e===!1||e==null?e:j.isArray(e)?e.map(Ar):sm(String(e))}function im(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 cm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qo(e,t,n,r,o){if(j.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function lm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function dm(e,t){const n=j.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}let Oe=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(c,u,d){const f=Fn(u);if(!f)throw new Error("header name must be a non-empty string");const l=j.findKey(o,f);(!l||o[l]===void 0||d===!0||d===void 0&&o[l]!==!1)&&(o[l||u]=Ar(c))}const i=(c,u)=>j.forEach(c,(d,f)=>s(d,f,u));if(j.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(j.isString(t)&&(t=t.trim())&&!cm(t))i(tm(t),n);else if(j.isObject(t)&&j.isIterable(t)){let c={},u,d;for(const f of t){if(!j.isArray(f))throw TypeError("Object iterator must return a key-value pair");c[d=f[0]]=(u=c[d])?j.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}i(c,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=Fn(t),t){const r=j.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return im(o);if(j.isFunction(n))return n.call(this,o,r);if(j.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Fn(t),t){const r=j.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||qo(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Fn(i),i){const c=j.findKey(r,i);c&&(!n||qo(r,r[c],c,n))&&(delete r[c],o=!0)}}return j.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||qo(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return j.forEach(this,(o,s)=>{const i=j.findKey(r,s);if(i){n[i]=Ar(o),delete n[s];return}const c=t?lm(s):String(s).trim();c!==s&&delete n[s],n[c]=Ar(o),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return j.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&j.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
8
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[bi]=this[bi]={accessors:{}}).accessors,o=this.prototype;function s(i){const c=Fn(i);r[c]||(dm(o,i),r[c]=!0)}return j.isArray(t)?t.forEach(s):s(t),this}};Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);j.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});j.freezeMethods(Oe);const um="[REDACTED ****]";function fm(e){if(j.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(j.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function hm(e,t){const n=new Set(t.map(s=>String(s).toLowerCase())),r=[],o=s=>{if(s===null||typeof s!="object"||j.isBuffer(s))return s;if(r.indexOf(s)!==-1)return;s instanceof Oe&&(s=s.toJSON()),r.push(s);let i;if(j.isArray(s))i=[],s.forEach((c,u)=>{const d=o(c);j.isUndefined(d)||(i[u]=d)});else{if(!j.isPlainObject(s)&&fm(s))return r.pop(),s;i=Object.create(null);for(const[c,u]of Object.entries(s)){const d=n.has(c.toLowerCase())?um:o(u);j.isUndefined(d)||(i[c]=d)}}return r.pop(),i};return o(e)}let X=class al extends Error{static from(t,n,r,o,s,i){const c=new al(t.message,n||t.code,r,o,s);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),i&&Object.assign(c,i),c}constructor(t,n,r,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,n=t&&j.hasOwnProp(t,"redact")?t.redact:void 0,r=j.isArray(n)&&n.length>0?hm(t,n):j.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};X.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";X.ERR_BAD_OPTION="ERR_BAD_OPTION";X.ECONNABORTED="ECONNABORTED";X.ETIMEDOUT="ETIMEDOUT";X.ECONNREFUSED="ECONNREFUSED";X.ERR_NETWORK="ERR_NETWORK";X.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";X.ERR_DEPRECATED="ERR_DEPRECATED";X.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";X.ERR_BAD_REQUEST="ERR_BAD_REQUEST";X.ERR_CANCELED="ERR_CANCELED";X.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";X.ERR_INVALID_URL="ERR_INVALID_URL";X.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const pm=null;function xs(e){return j.isPlainObject(e)||j.isArray(e)}function il(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function Yo(e,t,n){return e?e.concat(t).map(function(o,s){return o=il(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function mm(e){return j.isArray(e)&&!e.some(xs)}const gm=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function lo(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,v){return!j.isUndefined(v[y])});const r=n.metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,c=n.Blob||typeof Blob<"u"&&Blob,u=n.maxDepth===void 0?100:n.maxDepth,d=c&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(j.isDate(m))return m.toISOString();if(j.isBoolean(m))return m.toString();if(!d&&j.isBlob(m))throw new X("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(m)||j.isTypedArray(m)?d&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,y,v){let b=m;if(j.isReactNative(t)&&j.isReactNativeBlob(m))return t.append(Yo(v,y,s),f(m)),!1;if(m&&!v&&typeof m=="object"){if(j.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(j.isArray(m)&&mm(m)||(j.isFileList(m)||j.endsWith(y,"[]"))&&(b=j.toArray(m)))return y=il(y),b.forEach(function(w,_){!(j.isUndefined(w)||w===null)&&t.append(i===!0?Yo([y],_,s):i===null?y:y+"[]",f(w))}),!1}return xs(m)?!0:(t.append(Yo(v,y,s),f(m)),!1)}const p=[],h=Object.assign(gm,{defaultVisitor:l,convertValue:f,isVisitable:xs});function x(m,y,v=0){if(!j.isUndefined(m)){if(v>u)throw new X("Object is too deeply nested ("+v+" levels). Max depth: "+u,X.ERR_FORM_DATA_DEPTH_EXCEEDED);if(p.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(m),j.forEach(m,function(S,w){(!(j.isUndefined(S)||S===null)&&o.call(t,S,j.isString(w)?w.trim():w,y,h))===!0&&x(S,y?y.concat(w):[w],v+1)}),p.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return x(e),t}function wi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Bs(e,t){this._pairs=[],e&&lo(e,this,t)}const cl=Bs.prototype;cl.append=function(t,n){this._pairs.push([t,n])};cl.toString=function(t){const n=t?function(r){return t.call(this,r,wi)}:wi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function xm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ll(e,t,n){if(!t)return e;const r=n&&n.encode||xm,o=j.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(s?i=s(t,o):i=j.isURLSearchParams(t)?t.toString():new Bs(t,o).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Si{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const $s={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ym=typeof URLSearchParams<"u"?URLSearchParams:Bs,vm=typeof FormData<"u"?FormData:null,bm=typeof Blob<"u"?Blob:null,wm={isBrowser:!0,classes:{URLSearchParams:ym,FormData:vm,Blob:bm},protocols:["http","https","file","blob","url","data"]},zs=typeof window<"u"&&typeof document<"u",ys=typeof navigator=="object"&&navigator||void 0,Sm=zs&&(!ys||["ReactNative","NativeScript","NS"].indexOf(ys.product)<0),Nm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rm=zs&&window.location.href||"http://localhost",Cm=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zs,hasStandardBrowserEnv:Sm,hasStandardBrowserWebWorkerEnv:Nm,navigator:ys,origin:Rm},Symbol.toStringTag,{value:"Module"})),_e={...Cm,...wm};function jm(e,t){return lo(e,new _e.classes.URLSearchParams,{visitor:function(n,r,o,s){return _e.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Em(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _m(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function dl(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),u=s>=n.length;return i=!i&&j.isArray(o)?o.length:i,u?(j.hasOwnProp(o,i)?o[i]=j.isArray(o[i])?o[i].concat(r):[o[i],r]:o[i]=r,!c):((!j.hasOwnProp(o,i)||!j.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&j.isArray(o[i])&&(o[i]=_m(o[i])),!c)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,o)=>{t(Em(r),o,n,0)}),n}return null}const pn=(e,t)=>e!=null&&j.hasOwnProp(e,t)?e[t]:void 0;function km(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Zn={transitional:$s,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=j.isObject(t);if(s&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(dl(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){const u=pn(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return jm(t,u).toString();if((c=j.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=pn(this,"env"),f=d&&d.FormData;return lo(c?{"files[]":t}:t,f&&new f,u)}}return s||o?(n.setContentType("application/json",!1),km(t)):t}],transformResponse:[function(t){const n=pn(this,"transitional")||Zn.transitional,r=n&&n.forcedJSONParsing,o=pn(this,"responseType"),s=o==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(r&&!o||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,pn(this,"parseReviver"))}catch(u){if(c)throw u.name==="SyntaxError"?X.from(u,X.ERR_BAD_RESPONSE,this,null,pn(this,"response")):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch","query"],e=>{Zn.headers[e]={}});function Xo(e,t){const n=this||Zn,r=t||n,o=Oe.from(r.headers);let s=r.data;return j.forEach(e,function(c){s=c.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ul(e){return!!(e&&e.__CANCEL__)}let Qn=class extends X{constructor(t,n,r){super(t??"canceled",X.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function fl(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new X("Request failed with status code "+n.status,n.status>=400&&n.status<500?X.ERR_BAD_REQUEST:X.ERR_BAD_RESPONSE,n.config,n.request,n))}function Pm(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Am(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=r[s];i||(i=d),n[o]=u,r[o]=d;let l=s,p=0;for(;l!==o;)p+=n[l++],l=l%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=f&&d-f;return h?Math.round(p*1e3/h):void 0}}function Tm(e,t){let n=0,r=1e3/t,o,s;const i=(d,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const f=Date.now(),l=f-n;l>=r?i(d,f):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},r-l)))},()=>o&&i(o)]}const zr=(e,t,n=3)=>{let r=0;const o=Am(50,250);return Tm(s=>{if(!s||typeof s.loaded!="number")return;const i=s.loaded,c=s.lengthComputable?s.total:void 0,u=c!=null?Math.min(i,c):i,d=Math.max(0,u-r),f=o(d);r=Math.max(r,u);const l={loaded:u,total:c,progress:c?u/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c?(c-u)/f:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},n)},Ni=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ri=e=>(...t)=>j.asap(()=>e(...t)),Om=_e.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,_e.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(_e.origin),_e.navigator&&/(msie|trident)/i.test(_e.navigator.userAgent)):()=>!0,Mm=_e.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];j.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),j.isString(r)&&c.push(`path=${r}`),j.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),j.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(o!==-1&&r.slice(0,o)===e)return decodeURIComponent(r.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Im(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Dm(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function hl(e,t,n){let r=!Im(t);return e&&(r||n===!1)?Dm(e,t):t}const Ci=e=>e instanceof Oe?{...e}:e;function en(e,t){t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(d,f,l,p){return j.isPlainObject(d)&&j.isPlainObject(f)?j.merge.call({caseless:p},d,f):j.isPlainObject(f)?j.merge({},f):j.isArray(f)?f.slice():f}function o(d,f,l,p){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d,l,p)}else return r(d,f,l,p)}function s(d,f){if(!j.isUndefined(f))return r(void 0,f)}function i(d,f){if(j.isUndefined(f)){if(!j.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function c(d,f,l){if(j.hasOwnProp(t,l))return r(d,f);if(j.hasOwnProp(e,l))return r(void 0,d)}const u={url:s,method:s,data:s,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,allowedSocketPaths:i,responseEncoding:i,validateStatus:c,headers:(d,f,l)=>o(Ci(d),Ci(f),l,!0)};return j.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const l=j.hasOwnProp(u,f)?u[f]:o,p=j.hasOwnProp(e,f)?e[f]:void 0,h=j.hasOwnProp(t,f)?t[f]:void 0,x=l(p,h,f);j.isUndefined(x)&&l!==c||(n[f]=x)}),n}const Lm=["content-type","content-length"];function Fm(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t).forEach(([r,o])=>{Lm.includes(r.toLowerCase())&&e.set(r,o)})}const Bm=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),pl=e=>{const t=en({},e),n=p=>j.hasOwnProp(t,p)?t[p]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let c=n("headers");const u=n("auth"),d=n("baseURL"),f=n("allowAbsoluteUrls"),l=n("url");if(t.headers=c=Oe.from(c),t.url=ll(hl(d,l,f),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?Bm(u.password):""))),j.isFormData(r)&&(_e.hasStandardBrowserEnv||_e.hasStandardBrowserWebWorkerEnv?c.setContentType(void 0):j.isFunction(r.getHeaders)&&Fm(c,r.getHeaders(),n("formDataHeaderPolicy"))),_e.hasStandardBrowserEnv&&(j.isFunction(o)&&(o=o(t)),o===!0||o==null&&Om(t.url))){const h=s&&i&&Mm.read(i);h&&c.set(s,h)}return t},$m=typeof XMLHttpRequest<"u",zm=$m&&function(e){return new Promise(function(n,r){const o=pl(e);let s=o.data;const i=Oe.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:d}=o,f,l,p,h,x;function m(){h&&h(),x&&x(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function v(){if(!y)return;const S=Oe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};fl(function(C){n(C),m()},function(C){r(C),m()},_),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(v)},y.onabort=function(){y&&(r(new X("Request aborted",X.ECONNABORTED,e,y)),m(),y=null)},y.onerror=function(w){const _=w&&w.message?w.message:"Network Error",E=new X(_,X.ERR_NETWORK,e,y);E.event=w||null,r(E),m(),y=null},y.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||$s;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),r(new X(w,_.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,y)),m(),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&j.forEach(sl(i),function(w,_){y.setRequestHeader(_,w)}),j.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),c&&c!=="json"&&(y.responseType=o.responseType),d&&([p,x]=zr(d,!0),y.addEventListener("progress",p)),u&&y.upload&&([l,h]=zr(u),y.upload.addEventListener("progress",l),y.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(f=S=>{y&&(r(!S||S.type?new Qn(null,e,y):S),y.abort(),m(),y=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const b=Pm(o.url);if(b&&!_e.protocols.includes(b)){r(new X("Unsupported protocol "+b+":",X.ERR_BAD_REQUEST,e));return}y.send(s||null)})},Um=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(u){if(!r){r=!0,i();const d=u instanceof Error?u:this.reason;n.abort(d instanceof X?d:new Qn(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,o(new X(`timeout of ${t}ms exceeded`,X.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>j.asap(i),c},Vm=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Wm=async function*(e,t){for await(const n of Hm(e))yield*Vm(n,t)},Hm=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()}},ji=(e,t,n,r)=>{const o=Wm(e,t);let s=0,i,c=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:f}=await o.next();if(d){c(),u.close();return}let l=f.byteLength;if(n){let p=s+=l;n(p)}u.enqueue(new Uint8Array(f))}catch(d){throw c(d),d}},cancel(u){return c(u),o.return()}},{highWaterMark:2})};function Km(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let i=r.length;const c=r.length;for(let h=0;h<c;h++)if(r.charCodeAt(h)===37&&h+2<c){const x=r.charCodeAt(h+1),m=r.charCodeAt(h+2);(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(i-=2,h+=2)}let u=0,d=c-1;const f=h=>h>=2&&r.charCodeAt(h-2)===37&&r.charCodeAt(h-1)===51&&(r.charCodeAt(h)===68||r.charCodeAt(h)===100);d>=0&&(r.charCodeAt(d)===61?(u++,d--):f(d)&&(u++,d-=3)),u===1&&d>=0&&(r.charCodeAt(d)===61||f(d))&&u++;const p=Math.floor(i/4)*3-(u||0);return p>0?p:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(r,"utf8");let s=0;for(let i=0,c=r.length;i<c;i++){const u=r.charCodeAt(i);if(u<128)s+=1;else if(u<2048)s+=2;else if(u>=55296&&u<=56319&&i+1<c){const d=r.charCodeAt(i+1);d>=56320&&d<=57343?(s+=4,i++):s+=3}else s+=3}return s}const Us="1.16.1",Ei=64*1024,{isFunction:gr}=j,_i=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Gm=e=>{const t=j.global!==void 0&&j.global!==null?j.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=j.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,c=o?gr(o):typeof fetch=="function",u=gr(s),d=gr(i);if(!c)return!1;const f=c&&gr(n),l=c&&(typeof r=="function"?(v=>b=>v.encode(b))(new r):async v=>new Uint8Array(await new s(v).arrayBuffer())),p=u&&f&&_i(()=>{let v=!1;const b=new s(_e.origin,{body:new n,method:"POST",get duplex(){return v=!0,"half"}}),S=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),v&&!S}),h=d&&f&&_i(()=>j.isReadableStream(new i("").body)),x={stream:h&&(v=>v.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!x[v]&&(x[v]=(b,S)=>{let w=b&&b[v];if(w)return w.call(b);throw new X(`Response type '${v}' is not supported`,X.ERR_NOT_SUPPORT,S)})});const m=async v=>{if(v==null)return 0;if(j.isBlob(v))return v.size;if(j.isSpecCompliantForm(v))return(await new s(_e.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(j.isArrayBufferView(v)||j.isArrayBuffer(v))return v.byteLength;if(j.isURLSearchParams(v)&&(v=v+""),j.isString(v))return(await l(v)).byteLength},y=async(v,b)=>{const S=j.toFiniteNumber(v.getContentLength());return S??m(b)};return async v=>{let{url:b,method:S,data:w,signal:_,cancelToken:E,timeout:C,onDownloadProgress:N,onUploadProgress:P,responseType:T,headers:M,withCredentials:D="same-origin",fetchOptions:G,maxContentLength:I,maxBodyLength:$}=pl(v);const F=j.isNumber(I)&&I>-1,W=j.isNumber($)&&$>-1;let V=o||fetch;T=T?(T+"").toLowerCase():"text";let L=Um([_,E&&E.toAbortSignal()],C),O=null;const k=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let Y;try{if(F&&typeof b=="string"&&b.startsWith("data:")&&Km(b)>I)throw new X("maxContentLength size of "+I+" exceeded",X.ERR_BAD_RESPONSE,v,O);if(W&&S!=="get"&&S!=="head"){const U=await y(M,w);if(typeof U=="number"&&isFinite(U)&&U>$)throw new X("Request body larger than maxBodyLength limit",X.ERR_BAD_REQUEST,v,O)}if(P&&p&&S!=="get"&&S!=="head"&&(Y=await y(M,w))!==0){let U=new s(b,{method:"POST",body:w,duplex:"half"}),te;if(j.isFormData(w)&&(te=U.headers.get("content-type"))&&M.setContentType(te),U.body){const[he,de]=Ni(Y,zr(Ri(P)));w=ji(U.body,Ei,he,de)}}j.isString(D)||(D=D?"include":"omit");const A=u&&"credentials"in s.prototype;if(j.isFormData(w)){const U=M.getContentType();U&&/^multipart\/form-data/i.test(U)&&!/boundary=/i.test(U)&&M.delete("content-type")}M.set("User-Agent","axios/"+Us,!1);const z={...G,signal:L,method:S.toUpperCase(),headers:sl(M.normalize()),body:w,duplex:"half",credentials:A?D:void 0};O=u&&new s(b,z);let B=await(u?V(O,G):V(b,z));if(F){const U=j.toFiniteNumber(B.headers.get("content-length"));if(U!=null&&U>I)throw new X("maxContentLength size of "+I+" exceeded",X.ERR_BAD_RESPONSE,v,O)}const J=h&&(T==="stream"||T==="response");if(h&&B.body&&(N||F||J&&k)){const U={};["status","statusText","headers"].forEach(we=>{U[we]=B[we]});const te=j.toFiniteNumber(B.headers.get("content-length")),[he,de]=N&&Ni(te,zr(Ri(N),!0))||[];let ue=0;const Pe=we=>{if(F&&(ue=we,ue>I))throw new X("maxContentLength size of "+I+" exceeded",X.ERR_BAD_RESPONSE,v,O);he&&he(we)};B=new i(ji(B.body,Ei,Pe,()=>{de&&de(),k&&k()}),U)}T=T||"text";let q=await x[j.findKey(x,T)||"text"](B,v);if(F&&!h&&!J){let U;if(q!=null&&(typeof q.byteLength=="number"?U=q.byteLength:typeof q.size=="number"?U=q.size:typeof q=="string"&&(U=typeof r=="function"?new r().encode(q).byteLength:q.length)),typeof U=="number"&&U>I)throw new X("maxContentLength size of "+I+" exceeded",X.ERR_BAD_RESPONSE,v,O)}return!J&&k&&k(),await new Promise((U,te)=>{fl(U,te,{data:q,headers:Oe.from(B.headers),status:B.status,statusText:B.statusText,config:v,request:O})})}catch(A){if(k&&k(),L&&L.aborted&&L.reason instanceof X){const z=L.reason;throw z.config=v,O&&(z.request=O),A!==z&&(z.cause=A),z}throw A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new X("Network Error",X.ERR_NETWORK,v,O,A&&A.response),{cause:A.cause||A}):X.from(A,A&&A.code,v,O,A&&A.response)}}},qm=new Map,ml=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i=s.length,c=i,u,d,f=qm;for(;c--;)u=s[c],d=f.get(u),d===void 0&&f.set(u,d=c?new Map:Gm(t)),f=d;return d};ml();const Vs={http:pm,xhr:zm,fetch:{get:ml}};j.forEach(Vs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ki=e=>`- ${e}`,Ym=e=>j.isFunction(e)||e===null||e===!1;function Xm(e,t){e=j.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){r=e[i];let c;if(o=r,!Ym(r)&&(o=Vs[(c=String(r)).toLowerCase()],o===void 0))throw new X(`Unknown adapter '${c}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;s[c||"#"+i]=o}if(!o){const i=Object.entries(s).map(([u,d])=>`adapter ${u} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
9
|
+
`+i.map(ki).join(`
|
|
10
|
+
`):" "+ki(i[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const gl={getAdapter:Xm,adapters:Vs};function Jo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qn(null,e)}function Pi(e){return Jo(e),e.headers=Oe.from(e.headers),e.data=Xo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),gl.getAdapter(e.adapter||Zn.adapter,e)(e).then(function(r){Jo(e),e.response=r;try{r.data=Xo.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=Oe.from(r.headers),r},function(r){if(!ul(r)&&(Jo(e),r&&r.response)){e.response=r.response;try{r.response.data=Xo.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=Oe.from(r.response.headers)}return Promise.reject(r)})}const uo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uo[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ai={};uo.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Us+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,c)=>{if(t===!1)throw new X(o(i," has been removed"+(n?" in "+n:"")),X.ERR_DEPRECATED);return n&&!Ai[i]&&(Ai[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,c):!0}};uo.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Jm(e,t,n){if(typeof e!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const c=e[s],u=c===void 0||i(c,s,e);if(u!==!0)throw new X("option "+s+" must be "+u,X.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new X("Unknown option "+s,X.ERR_BAD_OPTION)}}const Tr={assertOptions:Jm,validators:uo},He=Tr.validators;let Zt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Si,response:new Si}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=(()=>{if(!o.stack)return"";const i=o.stack.indexOf(`
|
|
11
|
+
`);return i===-1?"":o.stack.slice(i+1)})();try{if(!r.stack)r.stack=s;else if(s){const i=s.indexOf(`
|
|
12
|
+
`),c=i===-1?-1:s.indexOf(`
|
|
13
|
+
`,i+1),u=c===-1?"":s.slice(c+1);String(r.stack).endsWith(u)||(r.stack+=`
|
|
14
|
+
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=en(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Tr.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean),legacyInterceptorReqResOrdering:He.transitional(He.boolean)},!1),o!=null&&(j.isFunction(o)?n.paramsSerializer={serialize:o}:Tr.assertOptions(o,{encode:He.function,serialize:He.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Tr.assertOptions(n,{baseUrl:He.spelling("baseURL"),withXsrfToken:He.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&j.merge(s.common,s[n.method]);s&&j.forEach(["delete","get","head","post","put","patch","query","common"],x=>{delete s[x]}),n.headers=Oe.concat(i,s);const c=[];let u=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(n)===!1)return;u=u&&m.synchronous;const y=n.transitional||$s;y&&y.legacyInterceptorReqResOrdering?c.unshift(m.fulfilled,m.rejected):c.push(m.fulfilled,m.rejected)});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let f,l=0,p;if(!u){const x=[Pi.bind(this),void 0];for(x.unshift(...c),x.push(...d),p=x.length,f=Promise.resolve(n);l<p;)f=f.then(x[l++],x[l++]);return f}p=c.length;let h=n;for(;l<p;){const x=c[l++],m=c[l++];try{h=x(h)}catch(y){m.call(this,y);break}}try{f=Pi.call(this,h)}catch(x){return Promise.reject(x)}for(l=0,p=d.length;l<p;)f=f.then(d[l++],d[l++]);return f}getUri(t){t=en(this.defaults,t);const n=hl(t.baseURL,t.url,t.allowAbsoluteUrls);return ll(n,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){Zt.prototype[t]=function(n,r){return this.request(en(r||{},{method:t,url:n,data:(r||{}).data}))}});j.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,i,c){return this.request(en(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Zt.prototype[t]=n(),t!=="query"&&(Zt.prototype[t+"Form"]=n(!0))});let Zm=class xl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(c=>{r.subscribe(c),s=c}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,c){r.reason||(r.reason=new Qn(s,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new xl(function(o){t=o}),cancel:t}}};function Qm(e){return function(n){return e.apply(null,n)}}function eg(e){return j.isObject(e)&&e.isAxiosError===!0}const vs={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(vs).forEach(([e,t])=>{vs[t]=e});function yl(e){const t=new Zt(e),n=Jc(Zt.prototype.request,t);return j.extend(n,Zt.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return yl(en(e,o))},n}const fe=yl(Zn);fe.Axios=Zt;fe.CanceledError=Qn;fe.CancelToken=Zm;fe.isCancel=ul;fe.VERSION=Us;fe.toFormData=lo;fe.AxiosError=X;fe.Cancel=fe.CanceledError;fe.all=function(t){return Promise.all(t)};fe.spread=Qm;fe.isAxiosError=eg;fe.mergeConfig=en;fe.AxiosHeaders=Oe;fe.formToJSON=e=>dl(j.isHTMLForm(e)?new FormData(e):e);fe.getAdapter=gl.getAdapter;fe.HttpStatusCode=vs;fe.default=fe;const{Axios:MS,AxiosError:IS,CanceledError:DS,isCancel:LS,CancelToken:FS,VERSION:BS,all:$S,Cancel:zS,isAxiosError:US,spread:VS,toFormData:WS,AxiosHeaders:HS,HttpStatusCode:KS,formToJSON:GS,getAdapter:qS,mergeConfig:YS,create:XS}=fe,ie=fe.create({baseURL:"/api/v1/insight"});function vl(e,t){ie.defaults.baseURL=`${e}/insight`,t&&(ie.defaults.headers.common.Authorization=`Bearer ${t}`)}function tg(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 ng=e=>{switch(e){case"success":return sg;case"info":return ig;case"warning":return ag;case"error":return cg;default:return null}},rg=Array(12).fill(0),og=({visible:e,className:t})=>R.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},R.createElement("div",{className:"sonner-spinner"},rg.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sg=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.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"})),ag=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.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"})),ig=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.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"})),cg=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.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"})),lg=R.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"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),dg=()=>{const[e,t]=R.useState(document.hidden);return R.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let bs=1;class ug{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:bs++,i=this.toasts.find(u=>u.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:r}),{...u,...t,id:s,dismissible:c,title:r}):u):this.addToast({title:r,...o,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const c=o.then(async d=>{if(i=["resolve",d],R.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(hg(d)&&!d.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof l=="object"&&!R.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:p,...x})}else if(d instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,x=typeof l=="object"&&!R.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:p,...x})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(d):n.success,p=typeof n.description=="function"?await n.description(d):n.description,x=typeof l=="object"&&!R.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:p,...x})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,l=typeof n.description=="function"?await n.description(d):n.description,h=typeof f=="object"&&!R.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:l,...h})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>c.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||bs++;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 Ie=new ug,fg=(e,t)=>{const n=t?.id||bs++;return Ie.addToast({title:e,...t,id:n}),n},hg=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pg=fg,mg=()=>Ie.toasts,gg=()=>Ie.getActiveToasts(),se=Object.assign(pg,{success:Ie.success,info:Ie.info,warning:Ie.warning,error:Ie.error,custom:Ie.custom,message:Ie.message,promise:Ie.promise,dismiss:Ie.dismiss,loading:Ie.loading},{getHistory:mg,getToasts:gg});tg("[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 xr(e){return e.label!==void 0}const xg=3,yg="24px",vg="16px",Ti=4e3,bg=356,wg=14,Sg=45,Ng=200;function et(...e){return e.filter(Boolean).join(" ")}function Rg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Cg=e=>{var t,n,r,o,s,i,c,u,d;const{invert:f,toast:l,unstyled:p,interacting:h,setHeights:x,visibleToasts:m,heights:y,index:v,toasts:b,expanded:S,removeToast:w,defaultRichColors:_,closeButton:E,style:C,cancelButtonStyle:N,actionButtonStyle:P,className:T="",descriptionClassName:M="",duration:D,position:G,gap:I,expandByDefault:$,classNames:F,icons:W,closeButtonAriaLabel:V="Close toast"}=e,[L,O]=R.useState(null),[k,Y]=R.useState(null),[A,z]=R.useState(!1),[B,J]=R.useState(!1),[q,U]=R.useState(!1),[te,he]=R.useState(!1),[de,ue]=R.useState(!1),[Pe,we]=R.useState(0),[To,An]=R.useState(0),vt=R.useRef(l.duration||D||Ti),ct=R.useRef(null),Fe=R.useRef(null),lt=v===0,Oo=v+1<=m,je=l.type,bt=l.dismissible!==!1,sr=l.className||"",ae=l.descriptionClassName||"",xe=R.useMemo(()=>y.findIndex(re=>re.toastId===l.id)||0,[y,l.id]),dt=R.useMemo(()=>{var re;return(re=l.closeButton)!=null?re:E},[l.closeButton,E]),ar=R.useMemo(()=>l.duration||D||Ti,[l.duration,D]),Mo=R.useRef(0),un=R.useRef(0),Aa=R.useRef(0),fn=R.useRef(null),[ff,hf]=G.split("-"),Ta=R.useMemo(()=>y.reduce((re,ve,Ee)=>Ee>=xe?re:re+ve.height,0),[y,xe]),Oa=dg(),pf=l.invert||f,Io=je==="loading";un.current=R.useMemo(()=>xe*I+Ta,[xe,Ta]),R.useEffect(()=>{vt.current=ar},[ar]),R.useEffect(()=>{z(!0)},[]),R.useEffect(()=>{const re=Fe.current;if(re){const ve=re.getBoundingClientRect().height;return An(ve),x(Ee=>[{toastId:l.id,height:ve,position:l.position},...Ee]),()=>x(Ee=>Ee.filter(Be=>Be.toastId!==l.id))}},[x,l.id]),R.useLayoutEffect(()=>{if(!A)return;const re=Fe.current,ve=re.style.height;re.style.height="auto";const Ee=re.getBoundingClientRect().height;re.style.height=ve,An(Ee),x(Be=>Be.find(Se=>Se.toastId===l.id)?Be.map(Se=>Se.toastId===l.id?{...Se,height:Ee}:Se):[{toastId:l.id,height:Ee,position:l.position},...Be])},[A,l.title,l.description,x,l.id,l.jsx,l.action,l.cancel]);const wt=R.useCallback(()=>{J(!0),we(un.current),x(re=>re.filter(ve=>ve.toastId!==l.id)),setTimeout(()=>{w(l)},Ng)},[l,w,x,un]);R.useEffect(()=>{if(l.promise&&je==="loading"||l.duration===1/0||l.type==="loading")return;let re;return S||h||Oa?(()=>{if(Aa.current<Mo.current){const Be=new Date().getTime()-Mo.current;vt.current=vt.current-Be}Aa.current=new Date().getTime()})():vt.current!==1/0&&(Mo.current=new Date().getTime(),re=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),wt()},vt.current)),()=>clearTimeout(re)},[S,h,l,je,Oa,wt]),R.useEffect(()=>{l.delete&&(wt(),l.onDismiss==null||l.onDismiss.call(l,l))},[wt,l.delete]);function mf(){var re;if(W?.loading){var ve;return R.createElement("div",{className:et(F?.loader,l==null||(ve=l.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":je==="loading"},W.loading)}return R.createElement(og,{className:et(F?.loader,l==null||(re=l.classNames)==null?void 0:re.loader),visible:je==="loading"})}const gf=l.icon||W?.[je]||ng(je);var Ma,Ia;return R.createElement("li",{tabIndex:0,ref:Fe,className:et(T,sr,F?.toast,l==null||(t=l.classNames)==null?void 0:t.toast,F?.default,F?.[je],l==null||(n=l.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(Ma=l.richColors)!=null?Ma:_,"data-styled":!(l.jsx||l.unstyled||p),"data-mounted":A,"data-promise":!!l.promise,"data-swiped":de,"data-removed":B,"data-visible":Oo,"data-y-position":ff,"data-x-position":hf,"data-index":v,"data-front":lt,"data-swiping":q,"data-dismissible":bt,"data-type":je,"data-invert":pf,"data-swipe-out":te,"data-swipe-direction":k,"data-expanded":!!(S||$&&A),"data-testid":l.testId,style:{"--index":v,"--toasts-before":v,"--z-index":b.length-v,"--offset":`${B?Pe:un.current}px`,"--initial-height":$?"auto":`${To}px`,...C,...l.style},onDragEnd:()=>{U(!1),O(null),fn.current=null},onPointerDown:re=>{re.button!==2&&(Io||!bt||(ct.current=new Date,we(un.current),re.target.setPointerCapture(re.pointerId),re.target.tagName!=="BUTTON"&&(U(!0),fn.current={x:re.clientX,y:re.clientY})))},onPointerUp:()=>{var re,ve,Ee;if(te||!bt)return;fn.current=null;const Be=Number(((re=Fe.current)==null?void 0:re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ir=Number(((ve=Fe.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Se=new Date().getTime()-((Ee=ct.current)==null?void 0:Ee.getTime()),We=L==="x"?Be:ir,cr=Math.abs(We)/Se;if(Math.abs(We)>=Sg||cr>.11){we(un.current),l.onDismiss==null||l.onDismiss.call(l,l),Y(L==="x"?Be>0?"right":"left":ir>0?"down":"up"),wt(),he(!0);return}else{var Ge,qe;(Ge=Fe.current)==null||Ge.style.setProperty("--swipe-amount-x","0px"),(qe=Fe.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}ue(!1),U(!1),O(null)},onPointerMove:re=>{var ve,Ee,Be;if(!fn.current||!bt||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;const Se=re.clientY-fn.current.y,We=re.clientX-fn.current.x;var cr;const Ge=(cr=e.swipeDirections)!=null?cr:Rg(G);!L&&(Math.abs(We)>1||Math.abs(Se)>1)&&O(Math.abs(We)>Math.abs(Se)?"x":"y");let qe={x:0,y:0};const Da=$t=>1/(1.5+Math.abs($t)/20);if(L==="y"){if(Ge.includes("top")||Ge.includes("bottom"))if(Ge.includes("top")&&Se<0||Ge.includes("bottom")&&Se>0)qe.y=Se;else{const $t=Se*Da(Se);qe.y=Math.abs($t)<Math.abs(Se)?$t:Se}}else if(L==="x"&&(Ge.includes("left")||Ge.includes("right")))if(Ge.includes("left")&&We<0||Ge.includes("right")&&We>0)qe.x=We;else{const $t=We*Da(We);qe.x=Math.abs($t)<Math.abs(We)?$t:We}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&ue(!0),(Ee=Fe.current)==null||Ee.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Be=Fe.current)==null||Be.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},dt&&!l.jsx&&je!=="loading"?R.createElement("button",{"aria-label":V,"data-disabled":Io,"data-close-button":!0,onClick:Io||!bt?()=>{}:()=>{wt(),l.onDismiss==null||l.onDismiss.call(l,l)},className:et(F?.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(Ia=W?.close)!=null?Ia:lg):null,(je||l.icon||l.promise)&&l.icon!==null&&(W?.[je]!==null||l.icon)?R.createElement("div",{"data-icon":"",className:et(F?.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||mf():null,l.type!=="loading"?gf:null):null,R.createElement("div",{"data-content":"",className:et(F?.content,l==null||(s=l.classNames)==null?void 0:s.content)},R.createElement("div",{"data-title":"",className:et(F?.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?R.createElement("div",{"data-description":"",className:et(M,ae,F?.description,l==null||(c=l.classNames)==null?void 0:c.description)},typeof l.description=="function"?l.description():l.description):null),R.isValidElement(l.cancel)?l.cancel:l.cancel&&xr(l.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||N,onClick:re=>{xr(l.cancel)&&bt&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,re),wt())},className:et(F?.cancelButton,l==null||(u=l.classNames)==null?void 0:u.cancelButton)},l.cancel.label):null,R.isValidElement(l.action)?l.action:l.action&&xr(l.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||P,onClick:re=>{xr(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,re),!re.defaultPrevented&&wt())},className:et(F?.actionButton,l==null||(d=l.classNames)==null?void 0:d.actionButton)},l.action.label):null)};function Oi(){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 jg(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",c=s?vg:yg;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=c:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(c)}),n}const Eg=R.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:f,mobileOffset:l,theme:p="light",richColors:h,duration:x,style:m,visibleToasts:y=xg,toastOptions:v,dir:b=Oi(),gap:S=wg,icons:w,containerAriaLabel:_="Notifications"}=t,[E,C]=R.useState([]),N=R.useMemo(()=>r?E.filter(A=>A.toasterId===r):E.filter(A=>!A.toasterId),[E,r]),P=R.useMemo(()=>Array.from(new Set([s].concat(N.filter(A=>A.position).map(A=>A.position)))),[N,s]),[T,M]=R.useState([]),[D,G]=R.useState(!1),[I,$]=R.useState(!1),[F,W]=R.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=R.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=R.useRef(null),k=R.useRef(!1),Y=R.useCallback(A=>{C(z=>{var B;return(B=z.find(J=>J.id===A.id))!=null&&B.delete||Ie.dismiss(A.id),z.filter(({id:J})=>J!==A.id)})},[]);return R.useEffect(()=>Ie.subscribe(A=>{if(A.dismiss){requestAnimationFrame(()=>{C(z=>z.map(B=>B.id===A.id?{...B,delete:!0}:B))});return}setTimeout(()=>{to.flushSync(()=>{C(z=>{const B=z.findIndex(J=>J.id===A.id);return B!==-1?[...z.slice(0,B),{...z[B],...A},...z.slice(B+1)]:[A,...z]})})})}),[E]),R.useEffect(()=>{if(p!=="system"){W(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:z})=>{W(z?"dark":"light")})}catch{A.addListener(({matches:B})=>{try{W(B?"dark":"light")}catch(J){console.error(J)}})}},[p]),R.useEffect(()=>{E.length<=1&&G(!1)},[E]),R.useEffect(()=>{const A=z=>{var B;if(i.every(U=>z[U]||z.code===U)){var q;G(!0),(q=V.current)==null||q.focus()}z.code==="Escape"&&(document.activeElement===V.current||(B=V.current)!=null&&B.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[i]),R.useEffect(()=>{if(V.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,k.current=!1)}},[V.current]),R.createElement("section",{ref:n,"aria-label":`${_} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((A,z)=>{var B;const[J,q]=A.split("-");return N.length?R.createElement("ol",{key:A,dir:b==="auto"?Oi():b,tabIndex:-1,ref:V,className:d,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":J,"data-x-position":q,style:{"--front-toast-height":`${((B=T[0])==null?void 0:B.height)||0}px`,"--width":`${bg}px`,"--gap":`${S}px`,...m,...jg(f,l)},onBlur:U=>{k.current&&!U.currentTarget.contains(U.relatedTarget)&&(k.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||k.current||(k.current=!0,O.current=U.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{I||G(!1)},onDragEnd:()=>G(!1),onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},N.filter(U=>!U.position&&z===0||U.position===A).map((U,te)=>{var he,de;return R.createElement(Cg,{key:U.id,icons:w,index:te,toast:U,defaultRichColors:h,duration:(he=v?.duration)!=null?he:x,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:y,closeButton:(de=v?.closeButton)!=null?de:u,interacting:I,position:A,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:Y,toasts:N.filter(ue=>ue.position==U.position),heights:T.filter(ue=>ue.position==U.position),setHeights:M,expandByDefault:c,gap:S,expanded:D,swipeDirections:t.swipeDirections})})):null}))});const _g=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Mi=e=>{const t=kg(e);return t.charAt(0).toUpperCase()+t.slice(1)},bl=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Pg=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ag={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 Tg=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},u)=>R.createElement("svg",{ref:u,...Ag,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bl("lucide",o),...!s&&!Pg(c)&&{"aria-hidden":"true"},...c},[...i.map(([d,f])=>R.createElement(d,f)),...Array.isArray(s)?s:[s]]));const Z=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(Tg,{ref:s,iconNode:t,className:bl(`lucide-${_g(Mi(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Mi(e),n};const Og=[["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"}]],Ws=Z("activity",Og);const Mg=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ii=Z("arrow-left",Mg);const Ig=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],wl=Z("bell",Ig);const Dg=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],$n=Z("brain-circuit",Dg);const Lg=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Fg=Z("calendar",Lg);const Bg=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],$g=Z("chart-no-axes-column",Bg);const zg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ur=Z("check",zg);const Ug=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vg=Z("chevron-down",Ug);const Wg=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hg=Z("chevron-left",Wg);const Kg=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Sl=Z("chevron-right",Kg);const Gg=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],qg=Z("chevrons-left",Gg);const Yg=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Xg=Z("chevrons-right",Yg);const Jg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Hs=Z("circle-arrow-up",Jg);const Zg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Qg=Z("circle-check",Zg);const ex=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],tx=Z("clipboard-list",ex);const nx=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ks=Z("clock",nx);const rx=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ox=Z("cloud",rx);const sx=[["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"}]],Gs=Z("copy",sx);const ax=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],qs=Z("cpu",ax);const ix=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],cx=Z("ellipsis-vertical",ix);const lx=[["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"}]],Nl=Z("ellipsis",lx);const dx=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ws=Z("eye",dx);const ux=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Vr=Z("folder-open",ux);const fx=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],hx=Z("gauge",fx);const px=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Di=Z("history",px);const mx=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Ys=Z("layout-grid",mx);const gx=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],xx=Z("link-2",gx);const yx=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ge=Z("loader-circle",yx);const vx=[["path",{d:"M12 3H4a2 2 0 0 0-2 2v16.286a.71.71 0 0 0 1.212.502l2.202-2.202A2 2 0 0 1 6.828 19H20a2 2 0 0 0 2-2v-4",key:"11da1y"}],["path",{d:"M16 3h6v6",key:"1bx56c"}],["path",{d:"m16 9 6-6",key:"m4dnic"}]],bx=Z("message-square-share",vx);const wx=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Sx=Z("octagon-alert",wx);const Nx=[["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"}]],Xs=Z("package",Nx);const Rx=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],Ss=Z("plug",Rx);const Cx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wr=Z("plus",Cx);const jx=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Ex=Z("refresh-ccw",jx);const _x=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],kx=Z("rotate-ccw",_x);const Px=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fo=Z("search",Px);const Ax=[["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"}]],Tx=Z("server",Ax);const Ox=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mx=Z("settings",Ox);const Ix=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dx=Z("shield-check",Ix);const Lx=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Fx=Z("sparkles",Lx);const Bx=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Js=Z("square-pen",Bx);const $x=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Zs=Z("table",$x);const zx=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ux=Z("tag",zx);const Vx=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wx=Z("terminal",Vx);const Hx=[["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"}]],Rl=Z("trash-2",Hx);const Kx=[["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"}]],Qs=Z("trash",Kx);const Gx=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],qx=Z("trending-down",Gx);const Yx=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Li=Z("triangle-alert",Yx);const Xx=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Jx=Z("webhook",Xx);const Zx=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=Z("x",Zx),be={listIncidents:e=>ie.get("/incidents",{params:e}).then(t=>t.data),getIncident:e=>ie.get(`/incidents/${e}`).then(t=>t.data),getIncidentStatus:e=>ie.get(`/incidents/${e}/status`).then(t=>t.data),triggerAnalysis:e=>ie.post(`/incidents/${e}/analyse`).then(t=>t.data),listAlerts:e=>ie.get("/alerts",{params:e}).then(t=>t.data),getAlert:e=>ie.get(`/alerts/${e}`).then(t=>t.data),promoteAlert:e=>ie.post(`/alerts/${e}/promote`).then(t=>t.data),dismissAlert:e=>ie.post(`/alerts/${e}/dismiss`).then(t=>t.data),deleteAlert:e=>ie.delete(`/alerts/${e}`).then(t=>t.data),listConnectors:e=>ie.get("/connectors",{params:e}).then(t=>t.data),createConnector:e=>ie.post("/connectors",e).then(t=>t.data),getConnector:e=>ie.get(`/connectors/${e}`).then(t=>t.data),updateConnector:(e,t)=>ie.patch(`/connectors/${e}`,t).then(n=>n.data),rotateToken:e=>ie.post(`/connectors/${e}/rotate-token`).then(t=>t.data),deleteConnector:e=>ie.delete(`/connectors/${e}`).then(t=>t.data),listProjects:e=>ie.get("/projects",{params:e}).then(t=>t.data),getProject:e=>ie.get(`/projects/${e}`).then(t=>t.data),createProject:e=>ie.post("/projects",e).then(t=>t.data),updateProject:(e,t)=>ie.patch(`/projects/${e}`,t).then(n=>n.data),deleteProject:e=>ie.delete(`/projects/${e}`).then(t=>t.data),getSettings:()=>ie.get("/settings").then(e=>e.data),updateSettings:e=>ie.patch("/settings",e).then(t=>t.data)},Hr=new Set(["triggered","processing","queued","fetching_ec2","fetching_metrics","fetching_logs","compressing_logs","building_prompt","finding_rca","storing_results"]);function Cl(e,t,n="pending"){const[r,o]=R.useState(n),[s,i]=R.useState(0),c=R.useRef(null),u=r==="completed",d=r==="failed",f=R.useCallback(()=>{o("triggered"),i(0)},[]);return R.useEffect(()=>{Hr.has(r)||o(n)},[n]),R.useEffect(()=>{if(!(e&&(t||Hr.has(r)))){c.current&&(clearInterval(c.current),c.current=null);return}const p=async()=>{try{const h=await be.getIncidentStatus(e),x=h.analysisStatus??"pending";o(x),i(h.progressPercent??0),(h.isComplete||h.isFailed)&&c.current&&(clearInterval(c.current),c.current=null)}catch{}};return p(),c.current=setInterval(p,5e3),()=>{c.current&&(clearInterval(c.current),c.current=null)}},[e,t,r]),{status:r,progressPercent:s,isComplete:u,isFailed:d,optimisticTrigger:f}}function jl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=jl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function El(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=jl(e))&&(r&&(r+=" "),r+=t);return r}const Qx=(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},ey=(e,t)=>({classGroupId:e,validator:t}),_l=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kr="-",Fi=[],ty="arbitrary..",ny=e=>{const t=oy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ry(i);const c=i.split(Kr),u=c[0]===""&&c.length>1?1:0;return kl(c,u,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const u=r[i],d=n[i];return u?d?Qx(d,u):u:d||Fi}return n[i]||Fi}}},kl=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const d=kl(e,t+1,s);if(d)return d}const i=n.validators;if(i===null)return;const c=t===0?e.join(Kr):e.slice(t).join(Kr),u=i.length;for(let d=0;d<u;d++){const f=i[d];if(f.validator(c))return f.classGroupId}},ry=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?ty+r:void 0})(),oy=e=>{const{theme:t,classGroups:n}=e;return sy(n,t)},sy=(e,t)=>{const n=_l();for(const r in e){const o=e[r];ea(o,n,r,t)}return n},ea=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];ay(i,t,n,r)}},ay=(e,t,n,r)=>{if(typeof e=="string"){iy(e,t,n);return}if(typeof e=="function"){cy(e,t,n,r);return}ly(e,t,n,r)},iy=(e,t,n)=>{const r=e===""?t:Pl(t,e);r.classGroupId=n},cy=(e,t,n,r)=>{if(dy(e)){ea(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ey(n,e))},ly=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[c,u]=o[i];ea(u,Pl(t,c),n,r)}},Pl=(e,t)=>{let n=e;const r=t.split(Kr),o=r.length;for(let s=0;s<o;s++){const i=r[s];let c=n.nextPart.get(i);c||(c=_l(),n.nextPart.set(i,c)),n=c}return n},dy=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,uy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Ns="!",Bi=":",fy=[],$i=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),hy=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,c=0,u=0,d;const f=o.length;for(let m=0;m<f;m++){const y=o[m];if(i===0&&c===0){if(y===Bi){s.push(o.slice(u,m)),u=m+1;continue}if(y==="/"){d=m;continue}}y==="["?i++:y==="]"?i--:y==="("?c++:y===")"&&c--}const l=s.length===0?o:o.slice(u);let p=l,h=!1;l.endsWith(Ns)?(p=l.slice(0,-1),h=!0):l.startsWith(Ns)&&(p=l.slice(1),h=!0);const x=d&&d>u?d-u:void 0;return $i(s,h,p,x)};if(t){const o=t+Bi,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):$i(fy,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},py=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],c=i[0]==="[",u=t.has(i);c||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},my=e=>({cache:uy(e.cacheSize),parseClassName:hy(e),sortModifiers:py(e),postfixLookupClassGroupIds:gy(e),...ny(e)}),gy=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},xy=/\s+/,yy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,c=[],u=e.trim().split(xy);let d="";for(let f=u.length-1;f>=0;f-=1){const l=u[f],{isExternal:p,modifiers:h,hasImportantModifier:x,baseClassName:m,maybePostfixModifierPosition:y}=n(l);if(p){d=l+(d.length>0?" "+d:d);continue}let v=!!y,b;if(v){const C=m.substring(0,y);b=r(C);const N=b&&i[b]?r(m):void 0;N&&N!==b&&(b=N,v=!1)}else b=r(m);if(!b){if(!v){d=l+(d.length>0?" "+d:d);continue}if(b=r(m),!b){d=l+(d.length>0?" "+d:d);continue}v=!1}const S=h.length===0?"":h.length===1?h[0]:s(h).join(":"),w=x?S+Ns:S,_=w+b;if(c.indexOf(_)>-1)continue;c.push(_);const E=o(b,v);for(let C=0;C<E.length;++C){const N=E[C];c.push(w+N)}d=l+(d.length>0?" "+d:d)}return d},vy=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Al(n))&&(o&&(o+=" "),o+=r);return o},Al=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Al(e[r]))&&(n&&(n+=" "),n+=t);return n},by=(e,...t)=>{let n,r,o,s;const i=u=>{const d=t.reduce((f,l)=>l(f),e());return n=my(d),r=n.cache.get,o=n.cache.set,s=c,c(u)},c=u=>{const d=r(u);if(d)return d;const f=yy(u,n);return o(u,f),f};return s=i,(...u)=>s(vy(...u))},wy=[],ye=e=>{const t=n=>n[e]||wy;return t.isThemeGetter=!0,t},Tl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ol=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sy=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ny=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ry=/\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$/,Cy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ey=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nt=e=>Sy.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),tt=e=>!!e&&Number.isInteger(Number(e)),Zo=e=>e.endsWith("%")&&oe(e.slice(0,-1)),ut=e=>Ny.test(e),Ml=()=>!0,_y=e=>Ry.test(e)&&!Cy.test(e),ta=()=>!1,ky=e=>jy.test(e),Py=e=>Ey.test(e),Ay=e=>!H(e)&&!K(e),Ty=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Oy=e=>Ot(e,Ll,ta),H=e=>Tl.test(e),Ut=e=>Ot(e,Fl,_y),zi=e=>Ot(e,zy,oe),My=e=>Ot(e,$l,Ml),Iy=e=>Ot(e,Bl,ta),Ui=e=>Ot(e,Il,ta),Dy=e=>Ot(e,Dl,Py),yr=e=>Ot(e,zl,ky),K=e=>Ol.test(e),Bn=e=>sn(e,Fl),Ly=e=>sn(e,Bl),Vi=e=>sn(e,Il),Fy=e=>sn(e,Ll),By=e=>sn(e,Dl),vr=e=>sn(e,zl,!0),$y=e=>sn(e,$l,!0),Ot=(e,t,n)=>{const r=Tl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sn=(e,t,n=!1)=>{const r=Ol.exec(e);return r?r[1]?t(r[1]):n:!1},Il=e=>e==="position"||e==="percentage",Dl=e=>e==="image"||e==="url",Ll=e=>e==="length"||e==="size"||e==="bg-size",Fl=e=>e==="length",zy=e=>e==="number",Bl=e=>e==="family-name",$l=e=>e==="number"||e==="weight",zl=e=>e==="shadow",Uy=()=>{const e=ye("color"),t=ye("font"),n=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),c=ye("container"),u=ye("spacing"),d=ye("radius"),f=ye("shadow"),l=ye("inset-shadow"),p=ye("text-shadow"),h=ye("drop-shadow"),x=ye("blur"),m=ye("perspective"),y=ye("aspect"),v=ye("ease"),b=ye("animate"),S=()=>["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"],_=()=>[...w(),K,H],E=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[K,H,u],P=()=>[Nt,"full","auto",...N()],T=()=>[tt,"none","subgrid",K,H],M=()=>["auto",{span:["full",tt,K,H]},tt,K,H],D=()=>[tt,"auto",K,H],G=()=>["auto","min","max","fr",K,H],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...N()],W=()=>[Nt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],V=()=>[Nt,"screen","full","dvw","lvw","svw","min","max","fit",...N()],L=()=>[Nt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],O=()=>[e,K,H],k=()=>[...w(),Vi,Ui,{position:[K,H]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Fy,Oy,{size:[K,H]}],z=()=>[Zo,Bn,Ut],B=()=>["","none","full",d,K,H],J=()=>["",oe,Bn,Ut],q=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[oe,Zo,Vi,Ui],he=()=>["","none",x,K,H],de=()=>["none",oe,K,H],ue=()=>["none",oe,K,H],Pe=()=>[oe,K,H],we=()=>[Nt,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ut],breakpoint:[ut],color:[Ml],container:[ut],"drop-shadow":[ut],ease:["in","out","in-out"],font:[Ay],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ut],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ut],shadow:[ut],spacing:["px",oe],text:[ut],"text-shadow":[ut],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nt,H,K,y]}],container:["container"],"container-type":[{"@container":["","normal","size",K,H]}],"container-named":[Ty],columns:[{columns:[oe,H,K,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[tt,"auto",K,H]}],basis:[{basis:[Nt,"full","auto",c,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,Nt,"auto","initial","none",H]}],grow:[{grow:["",oe,K,H]}],shrink:[{shrink:["",oe,K,H]}],order:[{order:[tt,"first","last","none",K,H]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,Bn,Ut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,$y,My]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zo,H]}],"font-family":[{font:[Ly,Iy,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,K,H]}],"line-clamp":[{"line-clamp":[oe,"none",K,zi]}],leading:[{leading:[s,...N()]}],"list-image":[{"list-image":["none",K,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",K,Ut]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[oe,"auto",K,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[tt,K,H]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,H]}],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",K,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tt,K,H],radial:["",K,H],conic:[tt,K,H]},By,Dy]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,K,H]}],"outline-w":[{outline:["",oe,Bn,Ut]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",f,vr,yr]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",l,vr,yr]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[oe,Ut]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",p,vr,yr]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[oe,K,H]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"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":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[K,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,H]}],filter:[{filter:["","none",K,H]}],blur:[{blur:he()}],brightness:[{brightness:[oe,K,H]}],contrast:[{contrast:[oe,K,H]}],"drop-shadow":[{"drop-shadow":["","none",h,vr,yr]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",oe,K,H]}],"hue-rotate":[{"hue-rotate":[oe,K,H]}],invert:[{invert:["",oe,K,H]}],saturate:[{saturate:[oe,K,H]}],sepia:[{sepia:["",oe,K,H]}],"backdrop-filter":[{"backdrop-filter":["","none",K,H]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[oe,K,H]}],"backdrop-contrast":[{"backdrop-contrast":[oe,K,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,K,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,K,H]}],"backdrop-invert":[{"backdrop-invert":["",oe,K,H]}],"backdrop-opacity":[{"backdrop-opacity":[oe,K,H]}],"backdrop-saturate":[{"backdrop-saturate":[oe,K,H]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,K,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",K,H]}],ease:[{ease:["linear","initial",v,K,H]}],delay:[{delay:[oe,K,H]}],animate:[{animate:["none",b,K,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,K,H]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[K,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],zoom:[{zoom:[tt,K,H]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",K,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",K,H]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[oe,Bn,Ut,zi]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Vy=by(Uy);function ee(...e){return Vy(El(e))}function Wy(e,t){const r=[];if(t<=5)for(let o=1;o<=t;o++)r.push(o);else if(r.push(1),e<=3){for(let o=2;o<=4;o++)r.push(o);r.push("...",t)}else if(e>=t-2){r.push("...");for(let o=t-3;o<=t;o++)r.push(o)}else{r.push("...");for(let o=e-1;o<=e+1;o++)r.push(o);r.push("...",t)}return r}const Ne=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ee("rounded-lg border bg-card text-card-foreground shadow",e),...t}));Ne.displayName="Card";const ho=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ee("flex flex-col space-y-1.5 p-6",e),...t}));ho.displayName="CardHeader";const na=g.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:ee("font-semibold leading-none tracking-tight",e),...t}));na.displayName="CardTitle";const Ul=g.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));Ul.displayName="CardDescription";const Re=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ee("p-6 pt-0",e),...t}));Re.displayName="CardContent";const Vl=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ee("flex items-center p-6 pt-0",e),...t}));Vl.displayName="CardFooter";const Wi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hi=El,Wl=(e,t)=>n=>{var r;if(t?.variants==null)return Hi(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(d=>{const f=n?.[d],l=s?.[d];if(f===null)return null;const p=Wi(f)||Wi(l);return o[d][p]}),c=n&&Object.entries(n).reduce((d,f)=>{let[l,p]=f;return p===void 0||(d[l]=p),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:l,className:p,...h}=f;return Object.entries(h).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...s,...c}[m]):{...s,...c}[m]===y})?[...d,l,p]:d},[]);return Hi(e,i,u,n?.class,n?.className)},Hy=Wl("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function st({className:e,variant:t,...n}){return a.jsx("div",{className:ee(Hy({variant:t}),e),...n})}function Hl({status:e}){const t="inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-semibold border";switch(e){case"pending":return a.jsx("span",{className:ee(t,"bg-secondary text-secondary-foreground border-border"),children:"Pending"});case"triggered":return a.jsx("span",{className:ee(t,"border-blue-400 text-blue-600 dark:text-blue-400"),children:"Triggered"});case"processing":return a.jsx("span",{className:ee(t,"border-yellow-400 text-yellow-600 dark:text-yellow-400"),children:"Processing"});case"completed":return a.jsx("span",{className:ee(t,"bg-emerald-100 text-emerald-700 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-400 dark:border-emerald-700"),children:"Completed"});case"failed":return a.jsx("span",{className:ee(t,"bg-destructive/10 text-destructive border-destructive/30"),children:"Failed"});default:return a.jsx("span",{className:ee(t,"bg-secondary text-secondary-foreground"),children:e})}}function Ky({incident:e,onViewResult:t}){const n=Hr.has(e.analysisStatus),{status:r,progressPercent:o,isComplete:s,optimisticTrigger:i}=Cl(e.id,n,e.analysisStatus),c=Hr.has(r),u=e.aliasId?`INC-${String(e.aliasId).padStart(3,"0")}`:null;return a.jsx(Ne,{onClick:()=>t(e.id),className:"hover:shadow-sm hover:border-primary/30 transition-all flex flex-col bg-card border-border cursor-pointer overflow-hidden",children:a.jsxs(Re,{className:"p-5 flex flex-col gap-4 h-full",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-red-500/10 text-red-500",children:a.jsx(qx,{size:20})}),a.jsx("div",{className:"flex flex-col items-end gap-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Hl,{status:r}),c&&a.jsx(ge,{className:"h-3 w-3 animate-spin text-muted-foreground"})]})})]}),a.jsx("div",{className:"flex flex-col gap-2 mt-1",children:a.jsx("h3",{className:"font-semibold text-md text-card-foreground leading-tight truncate",children:e.monitorName})}),a.jsx("div",{className:"flex items-center justify-between",children:u&&a.jsx(st,{variant:"outline",className:"uppercase tracking-wider text-[10px] font-semibold px-2 py-0.5 rounded-md",children:u})}),a.jsxs("div",{className:"mt-auto pt-2 flex items-center justify-between",children:[a.jsx(st,{variant:"secondary",className:"uppercase tracking-wider text-[10px] font-semibold px-2 py-0.5 rounded-md",children:e.monitorType}),e.projectTag?a.jsxs("div",{className:" flex text-xs text-muted-foreground truncate",children:[a.jsx(Vr,{className:"mr-2 h-4 w-4"}),a.jsx("span",{className:"font-medium text-foreground",children:e.projectTag})]}):a.jsx("span",{className:"text-xs text-muted-foreground/50",children:"—"})]})]})})}const po=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm",e),...t})}));po.displayName="Table";const mo=g.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:ee("[&_tr]:border-b",e),...t}));mo.displayName="TableHeader";const go=g.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0",e),...t}));go.displayName="TableBody";const Gy=g.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Gy.displayName="TableFooter";const tn=g.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));tn.displayName="TableRow";const pe=g.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:ee("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));pe.displayName="TableHead";const me=g.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:ee("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));me.displayName="TableCell";const qy=g.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground",e),...t}));qy.displayName="TableCaption";function Yy(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Xy({incidents:e,loading:t,onViewResult:n}){return t&&e.length===0?a.jsx("div",{className:"flex h-[40vh] items-center justify-center",children:a.jsx(ge,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):a.jsx("div",{className:"rounded-md border overflow-hidden bg-card text-card-foreground",children:a.jsxs(po,{children:[a.jsx(mo,{children:a.jsxs(tn,{className:"bg-muted/50",children:[a.jsx(pe,{children:"Incident ID"}),a.jsx(pe,{children:"Incident"}),a.jsx(pe,{children:"Type"}),a.jsx(pe,{children:"Project Tag"}),a.jsx(pe,{children:"Analysis"}),a.jsx(pe,{children:"Created"})]})}),a.jsx(go,{children:e.map(r=>a.jsxs(tn,{className:"cursor-pointer",onClick:()=>n(r.id),children:[a.jsx(me,{children:a.jsx(st,{variant:"outline",className:"text-[10px] font-medium",children:r.aliasId?a.jsxs(a.Fragment,{children:["INC-",String(r.aliasId).padStart(3,"0")]}):"-"})}),a.jsx(me,{children:a.jsx("div",{className:"flex items-center gap-3 min-w-0",children:a.jsx("div",{className:"min-w-0",children:a.jsx("p",{className:"font-medium text-sm truncate",children:r.monitorName})})})}),a.jsx(me,{children:a.jsx(st,{variant:"outline",className:"text-[10px] font-medium",children:r.monitorType.toUpperCase()})}),a.jsx(me,{children:r.projectTag?a.jsx(st,{variant:"secondary",children:r.projectTag}):a.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),a.jsx(me,{children:a.jsx(Hl,{status:r.analysisStatus})}),a.jsx(me,{className:"text-sm text-muted-foreground whitespace-nowrap",children:Yy(r.createdAt)})]},r.id))})]})})}function Ki(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ki(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ki(e[o],null)}}}}function Ce(...e){return g.useCallback(Mt(...e),e)}var Jy=Symbol.for("react.lazy"),Gr=g[" use ".trim().toString()];function Zy(e){return typeof e=="object"&&e!==null&&"then"in e}function Kl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Jy&&"_payload"in e&&Zy(e._payload)}function ra(e){const t=ev(e),n=g.forwardRef((r,o)=>{let{children:s,...i}=r;Kl(s)&&typeof Gr=="function"&&(s=Gr(s._payload));const c=g.Children.toArray(s),u=c.find(nv);if(u){const d=u.props.children,f=c.map(l=>l===u?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:l);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Qy=ra("Slot");function ev(e){const t=g.forwardRef((n,r)=>{let{children:o,...s}=n;if(Kl(o)&&typeof Gr=="function"&&(o=Gr(o._payload)),g.isValidElement(o)){const i=ov(o),c=rv(s,o.props);return o.type!==g.Fragment&&(c.ref=r?Mt(r,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tv=Symbol("radix.slottable");function nv(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tv}function rv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ov(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 sv=Wl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Q=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Qy:"button";return a.jsx(i,{className:ee(sv({variant:t,size:n,className:e})),ref:s,...o})});Q.displayName="Button";function xo({currentPage:e,pageSize:t,totalPages:n,total:r,onPageChange:o,onPageSizeChange:s,className:i}){const c=Wy(e,n),u=r>0;return a.jsxs("div",{className:ee("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-4 border-t mt-4",i),children:[a.jsxs("div",{className:"flex items-center justify-between w-full sm:w-auto gap-6",children:[u&&a.jsxs("p",{className:"text-sm text-muted-foreground font-medium",children:["Page ",e," of ",n]}),s&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Rows per page"}),a.jsx("select",{value:t,onChange:d=>s(Number(d.target.value)),className:"flex h-8 w-[70px] items-center justify-between rounded-md border border-input bg-popover text-popover-foreground px-2 py-1 text-xs shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring appearance-none",children:[10,20,30,50].map(d=>a.jsx("option",{value:d,children:d},d))})]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx(Q,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o(1),disabled:e<=1,title:"First page",children:a.jsx(qg,{className:"h-4 w-4"})}),a.jsx(Q,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o(e-1),disabled:e<=1,title:"Previous page",children:a.jsx(Hg,{className:"h-4 w-4"})}),u&&c.map((d,f)=>a.jsx("div",{className:"flex items-center",children:d==="..."?a.jsx("span",{className:"text-muted-foreground px-2 text-sm",children:"..."}):a.jsx(Q,{variant:e===d?"default":"outline",size:"icon",className:"h-8 min-w-8 px-2",onClick:()=>o(d),children:d})},`${d}-${f}`)),a.jsx(Q,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o(e+1),disabled:e>=n,title:"Next page",children:a.jsx(Sl,{className:"h-4 w-4"})}),a.jsx(Q,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o(n),disabled:e>=n,title:"Last page",children:a.jsx(Xg,{className:"h-4 w-4"})})]})]})}const Te=g.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:ee("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Te.displayName="Input";function av({onViewResult:e}){const[t,n]=R.useState([]),[r,o]=R.useState(0),[s,i]=R.useState(!0),[c,u]=R.useState(1),[d,f]=R.useState(""),[l,p]=R.useState(""),[h,x]=R.useState(()=>{try{return sessionStorage.getItem("insight-incidents-view")||"card"}catch{return"card"}}),[m,y]=R.useState(10);R.useEffect(()=>{const S=setTimeout(()=>{p(d),u(1)},400);return()=>clearTimeout(S)},[d]);const v=R.useCallback(async()=>{i(!0);try{const S={page:c,limit:m};l&&(S.search=l);const w=await be.listIncidents(S);n(w.incidents??[]),o(w.total??0)}catch{se.error("Failed to load incidents")}finally{i(!1)}},[c,m,l]);R.useEffect(()=>{v()},[v]);const b=Math.max(1,Math.ceil(r/m));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($n,{className:"h-6 w-6 text-primary"}),a.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Insight Incidents"})]}),a.jsx("span",{className:"text-muted-foreground text-sm mt-0.5",children:"AI-powered Root Cause Analysis for promoted alerts."})]}),a.jsxs("div",{className:"flex bg-muted/50 p-1 rounded-md border",children:[a.jsxs(Q,{size:"sm",variant:h==="card"?"secondary":"ghost",onClick:()=>x("card"),children:[a.jsx(Ys,{className:"h-4 w-4"}),"Card"]}),a.jsxs(Q,{size:"sm",variant:h==="table"?"secondary":"ghost",onClick:()=>x("table"),children:[a.jsx(Zs,{className:"h-3.5 w-3.5"}),"Table"]})]})]}),a.jsxs("div",{className:"relative w-fit",children:[a.jsx(fo,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),a.jsx(Te,{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:"Search monitor…",className:"pl-9 pr-8 w-[220px]"}),d&&a.jsx("button",{onClick:()=>f(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:a.jsx(er,{className:"h-4 w-4"})})]}),s&&t.length===0?a.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:a.jsx(ge,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex h-[60vh] flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center",children:[a.jsx("div",{className:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-muted/50 mb-4",children:a.jsx(Xs,{className:"h-10 w-10 text-muted-foreground"})}),a.jsx("h3",{className:"text-xl font-bold",children:"No incidents found"}),a.jsx("p",{className:"mt-2 text-sm text-muted-foreground max-w-sm",children:d?`No incidents matching "${d}".`:"Incidents are created by promoting alerts. Go to Alerts to promote an alert to an incident."})]}):a.jsxs(a.Fragment,{children:[s&&a.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:a.jsx(ge,{className:"h-10 w-10 animate-spin text-muted-foreground"})}),h==="card"&&a.jsx("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:t.map(S=>a.jsx(Ky,{incident:S,onViewResult:e},S.id))}),h==="table"&&a.jsx(Xy,{incidents:t,loading:s,onViewResult:e}),t.length>0&&a.jsx(xo,{currentPage:c,pageSize:m,totalPages:b,total:r,onPageChange:S=>u(S),onPageSizeChange:S=>{y(S),u(1)}})]})]})}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function iv(e,t){const n=g.createContext(t),r=s=>{const{children:i,...c}=s,u=g.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=g.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function an(e,t=[]){let n=[];function r(s,i){const c=g.createContext(i),u=n.length;n=[...n,i];const d=l=>{const{scope:p,children:h,...x}=l,m=p?.[e]?.[u]||c,y=g.useMemo(()=>x,Object.values(x));return a.jsx(m.Provider,{value:y,children:h})};d.displayName=s+"Provider";function f(l,p){const h=p?.[e]?.[u]||c,x=g.useContext(h);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[d,f]}const o=()=>{const s=n.map(i=>g.createContext(i));return function(c){const u=c?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,cv(o,...t)]}function cv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((c,{useScope:u,scopeName:d})=>{const l=u(s)[`__scope${d}`];return{...c,...l}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Gi(e){const t=lv(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,c=g.Children.toArray(s),u=c.find(uv);if(u){const d=u.props.children,f=c.map(l=>l===u?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:l);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function lv(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=hv(o),c=fv(s,o.props);return o.type!==g.Fragment&&(c.ref=r?Mt(r,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dv=Symbol("radix.slottable");function uv(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dv}function fv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function hv(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 Gl(e){const t=e+"CollectionProvider",[n,r]=an(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:v}=m,b=R.useRef(null),S=R.useRef(new Map).current;return a.jsx(o,{scope:y,itemMap:S,collectionRef:b,children:v})};i.displayName=t;const c=e+"CollectionSlot",u=Gi(c),d=R.forwardRef((m,y)=>{const{scope:v,children:b}=m,S=s(c,v),w=Ce(y,S.collectionRef);return a.jsx(u,{ref:w,children:b})});d.displayName=c;const f=e+"CollectionItemSlot",l="data-radix-collection-item",p=Gi(f),h=R.forwardRef((m,y)=>{const{scope:v,children:b,...S}=m,w=R.useRef(null),_=Ce(y,w),E=s(f,v);return R.useEffect(()=>(E.itemMap.set(w,{ref:w,...S}),()=>{E.itemMap.delete(w)})),a.jsx(p,{[l]:"",ref:_,children:b})});h.displayName=f;function x(m){const y=s(e+"CollectionConsumer",m);return R.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${l}]`));return Array.from(y.itemMap.values()).sort((E,C)=>S.indexOf(E.ref.current)-S.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},x,r]}var Pt=globalThis?.document?g.useLayoutEffect:()=>{},pv=g[" useId ".trim().toString()]||(()=>{}),mv=0;function Qt(e){const[t,n]=g.useState(pv());return Pt(()=>{n(r=>r??String(mv++))},[e]),t?`radix-${t}`:""}function gv(e){const t=xv(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,c=g.Children.toArray(s),u=c.find(vv);if(u){const d=u.props.children,f=c.map(l=>l===u?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:l);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function xv(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=wv(o),c=bv(s,o.props);return o.type!==g.Fragment&&(c.ref=r?Mt(r,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yv=Symbol("radix.slottable");function vv(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yv}function bv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wv(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 Sv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=Sv.reduce((e,t)=>{const n=gv(`Primitive.${t}`),r=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ql(e,t){e&&Sc.flushSync(()=>e.dispatchEvent(t))}function pt(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}var Nv=g[" useInsertionEffect ".trim().toString()]||Pt;function yo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Rv({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const l=f.current;l!==c&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const d=g.useCallback(f=>{if(c){const l=Cv(f)?f(e):f;l!==e&&i.current?.(l)}else s(f)},[c,e,s,i]);return[u,d]}function Rv({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),s=g.useRef(t);return Nv(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Cv(e){return typeof e=="function"}var jv=g.createContext(void 0);function oa(e){const t=g.useContext(jv);return e||t||"ltr"}var Qo="rovingFocusGroup.onEntryFocus",Ev={bubbles:!1,cancelable:!0},tr="RovingFocusGroup",[Rs,Yl,_v]=Gl(tr),[kv,vo]=an(tr,[_v]),[Pv,Av]=kv(tr),Xl=g.forwardRef((e,t)=>a.jsx(Rs.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Rs.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Tv,{...e,ref:t})})}));Xl.displayName=tr;var Tv=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...l}=e,p=g.useRef(null),h=Ce(t,p),x=oa(s),[m,y]=yo({prop:i,defaultProp:c??null,onChange:u,caller:tr}),[v,b]=g.useState(!1),S=pt(d),w=Yl(n),_=g.useRef(!1),[E,C]=g.useState(0);return g.useEffect(()=>{const N=p.current;if(N)return N.addEventListener(Qo,S),()=>N.removeEventListener(Qo,S)},[S]),a.jsx(Pv,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:g.useCallback(N=>y(N),[y]),onItemShiftTab:g.useCallback(()=>b(!0),[]),onFocusableItemAdd:g.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:g.useCallback(()=>C(N=>N-1),[]),children:a.jsx(le.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...l,ref:h,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{_.current=!0}),onFocus:ne(e.onFocus,N=>{const P=!_.current;if(N.target===N.currentTarget&&P&&!v){const T=new CustomEvent(Qo,Ev);if(N.currentTarget.dispatchEvent(T),!T.defaultPrevented){const M=w().filter(F=>F.focusable),D=M.find(F=>F.active),G=M.find(F=>F.id===m),$=[D,G,...M].filter(Boolean).map(F=>F.ref.current);Ql($,f)}}_.current=!1}),onBlur:ne(e.onBlur,()=>b(!1))})})}),Jl="RovingFocusGroupItem",Zl=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...c}=e,u=Qt(),d=s||u,f=Av(Jl,n),l=f.currentTabStopId===d,p=Yl(n),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:m}=f;return g.useEffect(()=>{if(r)return h(),()=>x()},[r,h,x]),a.jsx(Rs.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:a.jsx(le.span,{tabIndex:l?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:ne(e.onMouseDown,y=>{r?f.onItemFocus(d):y.preventDefault()}),onFocus:ne(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:ne(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Iv(y,f.orientation,f.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=p().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const w=S.indexOf(y.currentTarget);S=f.loop?Dv(S,w+1):S.slice(w+1)}setTimeout(()=>Ql(S))}}),children:typeof i=="function"?i({isCurrentTabStop:l,hasTabStop:m!=null}):i})})});Zl.displayName=Jl;var Ov={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Iv(e,t,n){const r=Mv(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ov[r]}function Ql(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Dv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ed=Xl,td=Zl;function Lv(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var xt=e=>{const{present:t,children:n}=e,r=Fv(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=Ce(r.ref,Bv(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:s}):null};xt.displayName="Presence";function Fv(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[c,u]=Lv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=br(r.current);s.current=c==="mounted"?d:"none"},[c]),Pt(()=>{const d=r.current,f=o.current;if(f!==e){const p=s.current,h=br(d);e?u("MOUNT"):h==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Pt(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,l=h=>{const m=br(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(s.current=br(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function br(e){return e?.animationName||"none"}function Bv(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 bo="Tabs",[$v]=an(bo,[vo]),nd=vo(),[zv,sa]=$v(bo),rd=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=oa(c),[l,p]=yo({prop:r,onChange:o,defaultProp:s??"",caller:bo});return a.jsx(zv,{scope:n,baseId:Qt(),value:l,onValueChange:p,orientation:i,dir:f,activationMode:u,children:a.jsx(le.div,{dir:f,"data-orientation":i,...d,ref:t})})});rd.displayName=bo;var od="TabsList",sd=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=sa(od,n),i=nd(n);return a.jsx(ed,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:a.jsx(le.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});sd.displayName=od;var ad="TabsTrigger",id=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=sa(ad,n),c=nd(n),u=dd(i.baseId,r),d=ud(i.baseId,r),f=r===i.value;return a.jsx(td,{asChild:!0,...c,focusable:!o,active:f,children:a.jsx(le.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:ne(e.onMouseDown,l=>{!o&&l.button===0&&l.ctrlKey===!1?i.onValueChange(r):l.preventDefault()}),onKeyDown:ne(e.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&i.onValueChange(r)}),onFocus:ne(e.onFocus,()=>{const l=i.activationMode!=="manual";!f&&!o&&l&&i.onValueChange(r)})})})});id.displayName=ad;var cd="TabsContent",ld=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,c=sa(cd,n),u=dd(c.baseId,r),d=ud(c.baseId,r),f=r===c.value,l=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(p)},[]),a.jsx(xt,{present:o||f,children:({present:p})=>a.jsx(le.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:l.current?"0s":void 0},children:p&&s})})});ld.displayName=cd;function dd(e,t){return`${e}-trigger-${t}`}function ud(e,t){return`${e}-content-${t}`}var Uv=rd,fd=sd,hd=id,pd=ld;const md=Uv,aa=g.forwardRef(({className:e,...t},n)=>a.jsx(fd,{ref:n,className:ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));aa.displayName=fd.displayName;const Gt=g.forwardRef(({className:e,...t},n)=>a.jsx(hd,{ref:n,className:ee("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Gt.displayName=hd.displayName;const qt=g.forwardRef(({className:e,...t},n)=>a.jsx(pd,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qt.displayName=pd.displayName;function Vv({text:e}){const[t,n]=R.useState(!1);return a.jsx(Q,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-7 w-7 text-neutral-400 hover:text-neutral-100 hover:bg-neutral-800",onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},children:t?a.jsx(Ur,{className:"h-3.5 w-3.5 text-emerald-400"}):a.jsx(Gs,{className:"h-3.5 w-3.5"})})}function Wv({result:e,remediationSteps:t,confidenceScore:n,aiModelUsed:r}){const o=t&&typeof t=="object"&&!Array.isArray(t)?t:null,[s,i]=R.useState("overview"),c=!!(e.timeline?.buildup||e.timeline?.failure||e.timeline?.impact||e.infra_change_analysis),u=!!(e.log_analysis?.nginx||e.log_analysis?.system||e.log_analysis?.database||e.log_analysis?.application||e.metrics_analysis),d=!!(o?.immediate_actions?.length||o?.verification_steps?.length||o?.rollback_steps?.length||o?.communication_template),f=n==null?"text-muted-foreground":n>=80?"text-emerald-600 dark:text-emerald-400":n>=50?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400",l=[{label:"Confidence Score",value:n!=null?a.jsxs("span",{className:ee("font-bold text-sm tabular-nums",f),children:[n,"%"]}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"})},{label:"Status",value:a.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-semibold flex items-center justify-center gap-1",children:[a.jsx(Dx,{className:"h-3.5 w-3.5"}),"Ready"]})}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:ee("grid gap-3",l.length===3?"grid-cols-3":"grid-cols-2"),children:l.map(({label:p,value:h})=>a.jsx(Ne,{className:"bg-muted/30 border-none shadow-none",children:a.jsxs(Re,{className:"p-3 text-center flex flex-col items-center justify-center gap-1",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:p}),a.jsx("div",{className:"flex items-center justify-center min-h-[20px] w-full",children:h})]})},p))}),a.jsxs(md,{value:s,onValueChange:i,children:[a.jsxs(aa,{className:"w-full justify-start border-b rounded-none h-auto p-0 bg-transparent overflow-x-auto flex-nowrap",children:[a.jsx(Gt,{value:"overview",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Overview & RCA"}),a.jsx(Gt,{value:"timeline",disabled:!c,className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Timeline & Changes"}),a.jsx(Gt,{value:"logs_metrics",disabled:!u,className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Logs & Metrics"}),a.jsx(Gt,{value:"remediation",disabled:!d,className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Remediation Plan"})]}),a.jsxs("div",{className:"pt-4",children:[a.jsxs(qt,{value:"overview",className:"m-0 space-y-4",children:[e.summary&&a.jsx(Ne,{children:a.jsxs(Re,{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-primary text-sm",children:[a.jsx(Fx,{className:"h-4 w-4 text-amber-500 animate-pulse"}),a.jsx("span",{children:"Executive Summary"})]}),a.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed whitespace-pre-wrap",children:e.summary})]})}),e.root_cause_analysis&&a.jsx(Ne,{className:"border-red-500/20 bg-red-500/5",children:a.jsxs(Re,{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-red-600 dark:text-red-400 text-sm",children:[a.jsx(Sx,{className:"h-4 w-4"}),a.jsx("span",{children:"Root Cause Analysis"})]}),a.jsx("p",{className:"text-sm text-foreground/95 leading-relaxed whitespace-pre-wrap font-sans",children:e.root_cause_analysis})]})}),e.blast_radius&&a.jsx(Ne,{children:a.jsxs(Re,{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-sm text-foreground",children:[a.jsx(Ws,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}),a.jsx("span",{children:"Blast Radius & Impact Scope"})]}),a.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed whitespace-pre-wrap",children:e.blast_radius})]})}),e.contributing_factors&&e.contributing_factors.length>0&&a.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4 space-y-2",children:[a.jsxs("div",{className:"font-semibold text-sm text-foreground flex items-center gap-2",children:[a.jsx(tx,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Contributing Factors"})]}),a.jsx("ul",{className:"list-disc list-inside text-sm text-muted-foreground space-y-1.5 pl-1",children:e.contributing_factors.map((p,h)=>a.jsx("li",{className:"leading-relaxed",children:p},h))})]})]}),a.jsxs(qt,{value:"timeline",className:"m-0 space-y-6",children:[e.timeline&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[a.jsx(Fg,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Incident Timeline"})]}),a.jsxs("div",{className:"relative border-l border-muted pl-6 ml-3 space-y-6",children:[e.timeline.buildup&&a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute -left-[34px] top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary ring-4 ring-background",children:a.jsx("span",{className:"h-2 w-2 rounded-full bg-background"})}),a.jsx("h4",{className:"font-semibold text-sm text-foreground",children:"Buildup Phase"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-wrap leading-relaxed",children:e.timeline.buildup})]}),e.timeline.failure&&a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute -left-[34px] top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary ring-4 ring-background",children:a.jsx("span",{className:"h-2 w-2 rounded-full bg-background"})}),a.jsx("h4",{className:"font-semibold text-sm text-foreground",children:"Failure Trigger"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-wrap leading-relaxed",children:e.timeline.failure})]}),e.timeline.impact&&a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute -left-[34px] top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary ring-4 ring-background",children:a.jsx("span",{className:"h-2 w-2 rounded-full bg-background"})}),a.jsx("h4",{className:"font-semibold text-sm text-foreground",children:"Active Impact"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-wrap leading-relaxed",children:e.timeline.impact})]})]})]}),e.infra_change_analysis&&a.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-sm",children:[a.jsx(Di,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Infrastructure Change Analysis"})]}),a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-wrap",children:e.infra_change_analysis})]})]}),a.jsxs(qt,{value:"logs_metrics",className:"m-0 space-y-6",children:[e.log_analysis&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-semibold text-sm",children:"Log Analysis by Component"}),a.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:Object.entries(e.log_analysis).map(([p,h])=>h?a.jsx(Ne,{className:"hover:border-primary/20 transition-all",children:a.jsxs(Re,{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"text-xs font-semibold text-primary uppercase tracking-wider",children:[p," Logs"]}),a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-wrap",children:h})]})},p):null)})]}),e.metrics_analysis&&a.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-sm",children:[a.jsx(qs,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Metrics & Resource Analysis"})]}),a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-wrap",children:e.metrics_analysis})]})]}),a.jsx(qt,{value:"remediation",className:"m-0 space-y-6",children:o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.immediate_actions&&o.immediate_actions.length>0&&a.jsx(Ne,{children:a.jsxs(Re,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-sm text-foreground",children:[a.jsx(Qg,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Immediate Actions"})]}),a.jsx("ul",{className:"text-sm text-muted-foreground space-y-2 pl-1",children:o.immediate_actions.map((p,h)=>a.jsxs("li",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"font-mono text-xs text-foreground/80 mt-0.5 shrink-0 bg-primary/10 px-1.5 py-0.5 rounded",children:h+1}),a.jsx("span",{className:"leading-relaxed text-foreground/80",children:p})]},h))})]})}),o.verification_steps&&o.verification_steps.length>0&&a.jsx(Ne,{children:a.jsxs(Re,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-sm text-foreground",children:[a.jsx(Wx,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Verification Steps"})]}),a.jsx("ul",{className:"text-sm text-muted-foreground space-y-2 pl-1",children:o.verification_steps.map((p,h)=>a.jsxs("li",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"font-mono text-xs text-foreground/80 mt-0.5 shrink-0 bg-primary/10 px-1.5 py-0.5 rounded",children:h+1}),a.jsx("span",{className:"leading-relaxed text-foreground/80",children:p})]},h))})]})})]}),o.rollback_steps&&o.rollback_steps.length>0&&a.jsx(Ne,{children:a.jsxs(Re,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-foreground font-semibold text-sm",children:[a.jsx(Di,{className:"h-4 w-4 text-amber-500"}),a.jsx("span",{children:"Rollback Steps"})]}),a.jsx("ul",{className:"text-sm text-muted-foreground space-y-2 pl-1",children:o.rollback_steps.map((p,h)=>a.jsxs("li",{className:"flex gap-2 items-start",children:[a.jsx("span",{className:"font-mono text-xs text-foreground/80 mt-0.5 shrink-0 bg-primary/10 px-1.5 py-0.5 rounded",children:h+1}),a.jsx("span",{className:"leading-relaxed text-foreground/80",children:p})]},h))})]})}),o.communication_template&&a.jsx(Ne,{className:"relative",children:a.jsxs(Re,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold text-primary text-sm",children:[a.jsx(bx,{className:"h-4 w-4 text-primary"}),a.jsx("span",{children:"Status Update / Communication Template"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("pre",{className:"text-xs whitespace-pre-wrap leading-relaxed font-sans text-foreground/90 bg-muted/40 p-4 pr-12 rounded-md border",children:o.communication_template}),a.jsx(Vv,{text:o.communication_template})]})]})})]})})]})]})]})}function qi(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Hv({incidentId:e,onBack:t,onViewAlert:n}){const[r,o]=R.useState(null),[s,i]=R.useState(!0),[c,u]=R.useState("timeline"),d=R.useCallback(async()=>{try{const b=await be.getIncident(e);o(b.incident)}catch{se.error("Failed to load incident")}finally{i(!1)}},[e]);R.useEffect(()=>{d()},[d]);const f=r?.analysisStatus==="triggered"||r?.analysisStatus==="processing",l=Cl(e,!!f,r?.analysisStatus??"pending");R.useEffect(()=>{(l.isComplete||l.isFailed)&&d()},[l.isComplete,l.isFailed,d]);const p=async b=>{l.optimisticTrigger();try{await be.triggerAnalysis(b),se.success("Analysis triggered"),d()}catch(S){se.error(S?.response?.data?.error??"Failed to trigger analysis")}};if(s)return a.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:a.jsx(ge,{className:"h-10 w-10 animate-spin text-muted-foreground"})});if(!r)return a.jsxs("div",{className:"flex h-[60vh] flex-col items-center justify-center text-center gap-4",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Incident Not Found"}),a.jsxs(Q,{variant:"outline",onClick:t,children:[a.jsx(Ii,{className:"mr-2 h-4 w-4"})," Back"]})]});const h=f||l.status==="triggered"||l.status==="processing"?l.status??r.analysisStatus:r.analysisStatus,x=h==="triggered"||h==="processing",m=h==="completed",y=h==="failed"&&!x,v=h==="pending";return a.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 min-h-0",children:[a.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Q,{variant:"ghost",size:"icon",onClick:t,className:"shrink-0","aria-label":"Back to incidents",children:a.jsx(Ii,{className:"h-5 w-5"})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight truncate",children:r.monitorName}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.aliasId?`INC-${String(r.aliasId).padStart(3,"0")} `:""," · ",r.monitorType.toUpperCase()," incident · created ",qi(r.createdAt)]})]})]}),a.jsx(Ne,{children:a.jsx(Re,{className:"p-4",children:a.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2.5 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(qs,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:"Resource"})]}),a.jsx("code",{className:"text-xs font-mono truncate",children:r.monitorName}),a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Xs,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:"Type"})]}),a.jsx(st,{variant:"outline",className:"w-fit text-[10px]",children:r.monitorType.toUpperCase()}),a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Ks,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:"Down At"})]}),a.jsx("span",{className:"text-xs",children:r.incidentDownTime?new Date(r.incidentDownTime).toLocaleString():qi(r.createdAt)}),r.downMessage&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground col-span-2 border-t pt-2 mt-0.5",children:[a.jsx(Li,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:"Message"})]}),a.jsx("p",{className:"col-span-2 text-xs text-muted-foreground leading-relaxed -mt-1",children:r.downMessage})]}),r.sourceAlertId&&n&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(xx,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:"Source Alert"})]}),a.jsx("button",{onClick:()=>n(r.sourceAlertId),className:"text-xs text-primary hover:underline text-left truncate",children:r.sourceAlertId})]})]})})}),a.jsxs(md,{value:c,onValueChange:u,children:[a.jsxs(aa,{className:"w-full justify-start border-b rounded-none h-auto p-0 bg-transparent",children:[a.jsx(Gt,{value:"timeline",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Timeline"}),a.jsx(Gt,{value:"analysis",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Raw Analysis"})]}),a.jsxs("div",{className:"pt-4",children:[a.jsx(qt,{value:"timeline",className:"m-0 space-y-2 text-sm",children:[["Alert / Down",r.incidentDownTime||r.createdAt],["Incident Created",r.createdAt],r.analysisTriggeredAt&&["Analysis Triggered",r.analysisTriggeredAt],r.analysisCompletedAt&&["Analysis Completed",r.analysisCompletedAt],r.resolvedAt&&["Resolved",r.resolvedAt]].filter(Boolean).map(([b,S],w)=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted",children:a.jsx("span",{className:"h-2 w-2 rounded-full bg-primary"})}),a.jsxs("div",{className:"flex-1 flex justify-between items-center border-b pb-2",children:[a.jsx("span",{className:"text-muted-foreground",children:b}),a.jsx("span",{className:"text-xs",children:new Date(S).toLocaleString()})]})]},w))}),a.jsx(qt,{value:"analysis",className:"m-0",children:m?a.jsx("pre",{className:"text-xs font-mono bg-neutral-950 text-neutral-100 p-4 rounded-lg overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(r.analysisResult,null,2)}):a.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:[a.jsx($n,{className:"h-8 w-8 mx-auto mb-2 opacity-40"}),a.jsx("p",{children:"No analysis data yet."})]})})]})]})]}),a.jsx("aside",{className:"lg:w-80 xl:w-96 shrink-0",children:a.jsxs(Ne,{className:"sticky top-4 overflow-hidden",children:[a.jsxs(ho,{className:"flex flex-row items-center gap-2 px-4 py-3 border-b bg-muted/40 space-y-0",children:[a.jsx($n,{className:"h-4 w-4 text-primary"}),a.jsx(na,{className:"text-sm font-semibold",children:"AI RCA Assistant"})]}),a.jsxs(Re,{className:"p-4",children:[x&&a.jsxs("div",{className:"space-y-3 text-center py-4",children:[a.jsx(ge,{className:"h-8 w-8 animate-spin text-primary mx-auto"}),a.jsx("p",{className:"font-medium text-sm",children:"Analysis in progress…"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"h-2 rounded-full bg-primary/20 overflow-hidden",children:a.jsx("div",{className:"h-full bg-primary transition-all duration-1000",style:{width:`${l.progressPercent>0?l.progressPercent:5}%`}})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:l.progressPercent>0?`${l.progressPercent}% complete`:"Waiting for AI…"})]})]}),m&&!x&&r.analysisResult&&a.jsx("div",{className:"space-y-4",children:typeof r.analysisResult=="string"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3 text-center",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Confidence"}),a.jsx("div",{className:"font-bold mt-0.5",children:r.confidenceScore!=null?`${r.confidenceScore}%`:"—"})]}),a.jsx("pre",{className:"text-xs whitespace-pre-wrap leading-relaxed font-sans bg-muted/20 p-3 rounded border",children:r.analysisResult})]}):a.jsx(Wv,{result:r.analysisResult,remediationSteps:r.remediationSteps,confidenceScore:r.confidenceScore,aiModelUsed:r.aiModelUsed})}),y&&a.jsxs("div",{className:"space-y-3 py-2",children:[a.jsxs("div",{className:"rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 p-3 text-center",children:[a.jsx(Li,{className:"h-6 w-6 text-red-500 mx-auto mb-1.5"}),a.jsx("p",{className:"text-sm font-medium text-red-600 dark:text-red-400",children:"Analysis failed"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Something went wrong with the AI pipeline."})]}),a.jsxs(Q,{variant:"outline",className:"w-full",onClick:()=>p(r.id),children:[a.jsx(Ex,{className:"mr-2 h-4 w-4"})," Retry Analysis"]})]}),v&&a.jsxs("div",{className:"space-y-3 py-2",children:[a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx($n,{className:"h-10 w-10 text-muted-foreground mx-auto"}),a.jsx("p",{className:"text-sm font-medium",children:"No analysis yet"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Run AI-powered root cause analysis on this incident."})]}),a.jsxs(Q,{className:"w-full",onClick:()=>p(r.id),children:[a.jsx($n,{className:"mr-2 h-4 w-4"})," Run Analysis"]})]})]})]})})]})}function Kv({text:e}){const[t,n]=R.useState(!1),r=o=>{o.stopPropagation(),navigator.clipboard.writeText(e).catch(()=>{}),n(!0),setTimeout(()=>n(!1),2e3)};return a.jsxs(Q,{variant:"secondary",size:"sm",onClick:r,className:`rounded-md bg-primary text-secondary hover:bg-primary/80 h-8 px-4 gap-2 text-xs font-medium transition-all ${t?"bg-emerald-50 text-emerald-700 hover:bg-emerald-100 hover:text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400":""}`,"aria-label":"Copy webhook URL",children:[t?a.jsx(Ur,{className:"h-3.5 w-3.5"}):a.jsx(Gs,{className:"h-3.5 w-3.5"}),t?"Copied!":"Copy Webhook"]})}function Gv({connector:e,deletingId:t,rotatingId:n,onEdit:r,onRotate:o,onDelete:s}){const i=t===e.id,c=n===e.id,u=`${window.location.origin}/api/v1/insight/webhook/${e.webhookToken}`;return a.jsx(Ne,{className:"hover:shadow-sm hover:border-primary/30 transition-all flex flex-col bg-card border-border",children:a.jsxs(Re,{className:"p-5 flex flex-col gap-4 h-full",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-muted/80 text-foreground",children:a.jsx(Ss,{size:20})}),a.jsxs("div",{className:"flex gap-1 shrink-0",children:[a.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>r(e),disabled:i,className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:"Configure connector",children:a.jsx(Js,{size:16})}),a.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>o(e.id),disabled:i||c,className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:"Rotate webhook token",children:c?a.jsx(ge,{size:16,className:"animate-spin"}):a.jsx(kx,{size:16})}),a.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>s(e.id),disabled:i||c,className:"h-8 w-8 text-red-500/80 hover:text-red-500 hover:bg-red-500/10",title:"Delete connector",children:i?a.jsx(ge,{size:16,className:"animate-spin"}):a.jsx(Qs,{size:16})})]})]}),a.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[a.jsx("h3",{className:"font-semibold text-md text-card-foreground leading-tight truncate",children:e.name}),e.description?a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):a.jsxs("p",{className:"text-sm text-muted-foreground/50 italic",children:["No description —"," ",a.jsx("button",{onClick:()=>r(e),className:"underline underline-offset-2 hover:text-muted-foreground transition-colors",children:"add one"})]})]}),a.jsxs("div",{className:"mt-auto pt-2 flex items-center justify-between",children:[a.jsx(st,{variant:"secondary",className:"uppercase tracking-wider text-[10px] font-semibold px-2 py-0.5 rounded-md",children:e.type}),a.jsx(Kv,{text:u})]})]})})}function qv(e,t=globalThis?.document){const n=pt(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Yv="DismissableLayer",Cs="dismissableLayer.update",Xv="dismissableLayer.pointerDownOutside",Jv="dismissableLayer.focusOutside",Yi,gd=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ia=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...u}=e,d=g.useContext(gd),[f,l]=g.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=g.useState({}),x=Ce(t,C=>l(C)),m=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(y),b=f?m.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,w=b>=v,_=eb(C=>{const N=C.target,P=[...d.branches].some(T=>T.contains(N));!w||P||(o?.(C),i?.(C),C.defaultPrevented||c?.())},p),E=tb(C=>{const N=C.target;[...d.branches].some(T=>T.contains(N))||(s?.(C),i?.(C),C.defaultPrevented||c?.())},p);return qv(C=>{b===d.layers.size-1&&(r?.(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},p),g.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yi=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Xi(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yi)}},[f,p,n,d]),g.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Xi())},[f,d]),g.useEffect(()=>{const C=()=>h({});return document.addEventListener(Cs,C),()=>document.removeEventListener(Cs,C)},[]),a.jsx(le.div,{...u,ref:x,style:{pointerEvents:S?w?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,_.onPointerDownCapture)})});ia.displayName=Yv;var Zv="DismissableLayerBranch",Qv=g.forwardRef((e,t)=>{const n=g.useContext(gd),r=g.useRef(null),o=Ce(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(le.div,{...e,ref:o})});Qv.displayName=Zv;function eb(e,t=globalThis?.document){const n=pt(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let u=function(){xd(Xv,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tb(e,t=globalThis?.document){const n=pt(e),r=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!r.current&&xd(Jv,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Xi(){const e=new CustomEvent(Cs);document.dispatchEvent(e)}function xd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ql(o,s):o.dispatchEvent(s)}var es="focusScope.autoFocusOnMount",ts="focusScope.autoFocusOnUnmount",Ji={bubbles:!1,cancelable:!0},nb="FocusScope",ca=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[c,u]=g.useState(null),d=pt(o),f=pt(s),l=g.useRef(null),p=Ce(t,m=>u(m)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let m=function(S){if(h.paused||!c)return;const w=S.target;c.contains(w)?l.current=w:Rt(l.current,{select:!0})},y=function(S){if(h.paused||!c)return;const w=S.relatedTarget;w!==null&&(c.contains(w)||Rt(l.current,{select:!0}))},v=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&Rt(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(v);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,c,h.paused]),g.useEffect(()=>{if(c){Qi.add(h);const m=document.activeElement;if(!c.contains(m)){const v=new CustomEvent(es,Ji);c.addEventListener(es,d),c.dispatchEvent(v),v.defaultPrevented||(rb(cb(yd(c)),{select:!0}),document.activeElement===m&&Rt(c))}return()=>{c.removeEventListener(es,d),setTimeout(()=>{const v=new CustomEvent(ts,Ji);c.addEventListener(ts,f),c.dispatchEvent(v),v.defaultPrevented||Rt(m??document.body,{select:!0}),c.removeEventListener(ts,f),Qi.remove(h)},0)}}},[c,d,f,h]);const x=g.useCallback(m=>{if(!n&&!r||h.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const b=m.currentTarget,[S,w]=ob(b);S&&w?!m.shiftKey&&v===w?(m.preventDefault(),n&&Rt(S,{select:!0})):m.shiftKey&&v===S&&(m.preventDefault(),n&&Rt(w,{select:!0})):v===b&&m.preventDefault()}},[n,r,h.paused]);return a.jsx(le.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});ca.displayName=nb;function rb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rt(r,{select:t}),document.activeElement!==n)return}function ob(e){const t=yd(e),n=Zi(t,e),r=Zi(t.reverse(),e);return[n,r]}function yd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zi(e,t){for(const n of e)if(!sb(n,{upTo:t}))return n}function sb(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 ab(e){return e instanceof HTMLInputElement&&"select"in e}function Rt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ab(e)&&t&&e.select()}}var Qi=ib();function ib(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ec(e,t),e.unshift(t)},remove(t){e=ec(e,t),e[0]?.resume()}}}function ec(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cb(e){return e.filter(t=>t.tagName!=="A")}var lb="Portal",la=g.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=g.useState(!1);Pt(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?to.createPortal(a.jsx(le.div,{...r,ref:t}),i):null});la.displayName=lb;var ns=0;function vd(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tc()),document.body.insertAdjacentElement("beforeend",e[1]??tc()),ns++,()=>{ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ns--}},[])}function tc(){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 rt=function(){return rt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},rt.apply(this,arguments)};function bd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function db(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Or="right-scroll-bar-position",Mr="width-before-scroll-bar",ub="with-scroll-bars-hidden",fb="--removed-body-scroll-bar-size";function rs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hb(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pb=typeof window<"u"?g.useLayoutEffect:g.useEffect,nc=new WeakMap;function mb(e,t){var n=hb(null,function(r){return e.forEach(function(o){return rs(o,r)})});return pb(function(){var r=nc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(c){s.has(c)||rs(c,null)}),s.forEach(function(c){o.has(c)||rs(c,i)})}nc.set(n,e)},[e]),n}function gb(e){return e}function xb(e,t){t===void 0&&(t=gb);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function yb(e){e===void 0&&(e={});var t=xb(null);return t.options=rt({async:!0,ssr:!1},e),t}var wd=function(e){var t=e.sideCar,n=bd(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 g.createElement(r,rt({},n))};wd.isSideCarExport=!0;function vb(e,t){return e.useMedium(t),wd}var Sd=yb(),os=function(){},wo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:os,onWheelCapture:os,onTouchMoveCapture:os}),o=r[0],s=r[1],i=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,l=e.shards,p=e.sideCar,h=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,S=e.gapMode,w=bd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=p,E=mb([n,t]),C=rt(rt({},w),o);return g.createElement(g.Fragment,null,f&&g.createElement(_,{sideCar:Sd,removeScrollBar:d,shards:l,noRelative:h,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:S}),i?g.cloneElement(g.Children.only(c),rt(rt({},C),{ref:E})):g.createElement(b,rt({},C,{className:u,ref:E}),c))});wo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wo.classNames={fullWidth:Mr,zeroRight:Or};var bb=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wb(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bb();return t&&e.setAttribute("nonce",t),e}function Sb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nb(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Rb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wb())&&(Sb(t,n),Nb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cb=function(){var e=Rb();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nd=function(){var e=Cb(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},jb={left:0,top:0,right:0,gap:0},ss=function(e){return parseInt(e||"",10)||0},Eb=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ss(n),ss(r),ss(o)]},_b=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jb;var t=Eb(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])}},kb=Nd(),Sn="data-scroll-locked",Pb=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
15
|
+
.`.concat(ub,` {
|
|
16
|
+
overflow: hidden `).concat(r,`;
|
|
17
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
18
|
+
}
|
|
19
|
+
body[`).concat(Sn,`] {
|
|
20
|
+
overflow: hidden `).concat(r,`;
|
|
21
|
+
overscroll-behavior: contain;
|
|
22
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
23
|
+
padding-left: `.concat(o,`px;
|
|
24
|
+
padding-top: `).concat(s,`px;
|
|
25
|
+
padding-right: `).concat(i,`px;
|
|
26
|
+
margin-left:0;
|
|
27
|
+
margin-top:0;
|
|
28
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
29
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.`).concat(Or,` {
|
|
33
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.`).concat(Mr,` {
|
|
37
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.`).concat(Or," .").concat(Or,` {
|
|
41
|
+
right: 0 `).concat(r,`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.`).concat(Mr," .").concat(Mr,` {
|
|
45
|
+
margin-right: 0 `).concat(r,`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
body[`).concat(Sn,`] {
|
|
49
|
+
`).concat(fb,": ").concat(c,`px;
|
|
50
|
+
}
|
|
51
|
+
`)},rc=function(){var e=parseInt(document.body.getAttribute(Sn)||"0",10);return isFinite(e)?e:0},Ab=function(){g.useEffect(function(){return document.body.setAttribute(Sn,(rc()+1).toString()),function(){var e=rc()-1;e<=0?document.body.removeAttribute(Sn):document.body.setAttribute(Sn,e.toString())}},[])},Tb=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ab();var s=g.useMemo(function(){return _b(o)},[o]);return g.createElement(kb,{styles:Pb(s,!t,o,n?"":"!important")})},js=!1;if(typeof window<"u")try{var wr=Object.defineProperty({},"passive",{get:function(){return js=!0,!0}});window.addEventListener("test",wr,wr),window.removeEventListener("test",wr,wr)}catch{js=!1}var mn=js?{passive:!1}:!1,Ob=function(e){return e.tagName==="TEXTAREA"},Rd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ob(e)&&n[t]==="visible")},Mb=function(e){return Rd(e,"overflowY")},Ib=function(e){return Rd(e,"overflowX")},oc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Cd(e,r);if(o){var s=jd(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Db=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Lb=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Cd=function(e,t){return e==="v"?Mb(t):Ib(t)},jd=function(e,t){return e==="v"?Db(t):Lb(t)},Fb=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bb=function(e,t,n,r,o){var s=Fb(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,u=t.contains(c),d=!1,f=i>0,l=0,p=0;do{if(!c)break;var h=jd(e,c),x=h[0],m=h[1],y=h[2],v=m-y-s*x;(x||v)&&Cd(e,c)&&(l+=v,p+=x);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(p)<1)&&(d=!0),d},Sr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sc=function(e){return[e.deltaX,e.deltaY]},ac=function(e){return e&&"current"in e?e.current:e},$b=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zb=function(e){return`
|
|
52
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
53
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
54
|
+
`)},Ub=0,gn=[];function Vb(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(Ub++)[0],s=g.useState(Nd)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=db([e.lockRef.current],(e.shards||[]).map(ac),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=g.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var v=Sr(m),b=n.current,S="deltaX"in m?m.deltaX:b[0]-v[0],w="deltaY"in m?m.deltaY:b[1]-v[1],_,E=m.target,C=Math.abs(S)>Math.abs(w)?"h":"v";if("touches"in m&&C==="h"&&E.type==="range")return!1;var N=window.getSelection(),P=N&&N.anchorNode,T=P?P===E||P.contains(E):!1;if(T)return!1;var M=oc(C,E);if(!M)return!0;if(M?_=C:(_=C==="v"?"h":"v",M=oc(C,E)),!M)return!1;if(!r.current&&"changedTouches"in m&&(S||w)&&(r.current=_),!_)return!0;var D=r.current||_;return Bb(D,y,m,D==="h"?S:w)},[]),u=g.useCallback(function(m){var y=m;if(!(!gn.length||gn[gn.length-1]!==s)){var v="deltaY"in y?sc(y):Sr(y),b=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&$b(_.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(ac).filter(Boolean).filter(function(_){return _.contains(y.target)}),w=S.length>0?c(y,S[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),d=g.useCallback(function(m,y,v,b){var S={name:m,delta:y,target:v,should:b,shadowParent:Wb(v)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(w){return w!==S})},1)},[]),f=g.useCallback(function(m){n.current=Sr(m),r.current=void 0},[]),l=g.useCallback(function(m){d(m.type,sc(m),m.target,c(m,e.lockRef.current))},[]),p=g.useCallback(function(m){d(m.type,Sr(m),m.target,c(m,e.lockRef.current))},[]);g.useEffect(function(){return gn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:p}),document.addEventListener("wheel",u,mn),document.addEventListener("touchmove",u,mn),document.addEventListener("touchstart",f,mn),function(){gn=gn.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,mn),document.removeEventListener("touchmove",u,mn),document.removeEventListener("touchstart",f,mn)}},[]);var h=e.removeScrollBar,x=e.inert;return g.createElement(g.Fragment,null,x?g.createElement(s,{styles:zb(o)}):null,h?g.createElement(Tb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wb(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hb=vb(Sd,Vb);var da=g.forwardRef(function(e,t){return g.createElement(wo,rt({},e,{ref:t,sideCar:Hb}))});da.classNames=wo.classNames;var Kb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xn=new WeakMap,Nr=new WeakMap,Rr={},as=0,Ed=function(e){return e&&(e.host||Ed(e.parentNode))},Gb=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ed(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})},qb=function(e,t,n,r){var o=Gb(t,Array.isArray(e)?e:[e]);Rr[n]||(Rr[n]=new WeakMap);var s=Rr[n],i=[],c=new Set,u=new Set(o),d=function(l){!l||c.has(l)||(c.add(l),d(l.parentNode))};o.forEach(d);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(p){if(c.has(p))f(p);else try{var h=p.getAttribute(r),x=h!==null&&h!=="false",m=(xn.get(p)||0)+1,y=(s.get(p)||0)+1;xn.set(p,m),s.set(p,y),i.push(p),m===1&&x&&Nr.set(p,!0),y===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),c.clear(),as++,function(){i.forEach(function(l){var p=xn.get(l)-1,h=s.get(l)-1;xn.set(l,p),s.set(l,h),p||(Nr.has(l)||l.removeAttribute(r),Nr.delete(l)),h||l.removeAttribute(n)}),as--,as||(xn=new WeakMap,xn=new WeakMap,Nr=new WeakMap,Rr={})}},_d=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Kb(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),qb(r,o,n,"aria-hidden")):function(){return null}};function Yb(e){const t=Xb(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,c=g.Children.toArray(s),u=c.find(Zb);if(u){const d=u.props.children,f=c.map(l=>l===u?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:l);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Xb(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=ew(o),c=Qb(s,o.props);return o.type!==g.Fragment&&(c.ref=r?Mt(r,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jb=Symbol("radix.slottable");function Zb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jb}function Qb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ew(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 So="Dialog",[kd]=an(So),[tw,Qe]=kd(So),Pd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=g.useRef(null),u=g.useRef(null),[d,f]=yo({prop:r,defaultProp:o??!1,onChange:s,caller:So});return a.jsx(tw,{scope:t,triggerRef:c,contentRef:u,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(l=>!l),[f]),modal:i,children:n})};Pd.displayName=So;var Ad="DialogTrigger",nw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Ad,n),s=Ce(t,o.triggerRef);return a.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ha(o.open),...r,ref:s,onClick:ne(e.onClick,o.onOpenToggle)})});nw.displayName=Ad;var ua="DialogPortal",[rw,Td]=kd(ua,{forceMount:void 0}),Od=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Qe(ua,t);return a.jsx(rw,{scope:t,forceMount:n,children:g.Children.map(r,i=>a.jsx(xt,{present:n||s.open,children:a.jsx(la,{asChild:!0,container:o,children:i})}))})};Od.displayName=ua;var qr="DialogOverlay",Md=g.forwardRef((e,t)=>{const n=Td(qr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(qr,e.__scopeDialog);return s.modal?a.jsx(xt,{present:r||s.open,children:a.jsx(sw,{...o,ref:t})}):null});Md.displayName=qr;var ow=Yb("DialogOverlay.RemoveScroll"),sw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(qr,n);return a.jsx(da,{as:ow,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(le.div,{"data-state":ha(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),nn="DialogContent",Id=g.forwardRef((e,t)=>{const n=Td(nn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Qe(nn,e.__scopeDialog);return a.jsx(xt,{present:r||s.open,children:s.modal?a.jsx(aw,{...o,ref:t}):a.jsx(iw,{...o,ref:t})})});Id.displayName=nn;var aw=g.forwardRef((e,t)=>{const n=Qe(nn,e.__scopeDialog),r=g.useRef(null),o=Ce(t,n.contentRef,r);return g.useEffect(()=>{const s=r.current;if(s)return _d(s)},[]),a.jsx(Dd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,s=>s.preventDefault())})}),iw=g.forwardRef((e,t)=>{const n=Qe(nn,e.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return a.jsx(Dd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Dd=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,c=Qe(nn,n),u=g.useRef(null),d=Ce(t,u);return vd(),a.jsxs(a.Fragment,{children:[a.jsx(ca,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(ia,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":ha(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(cw,{titleId:c.titleId}),a.jsx(dw,{contentRef:u,descriptionId:c.descriptionId})]})]})}),fa="DialogTitle",Ld=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(fa,n);return a.jsx(le.h2,{id:o.titleId,...r,ref:t})});Ld.displayName=fa;var Fd="DialogDescription",Bd=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe(Fd,n);return a.jsx(le.p,{id:o.descriptionId,...r,ref:t})});Bd.displayName=Fd;var $d="DialogClose",zd=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Qe($d,n);return a.jsx(le.button,{type:"button",...r,ref:t,onClick:ne(e.onClick,()=>o.onOpenChange(!1))})});zd.displayName=$d;function ha(e){return e?"open":"closed"}var Ud="DialogTitleWarning",[JS,Vd]=iv(Ud,{contentName:nn,titleName:fa,docsSlug:"dialog"}),cw=({titleId:e})=>{const t=Vd(Ud),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
55
|
+
|
|
56
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
57
|
+
|
|
58
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},lw="DialogDescriptionWarning",dw=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vd(lw).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},uw=Pd,fw=Od,Wd=Md,Hd=Id,Kd=Ld,Gd=Bd,hw=zd;const cn=uw,pw=fw,qd=g.forwardRef(({className:e,...t},n)=>a.jsx(Wd,{ref:n,className:ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qd.displayName=Wd.displayName;const It=g.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(pw,{children:[a.jsx(qd,{}),a.jsxs(Hd,{ref:r,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(hw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(er,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));It.displayName=Hd.displayName;const Dt=({className:e,...t})=>a.jsx("div",{className:ee("flex flex-col space-y-1.5 text-start",e),...t});Dt.displayName="DialogHeader";const Lt=({className:e,...t})=>a.jsx("div",{className:ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Lt.displayName="DialogFooter";const Ft=g.forwardRef(({className:e,...t},n)=>a.jsx(Kd,{ref:n,className:ee("text-lg font-semibold leading-none tracking-tight",e),...t}));Ft.displayName=Kd.displayName;const Bt=g.forwardRef(({className:e,...t},n)=>a.jsx(Gd,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));Bt.displayName=Gd.displayName;var mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gw=mw.reduce((e,t)=>{const n=ra(`Primitive.${t}`),r=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xw="Label",Yd=g.forwardRef((e,t)=>a.jsx(gw.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Yd.displayName=xw;var Xd=Yd;const Ae=g.forwardRef(({className:e,...t},n)=>a.jsx(Xd,{ref:n,className:ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Ae.displayName=Xd.displayName;function yw({webhookUrl:e,connectorType:t,onClose:n}){const[r,o]=R.useState(!1),s=typeof window<"u"?`${window.location.origin}/api/v1${e}`:e,i=()=>{navigator.clipboard.writeText(s).catch(()=>{}),o(!0),setTimeout(()=>o(!1),2e3)};return a.jsx(cn,{open:!0,onOpenChange:c=>!c&&n(),children:a.jsxs(It,{children:[a.jsx(Dt,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full",children:a.jsx(Ur,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx(Ft,{children:"Connector Created!"}),a.jsx(Bt,{children:"Your webhook URL is ready."})]})]})}),a.jsxs("div",{className:"space-y-2 mt-4",children:[a.jsx(Ae,{className:"uppercase tracking-wide text-xs text-muted-foreground",children:"Webhook URL"}),a.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-muted border p-3",children:[a.jsx("code",{className:"text-xs font-mono flex-1 break-all text-foreground",children:s}),a.jsx(Q,{variant:"ghost",size:"icon",onClick:i,className:"h-7 w-7",children:r?a.jsx(Ur,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Gs,{className:"h-3.5 w-3.5"})})]})]}),a.jsx(Lt,{className:"mt-4",children:a.jsx(Q,{onClick:n,className:"w-full",children:"Got it, close"})})]})})}const vw=["meyi_pulse","grafana","datadog","prometheus","cloudwatch","pagerduty","custom"],bw={meyi_pulse:{label:"Meyi Pulse",Icon:Ws,color:"text-violet-500"},grafana:{label:"Grafana",Icon:$g,color:"text-orange-500"},datadog:{label:"Datadog",Icon:hx,color:"text-purple-500"},prometheus:{label:"Prometheus",Icon:qs,color:"text-red-500"},cloudwatch:{label:"AWS CloudWatch",Icon:ox,color:"text-amber-500"},pagerduty:{label:"PagerDuty",Icon:wl,color:"text-green-500"},custom:{label:"Custom Webhook",Icon:Jx,color:"text-blue-500"}};function ww({open:e,connector:t,submitting:n,onClose:r,onSubmit:o,createdWebhookUrl:s,onWebhookModalClose:i}){const c=!!t,[u,d]=R.useState(""),[f,l]=R.useState("meyi_pulse"),[p,h]=R.useState("");R.useEffect(()=>{e&&(t?(d(t.name),l(t.type),h(t.description??"")):(d(""),l("meyi_pulse"),h("")))},[e,t]);const x=m=>{if(m.preventDefault(),!u.trim()){se.error("Connector name is required");return}o(u.trim(),f,p.trim()||void 0)};return s?a.jsx(yw,{webhookUrl:s,connectorType:f,onClose:i??r}):a.jsx(cn,{open:e,onOpenChange:m=>!m&&!n&&r(),children:a.jsx(It,{children:a.jsxs("form",{onSubmit:x,children:[a.jsxs(Dt,{children:[a.jsx(Ft,{children:c?"Configure Connector":"Add Webhook Connector"}),a.jsx(Bt,{children:c?"Update the connector details below.":"Create a webhook endpoint to receive alerts from your monitoring tool."})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ae,{children:["Connector Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Te,{value:u,onChange:m=>d(m.target.value),placeholder:"e.g. Production Pulse",disabled:n})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ae,{children:["Source Type ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx("select",{value:f,onChange:m=>!c&&l(m.target.value),disabled:c||n,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:vw.map(m=>a.jsx("option",{value:m,className:"bg-popover text-popover-foreground",children:bw[m].label},m))}),c&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Source type cannot be changed after creation."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ae,{children:["Description ",a.jsx("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),a.jsx("textarea",{rows:2,value:p,onChange:m=>h(m.target.value),placeholder:"Brief description of what this connector monitors…",disabled:n,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none"})]}),!c&&a.jsxs("div",{className:"rounded-lg bg-muted/50 border p-3 text-xs text-muted-foreground space-y-1",children:[a.jsx("p",{className:"font-medium text-foreground",children:"After saving:"}),a.jsx("p",{children:"A unique webhook URL will be generated. Configure your monitoring tool to POST alerts to that URL when a resource goes down."})]})]}),a.jsxs(Lt,{children:[a.jsx(Q,{type:"button",variant:"outline",onClick:r,disabled:n,children:"Cancel"}),a.jsx(Q,{type:"submit",disabled:n,children:n?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin mr-2"})," Creating…"]}):c?"Save Changes":"Create & Get URL"})]})]})})})}function Sw({open:e,onOpenChange:t,connector:n,onConfirm:r}){const[o,s]=R.useState(!1),i=async()=>{s(!0);try{await r()}catch(c){console.error("Error deleting connector:",c)}finally{s(!1)}};return a.jsx(cn,{open:e,onOpenChange:c=>!o&&t(c),children:a.jsxs(It,{children:[a.jsxs(Dt,{children:[a.jsx(Ft,{children:"Are you absolutely sure?"}),a.jsxs(Bt,{children:["This will permanently delete the connector"," ",a.jsx("strong",{className:"text-foreground font-semibold",children:n?.name||"this connector"}),". This action cannot be undone and will remove all connection configurations."]})]}),a.jsxs(Lt,{children:[a.jsx(Q,{variant:"outline",onClick:()=>t(!1),disabled:o,children:"Cancel"}),a.jsx(Q,{variant:"destructive",onClick:i,disabled:o,children:o?"Deleting...":"Delete"})]})]})})}function Nw(){const[e,t]=R.useState([]),[n,r]=R.useState(0),[o,s]=R.useState(!0),[i,c]=R.useState(1),[u,d]=R.useState(10),[f,l]=R.useState(""),[p,h]=R.useState(""),[x,m]=R.useState(!1),[y,v]=R.useState(null),[b,S]=R.useState(!1),[w,_]=R.useState(null),[E,C]=R.useState(!1),[N,P]=R.useState(null),[T,M]=R.useState(null),[D,G]=R.useState(null);R.useEffect(()=>{const A=setTimeout(()=>{h(f),c(1)},400);return()=>clearTimeout(A)},[f]);const I=async()=>{s(!0);try{const A=await be.listConnectors({page:i,limit:u,search:p||void 0});t(A.connectors||[]),r(A.total||0)}catch{se.error("Failed to load connectors")}finally{s(!1)}};R.useEffect(()=>{I()},[i,u,p]);const $=()=>{v(null),_(null),m(!0)},F=A=>{v(A),_(null),m(!0)},W=()=>{b||(m(!1),_(null))},V=A=>{P(e.find(z=>z.id===A)??null),C(!0)},L=async()=>{if(N){M(N.id);try{await be.deleteConnector(N.id),se.success("Connector deleted"),C(!1),P(null),I()}catch{se.error("Failed to delete connector")}finally{M(null)}}},O=async A=>{G(A);try{const z=await be.rotateToken(A);se.success("Webhook token rotated"),t(B=>B.map(J=>J.id===A?{...J,webhookToken:z.webhookToken,webhookUrl:z.webhookUrl}:J))}catch{se.error("Failed to rotate token")}finally{G(null)}},k=async(A,z,B)=>{S(!0);try{if(y)await be.updateConnector(y.id,{name:A,description:B}),se.success("Connector updated"),m(!1),I();else{const J=await be.createConnector({name:A,type:z,description:B});_(J.webhookUrl),I()}}catch(J){se.error(J?.response?.data?.error||"Failed to save connector")}finally{S(!1)}},Y=Math.max(1,Math.ceil(n/u));return a.jsxs("div",{className:"space-y-6 p-4 md:p-6",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b pb-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ss,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Connectors"})]}),a.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Connect monitoring tools (Meyi Pulse, Grafana, Datadog…) via webhooks to receive alerts."})]}),a.jsxs(Q,{onClick:$,children:[a.jsx(Wr,{className:"h-4 w-4"}),"Add Connector"]})]}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(fo,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),a.jsx(Te,{type:"text",value:f,onChange:A=>l(A.target.value),placeholder:"Search connectors…",className:"pl-9 pr-8 w-[220px]"}),f&&a.jsx("button",{onClick:()=>l(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:a.jsx(er,{className:"h-4 w-4"})})]})}),o&&e.length===0?a.jsx("div",{className:"flex h-[50vh] items-center justify-center",children:a.jsx(ge,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.length===0?a.jsxs("div",{className:"flex h-[50vh] flex-col items-center justify-center rounded-xl border-2 border-dashed p-8 text-center",children:[a.jsx("div",{className:"bg-muted mx-auto flex h-16 w-16 items-center justify-center rounded-full mb-4",children:a.jsx(Ss,{className:"h-7 w-7 text-muted-foreground"})}),a.jsx("h3",{className:"text-base font-semibold",children:f?"No matching connectors":"No connectors yet"}),a.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground max-w-sm mx-auto",children:f?"Try a different search term.":"Add a webhook connector to start receiving alerts from your monitoring tools."}),!f&&a.jsxs(Q,{onClick:$,className:"mt-5",children:[a.jsx(Wr,{className:"h-4 w-4"}),"Add First Connector"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("ul",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:e.map(A=>a.jsx(Gv,{connector:A,deletingId:T,rotatingId:D,onEdit:F,onRotate:O,onDelete:V},A.id))}),a.jsx(xo,{currentPage:i,pageSize:u,totalPages:Y,total:n,onPageChange:A=>c(A),onPageSizeChange:A=>{d(A),c(1)}})]}),a.jsx(Sw,{open:E,onOpenChange:A=>{T||C(A)},connector:N,onConfirm:L}),a.jsx(ww,{open:x,connector:y,submitting:b,createdWebhookUrl:w,onClose:W,onSubmit:k,onWebhookModalClose:()=>{_(null),m(!1)}})]})}function Rw({alert:e,open:t,onConfirm:n,onCancel:r,promoting:o}){return a.jsx(cn,{open:t,onOpenChange:s=>!s&&r(),children:a.jsxs(It,{children:[a.jsxs(Dt,{children:[a.jsxs(Ft,{className:"flex items-center gap-2",children:[a.jsx(Hs,{className:"h-5 w-5 text-primary"}),"Convert to Incident?"]}),a.jsx(Bt,{children:"This will create a new incident from the alert and run AI-powered RCA analysis on it."})]}),e&&a.jsxs("div",{className:"rounded-lg bg-muted/50 border p-3 space-y-2 text-sm",children:[a.jsxs("div",{className:"flex justify-between gap-4",children:[a.jsx("span",{className:"text-muted-foreground",children:"Resource"}),a.jsx("span",{className:"font-medium truncate",children:e.resourceName})]}),a.jsxs("div",{className:"flex justify-between gap-4",children:[a.jsx("span",{className:"text-muted-foreground",children:"Type"}),a.jsx("span",{children:e.resourceType})]}),e.projectTag&&a.jsxs("div",{className:"flex items-center gap-1.5 mt-2",children:[a.jsx(Ux,{size:12,className:"text-muted-foreground"}),a.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded",children:e.projectTag})]})]}),a.jsxs(Lt,{children:[a.jsx(Q,{variant:"outline",onClick:r,disabled:o,children:"Cancel"}),a.jsx(Q,{onClick:n,disabled:o,children:o?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin"})," Promoting…"]}):"Convert to Incident"})]})]})})}function Cw({open:e,onConfirm:t,onCancel:n,deleting:r}){return a.jsx(cn,{open:e,onOpenChange:o=>!o&&!r&&n(),children:a.jsxs(It,{children:[a.jsxs(Dt,{children:[a.jsx(Ft,{children:"Delete alert?"}),a.jsx(Bt,{children:"This will permanently delete this alert. It will no longer be visible in the alerts list."})]}),a.jsxs(Lt,{children:[a.jsx(Q,{variant:"outline",onClick:n,disabled:r,children:"Cancel"}),a.jsx(Q,{variant:"destructive",onClick:t,disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin mr-2"})," Deleting…"]}):"Delete"})]})]})})}const jw=["top","right","bottom","left"],At=Math.min,$e=Math.max,Yr=Math.round,Cr=Math.floor,at=e=>({x:e,y:e}),Ew={left:"right",right:"left",bottom:"top",top:"bottom"};function Es(e,t,n){return $e(e,At(t,n))}function mt(e,t){return typeof e=="function"?e(t):e}function gt(e){return e.split("-")[0]}function kn(e){return e.split("-")[1]}function pa(e){return e==="x"?"y":"x"}function ma(e){return e==="y"?"height":"width"}function ot(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ga(e){return pa(ot(e))}function _w(e,t,n){n===void 0&&(n=!1);const r=kn(e),o=ga(e),s=ma(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function kw(e){const t=Xr(e);return[_s(e),t,_s(t)]}function _s(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ic=["left","right"],cc=["right","left"],Pw=["top","bottom"],Aw=["bottom","top"];function Tw(e,t,n){switch(e){case"top":case"bottom":return n?t?cc:ic:t?ic:cc;case"left":case"right":return t?Pw:Aw;default:return[]}}function Ow(e,t,n,r){const o=kn(e);let s=Tw(gt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_s)))),s}function Xr(e){const t=gt(e);return Ew[t]+e.slice(t.length)}function Mw(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jd(e){return typeof e!="number"?Mw(e):{top:e,right:e,bottom:e,left:e}}function Jr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function lc(e,t,n){let{reference:r,floating:o}=e;const s=ot(t),i=ga(t),c=ma(i),u=gt(t),d=s==="y",f=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(u){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:l};break;case"left":h={x:r.x-o.width,y:l};break;default:h={x:r.x,y:r.y}}switch(kn(t)){case"start":h[i]-=p*(n&&d?-1:1);break;case"end":h[i]+=p*(n&&d?-1:1);break}return h}async function Iw(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:p=!1,padding:h=0}=mt(t,e),x=Jd(h),y=c[p?l==="floating"?"reference":"floating":l],v=Jr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),b=l==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),w=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},_=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:S,strategy:u}):b);return{top:(v.top-_.top+x.top)/w.y,bottom:(_.bottom-v.bottom+x.bottom)/w.y,left:(v.left-_.left+x.left)/w.x,right:(_.right-v.right+x.right)/w.x}}const Dw=50,Lw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Iw},u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:l}=lc(d,r,u),p=r,h=0;const x={};for(let m=0;m<s.length;m++){const y=s[m];if(!y)continue;const{name:v,fn:b}=y,{x:S,y:w,data:_,reset:E}=await b({x:f,y:l,initialPlacement:r,placement:p,strategy:o,middlewareData:x,rects:d,platform:c,elements:{reference:e,floating:t}});f=S??f,l=w??l,x[v]={...x[v],..._},E&&h<Dw&&(h++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(d=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:f,y:l}=lc(d,p,u)),m=-1)}return{x:f,y:l,placement:p,strategy:o,middlewareData:x}},Fw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=mt(e,t)||{};if(d==null)return{};const l=Jd(f),p={x:n,y:r},h=ga(o),x=ma(h),m=await i.getDimensions(d),y=h==="y",v=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",w=s.reference[x]+s.reference[h]-p[h]-s.floating[x],_=p[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let C=E?E[S]:0;(!C||!await(i.isElement==null?void 0:i.isElement(E)))&&(C=c.floating[S]||s.floating[x]);const N=w/2-_/2,P=C/2-m[x]/2-1,T=At(l[v],P),M=At(l[b],P),D=T,G=C-m[x]-M,I=C/2-m[x]/2+N,$=Es(D,I,G),F=!u.arrow&&kn(o)!=null&&I!==$&&s.reference[x]/2-(I<D?T:M)-m[x]/2<0,W=F?I<D?I-D:I-G:0;return{[h]:p[h]+W,data:{[h]:$,centerOffset:I-$-W,...F&&{alignmentOffset:W}},reset:F}}}),Bw=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=gt(o),b=ot(c),S=gt(c)===c,w=await(u.isRTL==null?void 0:u.isRTL(d.floating)),_=p||(S||!m?[Xr(c)]:kw(c)),E=x!=="none";!p&&E&&_.push(...Ow(c,m,x,w));const C=[c,..._],N=await u.detectOverflow(t,y),P=[];let T=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&P.push(N[v]),l){const I=_w(o,i,w);P.push(N[I[0]],N[I[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(I=>I<=0)){var M,D;const I=(((M=s.flip)==null?void 0:M.index)||0)+1,$=C[I];if($&&(!(l==="alignment"?b!==ot($):!1)||T.every(V=>ot(V.placement)===b?V.overflows[0]>0:!0)))return{data:{index:I,overflows:T},reset:{placement:$}};let F=(D=T.filter(W=>W.overflows[0]<=0).sort((W,V)=>W.overflows[1]-V.overflows[1])[0])==null?void 0:D.placement;if(!F)switch(h){case"bestFit":{var G;const W=(G=T.filter(V=>{if(E){const L=ot(V.placement);return L===b||L==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(L=>L>0).reduce((L,O)=>L+O,0)]).sort((V,L)=>V[1]-L[1])[0])==null?void 0:G[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function dc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uc(e){return jw.some(t=>e[t]>=0)}const $w=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=mt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=dc(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:uc(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),c=dc(i,n.floating);return{data:{escapedOffsets:c,escaped:uc(c)}}}default:return{}}}}},Zd=new Set(["left","top"]);async function zw(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=gt(n),c=kn(n),u=ot(n)==="y",d=Zd.has(i)?-1:1,f=s&&u?-1:1,l=mt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof x=="number"&&(h=c==="end"?x*-1:x),u?{x:h*f,y:p*d}:{x:p*d,y:h*f}}const Uw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,u=await zw(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Vw=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:v=>{let{x:b,y:S}=v;return{x:b,y:S}}},...d}=mt(e,t),f={x:n,y:r},l=await s.detectOverflow(t,d),p=ot(gt(o)),h=pa(p);let x=f[h],m=f[p];if(i){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",S=x+l[v],w=x-l[b];x=Es(S,x,w)}if(c){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",S=m+l[v],w=m-l[b];m=Es(S,m,w)}const y=u.fn({...t,[h]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[p]:c}}}}}},Ww=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=mt(e,t),f={x:n,y:r},l=ot(o),p=pa(l);let h=f[p],x=f[l];const m=mt(c,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const S=p==="y"?"height":"width",w=s.reference[p]-s.floating[S]+y.mainAxis,_=s.reference[p]+s.reference[S]-y.mainAxis;h<w?h=w:h>_&&(h=_)}if(d){var v,b;const S=p==="y"?"width":"height",w=Zd.has(gt(o)),_=s.reference[l]-s.floating[S]+(w&&((v=i.offset)==null?void 0:v[l])||0)+(w?0:y.crossAxis),E=s.reference[l]+s.reference[S]+(w?0:((b=i.offset)==null?void 0:b[l])||0)-(w?y.crossAxis:0);x<_?x=_:x>E&&(x=E)}return{[p]:h,[l]:x}}}},Hw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...d}=mt(e,t),f=await i.detectOverflow(t,d),l=gt(o),p=kn(o),h=ot(o)==="y",{width:x,height:m}=s.floating;let y,v;l==="top"||l==="bottom"?(y=l,v=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(v=l,y=p==="end"?"top":"bottom");const b=m-f.top-f.bottom,S=x-f.left-f.right,w=At(m-f[y],b),_=At(x-f[v],S),E=!t.middlewareData.shift;let C=w,N=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=b),E&&!p){const T=$e(f.left,0),M=$e(f.right,0),D=$e(f.top,0),G=$e(f.bottom,0);h?N=x-2*(T!==0||M!==0?T+M:$e(f.left,f.right)):C=m-2*(D!==0||G!==0?D+G:$e(f.top,f.bottom))}await u({...t,availableWidth:N,availableHeight:C});const P=await i.getDimensions(c.floating);return x!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function No(){return typeof window<"u"}function Pn(e){return Qd(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function it(e){var t;return(t=(Qd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qd(e){return No()?e instanceof Node||e instanceof ze(e).Node:!1}function Xe(e){return No()?e instanceof Element||e instanceof ze(e).Element:!1}function yt(e){return No()?e instanceof HTMLElement||e instanceof ze(e).HTMLElement:!1}function fc(e){return!No()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}function nr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Kw(e){return/^(table|td|th)$/.test(Pn(e))}function Ro(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Gw=/transform|translate|scale|rotate|perspective|filter/,qw=/paint|layout|strict|content/,Vt=e=>!!e&&e!=="none";let is;function xa(e){const t=Xe(e)?Je(e):e;return Vt(t.transform)||Vt(t.translate)||Vt(t.scale)||Vt(t.rotate)||Vt(t.perspective)||!ya()&&(Vt(t.backdropFilter)||Vt(t.filter))||Gw.test(t.willChange||"")||qw.test(t.contain||"")}function Yw(e){let t=Tt(e);for(;yt(t)&&!En(t);){if(xa(t))return t;if(Ro(t))return null;t=Tt(t)}return null}function ya(){return is==null&&(is=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),is}function En(e){return/^(html|body|#document)$/.test(Pn(e))}function Je(e){return ze(e).getComputedStyle(e)}function Co(e){return Xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tt(e){if(Pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fc(e)&&e.host||it(e);return fc(t)?t.host:t}function eu(e){const t=Tt(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:yt(t)&&nr(t)?t:eu(t)}function Kn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=eu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ze(o);if(s){const c=ks(i);return t.concat(i,i.visualViewport||[],nr(o)?o:[],c&&n?Kn(c):[])}else return t.concat(o,Kn(o,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tu(e){const t=Je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=yt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Yr(n)!==s||Yr(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function va(e){return Xe(e)?e:e.contextElement}function Nn(e){const t=va(e);if(!yt(t))return at(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=tu(t);let i=(s?Yr(n.width):n.width)/r,c=(s?Yr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Xw=at(0);function nu(e){const t=ze(e);return!ya()||!t.visualViewport?Xw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ze(e)?!1:t}function rn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=va(e);let i=at(1);t&&(r?Xe(r)&&(i=Nn(r)):i=Nn(e));const c=Jw(s,n,r)?nu(s):at(0);let u=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,f=o.width/i.x,l=o.height/i.y;if(s){const p=ze(s),h=r&&Xe(r)?ze(r):r;let x=p,m=ks(x);for(;m&&r&&h!==x;){const y=Nn(m),v=m.getBoundingClientRect(),b=Je(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,w=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,d*=y.y,f*=y.x,l*=y.y,u+=S,d+=w,x=ze(m),m=ks(x)}}return Jr({width:f,height:l,x:u,y:d})}function jo(e,t){const n=Co(e).scrollLeft;return t?t.left+n:rn(it(e)).left+n}function ru(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-jo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Zw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=it(r),c=t?Ro(t.floating):!1;if(r===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},d=at(1);const f=at(0),l=yt(r);if((l||!l&&!s)&&((Pn(r)!=="body"||nr(i))&&(u=Co(r)),l)){const h=rn(r);d=Nn(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=i&&!l&&!s?ru(i,u):at(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+p.x,y:n.y*d.y-u.scrollTop*d.y+f.y+p.y}}function Qw(e){return Array.from(e.getClientRects())}function e0(e){const t=it(e),n=Co(e),r=e.ownerDocument.body,o=$e(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$e(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+jo(e);const c=-n.scrollTop;return Je(r).direction==="rtl"&&(i+=$e(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const hc=25;function t0(e,t){const n=ze(e),r=it(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,u=0;if(o){s=o.width,i=o.height;const f=ya();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const d=jo(r);if(d<=0){const f=r.ownerDocument,l=f.body,p=getComputedStyle(l),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-l.clientWidth-h);x<=hc&&(s-=x)}else d<=hc&&(s+=d);return{width:s,height:i,x:c,y:u}}function n0(e,t){const n=rn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=yt(e)?Nn(e):at(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:c,x:u,y:d}}function pc(e,t,n){let r;if(t==="viewport")r=t0(e,n);else if(t==="document")r=e0(it(e));else if(Xe(t))r=n0(t,n);else{const o=nu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(r)}function ou(e,t){const n=Tt(e);return n===t||!Xe(n)||En(n)?!1:Je(n).position==="fixed"||ou(n,t)}function r0(e,t){const n=t.get(e);if(n)return n;let r=Kn(e,[],!1).filter(c=>Xe(c)&&Pn(c)!=="body"),o=null;const s=Je(e).position==="fixed";let i=s?Tt(e):e;for(;Xe(i)&&!En(i);){const c=Je(i),u=xa(i);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||nr(i)&&!u&&ou(e,i))?r=r.filter(f=>f!==i):o=c,i=Tt(i)}return t.set(e,r),r}function o0(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ro(t)?[]:r0(t,this._c):[].concat(n),r],c=pc(t,i[0],o);let u=c.top,d=c.right,f=c.bottom,l=c.left;for(let p=1;p<i.length;p++){const h=pc(t,i[p],o);u=$e(h.top,u),d=At(h.right,d),f=At(h.bottom,f),l=$e(h.left,l)}return{width:d-l,height:f-u,x:l,y:u}}function s0(e){const{width:t,height:n}=tu(e);return{width:t,height:n}}function a0(e,t,n){const r=yt(t),o=it(t),s=n==="fixed",i=rn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=at(0);function d(){u.x=jo(o)}if(r||!r&&!s)if((Pn(t)!=="body"||nr(o))&&(c=Co(t)),r){const h=rn(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&d();s&&!r&&o&&d();const f=o&&!r&&!s?ru(o,c):at(0),l=i.left+c.scrollLeft-u.x-f.x,p=i.top+c.scrollTop-u.y-f.y;return{x:l,y:p,width:i.width,height:i.height}}function cs(e){return Je(e).position==="static"}function mc(e,t){if(!yt(e)||Je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return it(e)===n&&(n=n.ownerDocument.body),n}function su(e,t){const n=ze(e);if(Ro(e))return n;if(!yt(e)){let o=Tt(e);for(;o&&!En(o);){if(Xe(o)&&!cs(o))return o;o=Tt(o)}return n}let r=mc(e,t);for(;r&&Kw(r)&&cs(r);)r=mc(r,t);return r&&En(r)&&cs(r)&&!xa(r)?n:r||Yw(e)||n}const i0=async function(e){const t=this.getOffsetParent||su,n=this.getDimensions,r=await n(e.floating);return{reference:a0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function c0(e){return Je(e).direction==="rtl"}const l0={convertOffsetParentRelativeRectToViewportRelativeRect:Zw,getDocumentElement:it,getClippingRect:o0,getOffsetParent:su,getElementRects:i0,getClientRects:Qw,getDimensions:s0,getScale:Nn,isElement:Xe,isRTL:c0};function au(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function d0(e,t){let n=null,r;const o=it(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:l,width:p,height:h}=d;if(c||t(),!p||!h)return;const x=Cr(l),m=Cr(o.clientWidth-(f+p)),y=Cr(o.clientHeight-(l+h)),v=Cr(f),S={rootMargin:-x+"px "+-m+"px "+-y+"px "+-v+"px",threshold:$e(0,At(1,u))||1};let w=!0;function _(E){const C=E[0].intersectionRatio;if(C!==u){if(!w)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!au(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(_,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,S)}n.observe(e)}return i(!0),s}function u0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=va(e),f=o||s?[...d?Kn(d):[],...t?Kn(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const l=d&&c?d0(d,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),d&&!u&&h.observe(d),t&&h.observe(t));let x,m=u?rn(e):null;u&&y();function y(){const v=rn(e);m&&!au(m,v)&&n(),m=v,x=requestAnimationFrame(y)}return n(),()=>{var v;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),l?.(),(v=h)==null||v.disconnect(),h=null,u&&cancelAnimationFrame(x)}}const f0=Uw,h0=Vw,p0=Bw,m0=Hw,g0=$w,gc=Fw,x0=Ww,y0=(e,t,n)=>{const r=new Map,o={platform:l0,...n},s={...o.platform,_c:r};return Lw(e,t,{...o,platform:s})};var v0=typeof document<"u",b0=function(){},Ir=v0?R.useLayoutEffect:b0;function Zr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Zr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Zr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function iu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xc(e,t){const n=iu(e);return Math.round(t*n)/n}function ls(e){const t=g.useRef(e);return Ir(()=>{t.current=e}),t}function w0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,l]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=g.useState(r);Zr(p,r)||h(r);const[x,m]=g.useState(null),[y,v]=g.useState(null),b=g.useCallback(V=>{V!==E.current&&(E.current=V,m(V))},[]),S=g.useCallback(V=>{V!==C.current&&(C.current=V,v(V))},[]),w=s||x,_=i||y,E=g.useRef(null),C=g.useRef(null),N=g.useRef(f),P=u!=null,T=ls(u),M=ls(o),D=ls(d),G=g.useCallback(()=>{if(!E.current||!C.current)return;const V={placement:t,strategy:n,middleware:p};M.current&&(V.platform=M.current),y0(E.current,C.current,V).then(L=>{const O={...L,isPositioned:D.current!==!1};I.current&&!Zr(N.current,O)&&(N.current=O,Sc.flushSync(()=>{l(O)}))})},[p,t,n,M,D]);Ir(()=>{d===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[d]);const I=g.useRef(!1);Ir(()=>(I.current=!0,()=>{I.current=!1}),[]),Ir(()=>{if(w&&(E.current=w),_&&(C.current=_),w&&_){if(T.current)return T.current(w,_,G);G()}},[w,_,G,T,P]);const $=g.useMemo(()=>({reference:E,floating:C,setReference:b,setFloating:S}),[b,S]),F=g.useMemo(()=>({reference:w,floating:_}),[w,_]),W=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!F.floating)return V;const L=xc(F.floating,f.x),O=xc(F.floating,f.y);return c?{...V,transform:"translate("+L+"px, "+O+"px)",...iu(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:O}},[n,c,F.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:G,refs:$,elements:F,floatingStyles:W}),[f,G,$,F,W])}const S0=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gc({element:r.current,padding:o}).fn(n):{}:r?gc({element:r,padding:o}).fn(n):{}}}},N0=(e,t)=>{const n=f0(e);return{name:n.name,fn:n.fn,options:[e,t]}},R0=(e,t)=>{const n=h0(e);return{name:n.name,fn:n.fn,options:[e,t]}},C0=(e,t)=>({fn:x0(e).fn,options:[e,t]}),j0=(e,t)=>{const n=p0(e);return{name:n.name,fn:n.fn,options:[e,t]}},E0=(e,t)=>{const n=m0(e);return{name:n.name,fn:n.fn,options:[e,t]}},_0=(e,t)=>{const n=g0(e);return{name:n.name,fn:n.fn,options:[e,t]}},k0=(e,t)=>{const n=S0(e);return{name:n.name,fn:n.fn,options:[e,t]}};var P0="Arrow",cu=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return a.jsx(le.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});cu.displayName=P0;var A0=cu;function T0(e){const[t,n]=g.useState(void 0);return Pt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ba="Popper",[lu,du]=an(ba),[O0,uu]=lu(ba),fu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return a.jsx(O0,{scope:t,anchor:r,onAnchorChange:o,children:n})};fu.displayName=ba;var hu="PopperAnchor",pu=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=uu(hu,n),i=g.useRef(null),c=Ce(t,i),u=g.useRef(null);return g.useEffect(()=>{const d=u.current;u.current=r?.current||i.current,d!==u.current&&s.onAnchorChange(u.current)}),r?null:a.jsx(le.div,{...o,ref:c})});pu.displayName=hu;var wa="PopperContent",[M0,I0]=lu(wa),mu=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:x,...m}=e,y=uu(wa,n),[v,b]=g.useState(null),S=Ce(t,q=>b(q)),[w,_]=g.useState(null),E=T0(w),C=E?.width??0,N=E?.height??0,P=r+(s!=="center"?"-"+s:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(d)?d:[d],D=M.length>0,G={padding:T,boundary:M.filter(L0),altBoundary:D},{refs:I,floatingStyles:$,placement:F,isPositioned:W,middlewareData:V}=w0({strategy:"fixed",placement:P,whileElementsMounted:(...q)=>u0(...q,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[N0({mainAxis:o+N,alignmentAxis:i}),u&&R0({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?C0():void 0,...G}),u&&j0({...G}),E0({...G,apply:({elements:q,rects:U,availableWidth:te,availableHeight:he})=>{const{width:de,height:ue}=U.reference,Pe=q.floating.style;Pe.setProperty("--radix-popper-available-width",`${te}px`),Pe.setProperty("--radix-popper-available-height",`${he}px`),Pe.setProperty("--radix-popper-anchor-width",`${de}px`),Pe.setProperty("--radix-popper-anchor-height",`${ue}px`)}}),w&&k0({element:w,padding:c}),F0({arrowWidth:C,arrowHeight:N}),p&&_0({strategy:"referenceHidden",...G})]}),[L,O]=yu(F),k=pt(x);Pt(()=>{W&&k?.()},[W,k]);const Y=V.arrow?.x,A=V.arrow?.y,z=V.arrow?.centerOffset!==0,[B,J]=g.useState();return Pt(()=>{v&&J(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:W?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(M0,{scope:n,placedSide:L,onArrowChange:_,arrowX:Y,arrowY:A,shouldHideArrow:z,children:a.jsx(le.div,{"data-side":L,"data-align":O,...m,ref:S,style:{...m.style,animation:W?void 0:"none"}})})})});mu.displayName=wa;var gu="PopperArrow",D0={top:"bottom",right:"left",bottom:"top",left:"right"},xu=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=I0(gu,r),i=D0[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(A0,{...o,ref:n,style:{...o.style,display:"block"}})})});xu.displayName=gu;function L0(e){return e!==null}var F0=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=yu(n),l={start:"0%",center:"50%",end:"100%"}[f],p=(o.arrow?.x??0)+c/2,h=(o.arrow?.y??0)+u/2;let x="",m="";return d==="bottom"?(x=i?l:`${p}px`,m=`${-u}px`):d==="top"?(x=i?l:`${p}px`,m=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,m=i?l:`${h}px`):d==="left"&&(x=`${r.floating.width+u}px`,m=i?l:`${h}px`),{data:{x,y:m}}}});function yu(e){const[t,n="center"]=e.split("-");return[t,n]}var B0=fu,$0=pu,z0=mu,U0=xu;function V0(e){const t=W0(e),n=g.forwardRef((r,o)=>{const{children:s,...i}=r,c=g.Children.toArray(s),u=c.find(K0);if(u){const d=u.props.children,f=c.map(l=>l===u?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:l);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function W0(e){const t=g.forwardRef((n,r)=>{const{children:o,...s}=n;if(g.isValidElement(o)){const i=q0(o),c=G0(s,o.props);return o.type!==g.Fragment&&(c.ref=r?Mt(r,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var H0=Symbol("radix.slottable");function K0(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===H0}function G0(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function q0(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps=["Enter"," "],Y0=["ArrowDown","PageUp","Home"],vu=["ArrowUp","PageDown","End"],X0=[...Y0,...vu],J0={ltr:[...Ps,"ArrowRight"],rtl:[...Ps,"ArrowLeft"]},Z0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rr="Menu",[Gn,Q0,e1]=Gl(rr),[ln,bu]=an(rr,[e1,du,vo]),Eo=du(),wu=vo(),[t1,dn]=ln(rr),[n1,or]=ln(rr),Su=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,c=Eo(t),[u,d]=g.useState(null),f=g.useRef(!1),l=pt(s),p=oa(o);return g.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),a.jsx(B0,{...c,children:a.jsx(t1,{scope:t,open:n,onOpenChange:l,content:u,onContentChange:d,children:a.jsx(n1,{scope:t,onClose:g.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:p,modal:i,children:r})})})};Su.displayName=rr;var r1="MenuAnchor",Sa=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Eo(n);return a.jsx($0,{...o,...r,ref:t})});Sa.displayName=r1;var Na="MenuPortal",[o1,Nu]=ln(Na,{forceMount:void 0}),Ru=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=dn(Na,t);return a.jsx(o1,{scope:t,forceMount:n,children:a.jsx(xt,{present:n||s.open,children:a.jsx(la,{asChild:!0,container:o,children:r})})})};Ru.displayName=Na;var Ke="MenuContent",[s1,Ra]=ln(Ke),Cu=g.forwardRef((e,t)=>{const n=Nu(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=dn(Ke,e.__scopeMenu),i=or(Ke,e.__scopeMenu);return a.jsx(Gn.Provider,{scope:e.__scopeMenu,children:a.jsx(xt,{present:r||s.open,children:a.jsx(Gn.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(a1,{...o,ref:t}):a.jsx(i1,{...o,ref:t})})})})}),a1=g.forwardRef((e,t)=>{const n=dn(Ke,e.__scopeMenu),r=g.useRef(null),o=Ce(t,r);return g.useEffect(()=>{const s=r.current;if(s)return _d(s)},[]),a.jsx(Ca,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),i1=g.forwardRef((e,t)=>{const n=dn(Ke,e.__scopeMenu);return a.jsx(Ca,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),c1=V0("MenuContent.ScrollLock"),Ca=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:p,onDismiss:h,disableOutsideScroll:x,...m}=e,y=dn(Ke,n),v=or(Ke,n),b=Eo(n),S=wu(n),w=Q0(n),[_,E]=g.useState(null),C=g.useRef(null),N=Ce(t,C,y.onContentChange),P=g.useRef(0),T=g.useRef(""),M=g.useRef(0),D=g.useRef(null),G=g.useRef("right"),I=g.useRef(0),$=x?da:g.Fragment,F=x?{as:c1,allowPinchZoom:!0}:void 0,W=L=>{const O=T.current+L,k=w().filter(q=>!q.disabled),Y=document.activeElement,A=k.find(q=>q.ref.current===Y)?.textValue,z=k.map(q=>q.textValue),B=b1(z,O,A),J=k.find(q=>q.textValue===B)?.ref.current;(function q(U){T.current=U,window.clearTimeout(P.current),U!==""&&(P.current=window.setTimeout(()=>q(""),1e3))})(O),J&&setTimeout(()=>J.focus())};g.useEffect(()=>()=>window.clearTimeout(P.current),[]),vd();const V=g.useCallback(L=>G.current===D.current?.side&&S1(L,D.current?.area),[]);return a.jsx(s1,{scope:n,searchRef:T,onItemEnter:g.useCallback(L=>{V(L)&&L.preventDefault()},[V]),onItemLeave:g.useCallback(L=>{V(L)||(C.current?.focus(),E(null))},[V]),onTriggerLeave:g.useCallback(L=>{V(L)&&L.preventDefault()},[V]),pointerGraceTimerRef:M,onPointerGraceIntentChange:g.useCallback(L=>{D.current=L},[]),children:a.jsx($,{...F,children:a.jsx(ca,{asChild:!0,trapped:o,onMountAutoFocus:ne(s,L=>{L.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(ia,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:p,onDismiss:h,children:a.jsx(ed,{asChild:!0,...S,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:E,onEntryFocus:ne(u,L=>{v.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(z0,{role:"menu","aria-orientation":"vertical","data-state":zu(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...m,ref:N,style:{outline:"none",...m.style},onKeyDown:ne(m.onKeyDown,L=>{const k=L.target.closest("[data-radix-menu-content]")===L.currentTarget,Y=L.ctrlKey||L.altKey||L.metaKey,A=L.key.length===1;k&&(L.key==="Tab"&&L.preventDefault(),!Y&&A&&W(L.key));const z=C.current;if(L.target!==z||!X0.includes(L.key))return;L.preventDefault();const J=w().filter(q=>!q.disabled).map(q=>q.ref.current);vu.includes(L.key)&&J.reverse(),y1(J)}),onBlur:ne(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(P.current),T.current="")}),onPointerMove:ne(e.onPointerMove,qn(L=>{const O=L.target,k=I.current!==L.clientX;if(L.currentTarget.contains(O)&&k){const Y=L.clientX>I.current?"right":"left";G.current=Y,I.current=L.clientX}}))})})})})})})});Cu.displayName=Ke;var l1="MenuGroup",ja=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(le.div,{role:"group",...r,ref:t})});ja.displayName=l1;var d1="MenuLabel",ju=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(le.div,{...r,ref:t})});ju.displayName=d1;var Qr="MenuItem",yc="menu.itemSelect",_o=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=g.useRef(null),i=or(Qr,e.__scopeMenu),c=Ra(Qr,e.__scopeMenu),u=Ce(t,s),d=g.useRef(!1),f=()=>{const l=s.current;if(!n&&l){const p=new CustomEvent(yc,{bubbles:!0,cancelable:!0});l.addEventListener(yc,h=>r?.(h),{once:!0}),ql(l,p),p.defaultPrevented?d.current=!1:i.onClose()}};return a.jsx(Eu,{...o,ref:u,disabled:n,onClick:ne(e.onClick,f),onPointerDown:l=>{e.onPointerDown?.(l),d.current=!0},onPointerUp:ne(e.onPointerUp,l=>{d.current||l.currentTarget?.click()}),onKeyDown:ne(e.onKeyDown,l=>{const p=c.searchRef.current!=="";n||p&&l.key===" "||Ps.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});_o.displayName=Qr;var Eu=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ra(Qr,n),c=wu(n),u=g.useRef(null),d=Ce(t,u),[f,l]=g.useState(!1),[p,h]=g.useState("");return g.useEffect(()=>{const x=u.current;x&&h((x.textContent??"").trim())},[s.children]),a.jsx(Gn.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:a.jsx(td,{asChild:!0,...c,focusable:!r,children:a.jsx(le.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:ne(e.onPointerMove,qn(x=>{r?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ne(e.onPointerLeave,qn(x=>i.onItemLeave(x))),onFocus:ne(e.onFocus,()=>l(!0)),onBlur:ne(e.onBlur,()=>l(!1))})})})}),u1="MenuCheckboxItem",_u=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return a.jsx(Ou,{scope:e.__scopeMenu,checked:n,children:a.jsx(_o,{role:"menuitemcheckbox","aria-checked":eo(n)?"mixed":n,...o,ref:t,"data-state":_a(n),onSelect:ne(o.onSelect,()=>r?.(eo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_u.displayName=u1;var ku="MenuRadioGroup",[f1,h1]=ln(ku,{value:void 0,onValueChange:()=>{}}),Pu=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=pt(r);return a.jsx(f1,{scope:e.__scopeMenu,value:n,onValueChange:s,children:a.jsx(ja,{...o,ref:t})})});Pu.displayName=ku;var Au="MenuRadioItem",Tu=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=h1(Au,e.__scopeMenu),s=n===o.value;return a.jsx(Ou,{scope:e.__scopeMenu,checked:s,children:a.jsx(_o,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":_a(s),onSelect:ne(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Tu.displayName=Au;var Ea="MenuItemIndicator",[Ou,p1]=ln(Ea,{checked:!1}),Mu=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=p1(Ea,n);return a.jsx(xt,{present:r||eo(s.checked)||s.checked===!0,children:a.jsx(le.span,{...o,ref:t,"data-state":_a(s.checked)})})});Mu.displayName=Ea;var m1="MenuSeparator",Iu=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(le.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Iu.displayName=m1;var g1="MenuArrow",Du=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Eo(n);return a.jsx(U0,{...o,...r,ref:t})});Du.displayName=g1;var x1="MenuSub",[ZS,Lu]=ln(x1),zn="MenuSubTrigger",Fu=g.forwardRef((e,t)=>{const n=dn(zn,e.__scopeMenu),r=or(zn,e.__scopeMenu),o=Lu(zn,e.__scopeMenu),s=Ra(zn,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=g.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return g.useEffect(()=>f,[f]),g.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),u(null)}},[c,u]),a.jsx(Sa,{asChild:!0,...d,children:a.jsx(Eu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":zu(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:l=>{e.onClick?.(l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,qn(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ne(e.onPointerLeave,qn(l=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,x=h==="right",m=x?-5:5,y=p[x?"left":"right"],v=p[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+m,y:l.clientY},{x:y,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x:y,y:p.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,l=>{const p=s.searchRef.current!=="";e.disabled||p&&l.key===" "||J0[r.dir].includes(l.key)&&(n.onOpenChange(!0),n.content?.focus(),l.preventDefault())})})})});Fu.displayName=zn;var Bu="MenuSubContent",$u=g.forwardRef((e,t)=>{const n=Nu(Ke,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=dn(Ke,e.__scopeMenu),i=or(Ke,e.__scopeMenu),c=Lu(Bu,e.__scopeMenu),u=g.useRef(null),d=Ce(t,u);return a.jsx(Gn.Provider,{scope:e.__scopeMenu,children:a.jsx(xt,{present:r||s.open,children:a.jsx(Gn.Slot,{scope:e.__scopeMenu,children:a.jsx(Ca,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ne(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:ne(e.onKeyDown,f=>{const l=f.currentTarget.contains(f.target),p=Z0[i.dir].includes(f.key);l&&p&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});$u.displayName=Bu;function zu(e){return e?"open":"closed"}function eo(e){return e==="indeterminate"}function _a(e){return eo(e)?"indeterminate":e?"checked":"unchecked"}function y1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function v1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function b1(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=v1(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function w1(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],u=t[i],d=c.x,f=c.y,l=u.x,p=u.y;f>r!=p>r&&n<(l-d)*(r-f)/(p-f)+d&&(o=!o)}return o}function S1(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return w1(n,t)}function qn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var N1=Su,R1=Sa,C1=Ru,j1=Cu,E1=ja,_1=ju,k1=_o,P1=_u,A1=Pu,T1=Tu,O1=Mu,M1=Iu,I1=Du,D1=Fu,L1=$u,ko="DropdownMenu",[F1]=an(ko,[bu]),Me=bu(),[B1,Uu]=F1(ko),Vu=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=Me(t),d=g.useRef(null),[f,l]=yo({prop:o,defaultProp:s??!1,onChange:i,caller:ko});return a.jsx(B1,{scope:t,triggerId:Qt(),triggerRef:d,contentId:Qt(),open:f,onOpenChange:l,onOpenToggle:g.useCallback(()=>l(p=>!p),[l]),modal:c,children:a.jsx(N1,{...u,open:f,onOpenChange:l,dir:r,modal:c,children:n})})};Vu.displayName=ko;var Wu="DropdownMenuTrigger",Hu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Uu(Wu,n),i=Me(n);return a.jsx(R1,{asChild:!0,...i,children:a.jsx(le.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Mt(t,s.triggerRef),onPointerDown:ne(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:ne(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Hu.displayName=Wu;var $1="DropdownMenuPortal",Ku=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Me(t);return a.jsx(C1,{...r,...n})};Ku.displayName=$1;var Gu="DropdownMenuContent",qu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Uu(Gu,n),s=Me(n),i=g.useRef(!1);return a.jsx(j1,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,c=>{i.current||o.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!o.modal||f)&&(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)"}})});qu.displayName=Gu;var z1="DropdownMenuGroup",U1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(E1,{...o,...r,ref:t})});U1.displayName=z1;var V1="DropdownMenuLabel",Yu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(_1,{...o,...r,ref:t})});Yu.displayName=V1;var W1="DropdownMenuItem",Xu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(k1,{...o,...r,ref:t})});Xu.displayName=W1;var H1="DropdownMenuCheckboxItem",K1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(P1,{...o,...r,ref:t})});K1.displayName=H1;var G1="DropdownMenuRadioGroup",q1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(A1,{...o,...r,ref:t})});q1.displayName=G1;var Y1="DropdownMenuRadioItem",X1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(T1,{...o,...r,ref:t})});X1.displayName=Y1;var J1="DropdownMenuItemIndicator",Z1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(O1,{...o,...r,ref:t})});Z1.displayName=J1;var Q1="DropdownMenuSeparator",Ju=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(M1,{...o,...r,ref:t})});Ju.displayName=Q1;var eS="DropdownMenuArrow",tS=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(I1,{...o,...r,ref:t})});tS.displayName=eS;var nS="DropdownMenuSubTrigger",Zu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(D1,{...o,...r,ref:t})});Zu.displayName=nS;var rS="DropdownMenuSubContent",Qu=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return a.jsx(L1,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qu.displayName=rS;var oS=Vu,sS=Hu,aS=Ku,ef=qu,tf=Yu,nf=Xu,rf=Ju,of=Zu,sf=Qu;const ka=oS,Pa=sS,iS=g.forwardRef(({className:e,inset:t,children:n,...r},o)=>a.jsxs(of,{ref:o,className:ee("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,a.jsx(Sl,{className:"ml-auto"})]}));iS.displayName=of.displayName;const cS=g.forwardRef(({className:e,...t},n)=>a.jsx(sf,{ref:n,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));cS.displayName=sf.displayName;const Po=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(aS,{children:a.jsx(ef,{ref:r,sideOffset:t,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Po.displayName=ef.displayName;const Ye=g.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(nf,{ref:r,className:ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Ye.displayName=nf.displayName;const lS=g.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(tf,{ref:r,className:ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));lS.displayName=tf.displayName;const Ao=g.forwardRef(({className:e,...t},n)=>a.jsx(rf,{ref:n,className:ee("-mx-1 my-1 h-px bg-muted",e),...t}));Ao.displayName=rf.displayName;function af({severity:e}){const t={critical:{cls:"bg-red-100 text-red-700 border-red-200 dark:bg-red-900/30 dark:text-red-400 dark:border-red-700",dot:"bg-red-500"},high:{cls:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-900/30 dark:text-orange-400 dark:border-orange-700",dot:"bg-orange-500"},medium:{cls:"bg-yellow-100 text-yellow-700 border-yellow-200 dark:bg-yellow-900/30 dark:text-yellow-400 dark:border-yellow-700",dot:"bg-yellow-500"},low:{cls:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-700",dot:"bg-blue-500"}}[e]??{cls:"bg-muted text-muted-foreground border-border",dot:"bg-muted-foreground"};return a.jsxs("span",{className:ee("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[11px] font-semibold capitalize",t.cls),children:[a.jsx("span",{className:ee("h-1.5 w-1.5 rounded-full",t.dot)}),e]})}function dS(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function uS({alerts:e,deletingId:t,onViewIncident:n,onPromote:r,onDelete:o}){return a.jsx("div",{className:"rounded-lg border overflow-hidden bg-card text-card-foreground",children:a.jsxs(po,{children:[a.jsx(mo,{children:a.jsxs(tn,{className:"bg-muted/50",children:[a.jsx(pe,{children:"Title"}),a.jsx(pe,{children:"Resource"}),a.jsx(pe,{children:"Resource Type"}),a.jsx(pe,{children:"Connector"}),a.jsx(pe,{children:"Tag"}),a.jsx(pe,{children:"Incident"}),a.jsx(pe,{children:"Severity"}),a.jsx(pe,{children:"Time"}),a.jsx(pe,{className:"text-right",children:"Actions"})]})}),a.jsx(go,{children:e.map(s=>a.jsxs(tn,{children:[a.jsxs(me,{className:"max-w-[200px]",children:[a.jsx("p",{className:"font-medium truncate",children:s.title}),s.description&&a.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:s.description})]}),a.jsx(me,{children:a.jsx("p",{className:"font-medium text-sm truncate max-w-[140px]",children:s.resourceName})}),a.jsx(me,{children:a.jsx(st,{variant:"outline",className:"text-[12px] mt-0.5",children:s.resourceType})}),a.jsx(me,{className:"text-sm text-muted-foreground",children:a.jsx("span",{className:"truncate max-w-[120px] block",children:s.connectorName??"—"})}),a.jsx(me,{children:s.projectTag?a.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded",children:s.projectTag}):a.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),a.jsx(me,{children:s.promotedIncidentId?a.jsxs(Q,{variant:"ghost",className:"h-auto text-xs",onClick:()=>n(s.promotedIncidentId),children:[String(s.promotedIncidentId).slice(0,12),"..."]}):a.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),a.jsx(me,{children:a.jsx(af,{severity:s.severity})}),a.jsx(me,{className:"text-sm text-muted-foreground whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Ks,{className:"h-3 w-3 shrink-0"}),dS(s.alertTime)]})}),a.jsx(me,{className:"text-right",children:a.jsxs(ka,{children:[a.jsx(Pa,{asChild:!0,children:a.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7",children:a.jsx(Nl,{className:"h-4 w-4"})})}),a.jsxs(Po,{align:"end",children:[s.status==="open"&&a.jsxs(a.Fragment,{children:[a.jsxs(Ye,{onClick:()=>r(s),children:[a.jsx(Hs,{className:"h-4 w-4"}),"Convert to Incident"]}),a.jsx(Ao,{}),a.jsxs(Ye,{onClick:()=>o(s.id),disabled:t===s.id,className:"text-destructive focus:text-destructive",children:[t===s.id?a.jsx(ge,{className:"h-4 w-4 animate-spin"}):a.jsx(Rl,{className:"h-4 w-4"}),"Delete"]})]}),s.status==="promoted"&&s.promotedIncidentId&&a.jsxs(Ye,{onClick:()=>n(s.promotedIncidentId),children:[a.jsx(ws,{className:"h-4 w-4 text-foreground"}),"View Incident"]}),s.status==="dismissed"&&a.jsx(Ye,{disabled:!0,className:"text-muted-foreground italic",children:"No actions available"})]})]})})]},s.id))})]})})}function fS(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function hS({alert:e,deletingId:t,onViewIncident:n,onPromote:r,onDelete:o}){return a.jsxs(Ne,{className:"hover:border-primary/30 transition-colors flex flex-col h-full",children:[a.jsxs(ho,{className:"pb-3 flex flex-row items-start justify-between space-y-0",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("h3",{className:"font-semibold text-md text-card-foreground leading-tight truncate max-w-[220px]",children:e.title}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(af,{severity:e.severity}),a.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[a.jsx(Ks,{className:"h-3 w-3"}),fS(e.alertTime)]})]})]}),a.jsxs(ka,{children:[a.jsx(Pa,{asChild:!0,children:a.jsx(Q,{variant:"ghost",size:"icon",className:"h-8 w-8 -mr-2 -mt-2",children:a.jsx(cx,{className:"h-4 w-4"})})}),a.jsxs(Po,{align:"end",children:[e.status==="open"&&a.jsxs(a.Fragment,{children:[a.jsxs(Ye,{onClick:()=>r(e),children:[a.jsx(Hs,{className:"h-4 w-4"}),"Convert to Incident"]}),a.jsx(Ao,{}),a.jsxs(Ye,{onClick:()=>o(e.id),disabled:t===e.id,className:"text-destructive focus:text-destructive",children:[t===e.id?a.jsx(ge,{className:"h-4 w-4 animate-spin"}):a.jsx(Rl,{className:"h-4 w-4"}),"Delete"]})]}),e.status==="promoted"&&e.promotedIncidentId&&a.jsxs(Ye,{onClick:()=>n(e.promotedIncidentId),children:[a.jsx(ws,{className:"h-4 w-4"}),"View Incident"]}),e.status==="dismissed"&&a.jsx(Ye,{disabled:!0,className:"text-muted-foreground italic",children:"No actions available"})]})]})]}),a.jsxs(Re,{className:"flex-1 flex flex-col gap-4",children:[a.jsxs("div",{className:"text-xs flex flex-col gap-2 justify-center ",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[a.jsx(Tx,{className:"h-3.5 w-3.5"})," Resource"]}),a.jsx("span",{className:"truncate ",title:e.resourceName,children:e.resourceName})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[a.jsx(Ws,{className:"h-3.5 w-3.5"})," Source"]}),a.jsx("span",{className:"truncate",title:e.connectorName??"Unknown",children:e.connectorName??"—"})]})]}),e.promotedIncidentId&&a.jsx("div",{className:"flex justify-end items-center",children:a.jsxs(Q,{variant:"default",size:"sm",onClick:()=>n(e.promotedIncidentId),children:[a.jsx(ws,{className:"w-4 h-4 mr-1"}),"View Incident"]})})]})]})}function pS({onViewIncident:e}){const[t,n]=R.useState([]),[r,o]=R.useState(0),[s,i]=R.useState(!0),[c,u]=R.useState(1),[d,f]=R.useState(20),[l,p]=R.useState("card"),[h,x]=R.useState(""),[m,y]=R.useState(""),[v,b]=R.useState(""),[S,w]=R.useState(null),[_,E]=R.useState(!1),[C,N]=R.useState(null),[P,T]=R.useState(null);R.useEffect(()=>{const $=setTimeout(()=>{y(h),u(1)},400);return()=>clearTimeout($)},[h]);const M=R.useCallback(async()=>{i(!0);try{const $=await be.listAlerts({page:c,limit:d,severity:v||void 0,search:m||void 0});n($.alerts??[]),o($.total??0)}catch{se.error("Failed to load alerts")}finally{i(!1)}},[c,d,v,m]);R.useEffect(()=>{M()},[M]);const D=async()=>{if(S){E(!0);try{const $=await be.promoteAlert(S.id);se.success("Alert promoted to incident"),w(null),M(),e($.incidentId)}catch($){se.error($?.response?.data?.error??"Failed to promote alert")}finally{E(!1)}}},G=async()=>{if(C){T(C);try{await be.deleteAlert(C),se.success("Alert deleted"),N(null),M()}catch{se.error("Failed to delete alert")}finally{T(null)}}},I=Math.max(1,Math.ceil(r/d));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(wl,{className:"h-6 w-6 text-primary"}),a.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Alerts"})]}),a.jsxs("div",{className:"flex bg-muted/50 p-1 rounded-md border",children:[a.jsxs(Q,{size:"sm",variant:l==="card"?"secondary":"ghost",onClick:()=>p("card"),children:[a.jsx(Ys,{className:"h-4 w-4"}),"Card"]}),a.jsxs(Q,{size:"sm",variant:l==="table"?"secondary":"ghost",onClick:()=>p("table"),children:[a.jsx(Zs,{className:"h-3.5 w-3.5"}),"Table"]})]})]}),a.jsx("p",{className:"text-muted-foreground text-sm mt-0.5",children:"Inbound resource-down events from connected webhook sources."})]}),a.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[a.jsxs("div",{className:"relative",children:[a.jsx(fo,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),a.jsx(Te,{type:"text",value:h,onChange:$=>x($.target.value),placeholder:"Search alerts…",className:"pl-9 pr-8 w-[200px]"}),h&&a.jsx("button",{onClick:()=>x(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:a.jsx(er,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{value:v,onChange:$=>{b($.target.value),u(1)},className:"h-9 rounded-md border bg-popover text-popover-foreground px-3 pr-8 text-sm appearance-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx("option",{value:"",children:"All Severities"}),a.jsx("option",{value:"critical",children:"Critical"}),a.jsx("option",{value:"high",children:"High"}),a.jsx("option",{value:"medium",children:"Medium"}),a.jsx("option",{value:"low",children:"Low"})]}),a.jsx(Vg,{className:"pointer-events-none absolute right-2.5 top-2.5 h-4 w-4 opacity-50"})]})]}),s?a.jsx("div",{className:"flex justify-center p-8 text-muted-foreground",children:a.jsx(ge,{className:"h-6 w-6 animate-spin"})}):t.length===0?a.jsx("div",{className:"p-8 text-center text-muted-foreground border border-dashed rounded-lg",children:"No alerts found."}):a.jsxs(a.Fragment,{children:[l==="table"?a.jsx(uS,{alerts:t,deletingId:P,onViewIncident:e,onPromote:w,onDelete:N}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:t.map($=>a.jsx(hS,{alert:$,deletingId:P,onViewIncident:e,onPromote:w,onDelete:N},$.id))}),t.length>0&&a.jsx(xo,{currentPage:c,pageSize:d,totalPages:I,total:r,onPageChange:$=>u($),onPageSizeChange:$=>{f($),u(1)}})]}),a.jsx(Rw,{alert:S,open:!!S,onConfirm:D,onCancel:()=>w(null),promoting:_}),a.jsx(Cw,{open:!!C,onConfirm:G,onCancel:()=>N(null),deleting:!!P})]})}function mS({open:e,project:t,submitting:n,onClose:r,onSubmit:o}){const s=!!t,[i,c]=R.useState(""),[u,d]=R.useState(""),[f,l]=R.useState(""),[p,h]=R.useState(""),[x,m]=R.useState(""),[y,v]=R.useState(""),[b,S]=R.useState(""),[w,_]=R.useState("");R.useEffect(()=>{e&&(m(""),t?(c(t.name),d(t.tag),l(t.description??""),v(t.awsAccessKeyId??""),S(t.awsSecretAccessKey??""),_(t.awsRegion??""),h(t.dependencies?JSON.stringify(t.dependencies,null,2):`[
|
|
59
|
+
|
|
60
|
+
]`)):(c(""),d(""),l(""),h(""),v(""),S(""),_("")))},[e,t]);const E=N=>{const P=N.target.value;if(h(P),!P.trim()){m("");return}try{JSON.parse(P),m("")}catch{m("Invalid JSON")}},C=N=>{if(N.preventDefault(),!i.trim()){se.error("Project name is required");return}if(!u.trim()){se.error("Resource tag is required");return}let P=[];if(p.trim())try{const T=JSON.parse(p);if(!Array.isArray(T)){m("Dependencies must be a JSON array");return}P=T}catch{m("Invalid JSON");return}o({name:i.trim(),tag:u.trim(),description:f.trim()||void 0,dependencies:P,awsAccessKeyId:y.trim()||void 0,awsSecretAccessKey:b.trim()||void 0,awsRegion:w.trim()||void 0})};return a.jsx(cn,{open:e,onOpenChange:N=>!N&&!n&&r(),children:a.jsxs(It,{className:"max-w-xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Dt,{children:[a.jsx(Ft,{children:s?"Edit Project":"New Project"}),a.jsx(Bt,{children:"Projects map a resource tag to a list of dependencies used for RCA context."})]}),a.jsxs("form",{onSubmit:C,className:"flex flex-col gap-4 mt-2",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ae,{children:["Project Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Te,{value:i,onChange:N=>c(N.target.value),placeholder:"e.g. Checkout Service",disabled:n})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ae,{className:"flex items-center gap-1.5",children:["Project Tag ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Te,{value:u,onChange:N=>d(N.target.value),placeholder:"e.g. checkout-api",disabled:n||s,className:"font-mono"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Alerts with ",a.jsxs("code",{className:"bg-muted px-1 rounded",children:['project_tag = "',u||"...",'"']})," will use this project's dependencies.",s&&" Tag cannot be changed after creation."]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{children:"Description"}),a.jsx(Te,{value:f,onChange:N=>l(N.target.value),placeholder:"Brief description (optional)",disabled:n})]}),a.jsxs("div",{className:"space-y-4 pt-2 pb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium",children:"AWS Access (Optional)"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Provide AWS credentials if your dependencies require AWS integration for metrics/logs."})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{children:"Region"}),a.jsx(Te,{value:w,onChange:N=>_(N.target.value),placeholder:"us-east-1",disabled:n,className:"font-mono"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{children:"Access Key ID"}),a.jsx(Te,{value:y,onChange:N=>v(N.target.value),placeholder:"AKIA...",disabled:n,className:"font-mono"})]}),a.jsxs("div",{className:"space-y-2 col-span-2",children:[a.jsx(Ae,{children:"Secret Access Key"}),a.jsx(Te,{type:"password",value:b,onChange:N=>S(N.target.value),placeholder:"Secret Key",disabled:n,className:"font-mono"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{className:"flex items-center gap-1.5",children:"Dependencies"}),a.jsx("textarea",{rows:5,spellCheck:!1,value:p,onChange:E,placeholder:`[
|
|
61
|
+
{ "name": "EC2", "type": "compute" },
|
|
62
|
+
{ "name": "RDS", "type": "database" }
|
|
63
|
+
]`,disabled:n,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm font-mono shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 resize-none"}),x&&a.jsx("p",{className:"text-xs text-destructive mt-1",children:x}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe your infrastructure dependencies as JSON. This is sent to the AI for Root Cause Analysis."})]})]}),a.jsxs(Lt,{children:[a.jsx(Q,{type:"button",variant:"outline",onClick:r,disabled:n,children:"Cancel"}),a.jsx(Q,{type:"submit",disabled:n,children:n?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin mr-2"})," Saving…"]}):s?"Save Changes":"Create Project"})]})]})]})})}function gS({project:e,onConfirm:t,onCancel:n,deleting:r}){return a.jsx(cn,{open:!0,onOpenChange:o=>!o&&!r&&n(),children:a.jsxs(It,{children:[a.jsxs(Dt,{children:[a.jsx(Ft,{children:"Delete project?"}),a.jsxs(Bt,{children:["This will permanently delete ",a.jsx("strong",{children:e.name}),". Existing incidents that were promoted using this project's dependencies will not be affected."]})]}),a.jsxs(Lt,{children:[a.jsx(Q,{variant:"outline",onClick:n,disabled:r,children:"Cancel"}),a.jsx(Q,{variant:"destructive",onClick:t,disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin mr-2"})," Deleting…"]}):"Delete"})]})]})})}function xS({project:e,onEdit:t,onDelete:n}){return Array.isArray(e.dependencies)&&e.dependencies,a.jsx(Ne,{className:"hover:shadow-sm hover:border-primary/30 transition-all flex flex-col bg-card border-border",children:a.jsxs(Re,{className:"p-5 flex flex-col gap-4 h-full",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-muted/80 text-foreground",children:a.jsx(Vr,{size:20})}),a.jsxs("div",{className:"flex gap-1 shrink-0",children:[a.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>t(e),className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:"Edit",children:a.jsx(Js,{size:16})}),a.jsx(Q,{variant:"ghost",size:"icon",onClick:()=>n(e),className:"h-8 w-8 text-red-500/80 hover:text-red-500 hover:bg-red-500/10",title:"Delete",children:a.jsx(Qs,{size:16})})]})]}),a.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[a.jsx("h3",{className:"font-semibold text-md text-card-foreground leading-tight truncate",children:e.name}),e.description?a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):a.jsxs("p",{className:"text-sm text-muted-foreground/50 italic",children:["No description —"," ",a.jsx("button",{onClick:()=>t(e),className:"underline underline-offset-2 hover:text-muted-foreground transition-colors",children:"add one"})]})]}),a.jsx("div",{className:"mt-auto pt-2 flex items-center ",children:a.jsx(st,{variant:"secondary",className:"uppercase tracking-wider text-[10px] font-semibold px-2 py-0.5 rounded-md",children:e.tag||"PROJECT"})})]})})}function yS({projects:e,onEdit:t,onDelete:n}){return a.jsx("div",{className:"rounded-lg border overflow-hidden bg-card text-card-foreground",children:a.jsxs(po,{children:[a.jsx(mo,{children:a.jsxs(tn,{className:"bg-muted/50",children:[a.jsx(pe,{children:"Project Name"}),a.jsx(pe,{children:"Tag"}),a.jsx(pe,{children:"Dependencies"}),a.jsx(pe,{className:"text-right",children:"Actions"})]})}),a.jsx(go,{children:e.map(r=>{const o=Array.isArray(r.dependencies)?r.dependencies:[];return a.jsxs(tn,{children:[a.jsxs(me,{children:[a.jsx("p",{className:"font-medium",children:r.name}),r.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 max-w-[300px] mt-0.5",children:r.description})]}),a.jsx(me,{children:a.jsx(st,{variant:"secondary",className:"uppercase tracking-wider text-[10px] font-semibold px-2 py-0.5 rounded-md",children:r.tag||"PROJECT"})}),a.jsx(me,{children:a.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[a.jsx(Xs,{className:"h-4 w-4"}),a.jsxs("span",{children:[o.length," linked"]})]})}),a.jsx(me,{className:"text-right",children:a.jsxs(ka,{children:[a.jsx(Pa,{asChild:!0,children:a.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7",children:a.jsx(Nl,{className:"h-4 w-4"})})}),a.jsxs(Po,{align:"end",children:[a.jsxs(Ye,{onClick:()=>t(r),children:[a.jsx(Js,{className:"h-4 w-4 mr-2"}),"Edit"]}),a.jsx(Ao,{}),a.jsxs(Ye,{onClick:()=>n(r),className:"text-destructive focus:text-destructive",children:[a.jsx(Qs,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})})]},r.id)})})]})})}function vS(){const[e,t]=R.useState([]),[n,r]=R.useState(0),[o,s]=R.useState(!0),[i,c]=R.useState(1),[u,d]=R.useState(10),[f,l]=R.useState(""),[p,h]=R.useState(""),[x,m]=R.useState("card"),[y,v]=R.useState(!1),[b,S]=R.useState(null),[w,_]=R.useState(!1),[E,C]=R.useState(null),[N,P]=R.useState(!1);R.useEffect(()=>{const I=setTimeout(()=>{h(f),c(1)},400);return()=>clearTimeout(I)},[f]);const T=R.useCallback(async()=>{s(!0);try{const I=await be.listProjects({page:i,limit:u,search:p||void 0});t(I.projects??[]),r(I.total??0)}catch{se.error("Failed to load projects")}finally{s(!1)}},[i,u,p]);R.useEffect(()=>{T()},[T]);const M=async I=>{_(!0);try{b?(await be.updateProject(b.id,I),se.success("Project updated")):(await be.createProject(I),se.success("Project created")),v(!1),T()}catch($){se.error($?.response?.data?.error??"Failed to save project")}finally{_(!1)}},D=async()=>{if(E){P(!0);try{await be.deleteProject(E.id),se.success("Project deleted"),C(null),T()}catch{se.error("Failed to delete project")}finally{P(!1)}}},G=Math.max(1,Math.ceil(n/u));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b pb-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vr,{className:"h-5 w-5 text-primary"}),a.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Projects"})]}),a.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Map resource tags to dependency lists for automated RCA context on incident promotion."})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex bg-muted/50 p-1 rounded-md border",children:[a.jsxs(Q,{size:"sm",variant:x==="card"?"secondary":"ghost",onClick:()=>m("card"),children:[a.jsx(Ys,{className:"h-4 w-4"}),"Card"]}),a.jsxs(Q,{size:"sm",variant:x==="table"?"secondary":"ghost",onClick:()=>m("table"),children:[a.jsx(Zs,{className:"h-3.5 w-3.5"}),"Table"]})]}),a.jsxs(Q,{onClick:()=>{S(null),v(!0)},children:[a.jsx(Wr,{className:"h-4 w-4"})," New Project"]})]})]}),a.jsxs("div",{className:"relative w-fit",children:[a.jsx(fo,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),a.jsx(Te,{type:"text",value:f,onChange:I=>l(I.target.value),placeholder:"Search projects…",className:"pl-9 pr-8 w-[220px]"}),f&&a.jsx("button",{onClick:()=>l(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:a.jsx(er,{className:"h-4 w-4"})})]}),o&&e.length===0?a.jsx("div",{className:"flex h-[50vh] items-center justify-center",children:a.jsx(ge,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.length===0?a.jsxs("div",{className:"flex h-[50vh] flex-col items-center justify-center rounded-xl border-2 border-dashed p-8 text-center",children:[a.jsx("div",{className:"bg-muted mx-auto flex h-16 w-16 items-center justify-center rounded-full mb-4",children:a.jsx(Vr,{className:"h-7 w-7 text-muted-foreground"})}),a.jsx("h3",{className:"text-base font-semibold",children:f?"No matching projects":"No projects yet"}),a.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground max-w-sm mx-auto",children:f?"Try a different search term.":"Create a project to map resource tags to their dependencies for RCA analysis."}),!f&&a.jsxs(Q,{onClick:()=>{S(null),v(!0)},className:"mt-5",children:[a.jsx(Wr,{className:"h-4 w-4"})," Create First Project"]})]}):a.jsxs(a.Fragment,{children:[x==="table"?a.jsx(yS,{projects:e,onEdit:I=>{S(I),v(!0)},onDelete:I=>C(I)}):a.jsx("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:e.map(I=>a.jsx(xS,{project:I,onEdit:$=>{S($),v(!0)},onDelete:$=>C($)},I.id))}),a.jsx(xo,{currentPage:i,pageSize:u,totalPages:G,total:n,onPageChange:I=>c(I),onPageSizeChange:I=>{d(I),c(1)}})]}),a.jsx(mS,{open:y,project:b,submitting:w,onClose:()=>{w||v(!1)},onSubmit:M}),E&&a.jsx(gS,{project:E,onConfirm:D,onCancel:()=>C(null),deleting:N})]})}var bS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wS=bS.reduce((e,t)=>{const n=ra(`Primitive.${t}`),r=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),SS="Separator",vc="horizontal",NS=["horizontal","vertical"],cf=g.forwardRef((e,t)=>{const{decorative:n,orientation:r=vc,...o}=e,s=RS(r)?r:vc,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(wS.div,{"data-orientation":s,...c,...o,ref:t})});cf.displayName=SS;function RS(e){return NS.includes(e)}var lf=cf;const df=g.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>a.jsx(lf,{ref:o,decorative:n,orientation:t,className:ee("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));df.displayName=lf.displayName;function CS({awsBedrockAccessKeyId:e,setAwsBedrockAccessKeyId:t,awsBedrockSecretAccessKey:n,setAwsBedrockSecretAccessKey:r,awsBedrockRegion:o,setAwsBedrockRegion:s,saving:i,onSave:c}){return a.jsx("form",{onSubmit:c,className:"space-y-6",children:a.jsxs(Ne,{children:[a.jsxs(ho,{children:[a.jsx(na,{children:"AWS Bedrock Configuration"}),a.jsx(Ul,{children:"Configure AWS credentials to access Bedrock foundational models. These credentials are used across all RCA requests to generate intelligent summaries and remediation steps."})]}),a.jsxs(Re,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{htmlFor:"awsAccessKeyId",children:"Access Key ID"}),a.jsx(Te,{id:"awsAccessKeyId",type:"text",value:e,onChange:u=>t(u.target.value),placeholder:"AKIA...",disabled:i,className:"font-mono"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{htmlFor:"awsRegion",children:"AWS Region"}),a.jsx(Te,{id:"awsRegion",type:"text",value:o,onChange:u=>s(u.target.value),placeholder:"us-east-1",disabled:i,className:"font-mono"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ae,{htmlFor:"awsSecretKey",children:"Secret Access Key"}),a.jsx(Te,{id:"awsSecretKey",type:"password",value:n,onChange:u=>r(u.target.value),placeholder:"Secret Key...",disabled:i,className:"font-mono"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave blank to keep the existing saved secret key."})]})]}),a.jsx(Vl,{children:a.jsx(Q,{type:"submit",disabled:i,children:i?a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"h-4 w-4 animate-spin mr-2"}),"Saving..."]}):"Save Changes"})})]})})}function jS(){const[e,t]=R.useState(!0),[n,r]=R.useState(!1),[o,s]=R.useState(""),[i,c]=R.useState(""),[u,d]=R.useState("");R.useEffect(()=>{f()},[]);async function f(){try{t(!0);const p=await be.getSettings();p.ok&&p.settings&&(s(p.settings.awsBedrockAccessKeyId||""),c(p.settings.awsBedrockSecretAccessKey||""),d(p.settings.awsBedrockRegion||""))}catch(p){se.error(p.message||"Failed to load settings")}finally{t(!1)}}async function l(p){p.preventDefault();try{r(!0),(await be.updateSettings({awsBedrockAccessKeyId:o.trim()||void 0,awsBedrockSecretAccessKey:i.trim()||void 0,awsBedrockRegion:u.trim()||void 0})).ok?se.success("Settings saved successfully"):se.error("Failed to save settings")}catch(h){se.error(h.message||"Failed to save settings")}finally{r(!1)}}return e?a.jsx("div",{className:"p-8 text-center text-muted-foreground flex items-center justify-center h-64",children:a.jsx(ge,{className:"h-6 w-6 animate-spin mr-3"})}):a.jsxs("div",{className:"max-w-2xl w-full space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-xl font-semibold tracking-tight flex items-center gap-2",children:[a.jsx(Mx,{className:"h-5 w-5 text-primary"}),"Settings"]}),a.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Manage configurations for the Meyi Insight analysis engine."})]}),a.jsx(df,{}),a.jsx(CS,{awsBedrockAccessKeyId:o,setAwsBedrockAccessKeyId:s,awsBedrockSecretAccessKey:i,setAwsBedrockSecretAccessKey:c,awsBedrockRegion:u,setAwsBedrockRegion:d,saving:n,onSave:l})]})}function ES(){return a.jsxs("div",{className:"w-full h-full",children:[a.jsx(Ls,{}),a.jsx(Eg,{})]})}const bc=Jh({component:ES});function uf(){const e=St({getParentRoute:()=>bc,id:"insight-workspace",component:()=>a.jsx(Ls,{})}),t=e.addChildren([St({getParentRoute:()=>e,path:"/",component:()=>a.jsx(Bh,{to:"/alerts"})}),St({getParentRoute:()=>e,path:"/connectors",component:Nw}),St({getParentRoute:()=>e,path:"/projects",component:vS}),St({getParentRoute:()=>e,path:"/settings",component:jS}),St({getParentRoute:()=>e,path:"/alerts",component:()=>{const n=wn();return a.jsx(pS,{onViewIncident:r=>n({to:`/incidents/${r}`})})}}),St({getParentRoute:()=>e,path:"/incidents",component:()=>{const n=wn();return a.jsx(av,{onViewResult:r=>n({to:`/incidents/${r}`})})}}),St({getParentRoute:()=>e,path:"/incidents/$id",component:()=>{const{id:n}=Ds({strict:!1}),r=wn();return a.jsx(Hv,{incidentId:n,onBack:()=>r({to:"/incidents"}),onViewAlert:()=>r({to:"/alerts"})})}})]);return bc.addChildren([t])}function _S({apiBase:e,token:t,basePath:n="/insight"}){R.useEffect(()=>{vl(e,t)},[e,t]);const r=R.useMemo(()=>cp({routeTree:uf(),basepath:n}),[n]);return a.jsx(up,{router:r})}const kS=[{title:"Incidents",url:"/incidents",icon:"BrainCircuit",roles:["admin","user"]},{title:"Alerts",url:"/alerts",icon:"Bell",roles:["admin","user"]},{title:"Connectors",url:"/connectors",icon:"Plug",roles:["admin","user"]},{title:"Projects",url:"/projects",icon:"FolderOpen",roles:["admin","user"]},{title:"Settings",url:"/settings",icon:"Settings",roles:["admin"]}];exports.InsightPage=_S;exports.api=ie;exports.configureApi=vl;exports.createRouteTree=uf;exports.insightNavItems=kS;
|