PageSourceSearch

https://moredge.ai/assets/index-CCDpNIMv.js

js moredge.ai collected 2026-10-05 12:16:50 UTC 2,974,173 bytes, 4,658 lines download raw bytes

vendor: 6,275 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/parser-Bnw8YarV.js","assets/dateParser-DDpKOj7f.js","assets/index-BSm2Mt3-.js","assets/dasTraderParser-BmSzzhbz.js","assets/tradeStationParser-B9MvDzN6.js","assets/tradeZeroParser-BX5qpx0v.js","assets/webullParser-BfM1kmMO.js","assets/lightSpeedParser-B-ft8K1t.js","assets/traderVueParser-BSt_kfm_.js","assets/universalImportParser-BNkT7GGx.js"])))=>i.map(i=>d[i]);
2function lSe(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var N_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var QM={exports:{}},tv={},ZM={exports:{}},lr={};/**
3 * @license React
4 * react.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var uH;function cSe(){if(uH)return lr;uH=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function h(q){return q===null||typeof q!="object"?null:(q=f&&q[f]||q["@@iterator"],typeof q=="function"?q:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function v(q,H,Y){this.props=q,this.context=H,this.refs=x,this.updater=Y||m}v.prototype.isReactComponent={},v.prototype.setState=function(q,H){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,H,"setState")},v.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function _(){}_.prototype=v.prototype;function S(q,H,Y){this.props=q,this.context=H,this.refs=x,this.updater=Y||m}var k=S.prototype=new _;k.constructor=S,y(k,v.prototype),k.isPureReactComponent=!0;var E=Array.isArray,T=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function M(q,H,Y){var J,re={},me=null,oe=null;if(H!=null)for(J in H.ref!==void 0&&(oe=H.ref),H.key!==void 0&&(me=""+H.key),H)T.call(H,J)&&!j.hasOwnProperty(J)&&(re[J]=H[J]);var ge=arguments.length-2;if(ge===1)re.children=Y;else if(1<ge){for(var le=Array(ge),Se=0;Se<ge;Se++)le[Se]=arguments[Se+2];re.children=le}if(q&&q.defaultProps)for(J in ge=q.defaultProps,ge)re[J]===void 0&&(re[J]=ge[J]);return{$$typeof:t,type:q,key:me,ref:oe,props:re,_owner:N.current}}function O(q,H){return{$$typeof:t,type:q.type,key:H,ref:q.ref,props:q.props,_owner:q._owner}}function R(q){return typeof q=="object"&&q!==null&&q.$$typeof===t}function I(q){var H={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(Y){return H[Y]})}var B=/\/+/g;function F(q,H){return typeof q=="object"&&q!==null&&q.key!=null?I(""+q.key):H.toString(36)}function V(q,H,Y,J,re){var me=typeof q;(me==="undefined"||me==="boolean")&&(q=null);var oe=!1;if(q===null)oe=!0;else switch(me){case"string":case"number":oe=!0;break;case"object":switch(q.$$typeof){case t:case e:oe=!0}}if(oe)return oe=q,re=re(oe),q=J===""?"."+F(oe,0):J,E(re)?(Y="",q!=null&&(Y=q.replace(B,"$&/")+"/"),V(re,H,Y,"",function(Se){return Se})):re!=null&&(R(re)&&(re=O(re,Y+(!re.key||oe&&oe.key===re.key?"":(""+re.key).replace(B,"$&/")+"/")+q)),H.push(re)),1;if(oe=0,J=J===""?".":J+":",E(q))for(var ge=0;ge<q.length;ge++){me=q[ge];var le=J+F(me,ge);oe+=V(me,H,Y,le,re)}else if(le=h(q),typeof le=="function")for(q=le.call(q),ge=0;!(me=q.next()).done;)me=me.value,le=J+F(me,ge++),oe+=V(me,H,Y,le,re);else if(me==="object")throw H=String(q),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return oe}function $(q,H,Y){if(q==null)return q;var J=[],re=0;return V(q,J,"","",function(me){return H.call(Y,me,re++)}),J}function U(q){if(q._status===-1){var H=q._result;H=H(),H.then(function(Y){(q._status===0||q._status===-1)&&(q._status=1,q._result=Y)},function(Y){(q._status===0||q._status===-1)&&(q._status=2,q._result=Y)}),q._status===-1&&(q._status=0,q._result=H)}if(q._status===1)return q._result.default;throw q._result}var z={current:null},L={transition:null},W={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:L,ReactCurrentOwner:N};function K(){throw Error("act(...) is not supported in production builds of React.")}return lr.Children={map:$,forEach:function(q,H,Y){$(q,function(){H.apply(this,arguments)},Y)},count:function(q){var H=0;return $(q,function(){H++}),H},toArray:function(q){return $(q,function(H){return H})||[]},only:function(q){if(!R(q))throw Error("React.Children.only expected to receive a single React element child.");return q}},lr.Component=v,lr.Fragment=r,lr.Profiler=i,lr.PureComponent=S,lr.StrictMode=n,lr.Suspense=c,lr.__SECRET_INT
10ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,lr.act=K,lr.cloneElement=function(q,H,Y){if(q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+q+".");var J=y({},q.props),re=q.key,me=q.ref,oe=q._owner;if(H!=null){if(H.ref!==void 0&&(me=H.ref,oe=N.current),H.key!==void 0&&(re=""+H.key),q.type&&q.type.defaultProps)var ge=q.type.defaultProps;for(le in H)T.call(H,le)&&!j.hasOwnProperty(le)&&(J[le]=H[le]===void 0&&ge!==void 0?ge[le]:H[le])}var le=arguments.length-2;if(le===1)J.children=Y;else if(1<le){ge=Array(le);for(var Se=0;Se<le;Se++)ge[Se]=arguments[Se+2];J.children=ge}return{$$typeof:t,type:q.type,key:re,ref:me,props:J,_owner:oe}},lr.createContext=function(q){return q={$$typeof:a,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},q.Provider={$$typeof:s,_context:q},q.Consumer=q},lr.createElement=M,lr.createFactory=function(q){var H=M.bind(null,q);return H.type=q,H},lr.createRef=function(){return{current:null}},lr.forwardRef=function(q){return{$$typeof:o,render:q}},lr.isValidElement=R,lr.lazy=function(q){return{$$typeof:d,_payload:{_status:-1,_result:q},_init:U}},lr.memo=function(q,H){return{$$typeof:u,type:q,compare:H===void 0?null:H}},lr.startTransition=function(q){var H=L.transition;L.transition={};try{q()}finally{L.transition=H}},lr.unstable_act=K,lr.useCallback=function(q,H){return z.current.useCallback(q,H)},lr.useContext=function(q){return z.current.useContext(q)},lr.useDebugValue=function(){},lr.useDeferredValue=function(q){return z.current.useDeferredValue(q)},lr.useEffect=function(q,H){return z.current.useEffect(q,H)},lr.useId=function(){return z.current.useId()},lr.useImperativeHandle=function(q,H,Y){return z.current.useImperativeHandle(q,H,Y)},lr.useInsertionEffect=function(q,H){return z.current.useInsertionEffect(q,H)},lr.useLayoutEffect=function(q,H){return z.current.useLayoutEffect(q,H)},lr.useMemo=function(q,H){return z.current.useMemo(q,H)},lr.useReducer=function(q,H,Y){return z.current.useReducer(q,H,Y)},lr.useRef=function(q){return z.current.useRef(q)},lr.useState=function(q){return z.current.useState(q)},lr.useSyncExternalStore=function(q,H,Y){return z.current.useSyncExternalStore(q,H,Y)},lr.useTransition=function(){return z.current.useTransition()},lr.version="18.3.1",lr}var dH;function bE(){return dH||(dH=1,ZM.exports=cSe()),ZM.exports}/**
11 * @license React
12 * react-jsx-runtime.production.min.js
13 *
14 * Copyright (c) Facebook, Inc. and its affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var fH;function uSe(){if(fH)return tv;fH=1;var t=bE(),e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,c,u){var d,f={},h=null,m=null;u!==void 0&&(h=""+u),c.key!==void 0&&(h=""+c.key),c.ref!==void 0&&(m=c.ref);for(d in c)n.call(c,d)&&!s.hasOwnProperty(d)&&(f[d]=c[d]);if(o&&o.defaultProps)for(d in c=o.defaultProps,c)f[d]===void 0&&(f[d]=c[d]);return{$$typeof:e,type:o,key:h,ref:m,props:f,_owner:i.current}}return tv.Fragment=r,tv.jsx=a,tv.jsxs=a,tv}var hH;function dSe(){return hH||(hH=1,QM.exports=uSe()),QM.exports}var l=dSe(),b=bE();const P=Lr(b),xf=lSe({__proto__:null,default:P},[b]),fSe=!1;function rl(t){try{return t()}catch{}}const VL=rl(()=>globalThis)||rl(()=>window)||rl(()=>self)||rl(()=>global)||rl(function(){return rl.constructor("return this")()}),c4="4.0.8",pH=new Map;function ese(t){const e=pH.get(t)||1;return pH.set(t,e+1),`${t}:${e}:${Math.random().toString(36).slice(2)}`}function hSe(t,e=0){const r=ese("stringifyForDisplay");return JSON.stringify(t,(n,i)=>i===void 0?r:i,e).split(JSON.stringify(r)).join("<undefined>")}const mH="Invariant Violation";class u4 extends Error{constructor(e=mH){super(e),this.name=mH,Object.setPrototypeOf(this,u4.prototype)}}const tse=["debug","log","warn","error","silent"];let pSe=tse.indexOf("silent");function Xt(t,...e){if(!t)throw jo(...e)}function wE(t){return function(e,...r){if(tse.indexOf(t)>=pSe){const n=console[t]||console.log;if(typeof e=="number"){const i=e;e=rse(i),e||(e=nse(i,r),r=[])}n(e,...r)}}}Xt.debug=wE("debug");Xt.log=wE("log");Xt.warn=wE("warn");Xt.error=wE("error");function jo(t,...e){return new u4(rse(t,e)||nse(t,e))}const gH=Symbol.for("ApolloErrorMessageHandler_"+c4);function UL(t){if(typeof t=="string")return t;try{return hSe(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function rse(t,e=[]){if(t)return VL[gH]&&VL[gH](t,e.map(UL))}function nse(t,e=[]){if(t)return typeof t=="string"?e.reduce((r,n)=>r.replace(/%[sdfo]/,UL(n)),t):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:c4,message:t,args:e.map(UL)}))}`}const yH=Symbol.for("__APOLLO_CONTEXT__");function d4(){Xt("createContext"in xf,37);let t=b.createContext[yH];return t||(Object.defineProperty(b.createContext,yH,{value:t=b.createContext({}
18),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}const mSe=({client:t,children:e})=>{const r=d4(),n=b.useContext(r),i=b.useMemo(()=>({...n,client:t||n.client}),[n,t]);return Xt(i.client,38),b.createElement(r.Provider,{value:i},e)};function pw(t){const e=b.useContext(d4()),r=t||e.client;return Xt(!!r,28),r}const{toString:vH,hasOwnProperty:gSe}=Object.prototype,xH=Function.prototype.toString,GL=new Map;function _r(t,e){try{return WL(t,e)}finally{GL.clear()}}function WL(t,e){if(t===e)return!0;const r=vH.call(t),n=vH.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(wH(t,e))return!0;const i=bH(t),s=bH(e),a=i.length;if(a!==s.length)return!1;for(let o=0;o<a;++o)if(!gSe.call(e,i[o]))return!1;for(let o=0;o<a;++o){const c=i[o];if(!WL(t[c],e[c]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(wH(t,e))return!0;const i=t.entries(),s=r==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[o,c]=a.value;if(!e.has(o)||s&&!WL(c,e.get(o)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=xH.call(t);return i!==xH.call(e)?!1:!xSe(i,vSe)}}return!1}function bH(t){return Object.keys(t).filter(ySe,t)}function ySe(t){return this[t]!==void 0}const vSe="{ [native code] }";function xSe(t,e){const r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function wH(t,e){let r=GL.get(t);if(r){if(r.has(e))return!0}else GL.set(t,r=new Set);return r.add(e),!1}function ek(t,e){if(!!!t)throw new Error(e)}function bSe(t){return typeof t=="object"&&t!==null}function wSe(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const _Se=/\r\n|[\n\r]/g;function HL(t,e){let r=0,n=1;for(const i of t.body.matchAll(_Se)){if(typeof i.index=="number"||wSe(!1),i.index>=e)break;r=i.index+i[0].length,n+=1}return{line:n,column:e+1-r}}function SSe(t){return ise(t.source,HL(t.source,t.start))}function ise(t,e){const r=t.locationOffset.column-1,n="".padStart(r)+t.body,i=e.line-1,s=t.locationOffset.line-1,a=e.line+s,o=e.line===1?r:0,c=e.column+o,u=`${t.name}:${a}:${c}
19`,d=n.split(/\r\n|[\n\r]/g),f=d[i];if(f.length>120){const h=Math.floor(c/80),m=c%80,y=[];for(let x=0;x<f.length;x+=80)y.push(f.slice(x,x+80));return u+_H([[`${a} |`,y[0]],...y.slice(1,h+1).map(x=>["|",x]),["|","^".padStart(m)],["|",y[h+1]]])}return u+_H([[`${a-1} |`,d[i-1]],[`${a} |`,f],["|","^".padStart(c)],[`${a+1} |`,d[i+1]]])}function _H(t){const e=t.filter(([n,i])=>i!==void 0),r=Math.max(...e.map(([n])=>n.length));return e.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(`
20`)}function kSe(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class _E extends Error{constructor(e,...r){var n,i,s;const{nodes:a,source:o,positions:c,path:u,originalError:d,extensions:f}=kSe(r);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=SH(Array.isArray(a)?a:a?[a]:void 0);const h=SH((n=this.nodes)===null||n===void 0?void 0:n.map(y=>y.loc).filter(y=>y!=null));this.source=o??(h==null||(i=h[0])===null||i===void 0?void 0:i.source),this.positions=c??h?.map(y=>y.start),this.locations=c&&o?c.map(y=>HL(o,y)):h?.map(y=>HL(y.source,y.start));const m=bSe(d?.extensions)?d?.extensions:void 0;this.extensions=(s=f??m)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,_E):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+=`
21
22`+SSe(r.loc));else if(this.source&&this.locations)for(const r of this.locations)e+=`
23
24`+ise(this.source,r);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function SH(t){return t===void 0||t.length===0?void 0:t}function Ii(t,e,r){return new _E(`Syntax Error: ${r}`,{source:t,positions:[e]})}let TSe=class{constructor(e,r,n){this.start=e.start,this.end=r.end,this.startToken=e,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};class sse{constructor(e,r,n,i,s,a){this.kind=e,this.start=r,this.end=n,this.line=i,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const ase={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],Float
vendor: 4,858 bytes, lines 24-26
24Value:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},CSe=new Set(Object.keys(ase));function kH(t){const e=t?.kind;return typeof e=="string"&&CSe.has(e)}var al;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(al||(al={}));var qL;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(qL||(qL={}));var qe;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(qe||(qe={}));function YL(t){return t===9||t===32}function Gx(t){return t>=48&&t<=57}function ose(t){return t>=97&&t<=122||t>=65&&t<=90}function lse(t){return ose(t)||t===95}function ESe(t){return ose(t)||Gx(t)||t===95}function jSe(t){var e;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let a=0;a<t.length;++a){var s;const o=t[a],c=NSe(o);c!==o.length&&(n=(s=n)!==null&&s!==void 0?s:a,i=a,a!==0&&c<r&&(r=c))}return t.map((a,o)=>o===0?a:a.slice(r)).slice((e=n)!==null&&e!==void 0?e:0,i+1)}function NSe(t){let e=0;for(;e<t.length&&YL(t.charCodeAt(e));)++e;return e}function PSe(t,e){const r=t.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(m=>m.length===0||YL(m.charCodeAt(0))),a=r.endsWith('\\"""'),o=t.endsWith('"')&&!a,c=t.endsWith("\\"),u=o||c,d=!i||t.length>70||u||s||a;let f="";const h=i&&YL(t.charCodeAt(0));return(d&&!h||s)&&(f+=`
25`),f+=r,(d||u)&&(f+=`
26`),'"""'+f+'"""'}var ke;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}
26",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(ke||(ke={}));class MSe{constructor(e){const r=new sse(ke.SOF,0,0,0,0);this.source=e,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==ke.EOF)do if(e.next)e=e.next;else{const r=DSe(this,e.end);e.next=r,r.prev=e,e=r}while(e.kind===ke.COMMENT);return e}}function ASe(t){return t===ke.BANG||t===ke.DOLLAR||t===ke.AMP||t===ke.PAREN_L||t===ke.PAREN_R||t===ke.SPREAD||t===ke.COLON||t===ke.EQUALS||t===ke.AT||t===ke.BRACKET_L||t===ke.BRACKET_R||t===ke.BRACE_L||t===ke.PIPE||t===ke.BRACE_R}function Ly(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function SE(t,e){return cse(t.charCodeAt(e))&&use(t.charCodeAt(e+1))}function cse(t){return t>=55296&&t<=56319}function use(t){return t>=56320&&t<=57343}function ap(t,e){const r=t.source.body.codePointAt(e);if(r===void 0)return ke.EOF;if(r>=32&&r<=126){const n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function ni(t,e,r,n,i){const s=t.line,a=1+r-t.lineStart;return new sse(e,r,n,s,a,i)}function DSe(t,e){const r=t.source.body,n=r.length;let i=e;for(;i<n;){const s=r.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return OSe(t,i);case 33:return ni(t,ke.BANG,i,i+1);case 36:return ni(t,ke.DOLLAR,i,i+1);case 38:return ni(t,ke.AMP,i,i+1);case 40:return ni(t,ke.PAREN_L,i,i+1);case 41:return ni(t,ke.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return ni(t,ke.SPREAD,i,i+3);break;case 58:return ni(t,ke.COLON,i,i+1);case 61:return ni(t,ke.EQUALS,i,i+1);case 64:return ni(t,ke.AT,i,i+1);case 91:return ni(t,ke.BRACKET_L,i,i+1);case 93:return ni(t,ke.BRACKET_R,i,i+1);case 123:return ni(t,ke.BRACE_L,i,i+1);case 124:return ni(t,ke.PIPE,i,i+1);case 125:return ni(t,ke.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?zSe(t,i):ISe(t,i)}if(Gx(s)||s===45)return RSe(t,i,s);if(lse(s))return BSe(t,i);throw Ii(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ly(s)||SE(r,i)?`Unexpected character: ${ap(t,i)}.`:`Invalid character: ${ap(t,i)}.`)}return ni(t,ke.EOF,n,n)}function OSe(t,e){const r=t.source.body,n=r.length;let i=e+1;for(;i<n;){const s=r.charCodeAt(i);if(s===10||s===13)break;if(Ly(s))++i;else if(SE(r,i))i+=2;else break}return ni(t,ke.COMMENT,e,i,r.slice(e+1,i))}function RSe(t,e,r){const n=t.source.body;let i=e,s=r,a=!1;if(s===45&&(s=n.charCodeAt(++i)),s===48){if(s=n.charCodeAt(++i),Gx(s))throw Ii(t.source,i,`Invalid number, unexpected digit after 0: ${ap(t,i)}.`)}else i=XM(t,i,s),s=n.charCodeAt(i);if(s===46&&(a=!0,s=n.charCodeAt(++i),i=XM(t,i,s),s=n.charCodeAt(i)),(s===69||s===101)&&(a=!0,s=n.charCodeAt(++i),(s===43||s===45)&&(s=n.charCodeAt(++i)),i=XM(t,i,s),s=n.charCodeAt(i)),s===46||lse(s))throw Ii(t.source,i,`Invalid number, expected digit but got: ${ap(t,i)}.`);return ni(t,a?ke.FLOAT:ke.INT,e,i,n.slice(e,i))}function XM(t,e,r){if(!Gx(r))throw Ii(t.source,e,`Invalid number, expected digit but got: ${ap(t,e)}.`);const n=t.source.body;let i=e+1;for(;Gx(n.charCodeAt(i));)++i;return i}function ISe(t,e){const r=t.source.body,n=r.length;let i=e+1,s=i,a="";for(;i<n;){const o=r.charCodeAt(i);if(o===34)return a+=r.slice(s,i),ni(t,ke.STRING,e,i+1,a);if(o===92){a+=r.slice(s,i);const c=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?LSe(t,i):$Se(t,i):FSe(t,i);a+=c.value,i+=c.size,s=i;continue}if(o===10||o===13)break;if(Ly(o))++i;else if(SE(r,i))i+=2;else throw Ii(t.source,i,`Invalid character within String: ${ap(t,i)}.`)}throw Ii(t.source,i,"Unterminated string.")}function LSe(t,e){const r=t.source.body;let n=0,i=3;for(;i<12;){const s=r.charCodeAt(e+i++);if(s===125){if(i<5||!Ly(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|Wv(s),n<0)break}throw Ii(t.source,e,`Invalid Unicode escape sequence: "${r.slice(e,e+i)}".`)}function $Se(t,e){const r=t.source.body,n=TH(r,e+2);if(Ly(n))return{value:String.fromCodePoint(n),size:6};if(cse(n)&&r.charCodeAt(e+6)===92&&r.charCodeAt(e+7)===117){const i=TH(r,e+8);if(use(i))return{value:String.fromCodePoint(n,i),size:12}}throw Ii(t.source,e,`Invalid Unicode escape sequence: "${r.slice(e,e+6)}".`)}function TH(t,e){return Wv(t.charCodeAt(e))<<12|Wv(t.charCodeAt(e+1))<<8|Wv(t.charCodeAt(e+2))<<4|Wv(t.charCodeAt(e+3))}function Wv(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function FSe(t,e){const r=t.source.body;switch(r.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
27`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:"	",size:2}}throw Ii(t.source,e,`Invalid character escape sequence: "${r.slice(e,e+2)}".`)}function zSe(t,e){const r=t.source.body,n=r.length;let i=t.lineStart,s=e+3,a=s,o="";const c=[];for(;s<n;){const u=r.charCodeAt(s);if(u===34&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34){o+=r.slice(a,s),c.push(o);const d=ni(t,ke.BLOCK_STRING,e,s+3,jSe(c).join(`
28`));return t.line+=c.length-1,t.lineStart=i,d}if(u===92&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34&&r.charCodeAt(s+3)===34){o+=r.slice(a,s),a=s+1,s+=4;continue}if(u===10||u===13){o+=r.slice(a,s),c.push(o),u===13&&r.charCodeAt(s+1)===10?s+=2:++s,o="",a=s,i=s;continue}if(Ly(u))++s;else if(SE(r,s))s+=2;else throw Ii(t.source,s,`Invalid character within String: ${ap(t,s)}.`)}throw Ii(t.source,s,"Unterminated string.")}function BSe(t,e){const r=t.source.body,n=r.length;let i=e+1;for(;i<n;){const s=r.charCodeAt(i);if(ESe(s))++i;else break}return ni(t,ke.NAME,e,i,r.slice(e,i))}const VSe=10,dse=2;function f4(t){return kE(t,[])}function kE(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return USe(t,e);default:return String(t)}}function USe(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const r=[...e,t];if(GSe(t)){const n=t.toJSON();if(n!==t)return typeof n=="string"?n:kE(n,r)}else if(Array.isArray(t))return HSe(t,r);return WSe(t,r)}function GSe(t){return typeof t.toJSON=="function"}function WSe(t,e){const r=Object.entries(t);return r.length===0?"{}":e.length>dse?"["+qSe(t)+"]":"{ "+r.map(([i,s])=>i+": "+kE(s,e)).join(", ")+" }"}function HSe(t,e){if(t.length===0)return"[]";if(e.length>dse)return"[Array]";const r=Math.min(VSe,t.length),n=t.length-r,i=[];for(let s=0;s<r;++s)i.push(kE(t[s],e));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function qSe(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");
vendor: 16,384 bytes, lines 28-39
28if(e==="Object"&&typeof t.constructor=="function"){const r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}const YSe=globalThis.process&&!0,KSe=YSe?function(e,r){return e instanceof r}:function(e,r){if(e instanceof r)return!0;if(typeof e=="object"&&e!==null){var n;const i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(n=e.constructor)===null||n===void 0?void 0:n.name;if(i===s){const a=f4(e);throw new Error(`Cannot use ${i} "${a}" from another module or realm.
29
30Ensure that there is only one instance of "graphql" in the node_modules
31directory. If different versions of "graphql" are the dependencies of other
32relied on modules, use "resolutions" to ensure only one version is installed.
33
34https://yarnpkg.com/en/docs/selective-version-resolutions
35
36Duplicate "graphql" modules cannot be used at the same time since different
37versions may have different capabilities and behavior. The data from one
38version used in the function from another could produce confusing and
39spurious results.`)}}return!1};class fse{constructor(e,r="GraphQL request",n={line:1,column:1}){typeof e=="string"||ek(!1,`Body must be a string. Received: ${f4(e)}.`),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ek(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ek(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function QSe(t){return KSe(t,fse)}function ZSe(t,e){const r=new XSe(t,e),n=r.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n}let XSe=class{constructor(e,r={}){const n=QSe(e)?e:new fse(e);this._lexer=new MSe(n),this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(ke.NAME);return this.node(e,{kind:qe.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:qe.DOCUMENT,definitions:this.many(ke.SOF,this.parseDefinition,ke.EOF)})}parseDefinition(){if(this.peek(ke.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),r=e?this._lexer.lookahead():this._lexer.token;if(r.kind===ke.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Ii(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(ke.BRACE_L))return this.node(e,{kind:qe.OPERATION_DEFINITION,operation:al.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(ke.NAME)&&(n=this.parseName()),this.node(e,{kind:qe.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(ke.NAME);switch(e.value){case"query":return al.QUERY;case"mutation":return al.MUTATION;case"subscription":return al.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(ke.PAREN_L,this.parseVariableDefinition,ke.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:qe.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(ke.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ke.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(ke.DOLLAR),this.node(e,{kind:qe.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:qe.SELECTION_SET,selections:this.many(ke.BRACE_L,this.parseSelection,ke.BRACE_R)})}parseSelection(){return this.peek(ke.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(ke.COLON)?(n=r,i=this.parseName()):i=r,this.node(e,{kind:qe.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ke.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const r=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ke.PAREN_L,r,ke.PAREN_R)}parseArgument(e=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(ke.COLON),this.node(r,{kind:qe.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(ke.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(ke.NAME)?this.node(e,{kind:qe.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:qe.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:qe.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:qe.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const r=this._lexer.token;switch(r.kind){case ke.BRACKET_L:return this.parseList(e);case ke.BRACE_L:return this.parseObject(e);case ke.INT:return this.advanceLexer(),this.node(r,{kind:qe.INT,value:r.value});case ke.FLOAT:return this.advanceLexer(),this.node(r,{kind:qe.FLOAT,value:r.value});case ke.STRING:case ke.BLOCK_STRING:return this.parseStringLiteral();case ke.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:qe.BOOLEAN,value:!0});case"false":return this.node(r,{kind:qe.BOOLEAN,value:!1});case"null":return this.node(r,{kind:qe.NULL});default:return this.node(r,{kind:qe.ENUM,value:r.value})}case ke.DOLLAR:if(e)if(this.expectToken(ke.DOLLAR),this._lexer.token.kind===ke.NAME){const n=this._lexer.token.value;throw Ii(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:qe.STRING,value:e.value,block:e.kind===ke.BLOCK_STRING})}parseList(e){const r=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:qe.LIST,values:this.any(ke.BRACKET_L,r,ke.BRACKET_R)})}parseObject(e){const r=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:qe.OBJECT,fields:this.any(ke.BRACE_L,r,ke.BRACE_R)})}parseObjectField(e){const r=this._lexer.token,n=this.parseName();return this.expectToken(ke.COLON),this.node(r,{kind:qe.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const r=[];for(;this.peek(ke.AT);)r.push(this.parseDirective(e));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const r=this._lexer.token;return this.expectToken(ke.AT),this.node(r,{kind:qe.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let r;if(this.expectOptionalToken(ke.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(ke.BRACKET_R),r=this.node(e,{kind:qe.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(ke.BANG)?this.node(e,{kind:qe.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:qe.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ke.STRING)||this.peek(ke.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(ke.BRACE_L,this.parseOperationTypeDefinition,ke.BRACE_R);return this.node(e,{kind:qe.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,r=this.parseOperationType();this.expectToken(ke.COLON);const n=this.parseNamedType();return this.node(e,{kind:qe.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:qe.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:qe.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ke.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ke.BRACE_L,this.parseFieldDefinition,ke.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ke.COLON);const s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:qe.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(ke.PAREN_L,this.parseInputValueDef,ke.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(ke.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(ke.EQUALS)&&(s=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:qe.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:qe.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:qe.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(ke.EQUALS)?this.delimitedMany(ke.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:qe.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(ke.BRACE_L,this.parseEnumValueDefinition,ke.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:qe.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ii(this._lexer.source,this._lexer.token.start,`${P_(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:qe.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(ke.BRACE_L,this.parseInputValueDef,ke.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===ke.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(ke.BRACE_L,this.parseOperationTypeDefinition,ke.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:qe.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:qe.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:qe.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:qe.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:qe.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:qe.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:qe.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ke.AT);const n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(e,{kind:qe.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(ke.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=
vendor: 5,224 bytes, lines 39-44
39this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(qL,r.value))return r;throw this.unexpected(e)}node(e,r){return this._options.noLocation!==!0&&(r.loc=new TSe(e,this._lexer.lastToken,this._lexer.source)),r}peek(e){return this._lexer.token.kind===e}expectToken(e){const r=this._lexer.token;if(r.kind===e)return this.advanceLexer(),r;throw Ii(this._lexer.source,r.start,`Expected ${hse(e)}, found ${P_(r)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const r=this._lexer.token;if(r.kind===ke.NAME&&r.value===e)this.advanceLexer();else throw Ii(this._lexer.source,r.start,`Expected "${e}", found ${P_(r)}.`)}expectOptionalKeyword(e){const r=this._lexer.token;return r.kind===ke.NAME&&r.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const r=e??this._lexer.token;return Ii(this._lexer.source,r.start,`Unexpected ${P_(r)}.`)}any(e,r,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(e,r,n){if(this.expectOptionalToken(e)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(e,r,n){this.expectToken(e);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(e,r){this.expectOptionalToken(e);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,r=this._lexer.advance();if(r.kind!==ke.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw Ii(this._lexer.source,r.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function P_(t){const e=t.value;return hse(t.kind)+(e!=null?` "${e}"`:"")}function hse(t){return ASe(t)?`"${t}"`:t}function JSe(t){return`"${t.replace(eke,tke)}"`}const eke=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function tke(t){return rke[t.charCodeAt(0)]}const rke=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],h4=Object.freeze({});function cc(t,e,r=ase){const n=new Map;for(const _ of Object.values(qe))n.set(_,nke(e,_));let i,s=Array.isArray(t),a=[t],o=-1,c=[],u=t,d,f;const h=[],m=[];do{o++;const _=o===a.length,S=_&&c.length!==0;if(_){if(d=m.length===0?void 0:h[h.length-1],u=f,f=m.pop(),S)if(s){u=u.slice();let E=0;for(const[T,N]of c){const j=T-E;N===null?(u.splice(j,1),E++):u[j]=N}}else{u={...u};for(const[E,T]of c)u[E]=T}o=i.index,a=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(f){if(d=s?o:a[o],u=f[d],u==null)continue;h.push(d)}let k;if(!Array.isArray(u)){var y,x;kH(u)||ek(!1,`Invalid AST Node: ${f4(u)}.`);const E=_?(y=n.get(u.kind))===null||y===void 0?void 0:y.leave:(x=n.get(u.kind))===null||x===void 0?void 0:x.enter;if(k=E?.call(e,u,d,f,h,m),k===h4)break;if(k===!1){if(!_){h.pop();continue}}else if(k!==void 0&&(c.push([d,k]),!_))if(kH(k))u=k;else{h.pop();continue}}if(k===void 0&&S&&c.push([d,u]),_)h.pop();else{var v;i={inArray:s,index:o,keys:a,edits:c,prev:i},s=Array.isArray(u),a=s?u:(v=r[u.kind])!==null&&v!==void 0?v:[],o=-1,c=[],f&&m.push(f),f=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function nke(t,e){const r=t[e];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:t.enter,leave:t.leave}}function ike(t){return cc(t,ake)}const ske=80,ake={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>gt(t.definitions,`
40
41`)},OperationDefinition:{leave(t){const e=fr("(",gt(t.variableDefinitions,", "),")"),r=gt([t.operation,gt([t.name,e]),gt(t.directives," ")]," ");return(r==="query"?"":r+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:r,directives:n})=>t+": "+e+fr(" = ",r)+fr(" ",gt(n," "))},SelectionSet:{leave:({selections:t})=>Qo(t)},Field:{leave({alias:t,name:e,arguments:r,directives:n,selectionSet:i}){const s=fr("",t,": ")+e;let a=s+fr("(",gt(r,", "),")");return a.length>ske&&(a=s+fr(`(
42`,tk(gt(r,`
43`)),`
44)`)),gt([a,gt(n," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+fr(" ",gt(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:r})=>gt(["...",fr("on ",t),gt(e," "),r]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${t}${fr("(",gt(r,", "),")")} on ${e} ${fr("",gt(n," ")," ")}`+i},IntValue:{leave:({value:t})=>t}
vendor: 3,938 bytes, lines 44-66
44,FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?PSe(t):JSe(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+gt(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+gt(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+fr("(",gt(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:r})=>fr("",t,`
45`)+gt(["schema",gt(e," "),Qo(r)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:r})=>fr("",t,`
46`)+gt(["scalar",e,gt(r," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:r,directives:n,fields:i})=>fr("",t,`
47`)+gt(["type",e,fr("implements ",gt(r," & ")),gt(n," "),Qo(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:r,type:n,directives:i})=>fr("",t,`
48`)+e+(CH(r)?fr(`(
49`,tk(gt(r,`
50`)),`
51)`):fr("(",gt(r,", "),")"))+": "+n+fr(" ",gt(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:r,defaultValue:n,directives:i})=>fr("",t,`
52`)+gt([e+": "+r,fr("= ",n),gt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:r,directives:n,fields:i})=>fr("",t,`
53`)+gt(["interface",e,fr("implements ",gt(r," & ")),gt(n," "),Qo(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:r,types:n})=>fr("",t,`
54`)+gt(["union",e,gt(r," "),fr("= ",gt(n," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:r,values:n})=>fr("",t,`
55`)+gt(["enum",e,gt(r," "),Qo(n)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:r})=>fr("",t,`
56`)+gt([e,gt(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:r,fields:n})=>fr("",t,`
57`)+gt(["input",e,gt(r," "),Qo(n)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:r,repeatable:n,locations:i})=>fr("",t,`
58`)+"directive @"+e+(CH(r)?fr(`(
59`,tk(gt(r,`
60`)),`
61)`):fr("(",gt(r,", "),")"))+(n?" repeatable":"")+" on "+gt(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>gt(["extend schema",gt(t," "),Qo(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>gt(["extend scalar",t,gt(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:r,fields:n})=>gt(["extend type",t,fr("implements ",gt(e," & ")),gt(r," "),Qo(n)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:r,fields:n})=>gt(["extend interface",t,fr("implements ",gt(e," & ")),gt(r," "),Qo(n)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:r})=>gt(["extend union",t,gt(e," "),fr("= ",gt(r," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:r})=>gt(["extend enum",t,gt(e," "),Qo(r)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:r})=>gt(["extend input",t,gt(e," "),Qo(r)]," ")}};function gt(t,e=""){var r;return(r=t?.filter(n=>n).join(e))!==null&&r!==void 0?r:""}function Qo(t){return fr(`{
62`,tk(gt(t,`
63`)),`
64}`)}function fr(t,e,r=""){return e!=null&&e!==""?t+e+r:""}function tk(t){return fr("  ",t.replace(/\n/g,`
65  `))}function CH(t){var e;return(e=t?.some(r=>r.includes(`
66`)))!==null&&e!==void 0?e:!1}var KL=function(t,e){return KL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},KL(t,e)};function Ro(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");KL(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var yo=function(){return yo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];
vendor: 4,977 bytes, lines 66-68
66for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},yo.apply(this,arguments)};function mw(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function oke(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((n=n.apply(t,e||[])).next())})}function pse(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Ag(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dg(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function op(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function pg(t){return this instanceof pg?(this.v=t,this):new pg(t)}function lke(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(m){return function(y){return Promise.resolve(y).then(m,f)}}function o(m,y){n[m]&&(i[m]=function(x){return new Promise(function(v,_){s.push([m,x,v,_])>1||c(m,x)})},y&&(i[m]=y(i[m])))}function c(m,y){try{u(n[m](y))}catch(x){h(s[0][3],x)}}function u(m){m.value instanceof pg?Promise.resolve(m.value.v).then(d,f):h(s[0][2],m)}function d(m){c("next",m)}function f(m){c("throw",m)}function h(m,y){m(y),s.shift(),s.length&&c(s[0][0],s[0][1])}}function cke(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ag=="function"?Ag(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(o,c){a=t[s](a),i(o,c,a.done,a.value)})}}function i(s,a,o,c){Promise.resolve(c).then(function(u){s({value:u,done:o})},a)}}function Ln(t){return typeof t=="function"}function p4(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var JM=p4(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
67`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
68  `):"",this.name="UnsubscriptionError",this.errors=r}});function zk(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var gw=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Ag(a),c=o.next();!c.done;c=o.next()){var u=c.value;u.remove(this)}}catch(x){e={error:x}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}else a.remove(this);var d=this.initialTeardown;
vendor: 6,829 bytes, line 68
68if(Ln(d))try{d()}catch(x){s=x instanceof JM?x.errors:[x]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Ag(f),m=h.next();!m.done;m=h.next()){var y=m.value;try{EH(y)}catch(x){s=s??[],x instanceof JM?s=op(op([],Dg(s)),Dg(x.errors)):s.push(x)}}}catch(x){n={error:x}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}if(s)throw new JM(s)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)EH(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&zk(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&zk(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})(),mse=gw.EMPTY;function gse(t){return t instanceof gw||t&&"closed"in t&&Ln(t.remove)&&Ln(t.add)&&Ln(t.unsubscribe)}function EH(t){Ln(t)?t():t.unsubscribe()}var uke={Promise:void 0},dke={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,op([t,e],Dg(r)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function yse(t){dke.setTimeout(function(){throw t})}function jH(){}function rk(t){t()}var m4=(function(t){Ro(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,gse(r)&&r.add(n)):n.destination=pke,n}return e.create=function(r,n,i){return new Wx(r,n,i)},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(gw),fke=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){M_(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){M_(n)}else M_(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){M_(r)}},t})(),Wx=(function(t){Ro(e,t);function e(r,n,i){var s=t.call(this)||this,a;return Ln(r)||!r?a={next:r??void 0,error:n??void 0,complete:i??void 0}:a=r,s.destination=new fke(a),s}return e})(m4);function M_(t){yse(t)}function hke(t){throw t}var pke={closed:!0,next:jH,error:hke,complete:jH},g4=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function y4(t){return t}function mke(t){return t.length===0?y4:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var Jn=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this,s=yke(e)?e:new Wx(e,r,n);return rk(function(){var a=i,o=a.operator,c=a.source;s.add(o?o.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=NH(r),new r(function(i,s){var a=new Wx({next:function(o){try{e(o)}catch(c){s(c),a.unsubscribe()}},error:s,complete:i});n.subscribe(a)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[g4]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return mke(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=NH(e),new e(function(n,i){var s;r.subscribe(function(a){return s=a},function(a){return i(a)},function(){return n(s)})})},t.create=function(e){return new t(e)},t})();function NH(t){var e;return(e=t??uke.Promise)!==null&&e!==void 0?e:Promise}function gke(t){return t&&Ln(t.next)&&Ln(t.error)&&Ln(t.complete)}function yke(t){return t&&t instanceof m4||gke(t)&&gse(t)}function vke(t){return Ln(t?.lift)}function xc(t){return function(e){if(vke(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function bf(t,e,r,n,i){return new xke(t,e,r,n,i)}var xke=(function(t){Ro(e,t);function e(r,n,i,s,a,o){var c=t.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=o,c._next=n?function(u){try{n(u)}catch(d){r.error(d)}}:t.prototype._next,c._error=s?function(u){try{s(u)}catch(d){r.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(u){r.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e})(m4),bke=p4(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$y=(function(t){Ro(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new PH(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new bke},e.prototype.next=function(r){var n=this;rk(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Ag(n.currentObservers),o=a.next();!o.done;o=a.next()){var c=o.value;c.next(r)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;rk(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;rk(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}
68,enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,s=i.hasError,a=i.isStopped,o=i.observers;return s||a?mse:(this.currentObservers=null,o.push(r),new gw(function(){n.currentObservers=null,zk(o,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,s=n.thrownError,a=n.isStopped;i?r.error(s):a&&r.complete()},e.prototype.asObservable=function(){var r=new Jn;return r.source=this,r},e.create=function(r,n){return new PH(r,n)},e})(Jn),PH=(function(t){Ro(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:mse},e})($y),wke=(function(t){Ro(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,s=r._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e})($y),v4={now:function(){return(v4.delegate||Date).now()},delegate:void 0},_ke=(function(t){Ro(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=v4);var s=t.call(this)||this;return s._bufferSize=r,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,r),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(r){var n=this,i=n.isStopped,s=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,c=n._windowTime;i||(s.push(r),!a&&s.push(o.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,s=i._infiniteTimeWindow,a=i._buffer,o=a.slice(),c=0;c<o.length&&!r.closed;c+=s?1:2)r.next(o[c]);return this._checkFinalizedStatuses(r),n},e.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,i=r._timestampProvider,s=r._buffer,a=r._infiniteTimeWindow,o=(a?1:2)*n;if(n<1/0&&o<s.length&&s.splice(0,s.length-o),!a){for(var c=i.now(),u=0,d=1;d<s.length&&s[d]<=c;d+=2)u=d;u&&s.splice(0,u+1)}},e})($y),Ske=(function(t){Ro(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e})(gw),MH={setInterval:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,op([t,e],Dg(r)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},kke=(function(t){Ro(e,t);function e(r,n){var i=t.call(this,r,n)||this;
68return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,a=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(a,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),MH.setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&MH.clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s;try{this.work(r)}catch(a){i=!0,s=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,zk(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(Ske),Tke=1,e2,QL={};function AH(t){return t in QL?(delete QL[t],!0):!1}var vse={setImmediate:function(t){var e=Tke++;return QL[e]=!0,e2||(e2=Promise.resolve()),e2.then(function(){return AH(e)&&t()}),e},clearImmediate:function(t){AH(t)}},Cke=vse.setImmediate,Eke=vse.clearImmediate,DH={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Cke.apply(void 0,op([],Dg(t)))},clearImmediate:function(t){return Eke(t)},delegate:void 0},jke=(function(t){Ro(e,t);function e(r,n){var i=t.call(this,r,n)||this;
vendor: 4,423 bytes, line 68
68return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=DH.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var s;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var a=r.actions;n!=null&&((s=a[a.length-1])===null||s===void 0?void 0:s.id)!==n&&(DH.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e})(kke),OH=(function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=v4.now,t})(),Nke=(function(t){Ro(e,t);function e(r,n){n===void 0&&(n=OH.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e})(OH),Pke=(function(t){Ro(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,s;r=r||i.shift();do if(s=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,s){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw s}},e})(Nke),Mke=new Pke(jke),Bk=new Jn(function(t){return t.complete()});function Ake(t){return t&&Ln(t.schedule)}function Dke(t){return t[t.length-1]}function xse(t){return Ake(Dke(t))?t.pop():void 0}var bse=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"});function wse(t){return Ln(t?.then)}function _se(t){return Ln(t[g4])}function Sse(t){return Symbol.asyncIterator&&Ln(t?.[Symbol.asyncIterator])}function kse(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Oke(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Tse=Oke();function Cse(t){return Ln(t?.[Tse])}function Ese(t){return lke(this,arguments,function(){var r,n,i,s;return pse(this,function(a){switch(a.label){case 0:r=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,pg(r.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,pg(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,pg(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function jse(t){return Ln(t?.getReader)}function Af(t){if(t instanceof Jn)return t;if(t!=null){if(_se(t))return Rke(t);if(bse(t))return Ike(t);if(wse(t))return Lke(t);if(Sse(t))return Nse(t);if(Cse(t))return $ke(t);if(jse(t))return Fke(t)}throw kse(t)}function Rke(t){return new Jn(function(e){var r=t[g4]();if(Ln(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ike(t){return new Jn(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Lke(t){return new Jn(function(e){t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,yse)})}function $ke(t){return new Jn(function(e){var r,n;try{for(var i=Ag(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(o){r={error:o}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()})}function Nse(t){return new Jn(function(e){zke(t,e).catch(function(r){return e.error(r)})})}function Fke(t){return Nse(Ese(t))}function zke(t,e){var r,n,i,s;return oke(this,void 0,void 0,function(){var a,o;return pse(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=cke(t),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=c.sent(),i={error:o},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
68case 10:return[7];case 11:return e.complete(),[2]}})})}function qh(t,e,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){r(),i?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(s),!i)return s}function x4(t,e){return e===void 0&&(e=0),xc(function(r,n){r.subscribe(bf(n,function(i){return qh(n,t,function(){return n.next(i)},e)},function(){return qh(n,t,function(){return n.complete()},e)},function(i){return qh(n,t,function(){return n.error(i)},e)}))})}function Pse(t,e){return e===void 0&&(e=0),xc(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}function Bke(t,e){return Af(t).pipe(Pse(e),x4(e))}function Vke(t,e){return Af(t).pipe(Pse(e),x4(e))}function Uke(t,e){return new Jn(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Gke(t,e){return new Jn(function(r){var n;return qh(r,e,function(){n=t[Tse](),qh(r,e,function(){var i,s,a;try{i=n.next(),s=i.value,a=i.done}catch(o){r.error(o);return}a?r.complete():r.next(s)},0,!0)}),function(){return Ln(n?.return)&&n.return()}})}function Mse(t,e){if(!t)throw new Error("Iterable cannot be null");return new Jn(function(r){qh(r,e,function(){var n=t[Symbol.asyncIterator]();qh(r,e,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function Wke(t,e){return Mse(Ese(t),e)}function Hke(t,e){if(t!=null){if(_se(t))return Bke(t,e);if(bse(t))return Uke(t,e);if(wse(t))return Vke(t,e);if(Sse(t))return Mse(t,e);if(Cse(t))return Gke(t,e);if(jse(t))return Wke(t,e)}throw kse(t)}function jh(t,e){return e?Hke(t,e):Af(t)}function vh(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=xse(t);return jh(t,r)}function Ase(t,e){var r=Ln(t)?t:function(){return t},n=function(i){return i.error(r())};return new Jn(n)}var RH;(function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"})(RH||(RH={}));var t2=(function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){return qke(this,e)},t.prototype.do=function(e,r,n){var i=this,s=i.kind,a=i.value,o=i.error;return s==="N"?e?.(a):s==="E"?r?.(o):n?.()},t.prototype.accept=function(e,r,n){var i;return Ln((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this,r=e.kind,n=e.value,i=e.error,s=r==="N"?vh(n):r==="E"?Ase(function(){return i}):r==="C"?Bk:0;if(!s)throw new TypeError("Unexpected notification kind "+r);return s},t.createNext=function(e){return new t("N",e)},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t})();function qke(t,e){var r,n,i,s=t,a=s.kind,o=s.value,c=s.error;if(typeof a!="string")throw new TypeError('Invalid notification, missing "kind"');a==="N"?(r=e.next)===null||r===void 0||r.call(e,o):a==="E"?(n=e.error)===null||n===void 0||n.call(e,c):(i=e.complete)===null||i===void 0||i.call(e)}var Yke=p4(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Kke(t,e){var r=typeof e=="object";return new Promise(function(n,i){var s=!1,a;t.subscribe({next:function(o){a=o,s=!0},error:i,complete:function(){s?n(a):r?n(e.defaultValue):i(new Yke)}})})}function Ph(t,e){return xc(function(r,n){var i=0;r.subscribe(bf(n,function(s){n.next(t.call(e,s,i++))}))})}function Qke(t,e,r,n,i,s,a,o){var c=[],u=0,d=0,f=!1,h=function(){f&&!c.length&&!u&&e.complete()},m=function(x){return u<n?y(x):c.push(x)},y=function(x){u++;var v=!1;Af(r(x,d++)).subscribe(bf(e,function(_){e.next(_)},function(){v=!0},void 0,function(){if(v)try{u--;for(var _=function(){var S=c.shift();a||y(S)};c.length&&u<n;)_();h()}catch(S){e.error(S)}}))};return t.subscribe(bf(e,m,function(){f=!0,h()})),function(){}}function Zm(t,e,r){return r===void 0&&(r=1/0),Ln(e)?Zm(function(n,i){return Ph(function(s,a){return e(n,s,i,a)})(Af(t(n,i)))},r):(typeof e=="number"&&(r=e),xc(function(n,i){return Qke(n,i,t,r)}))}function Zke(t){return Zm(y4,t)}function Xke(){return Zke(1)}function r2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];
68return Xke()(jh(t,xse(t)))}function Jke(t,e){return xc(function(r,n){var i=0;r.subscribe(bf(n,function(s){return t.call(e,s,i++)&&n.next(s)}))})}function nk(t){return xc(function(e,r){var n=null,i=!1,s;n=e.subscribe(bf(r,void 0,void 0,function(a){s=Af(t(a,nk(t)(e))),n?(n.unsubscribe(),n=null,s.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(r))})}function eTe(t){return xc(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}function tTe(){return xc(function(t,e){t.subscribe(bf(e,function(r){e.next(t2.createNext(r))},function(){e.next(t2.createComplete()),e.complete()},function(r){e.next(t2.createError(r)),e.complete()}))})}function Vk(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new $y}:e,n=t.resetOnError,i=n===void 0?!0:n,s=t.resetOnComplete,a=s===void 0?!0:s,o=t.resetOnRefCountZero,c=o===void 0?!0:o;return function(u){var d,f,h,m=0,y=!1,x=!1,v=function(){f?.unsubscribe(),f=void 0},_=function(){v(),d=h=void 0,y=x=!1},S=function(){var k=d;_(),k?.unsubscribe()};return xc(function(k,E){m++,!x&&!y&&v();var T=h=h??r();E.add(function(){m--,m===0&&!x&&!y&&(f=n2(S,c))}),T.subscribe(E),!d&&m>0&&(d=new Wx({next:function(N){return T.next(N)},error:function(N){x=!0,v(),f=n2(_,i,N),T.error(N)},complete:function(){y=!0,v(),f=n2(_,a),T.complete()}}),Af(k).subscribe(d))})(u)}}function n2(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(e===!0){t();return}if(e!==!1){var i=new Wx({next:function(){i.unsubscribe(),t()}});return Af(e.apply(void 0,op([],Dg(r)))).subscribe(i)}}function rTe(t,e,r){var n,i,s,a,o=!1;return t&&typeof t=="object"?(n=t.bufferSize,a=n===void 0?1/0:n,i=t.windowTime,e=i===void 0?1/0:i,s=t.refCount,o=s===void 0?!1:s,r=t.scheduler):a=t??1/0,Vk({connector:function(){return new _ke(a,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Uk(t,e,r){var n=Ln(t)||e||r?{next:t,error:e,complete:r}:t;return n?xc(function(i,s){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var o=!0;i.subscribe(bf(s,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),s.next(c)},function(){var c;o=!1,(c=n.complete)===null||c===void 0||c.call(n),s.complete()},function(c){var u;o=!1,(u=n.error)===null||u===void 0||u.call(n,c),s.error(c)},function(){var c,u;o&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):y4}function Og(t,e,r,n){if(r.kind===qe.INT||r.kind===qe.FLOAT)t[e.value]=Number(r.value);else if(r.kind===qe.BOOLEAN||r.kind===qe.STRING)t[e.value]=r.value;else if(r.kind===qe.OBJECT){const i={};r.fields.map(s=>Og(i,s.name,s.value,n)),t[e.value]=i}else if(r.kind===qe.VARIABLE){const i=(n||{})[r.name.value];t[e.value]=i}else if(r.kind===qe.LIST)t[e.value]=r.values.map(i=>{const s={};return Og(s,e,i,n),s[e.value]});else if(r.kind===qe.ENUM)t[e.value]=r.value;else if(r.kind===qe.NULL)t[e.value]=null;else throw jo(19,e.value,r.kind)}function b4(t,e){if(t.arguments&&t.arguments.length){const r={};return t.arguments.forEach(({name:n,value:i})=>Og(r,n,i,e)),r}return null}const Dse=typeof rl(()=>window.document.createElement)=="function";function nTe(){}class ZL{constructor(e=1/0,r=nTe){this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}get size(){return this.map.size}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(e,r){let n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1}}function XL(){}const iTe=XL,sTe=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},aTe=typeof WeakMap<"u"?WeakMap:Map,oTe=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:XL,unregister:XL}},lTe=10024;class Hx{constructor(e=1/0,r=iTe){this.max=e,this.dispose=r,this.map=new aTe,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<lTe;i++){const s=n.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const a=s.key;delete s.key,s.keyRef=new sTe(a),this.registry.register(a,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new oTe(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(e,r){let n=this.getNode(e);
68return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const r=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,r),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),r&&this.map.delete(r)}delete(e){const r=this.map.get(e);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}const cTe=()=>Object.create(null),{forEach:uTe,slice:IH}=Array.prototype,{hasOwnProperty:dTe}=Object.prototype;class Df{constructor(e=!0,r=cTe){this.weakness=e,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(e){let r=this;return uTe.call(e,n=>r=r.getChildTrie(n)),dTe.call(r,"data")?r.data:r.data=this.makeData(IH.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let r=this;for(let n=0,i=e.length;r&&n<i;++n){const s=r.mapFor(e[n],!1);r=s&&s.get(e[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(e){let r;if(e.length){const n=e[0],i=this.mapFor(n,!1),s=i&&i.get(n);s&&(r=s.removeArray(IH.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(e){const r=this.mapFor(e,!0);let n=r.get(e);return n||r.set(e,n=new Df(this.weakness,this.makeData)),n}mapFor(e,r){return this.weakness&&fTe(e)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}}function fTe(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let Gi=null;const LH={};let hTe=1;const pTe=()=>class{constructor(){this.id=["slot",hTe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Gi;e;e=e.parent)if(this.id in e.slots){const r=e.slots[this.id];if(r===LH)break;return e!==Gi&&(Gi.slots[this.id]=r),!0}return Gi&&(Gi.slots[this.id]=LH),!1}getValue(){if(this.hasValue())return Gi.slots[this.id]}withValue(e,r,n,i){const s={__proto__:null,[this.id]:e},a=Gi;Gi={parent:a,slots:s};try{return r.apply(i,n)}finally{Gi=a}}static bind(e){const r=Gi;return function(){const n=Gi;try{return Gi=r,e.apply(this,arguments)}finally{Gi=n}}}static noContext(e,r,n){if(Gi){const i=Gi;try{return Gi=null,e.apply(n,r)}finally{Gi=i}}else return e.apply(n,r)}};function $H(t){try{return t()}catch{}}const i2="@wry/context:Slot",mTe=$H(()=>globalThis)||$H(()=>global)||Object.create(null),FH=mTe,TE=FH[i2]||Array[i2]||(function(t){try{Object.defineProperty(FH,i2,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}})(pTe()),{bind:kAt,noContext:TAt}=TE,CE=new TE,{hasOwnProperty:gTe}=Object.prototype,w4=Array.from||function(t){const e=[];return t.forEach(r=>e.push(r)),e};function _4(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const qx=[],yTe=100;function Rg(t,e){if(!t)throw new Error(e||"assertion failure")}function Ose(t,e){const r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Rse(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Ise(t){return t.slice(0)}class EE{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++EE.count}peek(){if(this.value.length===1&&!wf(this))return zH(this),this.value[0]}recompute(e){return Rg(!this.recomputing,"already recomputing"),zH(this),wf(this)?vTe(this,e):Rse(this.value)}setDirty(){this.dirty||(this.dirty=!0,Lse(this),_4(this))}dispose(){this.setDirty(),Vse(this),S4(this,(e,r)=>{e.setDirty(),Use(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=qx.pop()||new Set),this.deps.add(e)}
68forgetDeps(){this.deps&&(w4(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),qx.push(this.deps),this.deps=null)}}EE.count=0;function zH(t){const e=CE.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wf(t)?Fse(e,t):zse(e,t),e}function vTe(t,e){return Vse(t),CE.withValue(t,xTe,[t,e]),wTe(t,e)&&bTe(t),Rse(t.value)}function xTe(t,e){t.recomputing=!0;const{normalizeResult:r}=t;let n;r&&t.value.length===1&&(n=Ise(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),r&&n&&!Ose(n,t.value))try{t.value[0]=r(t.value[0],n[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function wf(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function bTe(t){t.dirty=!1,!wf(t)&&$se(t)}function Lse(t){S4(t,Fse)}function $se(t){S4(t,zse)}function S4(t,e){const r=t.parents.size;if(r){const n=w4(t.parents);for(let i=0;i<r;++i)e(n[i],t)}}function Fse(t,e){Rg(t.childValues.has(e)),Rg(wf(e));const r=!wf(t);if(!t.dirtyChildren)t.dirtyChildren=qx.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&Lse(t)}function zse(t,e){Rg(t.childValues.has(e)),Rg(!wf(e));const r=t.childValues.get(e);r.length===0?t.childValues.set(e,Ise(e.value)):Ose(r,e.value)||t.setDirty(),Bse(t,e),!wf(t)&&$se(t)}function Bse(t,e){const r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(qx.length<yTe&&qx.push(r),t.dirtyChildren=null))}function Vse(t){t.childValues.size>0&&t.childValues.forEach((e,r)=>{Use(t,r)}),t.forgetDeps(),Rg(t.dirtyChildren===null)}function Use(t,e){e.parents.delete(t),t.childValues.delete(e),Bse(t,e)}function wTe(t,e){if(typeof t.subscribe=="function")try{_4(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const _Te={setDirty:!0,dispose:!0,forget:!0};function Gse(t){const e=new Map;function r(n){const i=CE.getValue();if(i){let s=e.get(n);s||e.set(n,s=new Set),i.dependOn(s)}}return r.dirty=function(i,s){const a=e.get(i);if(a){const o=s&&gTe.call(_Te,s)?s:"setDirty";w4(a).forEach(c=>c[o]()),e.delete(i),_4(a)}},r}let BH;function STe(...t){return(BH||(BH=new Df(typeof WeakMap=="function"))).lookupArray(t)}const s2=new Set;function Ig(t,{max:e=Math.pow(2,16),keyArgs:r,makeCacheKey:n=STe,normalizeResult:i,subscribe:s,cache:a=ZL}=Object.create(null)){const o=typeof a=="function"?new a(e,h=>h.dispose()):a,c=function(){const h=n.apply(null,r?r.apply(null,arguments):arguments);if(h===void 0)return t.apply(null,arguments);let m=o.get(h);m||(o.set(h,m=new EE(t)),m.normalizeResult=i,m.subscribe=s,m.forget=()=>o.delete(h));const y=m.recompute(Array.prototype.slice.call(arguments));return o.set(h,m),s2.add(o),CE.hasValue()||(s2.forEach(x=>x.clean()),s2.clear()),y};Object.defineProperty(c,"size",{get:()=>o.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:e,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:s,cache:o});function u(h){const m=h&&o.get(h);m&&m.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function d(h){const m=h&&o.get(h);if(m)return m.peek()}c.peekKey=d,c.peek=function(){return d(n.apply(null,arguments))};function f(h){return h?o.delete(h):!1}return c.forgetKey=f,c.forget=function(){return f(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}const kTe=Symbol.for("apollo.cacheSize"),Su={...VL[kTe]};function Lg(t,e){return t.definitions.find(r=>r.kind==="OperationDefinition"&&!!r.name)?.name.value??e}const tf=Ig((t,e)=>{Xt(t&&t.kind==="Document",1);const r=t.definitions.filter(n=>n.kind==="OperationDefinition");e&&Xt(r.length==1&&r[0].operation===e,4,e,e,r[0].operation),cc(t,{Field(n,i,s,a){if(n.alias&&(n.alias.value==="__typename"||n.alias.value.startsWith("__ac_"))&&n.alias.value!==n.name.value){let o=t,c=[];for(const u of a)o=o[u],o.kind===qe.FIELD&&c.push(o.alias?.value||o.name.value);throw c.splice(-1,1,n.name.value),jo(5,n.alias.value,c.join("."),r[0].operation,Lg(t,"(anonymous)"))}}})},{max:Su.checkDocument||2e3,cache:Hx});function vo(...t){const e={};return t.forEach(r=>{r&&Object.keys(r).forEach(n=>{const i=r[n];i!==void 0&&(e[n]=i)})}),e}function yw(t=[]){const e={};return t.forEach(r=>{e[r.name.value]=r}),e}function vs(t){return t!==null&&typeof t=="object"}const{hasOwnProperty:TTe}
68=Object.prototype,CTe=function(t,e,r){return this.merge(t[r],e[r])};class $g{reconciler;constructor(e=CTe){this.reconciler=e}merge(e,r,...n){return vs(r)&&vs(e)?(Object.keys(r).forEach(i=>{if(TTe.call(e,i)){const s=e[i];if(r[i]!==s){const a=this.reconciler(e,r,i,...n);a!==s&&(e=this.shallowCopyForMerge(e),e[i]=a)}}else e=this.shallowCopyForMerge(e),e[i]=r[i]}),e):r}isObject=vs;pastCopies=new Set;shallowCopyForMerge(e){return vs(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e={__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function k4(t){const e={},r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(n=>{n.defaultValue&&Og(e,n.variable.name,n.defaultValue)}),e}function jE(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{const r=t.name.value;if(typeof e=="function")return e(r);const n=e&&e[r];return Xt(n,9,r),n||null}default:return null}}function ETe(t,e){let r=e;const n=[];return t.definitions.forEach(s=>{if(s.kind==="OperationDefinition")throw jo(10,s.operation,s.name?` named '${s.name.value}'`:"");s.kind==="FragmentDefinition"&&n.push(s)}),typeof r>"u"&&(Xt(n.length===1,11,n.length),r=n[0].name.value),{...t,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}},...t.definitions]}}function jTe(t){Xt(t.kind==="Document",6),Xt(t.definitions.length<=1,7);const e=t.definitions[0];return Xt(e.kind==="FragmentDefinition",8),e}function vw(t){return t.definitions.filter(e=>e.kind==="FragmentDefinition")}function T4(t){tf(t);let e;for(let r of t.definitions){if(r.kind==="OperationDefinition")return r;r.kind==="FragmentDefinition"&&!e&&(e=r)}if(e)return e;throw jo(12)}function ku(t){return tf(t),t.definitions.filter(e=>e.kind==="OperationDefinition")[0]}function NTe(t){const e=ku(t);return Xt(e&&e.operation==="query",13),e}const a2=new WeakSet;function Wse(t){t.size<=(t.max||-1)||a2.has(t)||(a2.add(t),setTimeout(()=>{t.clean(),a2.delete(t)},100))}const Hse=function(t,e){const r=new Hx(t,e);return r.set=function(n,i){const s=Hx.prototype.set.call(this,n,i);return Wse(this),s},r},PTe=function(t,e){const r=new ZL(t,e);return r.set=function(n,i){const s=ZL.prototype.set.call(this,n,i);return Wse(this),s},r},rf=Object.assign(function(e){return JSON.stringify(e,MTe)},{reset(){Hv=new PTe(Su.canonicalStringify||1e3)}});let Hv;rf.reset();function MTe(t,e){if(e&&typeof e=="object"){const r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){const n=Object.keys(e);if(n.every(ATe))return e;const i=JSON.stringify(n);let s=Hv.get(i);if(!s){n.sort();const o=JSON.stringify(n);s=Hv.get(o)||n,Hv.set(i,s),Hv.set(o,s)}const a=Object.create(r);return s.forEach(o=>{a[o]=e[o]}),a}}return e}function ATe(t,e,r){return e===0||r[e-1]<=t}const DTe=["connection","include","skip","client","rest","export","nonreactive"];let rv=rf;const qse=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){const i=r.connection.filter?r.connection.filter:[];i.sort();const s={};i.forEach(o=>{s[o]=e[o]});const a=rv(s);if(a!=="{}")return`${r.connection.key}(${a})`}return r.connection.key}let n=t;if(e){const i=rv(e);i!=="{}"&&(n+=`(${i})`)}return r&&Object.keys(r).forEach(i=>{DTe.indexOf(i)===-1&&(r[i]&&Object.keys(r[i]).length?n+=`@${i}(${rv(r[i])})`:n+=`@${i}`)}),n},{setStringify(t){const e=rv;return rv=t,e}});function Xm(t){return!!t.errors?.length}function qv(t,e,r){const n=new Set(t),i=n.size;return cc(e,{Directive(s){if(n.delete(s.name.value)&&(!r||!n.size))return h4}}),r?!n.size:n.size<i}function OTe(t){let e=!1;return cc(t,{Directive:{enter(r){if(r.name.value==="client"&&r.arguments&&(e=r.arguments.some(n=>n.name.value==="always"&&n.value.kind==="BooleanValue"&&n.value.value===!0),e))return h4}}}),e}const ki=Array.isArray;function RTe(t){return vs(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function xw(t){return t.kind==="Field"}function C4(t){return Array.isArray(t)&&t.length>0}function mg(t){return{__ref:String(t)}}function ITe(t){let e=t[0]||{};const r=t.length;if(r>1){const n=new $g;for(let i=1;i<r;
68++i)e=n.merge(e,t[i])}return e}function gg(t,e){return vo(t,e,e.variables&&{variables:vo({...t&&t.variables,...e.variables})})}function Yse(t){return t.catch(()=>{}),t}function LTe(t,e){tf(e);const r=VH(""),n=VH(""),i=v=>{for(let _=0,S;_<v.length&&(S=v[_]);++_)if(!ki(S)){if(S.kind===qe.OPERATION_DEFINITION)return r(S.name&&S.name.value);if(S.kind===qe.FRAGMENT_DEFINITION)return n(S.name.value)}return Xt.error(14),null};let s=0;for(let v=e.definitions.length-1;v>=0;--v)e.definitions[v].kind===qe.OPERATION_DEFINITION&&++s;const a=$Te(t),o=v=>C4(v)&&v.map(a).some(_=>_&&_.remove),c=new Map;let u=!1;const d={enter(v){if(o(v.directives))return u=!0,null}},f=cc(e,{Field:d,InlineFragment:d,VariableDefinition:{enter(){return!1}},Variable:{enter(v,_,S,k,E){const T=i(E);T&&T.variables.add(v.name.value)}},FragmentSpread:{enter(v,_,S,k,E){if(o(v.directives))return u=!0,null;const T=i(E);T&&T.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter(v,_,S,k){c.set(JSON.stringify(k),v)},leave(v,_,S,k){const E=c.get(JSON.str
68ingify(k));if(v===E)return v;if(s>0&&v.selectionSet.selections.every(T=>T.kind===qe.FIELD&&T.name.value==="__typename"))return n(v.name.value).removed=!0,u=!0,null}},Directive:{leave(v){if(a(v))return u=!0,null}}});if(!u)return e;const h=v=>(v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(_=>{h(n(_)).transitiveVars.forEach(S=>{v.transitiveVars.add(S)})})),v),m=new Set;f.definitions.forEach(v=>{v.kind===qe.OPERATION_DEFINITION?h(r(v.name&&v.name.value)).fragmentSpreads.forEach(_=>{m.add(_)}):v.kind===qe.FRAGMENT_DEFINITION&&s===0&&!n(v.name.value).removed&&m.add(v.name.value)}),m.forEach(v=>{h(n(v)).fragmentSpreads.forEach(_=>{m.add(_)})});const y=v=>!!(!m.has(v)||n(v).removed),x={enter(v){if(y(v.name.value))return null}};return FTe(cc(f,{FragmentSpread:x,FragmentDefinition:x,OperationDefinition:{leave(v){if(v.variableDefinitions){const _=h(r(v.name&&v.name.value)).transitiveVars;if(_.size<v.variableDefinitions.length)return{...v,variableDefinitions:v.variableDefinitions.filter(S=>_.has(S.variable.name.value))}}}}}))}function VH(t){const e=new Map;return function(n=t){let i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function $Te(t){const e=new Map,r=new Map;return t.forEach(n=>{n&&(n.name?e.set(n.name,n):n.test&&r.set(n.test,n))}),n=>{let i=e.get(n.name.value);return!i&&r.size&&r.forEach((s,a)=>{a(n)&&(i=s)}),i}}function Kse(t,e){return!t||t.selectionSet.selections.every(r=>r.kind===qe.FRAGMENT_SPREAD&&Kse(e[r.name.value],e))}function FTe(t){return Kse(ku(t)||jTe(t),yw(vw(t)))?null:t}function zTe(t){return cc(t,{FragmentSpread(e){if(!e.directives?.some(({name:r})=>r.value==="unmask"))return null}})}function Fy(t){return t.alias?t.alias.value:t.name.value}function NE({directives:t},e){return!t||!t.length?!0:VTe(t).every(({directive:r,ifArgument:n})=>{let i=!1;return n.value.kind==="Variable"?(i=e&&e[n.value.name.value],Xt(i!==void 0,15,r.name.value)):i=n.value.value,r.name.value==="skip"?!i:i})}function BTe({name:{value:t}}){return t==="skip"||t==="include"}function VTe(t){const e=[];return t&&t.length&&t.forEach(r=>{if(!BTe(r))return;const n=r.arguments,i=r.name.value;Xt(n&&n.length===1,16,i);const s=n[0];Xt(s.name&&s.name.value==="if",17,i);const a=s.value;Xt(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),18,i),e.push({directive:r,ifArgument:s})}),e}function UTe(t,e){let r=null;t.directives&&(r={},t.directives.forEach(i=>{r[i.name.value]={},i.arguments&&i.arguments.forEach(({name:s,value:a})=>Og(r[i.name.value],s,a,e))}));let n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(({name:i,value:s})=>Og(n,i,s,e))),qse(t.name.value,n,r)}function ik(t){const e={data:t.data};return t.error&&(e.error=t.error),e}function JL(t,e=()=>{}){return r=>new Jn(n=>{let i=e();return r.subscribe({next(s){let a;try{a=t(s,i)}catch(o){n.error(o)}a!==void 0&&n.next(a)},error(s){n.error(s)},complete(){n.complete()}})})}function Qse(t,{data:e,...r},{data:n,...i},s){return _r(r,i)&&sk(T4(t).selectionSet,e,n,{fragmentMap:yw(vw(t)),variables:s})}function sk(t,e,r,n){if(e===r)return!0;const i=new Set;return t.selections.every(s=>{if(i.has(s)||(i.add(s),!NE(s,n.variables))||UH(s))return!0;if(xw(s)){const a=Fy(s),o=e&&e[a],c=r&&r[a],u=s.selectionSet;if(!u)return _r(o,c);const d=Array.isArray(o),f=Array.isArray(c);if(d!==f)return!1;if(d&&f){const h=o.length;if(c.length!==h)return!1;for(let m=0;m<h;++m)if(!sk(u,o[m],c[m],n))return!1;return!0}return sk(u,o,c,n)}else{const a=jE(s,n.fragmentMap);if(a)return UH(a)?!0:sk(a.selectionSet,e,r,n)}})}function UH(t){return!!t.directives&&t.directives.some(GTe)}function GTe(t){return t.name.value==="nonreactive"}class WTe{isIncrementalResult(e){return!1}prepareRequest(e){return Xt(!qv(["defer"],e.query),64),e}extractErrors(){}startRequest=void 0}function HTe(t,{client:e}){const r={query:t.query,variables:t.variables||{},extensions:t.extensions||{},operationName:Lg(t.query),operationType:ku(t.query).operation};let n={...t.context};const i=a=>{typeof a=="function"?n={...n,...a(s())}:n={...n,...a}},s=()=>Object.freeze({...n});return Object.defineProperty(r,"setContext",{enumerable:!1,value:i}),Object.defineProperty(r,"getContext",{enumerable:!1,value:s}),Object.defineProperty(r,"client",{enumerable:!1,value:e}),r}function qTe(t,e){const r={...t},n=new Set(Object.keys(t));return cc(e,{Variable(i,s,a){a&&a.kind!=="VariableDefinition"&&n.delete(i.name.value)}}
68),n.forEach(i=>{delete r[i]}),r}class qi{static empty(){return new qi(()=>Bk)}static from(e){if(e.length===0)return qi.empty();const[r,...n]=e;return r.concat(...n)}static split(e,r,n=new qi((i,s)=>s(i))){const i=new qi((s,a)=>e(s)?r.request(s,a):n.request(s,a));return Object.assign(i,{left:r,right:n})}static execute(e,r,n){return e.request(HTe(r,n),()=>Bk)}static concat(...e){return qi.from(e)}constructor(e){e&&(this.request=e)}split(e,r,n){return this.concat(qi.split(e,r,n))}concat(...e){return e.length===0?this:e.reduce(this.combine.bind(this),this)}combine(e,r){const n=new qi((i,s)=>e.request(i,a=>r.request(a,s)));return Object.assign(n,{left:e,right:r})}request(e,r){throw jo(63)}left;right}const e$=qi.execute;function YTe(t){return t}class Hc{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new Hc(YTe,{cache:!1})}static split(e,r,n=Hc.identity()){return Object.assign(new Hc(i=>(e(i)?r:n).transformDocument(i),{cache:!1}),{left:r,right:n})}constructor(e,r={}){this.transform=e,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}resetCache(){if(this.cached){const e=new Df;this.performWork=Ig(Hc.prototype.performWork.bind(this),{makeCacheKey:r=>{const n=this.getCacheKey(r);if(n)return Xt(Array.isArray(n),20),e.lookupArray(n)},max:Su["documentTransform.cache"],cache:Hx})}}performWork(e){return tf(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const r=this.performWork(e);return this.resultCache.add(r),r}concat(e){return Object.assign(new Hc(r=>e.transformDocument(this.transformDocument(r)),{cache:!1}),{left:this,right:e})}left;right}let o2;const Yh=Object.assign(t=>{let e=o2.get(t);return e||(e=ike(t),o2.set(t,e)),e},{reset(){o2=new Hse(Su.print||2e3)}});Yh.reset();function cn(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}const GH={kind:qe.FIELD,name:{kind:qe.NAME,value:"__typename"}},Zse=Object.assign(function(t){return cc(t,{SelectionSet:{enter(e,r,n){if(n&&n.kind===qe.OPERATION_DEFINITION)return;const{selections:i}=e;if(!i||i.some(o=>o.kind===qe.FIELD&&(o.name.value==="__typename"||o.name.value.lastIndexOf("__",0)===0)))return;const a=n;if(!(a.kind===qe.FIELD&&a.directives&&a.directives.some(o=>o.name.value==="export")))return{...e,selections:[...i,GH]}}}})},{added(t){return t===GH}});function Xse(t,e){return ku(t)?.operation===e}function KTe(t){return Xse(t,"mutation")}function QTe(t){return Xse(t,"subscription")}function ZTe(t=!1){return{keyArgs:t,merge(e,r,{args:n}){const i=e?e.slice(0):[];if(r)if(n){const{offset:s=0}=n;for(let a=0;a<r.length;++a)i[s+a]=r[a]}else i.push(...r);return i}}}function XTe(t){return t===7||t===8}function t$(t){return!XTe(t)}class JTe{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){const r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0;let n;return this.performTransaction(()=>n=e.update(this),r),n}recordOptimisticTransaction(e,r){this.performTransaction(e,r)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,r=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:r})}watchFragment(e){const{fragment:r,fragmentName:n,from:i,optimistic:s=!0,...a}=e,o=this.getFragmentDoc(r,n),c=typeof i>"u"||typeof i=="string"?i:this.identify(i),u={...a,returnPartialData:!0,id:c,query:o,optimistic:s};let d;return new Jn(f=>this.watch({...u,immediate:!0,callback:h=>{let m=h.result;if(m===null&&(m={}),d&&Qse(o,{data:d.result},{data:m},e.variables))return;const y={data:m,dataState:h.complete?"complete":"partial",complete:!!h.complete};h.missing&&(y.missing=h.missing.missing),d={...h,result:m},f.next(y)}}))}getFragmentDoc=Ig(ETe,{max:Su["cache.fragmentQueryDocuments"]||1e3,cache:Hx});readFragment(e,r=!!e.optimistic){return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r})}writeQuery({id:e,data:r,...n}){return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:r}))}writeFragment({id:e,data:r,fragment:n,fragmentName:i,...s}){return this.write(Object.assign(s,{query:this.getFragmentDoc(n,i),dataId:e,result:r}))}updateQuery(e,r){return this.batch({update(n){const i=n.readQuery(e),s=r(i);return s==null?i:(n.writeQuery({...e,data:s}),s)}})}updateFragment(e,r){return this.batch({update(n){const i=n.readFragment(e),s=r(i);return s==null?i:(n.writeFragment({...e,data:s}),s)}})}}
68class E4 extends Error{message;path;query;variables;constructor(e,r,n,i){if(super(e),this.message=e,this.path=r,this.query=n,this.variables=i,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let s=this.path.length-1;s>=0;--s)this.missing={[this.path[s]]:this.missing}}else this.missing=this.path;this.__proto__=E4.prototype}missing}const{hasOwnProperty:Oi}=Object.prototype;function Jse({__typename:t,id:e,_id:r},n){if(typeof t=="string"&&(n&&(n.keyObject=e!=null?{id:e}:r!=null?{_id:r}:void 0),e==null&&r!=null&&(e=r),e!=null))return`${t}:${typeof e=="number"||typeof e=="string"?e:JSON.stringify(e)}`}const eCe={dataIdFromObject:Jse,resultCaching:!0};function tCe(t){return vo(eCe,t)}const eae=/^[_a-z][_0-9a-z]*/i;function Fg(t){const e=t.match(eae);return e?e[0]:t}function r$(t,e,r){return vs(e)?ki(e)?e.every(n=>r$(t,n,r)):t.selections.every(n=>{if(xw(n)&&NE(n,r)){const i=Fy(n);return Oi.call(e,i)&&(!n.selectionSet||r$(n.selectionSet,e[i],r))}return!0}):!1}function Jm(t){return vs(t)&&!cn(t)&&!ki(t)}function rCe(){return new $g}function tae(t,e){const r=yw(vw(t));return{fragmentMap:r,lookupFragment(n){let i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}const ak={},l2=()=>ak,WH={};class PE{policies;group;data={};constructor(e,r){this.policies=e,this.group=r}toObject(){return{...this.data}}has(e){return this.lookup(e,!0)!==void 0}get(e,r){if(this.group.depend(e,r),Oi.call(this.data,e)){const n=this.data[e];if(n&&Oi.call(n,r))return n[r]}if(r==="__typename"&&Oi.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ed)return this.parent.get(e,r)}lookup(e,r){if(r&&this.group.depend(e,"__exists"),Oi.call(this.data,e))return this.data[e];if(this instanceof Ed)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return{}}merge(e,r){let n;cn(e)&&(e=e.__ref),cn(r)&&(r=r.__ref);const i=typeof e=="string"?this.lookup(n=e):e,s=typeof r=="string"?this.lookup(n=r):r;if(!s)return;Xt(typeof n=="string",95);const a=new $g(sCe).merge(i,s);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){const o={};i||(o.__exists=1),Object.keys(s).forEach(c=>{if(!i||i[c]!==a[c]){o[c]=1;const u=Fg(c);u!==c&&!this.policies.hasKeyArgs(a.__typename,u)&&(o[u]=1),a[c]===void 0&&!(this instanceof Ed)&&delete a[c]}}),o.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===a.__typename&&delete o.__typename,Object.keys(o).forEach(c=>this.group.dirty(n,c))}}modify(e,r,n){const i=this.lookup(e);if(i){const s={};let a=!1,o=!0;const c={DELETE:ak,INVALIDATE:WH,isReference:cn,toReference:this.toReference,canRead:this.canRead,readField:(u,d)=>this.policies.readField(typeof u=="string"?{fieldName:u,from:d||mg(e)}:u,{store:this})};
68if(Object.keys(i).forEach(u=>{const d=Fg(u);let f=i[u];if(f===void 0)return;const h=typeof r=="function"?r:r[u]||(n?void 0:r[d]);if(h){let m=h===l2?ak:h(f,{...c,fieldName:d,storeFieldName:u,storage:this.getStorage(e,u)});m===WH?this.group.dirty(e,u):(m===ak&&(m=void 0),m!==f&&(s[u]=m,a=!0,f=m))}f!==void 0&&(o=!1)}),a)return this.merge(e,s),o&&(this instanceof Ed?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,r,n){const i=this.lookup(e);if(i){const s=this.getFieldValue(i,"__typename"),a=r&&n?this.policies.getStoreFieldName({typename:s,fieldName:r,args:n}):r;return this.modify(e,a?{[a]:l2}:l2,!!n)}return!1}evict(e,r){let n=!1;return e.id&&(Oi.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ed&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n}clear(){this.replace(null)}extract(){const e=this.toObject(),r=[];return this.getRootIdSet().forEach(n=>{Oi.call(this.policies.rootTypenamesById,n)||r.push(n)}),r.length&&(e.__META={extraRootIds:r.sort()}),e}replace(e){if(Object.keys(this.data).forEach(r=>{e&&Oi.call(e,r)||this.delete(r)}),e){const{__META:r,...n}=e;Object.keys(n).forEach(i=>{this.merge(i,n[i])}),r&&r.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof Ed?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),r=this.toObject();e.forEach(i=>{Oi.call(r,i)&&(Object.keys(this.findChildRefIds(i)).forEach(e.add,e),delete r[i])});const n=Object.keys(r);if(n.length){let i=this;for(;i instanceof Ed;)i=i.parent;n.forEach(s=>i.delete(s))}return n}refs={};findChildRefIds(e){if(!Oi.call(this.refs,e)){const r=this.refs[e]={},n=this.data[e];if(!n)return r;const i=new Set([n]);i.forEach(s=>{cn(s)&&(r[s.__ref]=!0),vs(s)&&Object.keys(s).forEach(a=>{const o=s[a];vs(o)&&i.add(o)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,r)=>cn(e)?this.get(e.__ref,r):e&&e[r];canRead=e=>cn(e)?this.has(e.__ref):typeof e=="object";toReference=(e,r)=>{if(typeof e=="string")return mg(e);if(cn(e))return e;const[n]=this.policies.identify(e);if(n){const i=mg(n);return r&&this.merge(n,e),i}};get supportsResultCaching(){return this.group.caching}}class rae{caching;parent;d=null;keyMaker;constructor(e,r=null){this.caching=e,this.parent=r,this.resetCaching()}resetCaching(){this.d=this.caching?Gse():null,this.keyMaker=new Df}depend(e,r){if(this.d){this.d(c2(e,r));const n=Fg(r);n!==r&&this.d(c2(e,n)),this.parent&&this.parent.depend(e,r)}}dirty(e,r){this.d&&this.d.dirty(c2(e,r),r==="__exists"?"forget":"setDirty")}}function c2(t,e){return e+"#"+t}function HH(t,e){fx(t)&&t.group.depend(e,"__exists")}let nCe=class extends PE{constructor({policies:e,resultCaching:r=!0,seed:n}){super(e,new rae(r)),n&&this.replace(n)}stump=new iCe(this);addLayer(e,r){return this.stump.addLayer(e,r)}removeLayer(){return this}storageTrie=new Df;getStorage(){return this.storageTrie.lookupArray(arguments)}};PE.Root=nCe;let Ed=class nae extends PE{id;parent;replay;group;constructor(e,r,n,i){super(r.policies,i),this.id=e,this.parent=r,this.replay=n,this.group=i,n(this)}addLayer(e,r){return new nae(e,this,r,this.group)}removeLayer(e){const r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(n=>{const i=this.data[n],s=r.lookup(n);
68s?i?i!==s&&Object.keys(i).forEach(a=>{_r(i[a],s[a])||this.group.dirty(n,a)}):(this.group.dirty(n,"__exists"),Object.keys(s).forEach(a=>{this.group.dirty(n,a)})):this.delete(n)}),r):r===this.parent?this:r.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const r=this.parent.findChildRefIds(e);return Oi.call(this.data,e)?{...r,...super.findChildRefIds(e)}:r}getStorage(...e){let r=this.parent;for(;r.parent;)r=r.parent;return r.getStorage(...e)}};class iCe extends Ed{constructor(e){super("EntityStore.Stump",e,()=>{},new rae(e.group.caching,e.group))}removeLayer(){return this}merge(e,r){return this.parent.merge(e,r)}}function sCe(t,e,r){const n=t[r],i=e[r];return _r(n,i)?n:i}function fx(t){return!!(t&&t.supportsResultCaching)}const iae=new TE;function aCe(t){const e=t.directives?.find(({name:n})=>n.value==="unmask");if(!e)return"mask";const r=e.arguments?.find(({name:n})=>n.value==="mode");return r&&"value"in r.value&&r.value.value==="migrate"?"migrate":"unmask"}function sae(t,e,r){return iae.withValue(!0,()=>Yv(t,e,r,!1))}function oCe(t,e){if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};return e.set(t,r),r}function Yv(t,e,r,n,i){const{knownChanged:s}=r,a=oCe(t,r.mutableTargets);if(Array.isArray(t)){for(const[o,c]of Array.from(t.entries())){if(c===null){a[o]=null;continue}const u=Yv(c,e,r,n);s.has(u)&&s.add(a),a[o]=u}return s.has(a)?a:t}for(const o of e.selections){let c;if(n&&s.add(a),o.kind===qe.FIELD){const u=Fy(o),d=o.selectionSet;if(c=a[u]||t[u],c===void 0)continue;if(d&&c!==null){const f=Yv(t[u],d,r,n);s.has(f)&&(c=f)}a[u]=c}if(o.kind===qe.INLINE_FRAGMENT&&(!o.typeCondition||r.cache.fragmentMatches(o,t.__typename))&&(c=Yv(t,o.selectionSet,r,n)),o.kind===qe.FRAGMENT_SPREAD){const u=o.name.value,d=r.fragmentMap[u]||(r.fragmentMap[u]=r.cache.lookupFragment(u));Xt(d,39,u);const f=aCe(o);f!=="mask"&&(c=Yv(t,d.selectionSet,r,f==="migrate"))}s.has(c)&&s.add(a)}return"__typename"in t&&!("__typename"in a)&&(a.__typename=t.__typename),Object.keys(a).length!==Object.keys(t).length&&s.add(a),s.has(a)?a:t}function lCe(t,e,r,n){const i=e.definitions.filter(a=>a.kind===qe.FRAGMENT_DEFINITION);typeof n>"u"&&(Xt(i.length===1,41,i.length),n=i[0].name.value);const s=i.find(a=>a.name.value===n);return Xt(!!s,42,n),t==null||_r(t,{})?t:sae(t,s.selectionSet,{operationName:s.name.value,fragmentMap:yw(vw(e)),cache:r,mutableTargets:new WeakMap,knownChanged:new WeakSet})}function cCe(t,e,r){const n=ku(e);return Xt(n,43),t==null?t:sae(t,n.selectionSet,{operationType:n.operation,operationName:n.name?.value,fragmentMap:yw(vw(e)),cache:r,mutableTargets:new WeakMap,knownChanged:new WeakSet})}const qH={};function j4(t){const e=JSON.stringify(t);return qH[e]||(qH[e]={})}function YH(t){const e=j4(t);return e.keyFieldsFn||(e.keyFieldsFn=(r,n)=>{const i=(a,o)=>n.readField(o,a),s=n.keyObject=N4(t,a=>{let o=yg(n.storeObject,a,i);return o===void 0&&r!==n.storeObject&&Oi.call(r,a[0])&&(o=yg(r,a,oae)),Xt(o!==void 0,98,a.join("."),r),o});return`${n.typename}:${JSON.stringify(s)}`})}function KH(t){const e=j4(t);return e.keyArgsFn||(e.keyArgsFn=(r,{field:n,variables:i,fieldName:s})=>{const a=N4(t,c=>{const u=c[0],d=u.charAt(0);if(d==="@"){if(n&&C4(n.directives)){const f=u.slice(1),h=n.directives.find(y=>y.name.value===f),m=h&&b4(h,i);return m&&yg(m,c.slice(1))}return}if(d==="$"){const f=u.slice(1);if(i&&Oi.call(i,f)){const h=c.slice(0);return h[0]=f,yg(i,h)}return}if(r)return yg(r,c)}),o=JSON.stringify(a);return(r||o!=="{}")&&(s+=":"+o),s})}function N4(t,e){const r=new $g;return aae(t).reduce((n,i)=>{let s=e(i);if(s!==void 0){for(let a=i.length-1;a>=0;--a)s={[i[a]]:s};n=r.merge(n,s)}return n},{})}function aae(t){const e=j4(t);if(!e.paths){const r=e.paths=[],n=[];t.forEach((i,s)=>{ki(i)?(aae(i).forEach(a=>r.push(n.concat(a))),n.length=0):(n.push(i),ki(t[s+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function oae(t,e){return t[e]}function yg(t,e,r){return r=r||oae,lae(e.reduce(function n(i,s){return ki(i)?i.map(a=>n(a,s)):i&&r(i,s)},t))}function lae(t){return vs(t)?ki(t)?t.map(lae):N4(Object.keys(t).sort(),e=>yg(t,e)):t}const cae=new TE,QH=new WeakMap;function hx(t){let e=QH.get(t);
68return e||QH.set(t,e={vars:new Set,dep:Gse()}),e}function ZH(t){hx(t).vars.forEach(e=>e.forgetCache(t))}function uCe(t){hx(t).vars.forEach(e=>e.attachCache(t))}function dCe(t){const e=new Set,r=new Set,n=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(o=>{hx(o).dep.dirty(n),fCe(o)});const a=Array.from(r);r.clear(),a.forEach(o=>o(t))}}else{const a=cae.getValue();a&&(i(a),hx(a).dep(n))}return t};n.onNextChange=s=>(r.add(s),()=>{r.delete(s)});const i=n.attachCache=s=>(e.add(s),hx(s).vars.add(n),n);return n.forgetCache=s=>e.delete(s),n}function fCe(t){t.broadcastWatches&&t.broadcastWatches()}function n$(t){return t.args!==void 0?t.args:t.field?b4(t.field,t.variables):null}const hCe=()=>{},XH=(t,e)=>e.fieldName,JH=(t,e,{mergeObjects:r})=>r(t,e),e8=(t,e)=>e;class pCe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:Jse,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,r){const n=this,i=r&&(r.typename||r.storeObject?.__typename)||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const s=r&&r.storeObject||e,a={...r,typename:i,storeObject:s,readField:r&&r.readField||((...d)=>{const f=P4(d,s);return n.readField(f,{store:n.cache.data,variables:f.variables})})};let o;const c=i&&this.getTypePolicy(i);let u=c&&c.keyFn||this.config.dataIdFromObject;return iae.withValue(!0,()=>{for(;u;){const d=u({...e,...s},a);if(ki(d))u=YH(d);else{o=d;break}}}),o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]}addTypePolicies(e){Object.keys(e).forEach(r=>{const{queryType:n,mutationType:i,subscriptionType:s,...a}=e[r];n&&this.setRootTypename("Query",r),i&&this.setRootTypename("Mutation",r),s&&this.setRootTypename("Subscription",r),Oi.call(this.toBeAdded,r)?this.toBeAdded[r].push(a):this.toBeAdded[r]=[a]})}updateTypePolicy(e,r,n){const i=this.getTypePolicy(e),{keyFields:s,fields:a}=r;function o(c,u){c.merge=typeof u=="function"?u:u===!0?JH:u===!1?e8:c.merge}o(i,r.merge),i.keyFn=s===!1?hCe:ki(s)?YH(s):typeof s=="function"?s:i.keyFn,a&&Object.keys(a).forEach(c=>{let u=n[c];(!u||u?.typename!==e)&&(u=n[c]={typename:e});const d=a[c];if(typeof d=="function")u.read=d;else{const{keyArgs:f,read:h,merge:m}=d;u.keyFn=f===!1?XH:ki(f)?KH(f):typeof f=="function"?f:u.keyFn,typeof h=="function"&&(u.read=h),o(u,m)}u.read&&u.merge&&(u.keyFn=u.keyFn||XH)})}setRootTypename(e,r=e){const n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(Xt(!i||i===e,99,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(r=>{this.getSupertypeSet(r,!0),e[r].forEach(n=>{this.getSupertypeSet(n,!0).add(r);const i=n.match(eae);(!i||i[0]!==n)&&this.fuzzySubtypes.set(n,new RegExp(n))})})}getTypePolicy(e){if(!Oi.call(this.typePolicies,e)){const n=this.typePolicies[e]={};n.fields={};let i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((s,a)=>
68{if(s.test(e)){const o=this.supertypeMap.get(a);o&&o.forEach(c=>i.add(c))}})),i&&i.size&&i.forEach(s=>{const{fields:a,...o}=this.getTypePolicy(s);Object.assign(n,o),Object.assign(n.fields,a)})}const r=this.toBeAdded[e];return r&&r.length&&r.splice(0).forEach(n=>{this.updateTypePolicy(e,n,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,r){if(e)return this.getTypePolicy(e).fields[r]}getSupertypeSet(e,r){let n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n}fragmentMatches(e,r,n,i){if(!e.typeCondition)return!0;if(!r)return!1;const s=e.typeCondition.name.value;if(r===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s)){const a=this.getSupertypeSet(r,!0),o=[a],c=d=>{const f=this.getSupertypeSet(d,!1);f&&f.size&&o.indexOf(f)<0&&o.push(f)};let u=!!(n&&this.fuzzySubtypes.size);for(let d=0;d<o.length;++d){const f=o[d];if(f.has(s))return a.has(s)||a.add(s),!0;f.forEach(c),u&&d===o.length-1&&r$(e.selectionSet,n,i)&&(u=!1,this.fuzzySubtypes.forEach((h,m)=>{const y=r.match(h);y&&y[0]===r&&c(m)}))}}return!1}hasKeyArgs(e,r){const n=this.getFieldPolicy(e,r);return!!(n&&n.keyFn)}getStoreFieldName(e){const{typename:r,fieldName:n}=e,i=this.getFieldPolicy(r,n);let s,a=i&&i.keyFn;if(a&&r){const o={typename:r,fieldName:n,field:e.field||null,variables:e.variables},c=n$(e);for(;a;){const u=a(c,o);if(ki(u))a=KH(u);else{s=u||n;break}}}return s===void 0&&(s=e.field?UTe(e.field,e.variables):qse(n,n$(e))),s===!1?n:n===Fg(s)?s:n+":"+s}readField(e,r){const n=e.from;if(!n||!(e.field||e.fieldName))return;if(e.typename===void 0){const d=r.store.getFieldValue(n,"__typename");d&&(e.typename=d)}const s=this.getStoreFieldName(e),a=Fg(s),o=r.store.getFieldValue(n,s),c=this.getFieldPolicy(e.typename,a),u=c&&c.read;if(u){const d=t8(this,n,e,r,r.store.getStorage(cn(n)?n.__ref:n,s));return cae.withValue(this.cache,u,[o,d])}return o}getReadFunction(e,r){const n=this.getFieldPolicy(e,r);return n&&n.read}getMergeFunction(e,r,n){let i=this.getFieldPolicy(e,r),s=i&&i.merge;return!s&&n&&(i=this.getTypePolicy(n),s=i&&i.merge),s}runMergeFunction(e,r,{field:n,typename:i,merge:s},a,o){return s===JH?uae(a.store)(e,r):s===e8?r:(a.overwrite&&(e=void 0),s(e,r,t8(this,void 0,{typename:i,fieldName:n.name.value,field:n,variables:a.variables},a,o||{})))}}function t8(t,e,r,n,i){const s=t.getStoreFieldName(r),a=Fg(s),o=r.variables||n.variables,{toReference:c,canRead:u}=n.store;return{args:n$(r),field:r.field||null,fieldName:a,storeFieldName:s,variables:o,isReference:cn,toReference:c,storage:i,cache:t.cache,canRead:u,readField(...d){return t.readField(P4(d,e,o),n)},mergeObjects:uae(n.store)}}function P4(t,e,r){const{0:n,1:i,length:s}=t;let a;return typeof n=="string"?a={fieldName:n,from:s>1?i:e}:(a={...n},Oi.call(a,"from")||(a.from=e)),a.variables===void 0&&(a.variables=r),a}function uae(t){return function(r,n){if(ki(r)||ki(n))throw jo(102);if(vs(r)&&vs(n)){const i=t.getFieldValue(r,"__typename"),s=t.getFieldValue(n,"__typename");if(i&&s&&i!==s)return n;if(cn(r)&&Jm(n))return t.merge(r.__ref,n),r;if(Jm(r)&&cn(n))return t.merge(r,n.__ref),n;if(Jm(r)&&Jm(n))return{...r,...n}}return n}}function r8(t){return[t.selectionSet,t.objectOrReference,t.context]}class mCe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=Ig(r=>{const n=r8(r),i=this.executeSelectionSet.peek(...n);return i||(HH(r.context.store,r.enclosingRef.__ref),this.execSelectionSetImpl(r))},{max:Su["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:r8,makeCacheKey(r,n,i){if(fx(i.store))return i.store.makeCacheKey(r,cn(n)?n.__ref:n,i.varString)}}),this.executeSubSelectedArray=Ig(r=>(HH(r.context.store,r.enclosingRef.__ref),this.execSubSelectedArrayImpl(r)),{max:Su["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:r,array:n,context:i}){if(fx(i.store))return i.store.makeCacheKey(r,n,i.varString)}})}diffQueryAgainstStore({store:e,query:r,rootId:n="ROOT_QUERY",variables:i,returnPartialData:s=!0}){const a=this.config.cache.policies;i={...k4(NTe(r)),...i};const o=mg(n),c=this.executeSelectionSet({selectionSet:T4(r).selectionSet,objectOrReference:o,enclosingRef:o,context:{store:e,query:r,policies:a,variables:i,varString:rf(i),...tae(r,this.config.fragments)}});let u;c.missing&&(u=new E4(gCe(c.missing),c.missing,r,i));const d=!u,{result:f}=c;return{result:d||s?Object.keys(f).length===0?null:f:null,complete:d,missing:u}}isFresh(e,r,n,i){if(fx(i.store)&&this.knownResults.get(e)===n){const s=this.executeSelectionSet.peek(n,r,i);if(s&&e===s.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:r,enclosingRef:n,context:i}){if(cn(r)&&!i.policies.rootTypenamesById[r.__ref]&&!i.store.has(r.__ref))return{result:{},missing:`Dangling reference to missing ${r.__ref} object`};const{variables:s,policies:a,store:o}=i,c=o.getFieldValue(r,"__typename"),u=[];let d;const f=new $g;typeof c=="string"&&!a.rootIdsByTypename[c]&&u.push({__typename:c}
68);function h(_,S){return _.missing&&(d=f.merge(d,{[S]:_.missing})),_.result}const m=new Set(e.selections);m.forEach(_=>{if(NE(_,s))if(xw(_)){let S=a.readField({fieldName:_.name.value,field:_,variables:i.variables,from:r},i);const k=Fy(_);S===void 0?Zse.added(_)||(d=f.merge(d,{[k]:`Can't find field '${_.name.value}' on ${cn(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)}`})):ki(S)?S.length>0&&(S=h(this.executeSubSelectedArray({field:_,array:S,enclosingRef:n,context:i}),k)):_.selectionSet&&S!=null&&(S=h(this.executeSelectionSet({selectionSet:_.selectionSet,objectOrReference:S,enclosingRef:cn(S)?S:n,context:i}),k)),S!==void 0&&u.push({[k]:S})}else{const S=jE(_,i.lookupFragment);if(!S&&_.kind===qe.FRAGMENT_SPREAD)throw jo(103,_.name.value);S&&a.fragmentMatches(S,c)&&S.selectionSet.selections.forEach(m.add,m)}});const x={result:ITe(u),missing:d},v=x;return v.result&&this.knownResults.set(v.result,e),v}execSubSelectedArrayImpl({field:e,array:r,enclosingRef:n,context:i}){let s,a=new $g;function o(c,u){return c.missing&&(s=a.merge(s,{[u]:c.missing})),c.result}return e.selectionSet&&(r=r.filter(i.store.canRead)),r=r.map((c,u)=>c===null?null:ki(c)?o(this.executeSubSelectedArray({field:e,array:c,enclosingRef:n,context:i}),u):e.selectionSet?o(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:c,enclosingRef:cn(c)?c:n,context:i}),u):c),{result:r,missing:s}}}function gCe(t){try{JSON.stringify(t,(e,r)=>{if(typeof r=="string")throw r;return r})}catch(e){return e}}function u2(t,e,r){const n=`${e}${r}`;let i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:{...t,clientOnly:e,deferred:r}),i}class yCe{cache;reader;fragments;constructor(e,r,n){this.cache=e,this.reader=r,this.fragments=n}writeToStore(e,{query:r,result:n,dataId:i,variables:s,overwrite:a}){const o=ku(r),c=rCe();s={...k4(o),...s};const u={store:e,written:{}
68,merge(f,h){return c.merge(f,h)},variables:s,varString:rf(s),...tae(r,this.fragments),overwrite:!!a,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},d=this.processSelectionSet({result:n||{},dataId:i,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:u});if(!cn(d))throw jo(105,n);return u.incomingById.forEach(({storeObject:f,mergeTree:h,fieldNodeSet:m},y)=>{const x=mg(y);if(h&&h.map.size){const v=this.applyMerges(h,x,f,u);if(cn(v))return;f=v}e.merge(y,f)}),e.retain(d.__ref),d}processSelectionSet({dataId:e,result:r,selectionSet:n,context:i,mergeTree:s}){const{policies:a}=this.cache;let o={};const c=e&&a.rootTypenamesById[e]||s$(r,n,i.fragmentMap)||e&&i.store.get(e,"__typename");typeof c=="string"&&(o.__typename=c);const u=(...f)=>{const h=P4(f,o,i.variables);if(cn(h.from)){const m=i.incomingById.get(h.from.__ref);if(m){const y=a.readField({...h,from:m.storeObject},i);if(y!==void 0)return y}}return a.readField(h,i)},d=new Set;this.flattenFields(n,r,i,c).forEach((f,h)=>{const m=Fy(h),y=r[m];if(d.add(h),y!==void 0){const x=a.getStoreFieldName({typename:c,fieldName:h.name.value,field:h,variables:f.variables}),v=n8(s,x);let _=this.processFieldValue(y,h,h.selectionSet?u2(f,!1,!1):f,v),S;h.selectionSet&&(cn(_)||Jm(_))&&(S=u("__typename",_));const k=a.getMergeFunction(c,h.name.value,S);k?v.info={field:h,typename:c,merge:k}:i8(s,x),o=f.merge(o,{[x]:_})}});try{const[f,h]=a.identify(r,{typename:c,selectionSet:n,fragmentMap:i.fragmentMap,storeObject:o,readField:u});e=e||f,h&&(o=i.merge(o,h))}catch(f){if(!e)throw f}if(typeof e=="string"){const f=mg(e),h=i.written[e]||(i.written[e]=[]);if(h.indexOf(n)>=0||(h.push(n),this.reader&&this.reader.isFresh(r,f,n,i)))return f;const m=i.incomingById.get(e);return m?(m.storeObject=i.merge(m.storeObject,o),m.mergeTree=i$(m.mergeTree,s),d.forEach(y=>m.fieldNodeSet.add(y))):i.incomingById.set(e,{storeObject:o,mergeTree:Gk(s)?void 0:s,fieldNodeSet:d}),f}return o}processFieldValue(e,r,n,i){return!r.selectionSet||e===null?e:ki(e)?e.map((s,a)=>{const o=this.processFieldValue(s,r,n,n8(i,a));return i8(i,a),o}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})}flattenFields(e,r,n,i=s$(r,e,n.fragmentMap)){const s=new Map,{policies:a}=this.cache,o=new Df(!1);return(function c(u,d){const f=o.lookup(u,d.clientOnly,d.deferred);f.visited||(f.visited=!0,u.selections.forEach(h=>{if(!NE(h,n.variables))return;let{clientOnly:m,deferred:y}=d;if(!(m&&y)&&C4(h.directives)&&h.directives.forEach(x=>{const v=x.name.value;if(v==="client"&&(m=!0),v==="defer"){const _=b4(x,n.variables);(!_||_.if!==!1)&&(y=!0)}}),xw(h)){const x=s.get(h);x&&(m=m&&x.clientOnly,y=y&&x.deferred),s.set(h,u2(n,m,y))}else{const x=jE(h,n.lookupFragment);if(!x&&h.kind===qe.FRAGMENT_SPREAD)throw jo(107,h.name.value);x&&a.fragmentMatches(x,i,r,n.variables)&&c(x.selectionSet,u2(n,m,y))}}))})(e,n),s}applyMerges(e,r,n,i,s){if(e.map.size&&!cn(n)){const a=!ki(n)&&(cn(r)||Jm(r))?r:void 0,o=n;a&&!s&&(s=[cn(a)?a.__ref:a]);let c;const u=(d,f)=>ki(d)?typeof f=="number"?d[f]:void 0:i.store.getFieldValue(d,String(f));e.map.forEach((d,f)=>{const h=u(a,f),m=u(o,f);if(m===void 0)return;s&&s.push(f);const y=this.applyMerges(d,h,m,i,s);y!==m&&(c=c||new Map,c.set(f,y)),s&&Xt(s.pop()===f)}),c&&(n=ki(o)?o.slice(0):{...o},c.forEach((d,f)=>{n[f]=d}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,s&&i.store.getStorage(...s)):n}}const dae=[];function n8({map:t},e){return t.has(e)||t.set(e,dae.pop()||{map:new Map}),t.get(e)}function i$(t,e){if(t===e||!e||Gk(e))return t;if(!t||Gk(t))return e;const r=t.info&&e.info?{...t.info,...e.info}:t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,s={info:r,map:i};if(n){const a=new Set(e.map.keys());t.map.forEach((o,c)=>{s.map.set(c,i$(o,e.map.get(c))),a.delete(c)}),a.forEach(o=>{s.map.set(o,i$(e.map.get(o),t.map.get(o)))})}return s}function Gk(t){return!t||!(t.info||t.map.size)}function i8({map:t},e){const r=t.get(e);r&&Gk(r)&&(dae.push(r),t.delete(e))}function s$(t,e,r){let n;for(const i of e.selections)if(xw(i)){if(i.name.value==="__typename")return t[Fy(i)]}else n?n.push(i):n=[i];if(typeof t.__typename=="string")return t.__typename;if(n)for(const i of n){const s=s$(t,jE(i,r).selectionSet,r);if(typeof s=="string")return s}}class vCe extends JTe{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new Hc(Zse);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=dCe;constructor(e={}){super(),this.config=tCe(e),this.policies=new pCe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new PE.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new yCe(this,this.storeReader=new mCe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=Ig((r,n)=>this.broadcastWatch(r,n),{max:Su["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:r=>{const n=r.optimistic?this.optimisticData:this.data;if(fx(n)){const{optimistic:i,id:s,variables:a}=r;return n.makeCacheKey(r.query,r.callback,rf({optimistic:i,id:s,variables:a}))}}}
68),new Set([this.data.group,this.optimisticData.group]).forEach(r=>r.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:r=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}}modify(e){if(Oi.call(e,"id")&&!e.id)return!1;const r=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||uCe(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&ZH(this),this.maybeBroadcastWatch.forget(e)}}gc(e){rf.reset(),Yh.reset();const r=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),r}retain(e,r){return(r?this.optimisticData:this.data).retain(e)}release(e,r){return(r?this.optimisticData:this.data).release(e)}identify(e){if(cn(e))return e.__ref;try{return this.policies.identify(e)[0]}catch{}}evict(e){if(!e.id){if(Oi.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{!--this.txCount&&e.broadcast!==!1&&this.broadcastWatches()}}reset(e){return this.init(),rf.reset(),e&&e.discardWatches?(this.watches.forEach(r=>this.maybeBroadcastWatch.forget(r)),this.watches.clear(),ZH(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const r=this.optimisticData.removeLayer(e);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())}txCount=0;batch(e){const{update:r,optimistic:n=!0,removeOptimistic:i,onWatchUpdated:s}=e;let a;const o=u=>{const{data:d,optimisticData:f}=this;++this.txCount,u&&(this.data=this.optimisticData=u);try{return a=r(this)}finally{--this.txCount,this.data=d,this.optimisticData=f}},c=new Set;return s&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated(u){return c.add(u),!1}}),typeof n=="string"?this.optimisticData=this.optimisticData.addLayer(n,o):n===!1?o(this.data):o(),typeof i=="string"&&(this.optimisticData=this.optimisticData.removeLayer(i)),s&&c.size?(this.broadcastWatches({...e,onWatchUpdated(u,d){const f=s.call(this,u,d);return f!==!1&&c.delete(u),f}}),c.size&&c.forEach(u=>this.maybeBroadcastWatch.dirty(u))):this.broadcastWatches(e),a}performTransaction(e,r){return this.batch({update:e,optimistic:r||r!==null})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,r){return this.policies.fragmentMatches(e,r)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}broadcastWatches(e){this.txCount||this.watches.forEach(r=>this.maybeBroadcastWatch(r,e))}addFragmentsToDocument(e){const{fragments:r}=this.config;return r?r.transform(e):e}broadcastWatch(e,r){const{lastDiff:n}=e,i=this.diff(e);r&&(e.optimistic&&typeof r.optimistic=="string"&&(i.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,e,i,n)===!1)||(!n||!_r(n.result,i.result))&&e.callback(e.lastDiff=i,n)}}function bw(t,e){return typeof t=="object"&&t!==null&&t[Symbol.for("apollo.error")]===e}function ww(t){Object.defineProperty(t,Symbol.for("apollo.error"),{value:t.name,enumerable:!1,writable:!1,configurable:!1})}function s8(t){return t.map(e=>e.message||"Error message not found.").join(`
69`)}
69class Yx extends Error{static is(e){return bw(e,"CombinedProtocolErrors")}static formatMessage=s8;errors;constructor(e){super(Yx.formatMessage(e,{defaultFormatMessage:s8})),this.name="CombinedProtocolErrors",this.errors=e,ww(this),Object.setPrototypeOf(this,Yx.prototype)}}function xCe(t){return t!==null&&typeof t=="object"&&typeof t.message=="string"&&typeof t.name=="string"&&(typeof t.stack=="string"||typeof t.stack>"u")}class M4 extends Error{static is(e){return bw(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",ww(this),Object.setPrototypeOf(this,M4.prototype)}}function a8(t){return t.filter(e=>e).map(e=>e.message||"Error message not found.").join(`
70`)}class qc extends Error{static is(e){return bw(e,"CombinedGraphQLErrors")}static formatMessage=a8;errors;data;extensions;constructor(e,r=e.errors||[]){super(qc.formatMessage(r,{result:e,defaultFormatMessage:a8})),this.errors=r,this.data=e.data,this.extensions=e.extensions,this.name="CombinedGraphQLErrors",ww(this),Object.setPrototypeOf(this,qc.prototype)}}const bCe=new WeakSet;function wCe(t){bCe.add(t)}class ME extends Error{static is(e){return bw(e,"ServerError")}response;statusCode;bodyText;constructor(e,r){super(e),this.name="ServerError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,ww(this),Object.setPrototypeOf(this,ME.prototype)}}class AE extends Error{static is(e){return bw(e,"ServerParseError")}response;statusCode;bodyText;constructor(e,r){super(e instanceof Error?e.message:"Could not parse server response",{cause:e}),this.name="ServerParseError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,ww(this),Object.setPrototypeOf(this,AE.prototype)}}const Wk=Symbol();function _Ce(t){return"extensions"in t?Yx.is(t.extensions[Wk]):!1}function SCe(t){return xCe(t)?t:typeof t=="string"?new Error(t,{cause:t}):new M4(t)}var $t;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error",t[t.streaming=9]="streaming"})($t||($t={}));const{assign:o8}=Object,Nm={loading:!0,networkStatus:$t.loading,data:void 0,dataState:"empty",partial:!0},d2={loading:!1,networkStatus:$t.ready,data:void 0,dataState:"empty",partial:!0};class f2{options;queryName;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}constructor({queryManager:e,options:r,transformedQuery:n=e.transform(r.query)}){this.queryManager=e,this.waitForNetworkResult=r.fetchPolicy==="network-only",this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:s=i,initialFetchPolicy:a=s==="standby"?i:s}=r;this.lastQuery=n,this.options={...r,initialFetchPolicy:a,fetchPolicy:s,variables:this.getVariablesWithDefaults(r.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const o=ku(this.query);this.queryName=o&&o.name&&o.name.value}initializeObservablesQueue(){this.subject=new wke({query:this.query,variables:this.variables,result:Nm,meta:{}});const e=this.subject.pipe(Uk({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),JL(({query:r,variables:n,result:i,meta:s},a)=>{const{shouldEmit:o}=s;
70if(i===Nm&&(a.previous=void 0,a.previousVariables=void 0),this.options.fetchPolicy==="standby"||o===2)return;if(o===1)return d();const{previous:c,previousVariables:u}=a;if(c){const f=this.queryManager.getDocumentInfo(r),h=this.queryManager.dataMasking,m=h?f.nonReactiveQuery:r;if((h||f.hasNonreactiveDirective?Qse(m,c,i,n):_r(c,i))&&_r(u,n))return}if(o===3&&(!this.options.notifyOnNetworkStatusChange||_r(c,i)))return;return d();function d(){return a.previous=i,a.previousVariables=n,i}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new $y,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.queryManager.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){const r=this.queryManager.prioritizeCacheValues?"cache-first":e||this.options.fetchPolicy,n=()=>{const i=this.getCacheDiff(),s=this.options.returnPartialData||i.complete?i.result??void 0:void 0;return this.maskResult({data:s,dataState:i.complete?"complete":s===void 0?"empty":"partial",loading:!i.complete,networkStatus:i.complete?$t.ready:$t.loading,partial:!i.complete})};switch(r){case"cache-only":return{...n(),loading:!1,networkStatus:$t.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:$t.loading};case"standby":return d2;default:return Nm}}resubscribeCache(){const{variables:e,fetchPolicy:r}=this.options,n=this.query,i=r==="standby"||r==="no-cache"||this.waitForNetworkResult,s=!nv({query:n,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((i||s)&&this.unsubscribeFromCache?.(),i||!s)return;const a={query:n,variables:e,optimistic:!0,watcher:this,callback:c=>{const u=this.queryManager.getDocumentInfo(n);if((u.hasClientExports||u.hasForcedResolvers)&&(a.lastDiff=void 0),a.lastOwnDiff===c)return;const{result:d}=this.subject.getValue();!c.complete&&(d.error||d===Nm||d===d2)||_r(d.data,c.result)||this.scheduleNotify()}},o=this.queryManager.cache.watch(a);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,o()},{query:n,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let r=e.networkStatus===$t.error||this.hasObservers()||this.options.fetchPolicy==="no-cache"?e:this.getInitialResult();return r===Nm&&(r=this.getInitialResult()),_r(this.stableLastResult,r)||(this.stableLastResult=r),this.stableLastResult}refetch(e){const{fetchPolicy:r}=this.options,n={pollInterval:0};return r==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",e&&!_r(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(n,{newNetworkStatus:$t.refetch})}fetchMore({query:e,variables:r,context:n,errorPolicy:i,updateQuery:s}){Xt(this.options.fetchPolicy!=="cache-only",78,Lg(this.query,"(anonymous)"));const a={...vo(this.options,{errorPolicy:"none"},{query:e,context:n,errorPolicy:i}),variables:e?r:{...this.variables,...r},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};a.query=this.transformDocument(a.query),this.lastQuery=e?this.transformDocument(this.options.query):a.query;let o=!1;const c=this.options.fetchPolicy!=="no-cache";c||Xt(s,79);const{finalize:u,pushNotification:d}=this.pushOperation($t.fetchMore);return d({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3}),this.queryManager.fetchQuery(a,$t.fetchMore).then(f=>{if(u(),c){const h=this.getCacheDiff();this.queryManager.cache.batch({update:m=>{s?m.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1},y=>s(y,{fetchMoreResult:f.data,variables:a.variables})):m.writeQuery({query:a.query,variables:a.variables,data:f.data})},onWatchUpdated:(m,y)=>{m.watcher===this&&!_r(y.result,h.result)&&(o=!0)}})}else{const h=this.getCurrentResult(),m=s(h.data,{fetchMoreResult:f.data,variables:a.variables});d({kind:"N",value:{...h,networkStatus:$t.ready,loading:!1,data:m,dataState:h.dataState==="streaming"?"streaming":"complete"},source:"network"})}return this.maskResult(f)}).finally(()=>{u(),c&&!o&&d({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})})}subscribeToMore(e){const r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:n=>{const{updateQuery:i,onError:s}=e,{error:a}=n;
70if(a){s?s(a):Xt.error(80,a);return}i&&this.updateQuery((o,c)=>i(o,{subscriptionData:n,...c}))}});return this.subscriptions.add(r),()=>{this.subscriptions.delete(r)&&r.unsubscribe()}}applyOptions(e){const r=vo(this.options,e||{});o8(this.options,r),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),_r(this.variables,e)?ik(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:$t.setVariables}):ik(this.getCurrentResult()))}updateQuery(e){const{queryManager:r}=this,{result:n,complete:i}=this.getCacheDiff({optimistic:!1}),s=e(n,{variables:this.variables,complete:!!i,previousData:n});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,r){if(r.nextFetchPolicy){const{fetchPolicy:n="cache-first",initialFetchPolicy:i=n}=r;n==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy.call(r,n,{reason:e,options:r,observable:this,initialFetchPolicy:i}):e==="variables-changed"?r.fetchPolicy=i:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy}fetch(e,r,n,i){const s=this.options.fetchPolicy;e.context??={};let a=!1;const o=()=>{a=!0},c=v=>new Jn(_=>{try{return v.subscribe({next(S){a=!0,_.next(S)},error:S=>_.error(S),complete:()=>_.complete()})}finally{a||(m.override=r,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:f,variables:h,meta:{shouldEmit:3,fetchPolicy:s}}))}});let{observable:u,fromLink:d}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:r,query:n,onCacheHit:o,fetchQueryOperator:c,observableQuery:this});const{query:f,variables:h}=this,m={abort:()=>{x.unsubscribe()},query:f,variables:h};this.activeOperations.add(m);let y=r==$t.refetch||r==$t.setVariables;u=u.pipe(i,Vk());const x=u.pipe(Uk({next:v=>{v.source==="newNetworkStatus"||v.kind==="N"&&v.value.loading?m.override=r:delete m.override},finalize:()=>this.activeOperations.delete(m)})).subscribe({next:v=>{const _={};y&&v.kind==="N"&&"loading"in v.value&&!v.value.loading&&(y=!1,_.shouldEmit=1),this.input.next({...v,query:f,variables:h,meta:_})}});return{fromLink:d,subscription:x,observable:u}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{fetchPolicy:r,pollInterval:n}}=this;if(!n||!this.hasObservers()||r==="cache-only"){this.cancelPolling();return}if(e?.interval===n)return;const i=e||(this.pollingInfo={});i.interval=n;const s=()=>{this.pollingInfo&&(!t$(this.networkStatus)&&!this.options.skipPollAttempt?.()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},{newNetworkStatus:$t.poll}).then(a,a):a())},a=()=>{const o=this.pollingInfo;o&&(clearTimeout(o.timeout),o.timeout=setTimeout(s,o.interval))};a()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,r){this.isTornDown=!1;let{newNetworkStatus:n}=r||{};this.queryManager.obsQueries.add(this);const i=n===$t.refetch||n===$t.poll,s=this.variables,a=this.options.fetchPolicy,o=vo(this.options,e||{}),c=i?o:o8(this.options,o),u=this.transformDocument(c.query);this.lastQuery=u,e&&"variables"in e&&(c.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),e&&e.variables&&!_r(e.variables,s)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===a||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=$t.setVariables)));const d=this.networkStatus;n||(n=$t.loading,d!==$t.loading&&e?.variables&&!_r(e.variables,s)&&(n=$t.setVariables),c.fetchPolicy==="standby"&&(n=$t.ready)),c.fetchPolicy==="standby"&&this.cancelPolling(),this.resubscribeCache();const{promise:f,operator:h}=kCe(_=>{switch(_.kind){case"E":throw _.error;case"N":if(_.source!=="newNetworkStatus"&&!_.value.loading)return _.value}},c.fetchPolicy==="standby"?{data:void 0}:void 0),{subscription:m,observable:y,fromLink:x}=this.fetch(c,n,u,h);!i&&(x||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=m);const v=Object.assign(Yse(f.then(_=>ik(this.maskResult(_))).finally(()=>{!this.hasObservers()&&this.activeOperations.size===0&&this.tearDownQuery()})),{retain:()=>{const _=y.subscribe({}),S=()=>_.unsubscribe();return f.then(S,S),v}});return v}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e
70=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const r=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return r===e.data?e:{...e,data:r}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const n=this.queryManager.getDocumentInfo(this.query);if(n.hasClientExports||n.hasForcedResolvers)return}const{dirty:r}=this;if(this.resetNotifications(),r&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!this.activeOperations.size)){const n=this.getCacheDiff();_r(n.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:n.result,dataState:n.complete?"complete":n.result?"partial":"empty",networkStatus:$t.ready,loading:!1,error:void 0,partial:!n.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let r=!1;const{query:n,variables:i}=this,s=()=>{this.activeOperations.delete(a)},a={override:e,abort:()=>{r=!0,s()},query:n,variables:i};return this.activeOperations.add(a),{finalize:s,pushNotification:(o,c)=>{r||this.input.next({...o,query:n,variables:i,meta:{...c}})}}}calculateNetworkStatus(e){return e===$t.streaming?e:Array.from(this.activeOperations.values()).findLast(n=>nv(n,this)&&n.override!==void 0)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e=this.options.fetchPolicy==="cache-only";this.setResult(e?d2:Nm,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,r){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...r}})}operator=JL(e=>{const{query:r,variables:n,meta:i}=e;if(e.source==="setResult")return{query:r,variables:n,result:e.value,meta:i};if(e.kind==="C"||!nv(e,this))return;let s;const a=this.subject.getValue();if(e.source==="cache"){if(s=e.value,s.networkStatus===$t.ready&&s.partial&&(!this.options.returnPartialData||a.result.networkStatus===$t.error)&&this.options.fetchPolicy!=="cache-only")return}else if(e.source==="network")this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),s=e.kind==="E"?{...nv(a,e)?a.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:$t.error,loading:!1}:e.value,e.kind==="E"&&s.dataState==="streaming"&&(s.dataState="complete"),s.error&&(i.shouldEmit=1);else if(e.source==="newNetworkStatus"){const o=nv(a,e)?a.result:this.getInitialResult(i.fetchPolicy),{resetError:c}=e.value,u=c?void 0:o.error,d=u?$t.error:$t.ready;s={...o,error:u,networkStatus:d}}return Xt(s),s.error||delete s.error,s.networkStatus=this.calculateNetworkStatus(s.networkStatus),s.loading=t$(s.networkStatus),s=this.maskResult(s),{query:r,variables:n,result:s,meta:i}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:r}=this.options;e==="cache-and-network"||e==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(n,i){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(n,i):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function nv(t,e){return!!(t&&e&&t.query===e.query&&_r(t.variables,e.variables))}function kCe(t,e){let r=e,n,i;const s=new Promise((o,c)=>{n=o,i=c}),a=Uk({next(o){try{const c=t(o);c!==void 0&&(r=c)}catch(c){i(c)}},finalize:()=>{if(r)n(r);else{const o="The operation was aborted.",c="AbortError";i(typeof DOMException<"u"?new DOMException(o,c):Object.assign(new Error(o),{name:c}))}}});return{promise:s,operator:a}}const l8={},eg=new WeakMap;function h2(t,e){const r=t[e];typeof r=="function"&&(t[e]=function(){return eg.set(t,(eg.get(t)+1)%1e15),r.apply(this,arguments)})}const c8=new WeakMap;class p2{lastRequestId=1;cache;queryManager;id;observableQuery;incremental;constructor(e,r){const n=this.cache=e.cache,i=(c8.get(e)||0)+1;c8.set(e,i),this.id=i+"",this.observableQuery=r,this.queryManager=e,eg.has(n)||(eg.set(n,0),h2(n,"evict"),h2(n,"modify"),h2(n,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,r){const{lastWrite:n}=this;return!(n&&n.dmCount===eg.get(this.cache)&&_r(r,n.variables)&&_r(e.data,n.result.data))}get hasNext(){return this.incremental?this.incremental.hasNext:!1}maybeHandleIncrementalResult(e,r,n){const{incrementalHandler:i}=this.queryManager;return i.isIncrementalResult(r)?(this.incremental||=i.startRequest
70({query:n}),this.incremental.handle(e,r)):r}markQueryResult(e,{document:r,variables:n,errorPolicy:i,cacheWriteBehavior:s}){const a={query:r,variables:n,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const o=s===0,c=o?void 0:this.cache.diff(a);let u=this.maybeHandleIncrementalResult(c?.result,e,r);return o||(m2(u,i)?this.cache.batch({onWatchUpdated:(d,f)=>{d.watcher===this.observableQuery&&(d.lastOwnDiff=f)},update:d=>{if(this.shouldWrite(u,n))d.writeQuery({query:r,data:u.data,variables:n,overwrite:s===1}),this.lastWrite={result:u,variables:n,dmCount:eg.get(this.cache)};else if(c&&c.complete){u={...u,data:c.result};return}const f=d.diff(a);f.complete&&(u={...u,data:f.result})}}):this.lastWrite=void 0),u}markMutationResult(e,r,n=this.cache){const i=[],s=r.cacheWriteBehavior===0;let a=this.maybeHandleIncrementalResult(s?void 0:n.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(r.document).asQuery,variables:r.variables,optimistic:!1,returnPartialData:!0}).result,e,r.document);if(r.errorPolicy==="ignore"&&(a={...a,errors:[]}),Xm(a)&&r.errorPolicy==="none")return Promise.resolve(a);const o=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!s&&m2(a,r.errorPolicy)){i.push({result:a.data,dataId:"ROOT_MUTATION",query:r.document,variables:r.variables});const{updateQueries:u}=r;u&&this.queryManager.getObservableQueries("all").forEach(d=>{const f=d&&d.queryName;if(!f||!Object.hasOwnProperty.call(u,f))return;const h=u[f],{query:m,variables:y}=d,{result:x,complete:v}=d.getCacheDiff({optimistic:!1});if(v&&x){const _=h(x,{mutationResult:o(),queryName:m&&Lg(m)||void 0,queryVariables:y});_&&i.push({result:_,dataId:"ROOT_QUERY",query:m,variables:y})}})}let c=r.refetchQueries;if(typeof c=="function"&&(c=c(o())),i.length>0||(c||"").length>0||r.update||r.onQueryUpdated||r.removeOptimistic){const u=[];if(this.queryManager.refetchQueries({updateCache:d=>{s||i.forEach(h=>d.write(h));const{update:f}=r;if(f){if(!s){const h=d.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(r.document).asQuery,variables:r.variables,optimistic:!1,returnPartialData:!0});h.complete&&(a={...a,data:h.result})}this.hasNext||f(d,a,{context:r.context,variables:r.variables})}!s&&!r.keepRootFields&&!this.hasNext&&d.modify({id:"ROOT_MUTATION",fields(h,{fieldName:m,DELETE:y}){return m==="__typename"?h:y}})},include:c,optimistic:!1,removeOptimistic:r.removeOptimistic,onQueryUpdated:r.onQueryUpdated||null}).forEach(d=>u.push(d)),r.awaitRefetchQueries||r.onQueryUpdated)return Promise.all(u).then(()=>a)}return Promise.resolve(a)}markMutationOptimistic(e,r){const n=typeof e=="function"?e(r.variables,{IGNORE:l8}):e;return n===l8?!1:(this.cache.recordOptimisticTransaction(i=>{try{this.markMutationResult({data:n},r,i)}catch(s){Xt.error(s)}},this.id),!0)}markSubscriptionResult(e,{document:r,variables:n,errorPolicy:i,cacheWriteBehavior:s}){s!==0&&(m2(e,i)&&this.cache.write({query:r,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n}),this.queryManager.broadcastQueries())}}function m2(t,e="none"){const r=e==="ignore"||e==="all";let n=!Xm(t);return!n&&r&&t.data&&(n=!0),n}class TCe{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const r=new Hc(i=>this.cache.transformDocument(i),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const n=e.documentTransform;this.documentTransform=n?r.concat(n).concat(r):r,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(jo(83))}cancelPendingFetches(e){this.fetchCancelFns.forEach(r=>r(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:r,optimisticResponse:n,updateQueries:i,refetchQueries:s=[],awaitRefetchQueries:a=!1,update:o,onQueryUpdated:c,fetchPolicy:u,errorPolicy:d,keepRootFields:f,context:h}){const m=new p2(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:y}=this.getDocumentInfo(e);r=this.getVariables(e,r),y&&(r=await this.localState.getExportedVariables({client:this.client,document:e,variables:r,context:h}));const x=this.mutationStore&&(this.mutationStore[m.id]={mutation:e,variables:r,loading:!0,error:null}),v=n&&m.markMutationOptimistic(n,{document:e,variables:r,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:h,updateQueries:i,update:o,keepRootFields:f});return this.broadcastQueries(),new Promise((_,S)=>{const k={};return this.getObservableFromLink(e,{...h,optimisticResponse:v?n:void 0},r,{},!1).observable.pipe(u8(),Zm(E=>{const T={...E};return jh(m.markMutationResult(T,{document:e,variables:r,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:h,update:o,updateQueries:i,awaitRefetchQueries:a,refetchQueries:s,removeOptimistic:v?m.id:void 0,onQueryUpdated:c,keepRootFields:f}))})).pipe(Ph(E=>{if(Xm(E)&&d==="none")throw new qc(E);return x&&(x.loading=!1,x.error=null),E})).subscribe({next:E=>{if(this.broadcastQueries(),!m.hasNext){const T={data:this.maskOperation({document:e,data:E.data,fetchPolicy:u,cause:k})};Xm(E)&&(T.error=new qc(E)),Object.keys(E.extensions||{}).length&&(T.extensions=E.extensions),_(T)}},error:E=>{if(x&&(x.loading=!1,x.error=E),v&&this.cache.removeOptimistic(m.id),this.broadcastQueries(),d==="ignore")return _({data:void 0});if(d==="all")return _({data:void 0,error:E});S(E)}})})}fetchQuery(e,r){return tf(e.query,al.QUERY),(async()=>Kke(this.fetchObservableWithInfo(e,{networkStatus:r}).observable.pipe(JL(n=>{switch(n.kind){case"E":throw n.error;case"N":if(n.source!=="newNetworkStatus")return ik(n.value)}})),{defaultValue:{data:void 0}}))()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new Hse(Su["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:r}=this;if(!r.has(e)){const i=ku(e),s={hasClientExports:qv(["client","export"],e,!0),hasForcedResolvers:OTe(e),hasNonreactiveDirective:qv(["nonreactive"],e),hasIncrementalDirective:qv(["defer"],e),nonReactiveQuery:CCe(e),clientQuery:qv(["client"],e)?e:null,serverQuery:LTe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:i?.operation,defaultVars:k4(i),asQuery:{...e,definitions:e.definitions.map(a=>a.kind==="OperationDefinition"&&a.operation!=="query"?{...a,operation:"query"}:a)}};r.set(e,s)}const n=r.get(e);if(n.violation)throw n.violation;return n}getVariables(e,r){const n=this.getDocumentInfo(e).defaultVars,i=Object.entries(r??{}).map(([s,a])=>[s,a===void 0?n[s]:a]);return{...n,...Object.fromEntries(i)}}watchQuery(e){tf(e.query,al.QUERY);const r=this.transform(e.query);return e={...e,variables:this.getVariables(r,e.variables)},typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new f2({queryManager:this,options:e,transformedQuery:r})}query(e){const r=this.transform(e.query);return this.fetchQuery({...e,query:r}).then(n=>({...n,data:this.maskOperation({document:r,data:n?.data,fetchPolicy:e.fetchPolicy})}))}requestIdCounter=1;generateRequestId(){return this.requestIdCounter++}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(jo(85)),this.obsQueries.forEac
70h(r=>{r.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const r=new Set,n=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(a=>{if(typeof a=="string")n.set(a,a),i.set(a,!1);else if(RTe(a)){const o=Yh(this.transform(a));n.set(o,Lg(a)),i.set(o,!1)}else vs(a)&&a.query&&s.add(a)}),this.obsQueries.forEach(a=>{const o=Yh(this.transform(a.options.query));if(e==="all"){r.add(a);return}const{queryName:c,options:{fetchPolicy:u}}=a;e==="active"&&u==="standby"||(e==="active"||c&&i.has(c)||o&&i.has(o))&&(r.add(a),c&&i.set(c,!0),o&&i.set(o,!0))}),s.size&&s.forEach(a=>{const o=new f2({queryManager:this,options:{...a,fetchPolicy:"network-only"}});r.add(o)}),r}refetchObservableQueries(e=!1){const r=[];return this.getObservableQueries(e?"all":"active").forEach(n=>{const{fetchPolicy:i}=n.options;(e||i!=="standby")&&i!=="cache-only"&&r.push(n.refetch())}),this.broadcastQueries(),Promise.all(r)}startGraphQLSubscription(e){let{query:r,variables:n}=e;const{fetchPolicy:i,errorPolicy:s="none",context:a={},extensions:o={}}=e;tf(r,al.SUBSCRIPTION),r=this.transform(r),n=this.getVariables(r,n);let c;const u=(this.getDocumentInfo(r).hasClientExports?jh(this.localState.getExportedVariables({client:this.client,document:r,variables:n,context:a})):vh(n)).pipe(Zm(d=>{const{observable:f,restart:h}=this.getObservableFromLink(r,a,d,o),m=new p2(this);return c=h,f.pipe(Ph(y=>{m.markSubscriptionResult(y,{document:r,variables:d,errorPolicy:s,cacheWriteBehavior:i==="no-cache"?0:2});const x={data:y.data??void 0};return Xm(y)?x.error=new qc(y):_Ce(y)&&(x.error=y.extensions[Wk],delete y.extensions[Wk]),y.extensions&&Object.keys(y.extensions).length&&(x.extensions=y.extensions),x.error&&s==="none"&&(x.data=void 0),s==="ignore"&&delete x.error,x}),nk(y=>vh(s==="ignore"?{data:void 0}:{data:void 0,error:y})),Jke(y=>!!(y.data||y.error)))}));return Object.assign(u,{restart:()=>c?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new Df(!1);getObservableFromLink(e,r,n,i,s=r?.queryDeduplication??this.queryDeduplication){let a={};const{serverQuery:o,clientQuery:c,operationType:u,hasIncrementalDirective:d}=this.getDocumentInfo(e),f=Lg(e),h={client:this.client};if(o){const{inFlightLinkObservables:m,link:y}=this;try{let v=function(_){return new Jn(S=>{function k(){return _.subscribe({next:S.next.bind(S),complete:S.complete.bind(S),error:S.error.bind(S)})}let E=k();return a.restart||=()=>{E.unsubscribe(),E=k()},()=>{E.unsubscribe(),a.restart=void 0}})};const x=this.incrementalHandler.prepareRequest({query:o,variables:n,context:{...this.defaultContext,...r,queryDeduplication:s},extensions:i});if(r=x.context,s){const _=Yh(o),S=rf(n);a=m.lookup(_,S),a.observable||(a.observable=e$(y,x,h).pipe(v,eTe(()=>{m.peek(_,S)===a&&m.remove(_,S)}),u===al.SUBSCRIPTION?Vk():rTe({refCount:!0})))}else a.observable=e$(y,x,h).pipe(v)}catch(x){a.observable=Ase(()=>x)}}else a.observable=vh({data:{}});if(c){const{operation:m}=ku(e);Xt(!d,90,m[0].toUpperCase()+m.slice(1),f??"(anonymous)"),a.observable=a.observable.pipe(Zm(y=>jh(this.localState.execute({client:this.client,document:c,remoteResult:y,context:r,variables:n}))))}return{restart:()=>a.restart?.(),observable:a.observable.pipe(nk(m=>{throw m=SCe(m),wCe(m),m}))}}getResultsFromLink(e,{queryInfo:r,cacheWriteBehavior:n,observableQuery:i}){const s=r.lastRequestId=this.generateRequestId(),{errorPolicy:a}=e,o=this.cache.transformForLink(e.query);return this.getObservableFromLink(o,e.context,e.variables).observable.pipe(Ph(c=>{const u=r.markQueryResult(c,{...e,document:o,cacheWriteBehavior:n}),d=Xm(u);if(d&&a==="none")throw r.resetLastWrite(),i?.resetNotifications(),new qc(u);const f={data:u.data,...r.hasNext?{loading:!0,networkStatus:$t.streaming,dataState:"streaming",partial:!0}:{dataState:u.data?"complete":"empty",loading:!1,networkStatus:$t.ready,partial:!u.data}};return d&&(a==="none"&&(f.data=void 0,f.dataState="empty"),a!=="ignore"&&(f.error=new qc(u),f.dataState!=="streaming"&&(f.networkStatus=$t.error))),f}),nk(c=>{if(s>=r.lastRequestId&&a==="none")throw r.resetLastWrite(),i?.resetNotifications(),c;const u={data:void 0,dataState:"empty",loading:!1,networkStatus:$t.ready,partial:!0};return a!=="ignore"&&(u.error=c,u.networkStatus=$t.error),vh(u)}))}fetchObservableWithInfo(e,{networkStatus:r=$t.loading,query:n=e.query,fetchQueryOperator:i=o=>o,onCacheHit:s=()=>{},observableQuery:a}){const o=this.getVariables(n,e.variables),c=this.defaultOptions.watchQuery;let{fetchPolicy:u=c&&c.fetchPolicy||"cache-first",errorPolicy:d=c&&c.errorPolicy||"none",returnPartialData:f=!1,notifyOnNetworkStatusChange:h=!0,context:m={}}=e;this.prioritizeCacheValues&&(u==="network-only"||u==="cache-and-network")&&(u="cache-first");const y=Object.assign({},e,{query:n,variables:o,fetchPolicy:u,errorPolicy:d,returnPartialData:f,notifyOnNetworkStatusChange:h,context:m}),x=new p2(this,a),v=T=>{y.variables=T;const N=u==="no-cache"?0:r===$t.refetch&&y.refetchWritePolicy!=="merge"?1:2,j=this.fetchQueryByPolicy(y,{queryInfo:x,cacheWriteBehavior:N,onCacheHit:s,observableQuery:a});return j.observable=j.observable.pipe(i),y.fetchPolicy!=="standby"&&a?.applyNextFetchPolicy("after-fetch",e),j},_=()=>{this.fetchCancelFns.delete(x.id)};this.fetchCancelFns.set(x.id,T=>{S.next({kind:"E",error:T,source:"network"})});const S=new $y;let k,E;
70if(this.getDocumentInfo(y.query).hasClientExports)k=jh(this.localState.getExportedVariables({client:this.client,document:y.query,variables:y.variables,context:y.context})).pipe(Zm(T=>v(T).observable)),E=!0;else{const T=v(y.variables);E=T.fromLink,k=T.observable}return{observable:new Jn(T=>{T.add(_),k.subscribe(T),S.subscribe(T)}).pipe(Vk()),fromLink:E}}refetchQueries({updateCache:e,include:r,optimistic:n=!1,removeOptimistic:i=n?ese("refetchQueries"):void 0,onQueryUpdated:s}){const a=new Map;r&&this.getObservableQueries(r).forEach(c=>{if(c.options.fetchPolicy==="cache-only")return;const u=c.getCurrentResult();a.set(c,{oq:c,lastDiff:{result:u?.data,complete:!u?.partial}})});const o=new Map;if(e){const c=new Set;this.cache.batch({update:e,optimistic:n&&i||!1,removeOptimistic:i,onWatchUpdated(u,d,f){const h=u.watcher;if(h instanceof f2&&!c.has(h)){if(c.add(h),s){a.delete(h);let m=s(h,d,f);return m===!0&&(m=h.refetch().retain()),m!==!1&&o.set(h,m),m}s!==null&&h.options.fetchPolicy!=="cache-only"&&a.set(h,{oq:h,lastDiff:f,diff:d})}}})}return a.size&&a.forEach(({oq:c,lastDiff:u,diff:d})=>{let f;s&&(d||(d=c.getCacheDiff()),f=s(c,d,u)),(!s||f===!0)&&(f=c.refetch().retain()),f!==!1&&o.set(c,f)}),i&&this.cache.removeOptimistic(i),o}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:r,data:n}=e;return this.dataMasking?cCe(n,r,this.cache):n}maskFragment(e){const{data:r,fragment:n,fragmentName:i}=e;return this.dataMasking?lCe(r,n,this.cache,i):r}fetchQueryByPolicy({query:e,variables:r,fetchPolicy:n,errorPolicy:i,returnPartialData:s,context:a},{cacheWriteBehavior:o,onCacheHit:c,queryInfo:u,observableQuery:d}){const f=()=>this.cache.diff({query:e,variables:r,returnPartialData:!0,optimistic:!0}),h=(y,x)=>{const v=y.result,_=k=>(!y.complete&&!s&&(k=void 0),{data:k,dataState:y.complete?"complete":k?"partial":"empty",loading:t$(x),networkStatus:x,partial:!y.complete}),S=k=>vh({kind:"N",value:_(k),source:"cache"});return(y.complete||s)&&this.getDocumentInfo(e).hasForcedResolvers?(c(),jh(this.localState.execute({client:this.client,document:e,remoteResult:v?{data:v}:void 0,context:a,variables:r,onlyRunForcedResolvers:!0,returnPartialData:!0}).then(k=>({kind:"N",value:_(k.data||void 0),source:"cache"})))):i==="none"&&x===$t.refetch&&y.missing?S(void 0):S(v||void 0)},m=()=>this.getResultsFromLink({query:e,variables:r,context:a,fetchPolicy:n,errorPolicy:i},{cacheWriteBehavior:o,queryInfo:u,observableQuery:d}).pipe(u8(),tTe(),Ph(y=>({...y,source:"network"})));switch(n){default:case"cache-first":{const y=f();return y.complete?{fromLink:!1,observable:h(y,$t.ready)}:s?{fromLink:!0,observable:r2(h(y,$t.loading),m())}:{fromLink:!0,observable:m()}}case"cache-and-network":{const y=f();return y.complete||s?{fromLink:!0,observable:r2(h(y,$t.loading),m())}:{fromLink:!0,observable:m()}}case"cache-only":return{fromLink:!1,observable:r2(h(f(),$t.ready))};case"network-only":return{fromLink:!0,observable:m()};case"no-cache":return{fromLink:!0,observable:m()};case"standby":return{fromLink:!1,observable:Bk}}}}function u8(){let t=!1;return Uk({next(){t=!0},complete(){Xt(t,94)}})}function CCe(t){return cc(t,{FragmentSpread:e=>{if(!e.directives?.some(r=>r.name.value==="unmask"))return{...e,directives:[...e.directives||[],{kind:qe.DIRECTIVE,name:{kind:qe.NAME,value:"nonreactive"}}
70]}}})}class ECe{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:r,documentTransform:n,ssrMode:i=!1,ssrForceFetchDelay:s=0,queryDeduplication:a=!0,defaultOptions:o,defaultContext:c,assumeImmutableResults:u=r.assumeImmutableResults,localState:d,devtools:f,dataMasking:h,link:m,incrementalHandler:y=new WTe}=e;this.link=m,this.cache=r,this.queryDeduplication=a,this.defaultOptions=o||{},this.devtoolsConfig={...f,enabled:f?.enabled??fSe},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=c4,this.queryManager=new TCe({client:this,defaultOptions:this.defaultOptions,defaultContext:c,documentTransform:n,queryDeduplication:a,ssrMode:i,dataMasking:!!h,clientOptions:e,incrementalHandler:y,assumeImmutableResults:u,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:d}),this.prioritizeCacheValues=i||s>0,s&&setTimeout(()=>{this.prioritizeCacheValues=!1},s),this.devtoolsConfig.enabled&&this.connectToDevTools()}connectToDevTools(){if(typeof window>"u")return;const e=window,r=Symbol.for("apollo.devtools");(e[r]=e[r]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop()}watchQuery(e){return this.defaultOptions.watchQuery&&(e=gg(this.defaultOptions.watchQuery,e)),this.queryManager.watchQuery(e)}query(e){return this.defaultOptions.query&&(e=gg(this.defaultOptions.query,e)),this.queryManager.query(e)}mutate(e){const r=gg(vo({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return tf(r.mutation,al.MUTATION),this.queryManager.mutate(r)}subscribe(e){const r={},n=this.queryManager.startGraphQLSubscription(e),i=n.pipe(Ph(s=>({...s,data:this.queryManager.maskOperation({document:e.query,data:s.data,fetchPolicy:e.fetchPolicy,cause:r})})));return Object.assign(i,{restart:n.restart})}readQuery(e,r=!1){return this.cache.readQuery({...e,query:this.transform(e.query)},r)}watchFragment(e){const r=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,r)}).pipe(Ph(n=>n))}readFragment(e,r=!1){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},r)}writeQuery(e){const r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r}writeFragment(e){const r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return e$(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(r=>r!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(r=>r!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach((a,o)=>{n.push(o),i.push(a)});const s=Promise.all(i);return s.queries=n,s.results=i,s.catch(a=>{}),s}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new Hc(zTe);transform(e,r=!1){const n=this.queryManager.transform(e);return r?this.maskedFragmentTransform.transformDocument(n):n}}const{hasOwnProperty:d8}=Object.prototype;function jCe(t){return vs(t)&&"payload"in t}async function*NCe(t){const e=new TextDecoder("utf-8"),i=`\r
71--`+(t.headers?.get("content-type")?.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i)?.findLast(h=>!!h)||"-");let s="";Xt(t.body&&typeof t.body.getReader=="function",60);const o=t.body.getReader();let c=!1,u=!1,d;const f=()=>u&&s[0]=="-"&&s[1]=="-";try{for(;!c;){({value:d,done:c}=await o.read());
71const h=typeof d=="string"?d:e.decode(d),m=s.length-i.length+1;s+=h;let y=s.indexOf(i,m);for(;y>-1&&!f();){u=!0;let x;[x,s]=[s.slice(0,y),s.slice(y+i.length)];const v=x.indexOf(`\r
72\r
73`),S=MCe(x.slice(0,v))["content-type"];if(S&&S.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");const k=x.slice(v);k&&(yield k),y=s.indexOf(i)}if(f())return}throw new Error("premature end of multipart body")}finally{o.cancel()}}async function PCe(t,e){for await(const r of NCe(t)){const n=fae(t,r);if(Object.keys(n).length!=0)if(jCe(n)){if(Object.keys(n).length===1&&n.payload===null)return;let i={...n.payload};"errors"in n&&(i.extensions={...i.extensions,[Wk]:new Yx(n.errors??[])}),e(i)}else e(n)}}function MCe(t){const e={};return t.split(`
74`).forEach(r=>{const n=r.indexOf(":");if(n>-1){const i=r.slice(0,n).trim().toLowerCase(),s=r.slice(n+1).trim();e[i]=s}}),e}function fae(t,e){if(t.status>=300)throw new ME(`Response not successful: Received status code ${t.status}`,{response:t,bodyText:e});try{return JSON.parse(e)}catch(r){throw new AE(r,{response:t,bodyText:e})}}function ACe(t,e){try{return JSON.parse(e)}catch(r){throw new AE(r,{response:t,bodyText:e})}}function DCe(t,e){return t.headers.get("content-type")?.includes("application/graphql-response+json")?ACe(t,e):fae(t,e)}function OCe(t){return e=>e.text().then(r=>{const n=DCe(e,r);if(!Array.isArray(n)&&!d8.call(n,"data")&&!d8.call(n,"errors"))throw new ME(`Server response was malformed for query '${Array.isArray(t)?t.map(i=>i.operationName):t.operationName}'.`,{response:e,bodyText:r});return n})}const RCe={includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},ICe={accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},LCe={method:"POST"},$Ce={http:RCe,headers:ICe,options:LCe},FCe=(t,e)=>e(t);function zCe(t,e,...r){let n={},i={};r.forEach(d=>{n={...n,...d.options,headers:{...n.headers,...d.headers}},d.credentials&&(n.credentials=d.credentials),n.headers.accept=(d.http?.accept||[]).concat(n.headers.accept).join(","),i={...i,...d.http}}),n.headers=BCe(n.headers,i.preserveHeaderCase);const{operationName:s,extensions:a,variables:o,query:c}=t,u={operationName:s,variables:o};return i.includeExtensions&&Object.keys(a||{}).length&&(u.extensions=a),i.includeQuery&&(u.query=e(c,Yh)),{options:n,body:u}}function BCe(t,e){if(!e){const i={};return Object.keys(Object(t)).forEach(s=>{i[s.toLowerCase()]=t[s]}),i}const r={};Object.keys(Object(t)).forEach(i=>{r[i.toLowerCase()]={originalName:i,value:t[i]}});const n={};return Object.keys(r).forEach(i=>{n[r[i].originalName]=r[i].value}),n}const VCe=(t,e)=>{const n=t.getContext().uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function UCe(t,e){const r=[],n=(u,d)=>{r.push(`${u}=${encodeURIComponent(d)}`)};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){let u;try{u=JSON.stringify(e.variables)}catch(d){return{parseError:d}}n("variables",u)}if(e.extensions){let u;try{u=JSON.stringify(e.extensions)}catch(d){return{parseError:d}}n("extensions",u)}let i="",s=t;const a=t.indexOf("#");a!==-1&&(i=t.substr(a),s=t.substr(0,a));const o=s.indexOf("?")===-1?"?":"&";return{newURI:s+o+r.join("&")+i}}const GCe=rl(()=>fetch);function WCe(){}class HCe extends qi{constructor(e={}){let{uri:r="/graphql",fetch:n,print:i=FCe,includeExtensions:s,preserveHeaderCase:a,useGETForQueries:o,includeUnusedVariables:c=!1,...u}=e;const d={http:vo({includeExtensions:s,preserveHeaderCase:a}),options:u.fetchOptions,credentials:u.credentials,headers:u.headers};super(f=>{let h=VCe(f,r);const m=f.getContext(),y={...m.http};QTe(f.query)&&(y.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...y.accept||[]]);const x={http:y,options:m.fetchOptions,credentials:m.credentials,headers:m.headers},{options:v,body:_}=zCe(f,i,$Ce,d,x);_.variables&&!c&&(_.variables=qTe(_.variables,f.query));let S=new AbortController,k=()=>{S=void 0};if(v.signal){const E=v.signal,T=()=>{S?.abort(E.reason)};E.addEventListener("abort",T,{once:!0}),k=()=>{S?.signal.removeEventListener("abort",k),S=void 0,E.removeEventListener("abort",T),k=WCe},S.signal.addEventListener("abort",k,{once:!0})}return v.signal=S.signal,o&&!KTe(f.query)&&(v.method="GET"),new Jn(E=>{if(v.method==="GET"){const{newURI:j,parseError:M}=UCe(h,_);
74if(M)throw M;h=j}else v.body=JSON.stringify(_);const T=n||rl(()=>fetch)||GCe,N=E.next.bind(E);return T(h,v).then(j=>{f.setContext({response:j});const M=j.headers?.get("content-type");return M!==null&&/^multipart\/mixed/i.test(M)?PCe(j,N):OCe(f)(j).then(N)}).then(()=>{k(),E.complete()}).catch(j=>{k(),E.error(j)}),()=>{S&&S.abort()}})})}}class qCe extends qi{constructor(e={}){super((r,n)=>{const i=r.client,s=i.queryManager.clientOptions,a=r.getContext();{const{name:o,version:c,transport:u="headers"}=vo({},s.clientAwareness,e.clientAwareness,a.clientAwareness);u==="headers"&&r.setContext(({headers:d,extensions:f})=>({headers:vo({"apollographql-client-name":o,"apollographql-client-version":c},d)}))}{const{transport:o="extensions"}=vo({},s.enhancedClientAwareness,e.enhancedClientAwareness);o==="extensions"&&(r.extensions=vo({clientLibrary:{name:"@apollo/client",version:i.version}},r.extensions))}return n(r)})}}class YCe extends qi{constructor(e={}){const{left:r,right:n,request:i}=qi.from([new qCe(e),new HCe(e)]);super(i),Object.assign(this,{left:r,right:n})}}var ok=new Map,a$=new Map,hae=!0,Hk=!1;function pae(t){return t.replace(/[\s,]+/g," ").trim()}function KCe(t){return pae(t.source.body.substring(t.start,t.end))}function QCe(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,s=KCe(n.loc),a=a$.get(i);a&&!a.has(s)?hae&&console.warn("Warning: fragment with name "+i+` already exists.
75graphql-tag enforces all fragment names across your application to be unique; read more about
76this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||a$.set(i,a=new Set),a.add(s),e.has(s)||(e.add(s),r.push(n))}else r.push(n)}),yo(yo({},t),{definitions:r})}function ZCe(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var s=n[i];s&&typeof s=="object"&&e.add(s)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function XCe(t){var e=pae(t);if(!ok.has(e)){var r=ZSe(t,{experimentalFragmentVariables:Hk,allowLegacyFragmentVariables:Hk});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");ok.set(e,ZCe(QCe(r)))}return ok.get(e)}function tt(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[s+1]}),XCe(n)}function JCe(){ok.clear(),a$.clear()}function eEe(){hae=!1}function tEe(){Hk=!0}function rEe(){Hk=!1}var iv={gql:tt,resetCaches:JCe,disableFragmentWarnings:eEe,enableExperimentalFragmentVariables:tEe,disableExperimentalFragmentVariables:rEe};(function(t){t.gql=iv.gql,t.resetCaches=iv.resetCaches,t.disableFragmentWarnings=iv.disableFragmentWarnings,t.enableExperimentalFragmentVariables=iv.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=iv.disableExperimentalFragmentVariables})(tt||(tt={}));tt.default=tt;function A4(t,e){const r=b.useRef(void 0);return(!r.current||!_r(r.current.deps,e))&&(r.current={value:t(),deps:e}),r.current.value}let g2;function nEe(){}function iEe(){return g2||(g2=b.createContext(null)),b.useCallback(()=>{const t=console.error;try{return console.error=nEe,b.useContext(g2),!0}catch{return!1}finally{console.error=t}},[])}const sEe=Symbol.for("apollo.hook.wrappers");function aEe(t,e,r){const n=[r.queryManager,t.startsWith("use")?b.useContext(d4()):void 0];let i=e;for(const s of n){const a=s?.[sEe]?.[t];a&&(i=a(i))}return i}const qk=Dse?b.useLayoutEffect:b.useEffect,oEe="useSyncExternalStore",lEe=xf[oEe],cEe=rl(()=>navigator.product)=="ReactNative",uEe=rl(()=>navigator.userAgent.indexOf("jsdom")>=0)||!1,dEe=(Dse||cEe)&&!uEe,D4=lEe||((t,e,r)=>{const n=e(),[{inst:i},s]=b.useState({inst:{value:n,getSnapshot:e}});return dEe?b.useLayoutEffect(()=>{Object.assign(i,{value:n,getSnapshot:e}),y2(i)&&s({inst:i})},[t,n,e]):Object.assign(i,{value:n,getSnapshot:e}),b.useEffect(()=>(y2(i)&&s({inst:i}),t(function(){y2(i)&&s({inst:i})})),[t]),n});function y2({value:t,getSnapshot:e}){try{return t!==e()}catch{return!0}}const fEe=["refetch","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function hEe(t,e){const r=pw(e?.client),n=b.useRef(void 0),i=b.useRef(void 0),s=A4(()=>e,[e]),a=iEe();function o(){return r.watchQuery({...e,query:t,initialFetchPolicy:e?.fetchPolicy,fetchPolicy:"standby"})}const[c,u]=b.useState(r),[d,f]=b.useState(o);c!==r&&(u(r),f(o()));const h=b.useCallback((k,E)=>{const T=i.current?.data;T&&!_r(T,k.data)&&(n.current=T),i.current=k,E()},[]),m=D4(b.useCallback(k=>{const E=d.subscribe(T=>{_r(i.current,T)||h(T,k)});return()=>{E.unsubscribe()}},[d,h]),()=>i.current||f8,()=>f8),y=b.useMemo(()=>{const k={};for(const E of fEe)k[E]=function(...T){return Xt(i.current,29,E),d[E](...T)};return k},[d]);b.useEffect(()=>{const k={query:t,errorPolicy:s?.errorPolicy,refetchWritePolicy:s?.refetchWritePolicy,returnPartialData:s?.returnPartialData,notifyOnNetworkStatusChange:s?.notifyOnNetworkStatusChange,nextFetchPolicy:e?.nextFetchPolicy,skipPollAttempt:e?.skipPollAttempt};d.options.fetchPolicy!=="standby"&&s?.fetchPolicy&&(k.fetchPolicy=s.fetchPolicy),d.applyOptions(k)},[t,d,s,e?.nextFetchPolicy,e?.skipPollAttempt]);const x=b.useCallback((...k)=>{Xt(!a(),30);const[E]=k;let T=d.options.fetchPolicy;return T==="standby"&&(T=d.options.initialFetchPolicy),d.reobserve({fetchPolicy:T,variables:E?.variables,context:E?.context??{}})},[d,a]),v=b.useRef(x);qk(()=>{v.current=x});const _=b.useCallback((...k)=>v.current(...k),[]),S=b.useMemo(()=>{const{partial:k,...E}=m;return{...y,...E,client:r,previousData:n.current,variables:d.variables,observable:d,called:!!i.current}},[r,m,y,d]);return[_,S]}const f8={data:void 0,dataState:"empty",loading:!1,networkStatus:$t.ready,partial:!0};function Zn(t,e){const r=pw(e?.client),[n,i]=b.useState(()=>h8(r)),s=b.useRef({result:n,mutationId:0,isMounted:!0,client:r,mutation:t,options:e});qk(()=>{Object.assign(s.current,{client:r,options:e,mutation:t})});const a=b.useCallback((c={})=>{const{options:u,mutation:d}=s.current,f={...u,mutation:d},h=c.client||s.current.client;!s.current.result.loading&&s.current.isMounted&&i(s.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:h});
76const m=++s.current.mutationId,y=gg(f,c);return Yse(h.mutate(y).then(x=>{const{data:v,error:_}=x,S=c.onError||s.current.options?.onError;if(_&&S&&S(_,y),m===s.current.mutationId){const E={called:!0,loading:!1,data:v,error:_,client:h};s.current.isMounted&&!_r(s.current.result,E)&&i(s.current.result=E)}const k=c.onCompleted||s.current.options?.onCompleted;return _||k?.(x.data,y),x},x=>{if(m===s.current.mutationId&&s.current.isMounted){const _={loading:!1,error:x,data:void 0,called:!0,client:h};_r(s.current.result,_)||i(s.current.result=_)}const v=c.onError||s.current.options?.onError;throw v&&v(x,y),x}))},[]),o=b.useCallback(()=>{if(s.current.isMounted){const c=h8(s.current.client);Object.assign(s.current,{mutationId:0,result:c}),i(c)}},[]);return b.useEffect(()=>{const c=s.current;return c.isMounted=!0,()=>{c.isMounted=!1}},[]),[a,{reset:o,...n}]}function h8(t){return{data:void 0,error:void 0,called:!1,loading:!1,client:t}}const _w=Symbol.for("apollo.skipToken"),sv=Symbol();function ws(t,...[e]){"use no memo";return aEe("useQuery",pEe,pw(typeof e=="object"?e.client:void 0))(t,e)}function pEe(t,e={}){const r=pw(typeof e=="object"?e.client:void 0),{ssr:n}=typeof e=="object"?e:{},i=mEe(t,e,r.defaultOptions.watchQuery);function s(m){const y=r.watchQuery(i);return{client:r,query:t,observable:y,resultData:{current:y.getCurrentResult(),previousData:m?.resultData.current.data,variables:y.variables}}}let[a,o]=b.useState(s);(r!==a.client||t!==a.query)&&o(a=s(a));const{observable:c,resultData:u}=a;gEe(i,c),vEe(u,c,i);const d=yEe(c,u,n),f=b.useMemo(()=>({refetch:c.refetch.bind(c),fetchMore:c.fetchMore.bind(c),updateQuery:c.updateQuery.bind(c),startPolling:c.startPolling.bind(c),stopPolling:c.stopPolling.bind(c),subscribeToMore:c.subscribeToMore.bind(c)}),[c]),h=u.previousData;return b.useMemo(()=>{const{partial:m,...y}=d;return{...y,client:r,observable:c,variables:c.variables,previousData:h,...f}},[d,r,c,h,f])}const mae=Symbol();function mEe(t,e,r){return A4(()=>{if(e===_w){const i=gg(r,{query:t,fetchPolicy:"standby"});return i[mae]=!0,i}const n=gg(r,{...e,query:t});return e.skip&&(n.initialFetchPolicy=e.initialFetchPolicy||e.fetchPolicy,n.fetchPolicy="standby"),n},[t,e,r])}function gEe(t,e){"use no memo";t.fetchPolicy||(t.fetchPolicy=e.options.initialFetchPolicy)}function yEe(t,e,r){"use no memo";return D4(b.useCallback(n=>{const i=t.pipe(x4(Mke)).subscribe(s=>{const a=e.current;_r(a,s)&&_r(e.variables,t.variables)||(e.variables=t.variables,a.data&&!_r(a.data,s.data)&&(e.previousData=a.data),e.current=s,n())});return()=>{setTimeout(()=>i.unsubscribe())}},[t,e]),()=>e.current,()=>r===!1?ws.ssrDisabledResult:e.current)}function vEe(t,e,r){"use no memo";if(e[sv]&&!_r(e[sv],r)){e[sv][mae]&&!r.initialFetchPolicy&&(r.initialFetchPolicy=r.fetchPolicy),xEe(e[sv],r)?e.reobserve(r):e.applyOptions(r);const n=e.getCurrentResult();_r(n.data,t.current.data)||(t.previousData=t.current.data||t.previousData),t.current=n,t.variables=e.variables}e[sv]=r}function xEe(t,e){return t.query!==e.query||!_r(t.variables,e.variables)||t.fetchPolicy!==e.fetchPolicy&&(e.fetchPolicy==="standby"||t.fetchPolicy==="standby")}ws.ssrDisabledResult={loading:!0,data:void 0,dataState:"empty",error:void 0,networkStatus:$t.loading,partial:!0};function bEe(t,...[e={}]){const r=pw(e.client),{skip:n,fetchPolicy:i,errorPolicy:s,shouldResubscribe:a,context:o,extensions:c,ignoreResults:u}=e,d=A4(()=>e.variables,[e.variables]),f=()=>wEe(r,t,d,i,s,o,c);let[h,m]=b.useState(e.skip?null:f);const y=b.useRef(f);qk(()=>{y.current=f}),n?h&&m(h=null):(!h||(r!==h.__.client||t!==h.__.query||i!==h.__.fetchPolicy||s!==h.__.errorPolicy||!_r(d,h.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&m(h=f());const x=b.useRef(e);b.useEffect(()=>{x.current=e});const v=!n&&!u,_=b.useMemo(()=>({loading:v,error:void 0,data:void 0}),[v]),S=b.useRef(u);qk(()=>{S.current=u});const k=D4(b.useCallback(T=>{if(!h)return()=>{};let N=!1;const j=h.__.client,M=h.subscribe({next(O){if(N)return;const R={loading:!1,data:O.data,error:O.error};h.__.setResult(R),S.current||T(),R.error?x.current.onError?.(R.error):x.current.onData&&x.current.onData({client:j,data:R})},complete(){h.__.completed=!0,!N&&x.current.onComplete&&x.current.onComplete()}});return()=>{N=!0,setTimeout(()=>M.unsubscribe())}},[h]),()=>h&&!n&&!u?h.__.result:_,()=>_),E=b.useCallback(()=>{Xt(!x.current.skip,33),h?.__.completed?m(y.current()):h?.restart()},[x,y,h]);return b.useMemo(()=>({...k,restart:E}),[k,E])}function wEe(t,e,r,n,i,s,a){const o={query:e,variables:r,fetchPolicy:n,errorPolicy:i,context:s,extensions:a},c={...o,client:t,completed:!1,result:{loading:!0,data:void 0,error:void 0},setResult(u){c.result=u}};return Object.assign(t.subscribe(o),{__:c})}var A_={},v2={exports:{}},Js={},x2={exports:{}},b2={};/**
77 * @license React
78 * scheduler.production.min.js
79 *
80 * Copyright (c) Facebook, Inc. and its affiliates.
81 *
82 * This source code is licensed under the MIT license found in the
83 * LICENSE file in the root directory of this source tree.
84 */var p8;function _Ee(){return p8||(p8=1,(function(t){function e(L,W){var K=L.length;L.push(W);e:for(;0<K;){var q=K-1>>>1,H=L[q];if(0<i(H,W))L[q]=W,L[K]=H,K=q;else break e}}function r(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var W=L[0],K=L.pop();if(K!==W){L[0]=K;e:for(var q=0,H=L.length,Y=H>>>1;q<Y;){var J=2*(q+1)-1,re=L[J],me=J+1,oe=L[me];if(0>i(re,K))me<H&&0>i(oe,re)?(L[q]=oe,L[me]=K,q=me):(L[q]=re,L[J]=K,q=J);else if(me<H&&0>i(oe,K))L[q]=oe,L[me]=K,q=me;else break e}}return W}function i(L,W){var K=L.sortIndex-W.sortIndex;return K!==0?K:L.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,f=null,h=3,m=!1,y=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(L){for(var W=r(u);W!==null;){if(W.callback===null)n(u);else if(W.startTime<=L)n(u),W.sortIndex=W.expirationTime,e(c,W);else break;W=r(u)}}
vendor: 17,845 bytes, lines 84-96
84function E(L){if(x=!1,k(L),!y)if(r(c)!==null)y=!0,U(T);else{var W=r(u);W!==null&&z(E,W.startTime-L)}}function T(L,W){y=!1,x&&(x=!1,_(M),M=-1),m=!0;var K=h;try{for(k(W),f=r(c);f!==null&&(!(f.expirationTime>W)||L&&!I());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var H=q(f.expirationTime<=W);W=t.unstable_now(),typeof H=="function"?f.callback=H:f===r(c)&&n(c),k(W)}else n(c);f=r(c)}if(f!==null)var Y=!0;else{var J=r(u);J!==null&&z(E,J.startTime-W),Y=!1}return Y}finally{f=null,h=K,m=!1}}var N=!1,j=null,M=-1,O=5,R=-1;function I(){return!(t.unstable_now()-R<O)}function B(){if(j!==null){var L=t.unstable_now();R=L;var W=!0;try{W=j(!0,L)}finally{W?F():(N=!1,j=null)}}else N=!1}var F;if(typeof S=="function")F=function(){S(B)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,$=V.port2;V.port1.onmessage=B,F=function(){$.postMessage(null)}}else F=function(){v(B,0)};function U(L){j=L,N||(N=!0,F())}function z(L,W){M=v(function(){L(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_continueExecution=function(){y||m||(y=!0,U(T))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(L){switch(h){case 1:case 2:case 3:var W=3;break;default:W=h}var K=h;h=W;try{return L()}finally{h=K}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,W){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=h;h=L;try{return W()}finally{h=K}},t.unstable_scheduleCallback=function(L,W,K){var q=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?q+K:q):K=q,L){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=K+H,L={id:d++,callback:W,priorityLevel:L,startTime:K,expirationTime:H,sortIndex:-1},K>q?(L.sortIndex=K,e(u,L),r(c)===null&&L===r(u)&&(x?(_(M),M=-1):x=!0,z(E,K-q))):(L.sortIndex=H,e(c,L),y||m||(y=!0,U(T))),L},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(L){var W=h;return function(){var K=h;h=W;try{return L.apply(this,arguments)}finally{h=K}}}})(b2)),b2}var m8;function SEe(){return m8||(m8=1,x2.exports=_Ee()),x2.exports}/**
85 * @license React
86 * react-dom.production.min.js
87 *
88 * Copyright (c) Facebook, Inc. and its affiliates.
89 *
90 * This source code is licensed under the MIT license found in the
91 * LICENSE file in the root directory of this source tree.
92 */var g8;function kEe(){if(g8)return Js;g8=1;var t=bE(),e=SEe();function r(p){for(var g="https://reactjs.org/docs/error-decoder.html?invariant="+p,w=1;w<arguments.length;w++)g+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(p,g){a(p,g),a(p+"Capture",g)}function a(p,g){for(i[p]=g,p=0;p<g.length;p++)n.add(g[p])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function h(p){return c.call(f,p)?!0:c.call(d,p)?!1:u.test(p)?f[p]=!0:(d[p]=!0,!1)}function m(p,g,w,C){if(w!==null&&w.type===0)return!1;switch(typeof g){case"function":case"symbol":return!0;case"boolean":return C?!1:w!==null?!w.acceptsBooleans:(p=p.toLowerCase().slice(0,5),p!=="data-"&&p!=="aria-");default:return!1}}function y(p,g,w,C){if(g===null||typeof g>"u"||m(p,g,w,C))return!0;if(C)return!1;if(w!==null)switch(w.type){case 3:return!g;case 4:return g===!1;case 5:return isNaN(g);case 6:return isNaN(g)||1>g}return!1}function x(p,g,w,C,A,D,G){this.acceptsBooleans=g===2||g===3||g===4,this.attributeName=C,this.attributeNamespace=A,this.mustUseProperty=w,this.propertyName=p,this.type=g,this.sanitizeURL=D,this.removeEmptyString=G}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(p){v[p]=new x(p,0,!1,p,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(p){var g=p[0];v[g]=new x(g,1,!1,p[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(p){v[p]=new x(p,2,!1,p.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(p){v[p]=new x(p,2,!1,p,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(p){v[p]=new x(p,3,!1,p.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(p){v[p]=new x(p,3,!0,p,null,!1,!1)}),["capture","download"].forEach(function(p){v[p]=new x(p,4,!1,p,null,!1,!1)}),["cols","rows","size","span"].forEach(function(p){v[p]=new x(p,6,!1,p,null,!1,!1)}),["rowSpan","start"].forEach(function(p){v[p]=new x(p,5,!1,p.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function S(p){return p[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(p){var g=p.replace(_,S);v[g]=new x(g,1,!1,p,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(p){var g=p.replace(_,S);v[g]=new x(g,1,!1,p,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(p){var g=p.replace(_,S);v[g]=new x(g,1,!1,p,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(p){v[p]=new x(p,1,!1,p.toLowerCase(),null,!1,!1)}),v.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(p){v[p]=new x(p,1,!1,p.toLowerCase(),null,!0,!0)});function k(p,g,w,C){var A=v.hasOwnProperty(g)?v[g]:null;(A!==null?A.type!==0:C||!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(y(g,w,A,C)&&(w=null),C||A===null?h(g)&&(w===null?p.removeAttribute(g):p.setAttribute(g,""+w)):A.mustUseProperty?p[A.propertyName]=w===null?A.type===3?!1:"":w:(g=A.attributeName,C=A.attributeNamespace,w===null?p.removeAttribute(g):(A=A.type,w=A===3||A===4&&w===!0?"":""+w,C?p.setAttributeNS(C,g,w):p.setAttribute(g,w))))}var E=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),N=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),I=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),L=Symbol.iterator;function W(p){return p===null||typeof p!="object"?null:(p=L&&p[L]||p["@@iterator"],typeof p=="function"?p:null)}var K=Object.assign,q;function H(p){if(q===void 0)try{throw Error()}catch(w){var g=w.stack.trim().match(/\n( *(at )?)/);q=g&&g[1]||""}return`
93`+q+p}var Y=!1;function J(p,g){if(!p||Y)return"";Y=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(g)if(g=function(){throw Error()},Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(pe){var C=pe}Reflect.construct(p,[],g)}else{try{g.call()}catch(pe){C=pe}p.call(g.prototype)}else{try{throw Error()}catch(pe){C=pe}p()}}catch(pe){if(pe&&C&&typeof pe.stack=="string"){for(var A=pe.stack.split(`
94`),D=C.stack.split(`
95`),G=A.length-1,Z=D.length-1;1<=G&&0<=Z&&A[G]!==D[Z];)Z--;for(;1<=G&&0<=Z;G--,Z--)if(A[G]!==D[Z]){if(G!==1||Z!==1)do if(G--,Z--,0>Z||A[G]!==D[Z]){var te=`
96`+A[G].replace(" at new "," at ");return p.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",p.displayName)),te}while(1<=G&&0<=Z);break}}}finally{Y=!1,Error.prepareStackTrace=w}return(p=p?p.displayName||p.name:"")?H(p):""}function re(p){switch(p.tag){case 5:return H(p.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return p=J(p.type,!1),p;case 11:return p=J(p.type.render,!1),p;case 1:return p=J(p.type,!0),p;default:return""}}function me(p){if(p==null)return null;if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case j:return"Fragment";case N:return"Portal";case O:return"Profiler";case M:return"StrictMode";case F:return"Suspense";case V:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case I:return(p.displayName||"Context")+".Consumer";case R:return(p._context.displayName||"Context")+".Provider";case B:var g=p.render;return p=p.displayName,p||(p=g.displayName||g.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case $:return g=p.displayName||null,g!==null?g:me(p.type)||"Memo";case U:g=p._payload,p=p._init;try{return me(p(g))}catch{}}return null}function oe(p){var g=p.type;switch(p.tag){case 24:return"Cache";case 9:return(g.displayName||"Context")+".Consumer";case 10:return(g._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return p=g.render,p=p.displayName||p.name||"",g.displayName||(p!==""?"ForwardRef("+p+")":"ForwardRef");case 7:return"Fragment";case 5:return g;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(g);case 8:return g===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g}return null}function ge(p){switch(typeof p){case"boolean":case"number":case"string":case"undefined":return p;case"object":return p;default:return""}}function le(p){var g=p.type;return(p=p.nodeName)&&p.toLowerCase()==="input"&&(g==="checkbox"||g==="radio")}function Se(p){var g=le(p)?"checked":"value",w=Object.getOwnPropertyDescriptor(p.constructor.prototype,g),C=""+p[g];if(!p.hasOwnProperty(g)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var A=w.get,D=w.set;return Object.defineProperty(p,g,{configurable:!0,get:function(){return A.call(this)},set:function(G){C=""+G,D.call(this,G)}}),Object.defineProperty(p,g,{enumerable:w.enumerable}),{getValue:function(){return C},setValue:function(G){C=""+G},stopTracking:function(){p._valueTracker=null,delete p[g]}}}}function Ce(p){p._valueTracker||(p._valueTracker=Se(p))}function he(p){if(!p)return!1;var g=p._valueTracker;if(!g)return!0;var w=g.getValue(),C="";return p&&(C=le(p)?p.checked?"true":"false":p.value),p=C,p!==w?(g.setValue(p),!0):!1}function Ct(p){if(p=p||(typeof document<"u"?document:void 0),typeof p>"u")return null;try{return p.activeElement||p.body}catch{return p.body}}function De(p,g){var w=g.checked;return K({},g,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:w??p._wrapperState.initialChecked})}function It(p,g){var w=g.defaultValue==null?"":g.defaultValue,C=g.checked!=null?g.checked:g.defaultChecked;w=ge(g.value!=null?g.value:w),p._wrapperState={initialChecked:C,initialValue:w,controlled:g.type==="checkbox"||g.type==="radio"?g.checked!=null:g.value!=null}}function Yt(p,g){g=g.checked,g!=null&&k(p,"checked",g,!1)}function Qt(p,g){Yt(p,g);var w=ge(g.value),C=g.type;if(w!=null)C==="number"?(w===0&&p.value===""||p.value!=w)&&(p.value=""+w):p.value!==""+w&&(p.value=""+w);else if(C==="submit"||C==="reset"){p.removeAttribute("value");return}g.hasOwnProperty("value")?gr(p,g.type,w):g.hasOwnProperty("defaultValue")&&gr(p,g.type,ge(g.defaultValue)),g.checked==null&&g.defaultChecked!=null&&(p.defaultChecked=!!g.defaultChecked)}function Qr(p,g,w){if(g.hasOwnProperty("value")||g.hasOwnProperty("defaultValue")){var C=g.type;if(!(C!=="submit"&&C!=="reset"||g.value!==void 0&&g.value!==null))return;g=""+p._wrapperState.initialValue,w||g===p.value||(p.value=g),p.defaultValue=g}w=p.name,w!==""&&(p.name=""),p.defaultChecked=!!p._wrapperState.initialChecked,w!==""&&(p.name=w)}function gr(p,g,w){(g!=="number"||Ct(p.ownerDocument)!==p)&&(w==null?p.defaultValue=""+p._wrapperState.initialValue:p.defaultValue!==""+w&&(p.defaultValue=""+w))}var X=Array.isArray;function ae(p,g,w,C){if(p=p.options,g){g={};for(var A=0;A<w.length;A++)g["$"+w[A]]=!0;for(w=0;w<p.length;w++)A=g.hasOwnProperty("$"+p[w].value),p[w].selected!==A&&(p[w].selected=A),A&&C&&(p[w].defaultSelected=!0)}else{for(w=""+ge(w),g=null,A=0;A<p.length;A++){if(p[A].value===w){p[A].selected=!0,C&&(p[A].defaultSelected=!0);return}g!==null||p[A].disabled||(g=p[A])}g!==null&&(g.selected=!0)}}function de(p,g){if(g.dangerouslySetInnerHTML!=null)throw Error(r(91));return K({},g,{value:void 0,defaultValue:void 0,children:""+p._wrapperState.initialValue})}function Ee(p,g){var w=g.value;if(w==null){if(w=g.children,g=g.defaultValue,w!=null){if(g!=null)throw Error(r(92));if(X(w)){if(1<w.length)throw Error(r(93));w=w[0]}g=w}g==null&&(g=""),w=g}p._wrapperState={initialValue:ge(w)}}function Me(p,g){var w=ge(g.value),C=ge(g.defaultValue);w!=null&&(w=""+w,w!==p.value&&(p.value=w),g.defaultValue==null&&p.defaultValue!==w&&(p.defaultValue=w)),C!=null&&(p.defaultValue=""+C)}function Te(p){var g=p.textContent;g===p._wrapperState.initialValue&&g!==""&&g!==null&&(p.value=g)}function Qe(p){switch(p){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Nt(p,g){return p==null||p==="http://www.w3.org/1999/xhtml"?Qe(g):p==="http://www.w3.org/2000/svg"&&g==="foreignObject"?"http://www.w3.org/1999/xhtml":p}var jt,jr=(function(p){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(g,w,C,A){MSApp.execUnsafeLocalFunction(function(){return p(g,w,C,A)})}:p})(function(p,g){if(p.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in p)p.innerHTML=g;else{for(jt=jt||document.createElement("div"),jt.innerHTML="<svg>"+g.valueOf().toString()+"</svg>",g=jt.firstChild;p.firstChild;)p.removeChild(p.firstChild);for(;g.firstChild;)p.appendChild(g.firstChild)}});function Vr(p,g){if(g){var w=p.firstChild;if(w&&w===p.lastChild&&w.nodeType===3){w.nodeValue=g;return}}p.textContent=g}var Dr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$r=["Webkit","ms","Moz","O"];Object.keys(Dr).forEach(function(p){$r.forEach(function(g){g=g+p.charAt(0).toUpperCase()+p.substring(1),Dr[g]=Dr[p]})});function Ur(p,g,w){return g==null||typeof g=="boolean"||g===""?"":w||typeof g!="number"||g===0||Dr.hasOwnProperty(p)&&Dr[p]?(""+g).trim():g+"px"}function Ni(p,g){p=p.style;for(var w in g)if(g.hasOwnProperty(w)){var C=w.indexOf("--")===0,A=Ur(w,g[w],C);w==="float"&&(w="cssFloat"),C?p.setProperty(w,A):p[w]=A}}var zi=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Nn(p,g){if(g){if(zi[p]&&(g.children!=null||g.dangerouslySetInnerHTML!=null))throw Error(r(137,p));if(g.dangerouslySetInnerHTML!=null){if(g.children!=null)throw Error(r(60));if(typeof g.dangerouslySetInnerHTML!="object"||!("__html"in g.dangerouslySetInnerHTML))throw Error(r(61))}if(g.style!=null&&typeof g.style!="object")throw Error(r(62))}}function or(p,g){if(p.indexOf("-")===-1)return typeof g.is=="str
96ing";switch(p){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xt=null;function $e(p){return p=p.target||p.srcElement||window,p.correspondingUseElement&&(p=p.correspondingUseElement),p.nodeType===3?p.parentNode:p}var We=null,rt=null,bt=null;function ut(p){if(p=z0(p)){if(typeof We!="function")throw Error(r(280));var g=p.stateNode;g&&(g=G1(g),We(p.stateNode,p.type,g))}}function it(p){rt?bt?bt.push(p):bt=[p]:rt=p}function Wt(){if(rt){var p=rt,g=bt;if(bt=rt=null,ut(p),g)for(p=0;p<g.length;p++)ut(g[p])}}function cr(p,g){return p(g)}function Jt(){}var pn=!1;function yr(p,g,w){if(pn)return p(g,w);pn=!0;try{return cr(p,g,w)}finally{pn=!1,(rt!==null||bt!==null)&&(Jt(),Wt())}}function Q(p,g){var w=p.stateNode;if(w===null)return null;var C=G1(w);if(C===null)return null;w=C[g];e:switch(g){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(C=!C.disabled)||(p=p.type,C=!(p==="button"||p==="input"||p==="select"||p==="textarea")),p=!C;break e;default:p=!1}if(p)return null;if(w&&typeof w!="function")throw Error(r(231,g,typeof w));return w}var ie=!1;if(o)try{var ue={};Object.defineProperty(ue,"passive",{get:function(){ie=!0}}),window.addEventListener("test",ue,ue),window.removeEventListener("test",ue,ue)}catch{ie=!1}function je(p,g,w,C,A,D,G,Z,te){var pe=Array.prototype.slice.call(arguments,3);try{g.apply(w,pe)}catch(Ae){this.onError(Ae)}}var Ue=!1,Xe=null,mt=!1,se=null,be={onError:function(p){Ue=!0,Xe=p}};function ve(p,g,w,C,A,D,G,Z,te){Ue=!1,Xe=null,je.apply(be,arguments)}function Re(p,g,w,C,A,D,G,Z,te){if(ve.apply(this,arguments),Ue){if(Ue){var pe=Xe;Ue=!1,Xe=null}else throw Error(r(198));mt||(mt=!0,se=pe)}}function Oe(p){var g=p,w=p;if(p.alternate)for(;g.return;)g=g.return;else{p=g;do g=p,(g.flags&4098)!==0&&(w=g.return),p=g.return;while(p)}return g.tag===3?w:null}function lt(p){if(p.tag===13){var g=p.memoizedState;if(g===null&&(p=p.alternate,p!==null&&(g=p.memoizedState)),g!==null)return g.dehydrated}return null}function er(p){if(Oe(p)!==p)throw Error(r(188))}function nn(p){var g=p.alternate;if(!g){if(g=Oe(p),g===null)throw Error(r(188));return g!==p?null:p}for(var w=p,C=g;;){var A=w.return;if(A===null)break;var D=A.alternate;if(D===null){if(C=A.return,C!==null){w=C;continue}break}if(A.child===D.child){for(D=A.child;D;){if(D===w)return er(A),p;if(D===C)return er(A),g;D=D.sibling}throw Error(r(188))}if(w.return!==C.return)w=A,C=D;else{for(var G=!1,Z=A.child;Z;){if(Z===w){G=!0,w=A,C=D;break}if(Z===C){G=!0,C=A,w=D;break}Z=Z.sibling}if(!G){for(Z=D.child;Z;){if(Z===w){G=!0,w=D,C=A;break}if(Z===C){G=!0,C=D,w=A;break}Z=Z.sibling}if(!G)throw Error(r(189))}}if(w.alternate!==C)throw Error(r(190))}if(w.tag!==3)throw Error(r(188));return w.stateNode.current===w?p:g}function Pn(p){return p=nn(p),p!==null?Zr(p):null}function Zr(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){var g=Zr(p);if(g!==null)return g;p=p.sibling}return null}var Fr=e.unstable_scheduleCallback,Sl=e.unstable_cancelCallback,Jf=e.unstable_shouldYield,kl=e.unstable_requestPaint,br=e.unstable_now,w0=e.unstable_getCurrentPriorityLevel,jc=e.unstable_ImmediatePriority,Tl=e.unstable_UserBlockingPriority,Nc=e.unstable_NormalPriority,sm=e.unstable_LowPriority,dr=e.unstable_IdlePriority,Un=null,Bi=null;function Pc(p){if(Bi&&typeof Bi.onCommitFiberRoot=="function")try{Bi.onCommitFiberRoot(Un,p,void 0,(p.current.flags&128)===128)}catch{}}var Tr=Math.clz32?Math.clz32:gP,am=Math.log,T1=Math.LN2;function gP(p){return p>>>=0,p===0?32:31-(am(p)/T1|0)|0}var C1=64,E1=4194304;function _0(p){switch(p&-p){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function j1(p,g){var w=p.pendingLanes;if(w===0)return 0;var C=0,A=p.suspendedLanes,D=p.pingedLanes,G=w&268435455;if(G!==0){var Z=G&~A;Z!==0?C=_0(Z):(D&=G,D!==0&&(C=_0(D)))}else G=w&~A,G!==0?C=_0(G):D!==0&&(C=_0(D));if(C===0)return 0;if(g!==0&&g!==C&&(g&A)===0&&(A=C&-C,D=g&-g,A>=D||A===16&&(D&4194240)!==0))return g;if((C&4)!==0&&(C|=w&16),g=p.entangledLanes,g!==0)for(p=p.entanglements,g&=C;0<g;)w=31-Tr(g),A=1<<w,C|=p[w],g&=~A;return C}function E1e(p,g){switch(p){case 1:case 2:case 4:return g+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return g+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function j1e(p,g){for(var w=p.suspendedLanes,C=p.pingedLanes,A=p.expirationTimes,D=p.pendingLanes;0<D;){var G=31-Tr(D),Z=1<<G,te=A[G];
vendor: 26,495 bytes, lines 96-97
96te===-1?((Z&w)===0||(Z&C)!==0)&&(A[G]=E1e(Z,g)):te<=g&&(p.expiredLanes|=Z),D&=~Z}}function yP(p){return p=p.pendingLanes&-1073741825,p!==0?p:p&1073741824?1073741824:0}function B6(){var p=C1;return C1<<=1,(C1&4194240)===0&&(C1=64),p}function vP(p){for(var g=[],w=0;31>w;w++)g.push(p);return g}function S0(p,g,w){p.pendingLanes|=g,g!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,g=31-Tr(g),p[g]=w}function N1e(p,g){var w=p.pendingLanes&~g;p.pendingLanes=g,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=g,p.mutableReadLanes&=g,p.entangledLanes&=g,g=p.entanglements;var C=p.eventTimes;for(p=p.expirationTimes;0<w;){var A=31-Tr(w),D=1<<A;g[A]=0,C[A]=-1,p[A]=-1,w&=~D}}function xP(p,g){var w=p.entangledLanes|=g;for(p=p.entanglements;w;){var C=31-Tr(w),A=1<<C;A&g|p[C]&g&&(p[C]|=g),w&=~A}}var Or=0;function V6(p){return p&=-p,1<p?4<p?(p&268435455)!==0?16:536870912:4:1}var U6,bP,G6,W6,H6,wP=!1,N1=[],nd=null,id=null,sd=null,k0=new Map,T0=new Map,ad=[],P1e="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function q6(p,g){switch(p){case"focusin":case"focusout":nd=null;break;case"dragenter":case"dragleave":id=null;break;case"mouseover":case"mouseout":sd=null;break;case"pointerover":case"pointerout":k0.delete(g.pointerId);break;case"gotpointercapture":case"lostpointercapture":T0.delete(g.pointerId)}}function C0(p,g,w,C,A,D){return p===null||p.nativeEvent!==D?(p={blockedOn:g,domEventName:w,eventSystemFlags:C,nativeEvent:D,targetContainers:[A]},g!==null&&(g=z0(g),g!==null&&bP(g)),p):(p.eventSystemFlags|=C,g=p.targetContainers,A!==null&&g.indexOf(A)===-1&&g.push(A),p)}function M1e(p,g,w,C,A){switch(g){case"focusin":return nd=C0(nd,p,g,w,C,A),!0;case"dragenter":return id=C0(id,p,g,w,C,A),!0;case"mouseover":return sd=C0(sd,p,g,w,C,A),!0;case"pointerover":var D=A.pointerId;return k0.set(D,C0(k0.get(D)||null,p,g,w,C,A)),!0;case"gotpointercapture":return D=A.pointerId,T0.set(D,C0(T0.get(D)||null,p,g,w,C,A)),!0}return!1}function Y6(p){var g=eh(p.target);if(g!==null){var w=Oe(g);if(w!==null){if(g=w.tag,g===13){if(g=lt(w),g!==null){p.blockedOn=g,H6(p.priority,function(){G6(w)});return}}else if(g===3&&w.stateNode.current.memoizedState.isDehydrated){p.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}p.blockedOn=null}function P1(p){if(p.blockedOn!==null)return!1;for(var g=p.targetContainers;0<g.length;){var w=SP(p.domEventName,p.eventSystemFlags,g[0],p.nativeEvent);if(w===null){w=p.nativeEvent;var C=new w.constructor(w.type,w);xt=C,w.target.dispatchEvent(C),xt=null}else return g=z0(w),g!==null&&bP(g),p.blockedOn=w,!1;g.shift()}return!0}function K6(p,g,w){P1(p)&&w.delete(g)}function A1e(){wP=!1,nd!==null&&P1(nd)&&(nd=null),id!==null&&P1(id)&&(id=null),sd!==null&&P1(sd)&&(sd=null),k0.forEach(K6),T0.forEach(K6)}function E0(p,g){p.blockedOn===g&&(p.blockedOn=null,wP||(wP=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,A1e)))}function j0(p){function g(A){return E0(A,p)}if(0<N1.length){E0(N1[0],p);for(var w=1;w<N1.length;w++){var C=N1[w];C.blockedOn===p&&(C.blockedOn=null)}}for(nd!==null&&E0(nd,p),id!==null&&E0(id,p),sd!==null&&E0(sd,p),k0.forEach(g),T0.forEach(g),w=0;w<ad.length;w++)C=ad[w],C.blockedOn===p&&(C.blockedOn=null);for(;0<ad.length&&(w=ad[0],w.blockedOn===null);)Y6(w),w.blockedOn===null&&ad.shift()}var om=E.ReactCurrentBatchConfig,M1=!0;function D1e(p,g,w,C){var A=Or,D=om.transition;om.transition=null;try{Or=1,_P(p,g,w,C)}finally{Or=A,om.transition=D}}function O1e(p,g,w,C){var A=Or,D=om.transition;om.transition=null;try{Or=4,_P(p,g,w,C)}finally{Or=A,om.transition=D}}function _P(p,g,w,C){if(M1){var A=SP(p,g,w,C);if(A===null)zP(p,g,C,A1,w),q6(p,C);else if(M1e(A,p,g,w,C))C.stopPropagation();else if(q6(p,C),g&4&&-1<P1e.indexOf(p)){for(;A!==null;){var D=z0(A);if(D!==null&&U6(D),D=SP(p,g,w,C),D===null&&zP(p,g,C,A1,w),D===A)break;A=D}A!==null&&C.stopPropagation()}else zP(p,g,C,null,w)}}var A1=null;function SP(p,g,w,C){if(A1=null,p=$e(C),p=eh(p),p!==null)if(g=Oe(p),g===null)p=null;else if(w=g.tag,w===13){if(p=lt(g),p!==null)return p;p=null}else if(w===3){if(g.stateNode.current.memoizedState.isDehydrated)return g.tag===3?g.stateNode.containerInfo:null;p=null}else g!==p&&(p=null);return A1=p,null}function Q6(p){switch(p){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(w0()){case jc:return 1;case Tl:return 4;case Nc:case sm:return 16;case dr:return 536870912;default:return 16}default:return 16}}var od=null,kP=null,D1=null;function Z6(){if(D1)return D1;var p,g=kP,w=g.length,C,A="value"in od?od.value:od.textContent,D=A.length;for(p=0;p<w&&g[p]===A[p];p++);var G=w-p;for(C=1;C<=G&&g[w-C]===A[D-C];C++);return D1=A.slice(p,1<C?1-C:void 0)}function O1(p){var g=p.keyCode;return"charCode"in p?(p=p.charCode,p===0&&g===13&&(p=13)):p=g,p===10&&(p=13),32<=p||p===13?p:0}function R1(){return!0}function X6(){return!1}function xa(p){function g(w,C,A,D,G){this._reactName=w,this._targetInst=A,this.type=C,this.nativeEvent=D,this.target=G,this.currentTarget=null;for(var Z in p)p.hasOwnProperty(Z)&&(w=p[Z],this[Z]=w?w(D):D[Z]);return this.isDefaultPrevented=(D.defaultPrevented!=null?D.defaultPrevented:D.returnValue===!1)?R1:X6,this.isPropagationStopped=X6,this}return K(g.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=R1)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=R1)},persist:function(){},isPersistent:R1}),g}var lm={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(p){return p.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},TP=xa(lm),N0=K({},lm,{view:0,detail:0}),R1e=xa(N0),CP,EP,P0,I1=K({},N0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:NP,button:0,buttons:0,relatedTarget:function(p){return p.relatedTarget===void 0?p.fromElement===p.srcElement?p.toElement:p.fromElement:p.relatedTarget},movementX:function(p){return"movementX"in p?p.movementX:(p!==P0&&(P0&&p.type==="mousemove"?(CP=p.screenX-P0.screenX,EP=p.screenY-P0.screenY):EP=CP=0,P0=p),CP)},movementY:function(p){return"movementY"in p?p.movementY:EP}}),J6=xa(I1),I1e=K({},I1,{dataTransfer:0}),L1e=xa(I1e),$1e=K({},N0,{relatedTarget:0}),jP=xa($1e),F1e=K({},lm,{animationName:0,elapsedTime:0,pseudoElement:0}),z1e=xa(F1e),B1e=K({},lm,{clipboardData:function(p){return"clipboardData"in p?p.clipboardData:window.clipboardData}}),V1e=xa(B1e),U1e=K({},lm,{data:0}),eG=xa(U1e),G1e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W1e={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},H1e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q1e(p){var g=this.nativeEvent;return g.getModifierState?g.getModifierState(p):(p=H1e[p])?!!g[p]:!1}function NP(){return q1e}var Y1e=K({},N0,{key:function(p){if(p.key){var g=G1e[p.key]||p.key;if(g!=="Unidentified")return g}return p.type==="keypress"?(p=O1(p),p===13?"Enter":String.fromCharCode(p)):p.type==="keydown"||p.type==="keyup"?W1e[p.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:NP,charCode:function(p){return p.type==="keypress"?O1(p):0},keyCode:function(p){return p.type==="keydown"||p.type==="keyup"?p.keyCode:0},which:function(p){return p.type==="keypress"?O1(p):p.type==="keydown"||p.type==="keyup"?p.keyCode:0}}),K1e=xa(Y1e),Q1e=K({},I1,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tG=xa(Q1e),Z1e=K({},N0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:NP}),X1e=xa(Z1e),J1e=K({},lm,{propertyName:0,elapsedTime:0,pseudoElement:0}),e_e=xa(J1e),t_e=K({},I1,{deltaX:function(p){return"deltaX"in p?p.deltaX:"wheelDeltaX"in p?-p.wheelDeltaX:0},deltaY:function(p){return"deltaY"in p?p.deltaY:"wheelDeltaY"in p?-p.wheelDeltaY:"wheelDelta"in p?-p.wheelDelta:0},deltaZ:0,deltaMode:0}),r_e=xa(t_e),n_e=[9,13,27,32],PP=o&&"CompositionEvent"in window,M0=null;o&&"documentMode"in document&&(M0=document.documentMode);var i_e=o&&"TextEvent"in window&&!M0,rG=o&&(!PP||M0&&8<M0&&11>=M0),nG=" ",iG=!1;function sG(p,g){switch(p){case"keyup":return n_e.indexOf(g.keyCode)!==-1;case"keydown":return g.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aG(p){return p=p.detail,typeof p=="object"&&"data"in p?p.data:null}var cm=!1;function s_e(p,g){switch(p){case"compositionend":return aG(g);case"keypress":return g.which!==32?null:(iG=!0,nG);case"textInput":return p=g.data,p===nG&&iG?null:p;default:return null}}function a_e(p,g){if(cm)return p==="compositionend"||!PP&&sG(p,g)?(p=Z6(),D1=kP=od=null,cm=!1,p):null;switch(p){case"paste":return null;case"keypress":if(!(g.ctrlKey||g.altKey||g.metaKey)||g.ctrlKey&&g.altKey){if(g.char&&1<g.char.length)return g.char;if(g.which)return String.fromCharCode(g.which)}return null;case"compositionend":return rG&&g.locale!=="ko"?null:g.data;default:return null}}var o_e={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function oG(p){var g=p&&p.nodeName&&p.nodeName.toLowerCase();return g==="input"?!!o_e[p.type]:g==="textarea"}function lG(p,g,w,C){it(C),g=B1(g,"onChange"),0<g.length&&(w=new TP("onChange","change",null,w,C),p.push({event:w,listeners:g}))}var A0=null,D0=null;function l_e(p){CG(p,0)}function L1(p){var g=pm(p);if(he(g))return p}function c_e(p,g){if(p==="change")return g}var cG=!1;if(o){var MP;if(o){var AP="oninput"in document;if(!AP){var uG=document.createElement("div");uG.setAttribute("oninput","return;"),AP=typeof uG.oninput=="function"}MP=AP}else MP=!1;cG=MP&&(!document.documentMode||9<document.documentMode)}function dG(){A0&&(A0.detachEvent("onpropertychange",fG),D0=A0=null)}function fG(p){if(p.propertyName==="value"&&L1(D0)){var g=[];lG(g,D0,p,$e(p)),yr(l_e,g)}}function u_e(p,g,w){p==="focusin"?(dG(),A0=g,D0=w,A0.attachEvent("onpropertychange",fG)):p==="focusout"&&dG()}function d_e(p){if(p==="selectionchange"||p==="keyup"||p==="keydown")return L1(D0)}function f_e(p,g){if(p==="click")return L1(g)}function h_e(p,g){if(p==="input"||p==="change")return L1(g)}function p_e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var Go=typeof Object.is=="function"?Object.is:p_e;function O0(p,g){if(Go(p,g))return!0;if(typeof p!="object"||p===null||typeof g!="object"||g===null)return!1;var w=Object.keys(p),C=Object.keys(g);if(w.length!==C.length)return!1;for(C=0;C<w.length;C++){var A=w[C];if(!c.call(g,A)||!Go(p[A],g[A]))return!1}return!0}function hG(p){for(;p&&p.firstChild;)p=p.firstChild;return p}function pG(p,g){var w=hG(p);p=0;for(var C;w;){if(w.nodeType===3){if(C=p+w.textContent.length,p<=g&&C>=g)return{node:w,offset:g-p};p=C}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=hG(w)}}function mG(p,g){return p&&g?p===g?!0:p&&p.nodeType===3?!1:g&&g.nodeType===3?mG(p,g.parentNode):"contains"in p?p.contains(g):p.compareDocumentPosition?!!(p.compareDocumentPosition(g)&16):!1:!1}function gG(){for(var p=window,g=Ct();g instanceof p.HTMLIFrameElement;){try{var w=typeof g.contentWindow.location.href=="string"}catch{w=!1}if(w)p=g.contentWindow;else break;g=Ct(p.document)}return g}function DP(p){var g=p&&p.nodeName&&p.nodeName.toLowerCase();return g&&(g==="input"&&(p.type==="text"||p.type==="search"||p.type==="tel"||p.type==="url"||p.type==="password")||g==="textarea"||p.contentEditable==="true")}function m_e(p){var g=gG(),w=p.focusedElem,C=p.selectionRange;if(g!==w&&w&&w.ownerDocument&&mG(w.ownerDocument.documentElement,w)){if(C!==null&&DP(w)){if(g=C.start,p=C.end,p===void 0&&(p=g),"selectionStart"in w)w.selectionStart=g,w.selectionEnd=Math.min(p,w.value.length);else if(p=(g=w.ownerDocument||document)&&g.defaultView||window,p.getSelection){p=p.getSelection();var A=w.textContent.length,D=Math.min(C.start,A);C=C.end===void 0?D:Math.min(C.end,A),!p.extend&&D>C&&(A=C,C=D,D=A),A=pG(w,D);var G=pG(w,C);A&&G&&(p.rangeCount!==1||p.anchorNode!==A.node||p.anchorOffset!==A.offset||p.focusNode!==G.node||p.focusOffset!==G.offset)&&(g=g.createRange(),g.setStart(A.node,A.offset),p.removeAllRanges(),D>C?(p.addRange(g),p.extend(G.node,G.offset)):(g.setEnd(G.node,G.offset),p.addRange(g)))}}for(g=[],p=w;p=p.parentNode;)p.nodeType===1&&g.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<g.length;w++)p=g[w],p.element.scrollLeft=p.left,p.element.scrollTop=p.top}}var g_e=o&&"documentMode"in document&&11>=document.documentMode,um=null,OP=null,R0=null,RP=!1;function yG(p,g,w){var C=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;RP||um==null||um!==Ct(C)||(C=um,"selectionStart"in C&&DP(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),R0&&O0(R0,C)||(R0=C,C=B1(OP,"onSelect"),0<C.length&&(g=new TP("onSelect","select",null,g,w),p.push({event:g,listeners:C}),g.target=um)))}function $1(p,g){var w={};return w[p.toLowerCase()]=g.toLowerCase(),w["Webkit"+p]="webkit"+g,w["Moz"+p]="moz"+g,w}var dm={animationend:$1("Animation","AnimationEnd"),animationiteration:$1("Animation","AnimationIteration"),animationstart:$1("Animation","AnimationStart"),transitionend:$1("Transition","TransitionEnd")},IP={},vG={};o&&(vG=document.createElement("div").style,"AnimationEvent"in window||(delete dm.animationend.animation,delete dm.animationiteration.animation,delete dm.animationstart.animation),"TransitionEvent"in window||delete dm.transitionend.transition);function F1(p){if(IP[p])return IP[p];if(!dm[p])return p;var g=dm[p],w;for(w in g)if(g.hasOwnProperty(w)&&w in vG)return IP[p]=g[w];return p}var xG=F1("animationend"),bG=F1("animationiteration"),wG=F1("animationstart"),_G=F1("transitionend"),SG=new Map,kG="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ld(p,g){SG.set(p,g),s(g,[p])}for(var LP=0;LP<kG.length;LP++){var $P=kG[LP],y_e=$P.toLowerCase(),v_e=$P[0].toUpperCase()+$P.slice(1);ld(y_e,"on"+v_e)}ld(xG,"onAnimationEnd"),ld(bG,"onAnimationIteration"),ld(wG,"onAnimationStart"),ld("dblclick","onDoubleClick"),ld("focusin","onFocus"),ld("focusout","onBlur"),ld(_G,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var I0="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),x_e=new Set("cancel close invalid load scroll toggle".split(" ").concat(I0));function TG(p,g,w){var C=p.type||"unknown-event";p.currentTarget=w,Re(C,g,void 0,p),p.currentTarget=null}function CG(p,g){g=(g&4)!==0;for(var w=0;w<p.length;w++){var C=p[w],A=C.event;C=C.listeners;e:{var D=void 0;if(g)for(var G=C.length-1;0<=G;G--){var Z=C[G],te=Z.instance,pe=Z.currentTarget;if(Z=Z.listener,te!==D&&A.isPropagationStopped())break e;TG(A,Z,pe),D=te}else for(G=0;G<C.length;G++){if(Z=C[G],te=Z.instance,pe=Z.currentTarget,Z=Z.listener,te!==D&&A.isPropagationStopped())break e;TG(A,Z,pe),D=te}}}if(mt)throw p=se,mt=!1,se=null,p}function sn(p,g){var w=g[HP];w===void 0&&(w=g[HP]=new Set);var C=p+"__bubble";w.has(C)||(EG(g,p,2,!1),w.add(C))}function FP(p,g,w){var C=0;g&&(C|=4),EG(w,p,C,g)}var z1="_reactListening"+Math.random().toString(36).slice(2);function L0(p){if(!p[z1]){p[z1]=!0,n.forEach(function(w){w!=="selectionchange"&&(x_e.has(w)||FP(w,!1,p),FP(w,!0,p))});var g=p.nodeType===9?p:p.ownerDocument;g===null||g[z1]||(g[z1]=!0,FP("selectionchange",!1,g))}}function EG(p,g,w,C){switch(Q6(g)){case 1:var A=D1e;break;case 4:A=O1e;break;default:A=_P}w=A.bind(null,g,w,p),A=void 0,!ie||g!=="touchstart"&&g!=="touchmove"&&g!=="wheel"||(A=!0),C?A!==void 0?p.addEventListener(g,w,{capture:!0,passive:A}):p.addEventListener(g,w,!0):A!==void 0?p.addEventListener(g,w,{passive:A}):p.addEventListener(g,w,!1)}function zP(p,g,w,C,A){var D=C;if((g&1)===0&&(g&2)===0&&C!==null)e:for(;;){if(C===null)return;var G=C.tag;if(G===3||G===4){var Z=C.stateNode.containerInfo;if(Z===A||Z.nodeType===8&&Z.parentNode===A)break;if(G===4)for(G=C.return;G!==null;){var te=G.tag;if((te===3||te===4)&&(te=G.stateNode.containerInfo,te===A||te.nodeType===8&&te.parentNode===A))return;G=G.return}for(;Z!==null;){if(G=eh(Z),G===null)return;if(te=G.tag,te===5||te===6){C=D=G;continue e}Z=Z.parentNode}}C=C.return}yr(function(){var pe=D,Ae=$e(w),Ie=[];e:{var Ne=SG.get(p);if(Ne!==void 0){var et=TP,dt=p;switch(p){case"keypress":if(O1(w)===0)break e;case"keydown":case"keyup":et=K1e;break;case"focusin":dt="focus",et=jP;break;case"focusout":dt="blur",et=jP;break;case"beforeblur":case"afterblur":et=jP;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":et=J6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":et=L1e;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":et=X1e;break;case xG:case bG:case wG:et=z1e;break;case _G:et=e_e;break;case"scroll":et=R1e;break;case"wheel":et=r_e;break;case"copy":case"cut":case"paste":et=V1e;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":et=tG}var yt=(g&4)!==0,Gn=!yt&&p==="scroll",ce=yt?Ne!==null?Ne+"Capture":null:Ne;yt=[];for(var ne=pe,fe;ne!==null;){fe=ne;var ze=fe.stateNode;if(fe.tag===5&&ze!==null&&(fe=ze,ce!==null&&(ze=Q(ne,ce),ze!=null&&yt.push($0(ne,ze,fe)))),Gn)break;ne=ne.return}0<yt.length&&(Ne=new et(Ne,dt,null,w,Ae),Ie.push({event:Ne,listeners:yt}))}}if((g&7)===0){e:{if(Ne=p==="mouseover"||p==="pointerover",et=p==="mouseout"||p==="pointerout",Ne&&w!==xt&&(dt=w.relatedTarget||w.fromElement)&&(eh(dt)||dt[Mc]))break e;if((et||Ne)&&(Ne=Ae.window===Ae?Ae:(Ne=Ae.ownerDocument)?Ne.defaultView||Ne.parentWindow:window,et?(dt=w.relatedTarget||w.toElement,et=pe,dt=dt?eh(dt):null,dt!==null&&(Gn=Oe(dt),dt!==Gn||dt.tag!==5&&dt.tag!==6)&&(dt=null)):(et=null,dt=pe),et!==dt)){if(yt=J6,ze="onMouseLeave",ce="onMouseEnter",ne="mouse",(p==="pointerout"||p==="pointerover")&&(yt=tG,ze="onPointerLeave",ce="onPointerEnter",ne="pointer"),Gn=et==null?Ne:pm(et),fe=dt==null?Ne:pm(dt),Ne=new yt(ze,ne+"leave",et,w,Ae),Ne.target=Gn,Ne.relatedTarget=fe,ze=null,eh(Ae)===pe&&(yt=new yt(ce,ne+"enter",dt,w,Ae),yt.target=fe,yt.relatedTarget=Gn,ze=yt),Gn=ze,et&&dt)t:{for(yt=et,ce=dt,ne=0,fe=yt;fe;fe=fm(fe))ne++;for(fe=0,ze=ce;ze;ze=fm(ze))fe++;for(;0<ne-fe;)yt=fm(yt),ne--;for(;0<fe-ne;)ce=fm(ce),fe--;for(;ne--;){if(yt===ce||ce!==null&&yt===ce.alternate)break t;yt=fm(yt),ce=fm(ce)}yt=null}else yt=null;et!==null&&jG(Ie,Ne,et,yt,!1),dt!==null&&Gn!==null&&jG(Ie,Gn,dt,yt,!0)}}e:{if(Ne=pe?pm(pe):window,et=Ne.nodeName&&Ne.nodeName.toLowerCase(),et==="select"||et==="input"&&Ne.type==="file")var wt=c_e;else if(oG(Ne))if(cG)wt=h_e;else{wt=d_e;var Pt=u_e}else(et=Ne.nodeName)&&et.toLowerCase()==="input"&&(Ne.type==="checkbox"||Ne.type==="radio")&&(wt=f_e);if(wt&&(wt=wt(p,pe))){lG(Ie,wt,w,Ae);break e}Pt&&Pt(p,Ne,pe),p==="focusout"&&(Pt=Ne._wrapperState)&&Pt.controlled&&Ne.type==="number"&&gr(Ne,"number",Ne.value)}switch(Pt=pe?pm(pe):window,p){case"focusin":(oG(Pt)||Pt.contentEditable==="true")&&(um=Pt,OP=pe,R0=null);break;case"focusout":R0=OP=um=null;break;case"mousedown":RP=!0;break;case"contextmenu":case"mouseup":case"dragend":RP=!1,yG(Ie,w,Ae);break;case"selectionchange":if(g_e)break;case"keydown":case"keyup":yG(Ie,w,Ae)}var Mt;if(PP)e:{switch(p){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else cm?sG(p,w)&&(zt="onCompositionEnd"):p==="keydown"&&w.keyCode===229&&(zt="onCompositionStart");zt&&(rG&&w.locale!=="ko"&&(cm||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&cm&&(Mt=Z6()):(od=Ae,kP="value"in od?od.value:od.textContent,cm=!0)),Pt=B1(pe,zt),0<Pt.length&&(zt=new eG(zt,p,null,w,Ae),Ie.push({event:zt,listeners:Pt}),Mt?zt.data=Mt:(Mt=aG(w),Mt!==null&&(zt.data=Mt)))),(Mt=i_e?s_e(p,w):a_e(p,w))&&(pe=B1(pe,"onBeforeInput"),0<pe.length&&(Ae=new eG("onBeforeInput","beforeinput",null,w,Ae),Ie.push({event:Ae,listeners:pe}),Ae.data=Mt))}CG(Ie,g)})}function $0(p,g,w){return{instance:p,listener:g,currentTarget:w}}function B1(p,g){for(var w=g+"Capture",C=[];p!==null;){var A=p,D=A.stateNode;A.tag===5&&D!==null&&(A=D,D=Q(p,w),D!=null&&C.unshift($0(p,D,A)),D=Q(p,g),D!=null&&C.push($0(p,D,A))),p=p.return}return C}function fm(p){if(p===null)return null;do p=p.return;while(p&&p.tag!==5);return p||null}function jG(p,g,w,C,A){for(var D=g._reactName,G=[];w!==null&&w!==C;){var Z=w,te=Z.alternate,pe=Z.stateNode;if(te!==null&&te===C)break;Z.tag===5&&pe!==null&&(Z=pe,A?(te=Q(w,D),te!=null&&G.unshift($0(w,te,Z))):A||(te=Q(w,D),te!=null&&G.push($0(w,te,Z)))),w=w.return}G.length!==0&&p.push({event:g,listeners:G})}var b_e=/\r\n?/g,w_e=/\u0000|\uFFFD/g;function NG(p){return(typeof p=="string"?p:""+p).replace(b_e,`
97`).replace(w_e,"")}function V1(p,g,w){if(g=NG(g),NG(p)!==g&&w)throw Error(r(425))}function U1(){}var BP=null,VP=null;function UP(p,g){return p==="textarea"||p==="noscript"||typeof g.children=="string"||typeof g.children=="number"||typeof g.dangerouslySetInnerHTML=="object"&&g.dangerouslySetInnerHTML!==null&&g.dangerouslySetInnerHTML.__html!=null}var GP=typeof setTimeout=="function"?setTimeout:void 0,__e=typeof clearTimeout=="function"?clearTimeout:void 0,PG=typeof Promise=="function"?Promise:void 0,S_e=typeof queueMicrotask=="function"?queueMicrotask:typeof PG<"u"?function(p){return PG.resolve(null).then(p).catch(k_e)}:GP;function k_e(p){setTimeout(function(){throw p})}function WP(p,g){var w=g,C=0;do{var A=w.nextSibling;if(p.removeChild(w),A&&A.nodeType===8)if(w=A.data,w==="/$"){if(C===0){p.removeChild(A),j0(g);return}C--}else w!=="$"&&w!=="$?"&&w!=="$!"||C++;w=A}while(w);j0(g)}function cd(p){for(;p!=null;p=p.nextSibling){var g=p.nodeType;if(g===1||g===3)break;if(g===8){if(g=p.data,g==="$"||g==="$!"||g==="$?")break;if(g==="/$")return null}}return p}function MG(p){p=p.previousSibling;for(var g=0;p;){if(p.nodeType===8){var w=p.data;if(w==="$"||w==="$!"||w==="$?"){if(g===0)return p;g--}else w==="/$"&&g++}p=p.previousSibling}return null}var hm=Math.random().toString(36).slice(2),Cl="__reactFiber$"+hm,F0="__reactProps$"+hm,Mc="__reactContainer$"+hm,HP="__reactEvents$"+hm,T_e="__reactListeners$"+hm,C_e="__reactHandles$"+hm;function eh(p){var g=p[Cl];if(g)return g;for(var w=p.parentNode;w;){if(g=w[Mc]||w[Cl]){if(w=g.alternate,g.child!==null||w!==null&&w.child!==null)for(p=MG(p);p!==null;){if(w=p[Cl])return w;p=MG(p)}return g}p=w,w=p.parentNode}return null}function z0(p){return p=p[Cl]||p[Mc],!p||p.tag!==5&&p.tag!==6&&p.tag!==13&&p.tag!==3?null:p}function pm(p){if(p.tag===5||p.tag===6)return p.stateNode;throw Error(r(33))}function G1(p){return p[F0]||null}var qP=[],mm=-1;function ud(p){return{current:p}}function an(p){0>mm||(p.current=qP[mm],qP[mm]=null,mm--)}function Xr(p,g){mm++,qP[mm]=p.current,p.current=g}var dd={},ss=ud(dd),Ys=ud(!1),th=dd;function gm(p,g){var w=p.type.contextTypes;if(!w)return dd;
vendor: 4,866 bytes, line 97
97var C=p.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===g)return C.__reactInternalMemoizedMaskedChildContext;var A={},D;for(D in w)A[D]=g[D];return C&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=g,p.__reactInternalMemoizedMaskedChildContext=A),A}function Ks(p){return p=p.childContextTypes,p!=null}function W1(){an(Ys),an(ss)}function AG(p,g,w){if(ss.current!==dd)throw Error(r(168));Xr(ss,g),Xr(Ys,w)}function DG(p,g,w){var C=p.stateNode;if(g=g.childContextTypes,typeof C.getChildContext!="function")return w;C=C.getChildContext();for(var A in C)if(!(A in g))throw Error(r(108,oe(p)||"Unknown",A));return K({},w,C)}function H1(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||dd,th=ss.current,Xr(ss,p),Xr(Ys,Ys.current),!0}function OG(p,g,w){var C=p.stateNode;if(!C)throw Error(r(169));w?(p=DG(p,g,th),C.__reactInternalMemoizedMergedChildContext=p,an(Ys),an(ss),Xr(ss,p)):an(Ys),Xr(Ys,w)}var Ac=null,q1=!1,YP=!1;function RG(p){Ac===null?Ac=[p]:Ac.push(p)}function E_e(p){q1=!0,RG(p)}function fd(){if(!YP&&Ac!==null){YP=!0;var p=0,g=Or;try{var w=Ac;for(Or=1;p<w.length;p++){var C=w[p];do C=C(!0);while(C!==null)}Ac=null,q1=!1}catch(A){throw Ac!==null&&(Ac=Ac.slice(p+1)),Fr(jc,fd),A}finally{Or=g,YP=!1}}return null}var ym=[],vm=0,Y1=null,K1=0,Ya=[],Ka=0,rh=null,Dc=1,Oc="";function nh(p,g){ym[vm++]=K1,ym[vm++]=Y1,Y1=p,K1=g}function IG(p,g,w){Ya[Ka++]=Dc,Ya[Ka++]=Oc,Ya[Ka++]=rh,rh=p;var C=Dc;p=Oc;var A=32-Tr(C)-1;C&=~(1<<A),w+=1;var D=32-Tr(g)+A;if(30<D){var G=A-A%5;D=(C&(1<<G)-1).toString(32),C>>=G,A-=G,Dc=1<<32-Tr(g)+A|w<<A|C,Oc=D+p}else Dc=1<<D|w<<A|C,Oc=p}function KP(p){p.return!==null&&(nh(p,1),IG(p,1,0))}function QP(p){for(;p===Y1;)Y1=ym[--vm],ym[vm]=null,K1=ym[--vm],ym[vm]=null;for(;p===rh;)rh=Ya[--Ka],Ya[Ka]=null,Oc=Ya[--Ka],Ya[Ka]=null,Dc=Ya[--Ka],Ya[Ka]=null}var ba=null,wa=null,mn=!1,Wo=null;function LG(p,g){var w=Ja(5,null,null,0);w.elementType="DELETED",w.stateNode=g,w.return=p,g=p.deletions,g===null?(p.deletions=[w],p.flags|=16):g.push(w)}function $G(p,g){switch(p.tag){case 5:var w=p.type;return g=g.nodeType!==1||w.toLowerCase()!==g.nodeName.toLowerCase()?null:g,g!==null?(p.stateNode=g,ba=p,wa=cd(g.firstChild),!0):!1;case 6:return g=p.pendingProps===""||g.nodeType!==3?null:g,g!==null?(p.stateNode=g,ba=p,wa=null,!0):!1;case 13:return g=g.nodeType!==8?null:g,g!==null?(w=rh!==null?{id:Dc,overflow:Oc}:null,p.memoizedState={dehydrated:g,treeContext:w,retryLane:1073741824},w=Ja(18,null,null,0),w.stateNode=g,w.return=p,p.child=w,ba=p,wa=null,!0):!1;default:return!1}}function ZP(p){return(p.mode&1)!==0&&(p.flags&128)===0}function XP(p){if(mn){var g=wa;if(g){var w=g;if(!$G(p,g)){if(ZP(p))throw Error(r(418));g=cd(w.nextSibling);var C=ba;g&&$G(p,g)?LG(C,w):(p.flags=p.flags&-4097|2,mn=!1,ba=p)}}else{if(ZP(p))throw Error(r(418));p.flags=p.flags&-4097|2,mn=!1,ba=p}}}function FG(p){for(p=p.return;p!==null&&p.tag!==5&&p.tag!==3&&p.tag!==13;)p=p.return;ba=p}function Q1(p){if(p!==ba)return!1;if(!mn)return FG(p),mn=!0,!1;var g;if((g=p.tag!==3)&&!(g=p.tag!==5)&&(g=p.type,g=g!=="head"&&g!=="body"&&!UP(p.type,p.memoizedProps)),g&&(g=wa)){if(ZP(p))throw zG(),Error(r(418));for(;g;)LG(p,g),g=cd(g.nextSibling)}if(FG(p),p.tag===13){if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));e:{for(p=p.nextSibling,g=0;p;){if(p.nodeType===8){var w=p.data;if(w==="/$"){if(g===0){wa=cd(p.nextSibling);break e}g--}else w!=="$"&&w!=="$!"&&w!=="$?"||g++}p=p.nextSibling}wa=null}}else wa=ba?cd(p.stateNode.nextSibling):null;return!0}function zG(){for(var p=wa;p;)p=cd(p.nextSibling)}function xm(){wa=ba=null,mn=!1}function JP(p){Wo===null?Wo=[p]:Wo.push(p)}var j_e=E.ReactCurrentBatchConfig;function B0(p,g,w){if(p=w.ref,p!==null&&typeof p!="function"&&typeof p!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(r(309));var C=w.stateNode}if(!C)throw Error(r(147,p));var A=C,D=""+p;return g!==null&&g.ref!==null&&typeof g.ref=="function"&&g.ref._stringRef===D?g.ref:(g=function(G){var Z=A.refs;G===null?delete Z[D]:Z[D]=G},g._stringRef=D,g)}if(typeof p!="string")throw Error(r(284));if(!w._owner)throw Error(r(290,p))}return p}function Z1(p,g){throw p=Object.prototype.toString.call(g),Error(r(31,p==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":p))}function BG(p){var g=p._init;return g(p._payload)}function VG(p){function g(ce,ne){if(p){var fe=ce.deletions;fe===null?(ce.deletions=[ne],ce.flags|=16):fe.push(ne)}}function w(ce,ne){if(!p)return null;for(;ne!==null;)g(ce,ne),ne=ne.sibling;return null}function C(ce,ne){for(ce=new Map;ne!==null;)ne.key!==null?ce.set(ne.key,ne):ce.set(ne.index,ne),ne=ne.sibling;return ce}function A(ce,ne){return ce=bd(ce,ne),ce.index=0,ce.sibling=null,ce}function D(ce,ne,fe){return ce.index=fe,p?(fe=ce.alternate,fe!==null?(fe=fe.index,fe<ne?(ce.flags|=2,ne):fe):(ce.flags|=2,ne)):(ce.flags|=1048576,ne)}
vendor: 9,416 bytes, line 97
97function G(ce){return p&&ce.alternate===null&&(ce.flags|=2),ce}function Z(ce,ne,fe,ze){return ne===null||ne.tag!==6?(ne=GM(fe,ce.mode,ze),ne.return=ce,ne):(ne=A(ne,fe),ne.return=ce,ne)}function te(ce,ne,fe,ze){var wt=fe.type;return wt===j?Ae(ce,ne,fe.props.children,ze,fe.key):ne!==null&&(ne.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===U&&BG(wt)===ne.type)?(ze=A(ne,fe.props),ze.ref=B0(ce,ne,fe),ze.return=ce,ze):(ze=w_(fe.type,fe.key,fe.props,null,ce.mode,ze),ze.ref=B0(ce,ne,fe),ze.return=ce,ze)}function pe(ce,ne,fe,ze){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==fe.containerInfo||ne.stateNode.implementation!==fe.implementation?(ne=WM(fe,ce.mode,ze),ne.return=ce,ne):(ne=A(ne,fe.children||[]),ne.return=ce,ne)}function Ae(ce,ne,fe,ze,wt){return ne===null||ne.tag!==7?(ne=dh(fe,ce.mode,ze,wt),ne.return=ce,ne):(ne=A(ne,fe),ne.return=ce,ne)}function Ie(ce,ne,fe){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=GM(""+ne,ce.mode,fe),ne.return=ce,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return fe=w_(ne.type,ne.key,ne.props,null,ce.mode,fe),fe.ref=B0(ce,null,ne),fe.return=ce,fe;case N:return ne=WM(ne,ce.mode,fe),ne.return=ce,ne;case U:var ze=ne._init;return Ie(ce,ze(ne._payload),fe)}if(X(ne)||W(ne))return ne=dh(ne,ce.mode,fe,null),ne.return=ce,ne;Z1(ce,ne)}return null}function Ne(ce,ne,fe,ze){var wt=ne!==null?ne.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return wt!==null?null:Z(ce,ne,""+fe,ze);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case T:return fe.key===wt?te(ce,ne,fe,ze):null;case N:return fe.key===wt?pe(ce,ne,fe,ze):null;case U:return wt=fe._init,Ne(ce,ne,wt(fe._payload),ze)}if(X(fe)||W(fe))return wt!==null?null:Ae(ce,ne,fe,ze,null);Z1(ce,fe)}return null}function et(ce,ne,fe,ze,wt){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return ce=ce.get(fe)||null,Z(ne,ce,""+ze,wt);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case T:return ce=ce.get(ze.key===null?fe:ze.key)||null,te(ne,ce,ze,wt);case N:return ce=ce.get(ze.key===null?fe:ze.key)||null,pe(ne,ce,ze,wt);case U:var Pt=ze._init;return et(ce,ne,fe,Pt(ze._payload),wt)}if(X(ze)||W(ze))return ce=ce.get(fe)||null,Ae(ne,ce,ze,wt,null);Z1(ne,ze)}return null}function dt(ce,ne,fe,ze){for(var wt=null,Pt=null,Mt=ne,zt=ne=0,Ai=null;Mt!==null&&zt<fe.length;zt++){Mt.index>zt?(Ai=Mt,Mt=null):Ai=Mt.sibling;var wr=Ne(ce,Mt,fe[zt],ze);if(wr===null){Mt===null&&(Mt=Ai);break}p&&Mt&&wr.alternate===null&&g(ce,Mt),ne=D(wr,ne,zt),Pt===null?wt=wr:Pt.sibling=wr,Pt=wr,Mt=Ai}if(zt===fe.length)return w(ce,Mt),mn&&nh(ce,zt),wt;if(Mt===null){for(;zt<fe.length;zt++)Mt=Ie(ce,fe[zt],ze),Mt!==null&&(ne=D(Mt,ne,zt),Pt===null?wt=Mt:Pt.sibling=Mt,Pt=Mt);return mn&&nh(ce,zt),wt}for(Mt=C(ce,Mt);zt<fe.length;zt++)Ai=et(Mt,ce,zt,fe[zt],ze),Ai!==null&&(p&&Ai.alternate!==null&&Mt.delete(Ai.key===null?zt:Ai.key),ne=D(Ai,ne,zt),Pt===null?wt=Ai:Pt.sibling=Ai,Pt=Ai);return p&&Mt.forEach(function(wd){return g(ce,wd)}),mn&&nh(ce,zt),wt}function yt(ce,ne,fe,ze){var wt=W(fe);if(typeof wt!="function")throw Error(r(150));if(fe=wt.call(fe),fe==null)throw Error(r(151));for(var Pt=wt=null,Mt=ne,zt=ne=0,Ai=null,wr=fe.next();Mt!==null&&!wr.done;zt++,wr=fe.next()){Mt.index>zt?(Ai=Mt,Mt=null):Ai=Mt.sibling;var wd=Ne(ce,Mt,wr.value,ze);if(wd===null){Mt===null&&(Mt=Ai);break}p&&Mt&&wd.alternate===null&&g(ce,Mt),ne=D(wd,ne,zt),Pt===null?wt=wd:Pt.sibling=wd,Pt=wd,Mt=Ai}if(wr.done)return w(ce,Mt),mn&&nh(ce,zt),wt;if(Mt===null){for(;!wr.done;zt++,wr=fe.next())wr=Ie(ce,wr.value,ze),wr!==null&&(ne=D(wr,ne,zt),Pt===null?wt=wr:Pt.sibling=wr,Pt=wr);return mn&&nh(ce,zt),wt}for(Mt=C(ce,Mt);!wr.done;zt++,wr=fe.next())wr=et(Mt,ce,zt,wr.value,ze),wr!==null&&(p&&wr.alternate!==null&&Mt.delete(wr.key===null?zt:wr.key),ne=D(wr,ne,zt),Pt===null?wt=wr:Pt.sibling=wr,Pt=wr);return p&&Mt.forEach(function(oSe){return g(ce,oSe)}),mn&&nh(ce,zt),wt}function Gn(ce,ne,fe,ze){if(typeof fe=="object"&&fe!==null&&fe.type===j&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case T:e:{for(var wt=fe.key,Pt=ne;Pt!==null;){if(Pt.key===wt){if(wt=fe.type,wt===j){if(Pt.tag===7){w(ce,Pt.sibling),ne=A(Pt,fe.props.children),ne.return=ce,ce=ne;break e}}else if(Pt.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===U&&BG(wt)===Pt.type){w(ce,Pt.sibling),ne=A(Pt,fe.props),ne.ref=B0(ce,Pt,fe),ne.return=ce,ce=ne;break e}w(ce,Pt);break}else g(ce,Pt);Pt=Pt.sibling}fe.type===j?(ne=dh(fe.props.children,ce.mode,ze,fe.key),ne.return=ce,ce=ne):(ze=w_(fe.type,fe.key,fe.props,null,ce.mode,ze),ze.ref=B0(ce,ne,fe),ze.return=ce,ce=ze)}return G(ce);case N:e:{for(Pt=fe.key;ne!==null;){if(ne.key===Pt)if(ne.tag===4&&ne.stateNode.containerInfo===fe.containerInfo&&ne.stateNode.implementation===fe.implementation){w(ce,ne.sibling),ne=A(ne,fe.children||[]),ne.return=ce,ce=ne;break e}else{w(ce,ne);break}else g(ce,ne);ne=ne.sibling}ne=WM(fe,ce.mode,ze),ne.return=ce,ce=ne}return G(ce);case U:return Pt=fe._init,Gn(ce,ne,Pt(fe._payload),ze)}if(X(fe))return dt(ce,ne,fe,ze);if(W(fe))return yt(ce,ne,fe,ze);Z1(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,ne!==null&&ne.tag===6?(w(ce,ne.sibling),ne=A(ne,fe),ne.return=ce,ce=ne):(w(ce,ne),ne=GM(fe,ce.mode,ze),ne.return=ce,ce=ne),G(ce)):w(ce,ne)}return Gn}var bm=VG(!0),UG=VG(!1),X1=ud(null),J1=null,wm=null,eM=null;function tM(){eM=wm=J1=null}function rM(p){var g=X1.current;an(X1),p._currentValue=g}function nM(p,g,w){for(;p!==null;){var C=p.alternate;if((p.childLanes&g)!==g?(p.childLanes|=g,C!==null&&(C.childLanes|=g)):C!==null&&(C.childLanes&g)!==g&&(C.childLanes|=g),p===w)break;p=p.return}}function _m(p,g){J1=p,eM=wm=null,p=p.dependencies,p!==null&&p.firstContext!==null&&((p.lanes&g)!==0&&(Qs=!0),p.firstContext=null)}function Qa(p){var g=p._currentValue;if(eM!==p)if(p={context:p,memoizedValue:g,next:null},wm===null){if(J1===null)throw Error(r(308));wm=p,J1.dependencies={lanes:0,firstContext:p}}else wm=wm.next=p;return g}var ih=null;function iM(p){ih===null?ih=[p]:ih.push(p)}function GG(p,g,w,C){var A=g.interleaved;return A===null?(w.next=w,iM(g)):(w.next=A.next,A.next=w),g.interleaved=w,Rc(p,C)}function Rc(p,g){p.lanes|=g;var w=p.alternate;for(w!==null&&(w.lanes|=g),w=p,p=p.return;p!==null;)p.childLanes|=g,w=p.alternate,w!==null&&(w.childLanes|=g),w=p,p=p.return;return w.tag===3?w.stateNode:null}var hd=!1;function sM(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function WG(p,g){p=p.updateQueue,g.updateQueue===p&&(g.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,effects:p.effects})}function Ic(p,g){return{eventTime:p,lane:g,tag:0,payload:null,callback:null,next:null}}function pd(p,g,w){var C=p.updateQueue;if(C===null)return null;if(C=C.shared,(vr&2)!==0){var A=C.pending;return A===null?g.next=g:(g.next=A.next,A.next=g),C.pending=g,Rc(p,w)}return A=C.interleaved,A===null?(g.next=g,iM(C)):(g.next=A.next,A.next=g),C.interleaved=g,Rc(p,w)}function e_(p,g,w){if(g=g.updateQueue,g!==null&&(g=g.shared,(w&4194240)!==0)){var C=g.lanes;C&=p.pendingLanes,w|=C,g.lanes=w,xP(p,w)}}function HG(p,g){var w=p.updateQueue,C=p.alternate;if(C!==null&&(C=C.updateQueue,w===C)){var A=null,D=null;if(w=w.firstBaseUpdate,w!==null){do{var G={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};D===null?A=D=G:D=D.next=G,w=w.next}while(w!==null);D===null?A=D=g:D=D.next=g}else A=D=g;w={baseState:C.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:C.shared,effects:C.effects},p.updateQueue=w;return}p=w.lastBaseUpdate,p===null?w.firstBaseUpdate=g:p.next=g,w.lastBaseUpdate=g}function t_(p,g,w,C){var A=p.updateQueue;hd=!1;var D=A.firstBaseUpdate,G=A.lastBaseUpdate,Z=A.shared.pending;if(Z!==null){A.shared.pending=null;var te=Z,pe=te.next;te.next=null,G===null?D=pe:G.next=pe,G=te;var Ae=p.alternate;Ae!==null&&(Ae=Ae.updateQueue,Z=Ae.lastBaseUpdate,Z!==G&&(Z===null?Ae.firstBaseUpdate=pe:Z.next=pe,Ae.lastBaseUpdate=te))}if(D!==null){var Ie=A.baseState;G=0,Ae=pe=te=null,Z=D;do{var Ne=Z.lane,et=Z.eventTime;if((C&Ne)===Ne){Ae!==null&&(Ae=Ae.next={eventTime:et,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var dt=p,yt=Z;switch(Ne=g,et=w,yt.tag){case 1:if(dt=yt.payload,typeof dt=="function"){Ie=dt.call(et,Ie,Ne);break e}Ie=dt;break e;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=yt.payload,Ne=typeof dt=="function"?dt.call(et,Ie,Ne):dt,Ne==null)break e;Ie=K({},Ie,Ne);break e;case 2:hd=!0}}Z.callback!==null&&Z.lane!==0&&(p.flags|=64,Ne=A.effects,Ne===null?A.effects=[Z]:Ne.push(Z))}else et={eventTime:et,lane:Ne,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ae===null?(pe=Ae=et,te=Ie):Ae=Ae.next=et,G|=Ne;if(Z=Z.next,Z===null){if(Z=A.shared.pending,Z===null)break;Ne=Z,Z=Ne.next,Ne.next=null,A.lastBaseUpdate=Ne,A.shared.pending=null}}while(!0);if(Ae===null&&(te=Ie),A.baseState=te,A.firstBaseUpdate=pe,A.lastBaseUpdate=Ae,g=A.shared.interleaved,g!==null){A=g;do G|=A.lane,A=A.next;while(A!==g)}else D===null&&(A.shared.lanes=0);oh|=G,p.lanes=G,p.memoizedState=Ie}}function qG(p,g,w){if(p=g.effects,g.effects=null,p!==null)for(g=0;g<p.length;g++){var C=p[g],A=C.callback;if(A!==null){if(C.callback=null,C=w,typeof A!="function")throw Error(r(191,A));A.call(C)}}}var V0={},El=ud(V0),U0=ud(V0),G0=ud(V0);
vendor: 7,506 bytes, line 97
97function sh(p){if(p===V0)throw Error(r(174));return p}function aM(p,g){switch(Xr(G0,g),Xr(U0,p),Xr(El,V0),p=g.nodeType,p){case 9:case 11:g=(g=g.documentElement)?g.namespaceURI:Nt(null,"");break;default:p=p===8?g.parentNode:g,g=p.namespaceURI||null,p=p.tagName,g=Nt(g,p)}an(El),Xr(El,g)}function Sm(){an(El),an(U0),an(G0)}function YG(p){sh(G0.current);var g=sh(El.current),w=Nt(g,p.type);g!==w&&(Xr(U0,p),Xr(El,w))}function oM(p){U0.current===p&&(an(El),an(U0))}var wn=ud(0);function r_(p){for(var g=p;g!==null;){if(g.tag===13){var w=g.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||w.data==="$?"||w.data==="$!"))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if((g.flags&128)!==0)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===p)break;for(;g.sibling===null;){if(g.return===null||g.return===p)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var lM=[];function cM(){for(var p=0;p<lM.length;p++)lM[p]._workInProgressVersionPrimary=null;lM.length=0}var n_=E.ReactCurrentDispatcher,uM=E.ReactCurrentBatchConfig,ah=0,_n=null,gi=null,Pi=null,i_=!1,W0=!1,H0=0,N_e=0;function as(){throw Error(r(321))}function dM(p,g){if(g===null)return!1;for(var w=0;w<g.length&&w<p.length;w++)if(!Go(p[w],g[w]))return!1;return!0}function fM(p,g,w,C,A,D){if(ah=D,_n=g,g.memoizedState=null,g.updateQueue=null,g.lanes=0,n_.current=p===null||p.memoizedState===null?D_e:O_e,p=w(C,A),W0){D=0;do{if(W0=!1,H0=0,25<=D)throw Error(r(301));D+=1,Pi=gi=null,g.updateQueue=null,n_.current=R_e,p=w(C,A)}while(W0)}if(n_.current=o_,g=gi!==null&&gi.next!==null,ah=0,Pi=gi=_n=null,i_=!1,g)throw Error(r(300));return p}function hM(){var p=H0!==0;return H0=0,p}function jl(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pi===null?_n.memoizedState=Pi=p:Pi=Pi.next=p,Pi}function Za(){if(gi===null){var p=_n.alternate;p=p!==null?p.memoizedState:null}else p=gi.next;var g=Pi===null?_n.memoizedState:Pi.next;if(g!==null)Pi=g,gi=p;else{if(p===null)throw Error(r(310));gi=p,p={memoizedState:gi.memoizedState,baseState:gi.baseState,baseQueue:gi.baseQueue,queue:gi.queue,next:null},Pi===null?_n.memoizedState=Pi=p:Pi=Pi.next=p}return Pi}function q0(p,g){return typeof g=="function"?g(p):g}function pM(p){var g=Za(),w=g.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=p;var C=gi,A=C.baseQueue,D=w.pending;if(D!==null){if(A!==null){var G=A.next;A.next=D.next,D.next=G}C.baseQueue=A=D,w.pending=null}if(A!==null){D=A.next,C=C.baseState;var Z=G=null,te=null,pe=D;do{var Ae=pe.lane;if((ah&Ae)===Ae)te!==null&&(te=te.next={lane:0,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),C=pe.hasEagerState?pe.eagerState:p(C,pe.action);else{var Ie={lane:Ae,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null};te===null?(Z=te=Ie,G=C):te=te.next=Ie,_n.lanes|=Ae,oh|=Ae}pe=pe.next}while(pe!==null&&pe!==D);te===null?G=C:te.next=Z,Go(C,g.memoizedState)||(Qs=!0),g.memoizedState=C,g.baseState=G,g.baseQueue=te,w.lastRenderedState=C}if(p=w.interleaved,p!==null){A=p;do D=A.lane,_n.lanes|=D,oh|=D,A=A.next;while(A!==p)}else A===null&&(w.lanes=0);return[g.memoizedState,w.dispatch]}function mM(p){var g=Za(),w=g.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=p;var C=w.dispatch,A=w.pending,D=g.memoizedState;if(A!==null){w.pending=null;var G=A=A.next;do D=p(D,G.action),G=G.next;while(G!==A);Go(D,g.memoizedState)||(Qs=!0),g.memoizedState=D,g.baseQueue===null&&(g.baseState=D),w.lastRenderedState=D}return[D,C]}function KG(){}function QG(p,g){var w=_n,C=Za(),A=g(),D=!Go(C.memoizedState,A);if(D&&(C.memoizedState=A,Qs=!0),C=C.queue,gM(JG.bind(null,w,C,p),[p]),C.getSnapshot!==g||D||Pi!==null&&Pi.memoizedState.tag&1){if(w.flags|=2048,Y0(9,XG.bind(null,w,C,A,g),void 0,null),Mi===null)throw Error(r(349));(ah&30)!==0||ZG(w,g,A)}return A}function ZG(p,g,w){p.flags|=16384,p={getSnapshot:g,value:w},g=_n.updateQueue,g===null?(g={lastEffect:null,stores:null},_n.updateQueue=g,g.stores=[p]):(w=g.stores,w===null?g.stores=[p]:w.push(p))}function XG(p,g,w,C){g.value=w,g.getSnapshot=C,eW(g)&&tW(p)}function JG(p,g,w){return w(function(){eW(g)&&tW(p)})}function eW(p){var g=p.getSnapshot;p=p.value;try{var w=g();return!Go(p,w)}catch{return!0}}function tW(p){var g=Rc(p,1);g!==null&&Ko(g,p,1,-1)}function rW(p){var g=jl();return typeof p=="function"&&(p=p()),g.memoizedState=g.baseState=p,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:q0,lastRenderedState:p},g.queue=p,p=p.dispatch=A_e.bind(null,_n,p),[g.memoizedState,p]}function Y0(p,g,w,C){return p={tag:p,create:g,destroy:w,deps:C,next:null},g=_n.updateQueue,g===null?(g={lastEffect:null,stores:null},_n.updateQueue=g,g.lastEffect=p.next=p):(w=g.lastEffect,w===null?g.lastEffect=p.next=p:(C=w.next,w.next=p,p.next=C,g.lastEffect=p)),p}function nW(){return Za().memoizedState}function s_(p,g,w,C){var A=jl();_n.flags|=p,A.memoizedState=Y0(1|g,w,void 0,C===void 0?null:C)}function a_(p,g,w,C){var A=Za();C=C===void 0?null:C;var D=void 0;if(gi!==null){var G=gi.memoizedState;if(D=G.destroy,C!==null&&dM(C,G.deps)){A.memoizedState=Y0(g,w,D,C);return}}_n.flags|=p,A.memoizedState=Y0(1|g,w,D,C)}function iW(p,g){return s_(8390656,8,p,g)}function gM(p,g){return a_(2048,8,p,g)}function sW(p,g){return a_(4,2,p,g)}function aW(p,g){return a_(4,4,p,g)}function oW(p,g){if(typeof g=="function")return p=p(),g(p),function(){g(null)};if(g!=null)return p=p(),g.current=p,function(){g.current=null}}function lW(p,g,w){return w=w!=null?w.concat([p]):null,a_(4,4,oW.bind(null,g,p),w)}function yM(){}function cW(p,g){var w=Za();g=g===void 0?null:g;var C=w.memoizedState;return C!==null&&g!==null&&dM(g,C[1])?C[0]:(w.memoizedState=[p,g],p)}function uW(p,g){var w=Za();g=g===void 0?null:g;var C=w.memoizedState;return C!==null&&g!==null&&dM(g,C[1])?C[0]:(p=p(),w.memoizedState=[p,g],p)}function dW(p,g,w){return(ah&21)===0?(p.baseState&&(p.baseState=!1,Qs=!0),p.memoizedState=w):(Go(w,g)||(w=B6(),_n.lanes|=w,oh|=w,p.baseState=!0),g)}function P_e(p,g){var w=Or;Or=w!==0&&4>w?w:4,p(!0);var C=uM.transition;uM.transition={};try{p(!1),g()}finally{Or=w,uM.transition=C}}function fW(){return Za().memoizedState}function M_e(p,g,w){var C=vd(p);if(w={lane:C,action:w,hasEagerState:!1,eagerState:null,next:null},hW(p))pW(g,w);else if(w=GG(p,g,w,C),w!==null){var A=js();Ko(w,p,C,A),mW(w,g,C)}}function A_e(p,g,w){var C=vd(p),A={lane:C,action:w,hasEagerState:!1,eagerState:null,next:null};if(hW(p))pW(g,A);else{var D=p.alternate;if(p.lanes===0&&(D===null||D.lanes===0)&&(D=g.lastRenderedReducer,D!==null))try{var G=g.lastRenderedState,Z=D(G,w);if(A.hasEagerState=!0,A.eagerState=Z,Go(Z,G)){var te=g.interleaved;te===null?(A.next=A,iM(g)):(A.next=te.next,te.next=A),g.interleaved=A;return}}catch{}finally{}w=GG(p,g,A,C),w!==null&&(A=js(),Ko(w,p,C,A),mW(w,g,C))}}function hW(p){var g=p.alternate;return p===_n||g!==null&&g===_n}function pW(p,g){W0=i_=!0;var w=p.pending;w===null?g.next=g:(g.next=w.next,w.next=g),p.pending=g}function mW(p,g,w){if((w&4194240)!==0){var C=g.lanes;C&=p.pendingLanes,w|=C,g.lanes=w,xP(p,w)}}var o_={readContext:Qa,useCallback:as,useContext:as,useEffect:as,useImperativeHandle:as,useInsertionEffect:as,useLayoutEffect:as,useMemo:as,useReducer:as,useRef:as,useState:as,useDebugValue:as,useDeferredValue:as,useTransition:as,useMutableSource:as,useSyncExternalStore:as,useId:as,unstable_isNewReconciler:!1},D_e={readContext:Qa,useCallback:function(p,g){return jl().memoizedState=[p,g===void 0?null:g],p}
vendor: 8,053 bytes, lines 97-99
97,useContext:Qa,useEffect:iW,useImperativeHandle:function(p,g,w){return w=w!=null?w.concat([p]):null,s_(4194308,4,oW.bind(null,g,p),w)},useLayoutEffect:function(p,g){return s_(4194308,4,p,g)},useInsertionEffect:function(p,g){return s_(4,2,p,g)},useMemo:function(p,g){var w=jl();return g=g===void 0?null:g,p=p(),w.memoizedState=[p,g],p},useReducer:function(p,g,w){var C=jl();return g=w!==void 0?w(g):g,C.memoizedState=C.baseState=g,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:g},C.queue=p,p=p.dispatch=M_e.bind(null,_n,p),[C.memoizedState,p]},useRef:function(p){var g=jl();return p={current:p},g.memoizedState=p},useState:rW,useDebugValue:yM,useDeferredValue:function(p){return jl().memoizedState=p},useTransition:function(){var p=rW(!1),g=p[0];return p=P_e.bind(null,p[1]),jl().memoizedState=p,[g,p]},useMutableSource:function(){},useSyncExternalStore:function(p,g,w){var C=_n,A=jl();if(mn){if(w===void 0)throw Error(r(407));w=w()}else{if(w=g(),Mi===null)throw Error(r(349));(ah&30)!==0||ZG(C,g,w)}A.memoizedState=w;var D={value:w,getSnapshot:g};return A.queue=D,iW(JG.bind(null,C,D,p),[p]),C.flags|=2048,Y0(9,XG.bind(null,C,D,w,g),void 0,null),w},useId:function(){var p=jl(),g=Mi.identifierPrefix;if(mn){var w=Oc,C=Dc;w=(C&~(1<<32-Tr(C)-1)).toString(32)+w,g=":"+g+"R"+w,w=H0++,0<w&&(g+="H"+w.toString(32)),g+=":"}else w=N_e++,g=":"+g+"r"+w.toString(32)+":";return p.memoizedState=g},unstable_isNewReconciler:!1},O_e={readContext:Qa,useCallback:cW,useContext:Qa,useEffect:gM,useImperativeHandle:lW,useInsertionEffect:sW,useLayoutEffect:aW,useMemo:uW,useReducer:pM,useRef:nW,useState:function(){return pM(q0)},useDebugValue:yM,useDeferredValue:function(p){var g=Za();return dW(g,gi.memoizedState,p)},useTransition:function(){var p=pM(q0)[0],g=Za().memoizedState;return[p,g]},useMutableSource:KG,useSyncExternalStore:QG,useId:fW,unstable_isNewReconciler:!1},R_e={readContext:Qa,useCallback:cW,useContext:Qa,useEffect:gM,useImperativeHandle:lW,useInsertionEffect:sW,useLayoutEffect:aW,useMemo:uW,useReducer:mM,useRef:nW,useState:function(){return mM(q0)},useDebugValue:yM,useDeferredValue:function(p){var g=Za();return gi===null?g.memoizedState=p:dW(g,gi.memoizedState,p)},useTransition:function(){var p=mM(q0)[0],g=Za().memoizedState;return[p,g]},useMutableSource:KG,useSyncExternalStore:QG,useId:fW,unstable_isNewReconciler:!1};function Ho(p,g){if(p&&p.defaultProps){g=K({},g),p=p.defaultProps;for(var w in p)g[w]===void 0&&(g[w]=p[w]);return g}return g}function vM(p,g,w,C){g=p.memoizedState,w=w(C,g),w=w==null?g:K({},g,w),p.memoizedState=w,p.lanes===0&&(p.updateQueue.baseState=w)}var l_={isMounted:function(p){return(p=p._reactInternals)?Oe(p)===p:!1},enqueueSetState:function(p,g,w){p=p._reactInternals;var C=js(),A=vd(p),D=Ic(C,A);D.payload=g,w!=null&&(D.callback=w),g=pd(p,D,A),g!==null&&(Ko(g,p,A,C),e_(g,p,A))},enqueueReplaceState:function(p,g,w){p=p._reactInternals;var C=js(),A=vd(p),D=Ic(C,A);D.tag=1,D.payload=g,w!=null&&(D.callback=w),g=pd(p,D,A),g!==null&&(Ko(g,p,A,C),e_(g,p,A))},enqueueForceUpdate:function(p,g){p=p._reactInternals;var w=js(),C=vd(p),A=Ic(w,C);A.tag=2,g!=null&&(A.callback=g),g=pd(p,A,C),g!==null&&(Ko(g,p,C,w),e_(g,p,C))}};function gW(p,g,w,C,A,D,G){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate(C,D,G):g.prototype&&g.prototype.isPureReactComponent?!O0(w,C)||!O0(A,D):!0}function yW(p,g,w){var C=!1,A=dd,D=g.contextType;return typeof D=="object"&&D!==null?D=Qa(D):(A=Ks(g)?th:ss.current,C=g.contextTypes,D=(C=C!=null)?gm(p,A):dd),g=new g(w,D),p.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=l_,p.stateNode=g,g._reactInternals=p,C&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=A,p.__reactInternalMemoizedMaskedChildContext=D),g}function vW(p,g,w,C){p=g.state,typeof g.componentWillReceiveProps=="function"&&g.componentWillReceiveProps(w,C),typeof g.UNSAFE_componentWillReceiveProps=="function"&&g.UNSAFE_componentWillReceiveProps(w,C),g.state!==p&&l_.enqueueReplaceState(g,g.state,null)}function xM(p,g,w,C){var A=p.stateNode;A.props=w,A.state=p.memoizedState,A.refs={},sM(p);var D=g.contextType;typeof D=="object"&&D!==null?A.context=Qa(D):(D=Ks(g)?th:ss.current,A.context=gm(p,D)),A.state=p.memoizedState,D=g.getDerivedStateFromProps,typeof D=="function"&&(vM(p,g,D,w),A.state=p.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(g=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),g!==A.state&&l_.enqueueReplaceState(A,A.state,null),t_(p,w,A,C),A.state=p.memoizedState),typeof A.componentDidMount=="function"&&(p.flags|=4194308)}function km(p,g){try{var w="",C=g;do w+=re(C),C=C.return;while(C);var A=w}catch(D){A=`
98Error generating stack: `+D.message+`
99`+D.stack}return{value:p,source:g,stack:A,digest:null}}function bM(p,g,w){return{value:p,source:null,stack:w??null,digest:g??null}}function wM(p,g){try{console.error(g.value)}catch(w){setTimeout(function(){throw w})}}var I_e=typeof WeakMap=="function"?WeakMap:Map;function xW(p,g,w){w=Ic(-1,w),w.tag=3,w.payload={element:null};var C=g.value;return w.callback=function(){m_||(m_=!0,IM=C),wM(p,g)},w}function bW(p,g,w){w=Ic(-1,w),w.tag=3;var C=p.type.getDerivedStateFromError;if(typeof C=="function"){var A=g.value;w.payload=function(){return C(A)},w.callback=function(){wM(p,g)}}var D=p.stateNode;return D!==null&&typeof D.componentDidCatch=="function"&&(w.callback=function(){wM(p,g),typeof C!="function"&&(gd===null?gd=new Set([this]):gd.add(this));var G=g.stack;this.componentDidCatch(g.value,{componentStack:G!==null?G:""})}),w}function wW(p,g,w){var C=p.pingCache;if(C===null){C=p.pingCache=new I_e;var A=new Set;C.set(g,A)}else A=C.get(g),A===void 0&&(A=new Set,C.set(g,A));A.has(w)||(A.add(w),p=Q_e.bind(null,p,g,w),g.then(p,p))}function _W(p){do{var g;if((g=p.tag===13)&&(g=p.memoizedState,g=g!==null?g.dehydrated!==null:!0),g)return p;p=p.return}while(p!==null);return null}function SW(p,g,w,C,A){return(p.mode&1)===0?(p===g?p.flags|=65536:(p.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(g=Ic(-1,1),g.tag=2,pd(w,g,1))),w.lanes|=1),p):(p.flags|=65536,p.lanes=A,p)}var L_e=E.ReactCurrentOwner,Qs=!1;function Es(p,g,w,C){g.child=p===null?UG(g,null,w,C):bm(g,p.child,w,C)}function kW(p,g,w,C,A){w=w.render;var D=g.ref;return _m(g,A),C=fM(p,g,w,C,D,A),w=hM(),p!==null&&!Qs?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~A,Lc(p,g,A)):(mn&&w&&KP(g),g.flags|=1,Es(p,g,C,A),g.child)}function TW(p,g,w,C,A){if(p===null){var D=w.type;return typeof D=="function"&&!UM(D)&&D.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(g.tag=15,g.type=D,CW(p,g,D,C,A)):(p=w_(w.type,null,C,g,g.mode,A),p.ref=g.ref,p.return=g,g.child=p)}if(D=p.child,(p.lanes&A)===0){var G=D.memoizedProps;if(w=w.compare,w=w!==null?w:O0,w(G,C)&&p.ref===g.ref)return Lc(p,g,A)}return g.flags|=1,p=bd(D,C),p.ref=g.ref,p.return=g,g.child=p}function CW(p,g,w,C,A){if(p!==null){var D=p.memoizedProps;if(O0(D,C)&&p.ref===g.ref)if(Qs=!1,g.pendingProps=C=D,(p.lanes&A)!==0)(p.flags&131072)!==0&&(Qs=!0);else return g.lanes=p.lanes,Lc(p,g,A)}return _M(p,g,w,C,A)}function EW(p,g,w){var C=g.pendingProps,A=C.children,D=p!==null?p.memoizedState:null;if(C.mode==="hidden")if((g.mode&1)===0)g.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xr(Cm,_a),_a|=w;else{if((w&1073741824)===0)return p=D!==null?D.baseLanes|w:w,g.lanes=g.childLanes=1073741824,g.memoizedState={baseLanes:p,cachePool:null,transitions:null},g.updateQueue=null,Xr(Cm,_a),_a|=p,null;g.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=D!==null?D.baseLanes:w,Xr(Cm,_a),_a|=C}else D!==null?(C=D.baseLanes|w,g.memoizedState=null):C=w,Xr(Cm,_a),_a|=C;return Es(p,g,A,w),g.child}function jW(p,g){var w=g.ref;(p===null&&w!==null||p!==null&&p.ref!==w)&&(g.flags|=512,g.flags|=2097152)}
vendor: 9,553 bytes, line 99
99function _M(p,g,w,C,A){var D=Ks(w)?th:ss.current;return D=gm(g,D),_m(g,A),w=fM(p,g,w,C,D,A),C=hM(),p!==null&&!Qs?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~A,Lc(p,g,A)):(mn&&C&&KP(g),g.flags|=1,Es(p,g,w,A),g.child)}function NW(p,g,w,C,A){if(Ks(w)){var D=!0;H1(g)}else D=!1;if(_m(g,A),g.stateNode===null)u_(p,g),yW(g,w,C),xM(g,w,C,A),C=!0;else if(p===null){var G=g.stateNode,Z=g.memoizedProps;G.props=Z;var te=G.context,pe=w.contextType;typeof pe=="object"&&pe!==null?pe=Qa(pe):(pe=Ks(w)?th:ss.current,pe=gm(g,pe));var Ae=w.getDerivedStateFromProps,Ie=typeof Ae=="function"||typeof G.getSnapshotBeforeUpdate=="function";Ie||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(Z!==C||te!==pe)&&vW(g,G,C,pe),hd=!1;var Ne=g.memoizedState;G.state=Ne,t_(g,C,G,A),te=g.memoizedState,Z!==C||Ne!==te||Ys.current||hd?(typeof Ae=="function"&&(vM(g,w,Ae,C),te=g.memoizedState),(Z=hd||gW(g,w,Z,C,Ne,te,pe))?(Ie||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount()),typeof G.componentDidMount=="function"&&(g.flags|=4194308)):(typeof G.componentDidMount=="function"&&(g.flags|=4194308),g.memoizedProps=C,g.memoizedState=te),G.props=C,G.state=te,G.context=pe,C=Z):(typeof G.componentDidMount=="function"&&(g.flags|=4194308),C=!1)}else{G=g.stateNode,WG(p,g),Z=g.memoizedProps,pe=g.type===g.elementType?Z:Ho(g.type,Z),G.props=pe,Ie=g.pendingProps,Ne=G.context,te=w.contextType,typeof te=="object"&&te!==null?te=Qa(te):(te=Ks(w)?th:ss.current,te=gm(g,te));var et=w.getDerivedStateFromProps;(Ae=typeof et=="function"||typeof G.getSnapshotBeforeUpdate=="function")||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(Z!==Ie||Ne!==te)&&vW(g,G,C,te),hd=!1,Ne=g.memoizedState,G.state=Ne,t_(g,C,G,A);var dt=g.memoizedState;Z!==Ie||Ne!==dt||Ys.current||hd?(typeof et=="function"&&(vM(g,w,et,C),dt=g.memoizedState),(pe=hd||gW(g,w,pe,C,Ne,dt,te)||!1)?(Ae||typeof G.UNSAFE_componentWillUpdate!="function"&&typeof G.componentWillUpdate!="function"||(typeof G.componentWillUpdate=="function"&&G.componentWillUpdate(C,dt,te),typeof G.UNSAFE_componentWillUpdate=="function"&&G.UNSAFE_componentWillUpdate(C,dt,te)),typeof G.componentDidUpdate=="function"&&(g.flags|=4),typeof G.getSnapshotBeforeUpdate=="function"&&(g.flags|=1024)):(typeof G.componentDidUpdate!="function"||Z===p.memoizedProps&&Ne===p.memoizedState||(g.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||Z===p.memoizedProps&&Ne===p.memoizedState||(g.flags|=1024),g.memoizedProps=C,g.memoizedState=dt),G.props=C,G.state=dt,G.context=te,C=pe):(typeof G.componentDidUpdate!="function"||Z===p.memoizedProps&&Ne===p.memoizedState||(g.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||Z===p.memoizedProps&&Ne===p.memoizedState||(g.flags|=1024),C=!1)}return SM(p,g,w,C,D,A)}function SM(p,g,w,C,A,D){jW(p,g);var G=(g.flags&128)!==0;if(!C&&!G)return A&&OG(g,w,!1),Lc(p,g,D);C=g.stateNode,L_e.current=g;var Z=G&&typeof w.getDerivedStateFromError!="function"?null:C.render();return g.flags|=1,p!==null&&G?(g.child=bm(g,p.child,null,D),g.child=bm(g,null,Z,D)):Es(p,g,Z,D),g.memoizedState=C.state,A&&OG(g,w,!0),g.child}function PW(p){var g=p.stateNode;g.pendingContext?AG(p,g.pendingContext,g.pendingContext!==g.context):g.context&&AG(p,g.context,!1),aM(p,g.containerInfo)}function MW(p,g,w,C,A){return xm(),JP(A),g.flags|=256,Es(p,g,w,C),g.child}var kM={dehydrated:null,treeContext:null,retryLane:0};function TM(p){return{baseLanes:p,cachePool:null,transitions:null}}function AW(p,g,w){var C=g.pendingProps,A=wn.current,D=!1,G=(g.flags&128)!==0,Z;if((Z=G)||(Z=p!==null&&p.memoizedState===null?!1:(A&2)!==0),Z?(D=!0,g.flags&=-129):(p===null||p.memoizedState!==null)&&(A|=1),Xr(wn,A&1),p===null)return XP(g),p=g.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?((g.mode&1)===0?g.lanes=1:p.data==="$!"?g.lanes=8:g.lanes=1073741824,null):(G=C.children,p=C.fallback,D?(C=g.mode,D=g.child,G={mode:"hidden",children:G},(C&1)===0&&D!==null?(D.childLanes=0,D.pendingProps=G):D=__(G,C,0,null),p=dh(p,C,w,null),D.return=g,p.return=g,D.sibling=p,g.child=D,g.child.memoizedState=TM(w),g.memoizedState=kM,p):CM(g,G));if(A=p.memoizedState,A!==null&&(Z=A.dehydrated,Z!==null))return $_e(p,g,G,C,Z,A,w);if(D){D=C.fallback,G=g.mode,A=p.child,Z=A.sibling;var te={mode:"hidden",children:C.children};return(G&1)===0&&g.child!==A?(C=g.child,C.childLanes=0,C.pendingProps=te,g.deletions=null):(C=bd(A,te),C.subtreeFlags=A.subtreeFlags&14680064),Z!==null?D=bd(Z,D):(D=dh(D,G,w,null),D.flags|=2),D.return=g,C.return=g,C.sibling=D,g.child=C,C=D,D=g.child,G=p.child.memoizedState,G=G===null?TM(w):{baseLanes:G.baseLanes|w,cachePool:null,transitions:G.transitions},D.memoizedState=G,D.childLanes=p.childLanes&~w,g.memoizedState=kM,C}return D=p.child,p=D.sibling,C=bd(D,{mode:"visible",children:C.children}),(g.mode&1)===0&&(C.lanes=w),C.return=g,C.sibling=null,p!==null&&(w=g.deletions,w===null?(g.deletions=[p],g.flags|=16):w.push(p)),g.child=C,g.memoizedState=null,C}function CM(p,g){return g=__({mode:"visible",children:g},p.mode,0,null),g.return=p,p.child=g}function c_(p,g,w,C){return C!==null&&JP(C),bm(g,p.child,null,w),p=CM(g,g.pendingProps.children),p.flags|=2,g.memoizedState=null,p}function $_e(p,g,w,C,A,D,G){if(w)return g.flags&256?(g.flags&=-257,C=bM(Error(r(422))),c_(p,g,G,C)):g.memoizedState!==null?(g.child=p.child,g.flags|=128,null):(D=C.fallback,A=g.mode,C=__({mode:"visible",children:C.children},A,0,null),D=dh(D,A,G,null),D.flags|=2,C.return=g,D.return=g,C.sibling=D,g.child=C,(g.mode&1)!==0&&bm(g,p.child,null,G),g.child.memoizedState=TM(G),g.memoizedState=kM,D);if((g.mode&1)===0)return c_(p,g,G,null);if(A.data==="$!"){if(C=A.nextSibling&&A.nextSibling.dataset,C)var Z=C.dgst;return C=Z,D=Error(r(419)),C=bM(D,C,void 0),c_(p,g,G,C)}if(Z=(G&p.childLanes)!==0,Qs||Z){if(C=Mi,C!==null){switch(G&-G){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(C.suspendedLanes|G))!==0?0:A,A!==0&&A!==D.retryLane&&(D.retryLane=A,Rc(p,A),Ko(C,p,A,-1))}return VM(),C=bM(Error(r(421))),c_(p,g,G,C)}return A.data==="$?"?(g.flags|=128,g.child=p.child,g=Z_e.bind(null,p),A._reactRetry=g,null):(p=D.treeContext,wa=cd(A.nextSibling),ba=g,mn=!0,Wo=null,p!==null&&(Ya[Ka++]=Dc,Ya[Ka++]=Oc,Ya[Ka++]=rh,Dc=p.id,Oc=p.overflow,rh=g),g=CM(g,C.children),g.flags|=4096,g)}function DW(p,g,w){p.lanes|=g;var C=p.alternate;C!==null&&(C.lanes|=g),nM(p.return,g,w)}function EM(p,g,w,C,A){var D=p.memoizedState;D===null?p.memoizedState={isBackwards:g,rendering:null,renderingStartTime:0,last:C,tail:w,tailMode:A}:(D.isBackwards=g,D.rendering=null,D.renderingStartTime=0,D.last=C,D.tail=w,D.tailMode=A)}function OW(p,g,w){var C=g.pendingProps,A=C.revealOrder,D=C.tail;if(Es(p,g,C.children,w),C=wn.current,(C&2)!==0)C=C&1|2,g.flags|=128;else{if(p!==null&&(p.flags&128)!==0)e:for(p=g.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&DW(p,w,g);else if(p.tag===19)DW(p,w,g);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===g)break e;for(;p.sibling===null;){if(p.return===null||p.return===g)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}C&=1}if(Xr(wn,C),(g.mode&1)===0)g.memoizedState=null;else switch(A){case"forwards":for(w=g.child,A=null;w!==null;)p=w.alternate,p!==null&&r_(p)===null&&(A=w),w=w.sibling;w=A,w===null?(A=g.child,g.child=null):(A=w.sibling,w.sibling=null),EM(g,!1,A,w,D);break;case"backwards":for(w=null,A=g.child,g.child=null;A!==null;){if(p=A.alternate,p!==null&&r_(p)===null){g.child=A;break}p=A.sibling,A.sibling=w,w=A,A=p}EM(g,!0,w,null,D);break;case"together":EM(g,!1,null,null,void 0);break;default:g.memoizedState=null}return g.child}function u_(p,g){(g.mode&1)===0&&p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2)}function Lc(p,g,w){if(p!==null&&(g.dependencies=p.dependencies),oh|=g.lanes,(w&g.childLanes)===0)return null;if(p!==null&&g.child!==p.child)throw Error(r(153));if(g.child!==null){for(p=g.child,w=bd(p,p.pendingProps),g.child=w,w.return=g;p.sibling!==null;)p=p.sibling,w=w.sibling=bd(p,p.pendingProps),w.return=g;w.sibling=null}return g.child}function F_e(p,g,w){switch(g.tag){case 3:PW(g),xm();break;case 5:YG(g);break;case 1:Ks(g.type)&&H1(g);break;case 4:aM(g,g.stateNode.containerInfo);break;case 10:var C=g.type._context,A=g.memoizedProps.value;Xr(X1,C._currentValue),C._currentValue=A;break;case 13:if(C=g.memoizedState,C!==null)return C.dehydrated!==null?(Xr(wn,wn.current&1),g.flags|=128,null):(w&g.child.childLanes)!==0?AW(p,g,w):(Xr(wn,wn.current&1),p=Lc(p,g,w),p!==null?p.sibling:null);Xr(wn,wn.current&1);break;case 19:if(C=(w&g.childLanes)!==0,(p.flags&128)!==0){if(C)return OW(p,g,w);g.flags|=128}if(A=g.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Xr(wn,wn.current),C)break;return null;case 22:case 23:return g.lanes=0,EW(p,g,w)}return Lc(p,g,w)}var RW,jM,IW,LW;RW=function(p,g){for(var w=g.child;w!==null;){if(w.tag===5||w.tag===6)p.appendChild(w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===g)break;for(;w.sibling===null;){if(w.return===null||w.return===g)return;w=w.return}w.sibling.return=w.return,w=w.sibling}}
vendor: 2,179 bytes, line 99
99,jM=function(){},IW=function(p,g,w,C){var A=p.memoizedProps;if(A!==C){p=g.stateNode,sh(El.current);var D=null;switch(w){case"input":A=De(p,A),C=De(p,C),D=[];break;case"select":A=K({},A,{value:void 0}),C=K({},C,{value:void 0}),D=[];break;case"textarea":A=de(p,A),C=de(p,C),D=[];break;default:typeof A.onClick!="function"&&typeof C.onClick=="function"&&(p.onclick=U1)}Nn(w,C);var G;w=null;for(pe in A)if(!C.hasOwnProperty(pe)&&A.hasOwnProperty(pe)&&A[pe]!=null)if(pe==="style"){var Z=A[pe];for(G in Z)Z.hasOwnProperty(G)&&(w||(w={}),w[G]="")}else pe!=="dangerouslySetInnerHTML"&&pe!=="children"&&pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&pe!=="autoFocus"&&(i.hasOwnProperty(pe)?D||(D=[]):(D=D||[]).push(pe,null));for(pe in C){var te=C[pe];if(Z=A?.[pe],C.hasOwnProperty(pe)&&te!==Z&&(te!=null||Z!=null))if(pe==="style")if(Z){for(G in Z)!Z.hasOwnProperty(G)||te&&te.hasOwnProperty(G)||(w||(w={}),w[G]="");for(G in te)te.hasOwnProperty(G)&&Z[G]!==te[G]&&(w||(w={}),w[G]=te[G])}else w||(D||(D=[]),D.push(pe,w)),w=te;else pe==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Z=Z?Z.__html:void 0,te!=null&&Z!==te&&(D=D||[]).push(pe,te)):pe==="children"?typeof te!="string"&&typeof te!="number"||(D=D||[]).push(pe,""+te):pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&(i.hasOwnProperty(pe)?(te!=null&&pe==="onScroll"&&sn("scroll",p),D||Z===te||(D=[])):(D=D||[]).push(pe,te))}w&&(D=D||[]).push("style",w);var pe=D;(g.updateQueue=pe)&&(g.flags|=4)}},LW=function(p,g,w,C){w!==C&&(g.flags|=4)};function K0(p,g){if(!mn)switch(p.tailMode){case"hidden":g=p.tail;for(var w=null;g!==null;)g.alternate!==null&&(w=g),g=g.sibling;w===null?p.tail=null:w.sibling=null;break;case"collapsed":w=p.tail;for(var C=null;w!==null;)w.alternate!==null&&(C=w),w=w.sibling;C===null?g||p.tail===null?p.tail=null:p.tail.sibling=null:C.sibling=null}}function os(p){var g=p.alternate!==null&&p.alternate.child===p.child,w=0,C=0;if(g)for(var A=p.child;A!==null;)w|=A.lanes|A.childLanes,C|=A.subtreeFlags&14680064,C|=A.flags&14680064,A.return=p,A=A.sibling;else for(A=p.child;A!==null;)w|=A.lanes|A.childLanes,C|=A.subtreeFlags,C|=A.flags,A.return=p,A=A.sibling;
vendor: 28,696 bytes, line 99
99return p.subtreeFlags|=C,p.childLanes=w,g}function z_e(p,g,w){var C=g.pendingProps;switch(QP(g),g.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return os(g),null;case 1:return Ks(g.type)&&W1(),os(g),null;case 3:return C=g.stateNode,Sm(),an(Ys),an(ss),cM(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(p===null||p.child===null)&&(Q1(g)?g.flags|=4:p===null||p.memoizedState.isDehydrated&&(g.flags&256)===0||(g.flags|=1024,Wo!==null&&(FM(Wo),Wo=null))),jM(p,g),os(g),null;case 5:oM(g);var A=sh(G0.current);if(w=g.type,p!==null&&g.stateNode!=null)IW(p,g,w,C,A),p.ref!==g.ref&&(g.flags|=512,g.flags|=2097152);else{if(!C){if(g.stateNode===null)throw Error(r(166));return os(g),null}if(p=sh(El.current),Q1(g)){C=g.stateNode,w=g.type;var D=g.memoizedProps;switch(C[Cl]=g,C[F0]=D,p=(g.mode&1)!==0,w){case"dialog":sn("cancel",C),sn("close",C);break;case"iframe":case"object":case"embed":sn("load",C);break;case"video":case"audio":for(A=0;A<I0.length;A++)sn(I0[A],C);break;case"source":sn("error",C);break;case"img":case"image":case"link":sn("error",C),sn("load",C);break;case"details":sn("toggle",C);break;case"input":It(C,D),sn("invalid",C);break;case"select":C._wrapperState={wasMultiple:!!D.multiple},sn("invalid",C);break;case"textarea":Ee(C,D),sn("invalid",C)}Nn(w,D),A=null;for(var G in D)if(D.hasOwnProperty(G)){var Z=D[G];G==="children"?typeof Z=="string"?C.textContent!==Z&&(D.suppressHydrationWarning!==!0&&V1(C.textContent,Z,p),A=["children",Z]):typeof Z=="number"&&C.textContent!==""+Z&&(D.suppressHydrationWarning!==!0&&V1(C.textContent,Z,p),A=["children",""+Z]):i.hasOwnProperty(G)&&Z!=null&&G==="onScroll"&&sn("scroll",C)}switch(w){case"input":Ce(C),Qr(C,D,!0);break;case"textarea":Ce(C),Te(C);break;case"select":case"option":break;default:typeof D.onClick=="function"&&(C.onclick=U1)}C=A,g.updateQueue=C,C!==null&&(g.flags|=4)}else{G=A.nodeType===9?A:A.ownerDocument,p==="http://www.w3.org/1999/xhtml"&&(p=Qe(w)),p==="http://www.w3.org/1999/xhtml"?w==="script"?(p=G.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild)):typeof C.is=="string"?p=G.createElement(w,{is:C.is}):(p=G.createElement(w),w==="select"&&(G=p,C.multiple?G.multiple=!0:C.size&&(G.size=C.size))):p=G.createElementNS(p,w),p[Cl]=g,p[F0]=C,RW(p,g,!1,!1),g.stateNode=p;e:{switch(G=or(w,C),w){case"dialog":sn("cancel",p),sn("close",p),A=C;break;case"iframe":case"object":case"embed":sn("load",p),A=C;break;case"video":case"audio":for(A=0;A<I0.length;A++)sn(I0[A],p);A=C;break;case"source":sn("error",p),A=C;break;case"img":case"image":case"link":sn("error",p),sn("load",p),A=C;break;case"details":sn("toggle",p),A=C;break;case"input":It(p,C),A=De(p,C),sn("invalid",p);break;case"option":A=C;break;case"select":p._wrapperState={wasMultiple:!!C.multiple},A=K({},C,{value:void 0}),sn("invalid",p);break;case"textarea":Ee(p,C),A=de(p,C),sn("invalid",p);break;default:A=C}Nn(w,A),Z=A;for(D in Z)if(Z.hasOwnProperty(D)){var te=Z[D];D==="style"?Ni(p,te):D==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&jr(p,te)):D==="children"?typeof te=="string"?(w!=="textarea"||te!=="")&&Vr(p,te):typeof te=="number"&&Vr(p,""+te):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(i.hasOwnProperty(D)?te!=null&&D==="onScroll"&&sn("scroll",p):te!=null&&k(p,D,te,G))}switch(w){case"input":Ce(p),Qr(p,C,!1);break;case"textarea":Ce(p),Te(p);break;case"option":C.value!=null&&p.setAttribute("value",""+ge(C.value));break;case"select":p.multiple=!!C.multiple,D=C.value,D!=null?ae(p,!!C.multiple,D,!1):C.defaultValue!=null&&ae(p,!!C.multiple,C.defaultValue,!0);break;default:typeof A.onClick=="function"&&(p.onclick=U1)}switch(w){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}}C&&(g.flags|=4)}g.ref!==null&&(g.flags|=512,g.flags|=2097152)}return os(g),null;case 6:if(p&&g.stateNode!=null)LW(p,g,p.memoizedProps,C);else{if(typeof C!="string"&&g.stateNode===null)throw Error(r(166));if(w=sh(G0.current),sh(El.current),Q1(g)){if(C=g.stateNode,w=g.memoizedProps,C[Cl]=g,(D=C.nodeValue!==w)&&(p=ba,p!==null))switch(p.tag){case 3:V1(C.nodeValue,w,(p.mode&1)!==0);break;case 5:p.memoizedProps.suppressHydrationWarning!==!0&&V1(C.nodeValue,w,(p.mode&1)!==0)}D&&(g.flags|=4)}else C=(w.nodeType===9?w:w.ownerDocument).createTextNode(C),C[Cl]=g,g.stateNode=C}return os(g),null;case 13:if(an(wn),C=g.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(mn&&wa!==null&&(g.mode&1)!==0&&(g.flags&128)===0)zG(),xm(),g.flags|=98560,D=!1;else if(D=Q1(g),C!==null&&C.dehydrated!==null){if(p===null){if(!D)throw Error(r(318));if(D=g.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(r(317));D[Cl]=g}else xm(),(g.flags&128)===0&&(g.memoizedState=null),g.flags|=4;os(g),D=!1}else Wo!==null&&(FM(Wo),Wo=null),D=!0;if(!D)return g.flags&65536?g:null}return(g.flags&128)!==0?(g.lanes=w,g):(C=C!==null,C!==(p!==null&&p.memoizedState!==null)&&C&&(g.child.flags|=8192,(g.mode&1)!==0&&(p===null||(wn.current&1)!==0?yi===0&&(yi=3):VM())),g.updateQueue!==null&&(g.flags|=4),os(g),null);case 4:return Sm(),jM(p,g),p===null&&L0(g.stateNode.containerInfo),os(g),null;case 10:return rM(g.type._context),os(g),null;case 17:return Ks(g.type)&&W1(),os(g),null;case 19:if(an(wn),D=g.memoizedState,D===null)return os(g),null;if(C=(g.flags&128)!==0,G=D.rendering,G===null)if(C)K0(D,!1);else{if(yi!==0||p!==null&&(p.flags&128)!==0)for(p=g.child;p!==null;){if(G=r_(p),G!==null){for(g.flags|=128,K0(D,!1),C=G.updateQueue,C!==null&&(g.updateQueue=C,g.flags|=4),g.subtreeFlags=0,C=w,w=g.child;w!==null;)D=w,p=C,D.flags&=14680066,G=D.alternate,G===null?(D.childLanes=0,D.lanes=p,D.child=null,D.subtreeFlags=0,D.memoizedProps=null,D.memoizedState=null,D.updateQueue=null,D.dependencies=null,D.stateNode=null):(D.childLanes=G.childLanes,D.lanes=G.lanes,D.child=G.child,D.subtreeFlags=0,D.deletions=null,D.memoizedProps=G.memoizedProps,D.memoizedState=G.memoizedState,D.updateQueue=G.updateQueue,D.type=G.type,p=G.dependencies,D.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),w=w.sibling;return Xr(wn,wn.current&1|2),g.child}p=p.sibling}D.tail!==null&&br()>Em&&(g.flags|=128,C=!0,K0(D,!1),g.lanes=4194304)}else{if(!C)if(p=r_(G),p!==null){if(g.flags|=128,C=!0,w=p.updateQueue,w!==null&&(g.updateQueue=w,g.flags|=4),K0(D,!0),D.tail===null&&D.tailMode==="hidden"&&!G.alternate&&!mn)return os(g),null}else 2*br()-D.renderingStartTime>Em&&w!==1073741824&&(g.flags|=128,C=!0,K0(D,!1),g.lanes=4194304);D.isBackwards?(G.sibling=g.child,g.child=G):(w=D.last,w!==null?w.sibling=G:g.child=G,D.last=G)}return D.tail!==null?(g=D.tail,D.rendering=g,D.tail=g.sibling,D.renderingStartTime=br(),g.sibling=null,w=wn.current,Xr(wn,C?w&1|2:w&1),g):(os(g),null);case 22:case 23:return BM(),C=g.memoizedState!==null,p!==null&&p.memoizedState!==null!==C&&(g.flags|=8192),C&&(g.mode&1)!==0?(_a&1073741824)!==0&&(os(g),g.subtreeFlags&6&&(g.flags|=8192)):os(g),null;case 24:return null;case 25:return null}throw Error(r(156,g.tag))}function B_e(p,g){switch(QP(g),g.tag){case 1:return Ks(g.type)&&W1(),p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 3:return Sm(),an(Ys),an(ss),cM(),p=g.flags,(p&65536)!==0&&(p&128)===0?(g.flags=p&-65537|128,g):null;case 5:return oM(g),null;case 13:if(an(wn),p=g.memoizedState,p!==null&&p.dehydrated!==null){if(g.alternate===null)throw Error(r(340));xm()}return p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 19:return an(wn),null;case 4:return Sm(),null;case 10:return rM(g.type._context),null;case 22:case 23:return BM(),null;case 24:return null;default:return null}}var d_=!1,ls=!1,V_e=typeof WeakSet=="function"?WeakSet:Set,at=null;function Tm(p,g){var w=p.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(C){Mn(p,g,C)}else w.current=null}function NM(p,g,w){try{w()}catch(C){Mn(p,g,C)}}var $W=!1;function U_e(p,g){if(BP=M1,p=gG(),DP(p)){if("selectionStart"in p)var w={start:p.selectionStart,end:p.selectionEnd};else e:{w=(w=p.ownerDocument)&&w.defaultView||window;var C=w.getSelection&&w.getSelection();if(C&&C.rangeCount!==0){w=C.anchorNode;var A=C.anchorOffset,D=C.focusNode;C=C.focusOffset;try{w.nodeType,D.nodeType}catch{w=null;break e}var G=0,Z=-1,te=-1,pe=0,Ae=0,Ie=p,Ne=null;t:for(;;){for(var et;Ie!==w||A!==0&&Ie.nodeType!==3||(Z=G+A),Ie!==D||C!==0&&Ie.nodeType!==3||(te=G+C),Ie.nodeType===3&&(G+=Ie.nodeValue.length),(et=Ie.firstChild)!==null;)Ne=Ie,Ie=et;for(;;){if(Ie===p)break t;if(Ne===w&&++pe===A&&(Z=G),Ne===D&&++Ae===C&&(te=G),(et=Ie.nextSibling)!==null)break;Ie=Ne,Ne=Ie.parentNode}Ie=et}w=Z===-1||te===-1?null:{start:Z,end:te}}else w=null}w=w||{start:0,end:0}}else w=null;for(VP={focusedElem:p,selectionRange:w},M1=!1,at=g;at!==null;)if(g=at,p=g.child,(g.subtreeFlags&1028)!==0&&p!==null)p.return=g,at=p;else for(;at!==null;){g=at;try{var dt=g.alternate;if((g.flags&1024)!==0)switch(g.tag){case 0:case 11:case 15:break;case 1:if(dt!==null){var yt=dt.memoizedProps,Gn=dt.memoizedState,ce=g.stateNode,ne=ce.getSnapshotBeforeUpdate(g.elementType===g.type?yt:Ho(g.type,yt),Gn);ce.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var fe=g.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ze){Mn(g,g.return,ze)}if(p=g.sibling,p!==null){p.return=g.return,at=p;break}at=g.return}return dt=$W,$W=!1,dt}function Q0(p,g,w){var C=g.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var A=C=C.next;do{if((A.tag&p)===p){var D=A.destroy;A.destroy=void 0,D!==void 0&&NM(g,w,D)}A=A.next}while(A!==C)}}function f_(p,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var w=g=g.next;do{if((w.tag&p)===p){var C=w.create;w.destroy=C()}w=w.next}while(w!==g)}}function PM(p){var g=p.ref;if(g!==null){var w=p.stateNode;switch(p.tag){case 5:p=w;break;default:p=w}typeof g=="function"?g(p):g.current=p}}function FW(p){var g=p.alternate;g!==null&&(p.alternate=null,FW(g)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(g=p.stateNode,g!==null&&(delete g[Cl],delete g[F0],delete g[HP],delete g[T_e],delete g[C_e])),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function zW(p){return p.tag===5||p.tag===3||p.tag===4}function BW(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||zW(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function MM(p,g,w){var C=p.tag;if(C===5||C===6)p=p.stateNode,g?w.nodeType===8?w.parentNode.insertBefore(p,g):w.insertBefore(p,g):(w.nodeType===8?(g=w.parentNode,g.insertBefore(p,w)):(g=w,g.appendChild(p)),w=w._reactRootContainer,w!=null||g.onclick!==null||(g.onclick=U1));else if(C!==4&&(p=p.child,p!==null))for(MM(p,g,w),p=p.sibling;p!==null;)MM(p,g,w),p=p.sibling}function AM(p,g,w){var C=p.tag;if(C===5||C===6)p=p.stateNode,g?w.insertBefore(p,g):w.appendChild(p);else if(C!==4&&(p=p.child,p!==null))for(AM(p,g,w),p=p.sibling;p!==null;)AM(p,g,w),p=p.sibling}var Vi=null,qo=!1;function md(p,g,w){for(w=w.child;w!==null;)VW(p,g,w),w=w.sibling}function VW(p,g,w){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount(Un,w)}catch{}switch(w.tag){case 5:ls||Tm(w,g);case 6:var C=Vi,A=qo;Vi=null,md(p,g,w),Vi=C,qo=A,Vi!==null&&(qo?(p=Vi,w=w.stateNode,p.nodeType===8?p.parentNode.removeChild(w):p.removeChild(w)):Vi.removeChild(w.stateNode));break;case 18:Vi!==null&&(qo?(p=Vi,w=w.stateNode,p.nodeType===8?WP(p.parentNode,w):p.nodeType===1&&WP(p,w),j0(p)):WP(Vi,w.stateNode));break;case 4:C=Vi,A=qo,Vi=w.stateNode.containerInfo,qo=!0,md(p,g,w),Vi=C,qo=A;break;case 0:case 11:case 14:case 15:if(!ls&&(C=w.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){A=C=C.next;do{var D=A,G=D.destroy;D=D.tag,G!==void 0&&((D&2)!==0||(D&4)!==0)&&NM(w,g,G),A=A.next}while(A!==C)}md(p,g,w);break;case 1:if(!ls&&(Tm(w,g),C=w.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=w.memoizedProps,C.state=w.memoizedState,C.componentWillUnmount()}catch(Z){Mn(w,g,Z)}md(p,g,w);break;case 21:md(p,g,w);break;case 22:w.mode&1?(ls=(C=ls)||w.memoizedState!==null,md(p,g,w),ls=C):md(p,g,w);break;default:md(p,g,w)}}function UW(p){var g=p.updateQueue;if(g!==null){p.updateQueue=null;var w=p.stateNode;w===null&&(w=p.stateNode=new V_e),g.forEach(function(C){var A=X_e.bind(null,p,C);w.has(C)||(w.add(C),C.then(A,A))})}}function Yo(p,g){var w=g.deletions;if(w!==null)for(var C=0;C<w.length;C++){var A=w[C];try{var D=p,G=g,Z=G;e:for(;Z!==null;){switch(Z.tag){case 5:Vi=Z.stateNode,qo=!1;break e;case 3:Vi=Z.stateNode.containerInfo,qo=!0;break e;case 4:Vi=Z.stateNode.containerInfo,qo=!0;break e}Z=Z.return}if(Vi===null)throw Error(r(160));VW(D,G,A),Vi=null,qo=!1;var te=A.alternate;te!==null&&(te.return=null),A.return=null}catch(pe){Mn(A,g,pe)}}if(g.subtreeFlags&12854)for(g=g.child;g!==null;)GW(g,p),g=g.sibling}function GW(p,g){var w=p.alternate,C=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:if(Yo(g,p),Nl(p),C&4){try{Q0(3,p,p.return),f_(3,p)}catch(yt){Mn(p,p.return,yt)}try{Q0(5,p,p.return)}catch(yt){Mn(p,p.return,yt)}}break;case 1:Yo(g,p),Nl(p),C&512&&w!==null&&Tm(w,w.return);break;case 5:if(Yo(g,p),Nl(p),C&512&&w!==null&&Tm(w,w.return),p.flags&32){var A=p.stateNode;try{Vr(A,"")}catch(yt){Mn(p,p.return,yt)}}if(C&4&&(A=p.stateNode,A!=null)){var D=p.memoizedProps,G=w!==null?w.memoizedProps:D,Z=p.type,te=p.updateQueue;if(p.updateQueue=null,te!==null)try{Z==="input"&&D.type==="radio"&&D.name!=null&&Yt(A,D),or(Z,G);var pe=or(Z,D);for(G=0;G<te.length;G+=2){var Ae=te[G],Ie=te[G+1];Ae==="style"?Ni(A,Ie):Ae==="dangerouslySetInnerHTML"?jr(A,Ie):Ae==="children"?Vr(A,Ie):k(A,Ae,Ie,pe)}switch(Z){case"input":Qt(A,D);break;case"textarea":Me(A,D);break;case"select":var Ne=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!D.multiple;var et=D.value;et!=null?ae(A,!!D.multiple,et,!1):Ne!==!!D.multiple&&(D.defaultValue!=null?ae(A,!!D.multiple,D.defaultValue,!0):ae(A,!!D.multiple,D.multiple?[]:"",!1))}A[F0]=D}catch(yt){Mn(p,p.return,yt)}}break;case 6:if(Yo(g,p),Nl(p),C&4){if(p.stateNode===null)throw Error(r(162));A=p.stateNode,D=p.memoizedProps;try{A.nodeValue=D}catch(yt){Mn(p,p.return,yt)}}break;case 3:if(Yo(g,p),Nl(p),C&4&&w!==null&&w.memoizedState.isDehydrated)try{j0(g.containerInfo)}catch(yt){Mn(p,p.return,yt)}break;case 4:Yo(g,p),Nl(p);break;case 13:Yo(g,p),Nl(p),A=p.child,A.flags&8192&&(D=A.memoizedState!==null,A.stateNode.isHidden=D,!D||A.alternate!==null&&A.alternate.memoizedState!==null||(RM=br())),C&4&&UW(p);break;case 22:if(Ae=w!==null&&w.memoizedState!==null,p.mode&1?(ls=(pe=ls)||Ae,Yo(g,p),ls=pe):Yo(g,p),Nl(p),C&8192){if(pe=p.memoizedState!==null,(p.stateNode.isHidden=pe)&&!Ae&&(p.mode&1)!==0)for(at=p,Ae=p.child;Ae!==null;){for(Ie=at=Ae;at!==null;){switch(Ne=at,et=Ne.child,Ne.tag){case 0:case 11:case 14:case 15:Q0(4,Ne,Ne.return);break;case 1:Tm(Ne,Ne.return);var dt=Ne.stateNode;if(typeof dt.componentWillUnmount=="function"){C=Ne,w=Ne.return;try{g=C,dt.props=g.memoizedProps,dt.state=g.memoizedState,dt.componentWillUnmount()}catch(yt){Mn(C,w,yt)}}break;case 5:Tm(Ne,Ne.return);break;case 22:if(Ne.memoizedState!==null){qW(Ie);continue}}et!==null?(et.return=Ne,at=et):qW(Ie)}Ae=Ae.sibling}e:for(Ae=null,Ie=p;;){if(Ie.tag===5){if(Ae===null){Ae=Ie;try{A=Ie.stateNode,pe?(D=A.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none"):(Z=Ie.stateNode,te=Ie.memoizedProps.style,G=te!=null&&te.hasOwnProperty("display")?te.display:null,Z.style.display=Ur("display",G))}catch(yt){Mn(p,p.return,yt)}}}else if(Ie.tag===6){if(Ae===null)try{Ie.stateNode.nodeValue=pe?"":Ie.memoizedProps}catch(yt){Mn(p,p.return,yt)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===p)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===p)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===p)break e;Ae===Ie&&(Ae=null),Ie=Ie.return}Ae===Ie&&(Ae=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Yo(g,p),Nl(p),C&4&&UW(p);break;case 21:break;default:Yo(g,p),Nl(p)}}function Nl(p){var g=p.flags;if(g&2){try{e:{for(var w=p.return;w!==null;){if(zW(w)){var C=w;break e}w=w.return}throw Error(r(160))}switch(C.tag){case 5:var A=C.stateNode;C.flags&32&&(Vr(A,""),C.flags&=-33);var D=BW(p);AM(p,D,A);break;case 3:case 4:var G=C.stateNode.containerInfo,Z=BW(p);MM(p,Z,G);break;default:throw Error(r(161))}}catch(te){Mn(p,p.return,te)}p.flags&=-3}g&4096&&(p.flags&=-4097)}function G_e(p,g,w){at=p,WW(p)}function WW(p,g,w){for(var C=(p.mode&1)!==0;at!==null;){var A=at,D=A.child;if(A.tag===22&&C){var G=A.memoizedState!==null||d_;if(!G){var Z=A.alternate,te=Z!==null&&Z.memoizedState!==null||ls;Z=d_;var pe=ls;if(d_=G,(ls=te)&&!pe)for(at=A;at!==null;)G=at,te=G.child,G.tag===22&&G.memoizedState!==null?YW(A):te!==null?(te.return=G,at=te):YW(A);for(;D!==null;)at=D,WW(D),D=D.sibling;at=A,d_=Z,ls=pe}HW(p)}else(A.subtreeFlags&8772)!==0&&D!==null?(D.return=A,at=D):HW(p)}}function HW(p){for(;at!==null;){var g=at;if((g.flags&8772)!==0){var w=g.alternate;try{if((g.flags&8772)!==0)switch(g.tag){case 0:case 11:case 15:ls||f_(5,g);break;case 1:var C=g.stateNode;if(g.flags&4&&!ls)if(w===null)C.componentDidMount();else{var A=g.elementType===g.type?w.memoizedProps:Ho(g.type,w.memoizedProps);C.componentDidUpdate(A,w.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var D=g.updateQueue;D!==null&&qG(g,D,C);break;case 3:var G=g.updateQueue;if(G!==null){if(w=null,g.child!==null)switch(g.child.tag){case 5:w=g.child.stateNode;break;case 1:w=g.child.stateNode}qG(g,G,w)}break;case 5:var Z=g.stateNode;if(w===null&&g.flags&4){w=Z;var te=g.memoizedProps;switch(g.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&w.focus();break;case"img":te.src&&(w.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(g.memoizedState===null){var pe=g.alternate;if(pe!==null){var Ae=pe.memoizedState;if(Ae!==null){var Ie=Ae.dehydrated;Ie!==null&&j0(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ls||g.flags&512&&PM(g)}catch(Ne){Mn(g,g.return,Ne)}}if(g===p){at=null;break}if(w=g.sibling,w!==null){w.return=g.return,at=w;break}at=g.return}}function qW(p){for(;at!==null;){var g=at;if(g===p){at=null;break}var w=g.sibling;if(w!==null){w.return=g.return,at=w;break}at=g.return}}function YW(p){for(;at!==null;){var g=at;try{switch(g.tag){case 0:case 11:case 15:var w=g.return;try{f_(4,g)}catch(te){Mn(g,w,te)}break;case 1:var C=g.stateNode;if(typeof C.componentDidMount=="function"){var A=g.return;try{C.componentDidMount()}catch(te){Mn(g,A,te)}}var D=g.return;try{PM(g)}catch(te){Mn(g,D,te)}break;case 5:var G=g.return;try{PM(g)}catch(te){Mn(g,G,te)}}}catch(te){Mn(g,g.return,te)}if(g===p){at=null;break}var Z=g.sibling;if(Z!==null){Z.return=g.return,at=Z;break}at=g.return}}var W_e=Math.ceil,h_=E.ReactCurrentDispatcher,DM=E.ReactCurrentOwner,Xa=E.ReactCurrentBatchConfig,vr=0,Mi=null,ti=null,Ui=0,_a=0,Cm=ud(0),yi=0,Z0=null,oh=0,p_=0,OM=0,X0=null,Zs=null,RM=0,Em=1/0,$c=null,m_=!1,IM=null,gd=null,g_=!1,yd=null,y_=0,J0=0,LM=null,v_=-1,x_=0;function js(){return(vr&6)!==0?br():v_!==-1?v_:v_=br()}function vd(p){return(p.mode&1)===0?1:(vr&2)!==0&&Ui!==0?Ui&-Ui:j_e.transition!==null?(x_===0&&(x_=B6()),x_):(p=Or,p!==0||(p=window.event,p=p===void 0?16:Q6(p.type)),p)}function Ko(p,g,w,C){if(50<J0)throw J0=0,LM=null,Error(r(185));S0(p,w,C),((vr&2)===0||p!==Mi)&&(p===Mi&&((vr&2)===0&&(p_|=w),yi===4&&xd(p,Ui)),Xs(p,C),w===1&&vr===0&&(g.mode&1)===0&&(Em=br()+500,q1&&fd()))}function Xs(p,g){var w=p.callbackNode;j1e(p,g);var C=j1(p,p===Mi?Ui:0);if(C===0)w!==null&&Sl(w),p.callbackNode=null,p.callbackPriority=0;else if(g=C&-C,p.callbackPriority!==g){if(w!=null&&Sl(w),g===1)p.tag===0?E_e(QW.bind(null,p)):RG(QW.bind(null,p)),S_e(function(){(vr&6)===0&&fd()}),w=null;else{switch(V6(C)){case 1:w=jc;break;case 4:w=Tl;break;case 16:w=Nc;break;case 536870912:w=dr;break;default:w=Nc}w=iH(w,KW.bind(null,p))}p.callbackPriority=g,p.callbackNode=w}}function KW(p,g){if(v_=-1,x_=0,(vr&6)!==0)throw Error(r(327));var w=p.callbackNode;if(jm()&&p.callbackNode!==w)return null;var C=j1(p,p===Mi?Ui:0);if(C===0)return null;if((C&30)!==0||(C&p.expiredLanes)!==0||g)g=b_(p,C);else{g=C;var A=vr;vr|=2;var D=XW();(Mi!==p||Ui!==g)&&($c=null,Em=br()+500,ch(p,g));do try{Y_e();break}catch(Z){ZW(p,Z)}while(!0);tM(),h_.current=D,vr=A,ti!==null?g=0:(Mi=null,Ui=0,g=yi)}if(g!==0){if(g===2&&(A=yP(p),A!==0&&(C=A,g=$M(p,A))),g===1)throw w=Z0,ch(p,0),xd(p,C),Xs(p,br()),w;if(g===6)xd(p,C);else{if(A=p.current.alternate,(C&30)===0&&!H_e(A)&&(g=b_(p,C),g===2&&(D=yP(p),D!==0&&(C=D,g=$M(p,D))),g===1))throw w=Z0,ch(p,0),xd(p,C),Xs(p,br()),w;switch(p.finishedWork=A,p.finishedLanes=C,g){case 0:case 1:throw Error(r(345));case 2:uh(p,Zs,$c);break;case 3:if(xd(p,C),(C&130023424)===C&&(g=RM+500-br(),10<g)){if(j1(p,0)!==0)break;if(A=p.suspendedLanes,(A&C)!==C){js(),p.pingedLanes|=p.suspendedLanes&A;break}p.timeoutHandle=GP(uh.bind(null,p,Zs,$c),g);break}uh(p,Zs,$c);break;case 4:if(xd(p,C),(C&4194240)===C)break;for(g=p.eventTimes,A=-1;0<C;){var G=31-Tr(C);D=1<<G,G=g[G],G>A&&(A=G),C&=~D}if(C=A,C=br()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*W_e(C/1960))-C,10<C){p.timeoutHandle=GP(uh.bind(null,p,Zs,$c),C);break}uh(p,Zs,$c);break;case 5:uh(p,Zs,$c);break;default:throw Error(r(329))}}}return Xs(p,br()),p.callbackNode===w?KW.bind(null,p):null}function $M(p,g){var w=X0;return p.current.memoizedState.isDehydrated&&(ch(p,g).flags|=256),p=b_(p,g),p!==2&&(g=Zs,Zs=w,g!==null&&FM(g)),p}function FM(p){Zs===null?Zs=p:Zs.push.apply(Zs,p)}function H_e(p){for(var g=p;;){if(g.flags&16384){var w=g.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var C=0;C<w.length;C++){var A=w[C],D=A.getSnapshot;A=A.value;try{if(!Go(D(),A))return!1}catch{return!1}}}if(w=g.child,g.subtreeFlags&16384&&w!==null)w.return=g,g=w;else{if(g===p)break;for(;g.sibling===null;){if(g.return===null||g.return===p)return!0;g=g.return}g.sibling.return=g.return,g=g.sibling}}return!0}function xd(p,g){for(g&=~OM,g&=~p_,p.suspendedLanes|=g,p.pingedLanes&=~g,p=p.expirationTimes;0<g;){var w=31-Tr(g),C=1<<w;p[w]=-1,g&=~C}}function QW(p){if((vr&6)!==0)throw Error(r(327));jm();var g=j1(p,0);if((g&1)===0)return Xs(p,br()),null;var w=b_(p,g);if(p.tag!==0&&w===2){var C=yP(p);C!==0&&(g=C,w=$M(p,C))}if(w===1)throw w=Z0,ch(p,0),xd(p,g),Xs(p,br()),w;if(w===6)throw Error(r(345));return p.finishedWork=p.current.alternate,p.finishedLanes=g,uh(p,Zs,$c),Xs(p,br()),null}function zM(p,g){var w=vr;vr|=1;try{return p(g)}finally{vr=w,vr===0&&(Em=br()+500,q1&&fd())}}function lh(p){yd!==null&&yd.tag===0&&(vr&6)===0&&jm();var g=vr;vr|=1;var w=Xa.transition,C=Or;try{if(Xa.transition=null,Or=1,p)return p()}finally{Or=C,Xa.transition=w,vr=g,(vr&6)===0&&fd()}}function BM(){_a=Cm.current,an(Cm)}function ch(p,g){p.finishedWork=null,p.finishedLanes=0;var w=p.timeoutHandle;if(w!==-1&&(p.timeoutHandle=-1,__e(w)),ti!==null)for(w=ti.return;w!==null;){var C=w;switch(QP(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&W1();break;case 3:Sm(),an(Ys),an(ss),cM();break;case 5:oM(C);break;case 4:Sm();break;case 13:an(wn);break;case 19:an(wn);break;case 10:rM(C.type._context);break;case 22:case 23:BM()}w=w.return}if(Mi=p,ti=p=bd(p.current,null),Ui=_a=g,yi=0,Z0=null,OM=p_=oh=0,Zs=X0=null,ih!==null){for(g=0;g<ih.length;g++)if(w=ih[g],C=w.interleaved,C!==null){w.interleaved=null;var A=C.next,D=w.pending;if(D!==null){var G=D.next;D.next=A,C.next=G}w.pending=C}ih=null}return p}function ZW(p,g){do{var w=ti;try{if(tM(),n_.current=o_,i_){for(var C=_n.memoizedState;C!==null;){var A=C.queue;A!==null&&(A.pending=null),C=C.next}i_=!1}if(ah=0,Pi=gi=_n=null,W0=!1,H0=0,DM.current=null,w===null||w.return===null){yi=1,Z0=g,ti=null;break}e:{var D=p,G=w.return,Z=w,te=g;if(g=Ui,Z.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=te,Ae=Z,Ie=Ae.tag;if((Ae.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var Ne=Ae.alternate;Ne?(Ae.updateQueue=Ne.updateQueue,Ae.memoizedState=Ne.memoizedState,Ae.lanes=Ne.lanes):(Ae.updateQueue=null,Ae.memoizedState=null)}var et=_W(G);if(et!==null){et.flags&=-257,SW(et,G,Z,D,g),et.mode&1&&wW(D,pe,g),g=et,te=pe;var dt=g.updateQueue;if(dt===null){var yt=new Set;yt.add(te),g.updateQueue=yt}else dt.add(te);break e}else{if((g&1)===0){wW(D,pe,g),VM();break e}te=Error(r(426))}}else if(mn&&Z.mode&1){var Gn=_W(G);if(Gn!==null){(Gn.flags&65536)===0&&(Gn.flags|=256),SW(Gn,G,Z,D,g),JP(km(te,Z));break e}}D=te=km(te,Z),yi!==4&&(yi=2),X0===null?X0=[D]:X0.push(D),D=G;do{switch(D.tag){case 3:D.flags|=65536,g&=-g,D.lanes|=g;var ce=xW(D,te,g);HG(D,ce);break e;case 1:Z=te;var ne=D.type,fe=D.stateNode;if((D.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(gd===null||!gd.has(fe)))){D.flags|=65536,g&=-g,D.lanes|=g;var ze=bW(D,Z,g);HG(D,ze);break e}}D=D.return}while(D!==null)}eH(w)}catch(wt){g=wt,ti===w&&w!==null&&(ti=w=w.return);continue}break}while(!0)}function XW(){var p=h_.current;return h_.current=o_,p===null?o_:p}function VM(){(yi===0||yi===3||yi===2)&&(yi=4),Mi===null||(oh&268435455)===0&&(p_&268435455)===0||xd(Mi,Ui)}function b_(p,g){var w=vr;vr|=2;var C=XW();(Mi!==p||Ui!==g)&&($c=null,ch(p,g));do try{q_e();break}catch(A){ZW(p,A)}while(!0);if(tM(),vr=w,h_.current=C,ti!==null)throw Error(r(261));return Mi=null,Ui=0,yi}function q_e(){for(;ti!==null;)JW(ti)}function Y_e(){for(;ti!==null&&!Jf();)JW(ti)}function JW(p){var g=nH(p.alternate,p,_a);p.memoizedProps=p.pendingProps,g===null?eH(p):ti=g,DM.current=null}function eH(p){var g=p;do{var w=g.alternate;if(p=g.return,(g.flags&32768)===0){if(w=z_e(w,g,_a),w!==null){ti=w;return}}else{if(w=B_e(w,g),w!==null){w.flags&=32767,ti=w;return}if(p!==null)p.flags|=32768,p.subtreeFlags=0,p.deletions=null;else{yi=6,ti=null;return}}if(g=g.sibling,g!==null){ti=g;return}ti=g=p}while(g!==null);yi===0&&(yi=5)}function uh(p,g,w){var C=Or,A=Xa.transition;try{Xa.transition=null,Or=1,K_e(p,g,w,C)}finally{Xa.transition=A,Or=C}return null}function K_e(p,g,w,C){do jm();while(yd!==null);if((vr&6)!==0)throw Error(r(327));w=p.finishedWork;var A=p.finishedLanes;if(w===null)return null;if(p.finishedWork=null,p.finishedLanes=0,w===p.current)throw Error(r(177));p.callbackNode=null,p.callbackPriority=0;var D=w.lanes|w.childLanes;if(N1e(p,D),p===Mi&&(ti=Mi=null,Ui=0),(w.subtreeFlags&2064)===0&&(w.flags&2064)===0||g_||(g_=!0,iH(Nc,function(){return jm(),null})),D=(w.flags&15990)!==0,(w.subtreeFlags&15990)!==0||D){D=Xa.transition,Xa.transition=null;var G=Or;Or=1;var Z=vr;vr|=4,DM.current=null,U_e(p,w),GW(w,p),m_e(VP),M1=!!BP,VP=BP=null,p.current=w,G_e(w),kl(),vr=Z,Or=G,Xa.transition=D}else p.current=w;if(g_&&(g_=!1,yd=p,y_=A),D=p.pendingLanes,D===0&&(gd=null),Pc(w.stateNode),Xs(p,br()),g!==null)for(C=p.onRecoverableError,w=0;w<g.length;w++)A=g[w],C(A.value,{componentStack:A.stack,digest:A.digest});if(m_)throw m_=!1,p=IM,IM=null,p;return(y_&1)!==0&&p.tag!==0&&jm(),D=p.pendingLanes,(D&1)!==0?p===LM?J0++:(J0=0,LM=p):J0=0,fd(),null}function jm(){if(yd!==null){var p=V6(y_),g=Xa.transition,w=Or;try{if(Xa.transition=null,Or=16>p?16:p,yd===null)var C=!1;else{if(p=yd,yd=null,y_=0,(vr&6)!==0)throw Error(r(331));var A=vr;for(vr|=4,at=p.current;at!==null;){var D=at,G=D.child;if((at.flags&16)!==0){var Z=D.deletions;if(Z!==null){for(var te=0;te<Z.length;te++){var pe=Z[te];for(at=pe;at!==null;){var Ae=at;switch(Ae.tag){case 0:case 11:case 15:Q0(8,Ae,D)}var Ie=Ae.child;if(Ie!==null)Ie.return=Ae,at=Ie;else for(;at!==null;){Ae=at;var Ne=Ae.sibling,et=Ae.return;if(FW(Ae),Ae===pe){at=null;break}if(Ne!==null){Ne.return=et,at=Ne;break}at=et}}}var dt=D.alternate;if(dt!==null){var yt=dt.child;if(yt!==null){dt.child=null;do{var Gn=yt.sibling;yt.sibling=null,yt=Gn}while(yt!==null)}}at=D}}if((D.subtreeFlags&2064)!==0&&G!==null)G.return=D,at=G;else e:for(;at!==null;){if(D=at,(D.flags&2048)!==0)switch(D.tag){case 0:case 11:case 15:Q0(9,D,D.return)}var ce=D.sibling;if(ce!==null){ce.return=D.return,at=ce;break e}at=D.return}}var ne=p.current;for(at=ne;at!==null;){G=at;var fe=G.child;if((G.subtreeFlags&2064)!==0&&fe!==null)fe.return=G,at=fe;else e:for(G=ne;at!==null;){if(Z=at,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:f_(9,Z)}}catch(wt){Mn(Z,Z.return,wt)}if(Z===G){at=null;break e}var ze=Z.sibling;if(ze!==null){ze.return=Z.return,at=ze;break e}at=Z.return}}if(vr=A,fd(),Bi&&typeof Bi.onPostCommitFiberRoot=="function")try{Bi.onPostCommitFiberRoot(Un,p)}catch{}C=!0}return C}finally{Or=w,Xa.transition=g}}return!1}
vendor: 1,052 bytes, line 99
99function tH(p,g,w){g=km(w,g),g=xW(p,g,1),p=pd(p,g,1),g=js(),p!==null&&(S0(p,1,g),Xs(p,g))}function Mn(p,g,w){if(p.tag===3)tH(p,p,w);else for(;g!==null;){if(g.tag===3){tH(g,p,w);break}else if(g.tag===1){var C=g.stateNode;if(typeof g.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(gd===null||!gd.has(C))){p=km(w,p),p=bW(g,p,1),g=pd(g,p,1),p=js(),g!==null&&(S0(g,1,p),Xs(g,p));break}}g=g.return}}function Q_e(p,g,w){var C=p.pingCache;C!==null&&C.delete(g),g=js(),p.pingedLanes|=p.suspendedLanes&w,Mi===p&&(Ui&w)===w&&(yi===4||yi===3&&(Ui&130023424)===Ui&&500>br()-RM?ch(p,0):OM|=w),Xs(p,g)}function rH(p,g){g===0&&((p.mode&1)===0?g=1:(g=E1,E1<<=1,(E1&130023424)===0&&(E1=4194304)));var w=js();p=Rc(p,g),p!==null&&(S0(p,g,w),Xs(p,w))}function Z_e(p){var g=p.memoizedState,w=0;g!==null&&(w=g.retryLane),rH(p,w)}function X_e(p,g){var w=0;switch(p.tag){case 13:var C=p.stateNode,A=p.memoizedState;A!==null&&(w=A.retryLane);break;case 19:C=p.stateNode;break;default:throw Error(r(314))}C!==null&&C.delete(g),rH(p,w)}var nH;
vendor: 12,650 bytes, line 99
99nH=function(p,g,w){if(p!==null)if(p.memoizedProps!==g.pendingProps||Ys.current)Qs=!0;else{if((p.lanes&w)===0&&(g.flags&128)===0)return Qs=!1,F_e(p,g,w);Qs=(p.flags&131072)!==0}else Qs=!1,mn&&(g.flags&1048576)!==0&&IG(g,K1,g.index);switch(g.lanes=0,g.tag){case 2:var C=g.type;u_(p,g),p=g.pendingProps;var A=gm(g,ss.current);_m(g,w),A=fM(null,g,C,p,A,w);var D=hM();return g.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,Ks(C)?(D=!0,H1(g)):D=!1,g.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,sM(g),A.updater=l_,g.stateNode=A,A._reactInternals=g,xM(g,C,p,w),g=SM(null,g,C,!0,D,w)):(g.tag=0,mn&&D&&KP(g),Es(null,g,A,w),g=g.child),g;case 16:C=g.elementType;e:{switch(u_(p,g),p=g.pendingProps,A=C._init,C=A(C._payload),g.type=C,A=g.tag=eSe(C),p=Ho(C,p),A){case 0:g=_M(null,g,C,p,w);break e;case 1:g=NW(null,g,C,p,w);break e;case 11:g=kW(null,g,C,p,w);break e;case 14:g=TW(null,g,C,Ho(C.type,p),w);break e}throw Error(r(306,C,""))}return g;case 0:return C=g.type,A=g.pendingProps,A=g.elementType===C?A:Ho(C,A),_M(p,g,C,A,w);case 1:return C=g.type,A=g.pendingProps,A=g.elementType===C?A:Ho(C,A),NW(p,g,C,A,w);case 3:e:{if(PW(g),p===null)throw Error(r(387));C=g.pendingProps,D=g.memoizedState,A=D.element,WG(p,g),t_(g,C,null,w);var G=g.memoizedState;if(C=G.element,D.isDehydrated)if(D={element:C,isDehydrated:!1,cache:G.cache,pendingSuspenseBoundaries:G.pendingSuspenseBoundaries,transitions:G.transitions},g.updateQueue.baseState=D,g.memoizedState=D,g.flags&256){A=km(Error(r(423)),g),g=MW(p,g,C,w,A);break e}else if(C!==A){A=km(Error(r(424)),g),g=MW(p,g,C,w,A);break e}else for(wa=cd(g.stateNode.containerInfo.firstChild),ba=g,mn=!0,Wo=null,w=UG(g,null,C,w),g.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(xm(),C===A){g=Lc(p,g,w);break e}Es(p,g,C,w)}g=g.child}return g;case 5:return YG(g),p===null&&XP(g),C=g.type,A=g.pendingProps,D=p!==null?p.memoizedProps:null,G=A.children,UP(C,A)?G=null:D!==null&&UP(C,D)&&(g.flags|=32),jW(p,g),Es(p,g,G,w),g.child;case 6:return p===null&&XP(g),null;case 13:return AW(p,g,w);case 4:return aM(g,g.stateNode.containerInfo),C=g.pendingProps,p===null?g.child=bm(g,null,C,w):Es(p,g,C,w),g.child;case 11:return C=g.type,A=g.pendingProps,A=g.elementType===C?A:Ho(C,A),kW(p,g,C,A,w);case 7:return Es(p,g,g.pendingProps,w),g.child;case 8:return Es(p,g,g.pendingProps.children,w),g.child;case 12:return Es(p,g,g.pendingProps.children,w),g.child;case 10:e:{if(C=g.type._context,A=g.pendingProps,D=g.memoizedProps,G=A.value,Xr(X1,C._currentValue),C._currentValue=G,D!==null)if(Go(D.value,G)){if(D.children===A.children&&!Ys.current){g=Lc(p,g,w);break e}}else for(D=g.child,D!==null&&(D.return=g);D!==null;){var Z=D.dependencies;if(Z!==null){G=D.child;for(var te=Z.firstContext;te!==null;){if(te.context===C){if(D.tag===1){te=Ic(-1,w&-w),te.tag=2;var pe=D.updateQueue;if(pe!==null){pe=pe.shared;var Ae=pe.pending;Ae===null?te.next=te:(te.next=Ae.next,Ae.next=te),pe.pending=te}}D.lanes|=w,te=D.alternate,te!==null&&(te.lanes|=w),nM(D.return,w,g),Z.lanes|=w;break}te=te.next}}else if(D.tag===10)G=D.type===g.type?null:D.child;else if(D.tag===18){if(G=D.return,G===null)throw Error(r(341));G.lanes|=w,Z=G.alternate,Z!==null&&(Z.lanes|=w),nM(G,w,g),G=D.sibling}else G=D.child;if(G!==null)G.return=D;else for(G=D;G!==null;){if(G===g){G=null;break}if(D=G.sibling,D!==null){D.return=G.return,G=D;break}G=G.return}D=G}Es(p,g,A.children,w),g=g.child}return g;case 9:return A=g.type,C=g.pendingProps.children,_m(g,w),A=Qa(A),C=C(A),g.flags|=1,Es(p,g,C,w),g.child;case 14:return C=g.type,A=Ho(C,g.pendingProps),A=Ho(C.type,A),TW(p,g,C,A,w);case 15:return CW(p,g,g.type,g.pendingProps,w);case 17:return C=g.type,A=g.pendingProps,A=g.elementType===C?A:Ho(C,A),u_(p,g),g.tag=1,Ks(C)?(p=!0,H1(g)):p=!1,_m(g,w),yW(g,C,A),xM(g,C,A,w),SM(null,g,C,!0,p,w);case 19:return OW(p,g,w);case 22:return EW(p,g,w)}throw Error(r(156,g.tag))};function iH(p,g){return Fr(p,g)}function J_e(p,g,w,C){this.tag=p,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ja(p,g,w,C){return new J_e(p,g,w,C)}function UM(p){return p=p.prototype,!(!p||!p.isReactComponent)}function eSe(p){if(typeof p=="function")return UM(p)?1:0;if(p!=null){if(p=p.$$typeof,p===B)return 11;if(p===$)return 14}return 2}function bd(p,g){var w=p.alternate;return w===null?(w=Ja(p.tag,g,p.key,p.mode),w.elementType=p.elementType,w.type=p.type,w.stateNode=p.stateNode,w.alternate=p,p.alternate=w):(w.pendingProps=g,w.type=p.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=p.flags&14680064,w.childLanes=p.childLanes,w.lanes=p.lanes,w.child=p.child,w.memoizedProps=p.memoizedProps,w.memoizedState=p.memoizedState,w.updateQueue=p.updateQueue,g=p.dependencies,w.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},w.sibling=p.sibling,w.index=p.index,w.ref=p.ref,w}function w_(p,g,w,C,A,D){var G=2;if(C=p,typeof p=="function")UM(p)&&(G=1);else if(typeof p=="string")G=5;else e:switch(p){case j:return dh(w.children,A,D,g);case M:G=8,A|=8;break;case O:return p=Ja(12,w,g,A|2),p.elementType=O,p.lanes=D,p;case F:return p=Ja(13,w,g,A),p.elementType=F,p.lanes=D,p;case V:return p=Ja(19,w,g,A),p.elementType=V,p.lanes=D,p;case z:return __(w,A,D,g);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case R:G=10;break e;case I:G=9;break e;case B:G=11;break e;case $:G=14;break e;case U:G=16,C=null;break e}throw Error(r(130,p==null?p:typeof p,""))}return g=Ja(G,w,g,A),g.elementType=p,g.type=C,g.lanes=D,g}function dh(p,g,w,C){return p=Ja(7,p,C,g),p.lanes=w,p}function __(p,g,w,C){return p=Ja(22,p,C,g),p.elementType=z,p.lanes=w,p.stateNode={isHidden:!1},p}function GM(p,g,w){return p=Ja(6,p,null,g),p.lanes=w,p}function WM(p,g,w){return g=Ja(4,p.children!==null?p.children:[],p.key,g),g.lanes=w,g.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},g}function tSe(p,g,w,C,A){this.tag=g,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vP(0),this.expirationTimes=vP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vP(0),this.identifierPrefix=C,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function HM(p,g,w,C,A,D,G,Z,te){return p=new tSe(p,g,w,Z,te),g===1?(g=1,D===!0&&(g|=8)):g=0,D=Ja(3,null,null,g),p.current=D,D.stateNode=p,D.memoizedState={element:C,isDehydrated:w,cache:null,transitions:null,pendingSuspenseBoundaries:null},sM(D),p}function rSe(p,g,w){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:C==null?null:""+C,children:p,containerInfo:g,implementation:w}}function sH(p){if(!p)return dd;p=p._reactInternals;e:{if(Oe(p)!==p||p.tag!==1)throw Error(r(170));var g=p;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(Ks(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(r(171))}if(p.tag===1){var w=p.type;if(Ks(w))return DG(p,w,g)}return g}function aH(p,g,w,C,A,D,G,Z,te){return p=HM(w,C,!0,p,A,D,G,Z,te),p.context=sH(null),w=p.current,C=js(),A=vd(w),D=Ic(C,A),D.callback=g??null,pd(w,D,A),p.current.lanes=A,S0(p,A,C),Xs(p,C),p}function S_(p,g,w,C){var A=g.current,D=js(),G=vd(A);return w=sH(w),g.context===null?g.context=w:g.pendingContext=w,g=Ic(D,G),g.payload={element:p},C=C===void 0?null:C,C!==null&&(g.callback=C),p=pd(A,g,G),p!==null&&(Ko(p,A,G,D),e_(p,A,G)),G}function k_(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return p.child.stateNode;default:return p.child.stateNode}}function oH(p,g){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var w=p.retryLane;p.retryLane=w!==0&&w<g?w:g}}function qM(p,g){oH(p,g),(p=p.alternate)&&oH(p,g)}function nSe(){return null}var lH=typeof reportError=="function"?reportError:function(p){console.error(p)};function YM(p){this._internalRoot=p}T_.prototype.render=YM.prototype.render=function(p){var g=this._internalRoot;if(g===null)throw Error(r(409));S_(p,g,null,null)},T_.prototype.unmount=YM.prototype.unmount=function(){var p=this._internalRoot;if(p!==null){this._internalRoot=null;var g=p.containerInfo;lh(function(){S_(null,p,null,null)}),g[Mc]=null}};function T_(p){this._internalRoot=p}T_.prototype.unstable_scheduleHydration=function(p){if(p){var g=W6();p={blockedOn:null,target:p,priority:g};for(var w=0;w<ad.length&&g!==0&&g<ad[w].priority;w++);ad.splice(w,0,p),w===0&&Y6(p)}};function KM(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)}function C_(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11&&(p.nodeType!==8||p.nodeValue!==" react-mount-point-unstable "))}function cH(){}function iSe(p,g,w,C,A){if(A){if(typeof C=="function"){var D=C;C=function(){var pe=k_(G);D.call(pe)}}var G=aH(g,C,p,0,null,!1,!1,"",cH);return p._reactRootContainer=G,p[Mc]=G.current,L0(p.nodeType===8?p.parentNode:p),lh(),G}for(;A=p.lastChild;)p.removeChild(A);if(typeof C=="function"){var Z=C;C=function(){var pe=k_(te);Z.call(pe)}}var te=HM(p,0,!1,null,null,!1,!1,"",cH);return p._reactRootContainer=te,p[Mc]=te.current,L0(p.nodeType===8?p.parentNode:p),lh(function(){S_(g,te,w,C)}),te}function E_(p,g,w,C,A){var D=w._reactRootContainer;if(D){var G=D;if(typeof A=="function"){var Z=A;A=function(){var te=k_(G);Z.call(te)}}S_(g,G,p,A)}else G=iSe(w,g,p,A,C);return k_(G)}U6=function(p){switch(p.tag){case 3:var g=p.stateNode;if(g.current.memoizedState.isDehydrated){var w=_0(g.pendingLanes);w!==0&&(xP(g,w|1),Xs(g,br()),(vr&6)===0&&(Em=br()+500,fd()))}break;case 13:lh(function(){var C=Rc(p,1);if(C!==null){var A=js();Ko(C,p,1,A)}}),qM(p,1)}},bP=function(p){if(p.tag===13){var g=Rc(p,134217728);if(g!==null){var w=js();Ko(g,p,134217728,w)}qM(p,134217728)}},G6=function(p){if(p.tag===13){var g=vd(p),w=Rc(p,g);if(w!==null){var C=js();Ko(w,p,g,C)}qM(p,g)}},W6=function(){return Or},H6=function(p,g){var w=Or;try{return Or=p,g()}finally{Or=w}},We=function(p,g,w){switch(g){case"input":if(Qt(p,w),g=w.name,w.type==="radio"&&g!=null){for(w=p;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll("input[name="+JSON.stringify(""+g)+'][type="radio"]'),g=0;g<w.length;g++){var C=w[g];if(C!==p&&C.form===p.form){var A=G1(C);if(!A)throw Error(r(90));he(C),Qt(C,A)}}}break;case"textarea":Me(p,w);break;case"select":g=w.value,g!=null&&ae(p,!!w.multiple,g,!1)}},cr=zM,Jt=lh;var sSe={usingClientEntryPoint:!1,Events:[z0,pm,G1,it,Wt,zM]},ev={findFiberByHostInstance:eh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aSe={bundleType:ev.bundleType,version:ev.version,rendererPackageName:ev.rendererPackageName,rendererConfig:ev.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(p){return p=Pn(p),p===null?null:p.stateNode},findFiberByHostInstance:ev.findFiberByHostInstance||nSe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var j_=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!j_.isDisabled&&j_.supportsFiber)try{Un=j_.inject(aSe),Bi=j_}catch{}}return Js.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sSe,Js.createPortal=function(p,g){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!KM(g))throw Error(r(200));return rSe(p,g,null,w)},Js.createRoot=function(p,g){if(!KM(p))throw Error(r(299));var w=!1,C="",A=lH;return g!=null&&(g.unstable_strictMode===!0&&(w=!0),g.identifierPrefix!==void 0&&(C=g.identifierPrefix),g.onRecoverableError!==void 0&&(A=g.onRecoverableError)),g=HM(p,1,!1,null,null,w,!1,C,A),p[Mc]=g.current,L0(p.nodeType===8?p.parentNode:p),new YM(g)},Js.findDOMNode=function(p){if(p==null)return null;if(p.nodeType===1)return p;var g=p._reactInternals;if(g===void 0)throw typeof p.render=="function"?Error(r(188)):(p=Object.keys(p).join(","),Error(r(268,p)));return p=Pn(g),p=p===null?null:p.stateNode,p},Js.flushSync=function(p){return lh(p)}
vendor: 27,155 bytes, line 99
99,Js.hydrate=function(p,g,w){if(!C_(g))throw Error(r(200));return E_(null,p,g,!0,w)},Js.hydrateRoot=function(p,g,w){if(!KM(p))throw Error(r(405));var C=w!=null&&w.hydratedSources||null,A=!1,D="",G=lH;if(w!=null&&(w.unstable_strictMode===!0&&(A=!0),w.identifierPrefix!==void 0&&(D=w.identifierPrefix),w.onRecoverableError!==void 0&&(G=w.onRecoverableError)),g=aH(g,null,p,1,w??null,A,!1,D,G),p[Mc]=g.current,L0(p),C)for(p=0;p<C.length;p++)w=C[p],A=w._getVersion,A=A(w._source),g.mutableSourceEagerHydrationData==null?g.mutableSourceEagerHydrationData=[w,A]:g.mutableSourceEagerHydrationData.push(w,A);return new T_(g)},Js.render=function(p,g,w){if(!C_(g))throw Error(r(200));return E_(null,p,g,!1,w)},Js.unmountComponentAtNode=function(p){if(!C_(p))throw Error(r(40));return p._reactRootContainer?(lh(function(){E_(null,null,p,!1,function(){p._reactRootContainer=null,p[Mc]=null})}),!0):!1},Js.unstable_batchedUpdates=zM,Js.unstable_renderSubtreeIntoContainer=function(p,g,w,C){if(!C_(w))throw Error(r(200));if(p==null||p._reactInternals===void 0)throw Error(r(38));return E_(p,g,w,!1,C)},Js.version="18.3.1-next-f1338f8080-20240426",Js}var y8;function gae(){if(y8)return v2.exports;y8=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),v2.exports=kEe(),v2.exports}var v8;function TEe(){if(v8)return A_;v8=1;var t=gae();return A_.createRoot=t.createRoot,A_.hydrateRoot=t.hydrateRoot,A_}var CEe=TEe(),zy=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},EEe={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},jEe=class{#e=EEe;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Mh=new jEe;function NEe(t){setTimeout(t,0)}var lp=typeof window>"u"||"Deno"in globalThis;function Ms(){}function PEe(t,e){return typeof t=="function"?t(e):t}function o$(t){return typeof t=="number"&&t>=0&&t!==1/0}function yae(t,e){return Math.max(t+(e||0)-Date.now(),0)}function nf(t,e){return typeof t=="function"?t(e):t}function ho(t,e){return typeof t=="function"?t(e):t}function x8(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(n){if(e.queryHash!==O4(a,e.options))return!1}else if(!Kx(e.queryKey,a))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function b8(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(cp(e.options.mutationKey)!==cp(s))return!1}else if(!Kx(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function O4(t,e){return(e?.queryKeyHashFn||cp)(t)}function cp(t){return JSON.stringify(t,(e,r)=>l$(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Kx(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>Kx(t[r],e[r])):!1}var MEe=Object.prototype.hasOwnProperty;function vae(t,e){if(t===e)return t;const r=w8(t)&&w8(e);if(!r&&!(l$(t)&&l$(e)))return e;const i=(r?t:Object.keys(t)).length,s=r?e:Object.keys(e),a=s.length,o=r?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=r?u:s[u],f=t[d],h=e[d];if(f===h){o[d]=f,(r?u<i:MEe.call(t,d))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){o[d]=h;continue}const m=vae(f,h);o[d]=m,m===f&&c++}return i===a&&c===i?t:o}function Yk(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function w8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function l$(t){if(!_8(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!_8(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function _8(t){return Object.prototype.toString.call(t)==="[object Object]"}function AEe(t){return new Promise(e=>{Mh.setTimeout(e,t)})}function c$(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?vae(t,e):e}function DEe(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function OEe(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var R4=Symbol();function xae(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===R4?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function bae(t,e){return typeof t=="function"?t(...e):!!t}var REe=class extends zy{#e;#t;#r;constructor(){super(),this.#r=t=>{if(!lp&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},I4=new REe;function u$(){let t,e;const r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}var IEe=NEe;function LEe(){let t=[],e=0,r=o=>{o()},n=o=>{o()},i=IEe;const s=o=>{e?t.push(o):i(()=>{r(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(c=>{r(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Si=LEe(),$Ee=class extends zy{#e=!0;#t;#r;constructor(){super(),this.#r=t=>{if(!lp&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#e}},Kk=new $Ee;function FEe(t){return Math.min(1e3*2**t,3e4)}function wae(t){return(t??"online")==="online"?Kk.isOnline():!0}var d$=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function _ae(t){let e=!1,r=0,n;const i=u$(),s=()=>i.status!=="pending",a=x=>{if(!s()){const v=new d$(x);h(v),t.onCancel?.(v)}},o=()=>{e=!0},c=()=>{e=!1},u=()=>I4.isFocused()&&(t.networkMode==="always"||Kk.isOnline())&&t.canRun(),d=()=>wae(t.networkMode)&&t.canRun(),f=x=>{s()||(n?.(),i.resolve(x))},h=x=>{s()||(n?.(),i.reject(x))},m=()=>new Promise(x=>{n=v=>{(s()||u())&&x(v)},t.onPause?.()}).then(()=>{n=void 0,s()||t.onContinue?.()}),y=()=>{if(s())return;let x;const v=r===0?t.initialPromise:void 0;try{x=v??t.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(f).catch(_=>{if(s())return;const S=t.retry??(lp?0:3),k=t.retryDelay??FEe,E=typeof k=="function"?k(r,_):k,T=S===!0||typeof S=="number"&&r<S||typeof S=="function"&&S(r,_);if(e||!T){h(_);return}r++,t.onFail?.(r,_),AEe(E).then(()=>u()?void 0:m()).then(()=>{e?h(_):y()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(n?.(),i),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?y():m().then(y),i)}}var Sae=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o$(this.gcTime)&&(this.#e=Mh.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(lp?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Mh.clearTimeout(this.#e),this.#e=void 0)}},zEe=class extends Sae{#e;#t;#r;#i;#n;#a;#o;constructor(t){super(),this.#o=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#r=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=S8(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(t){if(this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=S8(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){const r=c$(this.state.data,t,this.options);return this.#s({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#s({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#n?.promise;return this.#n?.cancel(t),e?e.then(Ms).catch(Ms):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>ho(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===R4||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>nf(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!yae(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(t&&this.setOptions(t),!this.options.queryFn){const o=this.observers.find(c=>c.options.queryFn);o&&this.setOptions(o.options)}const r=new AbortController,n=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},i=()=>{const o=xae(this.options,e),u=(()=>{const d={client:this.#i,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(o,u,this):o(u)},a=(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return n(o),o})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#n=_ae({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:o=>{o instanceof d$&&o.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(o,c)=>{this.#s({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const o=await this.#n.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#r.config.onSuccess?.(o,this),this.#r.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof d$){if(o.silent)return this.#n.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#s({type:"error",error:o}),this.#r.config.onError?.(o,this),this.#r.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#s(t){const e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...kae(r.data,this.options),fetchMeta:t.meta??null};case"success":const n={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?n:void 0,n;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),Si.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function kae(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wae(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function S8(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var BEe=class extends zy{constructor(t,e){super(),this.options=e,this.#e=t,this.#s=null,this.#o=u$(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#r=void 0;#i=void 0;#n;#a;#o;#s;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),k8(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f$(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f$(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ho(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),e._defaulted&&!Yk(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&T8(this.#t,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#t!==r||ho(this.options.enabled,this.#t)!==ho(e.enabled,this.#t)||nf(this.options.staleTime,this.#t)!==nf(e.staleTime,this.#t))&&this.#g();const i=this.#y();n&&(this.#t!==r||ho(this.options.enabled,this.#t)!==ho(e.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),r=this.createResult(e,t);return UEe(this,r)&&(this.#i=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),r=this.#e.getQueryCache().build(this.#e,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(t){this.#_();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Ms)),e}#g(){this.#b();const t=nf(this.options.staleTime,this.#t);if(lp||this.#i.isStale||!o$(t))return;const r=yae(this.#i.dataUpdatedAt,t)+1;this.#c=Mh.setTimeout(()=>{this.#i.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#w(),this.#l=t,!(lp||ho(this.options.enabled,this.#t)===!1||!o$(this.#l)||this.#l===0)&&(this.#u=Mh.setInterval(()=>{(this.options.refetchIntervalInBackground||I4.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Mh.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Mh.clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const r=this.#t,n=this.options,i=this.#i,s=this.#n,a=this.#a,c=t!==r?t.state:this.#r,{state:u}=t;let d={...u},f=!1,h;if(e._optimisticResults){const M=this.hasListeners(),O=!M&&k8(t,e),R=M&&T8(t,r,e,n);(O||R)&&(d={...d,...kae(u.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:x}=d;h=d.data;let v=!1;if(e.placeholderData!==void 0&&h===void 0&&x==="pending"){let M;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(M=i.data,v=!0):M=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,M!==void 0&&(x="success",h=c$(i?.data,M,e),f=!0)}if(e.select&&h!==void 0&&!v)if(i&&h===s?.data&&e.select===this.#m)h=this.#f;else try{this.#m=e.select,h=e.select(h),h=c$(i?.data,h,e),this.#f=h,this.#s=null}catch(M){this.#s=M}this.#s&&(m=this.#s,h=this.#f,y=Date.now(),x="error");const _=d.fetchStatus==="fetching",S=x==="pending",k=x==="error",E=S&&_,T=h!==void 0,j={status:x,fetchStatus:d.fetchStatus,isPending:S,isSuccess:x==="success",isError:k,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!S,isLoadingError:k&&!T,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:k&&T,isStale:L4(t,e),refetch:this.refetch,promise:this.#o,isEnabled:ho(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=I=>{j.status==="error"?I.reject(j.error):j.data!==void 0&&I.resolve(j.data)},O=()=>{const I=this.#o=j.promise=u$();M(I)},R=this.#o;switch(R.status){case"pending":t.queryHash===r.queryHash&&M(R);break;case"fulfilled":(j.status==="error"||j.data!==R.value)&&O();break;case"rejected":(j.status!=="error"||j.error!==R.reason)&&O();break}}return j}updateResult(){const t=this.#i,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#h=this.#t),Yk(e,t))return;this.#i=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const s=new Set(i??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(a=>{const o=a;return this.#i[o]!==t[o]&&s.has(o)})};this.#S({listeners:r()})}#_(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#S(t){Si.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function VEe(t,e){return ho(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function k8(t,e){return VEe(t,e)||t.state.data!==void 0&&f$(t,e,e.refetchOnMount)}function f$(t,e,r){if(ho(e.enabled,t)!==!1&&nf(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&L4(t,e)}return!1}function T8(t,e,r,n){return(t!==e||ho(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&L4(t,r)}function L4(t,e){return ho(e.enabled,t)!==!1&&t.isStaleByTime(nf(e.staleTime,t))}function UEe(t,e){return!Yk(t.getCurrentResult(),e)}function C8(t){return{onFetch:(e,r)=>{const n=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(e.signal.aborted?d=!0:e.signal.addEventListener("abort",()=>{d=!0}),e.signal)})},h=xae(e.options,e.fetchOptions),m=async(y,x,v)=>{if(d)return Promise.reject();if(x==null&&y.pages.length)return Promise.resolve(y);const S=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:x,direction:v?"backward":"forward",meta:e.options.meta};return f(N),N})(),k=await h(S),{maxPages:E}=e.options,T=v?OEe:DEe;return{pages:T(y.pages,k,E),pageParams:T(y.pageParams,x,E)}};if(i&&s.length){const y=i==="backward",x=y?GEe:E8,v={pages:s,pageParams:a},_=x(n,v);o=await m(v,_,y)}else{const y=t??s.length;do{const x=c===0?a[0]??n.initialPageParam:E8(n,o);if(c>0&&x==null)break;o=await m(o,x),c++}while(c<y)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=u}}}function E8(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function GEe(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var WEe=class extends Sae{#e;#t;#r;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#t=[],this.state=t.state||Tae(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=_ae({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#n({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",i=!this.#i.canStart();try{if(n)e();else{this.#n({type:"pending",variables:t,isPaused:i}),await this.#r.config.onMutate?.(t,this,r);const a=await this.options.onMutate?.(t,r);a!==this.state.context&&this.#n({type:"pending",context:a,variables:t,isPaused:i})}const s=await this.#i.start();return await this.#r.config.onSuccess?.(s,t,this.state.context,this,r),await this.options.onSuccess?.(s,t,this.state.context,r),await this.#r.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,t,this.state.context,r),this.#n({type:"success",data:s}),s}catch(s){try{throw await this.#r.config.onError?.(s,t,this.state.context,this,r),await this.options.onError?.(s,t,this.state.context,r),await this.#r.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,s,t,this.state.context,r),s}finally{this.#n({type:"error",error:s})}}finally{this.#r.runNext(this)}}#n(t){const e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Si.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(t)}),this.#r.notify({mutation:this,type:"updated",action:t})})}};function Tae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cae=class extends zy{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(t,e,r){const n=new WEe({client:t,mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(e),state:r});return this.add(n),n}add(t){this.#e.add(t);const e=D_(t);if(typeof e=="string"){const r=this.#t.get(e);r?r.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=D_(t);if(typeof e=="string"){const r=this.#t.get(e);if(r)if(r.length>1){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}else r[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=D_(t);if(typeof e=="string"){const n=this.#t.get(e)?.find(i=>i.state.status==="pending");return!n||n===t}else return!0}runNext(t){const e=D_(t);return typeof e=="string"?this.#t.get(e)?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Si.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(r=>b8(e,r))}findAll(t={}){return this.getAll().filter(e=>b8(t,e))}notify(t){Si.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>
vendor: 2,146 bytes, line 99
99e.state.isPaused);return Si.batch(()=>Promise.all(t.map(e=>e.continue().catch(Ms))))}};function D_(t){return t.options.scope?.id}var HEe=class extends zy{#e;#t=void 0;#r;#i;constructor(e,r){super(),this.#e=e,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const r=this.options;this.options=this.#e.defaultMutationOptions(e),Yk(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&cp(r.mutationKey)!==cp(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(e,r){return this.#i=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#n(){const e=this.#r?.state??Tae();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#a(e){Si.batch(()=>{if(this.#i&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#i.onSuccess?.(e.data,r,n,i),this.#i.onSettled?.(e.data,null,r,n,i)):e?.type==="error"&&(this.#i.onError?.(e.error,r,n,i),this.#i.onSettled?.(void 0,e.error,r,n,i))}this.listeners.forEach(r=>{r(this.#t)})})}},Eae=class extends zy{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){const n=e.queryKey,i=e.queryHash??O4(n,e);let s=this.get(i);return s||(s=new zEe({client:t,queryKey:n,queryHash:i,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);
vendor: 5,250 bytes, line 99
99e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Si.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(r=>x8(e,r))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(r=>x8(t,r)):e}notify(t){Si.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Si.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Si.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qEe=class{#e;#t;#r;#i;#n;#a;#o;#s;constructor(t={}){this.#e=t.queryCache||new Eae,this.#t=t.mutationCache||new Cae,this.#r=t.defaultOptions||{},this.#i=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=I4.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Kk.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=this.#e.build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(nf(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(n.queryHash)?.state.data,a=PEe(e,s);if(a!==void 0)return this.#e.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return Si.batch(()=>this.#e.findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Si.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=this.#e;return Si.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=Si.batch(()=>this.#e.findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(Ms).catch(Ms)}invalidateQueries(t,e={}){return Si.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=Si.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ms)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Ms)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=this.#e.build(this,e);return r.isStaleByTime(nf(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ms).catch(Ms)}fetchInfiniteQuery(t){return t.behavior=C8(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ms).catch(Ms)}ensureInfiniteQueryData(t){return t.behavior=C8(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Kk.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,e){this.#i.set(cp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],r={};return e.forEach(n=>{Kx(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){this.#n.set(cp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#n.values()],r={};return e.forEach(n=>{Kx(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=O4(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===R4&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},jae=b.createContext(void 0),Nae=t=>{const e=b.useContext(jae);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},YEe=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),l.jsx(jae.Provider,{value:t,children:e})),Pae=b.createContext(!1),KEe=()=>b.useContext(Pae);Pae.Provider;function QEe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ZEe=b.createContext(QEe()),XEe=()=>b.useContext(ZEe),JEe=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOn
99Mount=!1))},eje=t=>{b.useEffect(()=>{t.clearReset()},[t])},tje=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(i&&t.data===void 0||bae(r,[t.error,n])),rje=t=>{if(t.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},nje=(t,e)=>t.isLoading&&t.isFetching&&!e,ije=(t,e)=>t?.suspense&&e.isPending,j8=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function sje(t,e,r){const n=KEe(),i=XEe(),s=Nae(),a=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=n?"isRestoring":"optimistic",rje(a),JEe(a,i),eje(i);const o=!s.getQueryCache().get(a.queryHash),[c]=b.useState(()=>new e(s,a)),u=c.getOptimisticResult(a),d=!n&&t.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(f=>{const h=d?c.subscribe(Si.batchCalls(f)):Ms;return c.updateResult(),h},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(a)},[a,c]),ije(a,u))throw j8(a,c,i);if(tje({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,u),a.experimental_prefetchInRender&&!lp&&nje(u,n)&&(o?j8(a,c,i):s.getQueryCache().get(a.queryHash)?.promise)?.catch(Ms).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?u:c.trackResult(u)}function aje(t,e){return sje(t,BEe)}function oje(t,e){const r=Nae(),[n]=b.useState(()=>new HEe(r,t));b.useEffect(()=>{n.setOptions(t)},[n,t]);const i=b.useSyncExternalStore(b.useCallback(a=>n.subscribe(Si.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=b.useCallback((a,o)=>{n.mutate(a,o).catch(Ms)},[n]);if(i.error&&bae(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const w2={STALE_TIME:300*1e3,GC_TIME:600*1e3,RETRY_ATTEMPTS:2},lje=()=>typeof navigator<"u"?navigator.onLine:!0,Mae=()=>{const t=new Eae,e=new Cae,r={queries:{staleTime:w2.STALE_TIME,gcTime:w2.GC_TIME,retry:(n,i)=>i instanceof Error&&i.message.includes("4")?!1:n<w2.RETRY_ATTEMPTS&&lje(),retryDelay:n=>Math.min(1e3*2**n,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!0,networkMode:"online",placeholderData:n=>n,meta:{source:"global-query-config"}},mutations:{networkMode:"online",meta:{source:"global-mutation-config"}}};return new qEe({queryCache:t,mutationCache:e,defaultOptions:r})},cje=({children:t,client:e})=>{const r=e||Mae();return l.jsx(YEe,{client:r,children:t})};/**
100 * react-router v7.9.5
101 *
102 * Copyright (c) Remix Software Inc.
103 *
104 * This source code is licensed under the MIT license found in the
105 * LICENSE.md file in the root directory of this source tree.
106 *
107 * @license MIT
108 */var Aae=t=>{throw TypeError(t)},uje=(t,e,r)=>e.has(t)||Aae("Cannot "+r),_2=(t,e,r)=>(uje(t,e,"read from private field"),r?r.call(t):e.get(t)),dje=(t,e,r)=>e.has(t)?Aae("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),N8="popstate";function fje(t={}){function e(n,i){let{pathname:s,search:a,hash:o}=n.location;return Qx("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:uc(i)}return pje(e,r,null,t)}function rr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function vn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function hje(){return Math.random().toString(36).substring(2,10)}function P8(t,e){return{usr:t.state,key:t.key,idx:e}}function Qx(t,e,r=null,n){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Of(e):e,state:r,key:e&&e.key||n||hje()}}function uc({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Of(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substring(n),t=t.substring(0,n)),t&&(e.pathname=t)}return e}function pje(t,e,r,n={}){let{window:i=document.defaultView,v5Compat:s=!1}=n,a=i.history,o="POP",c=null,u=d();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function d(){return(a.state||{idx:null}).idx}function f(){o="POP";let v=d(),_=v==null?null:v-u;u=v,c&&c({action:o,location:x.location,delta:_})}function h(v,_){o="PUSH";let S=Qx(x.location,v,_);u=d()+1;let k=P8(S,u),E=x.createHref(S);try{a.pushState(k,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(E)}s&&c&&c({action:o,location:x.location,delta:1})}function m(v,_){o="REPLACE";let S=Qx(x.location,v,_);u=d();let k=P8(S,u),E=x.createHref(S);a.replaceState(k,"",E),s&&c&&c({action:o,location:x.location,delta:0})}function y(v){return Dae(v)}let x={get action(){return o},get location(){return t(i,a)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(N8,f),c=v,()=>{i.removeEventListener(N8,f),c=null}},createHref(v){return e(i,v)},createURL:y,encodeLocation(v){let _=y(v);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:m,go(v){return a.go(v)}};return x}function Dae(t,e=!1){let r="http://localhost";
108typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),rr(r,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:uc(t);return n=n.replace(/ $/,"%20"),!e&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var Kv,M8=class{constructor(t){if(dje(this,Kv,new Map),t)for(let[e,r]of t)this.set(e,r)}get(t){if(_2(this,Kv).has(t))return _2(this,Kv).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){_2(this,Kv).set(t,e)}};Kv=new WeakMap;var mje=new Set(["lazy","caseSensitive","path","id","index","children"]);function gje(t){return mje.has(t)}var yje=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function vje(t){return yje.has(t)}function xje(t){return t.index===!0}function Zx(t,e,r=[],n={},i=!1){return t.map((s,a)=>{let o=[...r,String(a)],c=typeof s.id=="string"?s.id:o.join("-");if(rr(s.index!==!0||!s.children,"Cannot specify children on an index route"),rr(i||!n[c],`Found a route id collision on i
108d "${c}".  Route id's must be globally unique within Data Router usages`),xje(s)){let u={...s,id:c};return n[c]=A8(u,e(u)),u}else{let u={...s,id:c,children:void 0};return n[c]=A8(u,e(u)),s.children&&(u.children=Zx(s.children,e,o,n,i)),u}})}function A8(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function Rd(t,e,r="/"){return lk(t,e,r,!1)}function lk(t,e,r,n){let i=typeof e=="string"?Of(e):e,s=za(i.pathname||"/",r);if(s==null)return null;let a=Rae(t);bje(a);let o=null;for(let c=0;o==null&&c<a.length;++c){let u=Mje(s);o=Nje(a[c],u,n)}return o}function Oae(t,e){let{route:r,pathname:n,params:i}=t;return{id:r.id,pathname:n,params:i,data:e[r.id],loaderData:e[r.id],handle:r.handle}}function Rae(t,e=[],r=[],n="",i=!1){let s=(a,o,c=i,u)=>{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&c)return;rr(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let f=Yl([n,d.relativePath]),h=r.concat(d);a.children&&a.children.length>0&&(rr(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Rae(a.children,e,h,f,c)),!(a.path==null&&!a.index)&&e.push({path:f,score:Eje(f,a.index),routesMeta:h})};return t.forEach((a,o)=>{if(a.path===""||!a.path?.includes("?"))s(a,o);else for(let c of Iae(a.path))s(a,o,!0,c)}),e}function Iae(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let a=Iae(n.join("/")),o=[];return o.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function bje(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:jje(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var wje=/^:[\w-]+$/,_je=3,Sje=2,kje=1,Tje=10,Cje=-2,D8=t=>t==="*";function Eje(t,e){let r=t.split("/"),n=r.length;return r.some(D8)&&(n+=Cje),e&&(n+=Sje),r.filter(i=>!D8(i)).reduce((i,s)=>i+(wje.test(s)?_je:s===""?kje:Tje),n)}function jje(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function Nje(t,e,r=!1){let{routesMeta:n}=t,i={},s="/",a=[];for(let o=0;o<n.length;++o){let c=n[o],u=o===n.length-1,d=s==="/"?e:e.slice(s.length)||"/",f=Qk({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=Qk({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
108Object.assign(i,f.params),a.push({params:i,pathname:Yl([s,f.pathname]),pathnameBase:Rje(Yl([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=Yl([s,f.pathnameBase]))}return a}function Qk(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=Pje(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce((u,{paramName:d,isOptional:f},h)=>{if(d==="*"){let y=o[h]||"";a=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const m=o[h];return f&&!m?u[d]=void 0:u[d]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:t}}function Pje(t,e=!1,r=!0){vn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(n.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function Mje(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return vn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function za(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function Aje({basename:t,pathname:e}){return e==="/"?t:Yl([t,e])}function Dje(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Of(t):t;return{pathname:r?r.startsWith("/")?r:Oje(r,e):e,search:Ije(n),hash:Lje(i)}}function Oje(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function S2(t,e,r,n){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lae(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function DE(t){let e=Lae(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function OE(t,e,r,n=!1){let i;typeof t=="string"?i=Of(t):(i={...t},rr(!i.pathname||!i.pathname.includes("?"),S2("?","pathname","search",i)),rr(!i.pathname||!i.pathname.includes("#"),S2("#","pathname","hash",i)),rr(!i.search||!i.search.includes("#"),S2("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=r;else{let f=e.length-1;if(!n&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?e[f]:"/"}let c=Dje(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var Yl=t=>t.join("/").replace(/\/\/+/g,"/"),Rje=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Ije=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Lje=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Zk=class{constructor(t,e,r,n=!1){this.status=t,this.statusText=e||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xx(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function $4(t){return t.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ud=Symbol("Uninstrumented");function $je(t,e){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(i=>i({id:e.id,index:e.index,path:e.path,instrument(s){let a=Object.keys(r);for(let o of a)s[o]&&r[o].push(s[o])}}));let n={};if(typeof e.lazy=="function"&&r.lazy.length>0){let i=tg(r.lazy,e.lazy,()=>{});i&&(n.lazy=i)}if(typeof e.lazy=="object"){let i=e.lazy;["middleware","loader","action"].forEach(s=>{let a=i[s],o=r[`lazy.${s}`];
108if(typeof a=="function"&&o.length>0){let c=tg(o,a,()=>{});c&&(n.lazy=Object.assign(n.lazy||{},{[s]:c}))}})}return["loader","action"].forEach(i=>{let s=e[i];if(typeof s=="function"&&r[i].length>0){let a=s[Ud]??s,o=tg(r[i],a,(...c)=>O8(c[0]));o&&(o[Ud]=a,n[i]=o)}}),e.middleware&&e.middleware.length>0&&r.middleware.length>0&&(n.middleware=e.middleware.map(i=>{let s=i[Ud]??i,a=tg(r.middleware,s,(...o)=>O8(o[0]));return a?(a[Ud]=s,a):i})),n}function Fje(t,e){let r={navigate:[],fetch:[]};if(e.forEach(n=>n({instrument(i){let s=Object.keys(i);for(let a of s)i[a]&&r[a].push(i[a])}})),r.navigate.length>0){let n=t.navigate[Ud]??t.navigate,i=tg(r.navigate,n,(...s)=>{let[a,o]=s;return{to:typeof a=="number"||typeof a=="string"?a:a?uc(a):".",...R8(t,o??{})}});i&&(i[Ud]=n,t.navigate=i)}if(r.fetch.length>0){let n=t.fetch[Ud]??t.fetch,i=tg(r.fetch,n,(...s)=>{let[a,,o,c]=s;return{href:o??".",fetcherKey:a,...R8(t,c??{})}});i&&(i[Ud]=n,t.fetch=i)}return t}function tg(t,e,r){return t.length===0?null:async(...n)=>{let i=await $ae(t,r(...n),()=>e(...n),t.length-1);if(i.type==="error")throw i.value;return i.value}}async function $ae(t,e,r,n){let i=t[n],s;if(i){let a,o=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=$ae(t,e,r,n-1),s=await a,rr(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await i(o,e)}catch(c){console.error("An instrumentation function threw an error:",c)}a||await o(),await a}else try{s={type:"success",value:await r()}}catch(a){s={type:"error",value:a}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function O8(t){let{request:e,context:r,params:n,unstable_pattern:i}=t;return{request:zje(e),params:{...n},unstable_pattern:i,context:Bje(r)}}function R8(t,e){return{currentUrl:uc(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function zje(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function Bje(t){if(Uje(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var Vje=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Uje(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Vje}var Fae=["POST","PUT","PATCH","DELETE"],Gje=new Set(Fae),Wje=["GET",...Fae],Hje=new Set(Wje),qje=new Set([301,302,303,307,308]),Yje=new Set([307,308]),k2={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Kje={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},av={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Qje=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,F4=t=>Qje.test(t),Zje=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),zae="remix-router-transitions",Bae=Symbol("ResetLoaderData");function Xje(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";rr(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=t.hydrationRouteProperties||[],i=t.mapRouteProperties||Zje,s=i;if(t.unstable_instrumentations){let Q=t.unstable_instrumentations;s=ie=>({...i(ie),...$je(Q.map(ue=>ue.route).filter(Boolean),ie)})}let a={},o=Zx(t.routes,s,void 0,a),c,u=t.basename||"/";u.startsWith("/")||(u=`/${u}`);let d=t.dataStrategy||nNe,f={...t.future},h=null,m=new Set,y=null,x=null,v=null,_=t.hydrationData!=null,S=Rd(o,t.history.location,u),k=!1,E=null,T;if(S==null&&!t.patchRoutesOnNavigation){let Q=uo(404,{pathname:t.history.location.pathname}),{matches:ie,route:ue}=O_(o);T=!0,S=ie,E={[ue.id]:Q}}else if(S&&!t.hydrationData&&cr(S,o,t.history.location.pathname).active&&(S=null),S)if(S.some(Q=>Q.route.lazy))T=!1;else if(!S.some(Q=>z4(Q.route)))T=!0;else{let Q=t.hydrationData?t.hydrationData.loaderData:null,ie=t.hydrationData?t.hydrationData.errors:null;if(ie){let ue=S.findIndex(je=>ie[je.route.id]!==void 0);T=S.slice(0,ue+1).every(je=>!p$(je.route,Q,ie))}else T=S.every(ue=>!p$(ue.route,Q,ie))}else{T=!1,S=[];let Q=cr(null,o,t.history.location.pathname);Q.active&&Q.matches&&(k=!0,S=Q.matches)}let N,j={historyAction:t.history.action,location:t.history.location,matches:S,initialized:T,navigation:k2,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||E,fetchers:new Map,blockers:new Map},M="POP",O=!1,R,I=!1,B=new Map,F=null,V=!1,$=!1,U=new Set,z=new Map,L=0,W=-1,K=new Map,q=new Set,H=new Map,Y=new Map,J=new Set,re=new Map,me,oe=null;function ge(){if(h=t.history.listen(({action:Q,location:ie,delta:ue})=>{if(me){me(),me=void 0;return}vn(re.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let je=We({currentLocation:j.location,nextLocation:ie,historyAction:Q});if(je&&ue!=null){let Ue=new Promise(Xe=>{me=Xe});t.history.go(ue*-1),$e(je,{state:"blocked",location:ie,proceed(){$e(je,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),Ue.then(()=>t.history.go(ue))},reset(){let Xe=new Map(j.blockers);Xe.set(je,av),Ce({blockers:Xe})}});return}return It(Q,ie)}),r){vNe(e,B);let Q=()=>xNe(e,B);e.addEventListener("pagehide",Q),F=()=>e.removeEventListener("pagehide",Q)}return j.initialized||It("POP",j.location,{initialHydration:!0}),N}function le(){h&&h(),F&&F(),m.clear(),R&&R.abort(),j.fetchers.forEac
108h((Q,ie)=>Dr(ie)),j.blockers.forEach((Q,ie)=>xt(ie))}function Se(Q){return m.add(Q),()=>m.delete(Q)}function Ce(Q,ie={}){Q.matches&&(Q.matches=Q.matches.map(Ue=>{let Xe=a[Ue.route.id],mt=Ue.route;return mt.element!==Xe.element||mt.errorElement!==Xe.errorElement||mt.hydrateFallbackElement!==Xe.hydrateFallbackElement?{...Ue,route:Xe}:Ue})),j={...j,...Q};let ue=[],je=[];j.fetchers.forEach((Ue,Xe)=>{Ue.state==="idle"&&(J.has(Xe)?ue.push(Xe):je.push(Xe))}),J.forEach(Ue=>{!j.fetchers.has(Ue)&&!z.has(Ue)&&ue.push(Ue)}),[...m].forEach(Ue=>Ue(j,{deletedFetchers:ue,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),ue.forEach(Ue=>Dr(Ue)),je.forEach(Ue=>j.fetchers.delete(Ue))}function he(Q,ie,{flushSync:ue}={}){let je=j.actionData!=null&&j.navigation.formMethod!=null&&Os(j.navigation.formMethod)&&j.navigation.state==="loading"&&Q.state?._isRedirect!==!0,Ue;ie.actionData?Object.keys(ie.actionData).length>0?Ue=ie.actionData:Ue=null:je?Ue=j.actionData:Ue=null;let Xe=ie.loaderData?W8(j.loaderData,ie.loaderData,ie.matches||[],ie.errors):j.loaderData,mt=j.blockers;mt.size>0&&(mt=new Map(mt),mt.forEach((Re,Oe)=>mt.set(Oe,av)));let se=V?!1:Wt(Q,ie.matches||j.matches),be=O===!0||j.navigation.formMethod!=null&&Os(j.navigation.formMethod)&&Q.state?._isRedirect!==!0;c&&(o=c,c=void 0),V||M==="POP"||(M==="PUSH"?t.history.push(Q,Q.state):M==="REPLACE"&&t.history.replace(Q,Q.state));let ve;if(M==="POP"){let Re=B.get(j.location.pathname);Re&&Re.has(Q.pathname)?ve={currentLocation:j.location,nextLocation:Q}:B.has(Q.pathname)&&(ve={currentLocation:Q,nextLocation:j.location})}else if(I){let Re=B.get(j.location.pathname);Re?Re.add(Q.pathname):(Re=new Set([Q.pathname]),B.set(j.location.pathname,Re)),ve={currentLocation:j.location,nextLocation:Q}}Ce({...ie,actionData:Ue,loaderData:Xe,historyAction:M,location:Q,initialized:!0,navigation:k2,revalidation:"idle",restoreScrollPosition:se,preventScrollReset:be,blockers:mt},{viewTransitionOpts:ve,flushSync:ue===!0}),M="POP",O=!1,I=!1,V=!1,$=!1,oe?.resolve(),oe=null}async function Ct(Q,ie){if(typeof Q=="number"){t.history.go(Q);return}let ue=h$(j.location,j.matches,u,Q,ie?.fromRouteId,ie?.relative),{path:je,submission:Ue,error:Xe}=I8(!1,ue,ie),mt=j.location,se=Qx(j.location,je,ie&&ie.state);se={...se,...t.history.encodeLocation(se)};let be=ie&&ie.replace!=null?ie.replace:void 0,ve="PUSH";be===!0?ve="REPLACE":be===!1||Ue!=null&&Os(Ue.formMethod)&&Ue.formAction===j.location.pathname+j.location.search&&(ve="REPLACE");let Re=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,Oe=(ie&&ie.flushSync)===!0,lt=We({currentLocation:mt,nextLocation:se,historyAction:ve});if(lt){$e(lt,{state:"blocked",location:se,proceed(){$e(lt,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),Ct(Q,ie)},reset(){let er=new Map(j.blockers);er.set(lt,av),Ce({blockers:er})}});return}await It(ve,se,{submission:Ue,pendingError:Xe,preventScrollReset:Re,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:Oe})}function De(){oe||(oe=bNe()),Qe(),Ce({revalidation:"loading"});let Q=oe.promise;return j.navigation.state==="submitting"?Q:j.navigation.state==="idle"?(It(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),Q):(It(M||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:I===!0}),Q)}async function It(Q,ie,ue){R&&R.abort(),R=null,M=Q,V=(ue&&ue.startUninterruptedRevalidation)===!0,it(j.location,j.matches),O=(ue&&ue.preventScrollReset)===!0,I=(ue&&ue.enableViewTransition)===!0;let je=c||o,Ue=ue&&ue.overrideNavigation,Xe=ue?.initialHydration&&j.matches&&j.matches.length>0&&!k?j.matches:Rd(je,ie,u),mt=(ue&&ue.flushSync)===!0;if(Xe&&j.initialized&&!$&&dNe(j.location,ie)&&!(ue&&ue.submission&&Os(ue.submission.formMethod))){he(ie,{matches:Xe},{flushSync:mt});return}let se=cr(Xe,je,ie.pathname);if(se.active&&se.matches&&(Xe=se.matches),!Xe){let{error:Pn,notFoundMatches:Zr,route:Fr}=rt(ie.pathname);he(ie,{matches:Zr,loaderData:{},errors:{[Fr.id]:Pn}},{flushSync:mt});return}R=new AbortController;let be=Um(t.history,ie,R.signal,ue&&ue.submission),ve=t.getContext?await t.getContext():new M8,Re;if(ue&&ue.pendingError)Re=[Id(Xe).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&Os(ue.submission.formMethod)){let Pn=await Yt(be,ie,ue.submission,Xe,ve,se.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:mt});if(Pn.shortCircuited)return;
108if(Pn.pendingActionResult){let[Zr,Fr]=Pn.pendingActionResult;if(ja(Fr)&&Xx(Fr.error)&&Fr.error.status===404){R=null,he(ie,{matches:Pn.matches,loaderData:{},errors:{[Zr]:Fr.error}});return}}Xe=Pn.matches||Xe,Re=Pn.pendingActionResult,Ue=T2(ie,ue.submission),mt=!1,se.active=!1,be=Um(t.history,be.url,be.signal)}let{shortCircuited:Oe,matches:lt,loaderData:er,errors:nn}=await Qt(be,ie,Xe,ve,se.active,Ue,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,mt,Re);Oe||(R=null,he(ie,{matches:lt||Xe,...H8(Re),loaderData:er,errors:nn}))}async function Yt(Q,ie,ue,je,Ue,Xe,mt,se={}){Qe();let be=gNe(ie,ue);if(Ce({navigation:be},{flushSync:se.flushSync===!0}),Xe){let Oe=await Jt(je,ie.pathname,Q.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:er,route:nn}=O_(o);return{matches:er,pendingActionResult:[nn.id,{type:"error",error:Oe.error}]}}let lt=Id(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,pendingActionResult:[lt,{type:"error",error:Oe.error}]}}else if(Oe.matches)je=Oe.matches;else{let{notFoundMatches:lt,error:er,route:nn}=rt(ie.pathname);return{matches:lt,pendingActionResult:[nn.id,{type:"error",error:er}]}}}let ve,Re=ck(je,ie);if(!Re.route.action&&!Re.route.lazy)ve={type:"error",error:uo(405,{method:Q.method,pathname:ie.pathname,routeId:Re.route.id})};else{let Oe=vg(s,a,Q,je,Re,mt?[]:n,Ue),lt=await Me(Q,Oe,Ue,null);if(ve=lt[Re.route.id],!ve){for(let er of je)if(lt[er.route.id]){ve=lt[er.route.id];break}}if(Q.signal.aborted)return{shortCircuited:!0}}if(Ah(ve)){let Oe;return se&&se.replace!=null?Oe=se.replace:Oe=V8(ve.response.headers.get("Location"),new URL(Q.url),u)===j.location.pathname+j.location.search,await Ee(Q,ve,!0,{submission:ue,replace:Oe}),{shortCircuited:!0}}if(ja(ve)){let Oe=Id(je,Re.route.id);return(se&&se.replace)!==!0&&(M="PUSH"),{matches:je,pendingActionResult:[Oe.route.id,ve,Re.route.id]}}return{matches:je,pendingActionResult:[Re.route.id,ve]}}async function Qt(Q,ie,ue,je,Ue,Xe,mt,se,be,ve,Re,Oe){let lt=Xe||T2(ie,mt),er=mt||se||Y8(lt),nn=!V&&!ve;if(Ue){if(nn){let Un=Qr(Oe);Ce({navigation:lt,...Un!==void 0?{actionData:Un}:{}},{flushSync:Re})}let dr=await Jt(ue,ie.pathname,Q.signal);if(dr.type==="aborted")return{shortCircuited:!0};if(dr.type==="error"){if(dr.partialMatches.length===0){let{matches:Bi,route:Pc}=O_(o);return{matches:Bi,loaderData:{},errors:{[Pc.id]:dr.error}}}let Un=Id(dr.partialMatches).route.id;return{matches:dr.partialMatches,loaderData:{},errors:{[Un]:dr.error}}}else if(dr.matches)ue=dr.matches;else{let{error:Un,notFoundMatches:Bi,route:Pc}=rt(ie.pathname);return{matches:Bi,loaderData:{},errors:{[Pc.id]:Un}}}}let Pn=c||o,{dsMatches:Zr,revalidatingFetchers:Fr}=L8(Q,je,s,a,t.history,j,ue,er,ie,ve?[]:n,ve===!0,$,U,J,H,q,Pn,u,t.patchRoutesOnNavigation!=null,Oe);if(W=++L,!t.dataStrategy&&!Zr.some(dr=>dr.shouldLoad)&&!Zr.some(dr=>dr.route.middleware&&dr.route.middleware.length>0)&&Fr.length===0){let dr=zi();return he(ie,{matches:ue,loaderData:{},errors:Oe&&ja(Oe[1])?{[Oe[0]]:Oe[1].error}:null,...H8(Oe),...dr?{fetchers:new Map(j.fetchers)}:{}},{flushSync:Re}),{shortCircuited:!0}}if(nn){let dr={};if(!Ue){dr.navigation=lt;let Un=Qr(Oe);Un!==void 0&&(dr.actionData=Un)}Fr.length>0&&(dr.fetchers=gr(Fr)),Ce(dr,{flushSync:Re})}Fr.forEach(dr=>{Ur(dr.key),dr.controller&&z.set(dr.key,dr.controller)});let Sl=()=>Fr.forEach(dr=>Ur(dr.key));R&&R.signal.addEventListener("abort",Sl);let{loaderResults:Jf,fetcherResults:kl}=await Te(Zr,Fr,Q,je);if(Q.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",Sl),Fr.forEach(dr=>z.delete(dr.key));let br=R_(Jf);if(br)return await Ee(Q,br.result,!0,{replace:be}),{shortCircuited:!0};if(br=R_(kl),br)return q.add(br.key),await Ee(Q,br.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:w0,errors:jc}=G8(j,ue,Jf,Oe,Fr,kl);ve&&j.errors&&(jc={...j.errors,...jc});let Tl=zi(),Nc=Nn(W),sm=Tl||Nc||Fr.length>0;return{matches:ue,loaderData:w0,errors:jc,...sm?{fetchers:new Map(j.fetchers)}:{}}}function Qr(Q){if(Q&&!ja(Q[1]))return{[Q[0]]:Q[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function gr(Q){return Q.forEach(ie=>{let ue=j.fetchers.get(ie.key),je=ov(void 0,ue?ue.data:void 0);j.fetchers.set(ie.key,je)}),new Map(j.fetchers)}async function X(Q,ie,ue,je){Ur(Q);let Ue=(je&&je.flushSync)===!0,Xe=c||o,mt=h$(j.location,j.matches,u,ue,ie,je?.relative),se=Rd(Xe,mt,u),be=cr(se,Xe,mt);if(be.active&&be.matches&&(se=be.matches),!se){jt(Q,ie,uo(404,{pathname:mt}),{flushSync:Ue});return}let{path:ve,submission:Re,error:Oe}=I8(!0,mt,je);if(Oe){jt(Q,ie,Oe,{flushSync:Ue});return}let lt=t.getContext?await t.getContext():new M8,er=(je&&je.preventScrollReset)===!0;if(Re&&Os(Re.formMethod)){await ae(Q,ie,ve,se,lt,be.active,Ue,er,Re);return}H.set(Q,{routeId:ie,path:ve}),await de(Q,ie,ve,se,lt,be.active,Ue,er,Re)}async function ae(Q,ie,ue,je,Ue,Xe,mt,se,be){Qe(),H.delete(Q);let ve=j.fetchers.get(Q);Nt(Q,yNe(be,ve),{flushSync:mt});let Re=new AbortController,Oe=Um(t.history,ue,Re.signal,be);if(Xe){let Tr=await Jt(je,new URL(Oe.url).pathname,Oe.signal,Q);if(Tr.type==="aborted")return;if(Tr.type==="error"){jt(Q,ie,Tr.error,{flushSync:mt});return}else if(Tr.matches)je=Tr.matches;else{jt(Q,ie,uo(404,{pathname:ue}),{flushSync:mt});return}}let lt=ck(je,ue);if(!lt.route.action&&!lt.route.lazy){let Tr=uo(405,{method:be.formMethod,pathname:ue,routeId:ie});jt(Q,ie,Tr,{flushSync:mt});return}z.set(Q,Re);let er=L,nn=vg(s,a,Oe,je,lt,n,Ue),Zr=(await Me(Oe,nn,Ue,Q))[lt.route.id];if(Oe.signal.aborted){z.get(Q)===Re&&z.delete(Q);return}if(J.has(Q)){if(Ah(Zr)||ja(Zr)){Nt(Q,Uc(void 0));return}}else{if(Ah(Zr))if(z.delete(Q),W>er){Nt(Q,Uc(void 0));return}else return q.add(Q),Nt(Q,ov(be)),Ee(Oe,Zr,!1,{fetcherSubmission:be,preventScrollReset:se});if(ja(Zr)){jt(Q,ie,Zr.error);return}}let Fr=j.navigation.location||j.location,Sl=Um(t.history,Fr,Re.signal),Jf=c||o,kl=j.navigation.state!=="idle"?Rd(Jf,j.navigation.location,u):j.matches;rr(kl,"Didn't find any matches after fetcher action");let br=++L;K.set(Q,br);let w0=ov(be,Zr.data);j.fetchers.set(Q,w0);let{dsMatches:jc,revalidatingFetchers:Tl}=L8(Sl,Ue,s,a,t.history,j,kl,be,Fr,n,!1,$,U,J,H,q,Jf,u,t.patchRoutesOnNavigation!=null,[lt.route.id,Zr]);Tl.filter(Tr=>
108Tr.key!==Q).forEach(Tr=>{let am=Tr.key,T1=j.fetchers.get(am),gP=ov(void 0,T1?T1.data:void 0);j.fetchers.set(am,gP),Ur(am),Tr.controller&&z.set(am,Tr.controller)}),Ce({fetchers:new Map(j.fetchers)});let Nc=()=>Tl.forEach(Tr=>Ur(Tr.key));Re.signal.addEventListener("abort",Nc);let{loaderResults:sm,fetcherResults:dr}=await Te(jc,Tl,Sl,Ue);if(Re.signal.aborted)return;if(Re.signal.removeEventListener("abort",Nc),K.delete(Q),z.delete(Q),Tl.forEach(Tr=>z.delete(Tr.key)),j.fetchers.has(Q)){let Tr=Uc(Zr.data);j.fetchers.set(Q,Tr)}let Un=R_(sm);if(Un)return Ee(Sl,Un.result,!1,{preventScrollReset:se});if(Un=R_(dr),Un)return q.add(Un.key),Ee(Sl,Un.result,!1,{preventScrollReset:se});let{loaderData:Bi,errors:Pc}=G8(j,kl,sm,void 0,Tl,dr);Nn(br),j.navigation.state==="loading"&&br>W?(rr(M,"Expected pending action"),R&&R.abort(),he(j.navigation.location,{matches:kl,loaderData:Bi,errors:Pc,fetchers:new Map(j.fetchers)})):(Ce({errors:Pc,loaderData:W8(j.loaderData,Bi,kl,Pc),fetchers:new Map(j.fetchers)}),$=!1)}async function de(Q,ie,ue,je,Ue,Xe,mt,se,be){let ve=j.fetchers.get(Q);Nt(Q,ov(be,ve?ve.data:void 0),{flushSync:mt});let Re=new AbortController,Oe=Um(t.history,ue,Re.signal);if(Xe){let Fr=await Jt(je,new URL(Oe.url).pathname,Oe.signal,Q);if(Fr.type==="aborted")return;if(Fr.type==="error"){jt(Q,ie,Fr.error,{flushSync:mt});return}else if(Fr.matches)je=Fr.matches;else{jt(Q,ie,uo(404,{pathname:ue}),{flushSync:mt});return}}let lt=ck(je,ue);z.set(Q,Re);let er=L,nn=vg(s,a,Oe,je,lt,n,Ue),Zr=(await Me(Oe,nn,Ue,Q))[lt.route.id];if(z.get(Q)===Re&&z.delete(Q),!Oe.signal.aborted){if(J.has(Q)){Nt(Q,Uc(void 0));return}if(Ah(Zr))if(W>er){Nt(Q,Uc(void 0));return}else{q.add(Q),await Ee(Oe,Zr,!1,{preventScrollReset:se});return}if(ja(Zr)){jt(Q,ie,Zr.error);return}Nt(Q,Uc(Zr.data))}}async function Ee(Q,ie,ue,{submission:je,fetcherSubmission:Ue,preventScrollReset:Xe,replace:mt}={}){ie.response.headers.has("X-Remix-Revalidate")&&($=!0);let se=ie.response.headers.get("Location");rr(se,"Expected a Location header on the redirect Response"),se=V8(se,new URL(Q.url),u);let be=Qx(j.location,se,{_isRedirect:!0});if(r){let nn=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))nn=!0;else if(F4(se)){const Pn=Dae(se,!0);nn=Pn.origin!==e.location.origin||za(Pn.pathname,u)==null}if(nn){mt?e.location.replace(se):e.location.assign(se);return}}R=null;let ve=mt===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Re,formAction:Oe,formEncType:lt}=j.navigation;!je&&!Ue&&Re&&Oe&&lt&&(je=Y8(j.navigation));let er=je||Ue;if(Yje.has(ie.response.status)&&er&&Os(er.formMethod))await It(ve,be,{submission:{...er,formAction:se},preventScrollReset:Xe||O,enableViewTransition:ue?I:void 0});else{let nn=T2(be,je);await It(ve,be,{overrideNavigation:nn,fetcherSubmission:Ue,preventScrollReset:Xe||O,enableViewTransition:ue?I:void 0})}}async function Me(Q,ie,ue,je){let Ue,Xe={};try{Ue=await sNe(d,Q,ie,je,ue,!1)}catch(mt){return ie.filter(se=>se.shouldLoad).forEach(se=>{Xe[se.route.id]={type:"error",error:mt}}),Xe}if(Q.signal.aborted)return Xe;for(let[mt,se]of Object.entries(Ue))if(pNe(se)){let be=se.result;Xe[mt]={type:"redirect",response:cNe(be,Q,mt,ie,u)}}else Xe[mt]=await lNe(se);return Xe}async function Te(Q,ie,ue,je){let Ue=Me(ue,Q,je,null),Xe=Promise.all(ie.map(async be=>{if(be.matches&&be.match&&be.request&&be.controller){let Re=(await Me(be.request,be.matches,je,be.key))[be.match.route.id];return{[be.key]:Re}}else return Promise.resolve({[be.key]:{type:"error",error:uo(404,{pathname:be.path})}})}
vendor: 4,320 bytes, line 108
108)),mt=await Ue,se=(await Xe).reduce((be,ve)=>Object.assign(be,ve),{});return{loaderResults:mt,fetcherResults:se}}function Qe(){$=!0,H.forEach((Q,ie)=>{z.has(ie)&&U.add(ie),Ur(ie)})}function Nt(Q,ie,ue={}){j.fetchers.set(Q,ie),Ce({fetchers:new Map(j.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function jt(Q,ie,ue,je={}){let Ue=Id(j.matches,ie);Dr(Q),Ce({errors:{[Ue.route.id]:ue},fetchers:new Map(j.fetchers)},{flushSync:(je&&je.flushSync)===!0})}function jr(Q){return Y.set(Q,(Y.get(Q)||0)+1),J.has(Q)&&J.delete(Q),j.fetchers.get(Q)||Kje}function Vr(Q,ie){Ur(Q,ie?.reason),Nt(Q,Uc(null))}function Dr(Q){let ie=j.fetchers.get(Q);z.has(Q)&&!(ie&&ie.state==="loading"&&K.has(Q))&&Ur(Q),H.delete(Q),K.delete(Q),q.delete(Q),J.delete(Q),U.delete(Q),j.fetchers.delete(Q)}function $r(Q){let ie=(Y.get(Q)||0)-1;ie<=0?(Y.delete(Q),J.add(Q)):Y.set(Q,ie),Ce({fetchers:new Map(j.fetchers)})}function Ur(Q,ie){let ue=z.get(Q);ue&&(ue.abort(ie),z.delete(Q))}function Ni(Q){for(let ie of Q){let ue=jr(ie),je=Uc(ue.data);j.fetchers.set(ie,je)}}function zi(){let Q=[],ie=!1;for(let ue of q){let je=j.fetchers.get(ue);rr(je,`Expected fetcher: ${ue}`),je.state==="loading"&&(q.delete(ue),Q.push(ue),ie=!0)}return Ni(Q),ie}function Nn(Q){let ie=[];for(let[ue,je]of K)if(je<Q){let Ue=j.fetchers.get(ue);rr(Ue,`Expected fetcher: ${ue}`),Ue.state==="loading"&&(Ur(ue),K.delete(ue),ie.push(ue))}return Ni(ie),ie.length>0}function or(Q,ie){let ue=j.blockers.get(Q)||av;return re.get(Q)!==ie&&re.set(Q,ie),ue}function xt(Q){j.blockers.delete(Q),re.delete(Q)}function $e(Q,ie){let ue=j.blockers.get(Q)||av;rr(ue.state==="unblocked"&&ie.state==="blocked"||ue.state==="blocked"&&ie.state==="blocked"||ue.state==="blocked"&&ie.state==="proceeding"||ue.state==="blocked"&&ie.state==="unblocked"||ue.state==="proceeding"&&ie.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${ie.state}`);let je=new Map(j.blockers);je.set(Q,ie),Ce({blockers:je})}function We({currentLocation:Q,nextLocation:ie,historyAction:ue}){if(re.size===0)return;re.size>1&&vn(!1,"A router only supports one blocker at a time");let je=Array.from(re.entries()),[Ue,Xe]=je[je.length-1],mt=j.blockers.get(Ue);if(!(mt&&mt.state==="proceeding")&&Xe({currentLocation:Q,nextLocation:ie,historyAction:ue}))return Ue}function rt(Q){let ie=uo(404,{pathname:Q}),ue=c||o,{matches:je,route:Ue}=O_(ue);return{notFoundMatches:je,route:Ue,error:ie}}function bt(Q,ie,ue){if(y=Q,v=ie,x=ue||null,!_&&j.navigation===k2){_=!0;let je=Wt(j.location,j.matches);je!=null&&Ce({restoreScrollPosition:je})}return()=>{y=null,v=null,x=null}}function ut(Q,ie){return x&&x(Q,ie.map(je=>Oae(je,j.loaderData)))||Q.key}function it(Q,ie){if(y&&v){let ue=ut(Q,ie);y[ue]=v()}}function Wt(Q,ie){if(y){let ue=ut(Q,ie),je=y[ue];if(typeof je=="number")return je}return null}function cr(Q,ie,ue){if(t.patchRoutesOnNavigation)if(Q){if(Object.keys(Q[0].params).length>0)return{active:!0,matches:lk(ie,ue,u,!0)}}else return{active:!0,matches:lk(ie,ue,u,!0)||[]};return{active:!1,matches:null}}async function Jt(Q,ie,ue,je){if(!t.patchRoutesOnNavigation)return{type:"success",matches:Q};let Ue=Q;for(;;){let Xe=c==null,mt=c||o,se=a;try{await t.patchRoutesOnNavigation({signal:ue,path:ie,matches:Ue,fetcherKey:je,patch:(Re,Oe)=>{ue.aborted||$8(Re,Oe,mt,se,s,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:Ue}}finally{Xe&&!ue.aborted&&(o=[...o])}if(ue.aborted)return{type:"aborted"};let be=Rd(mt,ie,u);if(be)return{type:"success",matches:be};let ve=lk(mt,ie,u,!0);if(!ve||Ue.length===ve.length&&Ue.every((Re,Oe)=>Re.route.id===ve[Oe].route.id))return{type:"success",matches:null};Ue=ve}}function pn(Q){a={},c=Zx(Q,s,void 0,a)}function yr(Q,ie,ue=!1){let je=c==null;$8(Q,ie,c||o,a,s,ue),je&&(o=[...o],Ce({}))}return N={get basename(){return u},get future(){return f},get state(){return j},get routes(){return o},get window(){return e},initialize:ge,subscribe:Se,enableScrollRestoration:bt,navigate:Ct,fetch:X,revalidate:De,createHref:Q=>t.history.createHref(Q),encodeLocation:Q=>t.history.encodeLocation(Q),getFetcher:jr,resetFetcher:Vr,deleteFetcher:$r,dispose:le,getBlocker:or,deleteBlocker:xt,patchRoutes:yr,_internalFetchControllers:z,_internalSetRoutes:pn,_internalSetStateDoNotUseOrYouWillBreakYourApp(Q){Ce(Q)}},t.unstable_instrumentations&&(N=Fje(N,t.unstable_instrumentations.map(Q=>
108Q.router).filter(Boolean))),N}function Jje(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function h$(t,e,r,n,i,s){let a,o;if(i){a=[];for(let u of e)if(a.push(u),u.route.id===i){o=u;break}}else a=e,o=e[e.length-1];let c=OE(n||".",DE(a),za(t.pathname,r)||t.pathname,s==="path");if(n==null&&(c.search=t.search,c.hash=t.hash),(n==null||n===""||n===".")&&o){let u=B4(c.search);if(o.route.index&&!u)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!o.route.index&&u){let d=new URLSearchParams(c.search),f=d.getAll("index");d.delete("index"),f.filter(m=>m).forEach(m=>d.append("index",m));let h=d.toString();c.search=h?`?${h}`:""}}return r!=="/"&&(c.pathname=Aje({basename:r,pathname:c.pathname})),uc(c)}function I8(t,e,r){if(!r||!Jje(r))return{path:e};if(r.formMethod&&!mNe(r.formMethod))return{path:e,error:uo(405,{method:r.formMethod})};let n=()=>({path:e,error:uo(400,{type:"invalid-body"})}),s=(r.formMethod||"get").toUpperCase(),a=qae(e);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Os(s))return n();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,[m,y])=>`${h}${m}=${y}
109`,""):String(r.body);return{path:e,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Os(s))return n();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:e,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return n()}}}rr(typeof FormData=="function","FormData is not available in this environment");let o,c;if(r.formData)o=g$(r.formData),c=r.formData;else if(r.body instanceof FormData)o=g$(r.body),c=r.body;else if(r.body instanceof URLSearchParams)o=r.body,c=U8(o);else if(r.body==null)o=new URLSearchParams,c=new FormData;else try{o=new URLSearchParams(r.body),c=U8(o)}catch{return n()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Os(u.formMethod))return{path:e,submission:u};let d=Of(e);return t&&d.search&&B4(d.search)&&o.append("index",""),d.search=`?${o}`,{path:uc(d),submission:u}}function L8(t,e,r,n,i,s,a,o,c,u,d,f,h,m,y,x,v,_,S,k){let E=k?ja(k[1])?k[1].error:k[1].data:void 0,T=i.createURL(s.location),N=i.createURL(c),j;if(d&&s.errors){let V=Object.keys(s.errors)[0];j=a.findIndex($=>$.route.id===V)}else if(k&&ja(k[1])){let V=k[0];j=a.findIndex($=>$.route.id===V)-1}let M=k?k[1].statusCode:void 0,O=M&&M>=400,R={currentUrl:T,currentParams:s.matches[0]?.params||{},nextUrl:N,nextParams:a[0].params,...o,actionResult:E,actionStatus:M},I=$4(a.map(V=>V.route.path)),B=a.map((V,$)=>{let{route:U}=V,z=null;if(j!=null&&$>j?z=!1:U.lazy?z=!0:z4(U)?d?z=p$(U,s.loaderData,s.errors):eNe(s.loaderData,s.matches[$],V)&&(z=!0):z=!1,z!==null)return m$(r,n,t,I,V,u,e,z);let L=O?!1:f||T.pathname+T.search===N.pathname+N.search||T.search!==N.search||tNe(s.matches[$],V),W={...R,defaultShouldRevalidate:L},K=Xk(V,W);return m$(r,n,t,I,V,u,e,K,W)}),F=[];return y.forEach((V,$)=>{if(d||!a.some(Y=>Y.route.id===V.routeId)||m.has($))return;let U=s.fetchers.get($),z=U&&U.state!=="idle"&&U.data===void 0,L=Rd(v,V.path,_);if(!L){if(S&&z)return;F.push({key:$,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(x.has($))return;let W=ck(L,V.path),K=new AbortController,q=Um(i,V.path,K.signal),H=null;if(h.has($))h.delete($),H=vg(r,n,q,L,W,u,e);else if(z)f&&(H=vg(r,n,q,L,W,u,e));else{let Y={...R,defaultShouldRevalidate:O?!1:f};Xk(W,Y)&&(H=vg(r,n,q,L,W,u,e,Y))}H&&F.push({key:$,routeId:V.routeId,path:V.path,matches:H,match:W,request:q,controller:K})}),{dsMatches:B,revalidatingFetchers:F}}function z4(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function p$(t,e,r){if(t.lazy)return!0;if(!z4(t))return!1;let n=e!=null&&t.id in e,i=r!=null&&r[t.id]!==void 0;return!n&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!n&&!i}function eNe(t,e,r){let n=!e||r.route.id!==e.route.id,i=!t.hasOwnProperty(r.route.id);return n||i}function tNe(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Xk(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}function $8(t,e,r,n,i,s){let a;if(t){let u=n[t];rr(u,`No route found to patch children into: routeId = ${t}`),u.children||(u.children=[]),a=u.children}else a=r;let o=[],c=[];if(e.forEach(u=>{let d=a.find(f=>Vae(u,f));d?c.push({existingRoute:d,newRoute:u}):o.push(u)}),o.length>0){let u=Zx(o,i,[t||"_","patch",String(a?.length||"0")],n);a.push(...u)}if(s&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:d,newRoute:f}=c[u],h=d,[m]=Zx([f],i,[],{},!0);Object.assign(h,{element:m.element?m.element:h.element,errorElement:m.errorElement?m.errorElement:h.errorElement,hydrateFallbackElement:m.hydrateFallbackElement?m.hydrateFallbackElement:h.hydrateFallbackElement})}}function Vae(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((r,n)=>e.children?.some(i=>Vae(r,i))):!1}var F8=new WeakMap,Uae=({key:t,route:e,manifest:r,mapRouteProperties:n})=>{let i=r[e.id];if(rr(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[t];if(!s)return;let a=F8.get(i);a||(a={},F8.set(i,a));let o=a[t];if(o)return o;let c=(async()=>{let u=gje(t),f=i[t]!==void 0&&t!=="hasErrorBoundary";if(u)vn(!u,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),a[t]=Promise.resolve();else if(f)vn(!1,`Route "${i.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let h=await s();h!=null&&(Object.assign(i,{[t]:h}),Object.assign(i,n(i)))}typeof i.lazy=="object"&&(i.lazy[t]=void 0,Object.values(i.lazy).every(h=>h===void 0)&&(i.lazy=void 0))})();
109return a[t]=c,c},z8=new WeakMap;function rNe(t,e,r,n,i){let s=r[t.id];if(rr(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let d=z8.get(s);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let f=(async()=>{rr(typeof t.lazy=="function","No lazy route function found");let h=await t.lazy(),m={};for(let y in h){let x=h[y];if(x===void 0)continue;let v=vje(y),S=s[y]!==void 0&&y!=="hasErrorBoundary";v?vn(!v,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?vn(!S,`Route "${s.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):m[y]=x}Object.assign(s,m),Object.assign(s,{...n(s),lazy:void 0})})();return z8.set(s,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let a=Object.keys(t.lazy),o=[],c;for(let d of a){if(i&&i.includes(d))continue;let f=Uae({key:d,route:t,manifest:r,mapRouteProperties:n});f&&(o.push(f),d===e&&(c=f))}let u=o.length>0?Promise.all(o).then(()=>{}):void 0;return u?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:c}}async function B8(t){let e=t.matches.filter(i=>i.shouldLoad),r={};return(await Promise.all(e.map(i=>i.resolve()))).forEach((i,s)=>{r[e[s].route.id]=i}),r}async function nNe(t){return t.matches.some(e=>e.route.middleware)?Gae(t,()=>B8(t)):B8(t)}function Gae(t,e){return iNe(t,e,n=>n,fNe,r);function r(n,i,s){if(s)return Promise.resolve(Object.assign(s.value,{[i]:{type:"error",result:n}}));{let{matches:a}=t,o=Math.min(Math.max(a.findIndex(u=>u.route.id===i),0),Math.max(a.findIndex(u=>u.unstable_shouldCallHandler()),0)),c=Id(a,a[o].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:n}})}}}async function iNe(t,e,r,n,i){let{matches:s,request:a,params:o,context:c,unstable_pattern:u}=t,d=s.flatMap(h=>h.route.middleware?h.route.middleware.map(m=>[h.route.id,m]):[]);return await Wae({request:a,params:o,context:c,unstable_pattern:u},d,e,r,n,i)}async function Wae(t,e,r,n,i,s,a=0){let{request:o}=t;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let c=e[a];if(!c)return await r();let[u,d]=c,f,h=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Wae(t,e,r,n,i,s,a+1)},f.value}catch(m){return f={value:await s(m,u,f)},f.value}};try{let m=await d(t,h),y=m!=null?n(m):void 0;return i(y)?y:f?y??f.value:(f={value:await h()},f.value)}catch(m){return await s(m,u,f)}}function Hae(t,e,r,n,i){let s=Uae({key:"middleware",route:n.route,manifest:e,mapRouteProperties:t}),a=rNe(n.route,Os(r.method)?"action":"loader",e,t,i);return{middleware:s,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function m$(t,e,r,n,i,s,a,o,c=null){let u=!1,d=Hae(t,e,r,i,s);return{...i,_lazyPromises:d,shouldLoad:o,unstable_shouldRevalidateArgs:c,unstable_shouldCallHandler(f){return u=!0,c?typeof f=="boolean"?Xk(i,{...c,defaultShouldRevalidate:f}):Xk(i,c):o},resolve(f){let{lazy:h,loader:m,middleware:y}=i.route,x=u||o||f&&!Os(r.method)&&(h||m),v=y&&y.length>0&&!m&&!h;return x&&(Os(r.method)||!v)?aNe({request:r,unstable_pattern:n,match:i,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:f,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function vg(t,e,r,n,i,s,a,o=null){return n.map(c=>c.route.id!==i.route.id?{...c,shouldLoad:!1,unstable_shouldRevalidateArgs:o,unstable_shouldCallHandler:()=>!1,_lazyPromises:Hae(t,e,r,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:m$(t,e,r,$4(n.map(u=>u.route.path)),c,s,a,!0,o))}async function sNe(t,e,r,n,i,s){r.some(u=>u._lazyPromises?.middleware)&&await Promise.all(r.map(u=>u._lazyPromises?.middleware));let a={request:e,unstable_pattern:$4(r.map(u=>u.route.path)),params:r[0].params,context:i,matches:r},c=await t({...a,fetcherKey:n,runClientMiddleware:u=>{let d=a;return Gae(d,()=>u({...d,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return c}async function aNe({request:t,unstable_pattern:e,match:r,lazyHandlerPromise:n,lazyRoutePromise:i,handlerOverride:s,scopedContext:a}){let o,c,u=Os(t.method),d=u?"action":"loader",f=h=>{let m,y=new Promise((_,S)=>m=S);c=()=>m(),t.signal.addEventListener("abort",c);let x=_=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)):h({request:t,unstable_pattern:e,params:r.params,context:a},..._!==void 0?[_]:[]),v=(async()=>{try{return{type:"data",result:await(s?s(S=>x(S)):x())}}catch(_){return{type:"error",result:_}}})();return Promise.race([v,y])};try{let h=u?r.route.action:r.route.loader;if(n||i)if(h){let m,[y]=await Promise.all([f(h).catch(x=>{m=x}),n,i]);if(m!==void 0)throw m;o=y}else{await n;let m=u?r.route.action:r.route.loader;if(m)[o]=await Promise.all([f(m),i]);else if(d==="action"){let y=new URL(t.url),x=y.pathname+y.search;throw uo(405,{method:t.method,pathname:x,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(h)o=await f(h);else{let m=new URL(t.url),y=m.pathname+m.search;throw uo(404,{pathname:y})}}catch(h){return{type:"error",result:h}}finally{c&&t.signal.removeEventListener("abort",c)}return o}async function oNe(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function lNe(t){let{result:e,type:r}=t;if(Yae(e)){let n;try{n=await oNe(e)}catch(i){return{type:"error",error:i}}return r==="error"?{type:"error",error:new Zk(e.status,e.statusText,n),statusCode:e.status,headers:e.headers}:{type:"data",data:n,statusCode:e.status,headers:e.headers}}return r==="error"?q8(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:new Zk(e.init?.status||500,void 0,e.data),statusCode:Xx(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:Xx(e)?e.status:void 0}:q8(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function cNe(t,e,r,n,i){let s=t.headers.get("Location");if(rr(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!F4(s)){let a=n.slice(0,n.findIndex(o=>o.route.id===r)+1);s=h$(new URL(e.url),a,i,s),t.headers.set("Location",s)}return t}function V8(t,e,r){if(F4(t)){let n=t,i=n.startsWith("//")?new URL(e.protocol+n):new URL(n),s=za(i.pathname,r)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function Um(t,e,r,n){let i=t.createURL(qae(e)).toString(),s={signal:r};if(n&&Os(n.formMethod)){let{formMethod:a,formEncType:o}=n;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(n.json)):o==="text/plain"?s.body=n.text:o==="application/x-www-form-urlencoded"&&n.formData?s.body=g$(n.formData):s.body=n.formData}
109return new Request(i,s)}function g$(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function U8(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function uNe(t,e,r,n=!1,i=!1){let s={},a=null,o,c=!1,u={},d=r&&ja(r[1])?r[1].error:void 0;return t.forEach(f=>{if(!(f.route.id in e))return;let h=f.route.id,m=e[h];if(rr(!Ah(m),"Cannot handle redirect results in processLoaderData"),ja(m)){let y=m.error;if(d!==void 0&&(y=d,d=void 0),a=a||{},i)a[h]=y;else{let x=Id(t,h);a[x.route.id]==null&&(a[x.route.id]=y)}n||(s[h]=Bae),c||(c=!0,o=Xx(m.error)?m.error.status:500),m.headers&&(u[h]=m.headers)}else s[h]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[h]=m.headers)}),d!==void 0&&r&&(a={[r[0]]:d},r[2]&&(s[r[2]]=void 0)),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:u}}function G8(t,e,r,n,i,s){let{loaderData:a,errors:o}=uNe(e,r,n);return i.filter(c=>!c.matches||c.matches.some(u=>u.shouldLoad)).forEach(c=>{let{key:u,match:d,controller:f}=c;if(f&&f.signal.aborted)return;let h=s[u];if(rr(h,"Did not find corresponding fetcher result"),ja(h)){let m=Id(t.matches,d?.route.id);o&&o[m.route.id]||(o={...o,[m.route.id]:h.error}),t.fetchers.delete(u)}else if(Ah(h))rr(!1,"Unhandled fetcher revalidation redirect");else{let m=Uc(h.data);t.fetchers.set(u,m)}}),{loaderData:a,errors:o}}function W8(t,e,r,n){let i=Object.entries(e).filter(([,s])=>s!==Bae).reduce((s,[a,o])=>(s[a]=o,s),{});for(let s of r){let a=s.route.id;if(!e.hasOwnProperty(a)&&t.hasOwnProperty(a)&&s.route.loader&&(i[a]=t[a]),n&&n.hasOwnProperty(a))break}return i}function H8(t){return t?ja(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Id(t,e){return(e?t.slice(0,t.findIndex(n=>n.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function O_(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function uo(t,{pathname:e,routeId:r,method:n,type:i,message:s}={}){let a="Unknown Server Error",o="Unknown @remix-run/router error";return t===400?(a="Bad Request",n&&e&&r?o=`You made a ${n} request to "${e}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:i==="invalid-body"&&(o="Unable to encode submission body")):t===403?(a="Forbidden",o=`Route "${r}" does not match URL "${e}"`):t===404?(a="Not Found",o=`No route matches URL "${e}"`):t===405&&(a="Method Not Allowed",n&&e&&r?o=`You made a ${n.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(o=`Invalid request method "${n.toUpperCase()}"`)),new Zk(t||500,a,new Error(o),!0)}function R_(t){let e=Object.entries(t);for(let r=e.length-1;r>=0;r--){let[n,i]=e[r];if(Ah(i))return{key:n,result:i}}}function qae(t){let e=typeof t=="string"?Of(t):t;return uc({...e,hash:""})}function dNe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function fNe(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,r])=>typeof e=="string"&&hNe(r))}function hNe(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function pNe(t){return Yae(t.result)&&qje.has(t.result.status)}function ja(t){return t.type==="error"}function Ah(t){return(t&&t.type)==="redirect"}function q8(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Yae(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function mNe(t){return Hje.has(t.toUpperCase())}function Os(t){return Gje.has(t.toUpperCase())}function B4(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function ck(t,e){let r=typeof e=="string"?Of(e).search:e.search;if(t[t.length-1].route.index&&B4(r||""))return t[t.length-1];let n=Lae(t);return n[n.length-1]}function Y8(t){let{formMethod:e,formAction:r,formEncType:n,text:i,formData:s,json:a}=t;
109if(!(!e||!r||!n)){if(i!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function T2(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function gNe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function ov(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function yNe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Uc(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function vNe(t,e){try{let r=t.sessionStorage.getItem(zae);if(r){let n=JSON.parse(r);for(let[i,s]of Object.entries(n||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function xNe(t,e){if(e.size>0){let r={};for(let[n,i]of e)r[n]=[...i];try{t.sessionStorage.setItem(zae,JSON.stringify(r))}catch(n){vn(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function bNe(){let t,e,r=new Promise((n,i)=>{t=async s=>{n(s);try{await r}catch{}},e=async s=>{i(s);try{await r}catch{}}});return{promise:r,resolve:t,reject:e}}var Up=b.createContext(null);Up.displayName="DataRouter";var By=b.createContext(null);By.displayName="DataRouterState";b.createContext(!1);var V4=b.createContext({isTransitioning:!1});V4.displayName="ViewTransition";var Kae=b.createContext(new Map);Kae.displayName="Fetchers";var wNe=b.createContext(null);wNe.displayName="Await";var Wa=b.createContext(null);Wa.displayName="Navigation";var RE=b.createContext(null);RE.displayName="Location";var Io=b.createContext({outlet:null,matches:[],isDataRoute:!1});Io.displayName="Route";var U4=b.createContext(null);U4.displayName="RouteError";function _Ne(t,{relative:e}={}){rr(Vy(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=b.useContext(Wa),{hash:i,pathname:s,search:a}=Sw(t,{relative:e}),o=s;return r!=="/"&&(o=s==="/"?r:Yl([r,s])),n.createHref({pathname:o,search:a,hash:i})}function Vy(){return b.useContext(RE)!=null}function ns(){return rr(Vy(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(RE).location}var Qae="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zae(t){b.useContext(Wa).static||b.useLayoutEffect(t)}function Ws(){let{isDataRoute:t}=b.useContext(Io);return t?LNe():SNe()}function SNe(){rr(Vy(),"useNavigate() may be used only in the context of a <Router> component.");let t=b.useContext(Up),{basename:e,navigator:r}=b.useContext(Wa),{matches:n}=b.useContext(Io),{pathname:i}=ns(),s=JSON.stringify(DE(n)),a=b.useRef(!1);return Zae(()=>{a.current=!0}),b.useCallback((c,u={})=>{if(vn(a.current,Qae),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=OE(c,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Yl([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,s,i,t])}var kNe=b.createContext(null);function TNe(t){let e=b.useContext(Io).outlet;return b.useMemo(()=>e&&b.createElement(kNe.Provider,{value:t},e),[e,t])}function G4(){let{matches:t}=b.useContext(Io),e=t[t.length-1];return e?e.params:{}}function Sw(t,{relative:e}={}){let{matches:r}=b.useContext(Io),{pathname:n}=ns(),i=JSON.stringify(DE(r));return b.useMemo(()=>OE(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function CNe(t,e,r,n,i){rr(Vy(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=b.useContext(Wa),{matches:a}=b.useContext(Io),o=a[a.length-1],c=o?o.params:{},u=o?o.pathname:"/",d=o?o.pathnameBase:"/",f=o&&o.route;{let S=f&&f.path||"";Jae(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
110
111Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=ns(),m;m=h;let y=m.pathname||"/",x=y;if(d!=="/"){let S=d.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=Rd(t,{pathname:x});return vn(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),vn(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),MNe(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Yl([d,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:Yl([d,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,r,n,i)}function ENe(){let t=INe(),e=Xx(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application 
111Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),r?b.createElement("pre",{style:i},r):null,a)}var jNe=b.createElement(ENe,null),NNe=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?b.createElement(Io.Provider,{value:this.props.routeContext},b.createElement(U4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function PNe({routeContext:t,match:e,children:r}){let n=b.useContext(Up);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),b.createElement(Io.Provider,{value:t},r)}function MNe(t,e=[],r=null,n=null,i=null){if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,a=r?.errors;if(a!=null){let u=s.findIndex(d=>d.route.id&&a?.[d.route.id]!==void 0);rr(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let o=!1,c=-1;if(r)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:h}=r,m=d.route.loader&&!f.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){o=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,d,f)=>{let h,m=!1,y=null,x=null;r&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||jNe,o&&(c<0&&f===0?(Jae("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,x=null):c===f&&(m=!0,x=d.route.hydrateFallbackElement||null)));let v=e.concat(s.slice(0,f+1)),_=()=>{let S;return h?S=y:m?S=x:d.route.Component?S=b.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=u,b.createElement(PNe,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:r!=null},children:S})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?b.createElement(NNe,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:_(),routeContext:{outlet:null,matches:v,isDataRoute:!0},unstable_onError:n}):_()},null)}function W4(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ANe(t){let e=b.useContext(Up);return rr(e,W4(t)),e}function H4(t){let e=b.useContext(By);return rr(e,W4(t)),e}function DNe(t){let e=b.useContext(Io);return rr(e,W4(t)),e}function q4(t){let e=DNe(t),r=e.matches[e.matches.length-1];return rr(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function ONe(){return q4("useRouteId")}function RNe(){return H4("useNavigation").navigation}function Xae(){let{matches:t,loaderData:e}=H4("useMatches");return b.useMemo(()=>t.map(r=>Oae(r,e)),[t,e])}function INe(){let t=b.useContext(U4),e=H4("useRouteError"),r=q4("useRouteError");return t!==void 0?t:e.errors?.[r]}function LNe(){let{router:t}=ANe("useNavigate"),e=q4("useNavigate"),r=b.useRef(!1);return Zae(()=>{r.current=!0}),b.useCallback(async(i,s={})=>{vn(r.current,Qae),r.current&&(typeof i=="number"?t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var K8={};function Jae(t,e,r){!e&&!K8[t]&&(K8[t]=!0,vn(!1,r))}var Q8={};function Z8(t,e){!t&&!Q8[e]&&(Q8[e]=!0,console.warn(e))}function $Ne(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&vn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:b.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&vn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:b.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&vn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:b.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var FNe=["HydrateFallback","hydrateFallbackElement"],zNe=class{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=n=>
111{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}};function BNe({router:t,flushSync:e,unstable_onError:r}){let[n,i]=b.useState(t.state),[s,a]=b.useState(),[o,c]=b.useState({isTransitioning:!1}),[u,d]=b.useState(),[f,h]=b.useState(),[m,y]=b.useState(),x=b.useRef(new Map),v=b.useCallback(T=>{i(N=>(T.errors&&r&&Object.entries(T.errors).forEach(([j,M])=>{N.errors?.[j]!==M&&r(M)}),T))},[r]),_=b.useCallback((T,{deletedFetchers:N,flushSync:j,viewTransitionOpts:M})=>{T.fetchers.forEach((R,I)=>{R.data!==void 0&&x.current.set(I,R.data)}),N.forEach(R=>x.current.delete(R)),Z8(j===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let O=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Z8(M==null||O,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!M||!O){e&&j?e(()=>v(T)):b.startTransition(()=>v(T));return}if(e&&j){e(()=>{f&&(u&&u.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let R=t.window.document.startViewTransition(()=>{e(()=>v(T))});R.finished.finally(()=>{e(()=>{d(void 0),h(void 0),a(void 0),c({isTransitioning:!1})})}),e(()=>h(R));return}f?(u&&u.resolve(),f.skipTransition(),y({state:T,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(a(T),c({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[t.window,e,f,u,v]);b.useLayoutEffect(()=>t.subscribe(_),[t,_]),b.useEffect(()=>{o.isTransitioning&&!o.flushSync&&d(new zNe)},[o]),b.useEffect(()=>{if(u&&s&&t.window){let T=s,N=u.promise,j=t.window.document.startViewTransition(async()=>{b.startTransition(()=>v(T)),await N});j.finished.finally(()=>{d(void 0),h(void 0),a(void 0),c({isTransitioning:!1})}),h(j)}},[s,u,t.window,v]),b.useEffect(()=>{u&&s&&n.location.key===s.location.key&&u.resolve()},[u,f,n.location,s]),b.useEffect(()=>{!o.isTransitioning&&m&&(a(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),y(void 0))},[o.isTransitioning,m]);let S=b.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:T=>t.navigate(T),push:(T,N,j)=>t.navigate(T,{state:N,preventScrollReset:j?.preventScrollReset}),replace:(T,N,j)=>t.navigate(T,{replace:!0,state:N,preventScrollReset:j?.preventScrollReset})}),[t]),k=t.basename||"/",E=b.useMemo(()=>({router:t,navigator:S,static:!1,basename:k,unstable_onError:r}),[t,S,k,r]);return b.createElement(b.Fragment,null,b.createElement(Up.Provider,{value:E},b.createElement(By.Provider,{value:n},b.createElement(Kae.Provider,{value:x.current},b.createElement(V4.Provider,{value:o},b.createElement(GNe,{basename:k,location:n.location,navigationType:n.historyAction,navigator:S},b.createElement(VNe,{routes:t.routes,future:t.future,state:n,unstable_onError:r})))))),null)}var VNe=b.memo(UNe);function UNe({routes:t,future:e,state:r,unstable_onError:n}){return CNe(t,void 0,r,n,e)}function IE({to:t,replace:e,state:r,relative:n}){rr(Vy(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=b.useContext(Wa);vn(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=b.useContext(Io),{pathname:a}=ns(),o=Ws(),c=OE(t,DE(s),a,n==="path"),u=JSON.stringify(c);return b.useEffect(()=>{o(JSON.parse(u),{replace:e,state:r,relative:n})},[o,u,n,e,r]),null}function Y4(t){return TNe(t.context)}function GNe({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:s=!1}
111){rr(!Vy(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),o=b.useMemo(()=>({basename:a,navigator:i,static:s,future:{}}),[a,i,s]);typeof r=="string"&&(r=Of(r));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:h="default"}=r,m=b.useMemo(()=>{let y=za(c,a);return y==null?null:{location:{pathname:y,search:u,hash:d,state:f,key:h},navigationType:n}},[a,c,u,d,f,h,n]);return vn(m!=null,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:b.createElement(Wa.Provider,{value:o},b.createElement(RE.Provider,{children:e,value:m}))}var uk="get",dk="application/x-www-form-urlencoded";function LE(t){return t!=null&&typeof t.tagName=="string"}function WNe(t){return LE(t)&&t.tagName.toLowerCase()==="button"}function HNe(t){return LE(t)&&t.tagName.toLowerCase()==="form"}function qNe(t){return LE(t)&&t.tagName.toLowerCase()==="input"}function YNe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function KNe(t,e){return t.button===0&&(!e||e==="_self")&&!YNe(t)}function y$(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function QNe(t,e){let r=y$(t);return e&&e.forEach((n,i)=>{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}var I_=null;function ZNe(){if(I_===null)try{new FormData(document.createElement("form"),0),I_=!1}catch{I_=!0}return I_}var XNe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function C2(t){return t!=null&&!XNe.has(t)?(vn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dk}"`),null):t}function JNe(t,e){let r,n,i,s,a;if(HNe(t)){let o=t.getAttribute("action");n=o?za(o,e):null,r=t.getAttribute("method")||uk,i=C2(t.getAttribute("enctype"))||dk,s=new FormData(t)}else if(WNe(t)||qNe(t)&&(t.type==="submit"||t.type==="image")){let o=t.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||o.getAttribute("action");if(n=c?za(c,e):null,r=t.getAttribute("formmethod")||o.getAttribute("method")||uk,i=C2(t.getAttribute("formenctype"))||C2(o.getAttribute("enctype"))||dk,s=new FormData(o,t),!ZNe()){let{name:u,type:d,value:f}=t;if(d==="image"){let h=u?`${u}.`:"";s.append(`${h}x`,"0"),s.append(`${h}y`,"0")}else u&&s.append(u,f)}}else{if(LE(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=uk,n=null,i=dk,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function K4(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ePe(t,e,r){let n=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n.pathname==="/"?n.pathname=`_root.${r}`:e&&za(n.pathname,e)==="/"?n.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function tPe(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rPe(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function nPe(t,e,r){let n=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];
111if(s){let a=await tPe(s,r);return a.links?a.links():[]}return[]}));return oPe(n.flat(1).filter(rPe).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function X8(t,e,r,n,i,s){let a=(c,u)=>r[u]?c.route.id!==r[u].route.id:!0,o=(c,u)=>r[u].pathname!==c.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==c.params["*"];return s==="assets"?e.filter((c,u)=>a(c,u)||o(c,u)):s==="data"?e.filter((c,u)=>{let d=n.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(a(c,u)||o(c,u))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function iPe(t,e,{includeHydrateFallback:r}={}){return sPe(t.map(n=>{let i=e.routes[n.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function sPe(t){return[...new Set(t)]}function aPe(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function oPe(t,e){let r=new Set;return new Set(e),t.reduce((n,i)=>{let s=JSON.stringify(aPe(i));return r.has(s)||(r.add(s),n.push({key:s,link:i})),n},[])}function eoe(){let t=b.useContext(Up);return K4(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function lPe(){let t=b.useContext(By);return K4(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var $E=b.createContext(void 0);$E.displayName="FrameworkContext";function toe(){let t=b.useContext($E);return K4(t,"You must render this element inside a <HydratedRouter> element"),t}function cPe(t,e){let r=b.useContext($E),[n,i]=b.useState(!1),[s,a]=b.useState(!1),{onFocus:o,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=e,h=b.useRef(null);b.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let x=_=>{_.forEach(S=>{a(S.isIntersecting)})},v=new IntersectionObserver(x,{threshold:.5});return h.current&&v.observe(h.current),()=>{v.disconnect()}}},[t]),b.useEffect(()=>{if(n){let x=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(x)}}},[n]);let m=()=>{i(!0)},y=()=>{i(!1),a(!1)};return r?t!=="intent"?[s,h,{}]:[s,h,{onFocus:lv(o,m),onBlur:lv(c,y),onMouseEnter:lv(u,m),onMouseLeave:lv(d,y),onTouchStart:lv(f,m)}]:[!1,h,{}]}function lv(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function uPe({page:t,...e}){let{router:r}=eoe(),n=b.useMemo(()=>Rd(r.routes,t,r.basename),[r.routes,t,r.basename]);return n?b.createElement(fPe,{page:t,matches:n,...e}):null}function dPe(t){let{manifest:e,routeModules:r}=toe(),[n,i]=b.useState([]);return b.useEffect(()=>{let s=!1;return nPe(t,e,r).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,r]),n}function fPe({page:t,matches:e,...r}){let n=ns(),{manifest:i,routeModules:s}=toe(),{basename:a}=eoe(),{loaderData:o,matches:c}=lPe(),u=b.useMemo(()=>X8(t,e,c,i,n,"data"),[t,e,c,i,n]),d=b.useMemo(()=>X8(t,e,c,i,n,"assets"),[t,e,c,i,n]),f=b.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let y=new Set,x=!1;if(e.forEach(_=>{let S=i.routes[_.route.id];!S||!S.hasLoader||(!u.some(k=>k.route.id===_.route.id)&&_.route.id in o&&s[_.route.id]?.shouldRevalidate||S.hasClientLoader?x=!0:y.add(_.route.id))}),y.size===0)return[];let v=ePe(t,a,"data");return x&&y.size>0&&v.searchParams.set("_routes",e.filter(_=>y.has(_.route.id)).map(_=>_.route.id).join(",")),[v.pathname+v.search]},[a,o,n,i,u,e,t,s]),h=b.useMemo(()=>iPe(d,i),[d,i]),m=dPe(d);return b.createElement(b.Fragment,null,f.map(y=>b.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),h.map(y=>b.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),m.map(({key:y,link:x})=>b.createElement("link",{key:y,nonce:r.nonce,...x})))}function hPe(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var roe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{roe&&(window.__reactRouterVersion="7.9.5")}catch{}function pPe(t,e){return Xje({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:fje({window:e?.window}),hydrationData:mPe(),routes:t,mapRouteProperties:$Ne,hydrationRouteProperties:FNe,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window,unstable_instrumentations:e?.unstable_instrumentations}).initialize()}function mPe(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:gPe(t.errors)}),t}function gPe(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,i]of e)if(i&&i.__type==="RouteErrorResponse")r[n]=new Zk(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let a=new s(i.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let s=new Error(i.message);s.stack="",r[n]=s}}else r[n]=i;return r}var noe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,At=b.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:i,reloadDocument:s,replace:a,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f,...h},m){let{basename:y}=b.useContext(Wa),x=typeof u=="string"&&noe.test(u),v,_=!1;if(typeof u=="string"&&x&&(v=u,roe))try{let O=new URL(window.location.href),R=u.startsWith("//")?new URL(O.protocol+u):new URL(u),I=za(R.pathname,y);R.origin===O.origin&&I!=null?u=I+R.search+R.hash:_=!0}catch{vn(!1,`<Link to="${u}">
111 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let S=_Ne(u,{relative:i}),[k,E,T]=cPe(n,h),N=xPe(u,{replace:a,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:f});function j(O){e&&e(O),O.defaultPrevented||N(O)}let M=b.createElement("a",{...h,...T,href:v||S,onClick:_||s?e:j,ref:hPe(m,E),target:c,"data-discover":!x&&r==="render"?"true":void 0});return k&&!x?b.createElement(b.Fragment,null,M,b.createElement(uPe,{page:S})):M});At.displayName="Link";var Q4=b.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:i=!1,style:s,to:a,viewTransition:o,children:c,...u},d){let f=Sw(a,{relative:u.relative}),h=ns(),m=b.useContext(By),{navigator:y,basename:x}=b.useContext(Wa),v=m!=null&&CPe(f)&&o===!0,_=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,S=h.pathname,k=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;r||(S=S.toLowerCase(),k=k?k.toLowerCase():null,_=_.toLowerCase()),k&&x&&(k=za(k,x)||k);const E=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let T=S===_||!i&&S.startsWith(_)&&S.charAt(E)==="/",N=k!=null&&(k===_||!i&&k.startsWith(_)&&k.charAt(_.length)==="/"),j={isActive:T,isPending:N,isTransitioning:v},M=T?e:void 0,O;typeof n=="function"?O=n(j):O=[n,T?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let R=typeof s=="function"?s(j):s;return b.createElement(At,{...u,"aria-current":M,className:O,ref:d,style:R,to:a,viewTransition:o},typeof c=="function"?c(j):c)});Q4.displayName="NavLink";var yPe=b.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:s,method:a=uk,action:o,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:f,...h},m)=>{let y=_Pe(),x=SPe(o,{relative:u}),v=a.toLowerCase()==="get"?"get":"post",_=typeof o=="string"&&noe.test(o),S=k=>{if(c&&c(k),k.defaultPrevented)return;k.preventDefault();let E=k.nativeEvent.submitter,T=E?.getAttribute("formmethod")||a;y(E||k.currentTarget,{fetcherKey:e,method:T,navigate:r,replace:i,state:s,relative:u,preventScrollReset:d,viewTransition:f})};return b.createElement("form",{ref:m,method:v,action:x,onSubmit:n?c:S,...h,"data-discover":!_&&t==="render"?"true":void 0})});yPe.displayName="Form";function ioe({getKey:t,storageKey:e,...r}){let n=b.useContext($E),{basename:i}=b.useContext(Wa),s=ns(),a=Xae();kPe({getKey:t,storageKey:e});let o=b.useMemo(()=>{if(!n||!t)return null;let u=x$(s,a,i,t);return u!==s.key?u:null},[]);if(!n||n.isSpaMode)return null;let c=((u,d)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let h=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof h=="number"&&window.scrollTo(0,h)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return b.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${JSON.stringify(e||v$)}, ${JSON.stringify(o)})`}})}ioe.displayName="ScrollRestoration";function soe(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Z4(t){let e=b.useContext(Up);return rr(e,soe(t)),e}function vPe(t){let e=b.useContext(By);return rr(e,soe(t)),e}function xPe(t,{target:e,replace:r,state:n,preventScrollReset:i,relative:s,viewTransition:a}={}){let o=Ws(),c=ns(),u=Sw(t,{relative:s});return b.useCallback(d=>{if(KNe(d,e)){d.preventDefault();let f=r!==void 0?r:uc(c)===uc(u);o(t,{replace:f,state:n,preventScrollReset:i,relative:s,viewTransition:a})}},[c,o,u,r,n,e,t,i,s,a])}function aoe(t){vn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=b.useRef(y$(t)),r=b.useRef(!1),n=ns(),i=b.useMemo(()=>QNe(n.search,r.current?null:e.current),[n.search]),s=Ws(),a=b.useCallback((o,c)=>{const u=y$(typeof o=="function"?o(new URLSearchParams(i)):o);r.current=!0,s("?"+u,c)},[s,i]);return[i,a]}var bPe=0,wPe=()=>`__${String(++bPe)}__`;function _Pe(){let{router:t}=Z4("useSubmit"),{basename:e}=b.useContext(Wa),r=ONe();return b.useCallback(async(n,i={})=>{let{action:s,method:a,encType:o,formData:c,body:u}=JNe(n,e);if(i.navigate===!1){let d=i.fetcherKey||wPe();await t.fetch(d,r,i.action||s,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||a,formEncType:i.encType||o,flushSync:i.flushSync})}else await t.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||a,formEncType:i.encType||o,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[t,e,r])}function SPe(t,{relative:e}={}){let{basename:r}=b.useContext(Wa),n=b.useContext(Io);rr(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),s={...Sw(t||".",{relative:e})},a=ns();if(t==null){s.search=a.search;let o=new URLSearchParams(s.search),c=o.getAll("index");if(c.some(d=>d==="")){o.delete("index"),c.filter(f=>f).forEach(f=>o.append("index",f));let d=o.toString();s.search=d?`?${d}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Yl([r,s.pathname])),uc(s)}var v$="react-router-scroll-positions",L_={};function x$(t,e,r,n){let i=null;return n&&(r!=="/"?i=n({...t,pathname:za(t.pathname,r)||t.pathname},e):i=n(t,e)),i==null&&(i=t.key),i}function kPe({getKey:t,storageKey:e}={}){let{router:r}=Z4("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:i}
111=vPe("useScrollRestoration"),{basename:s}=b.useContext(Wa),a=ns(),o=Xae(),c=RNe();b.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),TPe(b.useCallback(()=>{if(c.state==="idle"){let u=x$(a,o,s,t);L_[u]=window.scrollY}try{sessionStorage.setItem(e||v$,JSON.stringify(L_))}catch(u){vn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[c.state,t,s,a,o,e])),typeof document<"u"&&(b.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(e||v$);u&&(L_=JSON.parse(u))}catch{}},[e]),b.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(L_,()=>window.scrollY,t?(d,f)=>x$(d,f,s,t):void 0);return()=>u&&u()},[r,s,t]),b.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{vn(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[a,n,i]))}function TPe(t,e){let{capture:r}={};b.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",t,n),()=>{window.removeEventListener("pagehide",t,n)}},[t,r])}function CPe(t,{relative:e}={}){let r=b.useContext(V4);rr(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Z4("useViewTransitionState"),i=Sw(t,{relative:e});if(!r.isTransitioning)return!1;let s=za(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=za(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Qk(i.pathname,a)!=null||Qk(i.pathname,s)!=null}/**
112 * @license lucide-react v0.344.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */var EPe={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"};/**
117 * @license lucide-react v0.344.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const jPe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),_e=(t,e)=>{const r=b.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:o="",children:c,...u},d)=>b.createElement("svg",{ref:d,...EPe,width:i,height:i,stroke:n,strokeWidth:a?Number(s)*24/Number(i):s,className:["lucide",`lucide-${jPe(t)}`,o].join(" "),...u},[...e.map(([f,h])=>b.createElement(f,h)),...Array.isArray(c)?c:[c]]));return r.displayName=`${t}`,r};/**
122 * @license lucide-react v0.344.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const b$=_e("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
127 * @license lucide-react v0.344.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const Ts=_e("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
132 * @license lucide-react v0.344.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const Wu=_e("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
137 * @license lucide-react v0.344.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const Jk=_e("ArrowDownToDot",[["path",{d:"M12 2v14",key:"jyx4ut"}],["path",{d:"m19 9-7 7-7-7",key:"1oe3oy"}],["circle",{cx:"12",cy:"21",r:"1",key:"o0uj5v"}]]);/**
142 * @license lucide-react v0.344.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const w$=_e("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
147 * @license lucide-react v0.344.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const Tu=_e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
152 * @license lucide-react v0.344.0 - ISC
153 *
154 * This source code is licensed under the ISC license.
155 * See the LICENSE file in the root directory of this source tree.
156 */const Jx=_e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
157 * @license lucide-react v0.344.0 - ISC
158 *
159 * This source code is licensed under the ISC license.
160 * See the LICENSE file in the root directory of this source tree.
161 */const eT=_e("ArrowUpFromDot",[["path",{d:"m5 9 7-7 7 7",key:"1hw5ic"}],["path",{d:"M12 16V2",key:"ywoabb"}],["circle",{cx:"12",cy:"21",r:"1",key:"o0uj5v"}]]);/**
162 * @license lucide-react v0.344.0 - ISC
163 *
164 * This source code is licensed under the ISC license.
165 * See the LICENSE file in the root directory of this source tree.
166 */const Cs=_e("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
167 * @license lucide-react v0.344.0 - ISC
168 *
169 * This source code is licensed under the ISC license.
170 * See the LICENSE file in the root directory of this source tree.
171 */const _$=_e("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
172 * @license lucide-react v0.344.0 - ISC
173 *
174 * This source code is licensed under the ISC license.
175 * See the LICENSE file in the root directory of this source tree.
176 */const eb=_e("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/**
177 * @license lucide-react v0.344.0 - ISC
178 *
179 * This source code is licensed under the ISC license.
180 * See the LICENSE file in the root directory of this source tree.
181 */const NPe=_e("BadgeAlert",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
182 * @license lucide-react v0.344.0 - ISC
183 *
184 * This source code is licensed under the ISC license.
185 * See the LICENSE file in the root directory of this source tree.
186 */const _f=_e("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
187 * @license lucide-react v0.344.0 - ISC
188 *
189 * This source code is licensed under the ISC license.
190 * See the LICENSE file in the root directory of this source tree.
191 */const ooe=_e("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
192 * @license lucide-react v0.344.0 - ISC
193 *
194 * This source code is licensed under the ISC license.
195 * See the LICENSE file in the root directory of this source tree.
196 */const PPe=_e("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/**
197 * @license lucide-react v0.344.0 - ISC
198 *
199 * This source code is licensed under the ISC license.
200 * See the LICENSE file in the root directory of this source tree.
201 */const FE=_e("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
202 * @license lucide-react v0.344.0 - ISC
203 *
204 * This source code is licensed under the ISC license.
205 * See the LICENSE file in the root directory of this source tree.
206 */const sf=_e("Brain",[["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:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["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:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
207 * @license lucide-react v0.344.0 - ISC
208 *
209 * This source code is licensed under the ISC license.
210 * See the LICENSE file in the root directory of this source tree.
211 */const MPe=_e("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}
211],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
212 * @license lucide-react v0.344.0 - ISC
213 *
214 * This source code is licensed under the ISC license.
215 * See the LICENSE file in the root directory of this source tree.
216 */const APe=_e("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
217 * @license lucide-react v0.344.0 - ISC
218 *
219 * This source code is licensed under the ISC license.
220 * See the LICENSE file in the root directory of this source tree.
221 */const DPe=_e("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
222 * @license lucide-react v0.344.0 - ISC
223 *
224 * This source code is licensed under the ISC license.
225 * See the LICENSE file in the root directory of this source tree.
226 */const OPe=_e("CalendarX",[["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"}],["path",{d:"m14 14-4 4",key:"rymu2i"}],["path",{d:"m10 14 4 4",key:"3sz06r"}]]);/**
227 * @license lucide-react v0.344.0 - ISC
228 *
229 * This source code is licensed under the ISC license.
230 * See the LICENSE file in the root directory of this source tree.
231 */const Cu=_e("Calendar",[["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"}]]);/**
232 * @license lucide-react v0.344.0 - ISC
233 *
234 * This source code is licensed under the ISC license.
235 * See the LICENSE file in the root directory of this source tree.
236 */const RPe=_e("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
237 * @license lucide-react v0.344.0 - ISC
238 *
239 * This source code is licensed under the ISC license.
240 * See the LICENSE file in the root directory of this source tree.
241 */const fk=_e("CandlestickChart",[["path",{d:"M9 5v4",key:"14uxtq"}],["rect",{width:"4",height:"6",x:"7",y:"9",rx:"1",key:"f4fvz0"}],["path",{d:"M9 15v2",key:"r5rk32"}],["path",{d:"M17 3v2",key:"1l2re6"}],["rect",{width:"4",height:"8",x:"15",y:"5",rx:"1",key:"z38je5"}],["path",{d:"M17 13v3",key:"5l0wba"}],["path",{d:"M3 3v18h18",key:"1s2lah"}]]);/**
242 * @license lucide-react v0.344.0 - ISC
243 *
244 * This source code is licensed under the ISC license.
245 * See the LICENSE file in the root directory of this source tree.
246 */const X4=_e("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
247 * @license lucide-react v0.344.0 - ISC
248 *
249 * This source code is licensed under the ISC license.
250 * See the LICENSE file in the root directory of this source tree.
251 */const ei=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
252 * @license lucide-react v0.344.0 - ISC
253 *
254 * This source code is licensed under the ISC license.
255 * See the LICENSE file in the root directory of this source tree.
256 */const Eu=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
257 * @license lucide-react v0.344.0 - ISC
258 *
259 * This source code is licensed under the ISC license.
260 * See the LICENSE file in the root directory of this source tree.
261 */const up=_e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
262 * @license lucide-react v0.344.0 - ISC
263 *
264 * This source code is licensed under the ISC license.
265 * See the LICENSE file in the root directory of this source tree.
266 */const Sf=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
267 * @license lucide-react v0.344.0 - ISC
268 *
269 * This source code is licensed under the ISC license.
270 * See the LICENSE file in the root directory of this source tree.
271 */const J4=_e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
272 * @license lucide-react v0.344.0 - ISC
273 *
274 * This source code is licensed under the ISC license.
275 * See the LICENSE file in the root directory of this source tree.
276 */const IPe=_e("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
277 * @license lucide-react v0.344.0 - ISC
278 *
279 * This source code is licensed under the ISC license.
280 * See the LICENSE file in the root directory of this source tree.
281 */const LPe=_e("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
282 * @license lucide-react v0.344.0 - ISC
283 *
284 * This source code is licensed under the ISC license.
285 * See the LICENSE file in the root directory of this source tree.
286 */const $Pe=_e("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
287 * @license lucide-react v0.344.0 - ISC
288 *
289 * This source code is licensed under the ISC license.
290 * See the LICENSE file in the root directory of this source tree.
291 */const FPe=_e("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
292 * @license lucide-react v0.344.0 - ISC
293 *
294 * This source code is licensed under the ISC license.
295 * See the LICENSE file in the root directory of this source tree.
296 */const loe=_e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
297 * @license lucide-react v0.344.0 - ISC
298 *
299 * This source code is licensed under the ISC license.
300 * See the LICENSE file in the root directory of this source tree.
301 */const Is=_e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
302 * @license lucide-react v0.344.0 - ISC
303 *
304 * This source code is licensed under the ISC license.
305 * See the LICENSE file in the root directory of this source tree.
306 */const zPe=_e("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/**
307 * @license lucide-react v0.344.0 - ISC
308 *
309 * This source code is licensed under the ISC license.
310 * See the LICENSE file in the root directory of this source tree.
311 */const coe=_e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
312 * @license lucide-react v0.344.0 - ISC
313 *
314 * This source code is licensed under the ISC license.
315 * See the LICENSE file in the root directory of this source tree.
316 */const BPe=_e("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
317 * @license lucide-react v0.344.0 - ISC
318 *
319 * This source code is licensed under the ISC license.
320 * See the LICENSE file in the root directory of this source tree.
321 */const Yc=_e("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
322 * @license lucide-react v0.344.0 - ISC
323 *
324 * This source code is licensed under the ISC license.
325 * See the LICENSE file in the root directory of this source tree.
326 */const tT=_e("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
327 * @license lucide-react v0.344.0 - ISC
328 *
329 * This source code is licensed under the ISC license.
330 * See the LICENSE file in the root directory of this source tree.
331 */const rT=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
332 * @license lucide-react v0.344.0 - ISC
333 *
334 * This source code is licensed under the ISC license.
335 * See the LICENSE file in the root directory of this source tree.
336 */const VPe=_e("Dumbbell",[["path",{d:"m6.5 6.5 11 11",key:"f7oqzb"}],["path",{d:"m21 21-1-1",key:"cpc6if"}],["path",{d:"m3 3 1 1",key:"d3rpuf"}],["path",{d:"m18 22 4-4",key:"1e32o6"}],["path",{d:"m2 6 4-4",key:"189tqz"}],["path",{d:"m3 10 7-7",key:"1bxui2"}],["path",{d:"m14 21 7-7",key:"16x78n"}]]);/**
337 * @license lucide-react v0.344.0 - ISC
338 *
339 * This source code is licensed under the ISC license.
340 * See the LICENSE file in the root directory of this source tree.
341 */const UPe=_e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
342 * @license lucide-react v0.344.0 - ISC
343 *
344 * This source code is licensed under the ISC license.
345 * See the LICENSE file in the root directory of this source tree.
346 */const uoe=_e("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
347 * @license lucide-react v0.344.0 - ISC
348 *
349 * This source code is licensed under the ISC license.
350 * See the LICENSE file in the root directory of this source tree.
351 */const tb=_e("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
352 * @license lucide-react v0.344.0 - ISC
353 *
354 * This source code is licensed under the ISC license.
355 * See the LICENSE file in the root directory of this source tree.
356 */const E2=_e("FileMinus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);/**
357 * @license lucide-react v0.344.0 - ISC
358 *
359 * This source code is licensed under the ISC license.
360 * See the LICENSE file in the root directory of this source tree.
361 */const e3=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
362 * @license lucide-react v0.344.0 - ISC
363 *
364 * This source code is licensed under the ISC license.
365 * See the LICENSE file in the root directory of this source tree.
366 */const GPe=_e("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
367 * @license lucide-react v0.344.0 - ISC
368 *
369 * This source code is licensed under the ISC license.
370 * See the LICENSE file in the root directory of this source tree.
371 */const t3=_e("GaugeCircle",[["path",{d:"M15.6 2.7a10 10 0 1 0 5.7 5.7",key:"1e0p6d"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M13.4 10.6 19 5",key:"1kr7tw"}]]);/**
372 * @license lucide-react v0.344.0 - ISC
373 *
374 * This source code is licensed under the ISC license.
375 * See the LICENSE file in the root directory of this source tree.
376 */const WPe=_e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
377 * @license lucide-react v0.344.0 - ISC
378 *
379 * This source code is licensed under the ISC license.
380 * See the LICENSE file in the root directory of this source tree.
381 */const HPe=_e("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
382 * @license lucide-react v0.344.0 - ISC
383 *
384 * This source code is licensed under the ISC license.
385 * See the LICENSE file in the root directory of this source tree.
386 */const qPe=_e("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
386]]);/**
387 * @license lucide-react v0.344.0 - ISC
388 *
389 * This source code is licensed under the ISC license.
390 * See the LICENSE file in the root directory of this source tree.
391 */const YPe=_e("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
392 * @license lucide-react v0.344.0 - ISC
393 *
394 * This source code is licensed under the ISC license.
395 * See the LICENSE file in the root directory of this source tree.
396 */const r3=_e("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
397 * @license lucide-react v0.344.0 - ISC
398 *
399 * This source code is licensed under the ISC license.
400 * See the LICENSE file in the root directory of this source tree.
401 */const KPe=_e("History",[["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"}]]);/**
402 * @license lucide-react v0.344.0 - ISC
403 *
404 * This source code is licensed under the ISC license.
405 * See the LICENSE file in the root directory of this source tree.
406 */const kw=_e("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
407 * @license lucide-react v0.344.0 - ISC
408 *
409 * This source code is licensed under the ISC license.
410 * See the LICENSE file in the root directory of this source tree.
411 */const n3=_e("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/**
412 * @license lucide-react v0.344.0 - ISC
413 *
414 * This source code is licensed under the ISC license.
415 * See the LICENSE file in the root directory of this source tree.
416 */const doe=_e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
417 * @license lucide-react v0.344.0 - ISC
418 *
419 * This source code is licensed under the ISC license.
420 * See the LICENSE file in the root directory of this source tree.
421 */const J8=_e("Layers2",[["path",{d:"m16.02 12 5.48 3.13a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74L7.98 12",key:"1cuww1"}],["path",{d:"M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74Z",key:"pdlvxu"}]]);/**
422 * @license lucide-react v0.344.0 - ISC
423 *
424 * This source code is licensed under the ISC license.
425 * See the LICENSE file in the root directory of this source tree.
426 */const hk=_e("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
427 * @license lucide-react v0.344.0 - ISC
428 *
429 * This source code is licensed under the ISC license.
430 * See the LICENSE file in the root directory of this source tree.
431 */const QPe=_e("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
432 * @license lucide-react v0.344.0 - ISC
433 *
434 * This source code is licensed under the ISC license.
435 * See the LICENSE file in the root directory of this source tree.
436 */const i3=_e("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
437 * @license lucide-react v0.344.0 - ISC
438 *
439 * This source code is licensed under the ISC license.
440 * See the LICENSE file in the root directory of this source tree.
441 */const dp=_e("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
442 * @license lucide-react v0.344.0 - ISC
443 *
444 * This source code is licensed under the ISC license.
445 * See the LICENSE file in the root directory of this source tree.
446 */const ZPe=_e("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",ke
446y:"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"}]]);/**
447 * @license lucide-react v0.344.0 - ISC
448 *
449 * This source code is licensed under the ISC license.
450 * See the LICENSE file in the root directory of this source tree.
451 */const XPe=_e("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
452 * @license lucide-react v0.344.0 - ISC
453 *
454 * This source code is licensed under the ISC license.
455 * See the LICENSE file in the root directory of this source tree.
456 */const No=_e("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
457 * @license lucide-react v0.344.0 - ISC
458 *
459 * This source code is licensed under the ISC license.
460 * See the LICENSE file in the root directory of this source tree.
461 */const S$=_e("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
462 * @license lucide-react v0.344.0 - ISC
463 *
464 * This source code is licensed under the ISC license.
465 * See the LICENSE file in the root directory of this source tree.
466 */const JPe=_e("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
467 * @license lucide-react v0.344.0 - ISC
468 *
469 * This source code is licensed under the ISC license.
470 * See the LICENSE file in the root directory of this source tree.
471 */const xs=_e("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
472 * @license lucide-react v0.344.0 - ISC
473 *
474 * This source code is licensed under the ISC license.
475 * See the LICENSE file in the root directory of this source tree.
476 */const eMe=_e("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
477 * @license lucide-react v0.344.0 - ISC
478 *
479 * This source code is licensed under the ISC license.
480 * See the LICENSE file in the root directory of this source tree.
481 */const tMe=_e("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);/**
482 * @license lucide-react v0.344.0 - ISC
483 *
484 * This source code is licensed under the ISC license.
485 * See the LICENSE file in the root directory of this source tree.
486 */const fp=_e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
487 * @license lucide-react v0.344.0 - ISC
488 *
489 * This source code is licensed under the ISC license.
490 * See the LICENSE file in the root directory of this source tree.
491 */const rMe=_e("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
492 * @license lucide-react v0.344.0 - ISC
493 *
494 * This source code is licensed under the ISC license.
495 * See the LICENSE file in the root directory of this source tree.
496 */const s3=_e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
497 * @license lucide-react v0.344.0 - ISC
498 *
499 * This source code is licensed under the ISC license.
500 * See the LICENSE file in the root directory of this source tree.
501 */const foe=_e("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
502 * @license lucide-react v0.344.0 - ISC
503 *
504 * This source code is licensed under the ISC license.
505 * See the LICENSE file in the root directory of this source tree.
506 */const nMe=_e("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
507 * @license lucide-react v0.344.0 - ISC
508 *
509 * This source code is licensed under the ISC license.
510 * See the LICENSE file in the root directory of this source tree.
511 */const ju=_e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
512 * @license lucide-react v0.344.0 - ISC
513 *
514 * This source code is licensed under the ISC license.
515 * See the LICENSE file in the root directory of this source tree.
516 */const iMe=_e("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
517 * @license lucide-react v0.344.0 - ISC
518 *
519 * This source code is licensed under the ISC license.
520 * See the LICENSE file in the root directory of this source tree.
521 */const sMe=_e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
522 * @license lucide-react v0.344.0 - ISC
523 *
524 * This source code is licensed under the ISC license.
525 * See the LICENSE file in the root directory of this source tree.
526 */const aMe=_e("MoreHorizontal",[["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"}]]);/**
527 * @license lucide-react v0.344.0 - ISC
528 *
529 * This source code is licensed under the ISC license.
530 * See the LICENSE file in the root directory of this source tree.
531 */const hoe=_e("Mouse",[["rect",{x:"5",y:"2",width:"14",height:"20",rx:"7",key:"11ol66"}],["path",{d:"M12 6v4",key:"16clxf"}]]);/**
532 * @license lucide-react v0.344.0 - ISC
533 *
534 * This source code is licensed under the ISC license.
535 * See the LICENSE file in the root directory of this source tree.
536 */const j2=_e("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);/**
537 * @license lucide-react v0.344.0 - ISC
538 *
539 * This source code is licensed under the ISC license.
540 * See the LICENSE file in the root directory of this source tree.
541 */const oMe=_e("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
542 * @license lucide-react v0.344.0 - ISC
543 *
544 * This source code is licensed under the ISC license.
545 * See the LICENSE file in the root directory of this source tree.
546 */const eq=_e("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/**
547 * @license lucide-react v0.344.0 - ISC
548 *
549 * This source code is licensed under the ISC license.
550 * See the LICENSE file in the root directory of this source tree.
551 */const lMe=_e("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
552 * @license lucide-react v0.344.0 - ISC
553 *
554 * This source code is licensed under the ISC license.
555 * See the LICENSE file in the root directory of this source tree.
556 */const k$=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
557 * @license lucide-react v0.344.0 - ISC
558 *
559 * This source code is licensed under the ISC license.
560 * See the LICENSE file in the root directory of this source tree.
561 */const N2=_e("Quote",[["path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",ke
561y:"4rm80e"}],["path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",key:"10za9r"}]]);/**
562 * @license lucide-react v0.344.0 - ISC
563 *
564 * This source code is licensed under the ISC license.
565 * See the LICENSE file in the root directory of this source tree.
566 */const T$=_e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
567 * @license lucide-react v0.344.0 - ISC
568 *
569 * This source code is licensed under the ISC license.
570 * See the LICENSE file in the root directory of this source tree.
571 */const poe=_e("RotateCcw",[["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"}]]);/**
572 * @license lucide-react v0.344.0 - ISC
573 *
574 * This source code is licensed under the ISC license.
575 * See the LICENSE file in the root directory of this source tree.
576 */const moe=_e("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
577 * @license lucide-react v0.344.0 - ISC
578 *
579 * This source code is licensed under the ISC license.
580 * See the LICENSE file in the root directory of this source tree.
581 */const cMe=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
582 * @license lucide-react v0.344.0 - ISC
583 *
584 * This source code is licensed under the ISC license.
585 * See the LICENSE file in the root directory of this source tree.
586 */const a3=_e("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
587 * @license lucide-react v0.344.0 - ISC
588 *
589 * This source code is licensed under the ISC license.
590 * See the LICENSE file in the root directory of this source tree.
591 */const fl=_e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
592 * @license lucide-react v0.344.0 - ISC
593 *
594 * This source code is licensed under the ISC license.
595 * See the LICENSE file in the root directory of this source tree.
596 */const zE=_e("Shield",[["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"}]]);/**
597 * @license lucide-react v0.344.0 - ISC
598 *
599 * This source code is licensed under the ISC license.
600 * See the LICENSE file in the root directory of this source tree.
601 */const uMe=_e("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
602 * @license lucide-react v0.344.0 - ISC
603 *
604 * This source code is licensed under the ISC license.
605 * See the LICENSE file in the root directory of this source tree.
606 */const Kc=_e("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
607 * @license lucide-react v0.344.0 - ISC
608 *
609 * This source code is licensed under the ISC license.
610 * See the LICENSE file in the root directory of this source tree.
611 */const dMe=_e("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
612 * @license lucide-react v0.344.0 - ISC
613 *
614 * This source code is licensed under the ISC license.
615 * See the LICENSE file in the root directory of this source tree.
616 */const fMe=_e("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
617 * @license lucide-react v0.344.0 - ISC
618 *
619 * This source code is licensed under the ISC license.
620 * See the LICENSE file in the root directory of this source tree.
621 */const hMe=_e("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
622 * @license lucide-react v0.344.0 - ISC
623 *
624 * This source code is licensed under the ISC license.
625 * See the LICENSE file in the root directory of this source tree.
626 */const P2=_e("Tag",[["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"}]]);/**
627 * @license lucide-react v0.344.0 - ISC
628 *
629 * This source code is licensed under the ISC license.
630 * See the LICENSE file in the root directory of this source tree.
631 */const px=_e("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
632 * @license lucide-react v0.344.0 - ISC
633 *
634 * This source code is licensed under the ISC license.
635 * See the LICENSE file in the root directory of this source tree.
636 */const C$=_e("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z",key:"s6e0r"}]]);/**
637 * @license lucide-react v0.344.0 - ISC
638 *
639 * This source code is licensed under the ISC license.
640 * See the LICENSE file in the root directory of this source tree.
641 */const E$=_e("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z",key:"y3tblf"}]]);/**
642 * @license lucide-react v0.344.0 - ISC
643 *
644 * This source code is licensed under the ISC license.
645 * See the LICENSE file in the root directory of this source tree.
646 */const j$=_e("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
647 * @license lucide-react v0.344.0 - ISC
648 *
649 * This source code is licensed under the ISC license.
650 * See the LICENSE file in the root directory of this source tree.
651 */const hl=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
652 * @license lucide-react v0.344.0 - ISC
653 *
654 * This source code is licensed under the ISC license.
655 * See the LICENSE file in the root directory of this source tree.
656 */const N$=_e("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
657 * @license lucide-react v0.344.0 - ISC
658 *
659 * This source code is licensed under the ISC license.
660 * See the LICENSE file in the root directory of this source tree.
661 */const Kl=_e("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
662 * @license lucide-react v0.344.0 - ISC
663 *
664 * This source code is licensed under the ISC license.
665 * See the LICENSE file in the root directory of this source tree.
666 */const _s=_e("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
667 * @license lucide-react v0.344.0 - ISC
668 *
669 * This source code is licensed under the ISC license.
670 * See the LICENSE file in the root directory of this source tree.
671 */const zl=_e("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
672 * @license lucide-react v0.344.0 - ISC
673 *
674 * This source code is licensed under the ISC license.
675 * See the LICENSE file in the root directory of this source tree.
676 */const goe=_e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
677 * @license lucide-react v0.344.0 - ISC
678 *
679 * This source code is licensed under the ISC license.
680 * See the LICENSE file in the root directory of this source tree.
681 */const af=_e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
682 * @license lucide-react v0.344.0 - ISC
683 *
684 * This source code is licensed under the ISC license.
685 * See the LICENSE file in the root directory of this source tree.
686 */const pMe=_e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
687 * @license lucide-react v0.344.0 - ISC
688 *
689 * This source code is licensed under the ISC license.
690 * See the LICENSE file in the root directory of this source tree.
691 */const Tw=_e("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
692 * @license lucide-react v0.344.0 - ISC
693 *
694 * This source code is licensed under the ISC license.
695 * See the LICENSE file in the root directory of this source tree.
696 */const pi=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,897 bytes, lines 696-701
696],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
697 * @license lucide-react v0.344.0 - ISC
698 *
699 * This source code is licensed under the ISC license.
700 * See the LICENSE file in the root directory of this source tree.
701 */const BE=_e("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);var bc=gae();const VE=Lr(bc);function mMe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const gMe=t=>{switch(t){case"success":return xMe;case"info":return wMe;case"warning":return bMe;case"error":return _Me;default:return null}},yMe=Array(12).fill(0),vMe=({visible:t,className:e})=>P.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},P.createElement("div",{className:"sonner-spinner"},yMe.map((r,n)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),xMe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),bMe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.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"})),wMe=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),_Me=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.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"})),SMe=P.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"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kMe=()=>{const[t,e]=P.useState(document.hidden);return P.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let P$=1;class TMe{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...i}=e,s=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:P$++,a=this.toasts.find(c=>c.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...e,id:s,title:n}),{...c,...e,id:s,dismissible:o,title:n}):c):this.addToast({title:n,...i,dismissible:o,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=n!==void 0,a;const o=i.then(async u=>{if(a=["resolve",u],P.isValidElement(u))s=!1,this.create({id:n,type:"default",message:u});else if(EMe(u)&&!u.ok){s=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,y=typeof f=="object"&&!P.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...y})}else if(u instanceof Error){s=!1;const f=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description,y=typeof f=="object"&&!P.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...y})}else if(r.success!==void 0){s=!1;const f=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description,y=typeof f=="object"&&!P.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...y})}}).catch(async u=>{if(a=["reject",u],r.error!==void 0){s=!1;const d=typeof r.error=="function"?await r.error(u):r.error,f=typeof r.description=="function"?await r.description(u):r.description,m=typeof d=="object"&&!P.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:f,...m})}}).finally(()=>{s&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=r?.id||P$++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const na=new TMe,CMe=(t,e)=>{const r=e?.id||P$++;return na.addToast({title:t,...e,id:r}),r},EMe=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",jMe=CMe,NMe=()=>na.toasts,PMe=()=>na.getActiveToasts(),Ft=Object.assign(jMe,{success:na.success,info:na.info,warning:na.warning,error:na.error,custom:na.custom,message:na.message,promise:na.promise,dismiss:na.dismiss,loading:na.loading},{getHistory:NMe,getToasts:PMe});mM
vendor: 14,874 bytes, line 701
701e("[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 
701$_(t){return t.label!==void 0}const MMe=3,AMe="24px",DMe="16px",tq=4e3,OMe=356,RMe=14,IMe=45,LMe=200;function Pl(...t){return t.filter(Boolean).join(" ")}function $Me(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const FMe=t=>{var e,r,n,i,s,a,o,c,u;const{invert:d,toast:f,unstyled:h,interacting:m,setHeights:y,visibleToasts:x,heights:v,index:_,toasts:S,exp
vendor: 13,869 bytes, line 701
701anded:k,removeToast:E,defaultRichColors:T,closeButton:N,style:j,cancelButtonStyle:M,actionButtonStyle:O,className:R="",descriptionClassName:I="",duration:B,position:F,gap:V,expandByDefault:$,classNames:U,icons:z,closeButtonAriaLabel:L="Close toast"}=t,[W,K]=P.useState(null),[q,H]=P.useState(null),[Y,J]=P.useState(!1),[re,me]=P.useState(!1),[oe,ge]=P.useState(!1),[le,Se]=P.useState(!1),[Ce,he]=P.useState(!1),[Ct,De]=P.useState(0),[It,Yt]=P.useState(0),Qt=P.useRef(f.duration||B||tq),Qr=P.useRef(null),gr=P.useRef(null),X=_===0,ae=_+1<=x,de=f.type,Ee=f.dismissible!==!1,Me=f.className||"",Te=f.descriptionClassName||"",Qe=P.useMemo(()=>v.findIndex(it=>it.toastId===f.id)||0,[v,f.id]),Nt=P.useMemo(()=>{var it;return(it=f.closeButton)!=null?it:N},[f.closeButton,N]),jt=P.useMemo(()=>f.duration||B||tq,[f.duration,B]),jr=P.useRef(0),Vr=P.useRef(0),Dr=P.useRef(0),$r=P.useRef(null),[Ur,Ni]=F.split("-"),zi=P.useMemo(()=>v.reduce((it,Wt,cr)=>cr>=Qe?it:it+Wt.height,0),[v,Qe]),Nn=kMe(),or=f.invert||d,xt=de==="loading";Vr.current=P.useMemo(()=>Qe*V+zi,[Qe,zi]),P.useEffect(()=>{Qt.current=jt},[jt]),P.useEffect(()=>{J(!0)},[]),P.useEffect(()=>{const it=gr.current;if(it){const Wt=it.getBoundingClientRect().height;return Yt(Wt),y(cr=>[{toastId:f.id,height:Wt,position:f.position},...cr]),()=>y(cr=>cr.filter(Jt=>Jt.toastId!==f.id))}},[y,f.id]),P.useLayoutEffect(()=>{if(!Y)return;const it=gr.current,Wt=it.style.height;it.style.height="auto";const cr=it.getBoundingClientRect().height;it.style.height=Wt,Yt(cr),y(Jt=>Jt.find(yr=>yr.toastId===f.id)?Jt.map(yr=>yr.toastId===f.id?{...yr,height:cr}:yr):[{toastId:f.id,height:cr,position:f.position},...Jt])},[Y,f.title,f.description,y,f.id,f.jsx,f.action,f.cancel]);const $e=P.useCallback(()=>{me(!0),De(Vr.current),y(it=>it.filter(Wt=>Wt.toastId!==f.id)),setTimeout(()=>{E(f)},LMe)},[f,E,y,Vr]);P.useEffect(()=>{if(f.promise&&de==="loading"||f.duration===1/0||f.type==="loading")return;let it;return k||m||Nn?(()=>{if(Dr.current<jr.current){const Jt=new Date().getTime()-jr.current;Qt.current=Qt.current-Jt}Dr.current=new Date().getTime()})():(()=>{Qt.current!==1/0&&(jr.current=new Date().getTime(),it=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),$e()},Qt.current))})(),()=>clearTimeout(it)},[k,m,f,de,Nn,$e]),P.useEffect(()=>{f.delete&&($e(),f.onDismiss==null||f.onDismiss.call(f,f))},[$e,f.delete]);function We(){var it;if(z?.loading){var Wt;return P.createElement("div",{className:Pl(U?.loader,f==null||(Wt=f.classNames)==null?void 0:Wt.loader,"sonner-loader"),"data-visible":de==="loading"},z.loading)}return P.createElement(vMe,{className:Pl(U?.loader,f==null||(it=f.classNames)==null?void 0:it.loader),visible:de==="loading"})}const rt=f.icon||z?.[de]||gMe(de);var bt,ut;return P.createElement("li",{tabIndex:0,ref:gr,className:Pl(R,Me,U?.toast,f==null||(e=f.classNames)==null?void 0:e.toast,U?.default,U?.[de],f==null||(r=f.classNames)==null?void 0:r[de]),"data-sonner-toast":"","data-rich-colors":(bt=f.richColors)!=null?bt:T,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":Y,"data-promise":!!f.promise,"data-swiped":Ce,"data-removed":re,"data-visible":ae,"data-y-position":Ur,"data-x-position":Ni,"data-index":_,"data-front":X,"data-swiping":oe,"data-dismissible":Ee,"data-type":de,"data-invert":or,"data-swipe-out":le,"data-swipe-direction":q,"data-expanded":!!(k||$&&Y),"data-testid":f.testId,style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${re?Ct:Vr.current}px`,"--initial-height":$?"auto":`${It}px`,...j,...f.style},onDragEnd:()=>{ge(!1),K(null),$r.current=null},onPointerDown:it=>{it.button!==2&&(xt||!Ee||(Qr.current=new Date,De(Vr.current),it.target.setPointerCapture(it.pointerId),it.target.tagName!=="BUTTON"&&(ge(!0),$r.current={x:it.clientX,y:it.clientY})))},onPointerUp:()=>{var it,Wt,cr;if(le||!Ee)return;$r.current=null;const Jt=Number(((it=gr.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pn=Number(((Wt=gr.current)==null?void 0:Wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yr=new Date().getTime()-((cr=Qr.current)==null?void 0:cr.getTime()),Q=W==="x"?Jt:pn,ie=Math.abs(Q)/yr;if(Math.abs(Q)>=IMe||ie>.11){De(Vr.current),f.onDismiss==null||f.onDismiss.call(f,f),H(W==="x"?Jt>0?"right":"left":pn>0?"down":"up"),$e(),Se(!0);return}else{var ue,je;(ue=gr.current)==null||ue.style.setProperty("--swipe-amount-x","0px"),(je=gr.current)==null||je.style.setProperty("--swipe-amount-y","0px")}he(!1),ge(!1),K(null)},onPointerMove:it=>{var Wt,cr,Jt;if(!$r.current||!Ee||((Wt=window.getSelection())==null?void 0:Wt.toString().length)>0)return;const yr=it.clientY-$r.current.y,Q=it.clientX-$r.current.x;var ie;const ue=(ie=t.swipeDirections)!=null?ie:$Me(F);!W&&(Math.abs(Q)>1||Math.abs(yr)>1)&&K(Math.abs(Q)>Math.abs(yr)?"x":"y");let je={x:0,y:0};const Ue=Xe=>1/(1.5+Math.abs(Xe)/20);if(W==="y"){if(ue.includes("top")||ue.includes("bottom"))if(ue.includes("top")&&yr<0||ue.includes("bottom")&&yr>0)je.y=yr;else{const Xe=yr*Ue(yr);je.y=Math.abs(Xe)<Math.abs(yr)?Xe:yr}}else if(W==="x"&&(ue.includes("left")||ue.includes("right")))if(ue.includes("left")&&Q<0||ue.includes("right")&&Q>0)je.x=Q;else{const Xe=Q*Ue(Q);je.x=Math.abs(Xe)<Math.abs(Q)?Xe:Q}(Math.abs(je.x)>0||Math.abs(je.y)>0)&&he(!0),(cr=gr.current)==null||cr.style.setProperty("--swipe-amount-x",`${je.x}px`),(Jt=gr.current)==null||Jt.style.setProperty("--swipe-amount-y",`${je.y}px`)}},Nt&&!f.jsx&&de!=="loading"?P.createElement("button",{"aria-label":L,"data-disabled":xt,"data-close-button":!0,onClick:xt||!Ee?()=>{}:()=>{$e(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Pl(U?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(ut=z?.close)!=null?ut:SMe):null,(de||f.icon||f.promise)&&f.icon!==null&&(z?.[de]!==null||f.icon)?P.createElement("div",{"data-icon":"",className:Pl(U?.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||We():null,f.type!=="loading"?rt:null):null,P.createElement("div",{"data-content":"",className:Pl(U?.content,f==null||(s=f.classNames)==null?void 0:s.content)},P.createElement("div",{"data-title":"",className:Pl(U?.title,f==null||(a=f.classNames)==null?void 0:a.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?P.createElement("div",{"data-description":"",className:Pl(I,Te,U?.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),P.isValidElement(f.cancel)?f.cancel:f.cancel&&$_(f.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||M,onClick:it=>{$_(f.cancel)&&Ee&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,it),$e())},className:Pl(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,P.isValidElement(f.action)?f.action:f.action&&$_(f.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||O,onClick:it=>{$_(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,it),!it.defaultPrevented&&$e())},className:Pl(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function rq(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function zMe(t,e){const r={};return[t,e].forEach((n,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",o=s?DMe:AMe;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=o:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}const BMe=P.forwardRef(function(e,r){const{id:n,invert:i,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:d,mobileOffset:f,theme:h="light",richColors:m,duration:y,style:x,visibleToasts:v=MMe,toastOptions:_,dir:S=rq(),gap:k=RMe,icons:E,containerAriaLabel:T="Notifications"}=e,[N,j]=P.useState([]),M=P.useMemo(()=>n?N.filter(Y=>Y.toasterId===n):N.filter(Y=>!Y.toasterId),[N,n]),O=P.useMemo(()=>Array.from(new Set([s].concat(M.filter(Y=>Y.position).map(Y=>Y.position)))),[M,s]),[R,I]=P.useState([]),[B,F]=P.useState(!1),[V,$]=P.useState(!1),[U,z]=P.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=P.useRef(null),W=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=P.useRef(null),q=P.useRef(!1),H=P.useCallback(Y=>{j(J=>{var re;return(re=J.find(me=>me.id===Y.id))!=null&&re.delete||na.dismiss(Y.id),J.filter(({id:me})=>me!==Y.id)})},[]);return P.useEffect(()=>na.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{j(J=>J.map(re=>re.id===Y.id?{...re,delete:!0}:re))});return}setTimeout(()=>{VE.flushSync(()=>{j(J=>{const re=J.findIndex(me=>me.id===Y.id);return re!==-1?[...J.slice(0,re),{...J[re],...Y},...J.slice(re+1)]:[Y,...J]})})})}),[N]),P.useEffect(()=>{if(h!=="system"){z(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:J})=>{z(J?"dark":"light")})}catch{Y.addListener(({matches:re})=>{try{z(re?"dark":"light")}catch(me){console.error(me)}})}},[h]),P.useEffect(()=>{N.length<=1&&F(!1)},[N]),P.useEffect(()=>{const Y=J=>{var re;if(a.every(ge=>J[ge]||J.code===ge)){var oe;F(!0),(oe=L.current)==null||oe.focus()}J.code==="Escape"&&(document.activeElement===L.current||(re=L.current)!=null&&re.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[a]),P.useEffect(()=>{if(L.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,q.current=!1)}},[L.current]),P.createElement("section",{ref:r,"aria-label":`${T} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((Y,J)=>{var re;const[me,oe]=Y.split("-");return M.length?P.createElement("ol",{key:Y,dir:S==="auto"?rq():S,tabIndex:-1,ref:L,className:u,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":me,"data-x-position":oe,style:{"--front-toast-height":`${((re=R[0])==null?void 0:re.height)||0}px`,"--width":`${OMe}px`,"--gap":`${k}px`,...x,...zMe(d,f)},onBlur:ge=>{q.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(q.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||q.current||(q.current=!0,K.current=ge.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{V||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},M.filter(ge=>!ge.position&&J===0||ge.position===Y).map((ge,le)=>{var Se,Ce;return P.createElement(FMe,{key:ge.id,icons:E,index:le,toast:ge,defaultRichColors:m,duration:(Se=_?.duration)!=null?Se:y,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:i,visibleToasts:v,closeButton:(Ce=_?.closeButton)!=null?Ce:c,interacting:V,position:Y,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:H,toasts:M.filter(he=>he.position==ge.position),heights:R.filter(he=>he.position==ge.position),setHeights:I,expandByDefault:o,gap:k,expanded:B,swipeDirections:e.swipeDirections})})):null}))}),VMe=({...t})=>l.jsx(BMe,{theme:"dark",className:"toaster group !p-0",toastOptions:{classNames:{toast:"justify-center text-center !p-3",title:"!font-normal"}},icons:{success:l.jsx(ei,{size:16}),error:l.jsx(pi,{size:16}),info:l.jsx(doe,{size:16}),warning:l.jsx(Wu,{size:16})},position:"top-center",richColors:!0,style:{"--border-radius":"18px","--normal-bg":"hsl(var(--input-bg))","--normal-text":"hsl(var(--primary-foreground))","--normal-border":"hsl(var(--border-color))","--width":"320px"},...t});function nq(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Nu(...t){return e=>{let r=!1;const n=t.map(i=>{const s=nq(i,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():nq(t[i],null)}}}}function Kt(...t){return b.useCallback(Nu(...t),t)}function kf(t){const e=UMe(t),r=b.forwardRef((n,i)=>{const{children:s,...a}=n,o=b.Children.toArray(s),c=o.find(WMe);if(c){const u=c.props.children,d=o.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...a,ref:i,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return l.jsx(e,{...a,ref:i,children:s})});return r.displayName=`${t}.Slot`,r}var Cw=kf("Slot");function UMe(t){const e=b.forwardRef((r,n)=>{const{children:i,...s}=r;if(b.isValidElement(i)){const a=qMe(i),o=HMe(s,i.props);return i.type!==b.Fragment&&(o.ref=n?Nu(n,a):a),b.cloneElement(i,o)}return b.Children.count(i)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var yoe=Symbol("radix.slottable");function GMe(t){const e=({children:r})=>l.jsx(l.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=yoe,e}function WMe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===yoe}function HMe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{const c=s(...o);return i(...o),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}
701:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function qMe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function voe(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=voe(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Tt(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=voe(t))&&(n&&(n+=" "),n+=e);return n}const iq=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,sq=Tt,Rf=(t,e)=>r=>{var n;if(e?.variants==null)return sq(t,r?.class,r?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(u=>{const d=r?.[u],f=s?.[u];if(d===null)return null;const h=iq(d)||iq(f);return i[u][h]}),o=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...m}=d;return Object.entries(m).every(y=>{let[x,v]=y;return Array.isArray(v)?v.includes({...s,...o}[x]):{...s,...o}[x]===v})?[...u,f,h]:u},[]);return sq(t,a,c,r?.class,r?.className)},YMe=()=>{};var aq={};/**
702 * @license
703 * Copyright 2017 Google LLC
704 *
705 * Licensed under the Apache License, Version 2.0 (the "License");
706 * you may not use this file except in compliance with the License.
707 * You may obtain a copy of the License at
708 *
709 *   http://www.apache.org/licenses/LICENSE-2.0
710 *
711 * Unless required by applicable law or agreed to in writing, software
712 * distributed under the License is distributed on an "AS IS" BASIS,
713 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
714 * See the License for the specific language governing permissions and
715 * limitations under the License.
716 */const xoe=function(t){const e=[];let r=0;for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);i<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=i&63|128):(i&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++n)&1023),e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128)}return e},KMe=function(t){const e=[];let r=0,n=0;for(;r<t.length;){const i=t[r++];if(i<128)e[n++]=String.fromCharCode(i);else if(i>191&&i<224){const s=t[r++];e[n++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[r++],a=t[r++],o=t[r++],c=((i&7)<<18|(s&63)<<12|(a&63)<<6|o&63)-65536;e[n++]=String.fromCharCode(55296+(c>>10)),e[n++]=String.fromCharCode(56320+(c&1023))}else{const s=t[r++],a=t[r++];e[n++]=String.fromCharCode((i&15)<<12|(s&63)<<6|a&63)}}return e.join("")},o3={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let i=0;i<t.length;i+=3){const s=t[i],a=i+1<t.length,o=a?t[i+1]:0,c=i+2<t.length,u=c?t[i+2]:0,d=s>>2,f=(s&3)<<4|o>>4;let h=(o&15)<<2|u>>6,m=u&63;c||(m=64,a||(h=64)),n.push(r[d],r[f],r[h],r[m])}return n.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(xoe(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):KMe(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const r=e?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let i=0;i<t.length;){const s=r[t.charAt(i++)],o=i<t.length?r[t.charAt(i)]:0;++i;const u=i<t.length?r[t.charAt(i)]:64;++i;const f=i<t.length?r[t.charAt(i)]:64;if(++i,s==null||o==null||u==null||f==null)throw new QMe;const h=s<<2|o>>4;if(n.push(h),u!==64){const m=o<<4&240|u>>2;if(n.push(m),f!==64){const y=u<<6&192|f;n.push(y)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};
716class QMe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const ZMe=function(t){const e=xoe(t);return o3.encodeByteArray(e,!0)},nT=function(t){return ZMe(t).replace(/\./g,"")},boe=function(t){try{return o3.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
717 * @license
718 * Copyright 2022 Google LLC
719 *
720 * Licensed under the Apache License, Version 2.0 (the "License");
721 * you may not use this file except in compliance with the License.
722 * You may obtain a copy of the License at
723 *
724 *   http://www.apache.org/licenses/LICENSE-2.0
725 *
726 * Unless required by applicable law or agreed to in writing, software
727 * distributed under the License is distributed on an "AS IS" BASIS,
728 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
729 * See the License for the specific language governing permissions and
730 * limitations under the License.
731 */function woe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
732 * @license
733 * Copyright 2022 Google LLC
734 *
735 * Licensed under the Apache License, Version 2.0 (the "License");
736 * you may not use this file except in compliance with the License.
737 * You may obtain a copy of the License at
738 *
739 *   http://www.apache.org/licenses/LICENSE-2.0
740 *
741 * Unless required by applicable law or agreed to in writing, software
742 * distributed under the License is distributed on an "AS IS" BASIS,
743 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
744 * See the License for the specific language governing permissions and
745 * limitations under the License.
746 */const XMe=()=>woe().__FIREBASE_DEFAULTS__,JMe=()=>{if(typeof process>"u"||typeof aq>"u")return;const t=aq.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},e2e=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&boe(t[1]);return e&&JSON.parse(e)},l3=()=>{try{return YMe()||XMe()||JMe()||e2e()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},_oe=t=>{var e,r;return(r=(e=l3())===null||e===void 0?void 0:e.emulatorHosts)===null||r===void 0?void 0:r[t]},t2e=t=>{const e=_oe(t);if(!e)return;const r=e.lastIndexOf(":");if(r<=0||r+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const n=parseInt(e.substring(r+1),10);return e[0]==="["?[e.substring(1,r-1),n]:[e.substring(0,r),n]},Soe=()=>{var t;return(t=l3())===null||t===void 0?void 0:t.config},koe=t=>{var e;return(e=l3())===null||e===void 0?void 0:e[`_${t}`]};/**
747 * @license
748 * Copyright 2017 Google LLC
749 *
750 * Licensed under the Apache License, Version 2.0 (the "License");
751 * you may not use this file except in compliance with the License.
752 * You may obtain a copy of the License at
753 *
754 *   http://www.apache.org/licenses/LICENSE-2.0
755 *
756 * Unless required by applicable law or agreed to in writing, software
757 * distributed under the License is distributed on an "AS IS" BASIS,
758 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
759 * See the License for the specific language governing permissions and
760 * limitations under the License.
761 */class rb{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}wrapCallback(e){return(r,n)=>{r?this.reject(r):this.resolve(n),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(r):e(r,n))}}}/**
762 * @license
763 * Copyright 2025 Google LLC
764 *
765 * Licensed under the Apache License, Version 2.0 (the "License");
766 * you may not use this file except in compliance with the License.
767 * You may obtain a copy of the License at
768 *
769 *   http://www.apache.org/licenses/LICENSE-2.0
770 *
771 * Unless required by applicable law or agreed to in writing, software
772 * distributed under the License is distributed on an "AS IS" BASIS,
773 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
774 * See the License for the specific language governing permissions and
775 * limitations under the License.
776 */function Uy(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Toe(t){return(await fetch(t,{credentials:"include"})).ok}/**
777 * @license
778 * Copyright 2021 Google LLC
779 *
780 * Licensed under the Apache License, Version 2.0 (the "License");
781 * you may not use this file except in compliance with the License.
782 * You may obtain a copy of the License at
783 *
784 *   http://www.apache.org/licenses/LICENSE-2.0
785 *
786 * Unless required by applicable law or agreed to in writing, software
787 * distributed under the License is distributed on an "AS IS" BASIS,
788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
789 * See the License for the specific language governing permissions and
790 * limitations under the License.
791 */function r2e(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r={alg:"none",type:"JWT"},n=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[nT(JSON.stringify(r)),nT(JSON.stringify(a)),""].join(".")}const mx={};function n2e(){const t={prod:[],emulator:[]};for(const e of Object.keys(mx))mx[e]?t.emulator.push(e):t.prod.push(e);return t}function i2e(t){let e=document.getElementById(t),r=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),r=!0),{created:r,element:e}}let oq=!1;function Coe(t,e){if(typeof window>"u"||typeof document>"u"||!Uy(window.location.host)||mx[t]===e||mx[t]||oq)return;mx[t]=e;function r(h){return`__firebase__banner__${h}`}const n="__firebase__banner",s=n2e().prod.length>0;function a(){const h=document.getElementById(n);h&&h.remove()}function o(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function c(h,m){h.setAttribute("width","24"),h.setAttribute("id",m),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" &times;",h.onclick=()=>{oq=!0,a()},h}function d(h,m){h.setAttribute("id",m),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=i2e(n),m=r("text"),y=document.getElementById(m)||document.createElement("span"),x=r("learnmore"),v=document.getElementById(x)||document.createElement("a"),_=r("preprendIcon"),S=document.getElementById(_)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const k=h.element;o(k),d(v,x);const E=u();c(S,_),k.append(S,y,v,E),document.body.appendChild(k)}s?(y.innerText="Preview backend disconnected.",S.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
792<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
793</g>
794<defs>
795<clipPath id="clip0_6013_33858">
796<rect width="24" height="24" fill="white"/>
797</clipPath>
798</defs>`):(S.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
799<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
800</g>
801<defs>
802<clipPath id="clip0_6083_34804">
803<rect width="24" height="24" fill="white"/>
804</clipPath>
805</defs>`,y.innerText="Preview backend running in this workspace."),y.setAttribute("id",m)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
806 * @license
807 * Copyright 2017 Google LLC
808 *
809 * Licensed under the Apache License, Version 2.0 (the "License");
810 * you may not use this file except in compliance with the License.
811 * You may obtain a copy of the License at
812 *
813 *   http://www.apache.org/licenses/LICENSE-2.0
814 *
815 * Unless required by applicable law or agreed to in writing, software
816 * distributed under the License is distributed on an "AS IS" BASIS,
817 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
818 * See the License for the specific language governing permissions and
819 * limitations under the License.
820 */function Bs(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function s2e(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Bs())}function a2e(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Eoe(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function o2e(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function l2e(){const t=Bs();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function UE(){try{return typeof indexedDB=="object"}catch{return!1}}function joe(){return new Promise((t,e)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(n);i.onsuccess=()=>{i.result.close(),r||self.indexedDB.deleteDatabase(n),t(!0)},i.onupgradeneeded=()=>{r=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(r){e(r)}})}function c2e(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
821 * @license
822 * Copyright 2017 Google LLC
823 *
824 * Licensed under the Apache License, Version 2.0 (the "License");
825 * you may not use this file except in compliance with the License.
826 * You may obtain a copy of the License at
827 *
828 *   http://www.apache.org/licenses/LICENSE-2.0
829 *
830 * Unless required by applicable law or agreed to in writing, software
831 * distributed under the License is distributed on an "AS IS" BASIS,
832 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
833 * See the License for the specific language governing permissions and
834 * limitations under the License.
835 */const u2e="FirebaseError";class Ha extends Error{constructor(e,r,n){super(r),this.code=e,this.customData=n,this.name=u2e,Object.setPrototypeOf(this,Ha.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,If.prototype.create)}}class If{constructor(e,r,n){this.service=e,this.serviceName=r,this.errors=n}create(e,...r){const n=r[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?d2e(s,n):"Error",o=`${this.serviceName}: ${a} (${i}).`;return new Ha(i,o,n)}}function d2e(t,e){return t.replace(f2e,(r,n)=>{const i=e[n];return i!=null?String(i):`<${n}?>`})}const f2e=/\{\$([^}]+)}/g;function h2e(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function zg(t,e){if(t===e)return!0;const r=Object.keys(t),n=Object.keys(e);for(const i of r){if(!n.includes(i))return!1;const s=t[i],a=e[i];if(lq(s)&&lq(a)){if(!zg(s,a))return!1}else if(s!==a)return!1}for(const i of n)if(!r.includes(i))return!1;return!0}function lq(t){return t!==null&&typeof t=="object"}/**
836 * @license
837 * Copyright 2017 Google LLC
838 *
839 * Licensed under the Apache License, Version 2.0 (the "License");
840 * you may not use this file except in compliance with the License.
841 * You may obtain a copy of the License at
842 *
843 *   http://www.apache.org/licenses/LICENSE-2.0
844 *
845 * Unless required by applicable law or agreed to in writing, software
846 * distributed under the License is distributed on an "AS IS" BASIS,
847 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
848 * See the License for the specific language governing permissions and
849 * limitations under the License.
850 */function Ew(t){const e=[];for(const[r,n]of Object.entries(t))Array.isArray(n)?n.forEach(i=>{e.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return e.length?"&"+e.join("&"):""}function Qv(t){const e={};return t.replace(/^\?/,"").split("&").forEach(n=>{if(n){const[i,s]=n.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Zv(t){const e=t.indexOf("?");if(!e)return"";const r=t.indexOf("#",e);return t.substring(e,r>0?r:void 0)}function p2e(t,e){const r=new m2e(t,e);return r.subscribe.bind(r)}class m2e{constructor(e,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
850ise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{e(this)}).catch(n=>{this.error(n)})}next(e){this.forEachObserver(r=>{r.next(e)})}error(e){this.forEachObserver(r=>{r.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,r,n){let i;if(e===void 0&&r===void 0&&n===void 0)throw new Error("Missing Observer.");g2e(e,["next","error","complete"])?i=e:i={next:e,error:r,complete:n},i.next===void 0&&(i.next=M2),i.error===void 0&&(i.error=M2),i.complete===void 0&&(i.complete=M2);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let r=0;r<this.observers.length;r++)this.sendOne(r,e)}sendOne(e,r){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{r(this.observers[e])}catch(n){typeof console<"u"&&console.error&&console.error(n)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function g2e(t,e){if(typeof t!="object"||t===null)return!1;for(const r of e)if(r in t&&typeof t[r]=="function")return!0;return!1}function M2(){}/**
851 * @license
852 * Copyright 2019 Google LLC
853 *
854 * Licensed under the Apache License, Version 2.0 (the "License");
855 * you may not use this file except in compliance with the License.
856 * You may obtain a copy of the License at
857 *
858 *   http://www.apache.org/licenses/LICENSE-2.0
859 *
860 * Unless required by applicable law or agreed to in writing, software
861 * distributed under the License is distributed on an "AS IS" BASIS,
862 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
863 * See the License for the specific language governing permissions and
864 * limitations under the License.
865 */const y2e=1e3,v2e=2,x2e=14400*1e3,b2e=.5;function M$(t,e=y2e,r=v2e){const n=e*Math.pow(r,t),i=Math.round(b2e*n*(Math.random()-.5)*2);return Math.min(x2e,n+i)}/**
866 * @license
867 * Copyright 2021 Google LLC
868 *
869 * Licensed under the Apache License, Version 2.0 (the "License");
870 * you may not use this file except in compliance with the License.
871 * You may obtain a copy of the License at
872 *
873 *   http://www.apache.org/licenses/LICENSE-2.0
874 *
875 * Unless required by applicable law or agreed to in writing, software
876 * distributed under the License is distributed on an "AS IS" BASIS,
877 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
878 * See the License for the specific language governing permissions and
879 * limitations under the License.
880 */function zn(t){return t&&t._delegate?t._delegate:t}class Ba{constructor(e,r,n){this.name=e,this.instanceFactory=r,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
881 * @license
882 * Copyright 2019 Google LLC
883 *
884 * Licensed under the Apache License, Version 2.0 (the "License");
885 * you may not use this file except in compliance with the License.
886 * You may obtain a copy of the License at
887 *
888 *   http://www.apache.org/licenses/LICENSE-2.0
889 *
890 * Unless required by applicable law or agreed to in writing, software
891 * distributed under the License is distributed on an "AS IS" BASIS,
892 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
893 * See the License for the specific language governing permissions and
894 * limitations under the License.
895 */const xh="[DEFAULT]";/**
896 * @license
897 * Copyright 2019 Google LLC
898 *
899 * Licensed under the Apache License, Version 2.0 (the "License");
900 * you may not use this file except in compliance with the License.
901 * You may obtain a copy of the License at
902 *
903 *   http://www.apache.org/licenses/LICENSE-2.0
904 *
905 * Unless required by applicable law or agreed to in writing, softw
905are
906 * distributed under the License is distributed on an "AS IS" BASIS,
907 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
908 * See the License for the specific language governing permissions and
909 * limitations under the License.
910 */let w2e=class{constructor(e,r){this.name=e,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const r=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(r)){const n=new rb;if(this.instancesDeferred.set(r,n),this.isInitialized(r)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:r});i&&n.resolve(i)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(e){var r;const n=this.normalizeInstanceIdentifier(e?.identifier),i=(r=e?.optional)!==null&&r!==void 0?r:!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(S2e(e))try{this.getOrInitializeService({instanceIdentifier:xh})}catch{}for(const[r,n]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(r);try{const s=this.getOrInitializeService({instanceIdentifier:i});n.resolve(s)}catch{}}}}clearInstance(e=xh){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...e.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=xh){return this.instances.has(e)}getOptions(e=xh){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:r={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:r});for(const[s,a]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(s);n===o&&a.resolve(i)}return i}onInit(e,r){var n;const i=this.normalizeInstanceIdentifier(r),s=(n=this.onInitCallbacks.get(i))!==null&&n!==void 0?n:new Set;s.add(e),this.onInitCallbacks.set(i,s);const a=this.instances.get(i);return a&&e(a,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,r){const n=this.onInitCallbacks.get(r);if(n)for(const i of n)try{i(e,r)}catch{}}getOrInitializeService({instanceIdentifier:e,options:r={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:_2e(e),options:r}),this.instances.set(e,n),this.instancesOptions.set(e,r),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=xh){return this.component?this.component.multipleInstances?e:xh:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function _2e(t){return t===xh?void 0:t}function S2e(t){return t.instantiationMode==="EAGER"}/**
911 * @license
912 * Copyright 2019 Google LLC
913 *
914 * Licensed under the Apache License, Version 2.0 (the "License");
915 * you may not use this file except in compliance with the License.
916 * You may obtain a copy of the License at
917 *
918 *   http://www.apache.org/licenses/LICENSE-2.0
919 *
920 * Unless required by applicable law or agreed to in writing, software
921 * distributed under the License is distributed on an "AS IS" BASIS,
922 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
923 * See the License for the specific language governing permissions and
924 * limitations under the License.
925 */class k2e{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const r=this.getProvider(e.name);if(r.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);r.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const r=new w2e(e,this);return this.providers.set(e,r),r}getProviders(){return Array.from(this.providers.values())}}/**
926 * @license
927 * Copyright 2017 Google LLC
928 *
929 * Licensed under the Apache License, Version 2.0 (the "License");
930 * you may not use this file except in compliance with the License.
931 * You may obtain a copy of the License at
932 *
933 *   http://www.apache.org/licenses/LICENSE-2.0
934 *
935 * Unless required by applicable law or agreed to in writing, software
936 * distributed under the License is distributed on an "AS IS" BASIS,
937 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
938 * See the License for the specific language governing permissions and
939 * limitations under the License.
940 */var Gr;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Gr||(Gr={}));const T2e={debug:Gr.DEBUG,verbose:Gr.VERBOSE,info:Gr.INFO,warn:Gr.WARN,error:Gr.ERROR,silent:Gr.SILENT},C2e=Gr.INFO,E2e={[Gr.DEBUG]:"log",[Gr.VERBOSE]:"log",[Gr.INFO]:"info",[Gr.WARN]:"warn",[Gr.ERROR]:"error"},j2e=(t,e,...r)=>{if(e<t.logLevel)return;const n=new Date().toISOString(),i=E2e[e];if(i)console[i](`[${n}]  ${t.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class GE{constructor(e){this.name=e,this._logLevel=C2e,this._logHandler=j2e,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Gr))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?T2e[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Gr.DEBUG,...e),this._logHandler(this,Gr.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Gr.VERBOSE,...e),this._logHandler(this,Gr.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Gr.INFO,...e),this._logHandler(this,Gr.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Gr.WARN,...e),this._logHandler(this,Gr.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Gr.ERROR,...e),this._logHandler(this,Gr.ERROR,...e)}}const N2e=(t,e)=>e.some(r=>t instanceof r);let cq,uq;function P2e(){return cq||(cq=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function M2e(){return uq||(uq=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Noe=new WeakMap,A$=new WeakMap,Poe=new WeakMap,A2=new WeakMap,c3=new WeakMap;function A2e(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",a)},s=()=>{r(of(t.result)),i()},a=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",a)});return e.then(r=>{r instanceof IDBCursor&&Noe.set(r,t)}).catch(()=>{}),c3.set(e,t),e}function D2e(t){if(A$.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",a),t.removeEventListener("abort",a)},s=()=>{r(),i()},a=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",a),t.addEventListener("abort",a)});A$.set(t,e)}let D$={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return A$.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Poe.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return of(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function O2e(t){D$=t(D$)}function R2e(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(D2(this),e,...r);return Poe.set(n,e.sort?e.sort():[e]),of(n)}:M2e().includes(t)?function(...e){return t.apply(D2(this),e),of(Noe.get(this))}:function(...e){return of(t.apply(D2(this),e))}}function I2e(t){return typeof t=="function"?R2e(t):(t instanceof IDBTransaction&&D2e(t),N2e(t,P2e())?new Proxy(t,D$):t)}function of(t){if(t instanceof IDBRequest)return A2e(t);if(A2.has(t))return A2.get(t);const e=I2e(t);return e!==t&&(A2.set(t,e),c3.set(e,t)),e}const D2=t=>c3.get(t);function Moe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const a=indexedDB.open(t,e),o=of(a);return n&&a.addEventListener("upgradeneeded",c=>{n(of(a.result),c.oldVersion,c.newVersion,of(a.transaction),c)}),r&&a.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),o.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}const L2e=["get","getKey","getAll","getAllKeys","count"],$2e=["put","add","delete","clear"],O2=new Map;function dq(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(O2.get(e))return O2.get(e);
940const r=e.replace(/FromIndex$/,""),n=e!==r,i=$2e.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||L2e.includes(r)))return;const s=async function(a,...o){const c=this.transaction(a,i?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(o.shift())),(await Promise.all([u[r](...o),i&&c.done]))[0]};return O2.set(e,s),s}O2e(t=>({...t,get:(e,r,n)=>dq(e,r)||t.get(e,r,n),has:(e,r)=>!!dq(e,r)||t.has(e,r)}));/**
941 * @license
942 * Copyright 2019 Google LLC
943 *
944 * Licensed under the Apache License, Version 2.0 (the "License");
945 * you may not use this file except in compliance with the License.
946 * You may obtain a copy of the License at
947 *
948 *   http://www.apache.org/licenses/LICENSE-2.0
949 *
950 * Unless required by applicable law or agreed to in writing, software
951 * distributed under the License is distributed on an "AS IS" BASIS,
952 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
953 * See the License for the specific language governing permissions and
954 * limitations under the License.
955 */class F2e{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(z2e(r)){const n=r.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(r=>r).join(" ")}}function z2e(t){const e=t.getComponent();return e?.type==="VERSION"}const O$="@firebase/app",fq="0.13.2";/**
956 * @license
957 * Copyright 2019 Google LLC
958 *
959 * Licensed under the Apache License, Version 2.0 (the "License");
960 * you may not use this file except in compliance with the License.
961 * You may obtain a copy of the License at
962 *
963 *   http://www.apache.org/licenses/LICENSE-2.0
964 *
965 * Unless required by applicable law or agreed to in writing, software
966 * distributed under the License is distributed on an "AS IS" BASIS,
967 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
968 * See the License for the specific language governing permissions and
969 * limitations under the License.
970 */const Pu=new GE("@firebase/app"),B2e="@firebase/app-compat",V2e="@firebase/analytics-compat",U2e="@firebase/analytics",G2e="@firebase/app-check-compat",W2e="@firebase/app-check",H2e="@firebase/auth",q2e="@firebase/auth-compat",Y2e="@firebase/database",K2e="@firebase/data-connect",Q2e="@firebase/database-compat",Z2e="@firebase/functions",X2e="@firebase/functions-compat",J2e="@firebase/installations",eAe="@firebase/installations-compat",tAe="@firebase/messaging",rAe="@firebase/messaging-compat",nAe="@firebase/performance",iAe="@firebase/performance-compat",sAe="@firebase/remote-config",aAe="@firebase/remote-config-compat",oAe="@firebase/storage",lAe="@firebase/storage-compat",cAe="@firebase/firestore",uAe="@firebase/ai",dAe="@firebase/firestore-compat",fAe="firebase",hAe="11.10.0";/**
971 * @license
972 * Copyright 2019 Google LLC
973 *
974 * Licensed under the Apache License, Version 2.0 (the "License");
975 * you may not use this file except in compliance with the License.
976 * You may obtain a copy of the License at
977 *
978 *   http://www.apache.org/licenses/LICENSE-2.0
979 *
980 * Unless required by applicable law or agreed to in writing, software
981 * distributed under the License is distributed on an "AS IS" BASIS,
982 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
983 * See the License for the specific language governing permissions and
984 * limitations under the License.
985 */const R$="[DEFAULT]",pAe={[O$]:"fire-core",[B2e]:"fire-core-compat",[U2e]:"fire-analytics",[V2e]:"fire-analytics-compat",[W2e]:"fire-app-check",[G2e]:"fire-app-check-compat",[H2e]:"fire-auth",[q2e]:"fire-auth-compat",[Y2e]:"fire-rtdb",[K2e]:"fire-data-connect",[Q2e]:"fire-rtdb-compat",[Z2e]:"fire-fn",[X2e]:"fire-fn-compat",[J2e]:"fire-iid",[eAe]:"fire-iid-compat",[tAe]:"fire-fcm",[rAe]:"fire-fcm-compat",[nAe]:"fire-perf",[iAe]:"fire-perf-compat",[sAe]:"fire-rc",[aAe]:"fire-rc-compat",[oAe]:"fire-gcs",[lAe]:"fire-gcs-compat",[cAe]:"fire-fst",[dAe]:"fire-fst-compat",[uAe]:"fire-vertex","fire-js":"fire-js",[fAe]:"fire-js-all"};/**
986 * @license
987 * Copyright 2019 Google LLC
988 *
989 * Licensed under the Apache License, Version 2.0 (the "License");
990 * you may not use this file except in compliance with the License.
991 * You may obtain a copy of the License at
992 *
993 *   http://www.apache.org/licenses/LICENSE-2.0
994 *
995 * Unless required by applicable law or agreed to in writing, software
996 * distributed under the License is distributed on an "AS IS" BASIS,
997 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
998 * See the License for the specific language governing permissions and
999 * limitations under the License.
1000 */const nb=new Map,mAe=new Map,I$=new Map;function hq(t,e){try{t.container.addComponent(e)}catch(r){Pu.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,r)}}function Po(t){const e=t.name;if(I$.has(e))return Pu.debug(`There were multiple attempts to register component ${e}.`),!1;I$.set(e,t);for(const r of nb.values())hq(r,t);for(const r of mAe.values())hq(r,t);return!0}function Gp(t,e){const r=t.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),t.container.getProvider(e)}function Ma(t){return t==null?!1:t.settings!==void 0}/**
1001 * @license
1002 * Copyright 2019 Google LLC
1003 *
1004 * Licensed under the Apache License, Version 2.0 (the "License");
1005 * you may not use this file except in compliance with the License.
1006 * You may obtain a copy of the License at
1007 *
1008 *   http://www.apache.org/licenses/LICENSE-2.0
1009 *
1010 * Unless required by applicable law or agreed to in writing, software
1011 * distributed under the License is distributed on an "AS IS" BASIS,
1012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1013 * See the License for the specific language governing permissions and
1014 * limitations under the License.
1015 */const gAe={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1015d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},lf=new If("app","Firebase",gAe);/**
1016 * @license
1017 * Copyright 2019 Google LLC
1018 *
1019 * Licensed under the Apache License, Version 2.0 (the "License");
1020 * you may not use this file except in compliance with the License.
1021 * You may obtain a copy of the License at
1022 *
1023 *   http://www.apache.org/licenses/LICENSE-2.0
1024 *
1025 * Unless required by applicable law or agreed to in writing, software
1026 * distributed under the License is distributed on an "AS IS" BASIS,
1027 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1028 * See the License for the specific language governing permissions and
1029 * limitations under the License.
1030 */class yAe{constructor(e,r,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},r),this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Ba("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw lf.create("app-deleted",{appName:this._name})}}/**
1031 * @license
1032 * Copyright 2019 Google LLC
1033 *
1034 * Licensed under the Apache License, Version 2.0 (the "License");
1035 * you may not use this file except in compliance with the License.
1036 * You may obtain a copy of the License at
1037 *
1038 *   http://www.apache.org/licenses/LICENSE-2.0
1039 *
1040 * Unless required by applicable law or agreed to in writing, software
1041 * distributed under the License is distributed on an "AS IS" BASIS,
1042 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1043 * See the License for the specific language governing permissions and
1044 * limitations under the License.
1045 */const Gy=hAe;function Aoe(t,e={}){let r=t;typeof e!="object"&&(e={name:e});const n=Object.assign({name:R$,automaticDataCollectionEnabled:!0},e),i=n.name;if(typeof i!="string"||!i)throw lf.create("bad-app-name",{appName:String(i)});if(r||(r=Soe()),!r)throw lf.create("no-options");const s=nb.get(i);if(s){if(zg(r,s.options)&&zg(n,s.config))return s;throw lf.create("duplicate-app",{appName:i})}const a=new k2e(i);for(const c of I$.values())a.addComponent(c);const o=new yAe(r,n,a);return nb.set(i,o),o}function WE(t=R$){const e=nb.get(t);if(!e&&t===R$&&Soe())return Aoe();if(!e)throw lf.create("no-app",{appName:t});return e}function vAe(){return Array.from(nb.values())}function Ia(t,e,r){var n;let i=(n=pAe[t])!==null&&n!==void 0?n:t;r&&(i+=`-${r}`);const s=i.match(/\s|\//),a=e.match(/\s|\//);if(s||a){const o=[`Unable to register library "${i}" with version "${e}":`];s&&o.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&a&&o.push("and"),a&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Pu.warn(o.join(" "));return}Po(new Ba(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
1046 * @license
1047 * Copyright 2021 Google LLC
1048 *
1049 * Licensed under the Apache License, Version 2.0 (the "License");
1050 * you may not use this file except in compliance with the License.
1051 * You may obtain a copy of the License at
1052 *
1053 *   http://www.apache.org/licenses/LICENSE-2.0
1054 *
1055 * Unless required by applicable law or agreed to in writing, softw
1055are
1056 * distributed under the License is distributed on an "AS IS" BASIS,
1057 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1058 * See the License for the specific language governing permissions and
1059 * limitations under the License.
1060 */const xAe="firebase-heartbeat-database",bAe=1,ib="firebase-heartbeat-store";let R2=null;function Doe(){return R2||(R2=Moe(xAe,bAe,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(ib)}catch(r){console.warn(r)}}}}).catch(t=>{throw lf.create("idb-open",{originalErrorMessage:t.message})})),R2}async function wAe(t){try{const r=(await Doe()).transaction(ib),n=await r.objectStore(ib).get(Ooe(t));return await r.done,n}catch(e){if(e instanceof Ha)Pu.warn(e.message);else{const r=lf.create("idb-get",{originalErrorMessage:e?.message});Pu.warn(r.message)}}}async function pq(t,e){try{const n=(await Doe()).transaction(ib,"readwrite");await n.objectStore(ib).put(e,Ooe(t)),await n.done}catch(r){if(r instanceof Ha)Pu.warn(r.message);else{const n=lf.create("idb-set",{originalErrorMessage:r?.message});Pu.warn(n.message)}}}function Ooe(t){return`${t.name}!${t.options.appId}`}/**
1061 * @license
1062 * Copyright 2021 Google LLC
1063 *
1064 * Licensed under the Apache License, Version 2.0 (the "License");
1065 * you may not use this file except in compliance with the License.
1066 * You may obtain a copy of the License at
1067 *
1068 *   http://www.apache.org/licenses/LICENSE-2.0
1069 *
1070 * Unless required by applicable law or agreed to in writing, software
1071 * distributed under the License is distributed on an "AS IS" BASIS,
1072 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1073 * See the License for the specific language governing permissions and
1074 * limitations under the License.
1075 */const _Ae=1024,SAe=30;class kAe{constructor(e){this.container=e,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new CAe(r),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){var e,r;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=mq();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(a=>a.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>SAe){const a=EAe(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(a,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(n){Pu.warn(n)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const r=mq(),{heartbeatsToSend:n,unsentEntries:i}=TAe(this._heartbeatsCache.heartbeats),s=nT(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=r,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(r){return Pu.warn(r),""}}}function mq(){return new Date().toISOString().substring(0,10)}function TAe(t,e=_Ae){const r=[];let n=t.slice();for(const i of t){const s=r.find(a=>a.agent===i.agent);if(s){if(s.dates.push(i.date),gq(r)>e){s.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),gq(r)>e){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}class CAe{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return UE()?joe().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await wAe(this.app);return r?.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var r;if(await this._canUseIndexedDBPromise){const i=await this.read();return pq(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var r;if(await this._canUseIndexedDBPromise){const i=await this.read();return pq(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function gq(t){return nT(JSON.stringify({version:2,heartbeats:t})).length}function EAe(t){if(t.length===0)return-1;let e=0,r=t[0].date;for(let n=1;n<t.length;n++)t[n].date<r&&(r=t[n].date,e=n);return e}/**
1076 * @license
1077 * Copyright 2019 Google LLC
1078 *
1079 * Licensed under the Apache License, Version 2.0 (the "License");
vendor: 8,848 bytes, lines 1080-1105
1080 * you may not use this file except in compliance with the License.
1081 * You may obtain a copy of the License at
1082 *
1083 *   http://www.apache.org/licenses/LICENSE-2.0
1084 *
1085 * Unless required by applicable law or agreed to in writing, software
1086 * distributed under the License is distributed on an "AS IS" BASIS,
1087 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1088 * See the License for the specific language governing permissions and
1089 * limitations under the License.
1090 */function jAe(t){Po(new Ba("platform-logger",e=>new F2e(e),"PRIVATE")),Po(new Ba("heartbeat",e=>new kAe(e),"PRIVATE")),Ia(O$,fq,t),Ia(O$,fq,"esm2017"),Ia("fire-js","")}jAe("");var NAe="firebase",PAe="11.10.0";/**
1091 * @license
1092 * Copyright 2020 Google LLC
1093 *
1094 * Licensed under the Apache License, Version 2.0 (the "License");
1095 * you may not use this file except in compliance with the License.
1096 * You may obtain a copy of the License at
1097 *
1098 *   http://www.apache.org/licenses/LICENSE-2.0
1099 *
1100 * Unless required by applicable law or agreed to in writing, software
1101 * distributed under the License is distributed on an "AS IS" BASIS,
1102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1103 * See the License for the specific language governing permissions and
1104 * limitations under the License.
1105 */Ia(NAe,PAe,"app");const u3="-",MAe=t=>{const e=DAe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:a=>{const o=a.split(u3);return o[0]===""&&o.length!==1&&o.shift(),Roe(o,e)||AAe(a)},getConflictingClassGroupIds:(a,o)=>{const c=r[a]||[];return o&&n[a]?[...c,...n[a]]:c}}},Roe=(t,e)=>{if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?Roe(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(u3);return e.validators.find(({validator:a})=>a(s))?.classGroupId},yq=/^\[(.+)\]$/,AAe=t=>{if(yq.test(t)){const e=yq.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},DAe=t=>{const{theme:e,classGroups:r}=t,n={nextPart:new Map,validators:[]};for(const i in r)L$(r[i],n,i,e);return n},L$=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:vq(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(OAe(i)){L$(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{L$(a,vq(e,s),r,n)})})},vq=(t,e)=>{let r=t;return e.split(u3).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},OAe=t=>t.isThemeGetter,RAe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(s,a)=>{r.set(s,a),e++,e>t&&(e=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return i(s,a),a},set(s,a){r.has(s)?r.set(s,a):i(s,a)}}},$$="!",F$=":",IAe=F$.length,LAe=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=i=>{const s=[];let a=0,o=0,c=0,u;for(let y=0;y<i.length;y++){let x=i[y];if(a===0&&o===0){if(x===F$){s.push(i.slice(c,y)),c=y+IAe;continue}if(x==="/"){u=y;continue}}x==="["?a++:x==="]"?a--:x==="("?o++:x===")"&&o--}const d=s.length===0?i:i.substring(c),f=$Ae(d),h=f!==d,m=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:m}};if(e){const i=e+F$,s=n;n=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const i=n;n=s=>r({className:s,parseClassName:i})}return n},$Ae=t=>t.endsWith($$)?t.substring(0,t.length-1):t.startsWith($$)?t.substring(1):t,FAe=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const i=[];let s=[];return n.forEach(a=>{a[0]==="["||e[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},zAe=t=>({cache:RAe(t.cacheSize),parseClassName:LAe(t),sortModifiers:FAe(t),...MAe(t)}),BAe=/\s+/,VAe=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],o=t.trim().split(BAe);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:x}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!x,_=n(v?y.substring(0,x):y);if(!_){if(!v){c=d+(c.length>0?" "+c:c);continue}if(_=n(y),!_){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=s(h).join(":"),k=m?S+$$:S,E=k+_;if(a.includes(E))continue;a.push(E);const T=i(_,v);for(let N=0;N<T.length;++N){const j=T[N];a.push(k+j)}c=d+(c.length>0?" "+c:c)}return c};function UAe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Ioe(e))&&(n&&(n+=" "),n+=r);return n}const Ioe=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Ioe(t[n]))&&(r&&(r+=" "),r+=e);return r};function GAe(t,...e){let r,n,i,s=a;function a(c){const u=e.reduce((d,f)=>f(d),t());return r=zAe(u),n=r.cache.get,i=r.cache.set,s=o,o(c)}function o(c){const u=n(c);if(u)return u;const d=VAe(c,r);return i(c,d),d}return function(){return s(UAe.apply(null,arguments))}}const vi=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},Loe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$oe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WAe=/^\d+\/\d+$/,HAe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qAe=/\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$/,YAe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KAe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QAe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pm=t=>WAe.test(t),ir=t=>!!t&&!Number.isNaN(Number(t)),_d=t=>!!t&&Number.isInteger(Number(t)),I2=t=>t.endsWith("%")&&ir(t.slice(0,-1)),Fc=t=>HAe.test(t),ZAe=()=>!0,XAe=t=>qAe.test(t)&&!YAe.test(t),Foe=()=>!1,JAe=t=>KAe.test(t),eDe=t=>QAe.test(t),tDe=t=>!ft(t)&&!ht(t),rDe=t=>Wy(t,Voe,Foe),ft=t=>Loe.test(t),fh=t=>Wy(t,Uoe,XAe),L2=t=>Wy(t,oDe,ir),xq=t=>Wy(t,zoe,Foe),nDe=t=>Wy(t,Boe,eDe),F_=t=>Wy(t,Goe,JAe),ht=t=>$oe.test(t),cv=t=>Hy(t,Uoe),iDe=t=>Hy(t,lDe),bq=t=>Hy(t,zoe),sDe=t=>Hy(t,Voe),aDe=t=>Hy(t,Boe),z_=t=>Hy(t,Goe,!0),Wy=(t,e,r)=>{const n=Loe.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Hy=(t,e,r=!1)=>{const n=$oe.exec(t);return n?n[1]?e(n[1]):r:!1},zoe=t=>t==="position"||t==="percentage",Boe=t=>t==="image"||t==="url",Voe=t=>t==="length"||t==="size"||t==="bg-size",Uoe=t=>t==="length",oDe=t=>t==="number",lDe=t=>t==="family-name",Goe=t=>t==="shadow",cDe=()=>{const t=vi("color"),e=vi("font"),r=vi("text"),n=vi("font-weight"),i=vi("tracking"),s=vi("leading"),a=vi("breakpoint"),o=vi("container"),c=vi("spacing"),u=vi("radius"),d=vi("shadow"),f=vi("inset-shadow"),h=vi("text-shadow"),m=vi("drop-shadow"),y=vi("blur"),x=vi("perspective"),v=vi("aspect"),_=vi("ease"),S=vi("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),ht,ft],N=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],M=()=>[ht,ft,c],O=()=>[Pm,"full","auto",...M()],R=()=>[_d,"none","subgrid",ht,ft],I=()=>["auto",{span:["full",_d,ht,ft]},_d,ht,ft],B=()=>[_d,"auto",ht,ft],F=()=>["auto","min","max","fr",ht,ft],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...M()],z=()=>[Pm,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],L=()=>[t,ht,ft],W=()=>[...E(),bq,xq,{position:[ht,ft]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",sDe,rDe,{size:[ht,ft]}],H=()=>[I2,cv,fh],Y=()=>["","none","full",u,ht,ft],J=()=>["",ir,cv,fh],re=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[ir,I2,bq,xq],ge=()=>["","none",y,ht,ft],le=()=>["none",ir,ht,ft],Se=()=>["none",ir,ht,ft],Ce=()=>[ir,ht,ft],he=()=>[Pm,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fc],breakpoint:[Fc],color:[ZAe],container:[Fc],"drop-shadow":[Fc],ease:["in","out","in-out"],font:[tDe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fc],shadow:[Fc],spacing:["px",ir],text:[Fc],"text-shadow":[Fc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pm,ft,ht,v]}
vendor: 4,429 bytes, line 1105
1105],container:["container"],columns:[{columns:[ir,ft,ht,o]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:T()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[_d,"auto",ht,ft]}],basis:[{basis:[Pm,"full","auto",o,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ir,Pm,"auto","initial","none",ft]}],grow:[{grow:["",ir,ht,ft]}],shrink:[{shrink:["",ir,ht,ft]}],order:[{order:[_d,"first","last","none",ht,ft]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[o,"screen",...z()]}],"min-w":[{"min-w":[o,"screen","none",...z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,cv,fh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ht,L2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",I2,ft]}],"font-family":[{font:[iDe,ft,e]}],"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:[i,ht,ft]}],"line-clamp":[{"line-clamp":[ir,"none",ht,L2]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",ht,ft]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ht,ft]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"w
1105avy"]}],"text-decoration-thickness":[{decoration:[ir,"from-font","auto",ht,fh]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ir,"auto",ht,ft]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht,ft]}],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",ht,ft]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_d,ht,ft],radial:["",ht,ft],conic:[_d,ht,ft]},aDe,nDe]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"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-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:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ir,ht,ft]}],"outline-w":[{outline:["",ir,cv,fh]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,z_,F_]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,z_,F_]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ir,fh]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,z_,F_]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ir,ht,ft]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[ir]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ht,ft]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[ir]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ht,ft]}],filter:[{filter:["","none",ht,ft]}],blur:[{blur:ge()}],brightness:[{brightness:[ir,ht,ft]}
vendor: 1,348 bytes, line 1105
1105],contrast:[{contrast:[ir,ht,ft]}],"drop-shadow":[{"drop-shadow":["","none",m,z_,F_]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ir,ht,ft]}],"hue-rotate":[{"hue-rotate":[ir,ht,ft]}],invert:[{invert:["",ir,ht,ft]}],saturate:[{saturate:[ir,ht,ft]}],sepia:[{sepia:["",ir,ht,ft]}],"backdrop-filter":[{"backdrop-filter":["","none",ht,ft]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[ir,ht,ft]}],"backdrop-contrast":[{"backdrop-contrast":[ir,ht,ft]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ir,ht,ft]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ir,ht,ft]}],"backdrop-invert":[{"backdrop-invert":["",ir,ht,ft]}],"backdrop-opacity":[{"backdrop-opacity":[ir,ht,ft]}],"backdrop-saturate":[{"backdrop-saturate":[ir,ht,ft]}],"backdrop-sepia":[{"backdrop-sepia":["",ir,ht,ft]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ht,ft]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ir,"initial",ht,ft]}],ease:[{ease:["linear","initial",_,ht,ft]}
1105],delay:[{delay:[ir,ht,ft]}],animate:[{animate:["none",S,ht,ft]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ht,ft]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[ht,ft,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",ht,ft]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ht,ft]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[ir,cv,fh,L2]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Woe=GAe(cDe);function Pe(...t){return Woe(Tt(t))}const uDe=t=>{const[e,r,n]=t.split("-").map(Number);return new Date(e,r-1,n)},iT=t=>{const e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}-${r}-${n}`},dDe=t=>t?t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",Hoe=()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),1);e.setHours(0,0,0,0);const r=new Date(t.getFullYear(),t.getMonth()+1,0);return r.setHours(23,59,59,999),{monthStart:e,monthEnd:r}},wq=()=>new Date().toISOString().split("T")[0],Mu=(t,e=!1)=>t.includes("T")&&t.endsWith("Z")?t:`${t}${e?"T23:59:59.999Z":"T00:00:00.000Z"}`,fDe=t=>t.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),qy=t=>{if(t instanceof Ha)switch(t.code){case"auth/user-not-found":return"No account found with this email address";case"auth/wrong-password":return"Incorrect password";case"auth/email-already-in-use":return"An account with this email already exists";case"auth/weak-password":return"Password should be at least 6 characters";case"auth/invalid-email":return"Please enter a valid email address";case"auth/network-request-failed":return"Network error. Please check your connection";case"auth/too-many-requests":return"Too many failed attempts. Please try again later";case"auth/requires-recent-login":return"Please log in again to continue";case"permission-denied":return"You do not have permission to perform this action";case"not-found":return"The requested resource was not found";case"storage/unauthorized":return"You are not authorized to access this file";case"storage/quota-exceeded":return"Storage quota exceeded";case"auth/invalid-credential":return"Invalid credentials";default:return t.message||"A Firebase error occurred"}return t instanceof Error?t.message:typeof t=="string"?t:"An unexpected error occurred"},jw=t=>{if(t instanceof _E){const e=t.message.toLowerCase();return e.includes("permission")||e.includes("unauthorized")?"You do not have permission to perform this action":e.includes("not found")||e.includes("does not exist")?"The requested resource was not found":e.includes("validation")||e.includes("invalid")?"Invalid data provided. Please check your input":e.includes("duplicate")||e.includes("already exists")?"This resource already exists":e.includes("network")||e.includes("connection")?"Network error. Please check your connection":e.includes("timeout")?"Request timed out. Please try again":e.includes("rate limit")||e.includes("too many requests")?"Too many requests. Please try again later":t.message||"A GraphQL error occurred"}if(t&&typeof t=="object"&&"graphQLErrors"in t){const e=t;if(e.graphQLErrors&&e.graphQLErrors.length>0)return jw(e.graphQLErrors[0])}return t instanceof Error?t.message:typeof t=="string"?t:"An unexpected GraphQL error occurred"};function hDe(t="09:00",e="16:00",r=30,n){const i=[],s=[],a=[],o=[],[c,u]=t.split(":").map(Number),[d,f]=e.split(":").map(Number),h=new Map(n.map(x=>[x.label,x])),m=new Date;
1105m.setHours(c,u,0,0);const y=new Date;for(y.setHours(d,f,0,0);m<=y;){const x=m.toTimeString().slice(0,5);i.push(x);const v=h.get(x);v?(s.push(v.pnl),a.push(v.trades),o.push(v.winRate)):(s.push(0),a.push(0),o.push(0)),m.setMinutes(m.getMinutes()+r)}return{labels:i,pnl:s,trades:a,winRate:o}}const z$=Rf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-normal transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-app-border-color-accent focus-visible:ring-app-border-color-accent/50 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-app-button-bg-active text-app-primary-foreground shadow-2xs hover:bg-app-button-bg-active/90 border border-app-border-color-accent",text:"text-primary disabled:text-muted disabled:opacity-25",destructive:"bg-red-600 text-white shadow-2xs hover:bg-red-600/90 focus-visible:ring-red-500/20 border border-red-500",outline:"border bg-transparent shadow-2xs hover:bg--app-button-bg hover:text-accent-foreground border-app-border-color",secondary:"bg-app-button-bg text-app-primary-foreground shadow-2xs hover:bg-app-button-bg/60 border border-app-border-color",ghost:"underline-offset-4 hover:underline",link:"text-primary underline-offset-4 hover:underline",accent:"bg-app-primary-foreground text-app-primary shadow-2xs hover:bg-app-primary-foreground/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-11 rounded-xl px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ye=b.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...i},s)=>{const a=n?Cw:"button";return l.jsx(a,{ref:s,"data-slot":"button",className:Pe(z$({variant:e,size:r,className:t})),...i})});ye.displayName="Button";const pDe=()=>{const t=Ws();return l.jsx("div",{className:"min-h-screen bg-gray-950 text-gray-100 flex items-center justify-center",children:l.jsxs("div",{className:"text-center max-w-md mx-auto px-6",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("div",{className:"flex justify-center mb-4",children:l.jsx(Wu,{size:80,className:"text-red-500"})}),l.jsx("h1",{className:"text-8xl font-bold mb-4",children:"404"}),l.jsx("div",{className:"w-24 h-1 bg-app-button-bg-active mx-auto mb-4"})]}),l.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Page Not Found"}),l.jsx("p",{className:"text-gray-400 mb-8 leading-relaxed",children:"The page you're looking for doesn't exist. It might have been moved, deleted, or you entered the wrong URL."}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs(ye,{variant:"secondary",onClick:()=>t(-1),className:"w-full flex items-center justify-center gap-2",children:[l.jsx(Tu,{size:20}),"Go Back"]}),l.jsx(ye,{asChild:!0,className:"w-full flex items-center justify-center gap-2",children:l.jsxs(At,{to:"/",children:[l.jsx(kw,{size:20}),"Home"]})})]})]})})};function mDe(t,e=120){const r=b.useMemo(()=>t.filter(Boolean),[t]),[n,i]=b.useState(null);return b.useEffect(()=>{if(r.length===0)return;const s=()=>{let a=null;for(const o of r){const c=document.getElementById(o);if(!c)continue;const{top:u}=c.getBoundingClientRect();if(u-e<=0)a=o;else break}if(!a)for(const o of r){const c=document.getElementById(o);if(!c)continue;const{top:u}=c.getBoundingClientRect();if(u>=0){a=o;break}}i(a)};return s(),window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[r,e]),n}function ee(...t){return Woe(Tt(t))}function gDe(t){switch(t){case"/docs":return[{id:"getting-started",text:"Getting Started",level:1}];case"/docs/import-thinkorswim":return[{id:"import-thinkorswim",text:"Import Think Or Swim",level:1}];case"/docs/import-das-trader":return[{id:"import-das-trader",text:"Import DAS Trader",level:1}];case"/docs/terms-of-use":return[{id:"acceptance-of-terms",text:"Acceptance of Terms",level:1},{id:"service-description",text:"Service Description",level:2},{id:"user-accounts",text:"User Accounts",level:1},{id:"subscriptions",text:"Subscriptions & Payments",level:1},{id:"use-license",text:"Limited License",level:1},{id:"trade-data",text:"Trade Data & Content",level:1},{id:"no-advice",text:"No Financial Advice",level:1},{id:"disclaimer",text:"Disclaimer of Warranties",level:1},{id:"limitation-of-liability",text:"Limitation of Liability",level:1},{id:"termination",text:"Termination",level:1},{id:"modifications",text:"Changes to Terms",level:1},{id:"governing-law",text:"Governing Law",level:1},{id:"contact-information",text:"Contact Information",level:1}];case"/docs/privacy-policy":return[{id:"information-collection",text:"Information We Collect",level:1},{id:"automated-data-collection",text:"Automated Data Collection",level:1},{id:"how-we-use-information",text:"How We Use Your Information",level:1},{id:"data-sharing",text:"Data Sharing and Disclosure",level:1},{id:"data-security",text:"Data Security and Protection",level:1},{id:"data-retention",text:"Data Retention and Deletion",level:1},{id:"cookies-tracking",text:"Cookies and Tracking",level:1},{id:"third-party-services",text:"Third-Party Services",level:1},{id:"children-privacy",text:"Children's Privacy",level:1},{id:"international-transfers",text:"International Data Transfers",level:1},{id:"your-rights",text:"Your Privacy Rights",level:1},{id:"policy-updates",text:"Changes to Privacy Policy",level:1},{id:"contact-us",text:"Contact Us",level:1}];case"/docs/contact-support":return[{id:"contact-support",text:"Contact Support",level:1},{id:"support-channels",text:"Support Channels",level:2},{id:"email-support",text:"Email Support",level:2},{id:"in-app-support",text:"In-App Support",level:2},{id:"common-issues",text:"Common Issues & Quick Solutions",level:2},{id:"import-issues",text:"Import Problems",level:3},{id:"account-issues",text:"Account & Subscription",level:3},{id:"response-times",text:"Response Times & Escalation",level:2},{id:"escalation-process",text:"Escalation Process",level:2},{id:"office-hours",text:"Office Hours & Holidays",level:2}];case"/docs/report-bug":return[{id:"report-bug",text:"Report a Bug",level:1},{id:"before-reporting",text:"Before You Report",level:2},{id:"how-to-report",text:"How to Report a Bug",level:2},{id:"email-reporting",text:"Email Bug Reporting",level:3},{id:"what-to-include",text:"What to Include in Your Report",level:2},{id:"essential-information",text:"Essential Information",level:3}
1105,{id:"technical-details",text:"Technical Details",level:3},{id:"bug-categories",text:"Bug Categories",level:2},{id:"response-timeline",text:"Response Timeline",level:2},{id:"tracking-updates",text:"Tracking Your Bug Report",level:2},{id:"common-mistakes",text:"Common Mistakes to Avoid",level:2}];case"/docs/cancel-subscription":return[{id:"cancel-subscription",text:"Cancel subscription",level:1},{id:"cancellation-methods",text:"How to cancel",level:2},{id:"cancel-in-app",text:"Cancel through your profile",level:3},{id:"stripe-portal-steps",text:"Complete cancellation in Stripe portal",level:3},{id:"confirm-update",text:"Confirm the update",level:3},{id:"cancel-via-email",text:"Cancel via email support",level:3},{id:"what-happens-after",text:"What happens after",level:2},{id:"immediate-effects",text:"Immediate effects",level:3},{id:"after-billing-period",text:"After billing period ends",level:3},{id:"data-retention",text:"Data retention and export",level:2},{id:"what-stays-accessible",text:"What stays accessible",level:3},{id:"premium-features-affected",text:"Premium features affected",level:3},{id:"reactivation",text:"Reactivating subscription",level:2},{id:"how-to-reactivate",text:"How to reactivate",level:3},{id:"refund-policy",text:"Refund policy",level:2},{id:"eligible-refunds",text:"When refunds are available",level:3},{id:"refund-process",text:"How to request refund",level:3},{id:"still-need-help",text:"Still need help?",level:2}];case"/docs/common-issues":return[{id:"importing",text:"Importing Trades",level:2},{id:"supported-brokers",text:"Supported Brokers & Platforms",level:2},{id:"trade-management",text:"Trade Management",level:2},{id:"sharing-privacy",text:"Sharing & Privacy",level:2},{id:"reports",text:"Reports & Analytics",level:2},{id:"other-issues",text:"Other Common Issues",level:2}];default:return[]}}function yDe(t){const e=document.getElementById(t);if(!e)return;const r=document.documentElement,n=getComputedStyle(r).getPropertyValue("--docs-anchor-offset").trim(),i=Number.parseInt(n.replace("px",""),10),s=Number.isFinite(i)?i:128,a=window.scrollY+e.getBoundingClientRect().top-s;window.history.pushState(null,"",`#${t}`),window.scrollTo({top:a,behavior:"smooth"}),e.getAttribute("tabindex")===null&&e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0})}const vDe=({sections:t=[],className:e})=>{const r=t.map(i=>i.id),n=mDe(r,144);return t.length===0?null:l.jsxs("nav",{className:ee("w-56 p-3 sticky top-24 hidden lg:block 2k:w-96 2k:p-8",e),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3 pb-2 2k:gap-6 2k:mb-6 2k:pb-4",children:[l.jsx(s3,{className:"size-4 text-app-primary-foreground/60 2k:size-10"}),l.jsx("h4",{className:"text-xs uppercase tracking-widest !m-0 2k:text-xl",children:"On this page"})]}),l.jsxs("div",{className:"relative pl-4 2k:pl-10",children:[l.jsx("div",{className:"pointer-events-none absolute left-[13.5px] top-0 bottom-0 w-px bg-app-border-color-soft 2k:left-[33px]"}),l.jsx("ul",{className:"relative m-0 list-none p-0 space-y-1 2k:space-y-4",children:t.map(i=>{const s=n===i.id;return l.jsxs("li",{className:"relative m-0",children:[s&&l.jsx("span",{"aria-hidden":!0,className:"absolute -left-1 top-1 bottom-1 w-[3px] rounded-sm bg-app-border-color-accent 2k:w-2"}),l.jsx("a",{href:`#${i.id}`,"aria-current":s?"true":void 0,onClick:a=>{a.defaultPrevented||a.button!==0||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey||(a.preventDefault(),yDe(i.id))},className:ee("block rounded-sm px-2 py-1 text-xs font-light transition-colors duration-300 ease-out","hover:bg-app-card/40",s?"text-app-text-accent":"text-app-primary-foreground/70",i.level===1&&"pl-2 2k:pl-6",i.level===2&&"pl-4 2k:pl-12",i.level===3&&"pl-6 2k:pl-20",i.level===4&&"pl-8 2k:pl-28",i.level===5&&"pl-10 2k:pl-36",i.level===6&&"pl-12 2k:pl-44","2k:text-3xl 2k:py-3"),children:i.text})]},i.id)})})]})]})},d3=b.createContext({});function HE(t){const e=b.useRef(null);return e.current===null&&(e.current=t()),e.current}const f3=typeof window<"u",h3=f3?b.useLayoutEffect:b.useEffect,qE=b.createContext(null);function p3(t,e){t.indexOf(e)===-1&&t.push(e)}function m3(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}const dc=(t,e,r)=>r>e?e:r<t?t:r;let sb=()=>{};const Au={},qoe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Yoe(t){return typeof t=="object"&&t!==null}const Koe=t=>/^0[^.\s]+$/u.test(t);function g3(t){let e;return()=>(e===void 0&&(e=t()),e)}const oa=t=>t,xDe=(t,e)=>r=>e(t(r)),Nw=(...t)=>t.reduce(xDe),Bg=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n};class y3{constructor(){this.subscriptions=[]}add(e){return p3(this.subscriptions,e),()=>m3(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(e,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ql=t=>t*1e3,Zl=t=>t/1e3;function v3(t,e){return e?t*(1e3/e):0}const Qoe=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,bDe=1e-7,wDe=12;function _De(t,e,r,n,i){let s,a,o=0;do a=e+(r-e)/2,s=Qoe(a,n,i)-t,s>0?r=a:e=a;while(Math.abs(s)>bDe&&++o<wDe);return a}function Pw(t,e,r,n){if(t===e&&r===n)return oa;const i=s=>_De(s,0,1,t,r);return s=>s===0||s===1?s:Qoe(i(s),e,n)}const Zoe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Xoe=t=>e=>1-t(1-e),Joe=Pw(.33,1.53,.69,.99),x3=Xoe(Joe),ele=Zoe(x3),tle=t=>(t*=2)<1?.5*x3(t):.5*(2-Math.pow(2,-10*(t-1))),b3=t=>1-Math.sin(Math.acos(t)),rle=Xoe(b3),nle=Zoe(b3),SDe=Pw(.42,0,1,1),kDe=Pw(0,0,.58,1),ile=Pw(.42,0,.58,1),TDe=t=>Array.isArray(t)&&typeof t[0]!="number",sle=t=>Array.isArray(t)&&typeof t[0]=="number",CDe={linear:oa,easeIn:SDe,easeInOut:ile,easeOut:kDe,circIn:b3,circInOut:nle,circOut:rle,backIn:x3,backInOut:ele,backOut:Joe,anticipate:tle},EDe=t=>typeof t=="string",_q=t=>
vendor: 34,951 bytes, line 1105
1105{if(sle(t)){sb(t.length===4);const[e,r,n,i]=t;return Pw(e,r,n,i)}else if(EDe(t))return CDe[t];return t},B_=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function jDe(t,e){let r=new Set,n=new Set,i=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(d){a.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,h=!1)=>{const y=h&&i?r:n;return f&&a.add(d),y.has(d)||y.add(d),d},cancel:d=>{n.delete(d),a.delete(d)},process:d=>{if(o=d,i){s=!0;return}i=!0,[r,n]=[n,r],r.forEach(c),r.clear(),i=!1,s&&(s=!1,u.process(d))}};return u}const NDe=40;function ale(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,a=B_.reduce((k,E)=>(k[E]=jDe(s),k),{}),{setup:o,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:m,postRender:y}=a,x=()=>{const k=Au.useManualTiming?i.timestamp:performance.now();r=!1,Au.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(k-i.timestamp,NDe),1)),i.timestamp=k,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),d.process(i),f.process(i),h.process(i),m.process(i),y.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(x))},v=()=>{r=!0,n=!0,i.isProcessing||t(x)};return{schedule:B_.reduce((k,E)=>{const T=a[E];return k[E]=(N,j=!1,M=!1)=>(r||v(),T.schedule(N,j,M)),k},{}),cancel:k=>{for(let E=0;E<B_.length;E++)a[B_[E]].cancel(k)},state:i,steps:a}}const{schedule:Br,cancel:fc,state:Di,steps:$2}=ale(typeof requestAnimationFrame<"u"?requestAnimationFrame:oa,!0);let pk;function PDe(){pk=void 0}const ia={now:()=>(pk===void 0&&ia.set(Di.isProcessing||Au.useManualTiming?Di.timestamp:performance.now()),pk),set:t=>{pk=t,queueMicrotask(PDe)}},ole=t=>e=>typeof e=="string"&&e.startsWith(t),w3=ole("--"),MDe=ole("var(--"),_3=t=>MDe(t)?ADe.test(t.split("/*")[0].trim()):!1,ADe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Yy={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ab={...Yy,transform:t=>dc(0,1,t)},V_={...Yy,default:1},gx=t=>Math.round(t*1e5)/1e5,S3=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function DDe(t){return t==null}const ODe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,k3=(t,e)=>r=>!!(typeof r=="string"&&ODe.test(r)&&r.startsWith(t)||e&&!DDe(r)&&Object.prototype.hasOwnProperty.call(r,e)),lle=(t,e,r)=>n=>{if(typeof n!="string")return n;const[i,s,a,o]=n.match(S3);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},RDe=t=>dc(0,255,t),F2={...Yy,transform:t=>Math.round(RDe(t))},Dh={test:k3("rgb","red"),parse:lle("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+F2.transform(t)+", "+F2.transform(e)+", "+F2.transform(r)+", "+gx(ab.transform(n))+")"};function IDe(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const B$={test:k3("#"),parse:IDe,transform:Dh.transform},Mw=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),jd=Mw("deg"),Xl=Mw("%"),Lt=Mw("px"),LDe=Mw("vh"),$De=Mw("vw"),Sq={...Xl,parse:t=>Xl.parse(t)/100,transform:t=>Xl.transform(t*100)},rg={test:k3("hsl","hue"),parse:lle("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Xl.transform(gx(e))+", "+Xl.transform(gx(r))+", "+gx(ab.transform(n))+")"},ai={test:t=>Dh.test(t)||B$.test(t)||rg.test(t),parse:t=>Dh.test(t)?Dh.parse(t):rg.test(t)?rg.parse(t):B$.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Dh.transform(t):rg.transform(t),getAnimatableNone:t=>{const e=ai.parse(t);return e.alpha=0,ai.transform(e)}},FDe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zDe(t){return isNaN(t)&&typeof t=="string"&&(t.match(S3)?.length||0)+(t.match(FDe)?.length||0)>0}const cle="number",ule="color",BDe="var",VDe="var(",kq="${}",UDe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ob(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const o=e.replace(UDe,c=>(ai.test(c)?(n.color.push(s),i.push(ule),r.push(ai.parse(c))):c.startsWith(VDe)?(n.var.push(s),i.push(BDe),r.push(c)):(n.number.push(s),i.push(cle),r.push(parseFloat(c))),++s,kq)).split(kq);return{values:r,split:o,indexes:n,types:i}}function dle(t){return ob(t).values}function fle(t){const{split:e,types:r}=ob(t),n=e.length;return i=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],i[a]!==void 0){const o=r[a];o===cle?s+=gx(i[a]):o===ule?s+=ai.transform(i[a]):s+=i[a]}return s}}const GDe=t=>typeof t=="number"?0:ai.test(t)?ai.getAnimatableNone(t):t;function WDe(t){const e=dle(t);return fle(t)(e.map(GDe))}const Tf={test:zDe,parse:dle,createTransformer:fle,getAnimatableNone:WDe};function z2(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function HDe({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,a=0;if(!e)i=s=a=r;else{const o=r<.5?r*(1+e):r+e-r*e,c=2*r-o;i=z2(c,o,t+1/3),s=z2(c,o,t),a=z2(c,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}function sT(t,e){return r=>r>0?e:t}const Cn=(t,e,r)=>t+(e-t)*r,B2=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},qDe=[B$,Dh,rg],YDe=t=>qDe.find(e=>e.test(t));function Tq(t){const e=YDe(t);if(!e)return!1;let r=e.parse(t);return e===rg&&(r=HDe(r)),r}const Cq=(t,e)=>{const r=Tq(t),n=Tq(e);if(!r||!n)return sT(t,e);const i={...r};return s=>(i.red=B2(r.red,n.red,s),i.green=B2(r.green,n.green,s),i.blue=B2(r.blue,n.blue,s),i.alpha=Cn(r.alpha,n.alpha,s),Dh.transform(i))},V$=new Set(["none","hidden"]);function KDe(t,e){return V$.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function QDe(t,e){return r=>Cn(t,e,r)}function T3(t){return typeof t=="number"?QDe:typeof t=="string"?_3(t)?sT:ai.test(t)?Cq:JDe:Array.isArray(t)?hle:typeof t=="object"?ai.test(t)?Cq:ZDe:sT}function hle(t,e){const r=[...t],n=r.length,i=t.map((s,a)=>T3(s)(s,e[a]));return s=>{for(let a=0;a<n;a++)r[a]=i[a](s);return r}}function ZDe(t,e){const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=T3(t[i])(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}}function XDe(t,e){const r=[],n={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],a=t.indexes[s][n[s]],o=t.values[a]??0;r[i]=o,n[s]++}return r}const JDe=(t,e)=>{const r=Tf.createTransformer(e),n=ob(t),i=ob(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?V$.has(t)&&!i.values.length||V$.has(e)&&!n.values.length?KDe(t,e):Nw(hle(XDe(n,i),i.values),r):sT(t,e)};function ple(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?Cn(t,e,r):T3(t)(t,e)}const eOe=t=>{const e=({timestamp:r})=>t(r);return{start:(r=!0)=>Br.update(e,r),stop:()=>fc(e),now:()=>Di.isProcessing?Di.timestamp:ia.now()}},mle=(t,e,r=10)=>{let n="";const i=Math.max(Math.round(e/r),2);for(let s=0;s<i;s++)n+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},aT=2e4;function C3(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e<aT;)e+=r,n=t.next(e);return e>=aT?1/0:e}function tOe(t,e=100,r){const n=r({...t,keyframes:[0,e]}),i=Math.min(C3(n),aT);return{type:"keyframes",ease:s=>n.next(i*s).value/e,duration:Zl(i)}}const rOe=5;function gle(t,e,r){const n=Math.max(e-rOe,0);return v3(r-t(n),e-n)}const An={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},V2=.001;function nOe({duration:t=An.duration,bounce:e=An.bounce,velocity:r=An.velocity,mass:n=An.mass}){let i,s,a=1-e;a=dc(An.minDamping,An.maxDamping,a),t=dc(An.minDuration,An.maxDuration,Zl(t)),a<1?(i=u=>{const d=u*a,f=d*t,h=d-r,m=U$(u,a),y=Math.exp(-f);return V2-h/m*y},s=u=>{const f=u*a*t,h=f*r+r,m=Math.pow(a,2)*Math.pow(u,2)*t,y=Math.exp(-f),x=U$(Math.pow(u,2),a);return(-i(u)+V2>0?-1:1)*((h-m)*y)/x}):(i=u=>{const d=Math.exp(-u*t),f=(u-r)*t+1;return-V2+d*f},s=u=>{const d=Math.exp(-u*t),f=(r-u)*(t*t);return d*f});const o=5/t,c=sOe(i,s,o);if(t=Ql(t),isNaN(c))return{stiffness:An.stiffness,damping:An.damping,duration:t};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:t}}}const iOe=12;function sOe(t,e,r){let n=r;for(let i=1;i<iOe;i++)n=n-t(n)/e(n);return n}function U$(t,e){return t*Math.sqrt(1-e*e)}const aOe=["duration","bounce"],oOe=["stiffness","damping","mass"];function Eq(t,e){return e.some(r=>t[r]!==void 0)}function lOe(t){let e={velocity:An.velocity,stiffness:An.stiffness,damping:An.damping,mass:An.mass,isResolvedFromDuration:!1,...t};if(!Eq(t,oOe)&&Eq(t,aOe))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*dc(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:An.mass,stiffness:i,damping:s}}else{const r=nOe(t);e={...e,...r,mass:An.mass},e.isResolvedFromDuration=!0}return e}function oT(t=An.visualDuration,e=An.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:i}=r;const s=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],o={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=lOe({...r,velocity:-Zl(r.velocity||0)}),y=h||0,x=u/(2*Math.sqrt(c*d)),v=a-s,_=Zl(Math.sqrt(c/d)),S=Math.abs(v)<5;n||(n=S?An.restSpeed.granular:An.restSpeed.default),i||(i=S?An.restDelta.granular:An.restDelta.default);let k;if(x<1){const T=U$(_,x);k=N=>{const j=Math.exp(-x*_*N);return a-j*((y+x*_*v)/T*Math.sin(T*N)+v*Math.cos(T*N))}}else if(x===1)k=T=>a-Math.exp(-_*T)*(v+(y+_*v)*T);else{const T=_*Math.sqrt(x*x-1);k=N=>{const j=Math.exp(-x*_*N),M=Math.min(T*N,300);return a-j*((y+x*_*v)*Math.sinh(M)+T*v*Math.cosh(M))/T}}const E={calculatedDuration:m&&f||null,next:T=>{const N=k(T);if(m)o.done=T>=f;else{let j=T===0?y:0;x<1&&(j=T===0?Ql(y):gle(k,T,N));const M=Math.abs(j)<=n,O=Math.abs(a-N)<=i;o.done=M&&O}return o.value=o.done?a:N,o},toString:()=>{const T=Math.min(C3(E),aT),N=mle(j=>E.next(T*j).value,T,30);return T+"ms "+N},toTransition:()=>{}};return E}oT.applyToOptions=t=>{const e=tOe(t,100,oT);return t.ease=e.ease,t.duration=Ql(e.duration),t.type="keyframes",t};function G$({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:c,restDelta:u=.5,restSpeed:d}){const f=t[0],h={done:!1,value:f},m=M=>o!==void 0&&M<o||c!==void 0&&M>c,y=M=>o===void 0?c:c===void 0||Math.abs(o-M)<Math.abs(c-M)?o:c;let x=r*e;const v=f+x,_=a===void 0?v:a(v);_!==v&&(x=_-f);const S=M=>-x*Math.exp(-M/n),k=M=>_+S(M),E=M=>{const O=S(M),R=k(M);h.done=Math.abs(O)<=u,h.value=h.done?_:R};let T,N;const j=M=>{m(h.value)&&(T=M,N=oT({keyframes:[h.value,y(h.value)],velocity:gle(k,M,h.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return j(0),{calculatedDuration:null,next:M=>{let O=!1;return!N&&T===void 0&&(O=!0,E(M),j(M)),T!==void 0&&M>=T?N.next(M-T):(!O&&E(M),h)}}}function cOe(t,e,r){const n=[],i=r||Au.mix||ple,s=t.length-1;for(let a=0;a<s;a++){let o=i(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||oa:e;o=Nw(c,o)}n.push(o)}return n}function yle(t,e,{clamp:r=!0,ease:n,mixer:i}={}){const s=t.length;if(sb(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=cOe(e,n,i),c=o.length,u=d=>{if(a&&d<t[0])return e[0];let f=0;if(c>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const h=Bg(t[f],t[f+1],d);return o[f](h)};return r?d=>u(dc(t[0],t[s-1],d)):u}function uOe(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=Bg(0,e,n);t.push(Cn(r,1,i))}}function vle(t){const e=[0];return uOe(e,t.length-1),e}function dOe(t,e){return t.map(r=>r*e)}function fOe(t,e){return t.map(()=>e||ile).splice(0,t.length-1)}function yx({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=TDe(n)?n.map(_q):_q(n),s={done:!1,value:e[0]},a=dOe(r&&r.length===e.length?r:vle(e),t),o=yle(a,e,{ease:Array.isArray(i)?i:fOe(e,i)});return{calculatedDuration:t,next:c=>(s.value=o(c),s.done=c>=t,s)}}const hOe=t=>t!==null;function E3(t,{repeat:e,repeatType:r="loop"},n,i=1){const s=t.filter(hOe),o=i<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return!o||n===void 0?s[o]:n}const pOe={decay:G$,inertia:G$,tween:yx,keyframes:yx,spring:oT};function xle(t){typeof t.type=="string"&&(t.type=pOe[t.type])}class j3{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,r){return this.finished.then(e,r)}}const mOe=t=>t/100;class N3 extends j3{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:r}=this.options;r&&r.updatedAt!==ia.now()&&this.tick(ia.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;xle(e);const{type:r=yx,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=e;let{keyframes:o}=e;const c=r||yx;c!==yx&&typeof o[0]!="number"&&(this.mixKeyframes=Nw(mOe,ple(o[0],o[1])),o=[0,100]);const u=c({...e,keyframes:o});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=C3(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(e){const r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(e,r=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:y,onUpdate:x,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);const _=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let k=this.currentTime,E=n;if(f){const M=Math.min(this.currentTime,i)/o;let O=Math.floor(M),R=M%1;!R&&M>=1&&(R=1),R===1&&O--,O=Math.min(O,f+1),!!(O%2)&&(h==="reverse"?(R=1-R,m&&(R-=m/o)):h==="mirror"&&(E=a)),k=dc(0,1,R)*o}const T=S?{done:!1,value:d[0]}:E.next(k);s&&(T.value=s(T.value));let{done:N}=T;!S&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return j&&y!==G$&&(T.value=E3(d,this.options,v,this.speed)),x&&x(T.value),j&&this.finish(),T}then(e,r){return this.finished.then(e,r)}get duration(){return Zl(this.calculatedDuration)}get time(){return Zl(this.currentTime)}set time(e){e=Ql(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ia.now());const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=Zl(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=eOe,startTime:r}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ia.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function gOe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Oh=t=>t*180/Math.PI,W$=t=>{const e=Oh(Math.atan2(t[1],t[0]));return H$(e)},yOe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:W$,rotateZ:W$,skewX:t=>Oh(Math.atan(t[1])),skewY:t=>Oh(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},H$=t=>(t=t%360,t<0&&(t+=360),t),jq=W$,Nq=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Pq=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vOe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Nq,scaleY:Pq,scale:t=>(Nq(t)+Pq(t))/2,rotateX:t=>H$(Oh(Math.atan2(t[6],t[5]))),rotateY:t=>H$(Oh(Math.atan2(-t[2],t[0]))),rotateZ:jq,rotate:jq,skewX:t=>Oh(Math.atan(t[4])),skewY:t=>Oh(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function q$(t){return t.includes("scale")?1:0}function Y$(t,e){if(!t||t==="none")return q$(e);const r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=vOe,i=r;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=yOe,i=o}if(!i)return q$(e);const s=n[e],a=i[1].split(",").map(bOe);return typeof s=="function"?s(a):a[s]}const xOe=(t,e)=>{const{transform:r="none"}=getComputedStyle(t);return Y$(r,e)};function bOe(t){return parseFloat(t.trim())}const Ky=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qy=new Set(Ky),Mq=t=>t===Yy||t===Lt,wOe=new Set(["x","y","z"]),_Oe=Ky.filter(t=>!wOe.has(t));function SOe(t){const e=[];return _Oe.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const Kh={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Y$(e,"x"),y:(t,{transform:e})=>Y$(e,"y")};Kh.translateX=Kh.x;Kh.translateY=Kh.y;const Qh=new Set;let K$=!1,Q$=!1,Z$=!1;function ble(){if(Q$){const t=Array.from(Qh).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=SOe(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([s,a])=>{n.getValue(s)?.set(a)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Q$=!1,K$=!1,Qh.forEach(t=>t.complete(Z$)),Qh.clear()}function wle(){Qh.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Q$=!0)})}function kOe(){Z$=!0,wle(),ble(),Z$=!1}class P3{constructor(e,r,n,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Qh.add(this),K$||(K$=!0,Br.read(wle),Br.resolveKeyframes(ble))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;if(e[0]===null){const s=i?.get(),a=e[e.length-1];if(s!==void 0)e[0]=s;else if(n&&r){const o=n.readValue(r,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&s===void 0&&i.set(e[0])}gOe(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Qh.delete(this)}cancel(){this.state==="scheduled"&&(Qh.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const TOe=t=>t.startsWith("--");function COe(t,e,r){TOe(e)?t.style.setProperty(e,r):t.style[e]=r}const _le=g3(()=>window.ScrollTimeline!==void 0),EOe={};function jOe(t,e){const r=g3(t);return()=>EOe[e]??r()}const Sle=jOe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xv=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,Aq={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xv([0,.65,.55,1]),circOut:Xv([.55,0,1,.45]),backIn:Xv([.31,.01,.66,-.59]),backOut:Xv([.33,1.53,.69,.99])};function kle(t,e){if(t)return typeof t=="function"?Sle()?mle(t,e):"ease-out":sle(t)?Xv(t):Array.isArray(t)?t.map(r=>kle(r,e)||Aq.easeOut):Aq[t]}function NOe(t,e,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:c}={},u=void 0){const d={[e]:r};c&&(d.offset=c);const f=kle(o,i);Array.isArray(f)&&(d.easing=f);const h={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(d,h)}function Tle(t){return typeof t=="function"&&"applyToOptions"in t}function POe({type:t,...e}){return Tle(t)&&Sle()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class MOe extends j3{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:r,name:n,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=e,sb(typeof e.type!="string");const u=POe(e);this.animation=NOe(r,n,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=E3(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):COe(r,n,d),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Zl(Number(e))}get time(){return Zl(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Ql(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&_le()?(this.animation.timeline=e,oa):r(this)}}const Cle={anticipate:tle,backInOut:ele,circInOut:nle};function AOe(t){return t in Cle}function DOe(t){typeof t.ease=="string"&&AOe(t.ease)&&(t.ease=Cle[t.ease])}const Dq=10;class OOe extends MOe{constructor(e){DOe(e),xle(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:r,onUpdate:n,onComplete:i,element:s,...a}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}const o=new N3({...a,autoplay:!1}),c=Ql(this.finishedTime??this.time);r.setWithVelocity(o.sample(c-Dq).value,o.sample(c).value,Dq),o.stop()}}const Oq=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Tf.test(t)||t==="0")&&!t.startsWith("url("));function ROe(t){const e=t[0];if(t.length===1)return!0;for(let r=0;r<t.length;r++)if(t[r]!==e)return!0}function IOe(t,e,r,n){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],a=Oq(i,e),o=Oq(s,e);return!a||!o?!1:ROe(t)||(r==="spring"||Tle(r))&&n}function X$(t){t.duration=0,t.type}const LOe=new Set(["opacity","clipPath","filter","transform"]),$Oe=g3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function FOe(t){const{motionValue:e,name:r,repeatDelay:n,repeatType:i,damping:s,type:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return $Oe()&&r&&LOe.has(r)&&(r!=="transform"||!u)&&!c&&!n&&i!=="mirror"&&s!==0&&a!=="inertia"}const zOe=40;class BOe extends j3{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:c,motionValue:u,element:d,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ia.now();const h={autoplay:e,delay:r,type:n,repeat:i,repeatDelay:s,repeatType:a,name:c,motionValue:u,element:d,...f},m=d?.KeyframeResolver||P3;this.keyframeResolver=new m(o,(y,x,v)=>this.onKeyframesResolved(y,x,h,!v),c,u,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,r,n,i){this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=ia.now(),IOe(e,s,a,o)||((Au.instantAnimations||!c)&&d?.(E3(e,n,r)),e[0]=e[e.length-1],X$(n),n.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>zOe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:e},m=!u&&FOe(h)?new OOe({...h,element:h.motionValue.owner.current}):new N3(h);m.finished.then(()=>this.notifyFinished()).catch(oa),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),kOe()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const VOe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function UOe(t){const e=VOe.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function Ele(t,e,r=1){const[n,i]=UOe(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const a=s.trim();return qoe(a)?parseFloat(a):a}return _3(i)?Ele(i,e,r+1):i}function M3(t,e){return t?.[e]??t?.default??t}const jle=new Set(["width","height","top","left","right","bottom",...Ky]),GOe={test:t=>t==="auto",parse:t=>t},Nle=t=>e=>e.test(t),Ple=[Yy,Lt,Xl,jd,$De,LDe,GOe],Rq=t=>Ple.find(Nle(t));function WOe(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Koe(t):!0}const HOe=new Set(["brightness","contrast","saturate","opacity"]);function qOe(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(S3)||[];if(!n)return t;const i=r.replace(n,"");let s=HOe.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const YOe=/\b([a-z-]*)\(.*?\)/gu,J$={...Tf,getAnimatableNone:t=>{const e=t.match(YOe);return e?e.map(qOe).join(" "):t}},Iq={...Yy,transform:Math.round},KOe={rotate:jd,rotateX:jd,rotateY:jd,rotateZ:jd,scale:V_,scaleX:V_,scaleY:V_,scaleZ:V_,skew:jd,skewX:jd,skewY:jd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:ab,originX:Sq,originY:Sq,originZ:Lt},A3={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...KOe,zIndex:Iq,fillOpacity:ab,strokeOpacity:ab,numOctaves:Iq},QOe={...A3,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:J$,WebkitFilter:J$},Mle=t=>QOe[t];function Ale(t,e){let r=Mle(t);return r!==J$&&(r=Tf),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const ZOe=new Set(["auto","none","0"]);function XOe(t,e,r){let n=0,i;for(;n<t.length&&!i;){const s=t[n];typeof s=="string"&&!ZOe.has(s)&&ob(s).values.length&&(i=t[n]),n++}if(i&&r)for(const s of e)t[s]=Ale(r,i)}class JOe extends P3{constructor(e,r,n,i,s){super(e,r,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),_3(u))){const d=Ele(u,r.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!jle.has(n)||e.length!==2)return;const[i,s]=e,a=Rq(i),o=Rq(s);if(a!==o)if(Mq(a)&&Mq(o))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else Kh[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:r}=this,n=[];for(let i=0;i<e.length;i++)(e[i]===null||WOe(e[i]))&&n.push(i);n.length&&XOe(e,n,r)}measureInitialState(){const{element:e,unresolvedKeyframes:r,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Kh[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&e.getValue(n,i).jump(i,!1)}measureEndState(){const{element:e,name:r,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const i=e.getValue(r);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,a=n[s];n[s]=Kh[r](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,c])=>{e.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function Dle(t,e,r){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const i=r?.[t]??n.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const Ole=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function D3(t){return Yoe(t)&&"offsetHeight"in t}const Lq=30,eRe=t=>!isNaN(parseFloat(t));class tRe{constructor(e,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const i=ia.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=ia.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=eRe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new y3);const n=this.events[e].add(r);return e==="change"?()=>{n(),Br.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ia.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Lq)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Lq);return v3(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bl(t,e){return new tRe(t,e)}const{schedule:O3}=ale(queueMicrotask,!1),Xo={x:!1,y:!1};function Rle(){return Xo.x||Xo.y}function rRe(t){return t==="x"||t==="y"?Xo[t]?null:(Xo[t]=!0,()=>{Xo[t]=!1}):Xo.x||Xo.y?null:(Xo.x=Xo.y=!0,()=>{Xo.x=Xo.y=!1})}function Ile(t,e){const r=Dle(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[r,i,()=>n.abort()]}function $q(t){return!(t.pointerType==="touch"||Rle())}function nRe(t,e,r={}){const[n,i,s]=Ile(t,r),a=o=>{if(!$q(o))return;const{target:c}=o,u=e(c,o);if(typeof u!="function"||!c)return;const d=f=>{$q(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,i)};return n.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}const Lle=(t,e)=>
1105e?t===e?!0:Lle(t,e.parentElement):!1,R3=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,iRe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sRe(t){return iRe.has(t.tagName)||t.tabIndex!==-1}const mk=new WeakSet;function Fq(t){return e=>{e.key==="Enter"&&t(e)}}function U2(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const aRe=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=Fq(()=>{if(mk.has(r))return;U2(r,"down");const i=Fq(()=>{U2(r,"up")}),s=()=>U2(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",s,e)});r.addEventListener("keydown",n,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),e)};function zq(t){return R3(t)&&!Rle()}function oRe(t,e,r={}){const[n,i,s]=Ile(t,r),a=o=>{const c=o.currentTarget;if(!zq(o))return;mk.add(c);const u=e(c,o),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),mk.has(c)&&mk.delete(c),zq(m)&&typeof u=="function"&&u(m,{success:y})},f=m=>{d(m,c===window||c===document||r.useGlobalTarget||Lle(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return n.forEach(o=>{(r.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),D3(o)&&(o.addEventListener("focus",u=>aRe(u,i)),!sRe(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function I3(t){return Yoe(t)&&"ownerSVGElement"in t}const gk=new WeakMap;let yk;const $le=(t,e,r)=>(n,i)=>i&&i[0]?i[0][t+"Size"]:I3(n)&&"getBBox"in n?n.getBBox()[e]:n[r],lRe=$le("inline","width","offsetWidth"),cRe=$le("block","height","offsetHeight");function uRe({target:t,borderBoxSize:e}){gk.get(t)?.forEach(r=>{r(t,{get width(){return lRe(t,e)},get height(){return cRe(t,e)}})})}function dRe(t){t.forEach(uRe)}function fRe(){typeof ResizeObserver>"u"||(yk=new ResizeObserver(dRe))}function hRe(t,e){yk||fRe();const r=Dle(t);return r.forEach(n=>{let i=gk.get(n);i||(i=new Set,gk.set(n,i)),i.add(e),yk?.observe(n)}),()=>{r.forEach(n=>{const i=gk.get(n);i?.delete(e),i?.size||yk?.unobserve(n)})}}const vk=new Set;let ng;function pRe(){ng=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};vk.forEach(e=>e(t))},window.addEventListener("resize",ng)}function mRe(t){return vk.add(t),ng||pRe(),()=>{vk.delete(t),!vk.size&&typeof ng=="function"&&(window.removeEventListener("resize",ng),ng=void 0)}}function gRe(t,e){return typeof t=="function"?mRe(t):hRe(t,e)}function Fle(t,e){let r;const n=()=>{const{currentTime:i}=e,a=(i===null?0:i.value)/100;r!==a&&t(a),r=a};return Br.preUpdate(n,!0),()=>fc(n)}function yRe(t){return I3(t)&&t.tagName==="svg"}const bs=t=>!!(t&&t.getVelocity),vRe=[...Ple,ai,Tf],xRe=t=>vRe.find(Nle(t)),L3=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class bRe extends b.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=D3(n)&&n.offsetWidth||0,s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function wRe({children:t,isPresent:e,anchorX:r,root:n}){const i=b.useId(),s=b.useRef(null),a=b.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=b.useContext(L3);return b.useInsertionEffect(()=>{const{width:c,height:u,top:d,left:f,right:h}=a.current;if(e||!s.current||!c||!u)return;const m=r==="left"?`left: ${f}`:`right: ${h}`;s.current.dataset.motionPopId=i;const y=document.createElement("style");o&&(y.nonce=o);const x=n??document.head;return x.appendChild(y),y.sheet&&y.sheet.insertRule(`
1106          [data-motion-pop-id="${i}"] {
1107            position: absolute !important;
1108            width: ${c}px !important;
1109            height: ${u}px !important;
1110            ${m}px !important;
1111            top: ${d}px !important;
1112          }
1113        `),()=>{x.contains(y)&&x.removeChild(y)}},[e]),l.jsx(bRe,{isPresent:e,childRef:s,sizeRef:a,children:b.cloneElement(t,{ref:s})})}const _Re=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,root:c})=>{const u=HE(SRe),d=b.useId();let f=!0,h=b.useMemo(()=>(f=!1,{id:d,initial:e,isPresent:r,custom:i,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;n&&n()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[r,u,n]);return s&&f&&(h={...h}),b.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[r]),b.useEffect(()=>{!r&&!u.size&&n&&n()},[r]),a==="popLayout"&&(t=l.jsx(wRe,{isPresent:r,anchorX:o,root:c,children:t})),l.jsx(qE.Provider,{value:h,children:t})};function SRe(){return new Map}function zle(t=!0){const e=b.useContext(qE);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=e,s=b.useId();b.useEffect(()=>{if(t)return i(s)},[t]);const a=b.useCallback(()=>t&&n&&n(s),[s,n,t]);return!r&&n?[!1,a]:[!0]}const U_=t=>t.key||"";function Bq(t){const e=[];
vendor: 4,248 bytes, line 1113
1113return b.Children.forEach(t,r=>{b.isValidElement(r)&&e.push(r)}),e}const Ss=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",root:c})=>{const[u,d]=zle(a),f=b.useMemo(()=>Bq(t),[t]),h=a&&!u?[]:f.map(U_),m=b.useRef(!0),y=b.useRef(f),x=HE(()=>new Map),[v,_]=b.useState(f),[S,k]=b.useState(f);h3(()=>{m.current=!1,y.current=f;for(let N=0;N<S.length;N++){const j=U_(S[N]);h.includes(j)?x.delete(j):x.get(j)!==!0&&x.set(j,!1)}},[S,h.length,h.join("-")]);const E=[];if(f!==v){let N=[...f];for(let j=0;j<S.length;j++){const M=S[j],O=U_(M);h.includes(O)||(N.splice(j,0,M),E.push(M))}return s==="wait"&&E.length&&(N=E),k(Bq(N)),_(f),null}const{forceRender:T}=b.useContext(d3);return l.jsx(l.Fragment,{children:S.map(N=>{const j=U_(N),M=a&&!u?!1:f===S||h.includes(j),O=()=>{if(x.has(j))x.set(j,!0);else return;let R=!0;x.forEach(I=>{I||(R=!1)}),R&&(T?.(),k(y.current),a&&d?.(),n&&n())};return l.jsx(_Re,{isPresent:M,initial:!m.current||r?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:M?void 0:O,anchorX:o,children:N},j)})})},Ble=b.createContext({strict:!1}),Vq={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Vg={};for(const t in Vq)Vg[t]={isEnabled:e=>Vq[t].some(r=>!!e[r])};function kRe(t){for(const e in t)Vg[e]={...Vg[e],...t[e]}}const TRe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function lT(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||TRe.has(t)}let Vle=t=>!lT(t);function CRe(t){typeof t=="function"&&(Vle=e=>e.startsWith("on")?!lT(e):t(e))}try{CRe(require("@emotion/is-prop-valid").default)}catch{}function ERe(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(Vle(i)||r===!0&&lT(i)||!e&&!lT(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}const YE=b.createContext({});function KE(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lb(t){return typeof t=="string"||Array.isArray(t)}const $3=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],F3=["initial",...$3];function QE(t){return KE(t.animate)||F3.some(e=>lb(t[e]))}function Ule(t){return!!(QE(t)||t.variants)}function jRe(t,e){if(QE(t)){const{initial:r,animate:n}=t;return{initial:r===!1||lb(r)?r:void 0,animate:lb(n)?n:void 0}}return t.inherit!==!1?e:{}}function NRe(t){const{initial:e,animate:r}=jRe(t,b.useContext(YE));return b.useMemo(()=>({initial:e,animate:r}),[Uq(e),Uq(r)])}function Uq(t){return Array.isArray(t)?t.join(" "):t}const cb={};function PRe(t){for(const e in t)cb[e]=t[e],w3(e)&&(cb[e].isCSSVariable=!0)}function Gle(t,{layout:e,layoutId:r}){return Qy.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!cb[t]||t==="opacity")}const MRe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ARe=Ky.length;function DRe(t,e,r){let n="",i=!0;for(let s=0;s<ARe;s++){const a=Ky[s],o=t[a];if(o===void 0)continue;let c=!0;if(typeof o=="number"?c=o===(a.startsWith("scale")?1:0):c=parseFloat(o)===0,!c||r){const u=Ole(o,A3[a]);if(!c){i=!1;const d=MRe[a]||a;n+=`${d}(${u}) `}r&&(e[a]=u)}}return n=n.trim(),r?n=r(e,i?"":n):i&&(n="none"),n}function z3(t,e,r){const{style:n,vars:i,transformOrigin:s}=t;let a=!1,o=!1;for(const c in e){const u=e[c];if(Qy.has(c)){a=!0;continue}else if(w3(c)){i[c]=u;continue}else{const d=Ole(u,A3[c]);c.startsWith("origin")?(o=!0,s[c]=d):n[c]=d}}
vendor: 4,914 bytes, line 1113
1113if(e.transform||(a||r?n.transform=DRe(e,t.transform,r):n.transform&&(n.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;n.transformOrigin=`${c} ${u} ${d}`}}const B3=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Wle(t,e,r){for(const n in e)!bs(e[n])&&!Gle(n,r)&&(t[n]=e[n])}function ORe({transformTemplate:t},e){return b.useMemo(()=>{const r=B3();return z3(r,e,t),Object.assign({},r.vars,r.style)},[e])}function RRe(t,e){const r=t.style||{},n={};return Wle(n,r,t),Object.assign(n,ORe(t,e)),n}function IRe(t,e){const r={},n=RRe(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const LRe={offset:"stroke-dashoffset",array:"stroke-dasharray"},$Re={offset:"strokeDashoffset",array:"strokeDasharray"};function FRe(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?LRe:$Re;t[s.offset]=Lt.transform(-n);const a=Lt.transform(e),o=Lt.transform(r);t[s.array]=`${a} ${o}`}function Hle(t,{attrX:e,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},c,u,d){if(z3(t,o,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),i!==void 0&&FRe(f,i,s,a,!1)}const qle=()=>({...B3(),attrs:{}}),Yle=t=>typeof t=="string"&&t.toLowerCase()==="svg";function zRe(t,e,r,n){const i=b.useMemo(()=>{const s=qle();return Hle(s,e,Yle(n),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Wle(s,t.style,t),i.style={...s,...i.style}}return i}const BRe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function V3(t){return typeof t!="string"||t.includes("-")?!1:!!(BRe.indexOf(t)>-1||/[A-Z]/u.test(t))}function VRe(t,e,r,{latestValues:n},i,s=!1){const o=(V3(t)?zRe:IRe)(e,n,i,t),c=ERe(e,typeof t=="string",s),u=t!==b.Fragment?{...c,...o,ref:r}:{},{children:d}=e,f=b.useMemo(()=>bs(d)?d.get():d,[d]);return b.createElement(t,{...u,children:f})}function Gq(t){const e=[{},{}];return t?.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function U3(t,e,r,n){if(typeof e=="function"){const[i,s]=Gq(n);e=e(r!==void 0?r:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Gq(n);e=e(r!==void 0?r:t.custom,i,s)}return e}function xk(t){return bs(t)?t.get():t}function URe({scrapeMotionValuesFromProps:t,createRenderState:e},r,n,i){return{latestValues:GRe(r,n,i,t),renderState:e()}}function GRe(t,e,r,n){const i={},s=n(t,{});for(const h in s)i[h]=xk(s[h]);let{initial:a,animate:o}=t;const c=QE(t),u=Ule(t);e&&u&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),o===void 0&&(o=e.animate));let d=r?r.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!KE(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const y=U3(t,h[m]);if(y){const{transitionEnd:x,transition:v,..._}=y;for(const S in _){let k=_[S];if(Array.isArray(k)){const E=d?k.length-1:0;k=k[E]}k!==null&&(i[S]=k)}for(const S in x)i[S]=x[S]}}}return i}const Kle=t=>(e,r)=>{const n=b.useContext(YE),i=b.useContext(qE),s=()=>URe(t,e,n,i);return r?s():HE(s)};function G3(t,e,r){const{style:n}=t,i={};for(const s in n)(bs(n[s])||e.style&&bs(e.style[s])||Gle(s,t)||r?.getValue(s)?.liveStyle!==void 0)&&(i[s]=n[s]);return i}const WRe=Kle({scrapeMotionValuesFromProps:G3,createRenderState:B3});function Qle(t,e,r){const n=G3(t,e,r);for(const i in t)if(bs(t[i])||bs(e[i])){const s=Ky.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=t[i]}return n}const HRe=Kle({scrapeMotionValuesFromProps:Qle,createRenderState:qle}),qRe=Symbol.for("motionComponentSymbol");function ig(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function YRe(t,e,r){return b.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):ig(r)&&(r.current=n))},[e,r])}const W3=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),KRe="framerAppearId",Zle="data-"+W3(KRe),Xle=b.createContext({});function QRe(t,e,r,n,i){const{visualElement:s}=b.useContext(YE),a=b.useContext(Ble),o=b.useContext(qE),c=b.useContext(L3).reducedMotion,u=b.useRef(null);n=n||a.renderer,!u.current&&n&&(u.current=n(t,{visualState:e,parent:s,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:c}
vendor: 8,748 bytes, line 1113
1113));const d=u.current,f=b.useContext(Xle);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&ZRe(u.current,r,i,f);const h=b.useRef(!1);b.useInsertionEffect(()=>{d&&h.current&&d.update(r,o)});const m=r[Zle],y=b.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return h3(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),y.current&&d.animationState&&d.animationState.animateChanges())}),b.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),y.current=!1),d.enteringChildren=void 0)}),d}function ZRe(t,e,r,n){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:Jle(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&ig(o),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function Jle(t){if(t)return t.options.allowProjection!==!1?t.projection:Jle(t.parent)}function G2(t,{forwardMotionProps:e=!1}={},r,n){r&&kRe(r);const i=V3(t)?HRe:WRe;function s(o,c){let u;const d={...b.useContext(L3),...o,layoutId:XRe(o)},{isStatic:f}=d,h=NRe(o),m=i(o,f);if(!f&&f3){JRe();const y=eIe(d);u=y.MeasureLayout,h.visualElement=QRe(t,m,d,n,y.ProjectionNode)}return l.jsxs(YE.Provider,{value:h,children:[u&&h.visualElement?l.jsx(u,{visualElement:h.visualElement,...d}):null,VRe(t,o,YRe(m,h.visualElement,c),m,f,e)]})}s.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const a=b.forwardRef(s);return a[qRe]=t,a}function XRe({layoutId:t}){const e=b.useContext(d3).id;return e&&t!==void 0?e+"-"+t:t}function JRe(t,e){b.useContext(Ble).strict}function eIe(t){const{drag:e,layout:r}=Vg;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e?.isEnabled(t)||r?.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function tIe(t,e){if(typeof Proxy>"u")return G2;const r=new Map,n=(s,a)=>G2(s,a,t,e),i=(s,a)=>n(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?n:(r.has(a)||r.set(a,G2(a,void 0,t,e)),r.get(a))})}function ece({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function rIe({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function nIe(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function W2(t){return t===void 0||t===1}function eF({scale:t,scaleX:e,scaleY:r}){return!W2(t)||!W2(e)||!W2(r)}function bh(t){return eF(t)||tce(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tce(t){return Wq(t.x)||Wq(t.y)}function Wq(t){return t&&t!=="0%"}function cT(t,e,r){const n=t-r,i=e*n;return r+i}function Hq(t,e,r,n,i){return i!==void 0&&(t=cT(t,i,n)),cT(t,r,n)+e}function tF(t,e=0,r=1,n,i){t.min=Hq(t.min,e,r,n,i),t.max=Hq(t.max,e,r,n,i)}function rce(t,{x:e,y:r}){tF(t.x,e.translate,e.scale,e.originPoint),tF(t.y,r.translate,r.scale,r.originPoint)}const qq=.999999999999,Yq=1.0000000000001;function iIe(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,a;for(let o=0;o<i;o++){s=r[o],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ag(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,rce(t,a)),n&&bh(s.latestValues)&&ag(t,s.latestValues))}e.x<Yq&&e.x>qq&&(e.x=1),e.y<Yq&&e.y>qq&&(e.y=1)}function sg(t,e){t.min=t.min+e,t.max=t.max+e}function Kq(t,e,r,n,i=.5){const s=Cn(t.min,t.max,i);tF(t,e,r,s,n)}function ag(t,e){Kq(t.x,e.x,e.scaleX,e.scale,e.originX),Kq(t.y,e.y,e.scaleY,e.scale,e.originY)}function nce(t,e){return ece(nIe(t.getBoundingClientRect(),e))}function sIe(t,e,r){const n=nce(t,r),{scroll:i}=e;return i&&(sg(n.x,i.offset.x),sg(n.y,i.offset.y)),n}const Qq=()=>({translate:0,scale:1,origin:0,originPoint:0}),og=()=>({x:Qq(),y:Qq()}),Zq=()=>({min:0,max:0}),Wn=()=>({x:Zq(),y:Zq()}),rF={current:null},ice={current:!1};function aIe(){if(ice.current=!0,!!f3)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>rF.current=t.matches;t.addEventListener("change",e),e()}else rF.current=!1}const oIe=new WeakMap;function lIe(t,e,r){for(const n in e){const i=e[n],s=r[n];if(bs(i))t.addValue(n,i);else if(bs(s))t.addValue(n,Bl(i,{owner:t}));else if(s!==i)if(t.hasValue(n)){const a=t.getValue(n);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(n);t.addValue(n,Bl(a!==void 0?a:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const Xq=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class cIe{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=P3,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ia.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Br.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!s,this.isControllingVariants=QE(r),this.isVariantNode=Ule(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(const h in f){const m=f[h];c[h]!==void 0&&bs(m)&&m.set(c[h])}}mount(e){this.current=e,oIe.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),ice.current||aIe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rF.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),fc(this.notifyUpdate),fc(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Qy.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Br.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Vg){const r=Vg[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;
vendor: 4,323 bytes, line 1113
1113for(let n=0;n<Xq.length;n++){const i=Xq[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=e[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=lIe(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(e),()=>r.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=Bl(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(qoe(n)||Koe(n))?n=parseFloat(n):!xRe(n)&&Tf.test(r)&&(n=Ale(e,r)),this.setBaseTarget(e,bs(n)?n.get():n)),bs(n)?n.get():n}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const s=U3(this.props,r,this.presenceContext?.custom);s&&(n=s[e])}if(r&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!bs(i)?i:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new y3),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}scheduleRenderMicrotask(){O3.render(this.render)}}class sce extends cIe{constructor(){super(...arguments),this.KeyframeResolver=JOe}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;bs(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function ace(t,{style:e,vars:r},n,i){const s=t.style;let a;for(a in e)s[a]=e[a];i?.applyProjectionStyles(s,n);for(a in r)s.setProperty(a,r[a])}function uIe(t){return window.getComputedStyle(t)}class dIe extends sce{constructor(){super(...arguments),this.type="html",this.renderInstance=ace}readValueFromInstance(e,r){if(Qy.has(r))return this.projection?.isProjecting?q$(r):xOe(e,r);{const n=uIe(e),i=(w3(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return nce(e,r)}build(e,r,n){z3(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return G3(e,r,n)}}const oce=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function fIe(t,e,r,n){ace(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(oce.has(i)?i:W3(i),e.attrs[i])}class hIe extends sce{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wn}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Qy.has(r)){const n=Mle(r);return n&&n.default||0}return r=oce.has(r)?r:W3(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return Qle(e,r,n)}
vendor: 6,629 bytes, line 1113
1113build(e,r,n){Hle(e,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,r,n,i){fIe(e,r,n,i)}mount(e){this.isSVGTag=Yle(e.tagName),super.mount(e)}}const pIe=(t,e)=>V3(t)?new hIe(e):new dIe(e,{allowProjection:t!==b.Fragment});function xg(t,e,r){const n=t.getProps();return U3(n,e,r!==void 0?r:n.custom,t)}const nF=t=>Array.isArray(t);function mIe(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,Bl(r))}function gIe(t){return nF(t)?t[t.length-1]||0:t}function yIe(t,e){const r=xg(t,e);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const a in s){const o=gIe(s[a]);mIe(t,a,o)}}function vIe(t){return!!(bs(t)&&t.add)}function iF(t,e){const r=t.getValue("willChange");if(vIe(r))return r.add(e);if(!r&&Au.WillChange){const n=new Au.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function lce(t){return t.props[Zle]}const xIe=t=>t!==null;function bIe(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(xIe),s=e&&r!=="loop"&&e%2===1?0:i.length-1;return i[s]}const wIe={type:"spring",stiffness:500,damping:25,restSpeed:10},_Ie=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),SIe={type:"keyframes",duration:.8},kIe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},TIe=(t,{keyframes:e})=>e.length>2?SIe:Qy.has(t)?t.startsWith("scale")?_Ie(e[1]):wIe:kIe;function CIe({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const H3=(t,e,r,n={},i,s)=>a=>{const o=M3(n,t)||{},c=o.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Ql(c);const d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:h=>{e.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:s?void 0:i};CIe(o)||Object.assign(d,TIe(t,d)),d.duration&&(d.duration=Ql(d.duration)),d.repeatDelay&&(d.repeatDelay=Ql(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(X$(d),d.delay===0&&(f=!0)),(Au.instantAnimations||Au.skipAnimations)&&(f=!0,X$(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,f&&!s&&e.get()!==void 0){const h=bIe(d.keyframes,o);if(h!==void 0){Br.update(()=>{d.onUpdate(h),d.onComplete()});return}}return o.isSync?new N3(d):new BOe(d)};function EIe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function cce(t,e,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:a,...o}=e;n&&(s=n);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in o){const f=t.getValue(d,t.latestValues[d]??null),h=o[d];if(h===void 0||u&&EIe(u,d))continue;const m={delay:r,...M3(s||{},d)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===y&&!m.velocity)continue;let x=!1;if(window.MotionHandoffAnimation){const _=lce(t);if(_){const S=window.MotionHandoffAnimation(_,d,Br);S!==null&&(m.startTime=S,x=!0)}}iF(t,d),f.start(H3(d,f,h,t.shouldReduceMotion&&jle.has(d)?{type:!1}:m,t,x));const v=f.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{Br.update(()=>{a&&yIe(t,a)})}),c}function uce(t,e,r,n=0,i=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),a=t.size,o=(a-1)*n;return typeof r=="function"?r(s,a):i===1?s*n:o-s*n}function sF(t,e,r={}){const n=xg(t,e,r.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const s=n?()=>Promise.all(cce(t,n,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return jIe(t,e,c,u,d,f,r)}:()=>Promise.resolve(),{when:o}=i;if(o){const[c,u]=o==="beforeChildren"?[s,a]:[a,s];return c().then(()=>u())}else return Promise.all([s(),a(r.delay)])}function jIe(t,e,r=0,n=0,i=0,s=1,a){const o=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),o.push(sF(c,e,{...a,delay:r+(typeof n=="function"?0:n)+uce(t.variantChildren,c,n,i,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(o)}function NIe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>sF(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=sF(t,e,r);else{const i=typeof e=="function"?xg(t,e,r.custom):e;n=Promise.all(cce(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}function dce(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}const PIe=F3.length;function fce(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?fce(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}const e={};for(let r=0;r<PIe;r++){const n=F3[r],i=t.props[n];(lb(i)||i===!1)&&(e[n]=i)}return e}const MIe=[...$3].reverse(),AIe=$3.length;function DIe(t){return e=>Promise.all(e.map(({animation:r,options:n})=>NIe(t,r,n)))}function OIe(t){let e=DIe(t),r=Jq(),n=!0;const i=c=>(u,d)=>{const f=xg(t,d,c==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:m,...y}=f;u={...u,...y,...m}}return u};function s(c){e=c(t)}function a(c){const{props:u}=t,d=fce(t.parent)||{},f=[],h=new Set;let m={},y=1/0;for(let v=0;v<AIe;v++){const _=MIe[v],S=r[_],k=u[_]!==void 0?u[_]:d[_],E=lb(k),T=_===c?S.isActive:null;T===!1&&(y=v);let N=k===d[_]&&k!==u[_]&&E;if(N&&n&&t.manuallyAnimateOnMount&&(N=!1),S.protectedKeys={...m},!S.isActive&&T===null||!k&&!S.prevProp||KE(k)||typeof k=="boolean")continue;const j=RIe(S.prevProp,k);let M=j||_===c&&S.isActive&&!N&&E||v>y&&E,O=!1;const R=Array.isArray(k)?k:[k];let I=R.reduce(i(_),{});T===!1&&(I={});const{prevResolvedValues:B={}}=S,F={...B,...I},V=z=>{M=!0,h.has(z)&&(O=!0,h.delete(z)),S.needsAnimating[z]=!0;const L=t.getValue(z);L&&(L.liveStyle=!1)};for(const z in F){const L=I[z],W=B[z];if(m.hasOwnProperty(z))continue;let K=!1;nF(L)&&nF(W)?K=!dce(L,W):K=L!==W,K?L!=null?V(z):h.add(z):L!==void 0&&h.has(z)?V(z):S.protectedKeys[z]=!0}S.prevProp=k,S.prevResolvedValues=I,S.isActive&&(m={...m,...I}),n&&t.blockInitialAnimation&&(M=!1);const $=N&&j;M&&(!$||O)&&f.push(...R.map(z=>{const L={type:_};if(typeof z=="string"&&n&&!$&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,K=xg(W,z);if(W.enteringChildren&&K){const{delayChildren:q}=K.transition||{};L.delay=uce(W.enteringChildren,t,q)}}return{animation:z,options:L}}))}if(h.size){const v={};if(typeof u.initial!="boolean"){const _=xg(t,Array.isArray(u.initial)?u.initial[0]:u.initial);_&&_.transition&&(v.transition=_.transition)}
vendor: 5,334 bytes, line 1113
1113h.forEach(_=>{const S=t.getBaseTarget(_),k=t.getValue(_);k&&(k.liveStyle=!0),v[_]=S??null}),f.push({animation:v})}let x=!!f.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(x=!1),n=!1,x?e(f):Promise.resolve()}function o(c,u){if(r[c].isActive===u)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(c,u)),r[c].isActive=u;const d=a(c);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>r,reset:()=>{r=Jq(),n=!0}}}function RIe(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!dce(e,t):!1}function hh(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jq(){return{animate:hh(!0),whileInView:hh(),whileHover:hh(),whileTap:hh(),whileDrag:hh(),whileFocus:hh(),exit:hh()}}class Lf{constructor(e){this.isMounted=!1,this.node=e}update(){}}class IIe extends Lf{constructor(e){super(e),e.animationState||(e.animationState=OIe(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();KE(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let LIe=0;class $Ie extends Lf{constructor(){super(...arguments),this.id=LIe++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>{r(this.id)})}mount(){const{register:e,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const FIe={animation:{Feature:IIe},exit:{Feature:$Ie}};function ub(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function Aw(t){return{point:{x:t.pageX,y:t.pageY}}}const zIe=t=>e=>R3(e)&&t(e,Aw(e));function vx(t,e,r,n){return ub(t,e,zIe(r),n)}const hce=1e-4,BIe=1-hce,VIe=1+hce,pce=.01,UIe=0-pce,GIe=0+pce;function Ls(t){return t.max-t.min}function WIe(t,e,r){return Math.abs(t-e)<=r}function e7(t,e,r,n=.5){t.origin=n,t.originPoint=Cn(e.min,e.max,t.origin),t.scale=Ls(r)/Ls(e),t.translate=Cn(r.min,r.max,t.origin)-t.originPoint,(t.scale>=BIe&&t.scale<=VIe||isNaN(t.scale))&&(t.scale=1),(t.translate>=UIe&&t.translate<=GIe||isNaN(t.translate))&&(t.translate=0)}function xx(t,e,r,n){e7(t.x,e.x,r.x,n?n.originX:void 0),e7(t.y,e.y,r.y,n?n.originY:void 0)}function t7(t,e,r){t.min=r.min+e.min,t.max=t.min+Ls(e)}function HIe(t,e,r){t7(t.x,e.x,r.x),t7(t.y,e.y,r.y)}function r7(t,e,r){t.min=e.min-r.min,t.max=t.min+Ls(e)}function bx(t,e,r){r7(t.x,e.x,r.x),r7(t.y,e.y,r.y)}function lo(t){return[t("x"),t("y")]}const mce=({current:t})=>t?t.ownerDocument.defaultView:null,n7=(t,e)=>Math.abs(t-e);function qIe(t,e){const r=n7(t.x,e.x),n=n7(t.y,e.y);return Math.sqrt(r**2+n**2)}class gce{constructor(e,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=q2(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=qIe(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:x}=h,{timestamp:v}=Di;this.history.push({...x,timestamp:v});const{onStart:_,onMove:S}=this.handlers;m||(_&&_(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=H2(m,this.transformPagePoint),Br.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=q2(h.type==="pointercancel"?this.lastMoveEventInfo:H2(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(h,_),x&&x(h,_)},!R3(e))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=i||window;const o=Aw(e),c=H2(o,this.transformPagePoint),{point:u}=c,{timestamp:d}=Di;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=r;f&&f(e,q2(c,this.history)),this.removeListeners=Nw(vx(this.contextWindow,"pointermove",this.handlePointerMove),vx(this.contextWindow,"pointerup",this.handlePointerUp),vx(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),fc(this.updatePoint)}}function H2(t,e){return e?{point:e(t.point)}:t}function i7(t,e){return{x:t.x-e.x,y:t.y-e.y}}function q2({point:t},e){return{point:t,delta:i7(t,yce(e)),offset:i7(t,YIe(e)),velocity:KIe(e,.1)}}function YIe(t){return t[0]}function yce(t){return t[t.length-1]}function KIe(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=yce(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Ql(e)));)r--;if(!n)return{x:0,y:0};const s=Zl(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-n.x)/s,y:(i.y-n.y)/s}
vendor: 4,620 bytes, line 1113
1113;return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function QIe(t,{min:e,max:r},n){return e!==void 0&&t<e?t=n?Cn(e,t,n.min):Math.max(t,e):r!==void 0&&t>r&&(t=n?Cn(r,t,n.max):Math.min(t,r)),t}function s7(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function ZIe(t,{top:e,left:r,bottom:n,right:i}){return{x:s7(t.x,r,i),y:s7(t.y,e,n)}}function a7(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([r,n]=[n,r]),{min:r,max:n}}function XIe(t,e){return{x:a7(t.x,e.x),y:a7(t.y,e.y)}}function JIe(t,e){let r=.5;const n=Ls(t),i=Ls(e);return i>n?r=Bg(e.min,e.max-n,t.min):n>i&&(r=Bg(t.min,t.max-i,e.min)),dc(0,1,r)}function eLe(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const aF=.35;function tLe(t=aF){return t===!1?t=0:t===!0&&(t=aF),{x:o7(t,"left","right"),y:o7(t,"top","bottom")}}function o7(t,e,r){return{min:l7(t,e),max:l7(t,r)}}function l7(t,e){return typeof t=="number"?t:t[e]||0}const rLe=new WeakMap;class nLe{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Aw(f).point)},a=(f,h)=>{const{drag:m,dragPropagation:y,onDragStart:x}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rRe(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lo(_=>{let S=this.getAxisMotionValue(_).get()||0;if(Xl.test(S)){const{projection:k}=this.visualElement;if(k&&k.layout){const E=k.layout.layoutBox[_];E&&(S=Ls(E)*(parseFloat(S)/100))}}this.originPoint[_]=S}),x&&Br.postRender(()=>x(f,h)),iF(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:x,onDrag:v}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:_}=h;if(y&&this.currentDirection===null){this.currentDirection=iLe(_),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",h.point,_),this.updateAxis("y",h.point,_),this.visualElement.render(),v&&v(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>lo(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:d}=this.getProps();this.panSession=new gce(e,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:mce(this.visualElement)})}stop(e,r){const n=e||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&Br.postRender(()=>o(n,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!G_(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=QIe(a,this.constraints[e],this.elastic[e])),s.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&ig(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=ZIe(n.layoutBox,e):this.constraints=!1,this.elastic=tLe(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&lo(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=eLe(n.layoutBox[s],this.constraints[s])
vendor: 10,090 bytes, line 1113
1113)})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!ig(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=sIe(n,i.root,this.visualElement.getTransformPagePoint());let a=XIe(i.layout.layoutBox,s);if(r){const o=r(rIe(a));this.hasMutatedConstraints=!!o,o&&(a=ece(o))}return a}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=lo(d=>{if(!G_(d,r,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:n?e[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(o)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return iF(this.visualElement,e),n.start(H3(e,n,0,r,this.visualElement,!1))}stopAnimation(){lo(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){lo(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lo(r=>{const{drag:n}=this.getProps();if(!G_(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[r];s.set(e[r]-Cn(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!ig(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};lo(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const c=o.get();i[a]=JIe({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),lo(a=>{if(!G_(a,e,null))return;const o=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];o.set(Cn(c,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;rLe.set(this.visualElement,this);const e=this.visualElement.current,r=vx(e,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();ig(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Br.read(n);const a=ub(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(lo(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())}));return()=>{a(),r(),s(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=aF,dragMomentum:o=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function G_(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function iLe(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class sLe extends Lf{constructor(e){super(e),this.removeGroupControls=oa,this.removeListeners=oa,this.controls=new nLe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||oa}unmount(){this.removeGroupControls(),this.removeListeners()}}const c7=t=>(e,r)=>{t&&Br.postRender(()=>t(e,r))};class aLe extends Lf{constructor(){super(...arguments),this.removePointerDownListener=oa}onPointerDown(e){this.session=new gce(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:mce(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:c7(e),onStart:c7(r),onMove:n,onEnd:(s,a)=>{delete this.session,i&&Br.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=vx(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const bk={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function u7(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const uv={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Lt.test(t))t=parseFloat(t);else return t;const r=u7(t,e.target.x),n=u7(t,e.target.y);return`${r}% ${n}%`}},oLe={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=Tf.parse(t);if(i.length>5)return n;const s=Tf.createTransformer(t),a=typeof i[0]!="number"?1:0,o=r.x.scale*e.x,c=r.y.scale*e.y;i[0+a]/=o,i[1+a]/=c;const u=Cn(o,c,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}};let Y2=!1;class lLe extends b.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;PRe(cLe),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),Y2&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),bk.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,{projection:a}=n;return a&&(a.isPresent=s,Y2=!0,i||e.layoutDependency!==r||r===void 0||e.isPresent!==s?a.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?a.promote():a.relegate()||Br.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),O3.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;Y2=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vce(t){const[e,r]=zle(),n=b.useContext(d3);return l.jsx(lLe,{...t,layoutGroup:n,switchLayoutGroup:b.useContext(Xle),isPresent:e,safeToRemove:r})}const cLe={borderRadius:{...uv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uv,borderTopRightRadius:uv,borderBottomLeftRadius:uv,borderBottomRightRadius:uv,boxShadow:oLe};function uLe(t,e,r){const n=bs(t)?t:Bl(t);return n.start(H3("",n,e,r)),n.animation}const dLe=(t,e)=>t.depth-e.depth;class fLe{constructor(){this.children=[],this.isDirty=!1}add(e){p3(this.children,e),this.isDirty=!0}remove(e){m3(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(dLe),this.isDirty=!1,this.children.forEach(e)}}function hLe(t,e){const r=ia.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(fc(n),t(s-e))};return Br.setup(n,!0),()=>fc(n)}const xce=["TopLeft","TopRight","BottomLeft","BottomRight"],pLe=xce.length,d7=t=>typeof t=="string"?parseFloat(t):t,f7=t=>typeof t=="number"||Lt.test(t);function mLe(t,e,r,n,i,s){i?(t.opacity=Cn(0,r.opacity??1,gLe(n)),t.opacityExit=Cn(e.opacity??1,0,yLe(n))):s&&(t.opacity=Cn(e.opacity??1,r.opacity??1,n));for(let a=0;a<pLe;a++){const o=`border${xce[a]}Radius`;let c=h7(e,o),u=h7(r,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||f7(c)===f7(u)?(t[o]=Math.max(Cn(d7(c),d7(u),n),0),(Xl.test(u)||Xl.test(c))&&(t[o]+="%")):t[o]=u}(e.rotate||r.rotate)&&(t.rotate=Cn(e.rotate||0,r.rotate||0,n))}function h7(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const gLe=bce(0,.5,rle),yLe=bce(.5,.95,oa);function bce(t,e,r){return n=>n<t?0:n>e?1:r(Bg(t,e,n))}function p7(t,e){t.min=e.min,t.max=e.max}function eo(t,e){p7(t.x,e.x),p7(t.y,e.y)}function m7(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function g7(t,e,r,n,i){return t-=e,t=cT(t,1/r,n),i!==void 0&&(t=cT(t,1/i,n)),t}function vLe(t,e=0,r=1,n=.5,i,s=t,a=t){if(Xl.test(e)&&(e=parseFloat(e),e=Cn(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=Cn(s.min,s.max,n);t===s&&(o-=e),t.min=g7(t.min,e,r,o,i),t.max=g7(t.max,e,r,o,i)}function y7(t,e,[r,n,i],s,a){vLe(t,e[r],e[n],e[i],e.scale,s,a)}const xLe=["x","scaleX","originX"],bLe=["y","scaleY","originY"];function v7(t,e,r,n){y7(t.x,e,xLe,r?r.x:void 0,n?n.x:void 0),y7(t.y,e,bLe,r?r.y:void 0,n?n.y:void 0)}function x7(t){return t.translate===0&&t.scale===1}function wce(t){return x7(t.x)&&x7(t.y)}function b7(t,e){return t.min===e.min&&t.max===e.max}function wLe(t,e){return b7(t.x,e.x)&&b7(t.y,e.y)}function w7(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _ce(t,e){return w7(t.x,e.x)&&w7(t.y,e.y)}function _7(t){return Ls(t.x)/Ls(t.y)}function S7(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class _Le{constructor(){this.members=[]}add(e){p3(this.members,e),e.scheduleRender()}remove(e){if(m3(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}
vendor: 7,803 bytes, line 1113
1113exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function SLe(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y,a=r?.z||0;if((i||s||a)&&(n=`translate3d(${i}px, ${s}px, ${a}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:y}=r;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),f&&(n+=`rotateX(${f}deg) `),h&&(n+=`rotateY(${h}deg) `),m&&(n+=`skewX(${m}deg) `),y&&(n+=`skewY(${y}deg) `)}const o=t.x.scale*e.x,c=t.y.scale*e.y;return(o!==1||c!==1)&&(n+=`scale(${o}, ${c})`),n||"none"}const K2=["","X","Y","Z"],kLe=1e3;let TLe=0;function Q2(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function Sce(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=lce(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Br,!(i||s))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&Sce(n)}function kce({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(a={},o=e?.()){this.id=TLe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jLe),this.nodes.forEach(ALe),this.nodes.forEach(DLe),this.nodes.forEach(NLe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new fLe)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new y3),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const c=this.eventHandlers.get(a);c&&c.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=I3(a)&&!yRe(a),this.instance=a;const{layoutId:o,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||o)&&(this.isLayoutDirty=!0),t){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;Br.read(()=>{f=window.innerWidth}),t(a,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=hLe(h,250),bk.hasAnimatedSinceResize&&(bk.hasAnimatedSinceResize=!1,this.nodes.forEach(C7)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||$Le,{onLayoutAnimationStart:x,onLayoutAnimationComplete:v}=u.getProps(),_=!this.targetLayout||!_ce(this.targetLayout,m),S=!f&&h;if(this.options.layoutRoot||this.resumeFrom||S||f&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...M3(y,"layout"),onPlay:x,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(d,S)}else f||C7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(OLe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sce(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(k7);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(T7);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(MLe),this.nodes.forEach(CLe),this.nodes.forEach(ELe)):this.nodes.forEach(T7),this.clearAllSnapshots();const o=ia.now();Di.delta=dc(0,1e3/60,o-Di.timestamp),Di.timestamp=o,Di.isProcessing=!0,$2.update.process(Di),$2.preRender.process(Di),$2.render.process(Di),Di.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,O3.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PLe),this.sharedNodes.forEach(RLe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Br.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Br.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ls(this.snapshot.measuredBox.x)&&!Ls(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Wn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const c=n(this.instance);
vendor: 4,810 bytes, line 1113
1113this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!wce(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||bh(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return a&&(c=this.removeTransform(c)),FLe(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return Wn();const o=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zLe))){const{scroll:u}=this.root;u&&(sg(o.x,u.offset.x),sg(o.y,u.offset.y))}return o}removeElementScroll(a){const o=Wn();if(eo(o,a),this.scroll?.wasRoot)return o;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&eo(o,a),sg(o.x,d.offset.x),sg(o.y,d.offset.y))}return o}applyTransform(a,o=!1){const c=Wn();eo(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&ag(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),bh(d.latestValues)&&ag(c,d.latestValues)}return bh(this.latestValues)&&ag(c,this.latestValues),c}removeTransform(a){const o=Wn();eo(o,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!bh(u.latestValues))continue;eF(u.latestValues)&&u.updateSnapshot();const d=Wn(),f=u.measurePageBox();eo(d,f),v7(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return bh(this.latestValues)&&v7(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Di.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==o;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Di.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wn(),this.relativeTargetOrigin=Wn(),bx(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),eo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Wn(),this.targetWithTransforms=Wn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),HIe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):eo(this.target,this.layout.layoutBox),rce(this.target,this.targetDelta)):eo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wn(),this.relativeTargetOrigin=Wn(),bx(this.relativeTargetOrigin,this.target,h.target),eo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||eF(this.parent.latestValues)||tce(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const a=this.getLead(),o=!!this.resumingFrom||this!==a;let c=!0;
vendor: 8,687 bytes, line 1113
1113if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Di.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;eo(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;iIe(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Wn());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(m7(this.prevProjectionDelta.x,this.projectionDelta.x),m7(this.prevProjectionDelta.y,this.projectionDelta.y)),xx(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!S7(this.projectionDelta.x,this.prevProjectionDelta.x)||!S7(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=og(),this.projectionDelta=og(),this.projectionDeltaWithTransform=og()}setAnimationOrigin(a,o=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=og();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const h=Wn(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,v=this.getStack(),_=!v||v.members.length<=1,S=!!(x&&!_&&this.options.crossfade===!0&&!this.path.some(LLe));this.animationProgress=0;let k;this.mixTargetDelta=E=>{const T=E/1e3;E7(f.x,a.x,T),E7(f.y,a.y,T),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bx(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ILe(this.relativeTarget,this.relativeTargetOrigin,h,T),k&&wLe(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Wn()),eo(k,this.relativeTarget)),x&&(this.animationValues=d,mLe(d,u,this.latestValues,T,S,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(fc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Br.update(()=>{bk.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bl(0)),this.currentAnimation=uLe(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(kLe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=a;if(!(!o||!c||!u)){if(this!==a&&this.layout&&u&&Tce(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Wn();const f=Ls(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=Ls(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}eo(o,c),ag(o,d),xx(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new _Le),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&Q2("z",a,u,this.animationValues);for(let d=0;d<K2.length;d++)Q2(`rotate${K2[d]}`,a,u,this.animationValues),Q2(`skew${K2[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=xk(o?.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=xk(o?.pointerEvents)||""),this.hasProjected&&!bh(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=SLe(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),a.transform=f;const{x:h,y:m}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const y in cb){if(d[y]===void 0)continue;const{correct:x,applyTo:v,isCSSVariable:_}=cb[y],S=f==="none"?d[y]:x(d[y],u);if(v){const k=v.length;for(let E=0;E<k;E++)a[v[E]]=S}else _?this.options.visualElement.renderState.vars[y]=S:a[y]=S}this.options.layoutId&&(a.pointerEvents=u===this?xk(o?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(k7),this.root.sharedNodes.clear()}}}function CLe(t){t.updateLayout()}function ELe(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:n}=t.layout,{animationType:i}=t.options,s=e.source!==t.layout.source;i==="size"?lo(d=>{const f=s?e.measuredBox[d]:e.layoutBox[d],h=Ls(f);f.min=r[d].min,f.max=f.min+h}):Tce(i,e.layoutBox,r)&&lo(d=>{const f=s?e.measuredBox[d]:e.layoutBox[d],h=Ls(r[d]);f.max=f.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+h)});const a=og();xx(a,r,e.layoutBox);const o=og();s?xx(o,t.applyTransform(n,!0),e.measuredBox):xx(o,r,e.layoutBox);const c=!wce(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=Wn();bx(m,e.layoutBox,f.layoutBox);const y=Wn();bx(y,r,h.layoutBox),_ce(m,y)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:o,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function jLe(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
vendor: 5,514 bytes, line 1113
1113isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function NLe(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function PLe(t){t.clearSnapshot()}function k7(t){t.clearMeasurements()}function T7(t){t.isLayoutDirty=!1}function MLe(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function C7(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ALe(t){t.resolveTargetDelta()}function DLe(t){t.calcProjection()}function OLe(t){t.resetSkewAndRotation()}function RLe(t){t.removeLeadSnapshot()}function E7(t,e,r){t.translate=Cn(e.translate,0,r),t.scale=Cn(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function j7(t,e,r,n){t.min=Cn(e.min,r.min,n),t.max=Cn(e.max,r.max,n)}function ILe(t,e,r,n){j7(t.x,e.x,r.x,n),j7(t.y,e.y,r.y,n)}function LLe(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $Le={duration:.45,ease:[.4,0,.1,1]},N7=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),P7=N7("applewebkit/")&&!N7("chrome/")?Math.round:oa;function M7(t){t.min=P7(t.min),t.max=P7(t.max)}function FLe(t){M7(t.x),M7(t.y)}function Tce(t,e,r){return t==="position"||t==="preserve-aspect"&&!WIe(_7(e),_7(r),.2)}function zLe(t){return t!==t.root&&t.scroll?.wasRoot}const BLe=kce({attachResizeListener:(t,e)=>ub(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Z2={current:void 0},Cce=kce({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Z2.current){const t=new BLe({});t.mount(window),t.setOptions({layoutScroll:!0}),Z2.current=t}return Z2.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),VLe={pan:{Feature:aLe},drag:{Feature:sLe,ProjectionNode:Cce,MeasureLayout:vce}};function A7(t,e,r){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,s=n[i];s&&Br.postRender(()=>s(e,Aw(e)))}class ULe extends Lf{mount(){const{current:e}=this.node;e&&(this.unmount=nRe(e,(r,n)=>(A7(this.node,n,"Start"),i=>A7(this.node,i,"End"))))}unmount(){}}class GLe extends Lf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Nw(ub(this.node.current,"focus",()=>this.onFocus()),ub(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function D7(t,e,r){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),s=n[i];s&&Br.postRender(()=>s(e,Aw(e)))}class WLe extends Lf{mount(){const{current:e}=this.node;e&&(this.unmount=oRe(e,(r,n)=>(D7(this.node,n,"Start"),(i,{success:s})=>D7(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const oF=new WeakMap,X2=new WeakMap,HLe=t=>{const e=oF.get(t.target);e&&e(t)},qLe=t=>{t.forEach(HLe)};function YLe({root:t,...e}){const r=t||document;X2.has(r)||X2.set(r,{});const n=X2.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(qLe,{root:t,...e})),n[i]}function KLe(t,e,r){const n=YLe(e);return oF.set(t,r),n.observe(t),()=>{oF.delete(t),n.unobserve(t)}}const QLe={some:0,all:1};class ZLe extends Lf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,a={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:QLe[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return KLe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(XLe(e,r))&&this.startObserver()}unmount(){}}function XLe({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const JLe={inView:{Feature:ZLe},tap:{Feature:WLe},focus:{Feature:GLe},hover:{Feature:ULe}},e$e={layout:{ProjectionNode:Cce,MeasureLayout:vce}},t$e={...FIe,...JLe,...VLe,...e$e},ct=tIe(t$e,pIe);function r$e(t,e,r){b.useInsertionEffect(()=>t.on(e,r),[t,e,r])}const n$e=50,O7=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),i$e=()=>({time:0,x:O7(),y:O7()}),s$e={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function R7(t,e,r,n){const i=r[e],{length:s,position:a}=s$e[e],o=i.current,c=r.time;i.current=t[`scroll${a}`],i.scrollLength=t[`scroll${s}`]-t[`client${s}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=Bg(0,i.scrollLength,i.current);const u=n-c;
1113i.velocity=u>n$e?0:v3(i.current-o,u)}function a$e(t,e,r){R7(t,"x",e,r),R7(t,"y",e,r),e.time=r}function o$e(t,e){const r={x:0,y:0};let n=t;for(;n&&n!==e;)if(D3(n))r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;else if(n.tagName==="svg"){const i=n.getBoundingClientRect();n=n.parentElement;const s=n.getBoundingClientRect();r.x+=i.left-s.left,r.y+=i.top-s.top}else if(n instanceof SVGGraphicsElement){const{x:i,y:s}=n.getBBox();r.x+=i,r.y+=s;let a=null,o=n.parentNode;for(;!a;)o.tagName==="svg"&&(a=o),o=n.parentNode;n=a}else break;return r}const lF={start:0,center:.5,end:1};function I7(t,e,r=0){let n=0;if(t in lF&&(t=lF[t]),typeof t=="string"){const i=parseFloat(t);t.endsWith("px")?n=i:t.endsWith("%")?t=i/100:t.endsWith("vw")?n=i/100*document.documentElement.clientWidth:t.endsWith("vh")?n=i/100*document.documentElement.clientHeight:t=i}return typeof t=="number"&&(n=e*t),r+n}const l$e=[0,0];function c$e(t,e,r,n){let i=Array.isArray(t)?t:l$e,s=0,a=0;return typeof t=="number"?i=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?i=t.split(" "):i=[t,lF[t]?t:"0"]),s=I7(i[0],r,n),a=I7(i[1],e),s-a}const u$e={All:[[0,0],[1,1]]},d$e={x:0,y:0};function f$e(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function h$e(t,e,r){const{offset:n=u$e.All}=r,{target:i=t,axis:s="y"}=r,a=s==="y"?"height":"width",o=i!==t?o$e(i,t):d$e,c=i===t?{width:t.scrollWidth,height:t.scrollHeight}:f$e(i),u={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let d=!e[s].interpolate;const f=n.length;for(let h=0;h<f;h++){const m=c$e(n[h],u[a],c[a],o[s]);!d&&m!==e[s].interpolatorOffsets[h]&&(d=!0),e[s].offset[h]=m}d&&(e[s].interpolate=yle(e[s].offset,vle(n),{clamp:!1}),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=dc(0,1,e[s].interpolate(e[s].current))}function p$e(t,e=t,r){if(r.x.targetOffset=0,r.y.targetOffset=0,e!==t){let n=e;for(;n&&n!==t;)r.x.targetOffset+=n.offsetLeft,r.y.targetOffset+=n.offsetTop,n=n.offsetParent}r.x.targetLength=e===t?e.scrollWidth:e.clientWidth,r.y.targetLength=e===t?e.scrollHeight:e.clientHeight,r.x.containerLength=t.clientWidth,r.y.containerLength=t.clientHeight}function m$e(t,e,r,n={}){return{measure:i=>{p$e(t,n.target,r),a$e(t,r,i),(n.offset||n.target)&&h$e(t,r,n)},notify:()=>e(r)}}const dv=new WeakMap,L7=new WeakMap,J2=new WeakMap,$7=t=>t===document.scrollingElement?window:t;function Ece(t,{container:e=document.scrollingElement,...r}={}){if(!e)return oa;let n=J2.get(e);n||(n=new Set,J2.set(e,n));const i=i$e(),s=m$e(e,t,i,r);if(n.add(s),!dv.has(e)){const o=()=>{for(const f of n)f.measure(Di.timestamp);Br.preUpdate(c)},c=()=>{for(const f of n)f.notify()},u=()=>Br.read(o);dv.set(e,u);const d=$7(e);window.addEventListener("resize",u,{passive:!0}),e!==document.documentElement&&L7.set(e,gRe(e,u)),d.addEventListener("scroll",u,{passive:!0}),u()}const a=dv.get(e);return Br.read(a,!1,!0),()=>{fc(a);const o=J2.get(e);if(!o||(o.delete(s),o.size))return;const c=dv.get(e);dv.delete(e),c&&($7(e).removeEventListener("scroll",c),L7.get(e)?.(),window.removeEventListener("resize",c))}}const F7=new Map;function g$e(t){const e={value:0},r=Ece(n=>{e.value=n[t.axis].progress*100},t);return{currentTime:e,cancel:r}}function jce({source:t,container:e,...r}){const{axis:n}=r;t&&(e=t);const i=F7.get(e)??new Map;F7.set(e,i);const s=r.target??"self",a=i.get(s)??{},o=n+(r.offset??[]).join(",");return a[o]||(a[o]=!r.target&&_le()?new ScrollTimeline({source:e,axis:n}):g$e({container:e,...r})),a[o]}function y$e(t,e){const r=jce(e);return t.attachTimeline({timeline:e.target?void 0:r,observe:n=>(n.pause(),Fle(i=>{n.time=n.duration*i},r))})}function v$e(t){return t.length===2}function x$e(t,e){return v$e(t)?Ece(r=>
1113{t(r[e.axis].progress,r)},e):Fle(t,jce(e))}function b$e(t,{axis:e="y",container:r=document.scrollingElement,...n}={}){if(!r)return oa;const i={axis:e,container:r,...n};return typeof t=="function"?x$e(t,i):y$e(t,i)}const w$e=()=>({scrollX:Bl(0),scrollY:Bl(0),scrollXProgress:Bl(0),scrollYProgress:Bl(0)}),W_=t=>t?!t.current:!1;function _$e({container:t,target:e,...r}={}){const n=HE(w$e),i=b.useRef(null),s=b.useRef(!1),a=b.useCallback(()=>(i.current=b$e((o,{x:c,y:u})=>{n.scrollX.set(c.current),n.scrollXProgress.set(c.progress),n.scrollY.set(u.current),n.scrollYProgress.set(u.progress)},{...r,container:t?.current||void 0,target:e?.current||void 0}),()=>{i.current?.()}),[t,e,JSON.stringify(r.offset)]);return h3(()=>{if(s.current=!1,W_(t)||W_(e)){s.current=!0;return}else return a()},[a]),b.useEffect(()=>{if(s.current)return sb(!W_(t)),sb(!W_(e)),a()},[a]),n}const Nce=[{title:"Getting Started",items:[{label:"Home",to:"/docs",icon:l.jsx(FE,{className:"size-4"})},{label:"Terms",to:"/docs/terms-of-use",icon:l.jsx(e3,{className:"size-4"})},{label:"Privacy",to:"/docs/privacy-policy",icon:l.jsx(xs,{className:"size-4"})}]},{title:"Import trades",items:[{label:"Think Or Swim",to:"/docs/import-thinkorswim",icon:l.jsx(dp,{className:"size-4"})},{label:"DAS Trader",to:"/docs/import-das-trader",icon:l.jsx(dp,{className:"size-4"})}]},{title:"Subscription",items:[{label:"Cancel",to:"/docs/cancel-subscription",icon:l.jsx(Tw,{className:"size-4"})}]},{title:"Contact Support",items:[{label:"Report bug",to:"/docs/report-bug",icon:l.jsx(MPe,{className:"size-4"})},{label:"Contact",to:"/docs/contact-support",icon:l.jsx(foe,{className:"size-4"})},{label:"Common Issues & FAQs",to:"/docs/common-issues",icon:l.jsx(i3,{className:"size-4"})}]}],S$e=({label:t,to:e,icon:r,className:n="",onClick:i})=>{const a=ns().pathname===e;return l.jsxs(At,{to:e,className:ee("group flex items-center gap-3 py-2 px-3 rounded-lg","text-sm font-light tracking-wide","transition-all duration-300 ease-out border-l-2 ",a?"text-app-border-color-accent bg-app-primary-foreground/ border-app-border-color-accent":"text-app-primary-foreground/70 hover:text-app-primary-foreground hover:bg-app-primary-foreground/5 border-app-primary/0",n),onClick:i,children:[r&&l.jsx("span",{className:ee("transition-colors duration-200",a?"text-app-border-color-accent":"text-gray-400 group-hover:text-app-primary-foreground"),children:typeof r=="object"&&r&&"type"in r?l.jsx(r.type,{...r.props,className:ee(r.props.className,"2k:size-7")}):r}),l.jsx("span",{className:"2k:text-4xl",children:t})]})},Pce=({title:t,items:e,className:r="",onItemClick:n})=>l.jsxs("section",{className:ee("flex flex-col items-start justify-center gap-2",r),children:[l.jsx("h4",{className:"text-xs uppercase tracking-widest 2k:text-3xl",children:t}),l.jsx("nav",{className:"flex flex-col gap-1 w-full",children:e.map(i=>l.jsx(S$e,{...i,onClick:n},i.to))})]}),k$e=()=>{const[t,e]=b.useState(!1),r=()=>e(!t),n=()=>e(!1);return l.jsxs("div",{className:"lg:hidden",children:[l.jsx("button",{onClick:r,className:"p-2 rounded-lg bg-app-primary-foreground/10 backdrop-blur-xs border border-app-primary-foreground/20 transition-colors duration-200 ease-out hover:bg-app-primary-foreground/20","aria-label":"Toggle documentation menu",children:l.jsx(ct.div,{initial:!1,animate:{rotate:t?180:0},transition:{duration:.2,ease:"easeOut"},children:t?l.jsx(pi,{className:"size-5 text-app-primary-foreground"}):l.jsx(s3,{className:"size-5 text-app-primary-foreground"})})}),l.jsx(Ss,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(ct.div,{initial:{opacity:0}
1113,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:"easeOut"},className:"fixed inset-0 bg-black/50 backdrop-blur-xs z-40",onClick:n}),l.jsxs(ct.div,{initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.2,ease:"easeOut",type:"spring",stiffness:300,damping:30},className:"fixed top-20 left-20 z-50 w-72 max-h-[80vh] overflow-y-auto bg-app-primary border border-app-primary-foreground/20 rounded-2xl px-6 pb-8 pt-6",children:[l.jsx(ct.button,{onClick:n,className:"p-1 rounded-md hover:bg-app-primary-foreground/10 transition-colors duration-200 ease-out absolute top-6 right-6","aria-label":"Close menu",whileHover:{scale:1.1},whileTap:{scale:.95},children:l.jsx(pi,{className:"size-4 text-app-primary-foreground"})}),l.jsx(ct.div,{className:"space-y-6",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1,duration:.2,ease:"easeOut"},children:Nce.map((i,s)=>l.jsx(ct.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.15+s*.05,duration:.3,ease:"easeOut"},children:l.jsx(Pce,{title:i.title,items:i.items,className:"w-full",onItemClick:n})},i.title))})]})]})})]})},T$e=()=>l.jsx("div",{className:"w-50 flex-col gap-2 items-start justify-center sticky top-24 hidden lg:flex 2k:w-96",children:Nce.map(t=>l.jsx(Pce,{title:t.title,items:t.items,className:"w-full"},t.title))}),C$e=()=>{const{scrollY:t}=_$e(),[e,r]=b.useState(!1);r$e(t,"change",i=>{const s=t.getPrevious();i>s&&i>150?r(!0):r(!1)});const n=()=>{const i=document.querySelector("[data-docs-outlet]"),s=96;if(i instanceof HTMLElement){const a=i.getBoundingClientRect(),o=window.scrollY+a.top-s;window.scrollTo({top:o,left:0,behavior:"smooth"})}else window.scrollTo({top:0,left:0,behavior:"smooth"})};return l.jsx(ct.div,{initial:{opacity:0}
1113,variants:{visible:{opacity:0},hidden:{opacity:1}},animate:e?"hidden":"visible",transition:{duration:.35,ease:"easeInOut",type:"spring"},onClick:n,className:Pe("fixed bottom-6 left-1/2 -translate-x-1/2 z-50 h-10 w-10 cursor-pointer place-items-center p-2 text-2xl text-app-primary-foreground transition-all duration-200 bg-app-input-bg hover:bg-app-button-bg-active border border-app-border-color-soft rounded-xl",!e&&"pointer-events-none"),"aria-label":"Scroll to top of documentation",children:l.jsx(J4,{className:"size-5"})})},Zy=P.memo(({mainCircleSize:t=210,mainCircleOpacity:e=.24,numCircles:r=8,className:n,...i})=>l.jsx("div",{className:ee("pointer-events-none absolute inset-0 select-none mask-[linear-gradient(to_bottom,white,transparent)]",n),...i,children:Array.from({length:r},(s,a)=>{const o=t+a*70,c=e-a*.03,u=`${a*.06}s`;return l.jsx("div",{className:"absolute animate-ripple rounded-full border bg-app-primary-foreground/25 shadow-xl",style:{"--i":a,width:`${o}px`,height:`${o}px`,opacity:c,animationDelay:u,borderStyle:"solid",borderWidth:"1px",borderColor:"var(--app-primary-foreground)",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)"}},a)})}));Zy.displayName="Ripple";const E$e=()=>{const t=ns(),e=b.useCallback(()=>gDe(t.pathname),[t.pathname]);return P.useEffect(()=>{const r=document.querySelector("[data-docs-outlet]"),n=96;if(r instanceof HTMLElement){const i=r.getBoundingClientRect();window.scrollTo({top:window.scrollY+i.top-n,left:0,behavior:"auto"})}else window.scrollTo({top:0,left:0,behavior:"auto"})},[t.pathname]),l.jsxs("article",{className:"min-h-screen prose-xl bg-app-primary text-app-primary-foreground prose-img:rounded-2xl prose-p:leading-relaxed prose-h1:text-3xl prose-h1:font-medium pt-32 relative",children:[l.jsx(C$e,{}),l.jsxs("section",{className:"flex flex-col items-center justify-center mx-auto py-40 text-center relative overflow-visible overflow-x-hidden",children:[l.jsx(Zy,{numCircles:5}),l.jsx("h1",{className:"my-0 text-5xl! font-medium 2k:text-6xl!",children:"Help Center"}),l.jsx("p",{className:"text-app-primary-foreground/80 text-lg! font-light max-w-xs lg:max-w-xl leading-relaxed 2k:text-3xl!",children:"Explore comprehensive guides and resources for Merciless Tracker. Learn how to import trades, manage your account, and get the most out of our AI-powered trading journal."})]}),l.jsxs("section",{"data-docs-outlet":!0,className:"px-6 pb-16 mx-auto flex flex-col lg:flex-row items-start justify-center gap-8 lg:gap-28 relative",children:[l.jsx(k$e,{}),l.jsx(T$e,{}),l.jsx("div",{className:"w-full lg:max-w-[720px] lg:w-auto mt-2 flex items-center justify-center",children:l.jsx(Y4,{})}),l.jsx(vDe,{sections:e()})]})]})},j$e=Rf("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-primary-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-app-button-bg text-primary-foreground",destructive:"border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500"}},defaultVariants:{variant:"default"}}),wo=b.forwardRef(({className:t,variant:e,...r},n)=>l.jsx("div",{ref:n,role:"alert",className:ee(j$e({variant:e}),t),...r}));wo.displayName="Alert";const Dw=b.forwardRef(({className:t,...e},r)=>l.jsx("h5",{ref:r,className:ee("mb-1",t),...e}));Dw.displayName="AlertTitle";const _o=b.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,className:ee("text-sm [&_p]:leading-relaxed",t),...e}));_o.displayName="AlertDescription";const N$e=Rf("relative w-full rounded-2xl border px-4 py-3 text-sm font-normal",{variants:{variant:{info:"bg-blue-500/10 border-blue-500/20 text-blue-200 [&>svg]:text-blue-400",warning:"bg-yellow-500/10 border-yellow-500/20 text-yellow-100 [&>svg]:text-yellow-400",error:"bg-red-500/10 border-red-500/20 text-red-100 [&>svg]:text-red-400",success:"bg-green-500/10 border-green-500/20 text-green-100 [&>svg]:text-green-400",default:"bg-app-card/40 border-app-border-color-soft text-app-primary-foreground [&>svg]:text-app-primary-foreground/70"}},defaultVariants:{variant:"default"}}),P$e={info:doe,warning:Wu,error:Tw,success:ei,default:null};function eA({variant:t="default",title:e,children:r,showIcon:n=!0,className:i,...s}){const a=P$e[t];return l.jsxs(wo,{className:ee(N$e({variant:t}),i),...s,children:[n&&a&&l.jsx(a,{size:20,strokeWidth:1.5}),e&&l.jsx(Dw,{children:e}),r&&l.jsx(_o,{children:r})]})}function Rh({align:t="center",className:e,...r}){const n=t==="left"?"justify-start":t==="right"?"justify-end":"justify-center";return l.jsx("figure",{className:ee("m-0 my-6 flex flex-col items-center justify-center p-3 bg-linear-to-b from-app-input-bg to-app-card/10 rounded-3xl border border-app-border-color-soft",n),children:l.jsx("img",{className:ee("max-w-full rounded-xl shadow-xs",e),alt:r.alt,...r})})}function Zt({children:t,className:e}){return l.jsx("code",{className:ee("inline-flex items-center rounded-md bg-app-input-bg px-1.5 py-[2px] mx-1 font-mono text-[0.85em] text-app-primary-foreground
1113/80 whitespace-nowrap",e),children:t})}function hs({href:t,children:e,external:r,className:n,...i}){const s=r?{target:"_blank",rel:"noopener noreferrer","aria-label":`${e} (opens in new tab)`}:{};return l.jsxs("a",{href:t,className:ee("inline-flex items-center text-app-primary-foreground hover:text-app-primary-foreground/80 underline underline-offset-4 transition-all duration-300 focus:outline-hidden focus:ring-4 focus:ring-app-primary-foreground/20 focus:ring-offset-0 rounded-xs decoration-app-border-color-accent group",n),...s,...i,children:[e,l.jsx(Cs,{className:"ml-1 h-3 w-3 translate-y-0 translate-x-0 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-transform duration-300"})]})}function ur({children:t,ordered:e=!1,compact:r=!1,spacious:n=!1,className:i,...s}){const a=e?"ol":"ul",o=r?"space-y-0.5":n?"space-y-2":"space-y-1";return l.jsx(a,{className:ee("my-2 pl-6 font-light text-app-primary-foreground/80 text-base 2k:text-2xl",e?"list-decimal":"list-disc",`${o} 2k:space-y-3`,"[&>li:first-child]:mt-1 [&>li:first-child]:mb-0",i),...s,children:t})}function Hu({className:t,children:e}){return l.jsx("section",{className:ee("max-w-[750px] w-full space-y-6",t),children:e})}function qu({title:t,description:e,children:r,className:n,id:i}){return l.jsxs("section",{className:ee("space-y-4 mb-12",n),children:[l.jsx("h1",{id:i,className:"m-0 text-3xl font-medium 2k:text-5xl",children:t}),e&&l.jsx("p",{className:"m-0 text-app-primary-foreground/80 font-light leading-relaxed text-lg 2k:text-2xl 2k:pt-10",children:e}),r,l.jsx("div",{className:"h-[1.5px] w-full bg-app-border-color-soft/40 mt-8! rounded-full"})]})}function Ve({children:t,className:e,large:r=!1,muted:n=!1}){return l.jsx("p",{className:ee("my-0 leading-[28px]! 2k:leading-[44px]!",r?"text-lg! font-light max-w-xl 2k:text-3xl! 2k:max-w-3xl":"text-base 2k:text-xl",n?"text-app-primary-foreground/60":"text-app-primary-foreground/80",e),children:t})}function Yu({previous:t,next:e,className:r}){return!t&&!e?null:l.jsxs("nav",{className:ee("mt-20! flex flex-col md:flex-row gap-3 bg-app-card rounded-2xl p-1.5 2k:gap-8 2k:p-6",r),"aria-label":"Section navigation",children:[l.jsxs(At,{to:t?.to??"#",tabIndex:t?0:-1,className:ee("group flex items-center gap-2 px-4 py-3 text-left transition-colors 2k:gap-6 2k:px-10 2k:py-6",!t&&"opacity-50 pointer-events-none"),"aria-disabled":!t,children:[l.jsx(up,{className:"size-4 text-app-primary-foreground/60 group-hover:text-app-primary-foreground duration-300 2k:size-10"}),l.jsx("span",{className:"text-xs text-app-primary-foreground/60 group-hover:text-app-primary-foreground duration-300 2k:text-xl",children:"Previous"})]}),e&&l.jsxs(At,{to:e.to,className:"group flex items-center justify-end gap-4 rounded-xl bg-app-primary px-4 py-3 text-right w-full border border-app-primary hover:border-app-primary-foreground/20 duration-300 2k:gap-8 2k:px-12 2k:py-6",children:[l.jsxs("div",{className:"flex flex-col items-end justify-center",children:[l.jsx("span",{className:"text-sm text-app-primary-foreground/80 2k:text-2xl",children:e.label}),e.sublabel&&l.jsx("span",{className:"text-xs text-app-primary-foreground/60 2k:text-lg",children:e.sublabel})]}),l.jsx("div",{className:"h-[80%] bg-app-primary-foreground/30 w-px rounded-full"}),l.jsxs("div",{className:"flex items-center gap-2 2k:gap-4",children:[l.jsx("span",{className:"text-xs text-app-primary-foreground/60 group-hover:text-app-primary-foreground duration-300 2k:text-xl",children:"Next"}),l.jsx(Sf,{className:"size-4 text-app-primary-foreground/60 group-hover:text-app-primary-foreground duration-300 2k:size-10"})]})]})]})}const H_=({icon:t,title:e,description:r,to:n,className:i})=>l.jsxs(At,{to:n,className:ee("group relative p-3 cursor-pointer h-fit hover:bg-app-card/40 rounded-2xl transition-colors duration-300",i),children:[l.jsx("div",{className:"mb-4 bg-app-card/60 rounded-2xl w-full h-1/2 flex items-center justify-center min-h-[200px] 2k:min-h-[320px]",children:l.jsx(t,{strokeWidth:1.5,className:"size-14 text-app-text-accent relative group-hover:scale-110 transition-transform duration-300 2k:size-24s"})}),l.jsx("h4",{className:"mt-0 mb-2 text-lg 2k:text-3xl",children:e}
1113),l.jsx("p",{className:"text-app-primary-foreground/70 font-light leading-relaxed text-sm 2k:text-xl",children:r})]});function Mce({steps:t,className:e}){return l.jsx("ol",{className:ee("m-0 list-none space-y-8 p-0 my-12! 2k:space-y-16 2k:my-24!",e),children:t.map((r,n)=>l.jsxs("li",{className:"relative pl-10 2k:pl-20",children:[l.jsx("span",{className:"absolute left-0 top-0 inline-flex size-8 items-center justify-center rounded-full bg-app-input-bg text-xs font-medium text-app-primary-foreground font-mono 2k:size-16 2k:text-2xl",children:n+1}),l.jsxs("div",{className:"space-y-1 ml-2 2k:space-y-3 2k:ml-6",children:[l.jsx("h4",{className:"m-0 text-base font-medium 2k:text-2xl",children:r.title}),r.description&&l.jsx("div",{className:"text-sm text-app-primary-foreground/80 font-light leading-relaxed 2k:text-2xl 2k:leading-10",children:r.description})]})]},n))})}function nt({children:t,level:e,className:r,prominent:n=!1,centered:i=!1,...s}){const a="my-0 font-medium",o={h1:n?"text-5xl! 2k:text-7xl!":"text-4xl 2k:text-6xl",h2:"text-3xl! 2k:text-5xl!",h3:"text-2xl! 2k:text-4xl!",h4:"text-xl! 2k:text-3xl!",h5:"text-lg! 2k:text-2xl!",h6:"text-base! 2k:text-lg!"};return l.jsx(e,{className:ee(a,o[e],i&&"text-center 2k:text-4xl",r),...s,children:t})}const M$e="1.2.0",A$e={version:M$e},es="MorEdge",D$e=A$e.version,O$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"cancel-subscription",title:"Cancel subscription",description:`We understand that circumstances change. Here's everything you need to know about canceling your ${es} subscription, what happens to your data, and how to reactivate if needed.`}),l.jsx(Rh,{src:"/profile-ss.png",alt:"Merciless Tracker dashboard with subscription management"}),l.jsx(nt,{level:"h3",id:"cancellation-methods",children:"How to cancel your subscription"}),l.jsx(Ve,{children:"You can cancel your subscription at any time through our streamlined process. Your subscription terminate immediately and you will not be charged again, you will receive a prorated credit for any unused portion of your current billing period."}),l.jsx(nt,{level:"h4",id:"cancel-in-app",children:"Cancel through your profile"}),l.jsx(Ve,{children:"The fastest way to cancel is directly through the app:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:["Navigate to your"," ",l.jsx(hs,{href:"/app/profile",children:"Profile page"})]}),l.jsxs("li",{children:["Scroll to the"," ",l.jsx(Zt,{children:"Billing"})," ","section"]}),l.jsxs("li",{children:["Click"," ",l.jsx(Zt,{children:"Manage Subscription"})]})]}),l.jsx(Rh,{src:"/stripe-ss-1.png",alt:"Stripe portal with Manage Subscription button"}),l.jsx(nt,{level:"h4",id:"stripe-portal-steps",children:"Complete cancellation in Stripe portal"}),l.jsx(Ve,{children:"Once redirected to the Stripe portal, follow these steps:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:["Click on"," ",l.jsx(Zt,{children:"Update subscription"})]}),l.jsxs("li",{children:["Select the"," ",l.jsx(Zt,{children:"Free plan"})," ","option"]}),l.jsxs("li",{children:["Click"," ",l.jsx(Zt,{children:"Continue"})," ","to proceed"]})]}),l.jsx(Rh,{src:"/stripe-ss-2.png",alt:"Stripe portal showing plan selection with Free plan option"}),l.jsx(nt,{level:"h4",id:"confirm-update",children:"Confirm the update"}),l.jsx(Ve,{children:"Review your changes and confirm the subscription update:"}),l.jsx(Rh,{src:"/stripe-ss-4.png",alt:"Stripe portal confirmation page for subscription update"}
1113),l.jsx(eA,{variant:"warning",title:"Apportionment notice",children:"When you downgrade to the free plan, you'll receive a prorated credit for any unused portion of your current billing period. This credit will be applied to your next subscription if you decide to upgrade again."}),l.jsx(nt,{level:"h4",id:"cancel-via-email",children:"Cancel via email support"}),l.jsx(Ve,{children:"If you prefer personal assistance or encounter any issues with the in-app cancellation process:"}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Email:"})," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"})]}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Subject line:"})," ",'"Cancel Subscription Request"']}),l.jsx(Ve,{children:"Include your account email address and we'll process your cancellation within 24 hours during business days."}),l.jsx(nt,{level:"h3",id:"what-happens-after",children:"What happens after cancellation"}),l.jsx(Ve,{children:"Understanding the cancellation process helps you plan accordingly and ensures you don't lose important data."}),l.jsx(nt,{level:"h4",id:"after-billing-period",children:"After cancellation"}),l.jsx(Ve,{children:"Immediately after cancellation:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Account downgrade:"})," ","Your account automatically transitions to the free plan"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Feature limitations:"})," ","Some premium features become unavailable"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Data retention:"})," ","Your trading data remains accessible with basic features"]})]}),l.jsx(eA,{variant:"success",title:"Good news",children:"Your trading data never gets deleted. Even on the free plan, you can access your complete trading history and basic analytics."}),l.jsx(nt,{level:"h3",id:"data-retention",children:"Data retention and export"}),l.jsx(Ve,{children:"We believe your trading data belongs to you. Here's how we handle your information after cancellation."}),l.jsx(nt,{level:"h4",id:"what-stays-accessible",children:"What stays accessible"}),l.jsx(Ve,{children:"What stays accessible after cancellation:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"All your imported trades and executions"}),l.jsx("li",{children:"Basic performance metrics and statistics"}),l.jsx("li",{children:"Account settings and preferences"}),l.jsx("li",{children:"Tags and trade notes"}),l.jsx("li",{children:"Basic charts and visualizations"})]}),l.jsx(nt,{level:"h4",id:"premium-features-affected",children:"Premium features that become unavailable"}),l.jsx(Ve,{children:"Premium features that become unavailable:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Advanced analytics and insights"}),l.jsx("li",{children:"AI-powered trade analysis"}),l.jsx("li",{children:"Advanced charting tools"}),l.jsx("li",{children:"Unlimited trade imports (limited to basic quota)"}),l.jsx("li",{children:"Priority support"})]}),l.jsx(nt,{level:"h3",id:"reactivation",children:"Reactivating your subscription"}),l.jsx(Ve,{children:"Changed your mind? Reactivating is simple and your data will be exactly as you left it."}),l.jsx(nt,{level:"h4",id:"how-to-reactivate",children:"How to reactivate"}),l.jsx(Ve,{children:"How to reactivate your subscription:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Log into your account (your login credentials remain the same)"}),l.jsxs("li",{children:["Navigate to your"," ",l.jsx(hs,{href:"/app/profile",children:"Profile page"})]}),l.jsxs("li",{children:["Click"," ",l.jsx(Zt,{children:"Upgrade Plan"})," ","in the subscription section"]}),l.jsx("li",{children:"Choose your preferred plan and complete payment"}),l.jsx("li",{children:"Premium features are restored immediately"})]}),l.jsx(eA,{variant:"success",title:"Seamless restoration",children:"All your data, settings, and preferences are instantly restored when you reactivate. It's like you never left."}),l.jsx(nt,{level:"h3",id:"refund-policy",children:"Refund policy"}),l.jsx(Ve,{children:"We want you to be completely satisfied with Merciless Tracker. Here's our straightforward refund policy."}),l.jsx(nt,{level:"h4",id:"eligible-refunds",children:"When refunds are available"}),l.jsx(Ve,{children:"When refunds are available:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Technical issues:"}
1113)," ","If the service is unusable due to technical problems on our end"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Billing errors:"})," ","Duplicate charges or incorrect billing amounts"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Service disruption:"})," ","Extended outages affecting core functionality"]})]}),l.jsx(nt,{level:"h4",id:"refund-process",children:"How to request a refund"}),l.jsx(Ve,{children:"Contact our support team with your refund request:"}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Email:"})," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"})]}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Subject:"})," ",'"Refund Request"']}),l.jsx(Ve,{children:"Include your account email, reason for the refund request, and any relevant details. We typically process refund requests within 3-5 business days."}),l.jsx(nt,{level:"h3",id:"still-need-help",children:"Still need help?"}),l.jsx(Ve,{children:"If you have questions about cancellation, billing, or need assistance with any part of this process, we're here to help."}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Support Email:"})," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"})]}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Response Time:"})," ","Within 4-6 hours during business hours (Monday-Friday, 9 AM - 6 PM EST)"]}),l.jsxs(Ve,{children:["You can also check our"," ",l.jsx(hs,{href:"/docs/contact-support",children:"Contact Support"})," ","page for additional ways to reach us."]}),l.jsx(Yu,{previous:{to:"/docs/import-das-trader"},next:{to:"/docs/report-bug",label:"Report a bug",sublabel:"Bug reporting guide"}})]}),R$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"common-issues-faqs",title:"Common Issues & FAQs",description:`Find answers to common questions and solutions to frequent issues in ${es}.`}),l.jsx(nt,{level:"h3",id:"importing",children:"Importing Trades"}),l.jsx(Ve,{children:"Having trouble importing your trades? Here are the most common questions and solutions:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"No trades found:"})," ","Make sure you selected the correct broker/platform when importing. If your file is from TradeZero, Webull, or another supported broker, select it specifically on the import page."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"File format issues:"})," ","Only CSV files exported directly from your broker are supported. Do not modify the file in Excel or Google Sheets before importing."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Partial imports or missing trades:"})," ","Check that your file contains only supported asset types (stocks and options). Futures and forex are not currently supported."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Duplicate trades:"})," ","If you import the same file twice, duplicate executions will be ignored automatically."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Commissions/fees not showing:"})," ","Ensure your broker's export includes all fee columns. Our app sums all commission and regulatory fees automatically if present in the file."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Date/time issues:"})," ","All imports are processed in New York time (Eastern Time). If your broker exports in a different timezone, times will be converted automatically."]})]}),l.jsx(nt,{level:"h3",id:"supported-brokers",children:"Supported Brokers & Platforms"}),l.jsxs(Ve,{children:[es," ","currently supports direct imports from:"]}),l.jsxs(ur,{children:[l.jsx("li",{children:"Thinkorswim"}),l.jsx("li",{children:"DAS Trader"}),l.jsx("li",{children:"Tradestation"}),l.jsx("li",{children:"TradeZero"}),l.jsx("li",{children:"Webull"}),l.jsx("li",{children:"Universal Import"})]}),l.jsx(Ve,{muted:!0,children:"If your broker is not listed, please contact support to request compatibility."}),l.jsx(nt,{level:"h3",id:"trade-management",children:"Trade Management"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Deleting trades:"})," ","You can delete individual trades from your dashboard. Bulk deletion it's supported through the bulk actions toolbar."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Editing trades:"})," ","Editing imported trades is not supported to ensure data integrity. Please re-import with corrected data if needed."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Splitting or merging trades:"})," ","These features are not yet available. Each import is processed as individual executions."]})]}),l.jsx(nt,{level:"h3",id:"sharing-privacy",children:"Sharing & Privacy"}),l.jsx(ur,{children:l.jsxs("li",{children:[l.jsx("strong",{children:"Avatar/profile image:"})," ","Profile images are managed via your account settings."]})}),l.jsx(nt,{level:"h3",id:"reports",children:"Reports & Analytics"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Price Range:"})," ","Analyze your trades by entry and exit price ranges."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Symbol Analysis:"})," ","See performance breakdowns by ticker symbol."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Time of Day:"})," ","Visualize when you trade most and your results by time."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Day of Week:"})," ","Analyze your trading performance by weekday."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Volume Range:"})," ","Review your trades by share size."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Win/Loss:"})," ","Track your win rate and P&L by winning and losing trades."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Equity Curve:"})," ","See your cumulative P&L over time."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Summary Statistics:"})," ","View key stats like average win, loss, and expectancy."]})]}),l.jsx(nt,{level:"h3",id:"position-type-issues",children:"Position Type Issues"}),l.jsx(Ve,{children:"If you notice that trades are showing the wrong position type (LONG vs SHORT), this is typically caused by incorrect execution order in your broker's export file."}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Incorrect position type:"})," ","If a trade shows as LONG when it should be SHORT (or vice versa), check that the executions in your broker file are sorted chronologically. The position type is determined by the first execution in the sequence."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Verifying execution order:"})," ","Open your CSV file and ensure that executions are ordered by date/time from oldest to newest. Some brokers export newest-first, which can cause incorrect position type detection."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Manual verification:"})," ","Look at the first execution in your trade sequence - if it's a BUY, the position should be LONG; if it's a SELL, it should be SHORT."]})]}),l.jsx(nt,{level:"h3",id:"other-issues",children:"Other Common Issues"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Charts not updating:"})," ","After importing or deleting trades, charts may take a few minutes to refresh."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Partial-share transactions:"})," ","Only whole-share trades are supported. Fractional shares will be rounded to the nearest whole number."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Account limits:"})," ","Free users may have monthly import limits. Upgrade to Pro for unlimited imports."]})]}),l.jsxs(Ve,{children:["Still have questions?"," ",l.jsx(hs,{href:"/docs/contact-support",children:"Contact support"})," ","and we'll be happy to help!"]}),l.jsx(Yu,{previous:{to:"/docs/privacy-policy"},next:{to:"/docs/import-thinkorswim",label:"Thinkorswim",sublabel:"Import Guide"}})]}),I$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"contact-support",title:"Contact Support",description:"Get the help you need when you need it. Our support team is here to ensure your trading journal experience is seamless and productive."}),l.jsx(nt,{level:"h3",id:"support-channels",children:"Support Channels"}),l.jsx(Ve,{children:"We believe great support should be accessible, responsive, and genuinely helpful. Whether you're troubleshooting an import issue or have questions about your subscription, we're here to help you succeed."}),l.jsx(nt,{level:"h3",id:"email-support",children:"Email Support"}),l.jsx(Ve,{children:"For detailed inquiries, technical issues, or account-related questions, email is your best option:"}),l.jsxs(Ve,{children:[l.jsx("strong",{children:"Primary Support:"})," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"})]}),l.jsx(Ve,{muted:!0,children:'We typically respond within 4-6 hours during business hours (Monday-Friday, 9 AM - 6 PM EST). For urgent issues, please include "URGENT" in your subject line.'}),l.jsx(nt,{level:"h3",id:"in-app-support",children:"In-App Support"}),l.jsx(Ve,{children:"Access support directly from your dashboard for quick assistance:"}),l.jsx(Ve,{children:"Access support directly from your dashboard for quick assistance:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Help Center:"})," ","Navigate to the Help section in your dashboard for comprehensive guides and troubleshooting"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Feature Requests:"})," ","Use the feedback form to suggest new features or improvements"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Bug Reports:"})," ","Report issues directly through the app for faster resolution"]})]}
1113),l.jsx(nt,{level:"h3",id:"common-issues",children:"Common Issues & Quick Solutions"}),l.jsx(Ve,{children:"Before reaching out, check these frequently asked questions and solutions:"}),l.jsx(nt,{level:"h4",id:"import-issues",children:"Import Problems"}),l.jsx(Ve,{children:"Common import issues and solutions:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"CSV Format Errors:"})," ","Ensure your file has the required columns. Check our"," ",l.jsx(hs,{href:"/docs/import-thinkorswim",children:"Thinkorswim guide"})," ","or"," ",l.jsx(hs,{href:"/docs/import-das-trader",children:"DAS Trader guide"})," ","for exact requirements"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Date Selection:"})," ","DAS Trader imports require manual date selection. Make sure you've picked the correct trade date"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Large Files:"})," ","Files over 10MB may take longer to process. Consider splitting into smaller date ranges"]})]}),l.jsx(nt,{level:"h4",id:"account-issues",children:"Account & Subscription"}),l.jsx(Ve,{children:"Common account and subscription issues:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Password Reset:"})," ",'Use the "Forgot Password" link on the login page']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Subscription Changes:"})," ","Manage your plan through your"," ",l.jsx(hs,{href:"/profile",children:"Profile Settings"})]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Data Export:"})," ","Request a complete export of your trading data via email"]})]}),l.jsx(nt,{level:"h3",id:"response-times",children:"Response Times & Escalation"}),l.jsx(Ve,{children:"We're committed to providing timely support while maintaining quality. Here's what you can expect:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Initial Response:"})," ","4-6 hours during business hours"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Issue Resolution:"})," ","24-48 hours for most technical problems"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Feature Requests:"})," ","Reviewed weekly, feedback provided within 7 days"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Bug Reports:"})," ","Critical issues addressed within 24 hours"]})]}),l.jsx(nt,{level:"h3",id:"escalation-process",children:"Escalation Process"}),l.jsx(Ve,{children:"If your issue isn't resolved within our standard response times, it's automatically escalated to senior support staff. You'll receive updates at each escalation level."}),l.jsx(nt,{level:"h3",id:"office-hours",children:"Office Hours & Holidays"}),l.jsx(Ve,{children:"Our support team operates on Eastern Standard Time (EST):"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Monday - Friday:"})," ","9:00 AM - 6:00 PM EST"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Saturday:"})," ","10:00 AM - 2:00 PM EST (limited support)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Sunday:"})," ","Closed"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Holidays:"})," ","Reduced support hours on major US holidays"]})]}),l.jsx(Ve,{muted:!0,children:'For urgent issues outside business hours, email with "URGENT" in the subject line. Critical system issues are monitored 24/7.'}),l.jsx(Ve,{children:"Remember, the best support experience starts with clear communication. When reaching out, please include:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx(Zt,{children:"username"})," ","or"," ",l.jsx(Zt,{children:"email"})]}),l.jsxs("li",{children:["Detailed"," ",l.jsx(Zt,{children:"description"})," ","of the issue"]}),l.jsxs("li",{children:[l.jsx(Zt,{children:"Steps"})," ","to reproduce the problem"]}),l.jsxs("li",{children:[l.jsx(Zt,{children:"Screenshots"})," ","or error messages (if applicable)"]}),l.jsxs("li",{children:["Your"," ",l.jsx(Zt,{children:"browser/device"})," ","information"]})]}),l.jsxs(Ve,{children:["We're committed to making"," ",es," ","the most powerful and user-friendly trading journal available. Your success is our success."]}),l.jsx(Yu,{previous:{to:"/docs/report-bug"},next:{to:"/docs",label:"Help Center",sublabel:"Get help with your account"}})]}),L$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"import-das-trader",title:"DAS Trader export guide",description:"A quick, reliable export → import flow for your DAS Trader executions."}),l.jsx(Rh,{src:"/das-ss.png",alt:"DAS Trader import"}),l.jsx(Mce,{steps:[{title:"Open the Trade Log",description:l.jsxs("p",{children:["In DAS Trader, open"," ",l.jsx(Zt,{children:"Trade"})," ","→",l.jsx(Zt,{children:"Trade Log"})," ","to view your executions."]})},{title:"Export to CSV",description:l.jsxs("p",{children:["Right-click inside the executions list and choose",l.jsx(Zt,{children:"Export"}),". Save the file as a",l.jsx(Zt,{children:"CSV"})," ","somewhere easy to find."]})},{title:"Select the trade date (required)",description:l.jsxs("p",{children:["On the import page here, click the"," ",l.jsx("b",{children:"Trade Date"})," ","picker and select the date of the trades you are importing. DAS exports do not include trade dates, so this 
1113step is required."]})},{title:"Upload to MercilessTracker",description:l.jsxs("p",{children:["Click"," ",l.jsx(Zt,{children:"Choose file"}),", pick your",l.jsx(Zt,{children:"CSV"}),", and then click",l.jsx(Zt,{children:"Upload"})," ","to import."]})}]}),l.jsxs("p",{className:"font-light text-app-primary-foreground/80 text-base",children:["Required columns:",l.jsx(Zt,{children:"Event"}),","," ",l.jsx(Zt,{children:"B/S"}),","," ",l.jsx(Zt,{children:"Symbol"}),","," ",l.jsx(Zt,{children:"Shares"}),","," ",l.jsx(Zt,{children:"Price"}),","," ",l.jsx(Zt,{children:"Route"}),","," ",l.jsx(Zt,{children:"Time"})]}),l.jsx(Yu,{previous:{to:"/docs/import-thinkorswim"},next:{to:"/docs/cancel-subscription",label:"Cancel subscription",sublabel:"Cancel your subscription"}})]}),$$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"getting-started",title:"Getting started",description:`Welcome to the ${es} documentation. This is your hub for importing trades, understanding features, and managing your subscription. Use the quick links below to jump right in.`}),l.jsx(Rh,{src:"/dashboard-ss.png",alt:`${es} dashboard overview`}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 w-full",children:[l.jsx(H_,{icon:e3,title:"Getting started",description:"Essential legal documents and policies to get you started with our platform",to:"/docs/terms-of-use"}),l.jsx(H_,{icon:dp,title:"Import trades",description:"Learn how to import your trading data from Thinkorswim and DAS Trader platforms",to:"/docs/import-thinkorswim"}),l.jsx(H_,{icon:fl,title:"Subscription",description:"Manage your subscription, update billing information, or cancel your plan",to:"/docs/cancel-subscription"}),l.jsx(H_,{icon:foe,title:"Support",description:"Get help with issues, report bugs, or contact our support team directly",to:"/docs/contact-support"})]}),l.jsx(Yu,{next:{to:"/docs/terms-of-use",label:"Terms of Use",sublabel:"Acceptance of Terms"}})]}),F$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"import-thinkorswim",title:"Think Or Swim export guide",description:"A quick, reliable export → import flow for your Thinkorswim trades."}),l.jsx(Rh,{src:"/thinkors-ss.png",alt:"Think Or Swim import"}),l.jsx(Mce,{steps:[{title:"Choose the correct account",description:l.jsxs("p",{children:["Open Thinkorswim and select a specific account,"," ",l.jsx("b",{children:"not"})," ",l.jsx(Zt,{children:"ALL ACCOUNTS"}),". This ensures your export only includes the trades you actually executed under that account."]})},{title:"Navigate to Trade History",description:l.jsxs("p",{children:["Go to"," ",l.jsx(Zt,{children:"Monitor"})," ","→",l.jsx(Zt,{children:"Account Statement"})," ","to access your historical executions."]})},{title:"Set the date range",description:l.jsxs("p",{children:["In the"," ",l.jsx(Zt,{children:"Account Statement"})," ","dropdown, choose the date range covering the trades you want to import."]})},{title:"Sort by time (oldest first)",description:l.jsxs("p",{children:["Wait for the"," ",l.jsx("b",{children:"Trade History"})," ","section to load, then sort by",l.jsx(Zt,{children:"Exec Time"})," ","in",l.jsx("b",{children:"ascending"})," ","order. This helps with a clean import and matching."]})},{title:"Export to CSV",description:l.jsxs("p",{children:["Click the actions menu (top-right) and choose",l.jsx(Zt,{children:"Export to file"}),". Set the file type to",l.jsx(Zt,{children:"CSV"})," ","and save it somewhere easy to find."]})},{title:"Upload to MercilessTracker",description:l.jsxs("p",{children:["Return to the import page here, select your"," ",l.jsx(Zt,{children:"CSV"})," ","file, and click"," ",l.jsx(Zt,{children:"Upload"})," ","to import your trades."]})}]}),l.jsxs("p",{className:"font-light text-app-primary-foreground/80 text-base 2k:text-xl",children:["Required columns:",l.jsx(Zt,{children:"Exec Time"}),","," ",l.jsx(Zt,{children:"Spread"}),","," ",l.jsx(Zt,{children:"Side"}),","," ",l.jsx(Zt,{children:"Qty"}),","," ",l.jsx(Zt,{children:"Symbol"}),","," ",l.jsx(Zt,{children:"Price"})]}),l.jsx(Yu,{previous:{to:"/docs/common-issues"},next:{to:"/docs/import-das-trader",label:"DAS Trader",sublabel:"Import Guide"}})]}),z$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"privacy-policy",title:"Privacy Policy",description:`Your privacy is important to us. This policy explains how we 
1113collect, use, and protect your personal information when you use ${es}.`}),l.jsx(nt,{level:"h3",id:"information-collection",children:"1. Information We Collect"}),l.jsx(Ve,{children:"We collect information you provide directly to us when you create an account, use our services, or communicate with us. This includes:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Account information (name, username, email address)"}),l.jsx("li",{children:"Trading data and journal entries you upload"}),l.jsx("li",{children:"Screenshots, notes, and trade metadata"}),l.jsx("li",{children:"Communication preferences and settings"}),l.jsx("li",{children:"Payment information (processed securely by Stripe)"})]}),l.jsx(nt,{level:"h3",id:"automated-data-collection",children:"2. Automated Data Collection"}),l.jsx(Ve,{children:"We automatically collect certain information when you use our service:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Usage data and analytics to improve our service"}),l.jsx("li",{children:"Device information and browser details"}),l.jsx("li",{children:"IP address and general location data"}),l.jsx("li",{children:"Crash reports and error logs for debugging"}),l.jsx("li",{children:"Performance metrics and service usage patterns"})]}),l.jsx(nt,{level:"h3",id:"how-we-use-information",children:"3. How We Use Your Information"}),l.jsx(Ve,{children:"We use the collected information to:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Provide, maintain, and improve our trading journal service"}),l.jsx("li",{children:"Process your transactions and manage your subscription"}),l.jsx("li",{children:"Send you important service updates and notifications"}),l.jsx("li",{children:"Respond to your questions and provide customer support"}),l.jsx("li",{children:"Analyze usage patterns to enhance user experience"}),l.jsx("li",{children:"Ensure security and prevent fraud or abuse"})]}),l.jsx(nt,{level:"h3",id:"data-sharing",children:"4. Data Sharing and Disclosure"}),l.jsx(Ve,{children:"We do not sell, trade, or rent your personal information to third parties. We may share your information only in these limited circumstances:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Service Providers:"})," ","Essential third-party services like Stripe (payments), Firebase (authentication), and hosting providers"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Legal Requirements:"})," ","When required by law or to protect our rights and safety"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Business Transfers:"})," ","In connection with a merger, acquisition, or sale of assets"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"With Your Consent:"})," ","When you explicitly authorize us to share specific information"]})]}),l.jsx(nt,{level:"h3",id:"data-security",children:"5. Data Security and Protection"}),l.jsx(Ve,{children:"We implement industry-standard security measures to protect your data:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"End-to-end encryption for data transmission"}),l.jsx("li",{children:"Secure authentication via Firebase with password hashing"}),l.jsx("li",{children:"Regular security audits and vulnerability assessments"}),l.jsx("li",{children:"Access controls and authentication requirements"}),l.jsx("li",{children:"Secure data centers with physical and digital safeguards"})]}),l.jsx(nt,{level:"h3",id:"data-retention",children:"6. Data Retention and Deletion"}),l.jsx(Ve,{children:"We retain your data for as long as your account is active or as needed to provide services. You can:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Delete individual trades or journal entries at any time"}),l.jsx("li",{children:"Export your complete trading data upon request"}),l.jsx("li",{children:"Request account deletion, which will permanently remove all your data"}),l.jsx("li",{children:"Modify or update your personal information through your account settings"})]}),l.jsx(nt,{level:"h3",id:"cookies-tracking",children:"7. Cookies and Tracking Technologies"}),l.jsx(Ve,{children:"We use cookies and similar technologies to:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Remember your preferences and login status"}),l.jsx("li",{children:"Analyze service usage and performance"}),l.jsx("li",{children:"Provide personalized features and content"}),l.jsx("li",{children:"Ensure security and prevent fraud"})]}),l.jsx(Ve,{children:"You can control cookie settings through your browser preferences, though disabling certain cookies may affect service functionality."}),l.jsx(nt,{level:"h3",id:"third-party-services",children:"8. Third-Party Services and Links"}),l.jsx(Ve,{children:"Our service integrates with third-party services that have their own privacy policies:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Stripe:"})," ","Payment processing and subscription management"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Firebase:"})," ","Authentication, analytics, and crash reporting"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Hosting Providers:"}
1113)," ","Secure data storage and infrastructure"]})]}),l.jsx(Ve,{children:"We recommend reviewing their privacy policies to understand how they handle your information."}),l.jsx(nt,{level:"h3",id:"children-privacy",children:"9. Children's Privacy"}),l.jsx(Ve,{children:"Our service is not intended for children under 18 years of age. We do not knowingly collect personal information from children under 18. If you believe we have collected such information, please contact us immediately so we can take appropriate action."}),l.jsx(nt,{level:"h3",id:"international-transfers",children:"10. International Data Transfers"}),l.jsx(Ve,{children:"Your data may be processed and stored in countries other than your own. We ensure that such transfers comply with applicable data protection laws and implement appropriate safeguards to protect your information."}),l.jsx(nt,{level:"h3",id:"your-rights",children:"11. Your Privacy Rights"}),l.jsx(Ve,{children:"Depending on your location, you may have certain rights regarding your personal information:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Access and review your personal data"}),l.jsx("li",{children:"Correct inaccurate or incomplete information"}),l.jsx("li",{children:"Request deletion of your personal data"}),l.jsx("li",{children:"Object to or restrict certain processing activities"}),l.jsx("li",{children:"Data portability and export capabilities"})]}),l.jsx(nt,{level:"h3",id:"policy-updates",children:"12. Changes to This Privacy Policy"}),l.jsx(Ve,{children:"We may update this Privacy Policy from time to time to reflect changes in our practices or applicable laws. We will notify you of any material changes through email or in-app notifications. Your continued use of the service after such changes constitutes acceptance of the updated policy."}),l.jsx(nt,{level:"h3",id:"contact-us",children:"13. Contact Us"}),l.jsxs(Ve,{children:["If you have questions about this Privacy Policy or our data practices, please contact us through our support channels available in the application or email us directly at"," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"}),". We're committed to addressing your privacy concerns promptly and transparently."]}),l.jsx(Yu,{previous:{to:"/docs/terms-of-use"},next:{to:"/docs/common-issues",label:"Common Issues & FAQs",sublabel:"Troubleshooting and frequently asked questions"}})]}),B$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"report-bug",title:"Report a Bug",description:`Help us improve ${es} by reporting any issues you encounter. Your detailed reports help us fix problems faster and enhance the user experience for everyone.`}),l.jsx(nt,{level:"h3",id:"before-reporting",children:"Before you report"}),l.jsx(Ve,{children:"Before submitting a bug report, please check if the issue has already been reported or if there's a simple solution available:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:["Check our"," ",l.jsx(hs,{href:"/docs",children:"documentation"})," ","for known solutions"]}),l.jsx("li",{children:"Try refreshing the page or clearing your browser cache"}),l.jsx("li",{children:"Ensure you're using a supported browser (Chrome, Firefox, Safari, Edge)"}),l.jsx("li",{children:"Check if the issue occurs in different browsers or devices"})]}),l.jsx(nt,{level:"h3",id:"how-to-report",children:"How to report a bug"}),l.jsx(Ve,{children:"We've made bug reporting as simple as possible. Choose the method that works best for you:"}),l.jsx(nt,{level:"h4",id:"email-reporting",children:"Email bug reporting"}),l.jsxs(Ve,{children:["For complex issues or when in-app reporting isn't available, email us directly:"," ",l.jsx(hs,{href:"mailto:[email protected]?subject=BUG%20REPORT",external:!0,children:"[email protected]"})]}),l.jsx(Ve,{muted:!0,children:'Please include "BUG REPORT" in your subject line for faster processing.'}),l.jsx(nt,{level:"h3",id:"what-to-include",children:"What to include in your report"}),l.jsx(nt,{level:"h4",id:"essential-information",children:"Essential information"}),l.jsx(Ve,{children:"Essential information for bug reports:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Clear Description:"})," ","Explain what you were trying to do and what went wrong"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Steps to Reproduce:"})," ","List the exact steps that led to the issue"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Expected vs. Actual Behavior:"})," ","What should have happened vs. what actually happened"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Error Messages:"})," ","Copy any error text or codes you see"]})]}),l.jsx(nt,{level:"h4",id:"technical-details",children:"Technical details"}),l.jsx(Ve,{children:"Technical details to include:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Browser & Version:"})," ","Include your browser name and version number"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Operating System:"})," ","Windows, macOS, Linux, iOS, or Android version"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Device Type:"})," ","Desktop, laptop, tablet, or mobile phone"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Account Type:"})," ","Free or Pro subscription plan"]})]}),l.jsx(nt,{level:"h3",id:"bug-categories",children:"Bug categories"}),l.jsx(Ve,{children:"Understanding the type of bug helps us prioritize and route your report to the right team:"}),l.jsx(Ve,{children:"Understanding the type of bug helps us prioritize and route your report to the right team:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"UI/UX Issues:"})," ","Visual glitches, layout problems, or confusing interfaces"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Functional Bugs:"})," ","Features not working as expected or completely broken"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Performance Issues:"})," ","Slow loading, freezing, or crashes"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Data Problems:"})," ","Import errors, missing data, or incorrect calculations"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Authentication Issues:"})," ","Login problems, password resets, or account access"]})]}),l.jsx(nt,{level:"h3",id:"response-timeline",children:"Response timeline"}),l.jsx(Ve,{children:"We take bug reports seriously and respond according to severity:"}),l.jsx(Ve,{children:"We take bug reports seriously and respond according to severity:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Critical Issues:"})," ","System crashes, data loss, or security problems - addressed within 24 hours"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Major Bugs:"})," ","Core functionality broken - addressed within 48-72 hours"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Minor Issues:"})," ","UI glitches or non-critical features - addressed within 1-2 weeks"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Enhancement Requests:"})," ","Feature improvements - reviewed weekly and prioritized"]})]}),l.jsx(nt,{level:"h3",id:"tracking-updates",children:"Tracking your bug report"}),l.jsx(Ve,{children:"Once you submit a bug report, here's what happens next:"}),l.jsx(Ve,{children:"Once you submit a bug report, here's what happens next:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Confirmation:"})," ","You'll receive an email confirmation with a tracking number"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Initial Review:"})," ","Our team reviews and categorizes your report within 24 hours"]}
1113),l.jsxs("li",{children:[l.jsx("strong",{children:"Status Updates:"})," ","You'll receive updates as the bug progresses through our pipeline"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Resolution:"})," ","When fixed, you'll get notified and can test the solution"]})]}),l.jsx(nt,{level:"h3",id:"common-mistakes",children:"Common mistakes to avoid"}),l.jsx(Ve,{children:"Help us help you by avoiding these common reporting mistakes:"}),l.jsx(Ve,{children:"Help us help you by avoiding these common reporting mistakes:"}),l.jsxs(ur,{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Vague Descriptions:"})," ",`"It's broken" doesn't give us enough information`]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Missing Steps:"})," ","We need to reproduce the issue to fix it"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"No Screenshots:"})," ","Visual evidence helps us understand the problem faster"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Multiple Issues:"})," ","Report each bug separately for better tracking"]})]}),l.jsxs(Ve,{children:["Remember, the more detailed your bug report, the faster we can resolve the issue. Your feedback directly contributes to making"," ",es,"better for everyone."]}),l.jsx(Yu,{previous:{to:"/docs/contact-support"},next:{to:"/docs/contact-support",label:"Contact Support",sublabel:"Get help with your issue"}})]}),V$e=()=>l.jsxs(Hu,{children:[l.jsx(qu,{id:"terms-of-use",title:"Terms of Use",description:`Welcome to ${es}. By using our service, you agree to these terms. Please read them carefully as they contain important information about your rights and obligations.`}),l.jsx(nt,{level:"h3",id:"acceptance-of-terms",children:"1. User's Acknowledgment and Acceptance"}),l.jsxs(Ve,{children:['Trading Journal ("',l.jsx("strong",{children:"we"}),'", "',l.jsx("strong",{children:"our"}),'", "',l.jsx("strong",{children:"us"}),'") provides an online platform and related mobile services (collectively, the "',l.jsx("strong",{children:"Service"}),'") that allow registered users ("',l.jsx("strong",{children:"User"}),'", "',l.jsx("strong",{children:"you"}),'") to journal, analyze, and visualize their trading activity. By accessing or using the Service, you confirm you have read, understood, and agree to be bound by these Terms of Use ("',l.jsx("strong",{children:"Terms"}),'"). If you do not agree, do not use the Service.']}),l.jsx(nt,{level:"h3",id:"service-description",children:"1.1 Service Description"}),l.jsx(Ve,{children:"The service enables you to:"}),l.jsxs(ur,{children:[l.jsx("li",{children:"Log trades manually or via supported broker imports"}),l.jsx("li",{children:"Store trade metadata, screenshots, and notes"}),l.jsx("li",{children:"View performance analytics, calendar heat-maps, and equity curves"}),l.jsx("li",{children:"Share or keep private your trades and journals"}),l.jsx("li",{children:"Manage subscription and account preferences"}),l.jsx("li",{children:"Export your trade data upon request"})]}),l.jsx(Ve,{children:"All analytics derive solely from data you submit — we do not provide live market data feeds or real-time execution tools."}),l.jsx(nt,{level:"h3",id:"user-accounts",children:"2. User Accounts"}),l.jsx(Ve,{children:"You must be at least 18 years old to register. Required data includes your first name, last name, username, and a valid email address. Passwords are handled securely via Firebase Authentication and are never stored in plaintext. You are solely responsible for maintaining the confidentiality of your login credentials and for all activity under your account."}),l.jsx(nt,{level:"h3",id:"subscriptions",children:"3. Subscriptions & Payments"}),l.jsx(Ve,{children:"Paid plans unlock advanced analytics, unlimited imports, and extended storage. Subscriptions are billed in advance (monthly or annually) via Stripe; we never store card details directly. Subscriptions auto-renew unless cancelled prior to renewal. Annual plans are eligible for refund within 14 days of purchase. Promotional discounts, if applicable, are non-refundable unless otherwise stated."}),l.jsx(nt,{level:"h3",id:"use-license",children:"4. Limited License"}),l.jsx(Ve,{children:"We grant you a limited, revocable, non-transferable, non-exclusive license to access and use the Service for personal, non-commercial purposes. Unauthorized actions — including but not limited to resale, reverse-engineering, bulk scraping, or impersonation — will result in immediate termination and potential legal consequences."}),l.jsx(nt,{level:"h3",id:"trade-data",children:"5. Trade Data & Content"}),l.jsx(Ve,{children:"All trade data you upload remains your property. We do not sell or commercialize user data. Your data is used solely to deliver and enhance the Service. We may share minimal information only with essential third-party processors: Stripe (payments), Firebase (authentication, analytics, crash logs), and infrastru
1113cture vendors for hosting. If you share trades publicly, you grant us a royalty-free, global license to display and promote such content within the app and associated media. You can privatize or delete content at any time."}),l.jsx(nt,{level:"h3",id:"no-advice",children:"6. No Financial Advice"}),l.jsx(Ve,{children:"All metrics and insights are for educational and informational purposes only. We do not provide personalized investment advice. You are solely responsible for evaluating and making your own trading decisions."}),l.jsx(nt,{level:"h3",id:"disclaimer",children:"7. Disclaimer of Warranties"}),l.jsx(Ve,{children:'The Service is provided "as is" and "as available" with no warranties of any kind, express or implied. We do not guarantee the Service will be error-free, uninterrupted, or meet specific performance expectations. In jurisdictions where limitations on implied warranties are restricted, our liability shall not exceed the amount paid by you in the last 3 months.'}),l.jsx(nt,{level:"h3",id:"limitation-of-liability",children:"8. Limitation of Liability"}),l.jsx(Ve,{children:"To the maximum extent permitted by law, we are not liable for indirect, incidental, special, punitive, or consequential damages resulting from the use or inability to use the Service, including loss of profits, data, or goodwill."}),l.jsx(nt,{level:"h3",id:"termination",children:"9. Termination"}),l.jsx(Ve,{children:"We may suspend or permanently terminate accounts at our discretion for violations of these Terms, abuse of the Service, or harm to other users. Upon termination, all licenses granted to you will cease. You may request export of your trade data within 30 days by contacting our support team."}),l.jsx(nt,{level:"h3",id:"modifications",children:"10. Changes to Terms"}),l.jsx(Ve,{children:"We may revise these Terms from time to time. Substantial changes will be communicated via email or in-app notification. By continuing to use the Service after updates, you accept the revised Terms."}),l.jsx(nt,{level:"h3",id:"governing-law",children:"11. Governing Law"}),l.jsxs(Ve,{children:["These Terms shall be governed by and construed in accordance with the laws of ",l.jsx("span",{className:"text-app-primary-foreground",children:"El Salvador"}),". Any disputes arising from these Terms shall be exclusively resolved in the competent courts of ",l.jsx("span",{className:"text-app-primary-foreground",children:"San Salvador"}),"."]}),l.jsx(nt,{level:"h3",id:"contact-information",children:"12. Contact Information"}),l.jsxs(Ve,{children:["If you have any questions about these Terms of Use, please contact us through our support channels available in the application or visit our contact support page."," ",l.jsx(hs,{href:"mailto:[email protected]",external:!0,children:"[email protected]"})]}),l.jsx(Yu,{previous:{to:"/docs"},next:{to:"/docs/privacy-policy",label:"Privacy Policy",sublabel:"Legal"}})]});function Ace(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const U$e=Ace,Dce=new If("auth","Firebase",Ace());/**
1114 * @license
1115 * Copyright 2020 Google LLC
1116 *
1117 * Licensed under the Apache License, Version 2.0 (the "License");
1118 * you may not use this file except in compliance with the License.
1119 * You may obtain a copy of the License at
1120 *
1121 *   http://www.apache.org/licenses/LICENSE-2.0
1122 *
1123 * Unless required by applicable law or agreed to in writing, software
1124 * distributed under the License is distributed on an "AS IS" BASIS,
1125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1126 * See the License for the specific language governing permissions and
1127 * limitations under the License.
1128 */const uT=new GE("@firebase/auth");function G$e(t,...e){uT.logLevel<=Gr.WARN&&uT.warn(`Auth (${Gy}): ${t}`,...e)}function wk(t,...e){uT.logLevel<=Gr.ERROR&&uT.error(`Auth (${Gy}): ${t}`,...e)}/**
1129 * @license
1130 * Copyright 2020 Google LLC
1131 *
1132 * Licensed under the Apache License, Version 2.0 (the "License");
1133 * you may not use this file except in compliance with the License.
1134 * You may obtain a copy of the License at
1135 *
1136 *   http://www.apache.org/licenses/LICENSE-2.0
1137 *
1138 * Unless required by applicable law or agreed to in writing, software
1139 * distributed under the License is distributed on an "AS IS" BASIS,
1140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1141 * See the License for the specific language governing permissions and
1142 * limitations under the License.
1143 */function Mo(t,...e){throw Y3(t,...e)}function pl(t,...e){return Y3(t,...e)}function q3(t,e,r){const n=Object.assign(Object.assign({},U$e()),{[e]:r});return new If("auth","Firebase",n).create(e,{appName:t.name})}function uu(t){return q3(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function W$e(t,e,r){const n=r;if(!(e instanceof n))throw n.name!==e.constructor.name&&Mo(t,"argument-error"),q3(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Y3(t,...e){if(typeof t!="string"){const r=e[0],n=[...e.slice(1)];return n[0]&&(n[0].appName=t.name),t._errorFactory.create(r,...n)}return Dce.create(t,...e)}function Et(t,e,...r){if(!t)throw Y3(e,...r)}function Jc(t){const e="INTERNAL ASSERTION FAILED: "+t;throw wk(e),new Error(e)}function Du(t,e){t||Jc(e)}/**
1144 * @license
1145 * Copyright 2020 Google LLC
1146 *
1147 * Licensed under the Apache License, Version 2.0 (the "License");
1148 * you may not use this file except in compliance with the License.
1149 * You may obtain a copy of the License at
1150 *
1151 *   http://www.apache.org/licenses/LICENSE-2.0
1152 *
1153 * Unless required by applicable law or agreed to in writing, software
1154 * distributed under the License is distributed on an "AS IS" BASIS,
1155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1156 * See the License for the specific language governing permissions and
1157 * limitations under the License.
1158 */function cF(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function H$e(){return z7()==="http:"||z7()==="https:"}function z7(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/**
1159 * @license
1160 * Copyright 2020 Google LLC
1161 *
1162 * Licensed under the Apache License, Version 2.0 (the "License");
1163 * you may not use this file except in compliance with the License.
1164 * You may obtain a copy of the License at
1165 *
1166 *   http://www.apache.org/licenses/LICENSE-2.0
1167 *
1168 * Unless required by applicable law or agreed to in writing, software
1169 * distributed under the License is distributed on an "AS IS" BASIS,
1170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1171 * See the License for the specific language governing permissions and
1172 * limitations under the License.
1173 */function q$e(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(H$e()||Eoe()||"connection"in navigator)?navigator.onLine:!0}function Y$e(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
1174 * @license
1175 * Copyright 2020 Google LLC
1176 *
1177 * Licensed under the Apache License, Version 2.0 (the "License");
1178 * you may not use this file except in compliance with the License.
1179 * You may obtain a copy of the License at
1180 *
1181 *   http://www.apache.org/licenses/LICENSE-2.0
1182 *
1183 * Unless required by applicable law or agreed to in writing, software
1184 * distributed under the License is distributed on an "AS IS" BASIS,
1185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1186 * See the License for the specific language governing permissions and
1187 * limitations under the License.
1188 */class Ow{constructor(e,r){this.shortDelay=e,this.longDelay=r,Du(r>e,"Short delay should be less than long delay!"),this.isMobile=s2e()||o2e()}get(){return q$e()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
1189 * @license
1190 * Copyright 2020 Google LLC
1191 *
1192 * Licensed under the Apache License, Version 2.0 (the "License");
1193 * you may not use this file except in compliance with the License.
1194 * You may obtain a copy of the License at
1195 *
1196 *   http://www.apache.org/licenses/LICENSE-2.0
1197 *
1198 * Unless required by applicable law or agreed to in writing, software
1199 * distributed under the License is distributed on an "AS IS" BASIS,
1200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1201 * See the License for the specific language governing permissions and
1202 * limitations under the License.
1203 */function K3(t,e){Du(t.emulator,"Emulator should always be set here");const{url:r}=t.emulator;return e?`${r}${e.startsWith("/")?e.slice(1):e}`:r}/**
1204 * @license
1205 * Copyright 2020 Google LLC
1206 *
1207 * Licensed under the Apache License, Version 2.0 (the "License");
1208 * you may not use this file except in compliance with the License.
1209 * You may obtain a copy of the License at
1210 *
1211 *   http://www.apache.org/licenses/LICENSE-2.0
1212 *
1213 * Unless required by applicable law or agreed to in writing, software
1214 * distributed under the License is distributed on an "AS IS" BASIS,
1215 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1216 * See the License for the specific language governing permissions and
1217 * limitations under the License.
1218 */class Oce{static initialize(e,r,n){this.fetchImpl=e,r&&(this.headersImpl=r),n&&(this.responseImpl=n)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jc("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jc("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jc("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
1219 * @license
1220 * Copyright 2020 Google LLC
1221 *
1222 * Licensed under the Apache License, Version 2.0 (the "License");
1223 * you may not use this file except in compliance with the License.
1224 * You may obtain a copy of the License at
1225 *
1226 *   http://www.apache.org/licenses/LICENSE-2.0
1227 *
1228 * Unless required by applicable law or agreed to in writing, software
1229 * distributed under the License is distributed on an "AS IS" BASIS,
1230 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1231 * See the License for the specific language governing permissions and
1232 * limitations under the License.
1233 */const K$e={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-rec
1233aptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
1234 * @license
1235 * Copyright 2020 Google LLC
1236 *
1237 * Licensed under the Apache License, Version 2.0 (the "License");
1238 * you may not use this file except in compliance with the License.
1239 * You may obtain a copy of the License at
1240 *
1241 *   http://www.apache.org/licenses/LICENSE-2.0
1242 *
1243 * Unless required by applicable law or agreed to in writing, software
1244 * distributed under the License is distributed on an "AS IS" BASIS,
1245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1246 * See the License for the specific language governing permissions and
1247 * limitations under the License.
1248 */const Q$e=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Z$e=new Ow(3e4,6e4);function Ku(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Lo(t,e,r,n,i={}){return Rce(t,i,async()=>{let s={},a={};n&&(e==="GET"?a=n:s={body:JSON.stringify(n)});const o=Ew(Object.assign({key:t.config.apiKey},a)).slice(1),c=await t._getAdditionalHeaders();c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode);const u=Object.assign({method:e,headers:c},s);return a2e()||(u.referrerPolicy="no-referrer"),t.emulatorConfig&&Uy(t.emulatorConfig.host)&&(u.credentials="include"),Oce.fetch()(await Ice(t,t.config.apiHost,r,o),u)})}async function Rce(t,e,r){t._canInitEmulator=!1;const n=Object.assign(Object.assign({},K$e),e);try{const i=new J$e(t),s=await Promise.race([r(),i.promise]);i.clearNetworkTimeout();const a=await s.json();if("needConfirmation"in a)throw q_(t,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{const o=s.ok?a.errorMessage:a.error.message,[c,u]=o.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw q_(t,"credential-already-in-use",a);if(c==="EMAIL_EXISTS")throw q_(t,"email-already-in-use",a);if(c==="USER_DISABLED")throw q_(t,"user-disabled",a);const d=n[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw q3(t,d,u);Mo(t,d)}}catch(i){if(i instanceof Ha)throw i;Mo(t,"network-request-failed",{message:String(i)})}}async function Rw(t,e,r,n,i={}){const s=await Lo(t,e,r,n,i);return"mfaPendingCredential"in s&&Mo(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function Ice(t,e,r,n){const i=`${e}${r}?${n}`,s=t,a=s.config.emulator?K3(t.config,i):`${t.config.apiScheme}://${i}`;return Q$e.includes(r)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(a).toString():a}function X$e(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class J$e{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((r,n)=>{this.timer=setTimeout(()=>n(pl(this.auth,"network-request-failed")),Z$e.get())})}}function q_(t,e,r){const n={appName:t.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);const i=pl(t,e,n);return i.customData._tokenResponse=r,i}function B7(t){return t!==void 0&&t.enterprise!==void 0}class eFe{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const r of this.recaptchaEnforcementState)if(r.provider&&r.provider===e)return X$e(r.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PRO
1248VIDER")}}async function tFe(t,e){return Lo(t,"GET","/v2/recaptchaConfig",Ku(t,e))}/**
1249 * @license
1250 * Copyright 2020 Google LLC
1251 *
1252 * Licensed under the Apache License, Version 2.0 (the "License");
1253 * you may not use this file except in compliance with the License.
1254 * You may obtain a copy of the License at
1255 *
1256 *   http://www.apache.org/licenses/LICENSE-2.0
1257 *
1258 * Unless required by applicable law or agreed to in writing, software
1259 * distributed under the License is distributed on an "AS IS" BASIS,
1260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261 * See the License for the specific language governing permissions and
1262 * limitations under the License.
1263 */async function rFe(t,e){return Lo(t,"POST","/v1/accounts:delete",e)}async function nFe(t,e){return Lo(t,"POST","/v1/accounts:update",e)}async function dT(t,e){return Lo(t,"POST","/v1/accounts:lookup",e)}/**
1264 * @license
1265 * Copyright 2020 Google LLC
1266 *
1267 * Licensed under the Apache License, Version 2.0 (the "License");
1268 * you may not use this file except in compliance with the License.
1269 * You may obtain a copy of the License at
1270 *
1271 *   http://www.apache.org/licenses/LICENSE-2.0
1272 *
1273 * Unless required by applicable law or agreed to in writing, software
1274 * distributed under the License is distributed on an "AS IS" BASIS,
1275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1276 * See the License for the specific language governing permissions and
1277 * limitations under the License.
1278 */function wx(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function iFe(t,e=!1){const r=zn(t),n=await r.getIdToken(e),i=Q3(n);Et(i&&i.exp&&i.auth_time&&i.iat,r.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,a=s?.sign_in_provider;return{claims:i,token:n,authTime:wx(tA(i.auth_time)),issuedAtTime:wx(tA(i.iat)),expirationTime:wx(tA(i.exp)),signInProvider:a||null,signInSecondFactor:s?.sign_in_second_factor||null}}function tA(t){return Number(t)*1e3}function Q3(t){const[e,r,n]=t.split(".");if(e===void 0||r===void 0||n===void 0)return wk("JWT malformed, contained fewer than 3 sections"),null;try{const i=boe(r);return i?JSON.parse(i):(wk("Failed to decode base64 JWT payload"),null)}catch(i){return wk("Caught error parsing JWT payload as JSON",i?.toString()),null}}function V7(t){const e=Q3(t);return Et(e,"internal-error"),Et(typeof e.exp<"u","internal-error"),Et(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
1279 * @license
1280 * Copyright 2020 Google LLC
1281 *
1282 * Licensed under the Apache License, Version 2.0 (the "License");
1283 * you may not use this file except in compliance with the License.
1284 * You may obtain a copy of the License at
1285 *
1286 *   http://www.apache.org/licenses/LICENSE-2.0
1287 *
1288 * Unless required by applicable law or agreed to in writing, software
1289 * distributed under the License is distributed on an "AS IS" BASIS,
1290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1291 * See the License for the specific language governing permissions and
1292 * limitations under the License.
1293 */async function hp(t,e,r=!1){if(r)return e;try{return await e}catch(n){throw n instanceof Ha&&sFe(n)&&t.auth.currentUser===t&&await t.auth.signOut(),n}}function sFe({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
1294 * @license
1295 * Copyright 2020 Google LLC
1296 *
1297 * Licensed under the Apache License, Version 2.0 (the "License");
1298 * you may not use this file except in compliance with the License.
1299 * You may obtain a copy of the License at
1300 *
1301 *   http://www.apache.org/licenses/LICENSE-2.0
1302 *
1303 * Unless required by applicable law or agreed to in writing, software
1304 * distributed under the License is distributed on an "AS IS" BASIS,
1305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1306 * See the License for the specific language governing permissions and
1307 * limitations under the License.
1308 */class aFe{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var r;if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const i=((r=this.user.stsTokenManager.expirationTime)!==null&&r!==void 0?r:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},r)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
1309 * @license
1310 * Copyright 2020 Google LLC
1311 *
1312 * Licensed under the Apache License, Version 2.0 (the "License");
1313 * you may not use this file except in compliance with the License.
1314 * You may obtain a copy of the License at
1315 *
1316 *   http://www.apache.org/licenses/LICENSE-2.0
1317 *
1318 * Unless required by applicable law or agreed to in writing, software
1319 * distributed under the License is distributed on an "AS IS" BASIS,
1320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1321 * See the License for the specific language governing permissions and
1322 * limitations under the License.
1323 */class uF{constructor(e,r){this.createdAt=e,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=wx(this.lastLoginAt),this.creationTime=wx(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
1324 * @license
1325 * Copyright 2019 Google LLC
1326 *
1327 * Licensed under the Apache License, Version 2.0 (the "License");
1328 * you may not use this file except in compliance with the License.
1329 * You may obtain a copy of the License at
1330 *
1331 *   http://www.apache.org/licenses/LICENSE-2.0
1332 *
1333 * Unless required by applicable law or agreed to in writing, software
1334 * distributed under the License is distributed on an "AS IS" BASIS,
1335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1336 * See the License for the specific language governing permissions and
1337 * limitations under the License.
1338 */async function db(t){var e;const r=t.auth,n=await t.getIdToken(),i=await hp(t,dT(r,{idToken:n}));Et(i?.users.length,r,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const a=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?$ce(s.providerUserInfo):[],o=oFe(t.providerData,a),c=t.isAnonymous,u=!(t.email&&s.passwordHash)&&!o?.length,d=c?u:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new uF(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(t,f)}async function Lce(t){const e=zn(t);await db(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function oFe(t,e){return[...t.filter(n=>!e.some(i=>i.providerId===n.providerId)),...e]}function $ce(t){return t.map(e=>{var{providerId:r}=e,n=mw(e,["providerId"]);return{providerId:r,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}/**
1339 * @license
1340 * Copyright 2020 Google LLC
1341 *
1342 * Licensed under the Apache License, Version 2.0 (the "License");
1343 * you may not use this file except in compliance with the License.
1344 * You may obtain a copy of the License at
1345 *
1346 *   http://www.apache.org/licenses/LICENSE-2.0
1347 *
1348 * Unless required by applicable law or agreed to in writing, software
1349 * distributed under the License is distributed on an "AS IS" BASIS,
1350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351 * See the License for the specific language governing permissions and
1352 * limitations under the License.
1353 */async function lFe(t,e){const r=await Rce(t,{},async()=>{const n=Ew({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,a=await Ice(t,i,"/v1/token",`key=${s}`),o=await t._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:o,body:n};return t.emulatorConfig&&Uy(t.emulatorConfig.host)&&(c.credentials="include"),Oce.fetch()(a,c)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function cFe(t,e){return Lo(t,"POST","/v2/accounts:revokeToken",Ku(t,e))}/**
1354 * @license
1355 * Copyright 2020 Google LLC
1356 *
1357 * Licensed under the Apache License, Version 2.0 (the "License");
1358 * you may not use this file except in compliance with the License.
1359 * You may obtain a copy of the License at
1360 *
1361 *   http://www.apache.org/licenses/LICENSE-2.0
1362 *
1363 * Unless required by applicable law or agreed to in writing, software
1364 * distributed under the License is distributed on an "AS IS" BASIS,
1365 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1366 * See the License for the specific language governing permissions and
1367 * limitations under the License.
1368 */class bg{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Et(e.idToken,"internal-error"),Et(typeof e.idToken<"u","internal-error"),Et(typeof e.refreshToken<"u","internal-error");
1368const r="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):V7(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)}updateFromIdToken(e){Et(e.length!==0,"internal-error");const r=V7(e);this.updateTokensAndExpiration(e,null,r)}async getToken(e,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(Et(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,r){const{accessToken:n,refreshToken:i,expiresIn:s}=await lFe(e,r);this.updateTokensAndExpiration(n,i,Number(s))}updateTokensAndExpiration(e,r,n){this.refreshToken=r||null,this.accessToken=e||null,this.expirationTime=Date.now()+n*1e3}static fromJSON(e,r){const{refreshToken:n,accessToken:i,expirationTime:s}=r,a=new bg;return n&&(Et(typeof n=="string","internal-error",{appName:e}),a.refreshToken=n),i&&(Et(typeof i=="string","internal-error",{appName:e}),a.accessToken=i),s&&(Et(typeof s=="number","internal-error",{appName:e}),a.expirationTime=s),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new bg,this.toJSON())}_performRefresh(){return Jc("not implemented")}}/**
1369 * @license
1370 * Copyright 2020 Google LLC
1371 *
1372 * Licensed under the Apache License, Version 2.0 (the "License");
1373 * you may not use this file except in compliance with the License.
1374 * You may obtain a copy of the License at
1375 *
1376 *   http://www.apache.org/licenses/LICENSE-2.0
1377 *
1378 * Unless required by applicable law or agreed to in writing, software
1379 * distributed under the License is distributed on an "AS IS" BASIS,
1380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1381 * See the License for the specific language governing permissions and
1382 * limitations under the License.
1383 */function Sd(t,e){Et(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class ol{constructor(e){var{uid:r,auth:n,stsTokenManager:i}=e,s=mw(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new aFe(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=r,this.auth=n,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new uF(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const r=await hp(this,this.stsTokenManager.getToken(this.auth,e));return Et(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(e){return iFe(this,e)}reload(){return Lce(this)}_assign(e){this!==e&&(Et(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(r=>Object.assign({},r)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const r=new ol(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return r.metadata._copy(this.metadata),r}_onReload(e){Et(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,r=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),r&&await db(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ma(this.auth.app))return Promise.reject(uu(this.auth));const e=await this.getIdToken();return await hp(this,rFe(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
1383nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,r){var n,i,s,a,o,c,u,d;const f=(n=r.displayName)!==null&&n!==void 0?n:void 0,h=(i=r.email)!==null&&i!==void 0?i:void 0,m=(s=r.phoneNumber)!==null&&s!==void 0?s:void 0,y=(a=r.photoURL)!==null&&a!==void 0?a:void 0,x=(o=r.tenantId)!==null&&o!==void 0?o:void 0,v=(c=r._redirectEventId)!==null&&c!==void 0?c:void 0,_=(u=r.createdAt)!==null&&u!==void 0?u:void 0,S=(d=r.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:k,emailVerified:E,isAnonymous:T,providerData:N,stsTokenManager:j}=r;Et(k&&j,e,"internal-error");const M=bg.fromJSON(this.name,j);Et(typeof k=="string",e,"internal-error"),Sd(f,e.name),Sd(h,e.name),Et(typeof E=="boolean",e,"internal-error"),Et(typeof T=="boolean",e,"internal-error"),Sd(m,e.name),Sd(y,e.name),Sd(x,e.name),Sd(v,e.name),Sd(_,e.name),Sd(S,e.name);const O=new ol({uid:k,auth:e,email:h,emailVerified:E,displayName:f,isAnonymous:T,photoURL:y,phoneNumber:m,tenantId:x,stsTokenManager:M,createdAt:_,lastLoginAt:S});return N&&Array.isArray(N)&&(O.providerData=N.map(R=>Object.assign({},R))),v&&(O._redirectEventId=v),O}static async _fromIdTokenResponse(e,r,n=!1){const i=new bg;i.updateFromServerResponse(r);const s=new ol({uid:r.localId,auth:e,stsTokenManager:i,isAnonymous:n});return await db(s),s}static async _fromGetAccountInfoResponse(e,r,n){const i=r.users[0];Et(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?$ce(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!s?.length,o=new bg;o.updateFromIdToken(n);const c=new ol({uid:i.localId,auth:e,stsTokenManager:o,isAnonymous:a}),u={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new uF(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(c,u),c}}/**
1384 * @license
1385 * Copyright 2020 Google LLC
1386 *
1387 * Licensed under the Apache License, Version 2.0 (the "License");
1388 * you may not use this file except in compliance with the License.
1389 * You may obtain a copy of the License at
1390 *
1391 *   http://www.apache.org/licenses/LICENSE-2.0
1392 *
1393 * Unless required by applicable law or agreed to in writing, software
1394 * distributed under the License is distributed on an "AS IS" BASIS,
1395 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1396 * See the License for the specific language governing permissions and
1397 * limitations under the License.
1398 */const U7=new Map;function eu(t){Du(t instanceof Function,"Expected a class definition");let e=U7.get(t);return e?(Du(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,U7.set(t,e),e)}/**
1399 * @license
1400 * Copyright 2019 Google LLC
1401 *
1402 * Licensed under the Apache License, Version 2.0 (the "License");
1403 * you may not use this file except in compliance with the License.
1404 * You may obtain a copy of the License at
1405 *
1406 *   http://www.apache.org/licenses/LICENSE-2.0
1407 *
1408 * Unless required by applicable law or agreed to in writing, software
1409 * distributed under the License is distributed on an "AS IS" BASIS,
1410 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1411 * See the License for the specific language governing permissions and
1412 * limitations under the License.
1413 */class Fce{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,r){this.storage[e]=r}async _get(e){const r=this.storage[e];return r===void 0?null:r}async _remove(e){delete this.storage[e]}_addListener(e,r){}_removeListener(e,r){}}Fce.type="NONE";const G7=Fce;/**
1414 * @license
1415 * Copyright 2019 Google LLC
1416 *
1417 * Licensed under the Apache License, Version 2.0 (the "License");
1418 * you may not use this file except in compliance with the License.
1419 * You may obtain a copy of the License at
1420 *
1421 *   http://www.apache.org/licenses/LICENSE-2.0
1422 *
1423 * Unless required by applicable law or agreed to in writing, software
1424 * distributed under the License is distributed on an "AS IS" BASIS,
1425 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1426 * See the License for the specific language governing permissions and
1427 * limitations under the License.
1428 */function _k(t,e,r){return`firebase:${t}:${e}:${r}`}class wg{constructor(e,r,n){this.persistence=e,this.auth=r,this.userKey=n;const{config:i,name:s}=this.auth;this.fullUserKey=_k(this.userKey,i.apiKey,s),this.fullPersistenceKey=_k("persistence",i.apiKey,s),this.boundEventHandler=r._onStorageEvent.bind(r),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const r=await dT(this.auth,{idToken:e}).catch(()=>{});return r?ol._fromGetAccountInfoResponse(this.auth,r,e):null}return ol._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,r,n="authUser"){if(!r.length)return new wg(eu(G7),e,n);const i=(await Promise.all(r.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let s=i[0]||eu(G7);const a=_k(n,e.config.apiKey,e.name);let o=null;for(const u of r)try{const d=await u._get(a);if(d){let f;if(typeof d=="string"){const h=await dT(e,{idToken:d}).catch(()=>{});if(!h)break;f=await ol._fromGetAccountInfoResponse(e,h,d)}else f=ol._fromJSON(e,d);u!==s&&(o=f),s=u;break}}catch{}const c=i.filter(u=>u._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new wg(s,e,n):(s=c[0],o&&await s._set(a,o.toJSON()),await Promise.all(r.map(async u=>{if(u!==s)try{await u._remove(a)}catch{}})),new wg(s,e,n))}}/**
1429 * @license
1430 * Copyright 2020 Google LLC
1431 *
1432 * Licensed under the Apache License, Version 2.0 (the "License");
1433 * you may not use this file except in compliance with the License.
1434 * You may obtain a copy of the License at
1435 *
1436 *   http://www.apache.org/licenses/LICENSE-2.0
1437 *
1438 * Unless required by applicable law or agreed to in writing, software
1439 * distributed under the License is distributed on an "AS IS" BASIS,
1440 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1441 * See the License for the specific language governing permissions and
1442 * limitations under the License.
1443 */function W7(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Uce(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(zce(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Wce(e))return"Blackberry";if(Hce(e))return"Webos";if(Bce(e))return"Safari";if((e.includes("chrome/")||Vce(e))&&!e.includes("edge/"))return"Chrome";if(Gce(e))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(r);if(n?.length===2)return n[1]}return"Other"}function zce(t=Bs()){return/firefox\//i.test(t)}function Bce(t=Bs()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Vce(t=Bs()){return/crios\//i.test(t)}function Uce(t=Bs()){return/iemobile/i.test(t)}function Gce(t=Bs()){return/android/i.test(t)}function Wce(t=Bs()){return/blackberry/i.test(t)}function Hce(t=Bs()){return/webos/i.test(t)}function Z3(t=Bs()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function uFe(t=Bs()){var e;return Z3(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function dFe(){return l2e()&&document.documentMode===10}function qce(t=Bs()){return Z3(t)||Gce(t)||Hce(t)||Wce(t)||/windows phone/i.test(t)||Uce(t)}/**
1444 * @license
1445 * Copyright 2020 Google LLC
1446 *
1447 * Licensed under the Apache License, Version 2.0 (the "License");
1448 * you may not use this file except in compliance with the License.
1449 * You may obtain a copy of the License at
1450 *
1451 *   http://www.apache.org/licenses/LICENSE-2.0
1452 *
1453 * Unless required by applicable law or agreed to in writing, software
1454 * distributed under the License is distributed on an "AS IS" BASIS,
1455 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1456 * See the License for the specific language governing permissions and
1457 * limitations under the License.
1458 */function Yce(t,e=[]){let r;switch(t){case"Browser":r=W7(Bs());break;case"Worker":r=`${W7(Bs())}-${t}`;break;default:r=t}const n=e.length?e.join(","):"FirebaseCore-web";return`${r}/JsCore/${Gy}/${n}`}/**
1459 * @license
1460 * Copyright 2022 Google LLC
1461 *
1462 * Licensed under the Apache License, Version 2.0 (the "License");
1463 * you may not use this file except in compliance with the License.
1464 * You may obtain a copy of the License at
1465 *
1466 *   http://www.apache.org/licenses/LICENSE-2.0
1467 *
1468 * Unless required by applicable law or agreed to in writing, software
1469 * distributed under the License is distributed on an "AS IS" BASIS,
1470 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1471 * See the License for the specific language governing permissions and
1472 * limitations under the License.
1473 */class fFe{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,r){const n=s=>new Promise((a,o)=>{try{const c=e(s);a(c)}catch(c){o(c)}});n.onAbort=r,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const r=[];try{for(const n of this.queue)await n(e),n.onAbort&&r.push(n.onAbort)}catch(n){r.reverse();for(const i of r)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:n?.message})}}}/**
1474 * @license
1475 * Copyright 2023 Google LLC
1476 *
1477 * Licensed under the Apache License, Version 2.0 (the "License");
1478 * you may not use this file except in compliance with the License.
1479 * You may obtain a copy of the License at
1480 *
1481 *   http://www.apache.org/licenses/LICENSE-2.0
1482 *
1483 * Unless required by applicable law or agreed to in writing, software
1484 * distributed under the License is distributed on an "AS IS" BASIS,
1485 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1486 * See the License for the specific language governing permissions and
1487 * limitations under the License.
1488 */async function hFe(t,e={}){return Lo(t,"GET","/v2/passwordPolicy",Ku(t,e))}/**
1489 * @license
1490 * Copyright 2023 Google LLC
1491 *
1492 * Licensed under the Apache License, Version 2.0 (the "License");
1493 * you may not use this file except in compliance with the License.
1494 * You may obtain a copy of the License at
1495 *
1496 *   http://www.apache.org/licenses/LICENSE-2.0
1497 *
1498 * Unless required by applicable law or agreed to in writing, software
1499 * distributed under the License is distributed on an "AS IS" BASIS,
1500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1501 * See the License for the specific language governing permissions and
1502 * limitations under the License.
1503 */const pFe=6;class mFe{constructor(e){var r,n,i,s;const a=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(r=a.minPasswordLength)!==null&&r!==void 0?r:pFe,a.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=a.maxPasswordLength),a.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=a.containsLowercaseCharacter),a.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=a.containsUppercaseCharacter),a.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=a.containsNumericCharacter),a.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=a.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(n=e.allowedNonAlphanumericCharacters)===null||n===void 0?void 0:n.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var r,n,i,s,a,o;const c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,c),this.validatePasswordCharacterOptions(e,c),c.isValid&&
1503(c.isValid=(r=c.meetsMinPasswordLength)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(n=c.meetsMaxPasswordLength)!==null&&n!==void 0?n:!0),c.isValid&&(c.isValid=(i=c.containsLowercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(s=c.containsUppercaseLetter)!==null&&s!==void 0?s:!0),c.isValid&&(c.isValid=(a=c.containsNumericCharacter)!==null&&a!==void 0?a:!0),c.isValid&&(c.isValid=(o=c.containsNonAlphanumericCharacter)!==null&&o!==void 0?o:!0),c}validatePasswordLengthOptions(e,r){const n=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;n&&(r.meetsMinPasswordLength=e.length>=n),i&&(r.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let n;for(let i=0;i<e.length;i++)n=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(r,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,r,n,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
1504 * @license
1505 * Copyright 2020 Google LLC
1506 *
1507 * Licensed under the Apache License, Version 2.0 (the "License");
1508 * you may not use this file except in compliance with the License.
1509 * You may obtain a copy of the License at
1510 *
1511 *   http://www.apache.org/licenses/LICENSE-2.0
1512 *
1513 * Unless required by applicable law or agreed to in writing, software
1514 * distributed under the License is distributed on an "AS IS" BASIS,
1515 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1516 * See the License for the specific language governing permissions and
1517 * limitations under the License.
1518 */class gFe{constructor(e,r,n,i){this.app=e,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new H7(this),this.idTokenSubscription=new H7(this),this.beforeStateQueue=new fFe(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Dce,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,r){return r&&(this._popupRedirectResolver=eu(r)),this._initializationPromise=this.queue(async()=>{var n,i,s;if(!this._deleted&&(this.persistenceManager=await wg.create(this,e),(n=this._resolvePersistenceManagerAvailable)===null||n===void 0||n.call(this),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const r=await dT(this,{idToken:e}),n=await ol._fromGetAccountInfoResponse(this,r,e);await this.directlySetCurrentUser(n)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var r;if(Ma(this.app)){const a=this.app.settings.authIdToken;return a?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(a).then(o,o))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const a=(r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId,o=i?._redirectEventId,c=await this.tryRedirectSignIn(e);(!a||a===o)&&c?.user&&(i=c.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);
1518if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(a){i=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(a))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Et(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(e){try{await db(e)}catch(r){if(r?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Y$e()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ma(this.app))return Promise.reject(uu(this));const r=e?zn(e):null;return r&&Et(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(e,r=!1){if(!this._deleted)return e&&Et(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ma(this.app)?Promise.reject(uu(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ma(this.app)?Promise.reject(uu(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(eu(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const r=this._getPasswordPolicyInternal();return r.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await hFe(this),r=new mFe(e);this.tenantId===null?this._projectPasswordPolicy=r:this._tenantPasswordPolicies[this.tenantId]=r}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new If("auth","Firebase",e())}onAuthStateChanged(e,r,n){return this.registerStateListener(this.authStateSubscription,e,r,n)}beforeAuthStateChanged(e,r){return this.beforeStateQueue.pushCallback(e,r)}onIdTokenChanged(e,r,n){return this.registerStateListener(this.idTokenSubscription,e,r,n)}authStateReady(){return new Promise((e,r)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},r)}})}async revokeAccessToken(e){if(this.currentUser){const r=await this.currentUser.getIdToken(),n={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:r};this.tenantId!=null&&(n.tenantId=this.tenantId),await cFe(this,n)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,r){const n=await this.getOrInitRedirectPersistenceManager(r);return e===null?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const r=e&&eu(e)||this._popupRedirectResolver;Et(r,this,"argument-error"),this.redirectPersistenceManager=await wg.create(this,[eu(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var r,n;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)===null||r===void 0?void 0:r._redirectEventId)===e?this._currentUser:((n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=(r=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&r!==void 0?r:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,r,n,i){if(this._deleted)return()=>{};const s=typeof r=="function"?r:r.next.bind(r);let a=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Et(o,this,"internal-error"),o.then(()=>{a||s(this.currentUser)}),typeof r=="function"){const c=e.addObserver(r,n,i);return()=>{a=!0,c()}}else{const c=e.addObserver(r);return()=>{a=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Et(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Yce(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const r={"X-Client-Version":this.clientVersion};this.app.options.appId&&(r["X-Firebase-gmpid"]=this.app.options.appId);const n=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());n&&(r["X-Firebase-Client"]=n);const i=await this._getAppCheckToken();return i&&(r["X-Firebase-AppCheck"]=i),r}async _getAppCheckToken(){var e;if(Ma(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const r=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return r?.error&&G$e(`Error while retrieving App Check token: ${r.error}`),r?.token}}function Qu(t){return zn(t)}class H7{constructor(e){this.auth=e,this.observer=null,this.addObserver=p2e(r=>this.observer=r)}get next(){return Et(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
1519 * @license
1520 * Copyright 2020 Google LLC
1521 *
1522 * Licensed under the Apache License, Version 2.0 (the "License");
1523 * you may not use this file except in compliance with the License.
1524 * You may obtain a copy of the License at
1525 *
1526 *   http://www.apache.org/licenses/LICENSE-2.0
1527 *
1528 * Unless required by applicable law or agreed to in writing, software
1529 * distributed under the License is distributed on an "AS IS" BASIS,
1530 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1531 * See the License for the specific language governing permissions and
1532 * limitations under the License.
1533 */let ZE={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function yFe(t){ZE=t}function Kce(t){return ZE.loadJS(t)}function vFe(){return ZE.recaptchaEnterpriseScript}function xFe(){return ZE.gapiScript}function bFe(t){return`__${t}${Math.floor(Math.random()*1e6)}`}class wFe{constructor(){this.enterprise=new _Fe}ready(e){e()}execute(e,r){return Promise.resolve("token")}render(e,r){return""}}class _Fe{ready(e){e()}execute(e,r){return Promise.resolve("token")}render(e,r){return""}}const SFe="recaptcha-enterprise",Qce="NO_RECAPTCHA";class kFe{constructor(e){this.type=SFe,this.auth=Qu(e)}async verify(e="verify",r=!1){async function n(s){if(!r){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(a,o)=>{tFe(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>
1533{if(c.recaptchaKey===void 0)o(new Error("recaptcha Enterprise site key undefined"));else{const u=new eFe(c);return s.tenantId==null?s._agentRecaptchaConfig=u:s._tenantRecaptchaConfigs[s.tenantId]=u,a(u.siteKey)}}).catch(c=>{o(c)})})}function i(s,a,o){const c=window.grecaptcha;B7(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(u=>{a(u)}).catch(()=>{a(Qce)})}):o(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new wFe().execute("siteKey",{action:"verify"}):new Promise((s,a)=>{n(this.auth).then(o=>{if(!r&&B7(window.grecaptcha))i(o,s,a);else{if(typeof window>"u"){a(new Error("RecaptchaVerifier is only supported in browser"));return}let c=vFe();c.length!==0&&(c+=o),Kce(c).then(()=>{i(o,s,a)}).catch(u=>{a(u)})}}).catch(o=>{a(o)})})}}async function q7(t,e,r,n=!1,i=!1){const s=new kFe(t);let a;if(i)a=Qce;else try{a=await s.verify(r)}catch{a=await s.verify(r,!0)}const o=Object.assign({},e);if(r==="mfaSmsEnrollment"||r==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in o){const c=o.phoneEnrollmentInfo.phoneNumber,u=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:u,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const c=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return n?Object.assign(o,{captchaResp:a}):Object.assign(o,{captchaResponse:a}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function fT(t,e,r,n,i){var s;if(!((s=t._getRecaptchaConfig())===null||s===void 0)&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const a=await q7(t,e,r,r==="getOobCode");return n(t,a)}else return n(t,e).catch(async a=>{if(a.code==="auth/missing-recaptcha-token"){console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await q7(t,e,r,r==="getOobCode");return n(t,o)}else return Promise.reject(a)})}/**
1534 * @license
1535 * Copyright 2020 Google LLC
1536 *
1537 * Licensed under the Apache License, Version 2.0 (the "License");
1538 * you may not use this file except in compliance with the License.
1539 * You may obtain a copy of the License at
1540 *
1541 *   http://www.apache.org/licenses/LICENSE-2.0
1542 *
1543 * Unless required by applicable law or agreed to in writing, software
1544 * distributed under the License is distributed on an "AS IS" BASIS,
1545 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1546 * See the License for the specific language governing permissions and
1547 * limitations under the License.
1548 */function TFe(t,e){const r=Gp(t,"auth");if(r.isInitialized()){const i=r.getImmediate(),s=r.getOptions();if(zg(s,e??{}))return i;Mo(i,"already-initialized")}return r.initialize({options:e})}function CFe(t,e){const r=e?.persistence||[],n=(Array.isArray(r)?r:[r]).map(eu);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(n,e?.popupRedirectResolver)}function EFe(t,e,r){const n=Qu(t);Et(/^https?:\/\//.test(e),n,"invalid-emulator-scheme");const i=!1,s=Zce(e),{host:a,port:o}=jFe(e),c=o===null?"":`:${o}`,u={url:`${s}//${a}${c}/`},d=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!n._canInitEmulator){Et(n.config.emulator&&n.emulatorConfig,n,"emulator-config-failed"),Et(zg(u,n.config.emulator)&&zg(d,n.emulatorConfig),n,"emulator-config-failed");return}n.config.emulator=u,n.emulatorConfig=d,n.settings.appVerificationDisabledForTesting=!0,Uy(a)?(Toe(`${s}//${a}${c}`),Coe("Auth",!0)):NFe()}function Zce(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function jFe(t){const e=Zce(t),r=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!r)return{host:"",port:null};const n=r[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(n);if(i){const s=i[1];return{host:s,port:Y7(n.substr(s.length+1))}}else{const[s,a]=n.split(":");return{host:s,port:Y7(a)}}}function Y7(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function NFe(){function t(){const e=document.createElement("p"),r=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
1549 * @license
1550 * Copyright 2020 Google LLC
1551 *
1552 * Licensed under the Apache License, Version 2.0 (the "License");
1553 * you may not use this file except in compliance with the License.
1554 * You may obtain a copy of the License at
1555 *
1556 *   http://www.apache.org/licenses/LICENSE-2.0
1557 *
1558 * Unless required by applicable law or agreed to in writing, software
1559 * distributed under the License is distributed on an "AS IS" BASIS,
1560 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1561 * See the License for the specific language governing permissions and
1562 * limitations under the License.
1563 */class X3{constructor(e,r){this.providerId=e,this.signInMethod=r}toJSON(){return Jc("not implemented")}_getIdTokenResponse(e){return Jc("not implemented")}_linkToIdToken(e,r){return Jc("not implemented")}_getReauthenticationResolver(e){return Jc("not implemented")}}async function PFe(t,e){return Lo(t,"POST","/v1/accounts:update",e)}async function MFe(t,e){return Lo(t,"POST","/v1/accounts:signUp",e)}/**
1564 * @license
1565 * Copyright 2020 Google LLC
1566 *
1567 * Licensed under the Apache License, Version 2.0 (the "License");
1568 * you may not use this file except in compliance with the License.
1569 * You may obtain a copy of the License at
1570 *
1571 *   http://www.apache.org/licenses/LICENSE-2.0
1572 *
1573 * Unless required by applicable law or agreed to in writing, software
1574 * distributed under the License is distributed on an "AS IS" BASIS,
1575 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1576 * See the License for the specific language governing permissions and
1577 * limitations under the License.
1578 */async function AFe(t,e){return Rw(t,"POST","/v1/accounts:signInWithPassword",Ku(t,e))}async function Xce(t,e){return Lo(t,"POST","/v1/accounts:sendOobCode",Ku(t,e))}async function DFe(t,e){return Xce(t,e)}async function OFe(t,e){return Xce(t,e)}/**
1579 * @license
1580 * Copyright 2020 Google LLC
1581 *
1582 * Licensed under the Apache License, Version 2.0 (the "License");
1583 * you may not use this file except in compliance with the License.
1584 * You may obtain a copy of the License at
1585 *
1586 *   http://www.apache.org/licenses/LICENSE-2.0
1587 *
1588 * Unless required by applicable law or agreed to in writing, software
1589 * distributed under the License is distributed on an "AS IS" BASIS,
1590 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1591 * See the License for the specific language governing permissions and
1592 * limitations under the License.
1593 */async function RFe(t,e){return Rw(t,"POST","/v1/accounts:signInWithEmailLink",Ku(t,e))}async function IFe(t,e){return Rw(t,"POST","/v1/accounts:signInWithEmailLink",Ku(t,e))}/**
1594 * @license
1595 * Copyright 2020 Google LLC
1596 *
1597 * Licensed under the Apache License, Version 2.0 (the "License");
1598 * you may not use this file except in compliance with the License.
1599 * You may obtain a copy of the License at
1600 *
1601 *   http://www.apache.org/licenses/LICENSE-2.0
1602 *
1603 * Unless required by applicable law or agreed to in writing, software
1604 * distributed under the License is distributed on an "AS IS" BASIS,
1605 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1606 * See the License for the specific language governing permissions and
1607 * limitations under the License.
1608 */class fb extends X3{constructor(e,r,n,i=null){super("password",n),this._email=e,this._password=r,this._tenantId=i}static _fromEmailAndPassword(e,r){return new fb(e,r,"password")}static _fromEmailAndCode(e,r,n=null){return new fb(e,r,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e;if(r?.email&&r?.password){if(r.signInMethod==="password")return this._fromEmailAndPassword(r.email,r.password);if(r.signInMethod==="emailLink")return this._fromEmailAndCode(r.email,r.password,r.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return fT(e,r,"signInWithPassword",AFe);case"emailLink":return RFe(e,{email:this._email,oobCode:this._password});default:Mo(e,"internal-error")}}async _linkToIdToken(e,r){switch(this.signInMethod){case"password":const n={idToken:r,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return fT(e,n,"signUpPassword",MFe);case"emailLink":return IFe(e,{idToken:r,email:this._email,oobCode:this._password});default:Mo(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
1609 * @license
1610 * Copyright 2020 Google LLC
1611 *
1612 * Licensed under the Apache License, Version 2.0 (the "License");
1613 * you may not use this file except in compliance with the License.
1614 * You may obtain a copy of the License at
1615 *
1616 *   http://www.apache.org/licenses/LICENSE-2.0
1617 *
1618 * Unless required by applicable law or agreed to in writing, software
1619 * distributed under the License is distributed on an "AS IS" BASIS,
1620 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1621 * See the License for the specific language governing permissions and
1622 * limitations under the License.
1623 */async function _g(t,e){return Rw(t,"POST","/v1/accounts:signInWithIdp",Ku(t,e))}/**
1624 * @license
1625 * Copyright 2020 Google LLC
1626 *
1627 * Licensed under the Apache License, Version 2.0 (the "License");
1628 * you may not use this file except in compliance with the License.
1629 * You may obtain a copy of the License at
1630 *
1631 *   http://www.apache.org/licenses/LICENSE-2.0
1632 *
1633 * Unless required by applicable law or agreed to in writing, software
1634 * distributed under the License is distributed on an "AS IS" BASIS,
1635 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1636 * See the License for the specific language governing permissions and
1637 * limitations under the License.
1638 */const LFe="http://localhost";class pp extends X3{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const r=new pp(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(r.idToken=e.idToken),e.accessToken&&(r.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(r.nonce=e.nonce),e.pendingToken&&(r.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(r.accessToken=e.oauthToken,r.secret=e.oauthTokenSecret):Mo("argument-error"),r}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1638once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e,{providerId:n,signInMethod:i}=r,s=mw(r,["providerId","signInMethod"]);if(!n||!i)return null;const a=new pp(n,i);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){const r=this.buildRequest();return _g(e,r)}_linkToIdToken(e,r){const n=this.buildRequest();return n.idToken=r,_g(e,n)}_getReauthenticationResolver(e){const r=this.buildRequest();return r.autoCreate=!1,_g(e,r)}buildRequest(){const e={requestUri:LFe,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),e.postBody=Ew(r)}return e}}/**
1639 * @license
1640 * Copyright 2020 Google LLC
1641 *
1642 * Licensed under the Apache License, Version 2.0 (the "License");
1643 * you may not use this file except in compliance with the License.
1644 * You may obtain a copy of the License at
1645 *
1646 *   http://www.apache.org/licenses/LICENSE-2.0
1647 *
1648 * Unless required by applicable law or agreed to in writing, software
1649 * distributed under the License is distributed on an "AS IS" BASIS,
1650 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1651 * See the License for the specific language governing permissions and
1652 * limitations under the License.
1653 */function $Fe(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function FFe(t){const e=Qv(Zv(t)).link,r=e?Qv(Zv(e)).deep_link_id:null,n=Qv(Zv(t)).deep_link_id;return(n?Qv(Zv(n)).link:null)||n||r||e||t}class J3{constructor(e){var r,n,i,s,a,o;const c=Qv(Zv(e)),u=(r=c.apiKey)!==null&&r!==void 0?r:null,d=(n=c.oobCode)!==null&&n!==void 0?n:null,f=$Fe((i=c.mode)!==null&&i!==void 0?i:null);Et(u&&d&&f,"argument-error"),this.apiKey=u,this.operation=f,this.code=d,this.continueUrl=(s=c.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(a=c.lang)!==null&&a!==void 0?a:null,this.tenantId=(o=c.tenantId)!==null&&o!==void 0?o:null}static parseLink(e){const r=FFe(e);try{return new J3(r)}catch{return null}}}/**
1654 * @license
1655 * Copyright 2020 Google LLC
1656 *
1657 * Licensed under the Apache License, Version 2.0 (the "License");
1658 * you may not use this file except in compliance with the License.
1659 * You may obtain a copy of the License at
1660 *
1661 *   http://www.apache.org/licenses/LICENSE-2.0
1662 *
1663 * Unless required by applicable law or agreed to in writing, software
1664 * distributed under the License is distributed on an "AS IS" BASIS,
1665 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1666 * See the License for the specific language governing permissions and
1667 * limitations under the License.
1668 */class Ou{constructor(){this.providerId=Ou.PROVIDER_ID}static credential(e,r){return fb._fromEmailAndPassword(e,r)}static credentialWithLink(e,r){const n=J3.parseLink(r);return Et(n,"argument-error"),fb._fromEmailAndCode(e,n.code,n.tenantId)}}Ou.PROVIDER_ID="password";Ou.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Ou.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
1669 * @license
1670 * Copyright 2020 Google LLC
1671 *
1672 * Licensed under the Apache License, Version 2.0 (the "License");
1673 * you may not use this file except in compliance with the License.
1674 * You may obtain a copy of the License at
1675 *
1676 *   http://www.apache.org/licenses/LICENSE-2.0
1677 *
1678 * Unless required by applicable law or agreed to in writing, software
1679 * distributed under the License is distributed on an "AS IS" BASIS,
1680 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1681 * See the License for the specific language governing permissions and
1682 * limitations under the License.
1683 */class eB{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
1684 * @license
1685 * Copyright 2019 Google LLC
1686 *
1687 * Licensed under the Apache License, Version 2.0 (the "License");
1688 * you may not use this file except in compliance with the License.
1689 * You may obtain a copy of the License at
1690 *
1691 *   http://www.apache.org/licenses/LICENSE-2.0
1692 *
1693 * Unless required by applicable law or agreed to in writing, software
1694 * distributed under the License is distributed on an "AS IS" BASIS,
1695 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1696 * See the License for the specific language governing permissions and
1697 * limitations under the License.
1698 */class Iw extends eB{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
1699 * @license
1700 * Copyright 2020 Google LLC
1701 *
1702 * Licensed under the Apache License, Version 2.0 (the "License");
1703 * you may not use this file except in compliance with the License.
1704 * You may obtain a copy of the License at
1705 *
1706 *   http://www.apache.org/licenses/LICENSE-2.0
1707 *
1708 * Unless required by applicable law or agreed to in writing, software
1709 * distributed under the License is distributed on an "AS IS" BASIS,
1710 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1711 * See the License for the specific language governing permissions and
1712 * limitations under the License.
1713 */class Ld extends Iw{constructor(){super("facebook.com")}static credential(e){return pp._fromParams({providerId:Ld.PROVIDER_ID,signInMethod:Ld.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ld.credentialFromTaggedObject(e)}static credentialFromError(e){return Ld.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Ld.credential(e.oauthAccessToken)}catch{return null}}}Ld.FACEBOOK_SIGN_IN_METHOD="facebook.com";Ld.PROVIDER_ID="facebook.com";/**
1714 * @license
1715 * Copyright 2020 Google LLC
1716 *
1717 * Licensed under the Apache License, Version 2.0 (the "License");
1718 * you may not use this file except in compliance with the License.
1719 * You may obtain a copy of the License at
1720 *
1721 *   http://www.apache.org/licenses/LICENSE-2.0
1722 *
1723 * Unless required by applicable law or agreed to in writing, software
1724 * distributed under the License is distributed on an "AS IS" BASIS,
1725 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1726 * See the License for the specific language governing permissions and
1727 * limitations under the License.
1728 */class Qc extends Iw{constructor(){super("google.com"),this.addScope("profile")}static credential(e,r){return pp._fromParams({providerId:Qc.PROVIDER_ID,signInMethod:Qc.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:r})}static credentialFromResult(e){return Qc.credentialFromTaggedObject(e)}static credentialFromError(e){return Qc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:r,oauthAccessToken:n}=e;if(!r&&!n)return null;try{return Qc.credential(r,n)}catch{return null}}}Qc.GOOGLE_SIGN_IN_METHOD="google.com";Qc.PROVIDER_ID="google.com";/**
1729 * @license
1730 * Copyright 2020 Google LLC
1731 *
1732 * Licensed under the Apache License, Version 2.0 (the "License");
1733 * you may not use this file except in compliance with the License.
1734 * You may obtain a copy of the License at
1735 *
1736 *   http://www.apache.org/licenses/LICENSE-2.0
1737 *
1738 * Unless required by applicable law or agreed to in writing, software
1739 * distributed under the License is distributed on an "AS IS" BASIS,
1740 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1741 * See the License for the specific language governing permissions and
1742 * limitations under the License.
1743 */class $d extends Iw{constructor(){super("github.com")}static credential(e){return pp._fromParams({providerId:$d.PROVIDER_ID,signInMethod:$d.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return $d.credentialFromTaggedObject(e)}static credentialFromError(e){return $d.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return $d.credential(e.oauthAccessToken)}catch{return null}}}$d.GITHUB_SIGN_IN_METHOD="github.com";$d.PROVIDER_ID="github.com";/**
1744 * @license
1745 * Copyright 2020 Google LLC
1746 *
1747 * Licensed under the Apache License, Version 2.0 (the "License");
1748 * you may not use this file except in compliance with the License.
1749 * You may obtain a copy of the License at
1750 *
1751 *   http://www.apache.org/licenses/LICENSE-2.0
1752 *
1753 * Unless required by applicable law or agreed to in writing, software
1754 * distributed under the License is distributed on an "AS IS" BASIS,
1755 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1756 * See the License for the specific language governing permissions and
1757 * limitations under the License.
1758 */class Fd extends Iw{constructor(){super("twitter.com")}static credential(e,r){return pp._fromParams({providerId:Fd.PROVIDER_ID,signInMethod:Fd.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:r})}static credentialFromResult(e){return Fd.credentialFromTaggedObject(e)}static credentialFromError(e){return Fd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:r,oauthTokenSecret:n}=e;if(!r||!n)return null;try{return Fd.credential(r,n)}catch{return null}}}Fd.TWITTER_SIGN_IN_METHOD="twitter.com";Fd.PROVIDER_ID="twitter.com";/**
1759 * @license
1760 * Copyright 2020 Google LLC
1761 *
1762 * Licensed under the Apache License, Version 2.0 (the "License");
1763 * you may not use this file except in compliance with the License.
1764 * You may obtain a copy of the License at
1765 *
1766 *   http://www.apache.org/licenses/LICENSE-2.0
1767 *
1768 * Unless required by applicable law or agreed to in writing, software
1769 * distributed under the License is distributed on an "AS IS" BASIS,
1770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1771 * See the License for the specific language governing permissions and
1772 * limitations under the License.
1773 */async function zFe(t,e){return Rw(t,"POST","/v1/accounts:signUp",Ku(t,e))}/**
1774 * @license
1775 * Copyright 2020 Google LLC
1776 *
1777 * Licensed under the Apache License, Version 2.0 (the "License");
1778 * you may not use this file except in compliance with the License.
1779 * You may obtain a copy of the License at
1780 *
1781 *   http://www.apache.org/licenses/LICENSE-2.0
1782 *
1783 * Unless required by applicable law or agreed to in writing, software
1784 * distributed under the License is distributed on an "AS IS" BASIS,
1785 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1786 * See the License for the specific language governing permissions and
1787 * limitations under the License.
1788 */class mp{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,r,n,i=!1){const s=await ol._fromIdTokenResponse(e,n,i),a=K7(n);return new mp({user:s,providerId:a,_tokenResponse:n,operationType:r})}static async _forOperation(e,r,n){await e._updateTokensIfNecessary(n,!0);const i=K7(n);return new mp({user:e,providerId:i,_tokenResponse:n,operationType:r})}}function K7(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
1789 * @license
1790 * Copyright 2020 Google LLC
1791 *
1792 * Licensed under the Apache License, Version 2.0 (the "License");
1793 * you may not use this file except in compliance with the License.
1794 * You may obtain a copy of the License at
1795 *
1796 *   http://www.apache.org/licenses/LICENSE-2.0
1797 *
1798 * Unless required by applicable law or agreed to in writing, software
1799 * distributed under the License is distributed on an "AS IS" BASIS,
1800 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1801 * See the License for the specific language governing permissions and
1802 * limitations under the License.
1803 */class hT extends Ha{constructor(e,r,n,i){var s;super(r.code,r.message),this.operationType=n,this.user=i,Object.setPrototypeOf(this,hT.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:r.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,r,n,i){return new hT(e,r,n,i)}}function Jce(t,e,r,n){return(e==="reauthenticate"?r._getReauthenticationResolver(t):r._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?hT._fromErrorAndOperation(t,s,e,n):s})}/**
1804 * @license
1805 * Copyright 2020 Google LLC
1806 *
1807 * Licensed under the Apache License, Version 2.0 (the "License");
1808 * you may not use this file except in compliance with the License.
1809 * You may obtain a copy of the License at
1810 *
1811 *   http://www.apache.org/licenses/LICENSE-2.0
1812 *
1813 * Unless required by applicable law or agreed to in writing, software
1814 * distributed under the License is distributed on an "AS IS" BASIS,
1815 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1816 * See the License for the specific language governing permissions and
1817 * limitations under the License.
1818 */function eue(t){return new Set(t.map(({providerId:e})=>e).filter(e=>!!e))}/**
1819 * @license
1820 * Copyright 2019 Google LLC
1821 *
1822 * Licensed under the Apache License, Version 2.0 (the "License");
1823 * you may not use this file except in compliance with the License.
1824 * You may obtain a copy of the License at
1825 *
1826 *   http://www.apache.org/licenses/LICENSE-2.0
1827 *
1828 * Unless required by applicable law or agreed to in writing, software
1829 * distributed under the License is distributed on an "AS IS" BASIS,
1830 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1831 * See the License for the specific language governing permissions and
1832 * limitations under the License.
1833 */async function BFe(t,e){const r=zn(t);await rue(!0,r,e);const{providerUserInfo:n}=await nFe(r.auth,{idToken:await r.getIdToken(),deleteProvider:[e]}),i=eue(n||[]);return r.providerData=r.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(r.phoneNumber=null),await r.auth._persistUserIfCurrent(r),r}async function tue(t,e,r=!1){const n=await hp(t,e._linkToIdToken(t.auth,await t.getIdToken()),r);return mp._forOperation(t,"link",n)}async function rue(t,e,r){await db(e);const n=eue(e.providerData),i=t===!1?"provider-already-linked":"no-such-provider";Et(n.has(r)===t,e.auth,i)}/**
1834 * @license
1835 * Copyright 2019 Google LLC
1836 *
1837 * Licensed under the Apache License, Version 2.0 (the "License");
1838 * you may not use this file except in compliance with the License.
1839 * You may obtain a copy of the License at
1840 *
1841 *   http://www.apache.org/licenses/LICENSE-2.0
1842 *
1843 * Unless required by applicable law or agreed to in writing, software
1844 * distributed under the License is distributed on an "AS IS" BASIS,
1845 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1846 * See the License for the specific language governing permissions and
1847 * limitations under the License.
1848 */async function nue(t,e,r=!1){const{auth:n}=t;if(Ma(n.app))return Promise.reject(uu(n));const i="reauthenticate";try{const s=await hp(t,Jce(n,i,e,t),r);Et(s.idToken,n,"internal-error");const a=Q3(s.idToken);Et(a,n,"internal-error");const{sub:o}=a;return Et(t.uid===o,n,"user-mismatch"),mp._forOperation(t,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&Mo(n,"user-mismatch"),s}}/**
1849 * @license
1850 * Copyright 2020 Google LLC
1851 *
1852 * Licensed under the Apache License, Version 2.0 (the "License");
1853 * you may not use this file except in compliance with the License.
1854 * You may obtain a copy of the License at
1855 *
1856 *   http://www.apache.org/licenses/LICENSE-2.0
1857 *
1858 * Unless required by applicable law or agreed to in writing, software
1859 * distributed under the License is distributed on an "AS IS" BASIS,
1860 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1861 * See the License for the specific language governing permissions and
1862 * limitations under the License.
1863 */async function iue(t,e,r=!1){if(Ma(t.app))return Promise.reject(uu(t));const n="signIn",i=await Jce(t,n,e),s=await mp._fromIdTokenResponse(t,n,i);return r||await t._updateCurrentUser(s.user),s}async function VFe(t,e){return iue(Qu(t),e)}async function UFe(t,e){const r=zn(t);return await rue(!1,r,e.providerId),tue(r,e)}async function sue(t,e){return nue(zn(t),e)}/**
1864 * @license
1865 * Copyright 2020 Google LLC
1866 *
1867 * Licensed under the Apache License, Version 2.0 (the "License");
1868 * you may not use this file except in compliance with the License.
1869 * You may obtain a copy of the License at
1870 *
1871 *   http://www.apache.org/licenses/LICENSE-2.0
1872 *
1873 * Unless required by applicable law or agreed to in writing, software
1874 * distributed under the License is distributed on an "AS IS" BASIS,
1875 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1876 * See the License for the specific language governing permissions and
1877 * limitations under the License.
1878 */function GFe(t,e,r){var n;Et(((n=r.url)===null||n===void 0?void 0:n.length)>
18780,t,"invalid-continue-uri"),Et(typeof r.dynamicLinkDomain>"u"||r.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),Et(typeof r.linkDomain>"u"||r.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=r.url,e.dynamicLinkDomain=r.dynamicLinkDomain,e.linkDomain=r.linkDomain,e.canHandleCodeInApp=r.handleCodeInApp,r.iOS&&(Et(r.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=r.iOS.bundleId),r.android&&(Et(r.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=r.android.installApp,e.androidMinimumVersionCode=r.android.minimumVersion,e.androidPackageName=r.android.packageName)}/**
1879 * @license
1880 * Copyright 2020 Google LLC
1881 *
1882 * Licensed under the Apache License, Version 2.0 (the "License");
1883 * you may not use this file except in compliance with the License.
1884 * You may obtain a copy of the License at
1885 *
1886 *   http://www.apache.org/licenses/LICENSE-2.0
1887 *
1888 * Unless required by applicable law or agreed to in writing, software
1889 * distributed under the License is distributed on an "AS IS" BASIS,
1890 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1891 * See the License for the specific language governing permissions and
1892 * limitations under the License.
1893 */async function aue(t){const e=Qu(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function WFe(t,e,r){const n=Qu(t);await fT(n,{requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"},"getOobCode",OFe)}async function HFe(t,e,r){if(Ma(t.app))return Promise.reject(uu(t));const n=Qu(t),a=await fT(n,{returnSecureToken:!0,email:e,password:r,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",zFe).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&aue(t),c}),o=await mp._fromIdTokenResponse(n,"signIn",a);return await n._updateCurrentUser(o.user),o}function qFe(t,e,r){return Ma(t.app)?Promise.reject(uu(t)):VFe(zn(t),Ou.credential(e,r)).catch(async n=>{throw n.code==="auth/password-does-not-meet-requirements"&&aue(t),n})}async function tB(t,e){const r=zn(t),i={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&GFe(r.auth,i,e);const{email:s}=await DFe(r.auth,i);s!==t.email&&await t.reload()}/**
1894 * @license
1895 * Copyright 2020 Google LLC
1896 *
1897 * Licensed under the Apache License, Version 2.0 (the "License");
1898 * you may not use this file except in compliance with the License.
1899 * You may obtain a copy of the License at
1900 *
1901 *   http://www.apache.org/licenses/LICENSE-2.0
1902 *
1903 * Unless required by applicable law or agreed to in writing, software
1904 * distributed under the License is distributed on an "AS IS" BASIS,
1905 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1906 * See the License for the specific language governing permissions and
1907 * limitations under the License.
1908 */async function YFe(t,e){return Lo(t,"POST","/v1/accounts:update",e)}/**
1909 * @license
1910 * Copyright 2020 Google LLC
1911 *
1912 * Licensed under the Apache License, Version 2.0 (the "License");
1913 * you may not use this file except in compliance with the License.
1914 * You may obtain a copy of the License at
1915 *
1916 *   http://www.apache.org/licenses/LICENSE-2.0
1917 *
1918 * Unless required by applicable law or agreed to in writing, software
1919 * distributed under the License is distributed on an "AS IS" BASIS,
1920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1921 * See the License for the specific language governing permissions and
1922 * limitations under the License.
1923 */async function KFe(t,{displayName:e,photoURL:r}){if(e===void 0&&r===void 0)return;const n=zn(t),s={idToken:await n.getIdToken(),displayName:e,photoUrl:r,returnSecureToken:!0},a=await hp(n,YFe(n.auth,s));n.displayName=a.displayName||null,n.photoURL=a.photoUrl||null;const o=n.providerData.find(({providerId:c})=>c==="password");o&&(o.displayName=n.displayName,o.photoURL=n.photoURL),await n._updateTokensIfNecessary(a)}function oue(t,e){return QFe(zn(t),null,e)}async function QFe(t,e,r){const{auth:n}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};r&&(s.password=r);const a=await hp(t,PFe(n,s));await t._updateTokensIfNecessary(a,!0)}function ZFe(t,e,r,n){return zn(t).onIdTokenChanged(e,r,n)}function XFe(t,e,r){return zn(t).beforeAuthStateChanged(e,r)}function lue(t,e,r,n){return zn(t).onAuthStateChanged(e,r,n)}function dF(t){return zn(t).signOut()}async function cue(t){return zn(t).delete()}const pT="__sak";/**
1924 * @license
1925 * Copyright 2019 Google LLC
1926 *
1927 * Licensed under the Apache License, Version 2.0 (the "License");
1928 * you may not use this file except in compliance with the License.
1929 * You may obtain a copy of the License at
1930 *
1931 *   http://www.apache.org/licenses/LICENSE-2.0
1932 *
1933 * Unless required by applicable law or agreed to in writing, software
1934 * distributed under the License is distributed on an "AS IS" BASIS,
1935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1936 * See the License for the specific language governing permissions and
1937 * limitations under the License.
1938 */class uue{constructor(e,r){this.storageRetriever=e,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(pT,"1"),this.storage.removeItem(pT),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,r){return this.storage.setItem(e,JSON.stringify(r)),Promise.resolve()}_get(e){const r=this.storage.getItem(e);return Promise.resolve(r?JSON.parse(r):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1939 * @license
1940 * Copyright 2020 Google LLC
1941 *
1942 * Licensed under the Apache License, Version 2.0 (the "License");
1943 * you may not use this file except in compliance with the License.
1944 * You may obtain a copy of the License at
1945 *
1946 *   http://www.apache.org/licenses/LICENSE-2.0
1947 *
1948 * Unless required by applicable law or agreed to in writing, software
1949 * distributed under the License is distributed on an "AS IS" BASIS,
1950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1951 * See the License for the specific language governing permissions and
1952 * limitations under the License.
1953 */const JFe=1e3,e5e=10;class due extends uue{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,r)=>this.onStorageEvent(e,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=qce(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const r of Object.keys(this.listeners)){const n=this.storage.getItem(r),i=this.localCache[r];n!==i&&e(r,i,n)}}onStorageEvent(e,r=!1){if(!e.key){this.forAllChangedKeys((a,o,c)=>{this.notifyListeners(a,c)});return}const n=e.key;r?this.detachListener():this.stopPolling();const i=()=>{const a=this.storage.getItem(n);!r&&this.localCache[n]===a||this.notifyListeners(n,a)},s=this.storage.getItem(n);dFe()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,e5e):i()}notifyListeners(e,r){this.localCache[e]=r;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,r,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:r,newValue:n}),!0)})},JFe)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1953ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,r){await super._set(e,r),this.localCache[e]=JSON.stringify(r)}async _get(e){const r=await super._get(e);return this.localCache[e]=JSON.stringify(r),r}async _remove(e){await super._remove(e),delete this.localCache[e]}}due.type="LOCAL";const t5e=due;/**
1954 * @license
1955 * Copyright 2020 Google LLC
1956 *
1957 * Licensed under the Apache License, Version 2.0 (the "License");
1958 * you may not use this file except in compliance with the License.
1959 * You may obtain a copy of the License at
1960 *
1961 *   http://www.apache.org/licenses/LICENSE-2.0
1962 *
1963 * Unless required by applicable law or agreed to in writing, software
1964 * distributed under the License is distributed on an "AS IS" BASIS,
1965 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1966 * See the License for the specific language governing permissions and
1967 * limitations under the License.
1968 */class fue extends uue{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,r){}_removeListener(e,r){}}fue.type="SESSION";const hue=fue;/**
1969 * @license
1970 * Copyright 2019 Google LLC
1971 *
1972 * Licensed under the Apache License, Version 2.0 (the "License");
1973 * you may not use this file except in compliance with the License.
1974 * You may obtain a copy of the License at
1975 *
1976 *   http://www.apache.org/licenses/LICENSE-2.0
1977 *
1978 * Unless required by applicable law or agreed to in writing, software
1979 * distributed under the License is distributed on an "AS IS" BASIS,
1980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1981 * See the License for the specific language governing permissions and
1982 * limitations under the License.
1983 */function r5e(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
1984 * @license
1985 * Copyright 2019 Google LLC
1986 *
1987 * Licensed under the Apache License, Version 2.0 (the "License");
1988 * you may not use this file except in compliance with the License.
1989 * You may obtain a copy of the License at
1990 *
1991 *   http://www.apache.org/licenses/LICENSE-2.0
1992 *
1993 * Unless required by applicable law or agreed to in writing, software
1994 * distributed under the License is distributed on an "AS IS" BASIS,
1995 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1996 * See the License for the specific language governing permissions and
1997 * limitations under the License.
1998 */class XE{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const r=this.receivers.find(i=>i.isListeningto(e));if(r)return r;const n=new XE(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const r=e,{eventId:n,eventType:i,data:s}=r.data,a=this.handlersMap[i];if(!a?.size)return;r.ports[0].postMessage({status:"ack",eventId:n,eventType:i});const o=Array.from(a).map(async u=>u(r.origin,s)),c=await r5e(o);r.ports[0].postMessage({status:"done",eventId:n,eventType:i,response:c})}_subscribe(e,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(r)}_unsubscribe(e,r){this.handlersMap[e]&&r&&this.handlersMap[e].delete(r),(!r||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}XE.receivers=[];/**
1999 * @license
2000 * Copyright 2020 Google LLC
2001 *
2002 * Licensed under the Apache License, Version 2.0 (the "License");
2003 * you may not use this file except in compliance with the License.
2004 * You may obtain a copy of the License at
2005 *
2006 *   http://www.apache.org/licenses/LICENSE-2.0
2007 *
2008 * Unless required by applicable law or agreed to in writing, software
2009 * distributed under the License is distributed on an "AS IS" BASIS,
2010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2011 * See the License for the specific language governing permissions and
2012 * limitations under the License.
2013 */function rB(t="",e=10){let r="";for(let n=0;n<e;n++)r+=Math.floor(Math.random()*10);return t+r}/**
2014 * @license
2015 * Copyright 2019 Google LLC
2016 *
2017 * Licensed under the Apache License, Version 2.0 (the "License");
2018 * you may not use this file except in compliance with the License.
2019 * You may obtain a copy of the License at
2020 *
2021 *   http://www.apache.org/licenses/LICENSE-2.0
2022 *
2023 * Unless required by applicable law or agreed to in writing, software
2024 * distributed under the License is distributed on an "AS IS" BASIS,
2025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2026 * See the License for the specific language governing permissions and
2027 * limitations under the License.
2028 */class n5e{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,r,n=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,a;return new Promise((o,c)=>{const u=rB("",20);i.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},n);a={messageChannel:i,onMessage(f){const h=f;if(h.data.eventId===u)switch(h.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),o(h.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:u,data:r},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}}/**
2029 * @license
2030 * Copyright 2020 Google LLC
2031 *
2032 * Licensed under the Apache License, Version 2.0 (the "License");
2033 * you may not use this file except in compliance with the License.
2034 * You may obtain a copy of the License at
2035 *
2036 *   http://www.apache.org/licenses/LICENSE-2.0
2037 *
2038 * Unless required by applicable law or agreed to in writing, software
2039 * distributed under the License is distributed on an "AS IS" BASIS,
2040 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2041 * See the License for the specific language governing permissions and
2042 * limitations under the License.
2043 */function Jl(){return window}function i5e(t){Jl().location.href=t}/**
2044 * @license
2045 * Copyright 2020 Google LLC.
2046 *
2047 * Licensed under the Apache License, Version 2.0 (the "License");
2048 * you may not use this file except in compliance with the License.
2049 * You may obtain a copy of the License at
2050 *
2051 *   http://www.apache.org/licenses/LICENSE-2.0
2052 *
2053 * Unless required by applicable law or agreed to in writing, software
2054 * distributed under the License is distributed on an "AS IS" BASIS,
2055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2056 * See the License for the specific language governing permissions and
2057 * limitations under the License.
2058 */function pue(){return typeof Jl().WorkerGlobalScope<"u"&&typeof Jl().importScripts=="function"}async function s5e(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function a5e(){var t;return((t=navigator?.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function o5e(){return pue()?self:null}/**
2059 * @license
2060 * Copyright 2019 Google LLC
2061 *
2062 * Licensed under the Apache License, Version 2.0 (the "License");
2063 * you may not use this file except in compliance with the License.
2064 * You may obtain a copy of the License at
2065 *
2066 *   http://www.apache.org/licenses/LICENSE-2.0
2067 *
2068 * Unless required by applicable law or agreed to in writing, software
2069 * distributed under the License is distributed on an "AS IS" BASIS,
2070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2071 * See the License for the specific language governing permissions and
2072 * limitations under the License.
2073 */const mue="firebaseLocalStorageDb",l5e=1,mT="firebaseLocalStorage",gue="fbase_key";class Lw{constructor(e){this.request=e}toPromise(){return new Promise((e,r)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function JE(t,e){return t.transaction([mT],e?"readwrite":"readonly").objectStore(mT)}function c5e(){const t=indexedDB.deleteDatabase(mue);
2073return new Lw(t).toPromise()}function fF(){const t=indexedDB.open(mue,l5e);return new Promise((e,r)=>{t.addEventListener("error",()=>{r(t.error)}),t.addEventListener("upgradeneeded",()=>{const n=t.result;try{n.createObjectStore(mT,{keyPath:gue})}catch(i){r(i)}}),t.addEventListener("success",async()=>{const n=t.result;n.objectStoreNames.contains(mT)?e(n):(n.close(),await c5e(),e(await fF()))})})}async function Q7(t,e,r){const n=JE(t,!0).put({[gue]:e,value:r});return new Lw(n).toPromise()}async function u5e(t,e){const r=JE(t,!1).get(e),n=await new Lw(r).toPromise();return n===void 0?null:n.value}function Z7(t,e){const r=JE(t,!0).delete(e);return new Lw(r).toPromise()}const d5e=800,f5e=3;class yue{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await fF(),this.db)}async _withRetries(e){let r=0;for(;;)try{const n=await this._openDb();return await e(n)}catch(n){if(r++>f5e)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return pue()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=XE._getInstance(o5e()),this.receiver._subscribe("keyChanged",async(e,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(e,r)=>["keyChanged"])}async initializeSender(){var e,r;if(this.activeServiceWorker=await s5e(),!this.activeServiceWorker)return;this.sender=new n5e(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&!((e=n[0])===null||e===void 0)&&e.fulfilled&&!((r=n[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||a5e()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await fF();return await Q7(e,pT,"1"),await Z7(e,pT),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,r){return this._withPendingWrite(async()=>(await this._withRetries(n=>Q7(n,e,r)),this.localCache[e]=r,this.notifyServiceWorker(e)))}async _get(e){const r=await this._withRetries(n=>u5e(n,e));return this.localCache[e]=r,r}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(r=>Z7(r,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=JE(i,!1).getAll();return new Lw(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const r=[],n=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)n.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),r.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!n.has(i)&&(this.notifyListeners(i,null),r.push(i));return r}notifyListeners(e,r){this.localCache[e]=r;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),d5e)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Ob
vendor: 4,332 bytes, lines 2073-2122
2073ject.keys(this.listeners).length===0&&this.stopPolling()}}yue.type="LOCAL";const h5e=yue;new Ow(3e4,6e4);/**
2074 * @license
2075 * Copyright 2021 Google LLC
2076 *
2077 * Licensed under the Apache License, Version 2.0 (the "License");
2078 * you may not use this file except in compliance with the License.
2079 * You may obtain a copy of the License at
2080 *
2081 *   http://www.apache.org/licenses/LICENSE-2.0
2082 *
2083 * Unless required by applicable law or agreed to in writing, software
2084 * distributed under the License is distributed on an "AS IS" BASIS,
2085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2086 * See the License for the specific language governing permissions and
2087 * limitations under the License.
2088 */function vue(t,e){return e?eu(e):(Et(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
2089 * @license
2090 * Copyright 2019 Google LLC
2091 *
2092 * Licensed under the Apache License, Version 2.0 (the "License");
2093 * you may not use this file except in compliance with the License.
2094 * You may obtain a copy of the License at
2095 *
2096 *   http://www.apache.org/licenses/LICENSE-2.0
2097 *
2098 * Unless required by applicable law or agreed to in writing, software
2099 * distributed under the License is distributed on an "AS IS" BASIS,
2100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2101 * See the License for the specific language governing permissions and
2102 * limitations under the License.
2103 */class nB extends X3{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return _g(e,this._buildIdpRequest())}_linkToIdToken(e,r){return _g(e,this._buildIdpRequest(r))}_getReauthenticationResolver(e){return _g(e,this._buildIdpRequest())}_buildIdpRequest(e){const r={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(r.idToken=e),r}}function p5e(t){return iue(t.auth,new nB(t),t.bypassAuthState)}function m5e(t){const{auth:e,user:r}=t;return Et(r,e,"internal-error"),nue(r,new nB(t),t.bypassAuthState)}async function g5e(t){const{auth:e,user:r}=t;return Et(r,e,"internal-error"),tue(r,new nB(t),t.bypassAuthState)}/**
2104 * @license
2105 * Copyright 2020 Google LLC
2106 *
2107 * Licensed under the Apache License, Version 2.0 (the "License");
2108 * you may not use this file except in compliance with the License.
2109 * You may obtain a copy of the License at
2110 *
2111 *   http://www.apache.org/licenses/LICENSE-2.0
2112 *
2113 * Unless required by applicable law or agreed to in writing, software
2114 * distributed under the License is distributed on an "AS IS" BASIS,
2115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2116 * See the License for the specific language governing permissions and
2117 * limitations under the License.
2118 */class xue{constructor(e,r,n,i,s=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(e,r)=>{this.pendingPromise={resolve:e,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:r,sessionId:n,postBody:i,tenantId:s,error:a,type:o}=e;if(a){this.reject(a);return}const c={auth:this.auth,requestUri:r,sessionId:n,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(c))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return p5e;case"linkViaPopup":case"linkViaRedirect":return g5e;case"reauthViaPopup":case"reauthViaRedirect":return m5e;default:Mo(this.auth,"internal-error")}}resolve(e){Du(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Du(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
2119 * @license
2120 * Copyright 2020 Google LLC
2121 *
2122 * Licensed under the Apache License, Version 2.0 (the "License");
2123 * you may not use this file except in compliance with the License.
2124 * You may obtain a copy of the License at
2125 *
2126 *   http://www.apache.org/licenses/LICENSE-2.0
2127 *
2128 * Unless required by applicable law or agreed to in writing, software
2129 * distributed under the License is distributed on an "AS IS" BASIS,
2130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2131 * See the License for the specific language governing permissions and
2132 * limitations under the License.
2133 */const y5e=new Ow(2e3,1e4);async function v5e(t,e,r){if(Ma(t.app))return Promise.reject(pl(t,"operation-not-supported-in-this-environment"));const n=Qu(t);W$e(t,e,eB);const i=vue(n,r);return new Ih(n,"signInViaPopup",e,i).executeNotNull()}class Ih extends xue{constructor(e,r,n,i,s){super(e,r,i,s),this.provider=n,this.authWindow=null,this.pollId=null,Ih.currentPopupAction&&Ih.currentPopupAction.cancel(),Ih.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Et(e,this.auth,"internal-error"),e}async onExecution(){Du(this.filter.length===1,"Popup operations only handle one event");const e=rB();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(pl(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(pl(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Ih.currentPopupAction=null}pollUserCancellation(){const e=()=>{var r,n;if(!((n=(r=this.authWindow)===null||r===void 0?void 0:r.window)===null||n===void 0)&&n.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(pl(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,y5e.get())};e()}}Ih.currentPopupAction=null;/**
2134 * @license
2135 * Copyright 2020 Google LLC
2136 *
2137 * Licensed under the Apache License, Version 2.0 (the "License");
2138 * you may not use this file except in compliance with the License.
2139 * You may obtain a copy of the License at
2140 *
2141 *   http://www.apache.org/licenses/LICENSE-2.0
2142 *
2143 * Unless required by applicable law or agreed to in writing, software
2144 * distributed under the License is distributed on an "AS IS" BASIS,
2145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2146 * See the License for the specific language governing permissions and
2147 * limitations under the License.
2148 */const x5e="pendingRedirect",Sk=new Map;class b5e extends xue{constructor(e,r,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,n),this.eventId=null}async execute(){let e=Sk.get(this.auth._key());if(!e){try{const n=await w5e(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(n)}catch(r){e=()=>Promise.reject(r)}Sk.set(this.auth._key(),e)}return this.bypassAuthState||Sk.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const r=await this.auth._redirectUserForId(e.eventId);if(r)return this.user=r,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function w5e(t,e){const r=k5e(e),n=S5e(t);if(!await n._isAvailable())return!1;const i=await n._get(r)==="true";return await n._remove(r),i}function _5e(t,e){Sk.set(t._key(),e)}function S5e(t){return eu(t._redirectPersistence)}function k5e(t){return _k(x5e,t.config.apiKey,t.name)}async function T5e(t,e,r=!1){if(Ma(t.app))return Promise.reject(uu(t));const n=Qu(t),i=vue(n,e),a=await new b5e(n,i,r).execute();return a&&!r&&(delete a.user._redirectEventId,await n._persistUserIfCurrent(a.user),await n._setRedirectUser(null,e)),a}/**
2149 * @license
2150 * Copyright 2020 Google LLC
2151 *
2152 * Licensed under the Apache License, Version 2.0 (the "License");
2153 * you may not use this file except in compliance with the License.
2154 * You may obtain a copy of the License at
2155 *
2156 *   http://www.apache.org/licenses/LICENSE-2.0
2157 *
2158 * Unless required by applicable law or agreed to in writing, software
2159 * distributed under the License is distributed on an "AS IS" BASIS,
2160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2161 * See the License for the specific language governing permissions and
2162 * limitations under the License.
2163 */const C5e=600*1e3;class E5e{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let r=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(r=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!j5e(e)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=e,r=!0)),r}sendToConsumer(e,r){var n;if(e.error&&!bue(e)){const i=((n=e.error.code)===null||n===void 0?void 0:n.split("auth/")[1])||"internal-error";r.onError(pl(this.auth,i))}else r.onAuthEvent(e)}isEventForConsumer(e,r){const n=r.eventId===null||!!e.eventId&&e.eventId===r.eventId;return r.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=C5e&&this.cachedEventUids.clear(),this.cachedEventUids.has(X7(e))}saveEventToCache(e){this.cachedEventUids.add(X7(e)),this.lastProcessedEventTime=Date.now()}}function X7(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function bue({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function j5e(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return bue(t);default:return!1}}/**
2164 * @license
2165 * Copyright 2020 Google LLC
2166 *
2167 * Licensed under the Apache License, Version 2.0 (the "License");
2168 * you may not use this file except in compliance with the License.
2169 * You may obtain a copy of the License at
2170 *
2171 *   http://www.apache.org/licenses/LICENSE-2.0
2172 *
2173 * Unless required by applicable law or agreed to in writing, software
2174 * distributed under the License is distributed on an "AS IS" BASIS,
2175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2176 * See the License for the specific language governing permissions and
2177 * limitations under the License.
2178 */async function N5e(t,e={}){return Lo(t,"GET","/v1/projects",e)}/**
2179 * @license
2180 * Copyright 2020 Google LLC
2181 *
2182 * Licensed under the Apache License, Version 2.0 (the "License");
2183 * you may not use this file except in compliance with the License.
2184 * You may obtain a copy of the License at
2185 *
2186 *   http://www.apache.org/licenses/LICENSE-2.0
2187 *
2188 * Unless required by applicable law or agreed to in writing, software
2189 * distributed under the License is distributed on an "AS IS" BASIS,
2190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2191 * See the License for the specific language governing permissions and
2192 * limitations under the License.
2193 */const P5e=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,M5e=/^https?/;async function A5e(t){if(t.config.emulator)return;const{authorizedDomains:e}=await N5e(t);for(const r of e)try{if(D5e(r))return}catch{}Mo(t,"unauthorized-domain")}function D5e(t){const e=cF(),{protocol:r,hostname:n}=new URL(e);if(t.startsWith("chrome-extension://")){const a=new URL(t);return a.hostname===""&&n===""?r==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):r==="chrome-extension:"&&a.hostname===n}if(!M5e.test(r))return!1;if(P5e.test(t))return n===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(n)}/**
2194 * @license
2195 * Copyright 2020 Google LLC.
2196 *
2197 * Licensed under the Apache License, Version 2.0 (the "License");
2198 * you may not use this file except in compliance with the License.
2199 * You may obtain a copy of the License at
2200 *
2201 *   http://www.apache.org/licenses/LICENSE-2.0
2202 *
2203 * Unless required by applicable law or agreed to in writing, software
2204 * distributed under the License is distributed on an "AS IS" BASIS,
2205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2206 * See the License for the specific language governing permissions and
2207 * limitations under the License.
2208 */const O5e=new Ow(3e4,6e4);function J7(){const t=Jl().___jsl;if(t?.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let r=0;r<t.CP.length;r++)t.CP[r]=null}}function R5e(t){return new Promise((e,r)=>{var n,i,s;function a(){J7(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{J7(),r(pl(t,"network-request-failed"))},timeout:O5e.get()})}if(!((i=(n=Jl().gapi)===null||n===void 0?void 0:n.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=Jl().gapi)===null||s===void 0)&&s.load)a();else{const o=bFe("iframefcb");return Jl()[o]=()=>{gapi.load?a():r(pl(t,"network-request-failed"))},Kce(`${xFe()}?onload=${o}`).catch(c=>r(c))}}).catch(e=>{throw kk=null,e})}let kk=null;function I5e(t){return kk=kk||R5e(t),kk}/**
2209 * @license
2210 * Copyright 2020 Google LLC.
2211 *
2212 * Licensed under the Apache License, Version 2.0 (the "License");
2213 * you may not use this file except in compliance with the License.
2214 * You may obtain a copy of the License at
2215 *
2216 *   http://www.apache.org/licenses/LICENSE-2.0
2217 *
2218 * Unless required by applicable law or agreed to in writing, software
2219 * distributed under the License is distributed on an "AS IS" BASIS,
2220 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2221 * See the License for the specific language governing permissions and
2222 * limitations under the License.
2223 */const L5e=new Ow(5e3,15e3),$5e="__/auth/iframe",F5e="emulator/auth/iframe",z5e={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},B5e=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function V5e(t){const e=t.config;Et(e.authDomain,t,"auth-domain-config-required");const r=e.emulator?K3(e,F5e):`https://${t.config.authDomain}/${$5e}`,n={apiKey:e.apiKey,appName:t.name,v:Gy},i=B5e.get(t.config.apiHost);i&&(n.eid=i);const s=t._getFrameworks();return s.length&&(n.fw=s.join(",")),`${r}?${Ew(n).slice(1)}`}async function U5e(t){const e=await I5e(t),r=Jl().gapi;return Et(r,t,"internal-error"),e.open({where:document.body,url:V5e(t),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:z5e,dontclear:!0},n=>new Promise(async(i,s)=>{await n.restyle({setHideOnLeave:!1});const a=pl(t,"network-request-failed"),o=Jl().setTimeout(()=>{s(a)},L5e.get());function c(){Jl().clearTimeout(o),i(n)}n.ping(c).then(c,()=>{s(a)})}))}/**
2224 * @license
2225 * Copyright 2020 Google LLC.
2226 *
2227 * Licensed under the Apache License, Version 2.0 (the "License");
2228 * you may not use this file except in compliance with the License.
2229 * You may obtain a copy of the License at
2230 *
2231 *   http://www.apache.org/licenses/LICENSE-2.0
2232 *
2233 * Unless required by applicable law or agreed to in writing, software
2234 * distributed under the License is distributed on an "AS IS" BASIS,
2235 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2236 * See the License for the specific language governing permissions and
2237 * limitations under the License.
2238 */const G5e={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},W5e=500,H5e=600,q5e="_blank",Y5e="http://localhost";class e9{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function K5e(t,e,r,n=W5e,i=H5e){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-n)/2,0).toString();let o="";const c=Object.assign(Object.assign({},G5e),{width:n.toString(),height:i.toString(),top:s,left:a}),u=Bs().toLowerCase();r&&(o=Vce(u)?q5e:r),zce(u)&&(e=e||Y5e,c.scrollbars="yes");const d=Object.entries(c).reduce((h,[m,y])=>`${h}${m}=${y},`,"");if(uFe(u)&&o!=="_self")return Q5e(e||"",o),new e9(null);const f=window.open(e||"",o,d);Et(f,t,"popup-blocked");try{f.focus()}catch{}return new e9(f)}function Q5e(t,e){const r=document.createElement("a");r.href=t,r.target=e;const n=document.createEvent("MouseEvent");
2238n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(n)}/**
2239 * @license
2240 * Copyright 2021 Google LLC
2241 *
2242 * Licensed under the Apache License, Version 2.0 (the "License");
2243 * you may not use this file except in compliance with the License.
2244 * You may obtain a copy of the License at
2245 *
2246 *   http://www.apache.org/licenses/LICENSE-2.0
2247 *
2248 * Unless required by applicable law or agreed to in writing, software
2249 * distributed under the License is distributed on an "AS IS" BASIS,
2250 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2251 * See the License for the specific language governing permissions and
2252 * limitations under the License.
2253 */const Z5e="__/auth/handler",X5e="emulator/auth/handler",J5e=encodeURIComponent("fac");async function t9(t,e,r,n,i,s){Et(t.config.authDomain,t,"auth-domain-config-required"),Et(t.config.apiKey,t,"invalid-api-key");const a={apiKey:t.config.apiKey,appName:t.name,authType:r,redirectUrl:n,v:Gy,eventId:i};if(e instanceof eB){e.setDefaultLanguage(t.languageCode),a.providerId=e.providerId||"",h2e(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries({}))a[d]=f}if(e instanceof Iw){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(a.scopes=d.join(","))}t.tenantId&&(a.tid=t.tenantId);const o=a;for(const d of Object.keys(o))o[d]===void 0&&delete o[d];const c=await t._getAppCheckToken(),u=c?`#${J5e}=${encodeURIComponent(c)}`:"";return`${eze(t)}?${Ew(o).slice(1)}${u}`}function eze({config:t}){return t.emulator?K3(t,X5e):`https://${t.authDomain}/${Z5e}`}/**
2254 * @license
2255 * Copyright 2020 Google LLC
2256 *
2257 * Licensed under the Apache License, Version 2.0 (the "License");
2258 * you may not use this file except in compliance with the License.
2259 * You may obtain a copy of the License at
2260 *
2261 *   http://www.apache.org/licenses/LICENSE-2.0
2262 *
2263 * Unless required by applicable law or agreed to in writing, software
2264 * distributed under the License is distributed on an "AS IS" BASIS,
2265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2266 * See the License for the specific language governing permissions and
2267 * limitations under the License.
2268 */const rA="webStorageSupport";class tze{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=hue,this._completeRedirectFn=T5e,this._overrideRedirectResult=_5e}async _openPopup(e,r,n,i){var s;Du((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const a=await t9(e,r,n,cF(),i);return K5e(e,a,rB())}async _openRedirect(e,r,n,i){await this._originValidation(e);const s=await t9(e,r,n,cF(),i);return i5e(s),new Promise(()=>{})}_initialize(e){const r=e._key();if(this.eventManagers[r]){const{manager:i,promise:s}=this.eventManagers[r];return i?Promise.resolve(i):(Du(s,"If manager is not set, promise should be"),s)}const n=this.initAndGetManager(e);return this.eventManagers[r]={promise:n},n.catch(()=>{delete this.eventManagers[r]}),n}async initAndGetManager(e){const r=await U5e(e),n=new E5e(e);return r.register("authEvent",i=>(Et(i?.authEvent,e,"invalid-auth-event"),{status:n.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=r,n}_isIframeWebStorageSupported(e,r){this.iframes[e._key()].send(rA,{type:rA},i=>{var s;const a=(s=i?.[0])===null||s===void 0?void 0:s[rA];a!==void 0&&r(!!a),Mo(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const r=e._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=A5e(e)),this.originValidationPromises[r]}get _shouldInitProactively(){return qce()||Bce()||Z3()}}const rze=tze;var r9="@firebase/auth",n9="1.10.8";/**
2269 * @license
2270 * Copyright 2020 Google LLC
2271 *
2272 * Licensed under the Apache License, Version 2.0 (the "License");
2273 * you may not use this file except in compliance with the License.
2274 * You may obtain a copy of the License at
2275 *
2276 *   http://www.apache.org/licenses/LICENSE-2.0
2277 *
2278 * Unless required by applicable law or agreed to in writing, softw
2278are
2279 * distributed under the License is distributed on an "AS IS" BASIS,
2280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2281 * See the License for the specific language governing permissions and
2282 * limitations under the License.
2283 */class nze{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const r=this.auth.onIdTokenChanged(n=>{e(n?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,r),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const r=this.internalListeners.get(e);r&&(this.internalListeners.delete(e),r(),this.updateProactiveRefresh())}assertAuthConfigured(){Et(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
2284 * @license
2285 * Copyright 2020 Google LLC
2286 *
2287 * Licensed under the Apache License, Version 2.0 (the "License");
2288 * you may not use this file except in compliance with the License.
2289 * You may obtain a copy of the License at
2290 *
2291 *   http://www.apache.org/licenses/LICENSE-2.0
2292 *
2293 * Unless required by applicable law or agreed to in writing, software
2294 * distributed under the License is distributed on an "AS IS" BASIS,
2295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2296 * See the License for the specific language governing permissions and
2297 * limitations under the License.
2298 */function ize(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function sze(t){Po(new Ba("auth",(e,{options:r})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:o}=n.options;Et(a&&!a.includes(":"),"invalid-api-key",{appName:n.name});const c={apiKey:a,authDomain:o,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Yce(t)},u=new gFe(n,i,s,c);return CFe(u,r),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,r,n)=>{e.getProvider("auth-internal").initialize()})),Po(new Ba("auth-internal",e=>{const r=Qu(e.getProvider("auth").getImmediate());return(n=>new nze(n))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ia(r9,n9,ize(t)),Ia(r9,n9,"esm2017")}/**
2299 * @license
2300 * Copyright 2021 Google LLC
2301 *
2302 * Licensed under the Apache License, Version 2.0 (the "License");
2303 * you may not use this file except in compliance with the License.
2304 * You may obtain a copy of the License at
2305 *
2306 *   http://www.apache.org/licenses/LICENSE-2.0
2307 *
2308 * Unless required by applicable law or agreed to in writing, software
2309 * distributed under the License is distributed on an "AS IS" BASIS,
2310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2311 * See the License for the specific language governing permissions and
2312 * limitations under the License.
2313 */const aze=300,oze=koe("authIdTokenMaxAge")||aze;let i9=null;const lze=t=>async e=>{const r=e&&await e.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>oze)return;const i=r?.token;i9!==i&&(i9=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function ej(t=WE()){const e=Gp(t,"auth");if(e.isInitialized())return e.getImmediate();const r=TFe(t,{popupRedirectResolver:rze,persistence:[h5e,t5e,hue]}),n=koe("authTokenSyncURL");if(n&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(n,location.origin);if(location.origin===s.origin){const a=lze(s.toString());XFe(r,a,()=>a(r.currentUser)),ZFe(r,o=>a(o))}}const i=_oe("auth");return i&&EFe(r,`http://${i}`),r}function cze(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}yFe({loadJS(t){return new Promise((e,r)=>{const n=document.createElement("script");n.setAttribute("src",t),n.onload=e,n.onerror=i=>{const s=pl("internal-error");s.customData=i,r(s)},n.type="text/javascript",n.charset="UTF-8",cze().appendChild(n)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});sze("Browser");const s9=t=>Symbol.iterator in t,a9=t=>"entries"in t,o9=(t,e)=>
2313{const r=t instanceof Map?t:new Map(t.entries()),n=e instanceof Map?e:new Map(e.entries());if(r.size!==n.size)return!1;for(const[i,s]of r)if(!n.has(i)||!Object.is(s,n.get(i)))return!1;return!0},uze=(t,e)=>{const r=t[Symbol.iterator](),n=e[Symbol.iterator]();let i=r.next(),s=n.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=r.next(),s=n.next()}return!!i.done&&!!s.done};function dze(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:s9(t)&&s9(e)?a9(t)&&a9(e)?o9(t,e):uze(t,e):o9({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function yl(t){const e=P.useRef(void 0);return r=>{const n=t(r);return dze(e.current,n)?e.current:e.current=n}}const fze=[{group:"Product",items:[{title:"Features",href:"#features"},{title:"Pricing",href:"#pricing"},{title:"Sign In",href:"/login"},{title:"Sign Up",href:"/signup"}]},{group:"Legal",items:[{title:"Privacy Policy",href:"/docs/privacy-policy"},{title:"Terms of Service",href:"/docs/terms-of-use"}]}],hze=[{name:"Email",href:"mailto:[email protected]",icon:fp}];function pze(){const t=new Date().getFullYear(),e=ns(),r=Ws(),n=(i,s)=>{if(e.pathname==="/"){i.preventDefault();const a=document.getElementById(s.replace("#",""));a&&a.scrollIntoView({behavior:"smooth"})}else i.preventDefault(),r(`/?scrollTo=${s.replace("#","")}`)};return l.jsx("footer",{className:"relative pt-20 pb-8 bg-linear-to-b from-app-primary to-app-primary/20",children:l.jsxs("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:[l.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start w-full gap-10 md:gap-0",children:[l.jsxs("div",{className:"lg:col-span-2",children:[l.jsxs(At,{to:"/","aria-label":"Merciless Metrics Home",className:"inline-flex items-center space-x-4 group",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Merciless Metrics",className:"h-8 w-auto transition-transform group-hover:scale-105"}),l.jsx("span",{className:"text-lg font-semibold text-app-primary-foreground",children:es})]}),l.jsx("p",{className:"mt-6 text-sm text-app-primary-foreground/70 leading-relaxed max-w-md",children:"Advanced trading analytics and journal platform designed to help traders analyze their performance, identify patterns, and improve their strategies."}),l.jsxs("div",{className:"mt-8 2k:mt-16",children:[l.jsx("h3",{className:"text-sm font-medium text-app-primary-foreground mb-4 2k:text-xl",children:"Contact Us"}),l.jsx("div",{className:"flex space-x-4 2k:space-x-8",children:hze.map(i=>l.jsx(At,{to:i.href,className:"text-app-primary-foreground/60 hover:text-app-primary-foreground transition-colors duration-200 p-2 rounded-lg hover:bg-app-primary/10 2k:p-4","aria-label":`Follow us on ${i.name}`,children:l.jsx(i.icon,{className:"h-5 w-5 2k:h-10 2k:w-10"})},i.name))})]})]}),l.jsx("div",{className:"lg:col-span-4 md:ml-auto",children:l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 sm:grid-cols-2 2k:gap-16",children:fze.map(i=>l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"text-sm font-semibold text-app-primary-foreground 2k:text-xl",children:i.group}),l.jsx("ul",{className:"space-y-3 2k:space-y-6",children:i.items.map(s=>["#features","#pricing"].includes(s.href)?l.jsx("li",{children:l.jsx("a",{href:s.href,className:"text-sm text-app-primary-foreground/70 hover:text-app-primary-foreground transition-colors duration-200 flex items-center gap-1 group 2k:text-xl 2k:gap-3",onClick:o=>n(o,s.href),children:l.jsx("span",{children:s.title})})},s.title):l.jsx("li",{children:l.jsxs(At,{to:s.href,className:"text-sm text-app-primary-foreground/70 hover:text-app-primary-foreground transition-colors duration-200 flex items-center gap-1 group 2k:text-xl 2k:gap-3",children:[l.jsx("span",{children:s.title}),s.href.startsWith("http")&&l.jsx(UPe,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity 2k:h-6 2k:w-6"})]})},s.title))})]},i.group))})})]}),l.jsx("div",{className:"mt-16 border-t border-app-border-color-soft 2k:mt-32"}),l.jsx("div",{className:"mt-8 flex flex-col items-center justify-between gap-4 sm:flex-row",children:l.jsxs("p",{className:"text-xs text-app-primary-foreground
2313/60",children:["©"," ",t," ",es,". All rights reserved."]})}),l.jsx("div",{className:"mt-16 w-full flex items-center justify-center overflow-hidden",children:l.jsx("h2",{className:"text-center text-4xl md:text-6xl lg:text-8xl xl:text-[10rem] font-bold bg-clip-text text-transparent bg-linear-to-b from-app-primary-foreground/20 to-app-primary/30 select-none pointer-events-none",children:es})})]})})}const mze={closed:{opacity:0,y:-10,transition:{duration:.15,ease:"easeInOut"}},open:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}},gze={closed:{opacity:0,transition:{duration:.15,ease:"easeInOut"}},open:{opacity:1,transition:{duration:.2,ease:"easeOut"}}},yze={closed:{transition:{staggerChildren:.03,staggerDirection:-1}},open:{transition:{staggerChildren:.05,delayChildren:.05}}},l9={closed:{opacity:0,transition:{duration:.15,ease:"easeInOut"}},open:{opacity:1,transition:{duration:.2,ease:"easeOut"}}},vze={closed:{opacity:0,transition:{duration:.15,ease:"easeInOut"}},open:{opacity:1,transition:{duration:.2,ease:"easeOut",delay:.1}}},xze={closed:{rotate:0,y:0},open:{rotate:45,y:6}},bze={closed:{opacity:1},open:{opacity:0}},wze={closed:{rotate:0,y:0},open:{rotate:-45,y:-6}},_ze=({isOpen:t,onClick:e,className:r=""})=>l.jsxs("button",{onClick:e,"aria-label":t?"Close Menu":"Open Menu",className:`relative z-20 flex h-9 w-9 cursor-pointer flex-col items-center justify-center space-y-1 rounded-lg transition-all duration-200 hover:bg-app-button-bg lg:hidden ${r}`,children:[l.jsx(ct.span,{variants:xze,animate:t?"open":"closed",transition:{duration:.2,ease:"easeInOut"},className:"block h-0.5 w-5 origin-center rounded-full bg-current"}),l.jsx(ct.span,{variants:bze,animate:t?"open":"closed",transition:{duration:.2,ease:"easeInOut"},className:"block h-0.5 w-5 origin-center rounded-full bg-current"}),l.jsx(ct.span,{variants:wze,animate:t?"open":"closed",transition:{duration:.2,ease:"easeInOut"},className:"block h-0.5 w-5 origin-center rounded-full bg-current"})]}),Sze=({isOpen:t,onClose:e,menuItems:r})=>l.jsx(Ss,{mode:"wait",children:t&&l.jsxs(l.Fragment,{children:[l.jsx(ct.div,{variants:gze,initial:"closed",animate:"open",exit:"closed",className:"fixed inset-0 z-40 bg-black/30",onClick:e}),l.jsx(ct.div,{variants:mze,initial:"closed",animate:"open",exit:"closed",className:"fixed top-16 left-2 right-2 z-50 mx-auto max-w-sm",children:l.jsx("div",{className:"relative overflow-hidden rounded-xl border border-app-border-color bg-app-card shadow-xl",children:l.jsxs("div",{className:"p-4",children:[l.jsx(ct.nav,{variants:yze,initial:"closed",animate:"open",exit:"closed",className:"space-y-1",children:r.map((n,i)=>l.jsx(ct.div,{variants:l9,children:l.jsx("a",{href:n.href,onClick:e,className:"flex items-center rounded-xl px-3 py-3 text-app-primary-foreground transition-all duration-200 hover:bg-app-button-bg",children:l.jsx("span",{className:"text-base font-medium",children:n.name})})},i))}),l.jsx(ct.div,{variants:l9,className:"my-4 h-px bg-app-border-color"}),l.jsxs(ct.div,{variants:vze,initial:"closed",animate:"open",exit:"closed",className:"space-y-3",children:[l.jsx(ye,{asChild:!0,variant:"secondary",className:"w-full justify-center",children:l.jsx(At,{to:"/login",onClick:e,children:l.jsx("span",{children:"Login"})})}),l.jsx(ye,{asChild:!0,className:"w-full justify-center",children:l.jsx(At,{to:"/signup",onClick:e,children:l.jsx("span",{children:"Get Started"})})})]})]})})})]})}),c9=[{name:"Features",href:"/#features",anchor:"features"},{name:"Pricing",href:"/#pricing",anchor:"pricing"},{name:"Help",href:"/docs"}],kze=({user:t})=>{const[e,r]=P.useState(!1),[n,i]=P.useState(!1),s=ns();P.useEffect(()=>{const o=()=>{i(window.scrollY>50)};return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),P.useEffect(()=>{const o=()=>{window.innerWidth>=1024&&e&&r(!1)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]);const a=(o,c)=>{if(c&&s.pathname==="/"){o.preventDefault();const u=document.getElementById(c);if(u){const h=u.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:h,behavior:"smooth"})}}};return b.useEffect(()=>{if(s.hash){const o=s.hash.replace("#",""),c=document.getElementById(o);if(c){const f=c.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:f,behavior:"smooth"})}}},[s]),l.jsxs("header",{children:[l.jsx("nav",{"data-state":e&&"active",className:"fixed z-20 w-full px-2",children:l.jsx("div",{className:ee("mx-auto mt-2 max-w-6xl px-6 transition-all duration-300 lg:px-12 2k:max-w-480 2k:px-30",n&&"bg-app-primary/40 max-w-5xl rounded-2xl backdrop-blur-xl lg:px-5"),children:l.jsxs("div",{className:"relative flex flex-wrap items-center justify-between gap-6 py-3 lg:gap-0 lg:py-4 2k:gap-20 2k:py-10",children:[l.jsxs("div",{className:"flex w-full justify-between lg:w-auto",children:[l.jsxs(At,{to:"/","aria-label":"home",className:"flex items-center space-x-4",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"h-8 w-auto 2k:h-16"}),l.jsx("span",{className:"text-md font-medium",children:es})]}),l.jsx(_ze,{isOpen:e,onClick:()=>r(!e)})]}),!t&&l.jsx("div",{className:"absolute inset-0 m-auto hidden size-fit lg:block",children:l.jsx("ul",{className:"flex gap-8 text-sm 2k:gap-16 2k:text-2xl",children:c9.map((o,c)=>l.jsx("li",{children:o.anchor?l.jsx("a",{href:o.href,onClick:u=>
2313a(u,o.anchor),className:"text-app-primary-foreground hover:text-app-primary-foreground/80 block duration-300 transition-all",children:l.jsx("span",{children:o.name})}):l.jsx("a",{href:o.href,className:"text-app-primary-foreground hover:text-app-primary-foreground/80 block duration-300 transition-all",children:l.jsx("span",{children:o.name})})},c))})}),l.jsx("div",{className:"hidden lg:flex lg:w-fit lg:gap-6 lg:space-y-0 2k:gap-12",children:t?l.jsx(ye,{asChild:!0,className:"2k:text-2xl 2k:h-16 2k:px-8",children:l.jsx(At,{to:"/app/dashboard",children:l.jsx("span",{children:"Dashboard"})})}):l.jsxs("div",{className:"flex w-full flex-col space-y-3 sm:flex-row sm:gap-3 sm:space-y-0 md:w-fit 2k:gap-8",children:[l.jsx(ye,{asChild:!0,variant:"ghost",className:ee(n&&"lg:hidden","2k:text-2xl 2k:h-16 2k:px-8"),children:l.jsx(At,{to:"/login",children:l.jsx("span",{children:"Login"})})}),l.jsx(ye,{asChild:!0,className:ee(n&&"lg:hidden","2k:text-2xl 2k:h-16 2k:px-8"),children:l.jsx(At,{to:"/signup",children:l.jsx("span",{children:"Sign Up"})})}),l.jsx(ye,{asChild:!0,className:ee(n?"lg:inline-flex":"hidden","2k:text-2xl 2k:h-16 2k:px-8"),children:l.jsx(At,{to:"/signup",children:l.jsx("span",{children:"Get Started"})})})]})})]})})}),l.jsx(Sze,{isOpen:e,onClose:()=>r(!1),menuItems:c9})]})};function da(t,e){return ws(t,e)}function tj(t,e){return Zn(t,e)}tt`
2314  query GetUserById($userId: uuid!) {
2315    user_by_pk(id: $userId) {
2316      id
2317      role_id
2318      firebase_role_id
2319      first_name
2320      last_name
2321      email
2322      username
2323      profile_photo_url
2324      stripe_customer_id
2325      current_subscription_id
2326      is_active
2327      created_at
2328      updated_at
2329      physical_state_config
2330      role {
2331        id
2332        name
2333      }
2334    }
2335  }
2336`;tt`
2337  query GetUserByUsername($username: String!) {
2338    user(where: { username: { _eq: $username }, is_active: { _eq: true } }) {
2339      id
2340      role_id
2341      firebase_role_id
2342      first_name
2343      last_name
2344      email
2345      username
2346      profile_photo_url
2347      stripe_customer_id
2348      is_active
2349      created_at
2350      updated_at
2351      role {
2352        id
2353        name
2354      }
2355    }
2356  }
2357`;tt`
2358  query GetUsersByPlanId(
2359    $stripePlanId: String!
2360    $limit: Int = 10
2361    $offset: Int = 0
2362  ) {
2363    user(
2364      where: {
2365        stripe_plan_id: { _eq: $stripePlanId }
2366        is_active: { _eq: true }
2367        deleted_at: { _is_null: true }
2368      }
2369      limit: $limit
2370      offset: $offset
2371      order_by: { created_at: desc }
2372    ) {
2373      id
2374      first_name
2375      last_name
2376      email
2377      username
2378      profile_photo_url
2379      stripe_customer_id
2380      created_at
2381      role {
2382        id
2383        name
2384      }
2385    }
2386  }
2387`;const $w=tt`
2388  query GetUserByEmail($email: String!) {
2389    user(where: { email: { _eq: $email }, is_active: { _eq: true } }) {
2390      id
2391      role_id
2392      firebase_role_id
2393      first_name
2394      last_name
2395      email
2396      username
2397      birth_date
2398      profile_photo_url
2399      onboarding_state
2400      current_subscription_id
2401      stripe_customer_id
2402      is_active
2403      created_at
2404      updated_at
2405      initial_risk
2406      physical_state_config
2407      role {
2408        id
2409        name
2410      }
2411    }
2412  }
2413`;tt`
2414  query GetUserByUsernameOrEmail($username: String, $email: String) {
2415    user(
2416      where: {
2417        _or: [{ username: { _eq: $username } }, { email: { _eq: $email } }]
2418        is_active: { _eq: true }
2419      }
2420      limit: 1
2421    ) {
2422      id
2423      role_id
2424      firebase_role_id
2425      first_name
2426      last_name
2427      email
2428      username
2429      profile_photo_url
2430      stripe_customer_id
2431      is_active
2432      created_at
2433      updated_at
2434      physical_state_config
2435      role {
2436        id
2437        name
2438      }
2439    }
2440  }
2441`;tt`
2442  query GetUserWithRoleAndFeatures($userId: uuid!) {
2443    user_by_pk(id: $userId) {
2444      id
2445      role {
2446        id
2447        name
2448        role_feature_access(where: { enabled: { _eq: true } }) {
2449          feature {
2450            id
2451            name
2452          }
2453        }
2454      }
2455    }
2456  }
2457`;tt`
2458  query GetPlanFromSubscription($subscriptionId: uuid!) {
2459    user_subscription(where: { id: { _eq: $subscriptionId } }) {
2460      plan_id
2461    }
2462  }
2463`;const Tze=tt`
2464  query GetUserSubscriptionById($subscriptionId: uuid!) {
2465    user_subscription_by_pk(id: $subscriptionId) {
2466      id
2467      cancelAtPeriodEnd: cancel_at_period_end
2468      endDate: end_date
2469      nextBillingDate: next_billing_date
2470      planId: plan_id
2471      stripeSubscriptionId: stripe_subscription_id
2472      status
2473    }
2474  }
2475`;tt`
2476  query GetUserInitialRisk($userId: uuid!) {
2477    user_by_pk(id: $userId) {
2478      id
2479      initial_risk
2480    }
2481  }
2482`;const u9=t=>{let e;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const h=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(m=>m(e,h))}},i=()=>e,o={setState:n,getState:i,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=e=t(n,i,o);return o},Cze=(t=>t?u9(t):u9),Eze=t=>t;function jze(t,e=Eze){const r=P.useSyncExternalStore(t.subscribe,P.useCallback(()=>e(t.getState()),[t,e]),P.useCallback(()=>e(t.getInitialState()),[t,e]));return P.useDebugValue(r),r}const d9=t=>{const e=Cze(t),r=n=>jze(e,n);return Object.assign(r,e),r},Wp=(t=>t?d9(t):d9);class Nze extends qi{constructor(e){super((r,n)=>{const{...i}=r;return Object.defineProperty(i,"client",{enumerable:!1,value:r.client}),new Jn(s=>{let a=!1;return Promise.resolve(i).then(o=>e(r.getContext(),o)).then(r.setContext).then(()=>{a||n(r).subscribe(s)}).catch(s.error.bind(s)),()=>{a=!0}})})}}function Pze(t){return vs(t)&&"code"in t&&"reason"in t}function Mze(t){return vs(t)&&t.target?.readyState===WebSocket.CLOSED}class Aze extends qi{client;constructor(e){super(),this.client=e}request(e){return new Jn(r=>{const{query:n,variables:i,operationName:s,extensions:a}=e;return this.client.subscribe({variables:i,operationName:s,extensions:a,query:Yh(n)},{next:r.next.bind(r),complete:r.complete.bind(r),error:o=>{if(o instanceof Error)return r.error(o);const c=Pze(o);return c||Mze(o)?r.error(new Error(`Socket closed${c?` with event ${o.code}`:""}${c?` ${o.reason}`:""}`)):r.error(new qc({errors:Array.isArray(o)?o:[o]}))}})})}}function ea(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function wh(t){return ea(t)==="object"}function Dze(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function f9(t,e){return t.length<124?t:e}const Oze="graphql-transport-ws";var ao=(t=>(t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",t))(ao||{}),oo=(t=>(t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete",t))(oo||{});function wue(t){if(!wh(t))throw new Error(`Message is expected to be an object, but got ${ea(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ea(t.type)}`);switch(t.type){case"connection_init":case"connection_ack":case"ping":case"pong":{if(t.payload!=null&&!wh(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case"subscribe":{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ea(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!wh(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ea(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ea(t.payload.query)}`);if(t.payload.variables!=null&&!wh(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ea(t.payload.variables)}`);if(t.payload.operationName!=null&&ea(t.payload.operationName)!=="str
2482ing")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ea(t.payload.operationName)}`);if(t.payload.extensions!=null&&!wh(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ea(t.payload.extensions)}`);break}case"next":{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ea(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!wh(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ea(t.payload)}`);break}case"error":{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ea(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Dze(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case"complete":{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ea(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Rze(t,e){return wue(typeof t=="string"?JSON.parse(t,e):t)}function fv(t,e){return wue(t),JSON.stringify(t,e)}function Ize(t){const{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:a=0,disablePong:o,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:d=async function($){const U=Math.pow(2,$);await new Promise(z=>setTimeout(z,U*1e3+Math.floor(Math.random()*2700+300)))},shouldRetry:f=nA,on:h,webSocketImpl:m,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,$=>{const U=Math.random()*16|0;return($=="x"?U:U&3|8).toString(16)})},jsonMessageReplacer:x,jsonMessageReviver:v}=t;let _;if(m){if(!$ze(m))throw new Error("Invalid WebSocket implementation provided");_=m}else typeof WebSocket<"u"?_=WebSocket:typeof global<"u"?_=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const S=_,k=(()=>{const V=(()=>{const U={};return{on(z,L){return U[z]=L,()=>{delete U[z]}},emit(z){"id"in z&&U[z.id]?.(z)}}})(),$={connecting:h?.connecting?[h.connecting]:[],opened:h?.opened?[h.opened]:[],connected:h?.connected?[h.connected]:[],ping:h?.ping?[h.ping]:[],pong:h?.pong?[h.pong]:[],message:h?.message?[V.emit,h.message]:[V.emit],closed:h?.closed?[h.closed]:[],error:h?.error?[h.error]:[]};return{onMessage:V.on,on(U,z){const L=$[U];return L.push(z),()=>{L.splice(L.indexOf(z),1)}},emit(U,...z){for(const L of[...$[U]])L(...z)}}})();function E(V){const $=[k.on("error",U=>{$.forEach(z=>z()),V(U)}),k.on("closed",U=>{$.forEach(z=>z()),V(U)})]}let T,N=0,j,M=!1,O=0,R=!1;async function I(){clearTimeout(j);const[V,$]=await(T??(T=new Promise((L,W)=>(async()=>{if(M){if(await d(O),!N)return T=void 0,W({code:1e3,reason:"All Subscriptions Gone"});O++}k.emit("connecting",M);const K=new S(typeof e=="function"?await e():e,Oze);let q,H;function Y(){isFinite(a)&&a>0&&(clearTimeout(H),H=setTimeout(()=>{K.readyState===S.OPEN&&(K.send(fv({type:oo.Ping})),k.emit("ping",!1,void 0))},a))}E(re=>{T=void 0,clearTimeout(q),clearTimeout(H),W(re),re instanceof h9&&(K.close(4499,"Terminated"),K.onerror=null,K.onclose=null)}),K.onerror=re=>k.emit("error",re),K.onclose=re=>k.emit("closed",re),K.onopen=async()=>{try{k.emit("opened",K);const re=typeof r=="function"?await r():r;if(K.readyState!==S.OPEN)return;K.send(fv(re?{type:oo.ConnectionInit,payload:re}:{type:oo.ConnectionInit},x)),isFinite(c)&&c>0&&(q=setTimeout(()=>{K.close(ao.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Y()}catch(re){k.emit("error",re),K.close(ao.InternalClientError,f9(re instanceof Error?re.message:String(re),"Internal 
2482client error"))}};let J=!1;K.onmessage=({data:re})=>{try{const me=Rze(re,v);if(k.emit("message",me),me.type==="ping"||me.type==="pong"){k.emit(me.type,!0,me.payload),me.type==="pong"?Y():o||(K.send(fv(me.payload?{type:oo.Pong,payload:me.payload}:{type:oo.Pong})),k.emit("pong",!1,me.payload));return}if(J)return;if(me.type!==oo.ConnectionAck)throw new Error(`First message cannot be of type ${me.type}`);clearTimeout(q),J=!0,k.emit("connected",K,me.payload,M),M=!1,O=0,L([K,new Promise((oe,ge)=>E(ge))])}catch(me){K.onmessage=null,k.emit("error",me),K.close(ao.BadResponse,f9(me instanceof Error?me.message:String(me),"Bad response"))}}})())));V.readyState===S.CLOSING&&await $;let U=()=>{};const z=new Promise(L=>U=L);return[V,U,Promise.race([z.then(()=>{if(!N){const L=()=>V.close(1e3,"Normal Closure");isFinite(s)&&s>0?j=setTimeout(()=>{V.readyState===S.OPEN&&L()},s):L()}}),$])]}function B(V){if(nA(V)&&(Lze(V.code)||[ao.InternalServerError,ao.InternalClientError,ao.BadRequest,ao.BadResponse,ao.Unauthorized,ao.SubprotocolNotAcceptable,ao.SubscriberAlreadyExists,ao.TooManyInitialisationRequests].includes(V.code)))throw V;if(R)return!1;if(nA(V)&&V.code===1e3)return N>0;if(!u||O>=u||!f(V))throw V;return M=!0}n||(async()=>{for(N++;;)try{const[,,V]=await I();await V}catch(V){try{if(!B(V))return}catch($){return i?.($)}}})();function F(V,$){const U=y(V);let z=!1,L=!1,W=()=>{N--,z=!0};return(async()=>{for(N++;;)try{const[K,q,H]=await I();if(z)return q();const Y=k.onMessage(U,J=>{switch(J.type){case oo.Next:{$.next(J.payload);return}case oo.Error:{L=!0,z=!0,$.error(J.payload),W();return}case oo.Complete:{z=!0,W();return}}});K.send(fv({id:U,type:oo.Subscribe,payload:V},x)),W=()=>{!z&&K.readyState===S.OPEN&&K.send(fv({id:U,type:oo.Complete},x)),N--,z=!0,q()},await H.finally(Y);return}catch(K){if(!B(K))return}})().then(()=>{L||$.complete()}).catch(K=>{$.error(K)}),()=>{z||W()}}return{on:k.on,subscribe:F,iterate(V){const $=[],U={done:!1,error:null,resolve:()=>{}},z=F(V,{next(W){$.push(W),U.resolve()},error(W){U.done=!0,U.error=W,U.resolve()},complete(){U.done=!0,U.resolve()}}),L=(async function*(){for(;;){for($.length||await new Promise(K=>U.resolve=K);$.length;)yield $.shift();if(U.error)throw U.error;if(U.done)return}})();return L.throw=async W=>(U.done||(U.done=!0,U.error=W,U.resolve()),{done:!0,value:void 0}),L.return=async()=>(z(),{done:!0,value:void 0}),L},async dispose(){if(R=!0,T){const[V]=await T;V.close(1e3,"Normal Closure")}},terminate(){T&&k.emit("closed",new h9)}}}class h9 extends Error{name="TerminatedCloseEvent";message="4499: Terminated";code=4499;reason="Terminated";wasClean=!1}function nA(t){return wh(t)&&"code"in t&&"reason"in t}function Lze(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function $ze(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const _ue="https://moredge-api.up.railway.app/v1/graphql",Fze=_ue.replace("https://","wss://").replace("http://","ws://"),zze=new YCe({uri:_ue}),Bze=new Nze(async t=>{const r=ej().currentUser,n=r?await r.getIdToken():null;return{headers:{...t?.headers??{},...n?{Authorization:`Bearer ${n}`}:{}}}}),Vze=new Aze(Ize({url:Fze,connectionParams:async()=>{const e=ej().currentUser,r=e?await e.getIdToken():null;return{headers:r?{Authorization:`Bearer ${r}`}:{}}}})),Uze=qi.split(({query:t})=>{const e=T4(t);return e.kind==="OperationDefinition"&&e.operation==="subscription"},Vze,qi.from([Bze,zze])),Gze=new vCe({typePolicies:{Query:{fields:{trade:{...ZTe(["where","order_by"]),read(t,{args:e}){if(!t)return t;const r=e?.offset??0,n=e?.limit??t.length;return t.slice(r,r+n)}},trade_execution:{keyArgs:["where","trade_id","_eq"],merge:!1}}}}}),xo=new ECe({link:Uze,cache:Gze}),Wze=Object.freeze(Object.defineProperty({__proto__:null,apolloClient:xo},Symbol.toStringTag,{value:"Module"})),Hze=tt`
2483  query getFeatureAccessByRoleId($roleId: uuid!) {
2484    role_feature_access(where: { role_id: { _eq: $roleId } }) {
2485      feature {
2486        id
2487        name
2488      }
2489      allowed_actions
2490    }
2491  }
2492`;tt`
2493  query getUserById($userId: uuid!) {
2494    user_by_pk(id: $userId) {
2495      id
2496      role_id
2497    }
2498  }
2499`;tt`
2500  query GetAllFeatures {
2501    feature {
2502      id
2503      name
2504    }
2505  }
2506`;tt`
2507  query GetAllRoles {
2508    role {
2509      id
2510      name
2511      created_at
2512      role_feature_accesses {
2513        id
2514        allowed_actions
2515        feature {
2516          id
2517          name
2518        }
2519      }
2520    }
2521  }
2522`;async function Ug(t){try{return{data:await t,error:null,ok:!0}}catch(e){return{data:null,error:e,ok:!1}}}function ks(t){return t instanceof Error?`${t.name}: ${t.message}`:typeof t=="string"?t:"Unknown error occurred"}const Fw=Wp((t,e)=>({permissions:{},isLoading:!1,error:null,roleId:null,isInitialized:!1,loadPermissions:async r=>{if(!(e().isLoading&&e().roleId===r)){if(!r){t({permissions:{},isLoading:!1,error:null,roleId:null,isInitialized:!0});return}t({isLoading:!0,error:null,roleId:r});try{const{data:n,error:i}=await xo.query({query:Hze,variables:{roleId:r},fetchPolicy:"cache-first"}),s={};
2522if((n?.role_feature_access||[]).forEach(o=>{o.feature?.name&&Array.isArray(o.allowed_actions)&&(s[o.feature.name]=new Set(o.allowed_actions))}),i){const o=i?.message||"Failed to load permissions";t({permissions:{},isLoading:!1,error:o,isInitialized:!0}),Ft.error("There was a problem loading your permissions. Please contact support at [email protected]."),console.error("GraphQL permissions error:",ks(i));return}t({permissions:s,isLoading:!1,error:null,isInitialized:!0})}catch(n){const i=n instanceof Error?n.message:"Failed to load permissions";t({permissions:{},isLoading:!1,error:i,isInitialized:!0}),Ft.error("There was a problem loading your permissions. Please contact support at [email protected].")}}},hasPermission:(r,n)=>{const{permissions:i}=e();return i[r]?.has(n)||!1},hasReadAccess:r=>e().hasPermission(r,"READ"),hasWriteAccess:r=>e().hasPermission(r,"WRITE"),hasDeleteAccess:r=>e().hasPermission(r,"DELETE"),hasUpdateAccess:r=>e().hasPermission(r,"UPDATE"),refetchPermissions:async()=>{const{roleId:r}=e();r&&await e().loadPermissions(r)},clearPermissions:()=>{t({permissions:{},isLoading:!1,error:null,roleId:null,isInitialized:!1})},clearError:()=>{t({error:null})}})),Sue="@firebase/installations",iB="0.6.18";/**
2523 * @license
2524 * Copyright 2019 Google LLC
2525 *
2526 * Licensed under the Apache License, Version 2.0 (the "License");
2527 * you may not use this file except in compliance with the License.
2528 * You may obtain a copy of the License at
2529 *
2530 *   http://www.apache.org/licenses/LICENSE-2.0
2531 *
2532 * Unless required by applicable law or agreed to in writing, software
2533 * distributed under the License is distributed on an "AS IS" BASIS,
2534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2535 * See the License for the specific language governing permissions and
2536 * limitations under the License.
2537 */const kue=1e4,Tue=`w:${iB}`,Cue="FIS_v2",qze="https://firebaseinstallations.googleapis.com/v1",Yze=3600*1e3,Kze="installations",Qze="Installations";/**
2538 * @license
2539 * Copyright 2019 Google LLC
2540 *
2541 * Licensed under the Apache License, Version 2.0 (the "License");
2542 * you may not use this file except in compliance with the License.
2543 * You may obtain a copy of the License at
2544 *
2545 *   http://www.apache.org/licenses/LICENSE-2.0
2546 *
2547 * Unless required by applicable law or agreed to in writing, software
2548 * distributed under the License is distributed on an "AS IS" BASIS,
2549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2550 * See the License for the specific language governing permissions and
2551 * limitations under the License.
2552 */const Zze={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},gp=new If(Kze,Qze,Zze);function Eue(t){return t instanceof Ha&&t.code.includes("request-failed")}/**
2553 * @license
2554 * Copyright 2019 Google LLC
2555 *
2556 * Licensed under the Apache License, Version 2.0 (the "License");
2557 * you may not use this file except in compliance with the License.
2558 * You may obtain a copy of the License at
2559 *
2560 *   http://www.apache.org/licenses/LICENSE-2.0
2561 *
2562 * Unless required by applicable law or agreed to in writing, software
2563 * distributed under the License is distributed on an "AS IS" BASIS,
2564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2565 * See the License for the specific language governing permissions and
2566 * limitations under the License.
2567 */function jue({projectId:t}){return`${qze}/projects/${t}/installations`}function Nue(t){return{token:t.token,requestStatus:2,expiresIn:Jze(t.expiresIn),creationTime:Date.now()}}async function Pue(t,e){const n=(await e.json()).error;return gp.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function Mue({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function Xze(t,{refreshToken:e}){const r=Mue(t);return r.append("Authorization",e4e(e)),r}async function Aue(t){const e=await t();return e.status>=500&&e.status<600?t():e}function Jze(t){return Number(t.replace("s","000"))}function e4e(t){return`${Cue} ${t}`}/**
2568 * @license
2569 * Copyright 2019 Google LLC
2570 *
2571 * Licensed under the Apache License, Version 2.0 (the "License");
2572 * you may not use this file except in compliance with the License.
2573 * You may obtain a copy of the License at
2574 *
2575 *   http://www.apache.org/licenses/LICENSE-2.0
2576 *
2577 * Unless required by applicable law or agreed to in writing, software
2578 * distributed under the License is distributed on an "AS IS" BASIS,
2579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2580 * See the License for the specific language governing permissions and
2581 * limitations under the License.
2582 */async function t4e({appConfig:t,heartbeatServiceProvider:e},{fid:r}){const n=jue(t),i=Mue(t),s=e.getImmediate({optional:!0});if(s){const u=await s.getHeartbeatsHeader();u&&i.append("x-firebase-client",u)}const a={fid:r,authVersion:Cue,appId:t.appId,sdkVersion:Tue},o={method:"POST",headers:i,body:JSON.stringify(a)},c=await Aue(()=>fetch(n,o));if(c.ok){const u=await c.json();return{fid:u.fid||r,registrationStatus:2,refreshToken:u.refreshToken,authToken:Nue(u.authToken)}}else throw await Pue("Create Installation",c)}/**
2583 * @license
2584 * Copyright 2019 Google LLC
2585 *
2586 * Licensed under the Apache License, Version 2.0 (the "License");
2587 * you may not use this file except in compliance with the License.
2588 * You may obtain a copy of the License at
2589 *
2590 *   http://www.apache.org/licenses/LICENSE-2.0
2591 *
2592 * Unless required by applicable law or agreed to in writing, software
2593 * distributed under the License is distributed on an "AS IS" BASIS,
2594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2595 * See the License for the specific language governing permissions and
2596 * limitations under the License.
2597 */function Due(t){return new Promise(e=>{setTimeout(e,t)})}/**
2598 * @license
2599 * Copyright 2019 Google LLC
2600 *
2601 * Licensed under the Apache License, Version 2.0 (the "License");
2602 * you may not use this file except in compliance with the License.
2603 * You may obtain a copy of the License at
2604 *
2605 *   http://www.apache.org/licenses/LICENSE-2.0
2606 *
2607 * Unless required by applicable law or agreed to in writing, software
2608 * distributed under the License is distributed on an "AS IS" BASIS,
2609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2610 * See the License for the specific language governing permissions and
2611 * limitations under the License.
2612 */function r4e(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
2613 * @license
2614 * Copyright 2019 Google LLC
2615 *
2616 * Licensed under the Apache License, Version 2.0 (the "License");
2617 * you may not use this file except in compliance with the License.
2618 * You may obtain a copy of the License at
2619 *
2620 *   http://www.apache.org/licenses/LICENSE-2.0
2621 *
2622 * Unless required by applicable law or agreed to in writing, software
2623 * distributed under the License is distributed on an "AS IS" BASIS,
2624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2625 * See the License for the specific language governing permissions and
2626 * limitations under the License.
2627 */const n4e=/^[cdef][\w-]{21}$/,hF="";function i4e(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const r=s4e(t);return n4e.test(r)?r:hF}catch{return hF}}function s4e(t){return r4e(t).substr(0,22)}/**
2628 * @license
2629 * Copyright 2019 Google LLC
2630 *
2631 * Licensed under the Apache License, Version 2.0 (the "License");
2632 * you may not use this file except in compliance with the License.
2633 * You may obtain a copy of the License at
2634 *
2635 *   http://www.apache.org/licenses/LICENSE-2.0
2636 *
2637 * Unless required by applicable law or agreed to in writing, software
2638 * distributed under the License is distributed on an "AS IS" BASIS,
2639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2640 * See the License for the specific language governing permissions and
2641 * limitations under the License.
2642 */function rj(t){return`${t.appName}!${t.appId}`}/**
2643 * @license
2644 * Copyright 2019 Google LLC
2645 *
2646 * Licensed under the Apache License, Version 2.0 (the "License");
2647 * you may not use this file except in compliance with the License.
2648 * You may obtain a copy of the License at
2649 *
2650 *   http://www.apache.org/licenses/LICENSE-2.0
2651 *
2652 * Unless required by applicable law or agreed to in writing, softw
2652are
2653 * distributed under the License is distributed on an "AS IS" BASIS,
2654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2655 * See the License for the specific language governing permissions and
2656 * limitations under the License.
2657 */const Oue=new Map;function Rue(t,e){const r=rj(t);Iue(r,e),a4e(r,e)}function Iue(t,e){const r=Oue.get(t);if(r)for(const n of r)n(e)}function a4e(t,e){const r=o4e();r&&r.postMessage({key:t,fid:e}),l4e()}let Lh=null;function o4e(){return!Lh&&"BroadcastChannel"in self&&(Lh=new BroadcastChannel("[Firebase] FID Change"),Lh.onmessage=t=>{Iue(t.data.key,t.data.fid)}),Lh}function l4e(){Oue.size===0&&Lh&&(Lh.close(),Lh=null)}/**
2658 * @license
2659 * Copyright 2019 Google LLC
2660 *
2661 * Licensed under the Apache License, Version 2.0 (the "License");
2662 * you may not use this file except in compliance with the License.
2663 * You may obtain a copy of the License at
2664 *
2665 *   http://www.apache.org/licenses/LICENSE-2.0
2666 *
2667 * Unless required by applicable law or agreed to in writing, software
2668 * distributed under the License is distributed on an "AS IS" BASIS,
2669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2670 * See the License for the specific language governing permissions and
2671 * limitations under the License.
2672 */const c4e="firebase-installations-database",u4e=1,yp="firebase-installations-store";let iA=null;function sB(){return iA||(iA=Moe(c4e,u4e,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(yp)}}})),iA}async function gT(t,e){const r=rj(t),i=(await sB()).transaction(yp,"readwrite"),s=i.objectStore(yp),a=await s.get(r);return await s.put(e,r),await i.done,(!a||a.fid!==e.fid)&&Rue(t,e.fid),e}async function Lue(t){const e=rj(t),n=(await sB()).transaction(yp,"readwrite");await n.objectStore(yp).delete(e),await n.done}async function nj(t,e){const r=rj(t),i=(await sB()).transaction(yp,"readwrite"),s=i.objectStore(yp),a=await s.get(r),o=e(a);return o===void 0?await s.delete(r):await s.put(o,r),await i.done,o&&(!a||a.fid!==o.fid)&&Rue(t,o.fid),o}/**
2673 * @license
2674 * Copyright 2019 Google LLC
2675 *
2676 * Licensed under the Apache License, Version 2.0 (the "License");
2677 * you may not use this file except in compliance with the License.
2678 * You may obtain a copy of the License at
2679 *
2680 *   http://www.apache.org/licenses/LICENSE-2.0
2681 *
2682 * Unless required by applicable law or agreed to in writing, software
2683 * distributed under the License is distributed on an "AS IS" BASIS,
2684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2685 * See the License for the specific language governing permissions and
2686 * limitations under the License.
2687 */async function aB(t){let e;const r=await nj(t.appConfig,n=>{const i=d4e(n),s=f4e(t,i);return e=s.registrationPromise,s.installationEntry});return r.fid===hF?{installationEntry:await e}:{installationEntry:r,registrationPromise:e}}function d4e(t){const e=t||{fid:i4e(),registrationStatus:0};return $ue(e)}function f4e(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(gp.create("app-offline"));return{installationEntry:e,registrationPromise:i}}const r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},n=h4e(t,r);return{installationEntry:r,registrationPromise:n}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:p4e(t)}:{installationEntry:e}}async function h4e(t,e){try{const r=await t4e(t,e);return gT(t.appConfig,r)}catch(r){throw Eue(r)&&r.customData.serverCode===409?await Lue(t.appConfig):await gT(t.appConfig,{fid:e.fid,registrationStatus:0}),r}}async function p4e(t){let e=await p9(t.appConfig);for(;e.registrationStatus===1;)await Due(100),e=await p9(t.appConfig);if(e.registrationStatus===0){const{installationEntry:r,registrationPromise:n}=await aB(t);return n||r}return e}function p9(t){return nj(t,e=>{if(!e)throw gp.create("installation-not-found");return $ue(e)})}function $ue(t){return m4e(t)?{fid:t.fid,registrationStatus:0}:t}function m4e(t){return t.registrationStatus===1&&t.registrationTime+kue<Date.now()}/**
2688 * @license
2689 * Copyright 2019 Google LLC
2690 *
2691 * Licensed under the Apache License, Version 2.0 (the "License");
2692 * you may not use this file except in compliance with the License.
2693 * You may obtain a copy of the License at
2694 *
2695 *   http://www.apache.org/licenses/LICENSE-2.0
2696 *
2697 * Unless required by applicable law or agreed to in writing, software
2698 * distributed under the License is distributed on an "AS IS" BASIS,
2699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2700 * See the License for the specific language governing permissions and
2701 * limitations under the License.
2702 */async function g4e({appConfig:t,heartbeatServiceProvider:e},r){const n=y4e(t,r),i=Xze(t,r),s=e.getImmediate({optional:!0});if(s){const u=await s.getHeartbeatsHeader();u&&i.append("x-firebase-client",u)}const a={installation:{sdkVersion:Tue,appId:t.appId}},o={method:"POST",headers:i,body:JSON.stringify(a)},c=await Aue(()=>fetch(n,o));if(c.ok){const u=await c.json();return Nue(u)}else throw await Pue("Generate Auth Token",c)}function y4e(t,{fid:e}){return`${jue(t)}/${e}/authTokens:generate`}/**
2703 * @license
2704 * Copyright 2019 Google LLC
2705 *
2706 * Licensed under the Apache License, Version 2.0 (the "License");
2707 * you may not use this file except in compliance with the License.
2708 * You may obtain a copy of the License at
2709 *
2710 *   http://www.apache.org/licenses/LICENSE-2.0
2711 *
2712 * Unless required by applicable law or agreed to in writing, software
2713 * distributed under the License is distributed on an "AS IS" BASIS,
2714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2715 * See the License for the specific language governing permissions and
2716 * limitations under the License.
2717 */async function oB(t,e=!1){let r;const n=await nj(t.appConfig,s=>{if(!Fue(s))throw gp.create("not-registered");const a=s.authToken;if(!e&&b4e(a))return s;if(a.requestStatus===1)return r=v4e(t,e),s;{if(!navigator.onLine)throw gp.create("app-offline");const o=_4e(s);return r=x4e(t,o),o}});return r?await r:n.authToken}async function v4e(t,e){let r=await m9(t.appConfig);for(;r.authToken.requestStatus===1;)await Due(100),r=await m9(t.appConfig);const n=r.authToken;return n.requestStatus===0?oB(t,e):n}function m9(t){return nj(t,e=>{if(!Fue(e))throw gp.create("not-registered");const r=e.authToken;return S4e(r)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function x4e(t,e){try{const r=await g4e(t,e),n=Object.assign(Object.assign({},e),{authToken:r});return await gT(t.appConfig,n),r}catch(r){if(Eue(r)&&(r.customData.serverCode===401||r.customData.serverCode===404))await Lue(t.appConfig);else{const n=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await gT(t.appConfig,n)}throw r}}function Fue(t){return t!==void 0&&t.registrationStatus===2}function b4e(t){return t.requestStatus===2&&!w4e(t)}function w4e(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+Yze}function _4e(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function S4e(t){return t.requestStatus===1&&t.requestTime+kue<Date.now()}/**
2718 * @license
2719 * Copyright 2019 Google LLC
2720 *
2721 * Licensed under the Apache License, Version 2.0 (the "License");
2722 * you may not use this file except in compliance with the License.
2723 * You may obtain a copy of the License at
2724 *
2725 *   http://www.apache.org/licenses/LICENSE-2.0
2726 *
2727 * Unless required by applicable law or agreed to in writing, software
2728 * distributed under the License is distributed on an "AS IS" BASIS,
2729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2730 * See the License for the specific language governing permissions and
2731 * limitations under the License.
2732 */async function k4e(t){const e=t,{installationEntry:r,registrationPromise:n}=await aB(e);return n?n.catch(console.error):oB(e).catch(console.error),r.fid}/**
2733 * @license
2734 * Copyright 2019 Google LLC
2735 *
2736 * Licensed under the Apache License, Version 2.0 (the "License");
2737 * you may not use this file except in compliance with the License.
2738 * You may obtain a copy of the License at
2739 *
2740 *   http://www.apache.org/licenses/LICENSE-2.0
2741 *
2742 * Unless required by applicable law or agreed to in writing, softw
2742are
2743 * distributed under the License is distributed on an "AS IS" BASIS,
2744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2745 * See the License for the specific language governing permissions and
2746 * limitations under the License.
2747 */async function T4e(t,e=!1){const r=t;return await C4e(r),(await oB(r,e)).token}async function C4e(t){const{registrationPromise:e}=await aB(t);e&&await e}/**
2748 * @license
2749 * Copyright 2019 Google LLC
2750 *
2751 * Licensed under the Apache License, Version 2.0 (the "License");
2752 * you may not use this file except in compliance with the License.
2753 * You may obtain a copy of the License at
2754 *
2755 *   http://www.apache.org/licenses/LICENSE-2.0
2756 *
2757 * Unless required by applicable law or agreed to in writing, software
2758 * distributed under the License is distributed on an "AS IS" BASIS,
2759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2760 * See the License for the specific language governing permissions and
2761 * limitations under the License.
2762 */function E4e(t){if(!t||!t.options)throw sA("App Configuration");if(!t.name)throw sA("App Name");const e=["projectId","apiKey","appId"];for(const r of e)if(!t.options[r])throw sA(r);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function sA(t){return gp.create("missing-app-config-values",{valueName:t})}/**
2763 * @license
2764 * Copyright 2020 Google LLC
2765 *
2766 * Licensed under the Apache License, Version 2.0 (the "License");
2767 * you may not use this file except in compliance with the License.
2768 * You may obtain a copy of the License at
2769 *
2770 *   http://www.apache.org/licenses/LICENSE-2.0
2771 *
2772 * Unless required by applicable law or agreed to in writing, software
2773 * distributed under the License is distributed on an "AS IS" BASIS,
2774 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2775 * See the License for the specific language governing permissions and
2776 * limitations under the License.
2777 */const zue="installations",j4e="installations-internal",N4e=t=>{const e=t.getProvider("app").getImmediate(),r=E4e(e),n=Gp(e,"heartbeat");return{app:e,appConfig:r,heartbeatServiceProvider:n,_delete:()=>Promise.resolve()}},P4e=t=>{const e=t.getProvider("app").getImmediate(),r=Gp(e,zue).getImmediate();return{getId:()=>k4e(r),getToken:i=>T4e(r,i)}};function M4e(){Po(new Ba(zue,N4e,"PUBLIC")),Po(new Ba(j4e,P4e,"PRIVATE"))}M4e();Ia(Sue,iB);Ia(Sue,iB,"esm2017");/**
2778 * @license
2779 * Copyright 2019 Google LLC
2780 *
2781 * Licensed under the Apache License, Version 2.0 (the "License");
2782 * you may not use this file except in compliance with the License.
2783 * You may obtain a copy of the License at
2784 *
2785 *   http://www.apache.org/licenses/LICENSE-2.0
2786 *
2787 * Unless required by applicable law or agreed to in writing, software
2788 * distributed under the License is distributed on an "AS IS" BASIS,
2789 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2790 * See the License for the specific language governing permissions and
2791 * limitations under the License.
2792 */const g9="analytics",A4e="firebase_id",D4e="origin",O4e=60*1e3,R4e="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",lB="https://www.googletagmanager.com/gtag/js";/**
2793 * @license
2794 * Copyright 2019 Google LLC
2795 *
2796 * Licensed under the Apache License, Version 2.0 (the "License");
2797 * you may not use this file except in compliance with the License.
2798 * You may obtain a copy of the License at
2799 *
2800 *   http://www.apache.org/licenses/LICENSE-2.0
2801 *
2802 * Unless required by applicable law or agreed to in writing, software
2803 * distributed under the License is distributed on an "AS IS" BASIS,
2804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2805 * See the License for the specific language governing permissions and
2806 * limitations under the License.
2807 */const la=new GE("@firebase/analytics");/**
2808 * @license
2809 * Copyright 2019 Google LLC
2810 *
2811 * Licensed under the Apache License, Version 2.0 (the "License");
2812 * you may not use this file except in compliance with the License.
2813 * You may obtain a copy of the License at
2814 *
2815 *   http://www.apache.org/licenses/LICENSE-2.0
2816 *
2817 * Unless required by applicable law or agreed to in writing, softw
2817are
2818 * distributed under the License is distributed on an "AS IS" BASIS,
2819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2820 * See the License for the specific language governing permissions and
2821 * limitations under the License.
2822 */const I4e={"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},So=new If("analytics","Analytics",I4e);/**
2823 * @license
2824 * Copyright 2019 Google LLC
2825 *
2826 * Licensed under the Apache License, Version 2.0 (the "License");
2827 * you may not use this file except in compliance with the License.
2828 * You may obtain a copy of the License at
2829 *
2830 *   http://www.apache.org/licenses/LICENSE-2.0
2831 *
2832 * Unless required by applicable law or agreed to in writing, software
2833 * distributed under the License is distributed on an "AS IS" BASIS,
2834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2835 * See the License for the specific language governing permissions and
2836 * limitations under the License.
2837 */function L4e(t){if(!t.startsWith(lB)){const e=So.create("invalid-gtag-resource",{gtagURL:t});return la.warn(e.message),""}return t}function Bue(t){return Promise.all(t.map(e=>e.catch(r=>r)))}function $4e(t,e){let r;return window.trustedTypes&&(r=window.trustedTypes.createPolicy(t,e)),r}function F4e(t,e){const r=$4e("firebase-js-sdk-policy",{createScriptURL:L4e}),n=document.createElement("script"),i=`${lB}?l=${t}&id=${e}`;n.src=r?r?.createScriptURL(i):i,n.async=!0,document.head.appendChild(n)}function z4e(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function B4e(t,e,r,n,i,s){const a=n[i];try{if(a)await e[a];else{const c=(await Bue(r)).find(u=>u.measurementId===i);c&&await e[c.appId]}}catch(o){la.error(o)}t("config",i,s)}async function V4e(t,e,r,n,i){try{let s=[];if(i&&i.send_to){let a=i.send_to;Array.isArray(a)||(a=[a]);const o=await Bue(r);for(const c of a){const u=o.find(f=>f.measurementId===c),d=u&&e[u.appId];if(d)s.push(d);else{s=[];break}}}s.length===0&&(s=Object.values(e)),await Promise.all(s),t("event",n,i||{})}catch(s){la.error(s)}}function U4e(t,e,r,n){async function i(s,...a){try{if(s==="event"){const[o,c]=a;await V4e(t,e,r,o,c)}else if(s==="config"){const[o,c]=a;await B4e(t,e,r,n,o,c)}else if(s==="consent"){const[o,c]=a;t("consent",o,c)}else if(s==="get"){const[o,c,u]=a;t("get",o,c,u)}else if(s==="set"){const[o]=a;t("set",o)}else t(s,...a)}catch(o){la.error(o)}}return i}function G4e(t,e,r,n,i){let s=function(...a){window[n].push(arguments)};return window[i]&&typeof window[i]=="function"&&(s=window[i]),window[i]=U4e(s,t,e,r),{gtagCore:s,wrappedGtag:window[i]}}function W4e(t){const e=window.document.getElementsByTagName("script");for(const r of Object.values(e))if(r.src&&r.src.includes(lB)&&r.src.includes(t))return r;return null}/**
2838 * @license
2839 * Copyright 2020 Google LLC
2840 *
2841 * Licensed under the Apache License, Version 2.0 (the "License");
2842 * you may not use this file except in compliance with the License.
2843 * You may obtain a copy of the License at
2844 *
2845 *   http://www.apache.org/licenses/LICENSE-2.0
2846 *
2847 * Unless required by applicable law or agreed to in writing, software
2848 * distributed under the License is distributed on an "AS IS" BASIS,
2849 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2850 * See the License for the specific language governing permissions and
2851 * limitations under the License.
2852 */const H4e=30,q4e=1e3;class Y4e{constructor(e={},r=q4e){this.throttleMetadata=e,this.intervalMillis=r}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,r){this.throttleMetadata[e]=r}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const Vue=new Y4e;function K4e(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function Q4e(t){var e;const{appId:r,apiKey:n}=t,i={method:"GET",headers:K4e(n)},s=R4e.replace("{app-id}",r),a=await fetch(s,i);if(a.status!==200&&a.status!==304){let o="";try{const c=await a.json();!((e=c.error)===null||e===void 0)&&e.message&&(o=c.error.message)}catch{}throw So.create("config-fetch-failed",{httpStatus:a.status,responseMessage:o})}return a.json()}async function Z4e(t,e=Vue,r){const{appId:n,apiKey:i,measurementId:s}=t.options;if(!n)throw So.create("no-app-id");if(!i){if(s)return{measurementId:s,appId:n};throw So.create("no-api-key")}const a=e.getThrottleMetadata(n)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new e3e;return setTimeout(async()=>{o.abort()},O4e),Uue({appId:n,apiKey:i,measurementId:s},a,o,e)}async function Uue(t,{throttleEndTimeMillis:e,backoffCount:r},n,i=Vue){var s;const{appId:a,measurementId:o}=t;try{await X4e(n,e)}catch(c){if(o)return la.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${c?.message}]`),{appId:a,measurementId:o};throw c}try{const c=await Q4e(t);return i.deleteThrottleMetadata(a),c}catch(c){const u=c;if(!J4e(u)){if(i.deleteThrottleMetadata(a),o)return la.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${u?.message}]`),{appId:a,measurementId:o};throw c}const d=Number((s=u?.customData)===null||s===void 0?void 0:s.httpStatus)===503?M$(r,i.intervalMillis,H4e):M$(r,i.intervalMillis),f={throttleEndTimeMillis:Date.now()+d,backoffCount:r+1};return i.setThrottleMetadata(a,f),la.debug(`Calling attemptFetch again in ${d} millis`),Uue(t,f,n,i)}}function X4e(t,e){return new Promise((r,n)=>{const i=Math.max(e-Date.now(),0),s=setTimeout(r,i);t.addEventListener(()=>{clearTimeout(s),n(So.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function J4e(t){if(!(t instanceof Ha)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class e3e{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function t3e(t,e,r,n,i){if(i&&i.global){t("event",r,n);return}else{const s=await e,a=Object.assign(Object.assign({},n),{send_to:s});t("event",r,a)}}/**
2853 * @license
2854 * Copyright 2020 Google LLC
2855 *
2856 * Licensed under the Apache License, Version 2.0 (the "License");
2857 * you may not use this file except in compliance with the License.
2858 * You may obtain a copy of the License at
2859 *
2860 *   http://www.apache.org/licenses/LICENSE-2.0
2861 *
2862 * Unless required by applicable law or agreed to in writing, software
2863 * distributed under the License is distributed on an "AS IS" BASIS,
2864 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2865 * See the License for the specific language governing permissions and
2866 * limitations under the License.
2867 */async function r3e(){if(UE())try{await joe()}catch(t){return la.warn(So.create("indexeddb-unavailable",{errorInfo:t?.toString()}).message),!1}else return la.warn(So.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function n3e(t,e,r,n,i,s,a){var o;const c=Z4e(t);c.then(m=>{r[m.measurementId]=m.appId,t.options.measurementId&&m.measurementId!==t.options.measurementId&&la.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${m.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(m=>la.error(m)),e.push(c);const u=r3e().then(m=>{if(m)return n.getId()}),[d,f]=await Promise.all([c,u]);W4e(s)||F4e(s,d.measurementId),i("js",new Date);const h=(o=a?.config)!==null&&o!==void 0?o:{};return h[D4e]="firebase",h.update=!0,f!=null&&(h[A4e]=f),i("config",d.measurementId,h),d.measurementId}/**
2868 * @license
2869 * Copyright 2019 Google LLC
2870 *
2871 * Licensed under the Apache License, Version 2.0 (the "License");
2872 * you may not use this file except in compliance with the License.
2873 * You may obtain a copy of the License at
2874 *
2875 *   http://www.apache.org/licenses/LICENSE-2.0
2876 *
2877 * Unless required by applicable law or agreed to in writing, software
2878 * distributed under the License is distributed on an "AS IS" BASIS,
2879 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2880 * See the License for the specific language governing permissions and
2881 * limitations under the License.
2882 */class i3e{constructor(e){this.app=e}_delete(){return delete _x[this.app.options.appId],Promise.resolve()}}let _x={},y9=[];const v9={};let aA="dataLayer",s3e="gtag",x9,Gue,b9=!1;function a3e(){const t=[];if(Eoe()&&t.push("This is a browser extension environment."),c2e()||t.push("Cookies are not available."),t.length>0){const e=t.map((n,i)=>`(${i+1}) ${n}`).join(" "),r=So.create("invalid-analytics-context",{errorInfo:e});la.warn(r.message)}}function o3e(t,e,r){a3e();const n=t.options.appId;if(!n)throw So.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)la.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw So.create("no-api-key");if(_x[n]!=null)throw So.create("already-exists",{id:n});if(!b9){z4e(aA);const{wrappedGtag:s,gtagCore:a}=G4e(_x,y9,v9,aA,s3e);Gue=s,x9=a,b9=!0}return _x[n]=n3e(t,y9,v9,e,x9,aA,r),new i3e(t)}function l3e(t,e,r,n){t=zn(t),t3e(Gue,_x[t.app.options.appId],e,r,n).catch(i=>la.error(i))}const w9="@firebase/analytics",_9="0.10.17";function c3e(){Po(new Ba(g9,(e,{options:r})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("installations-internal").getImmediate();return o3e(n,i,r)},"PUBLIC")),Po(new Ba("analytics-internal",t,"PRIVATE")),Ia(w9,_9),Ia(w9,_9,"esm2017");function t(e){try{const r=e.getProvider(g9).getImmediate();return{logEvent:(n,i,s)=>l3e(r,n,i,s)}}catch(r){throw So.create("interop-component-reg-failed",{reason:r})}}}c3e();/**
2883 * @license
2884 * Copyright 2020 Google LLC
2885 *
2886 * Licensed under the Apache License, Version 2.0 (the "License");
2887 * you may not use this file except in compliance with the License.
2888 * You may obtain a copy of the License at
2889 *
2890 *   http://www.apache.org/licenses/LICENSE-2.0
2891 *
2892 * Unless required by applicable law or agreed to in writing, software
2893 * distributed under the License is distributed on an "AS IS" BASIS,
2894 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2895 * See the License for the specific language governing permissions and
2896 * limitations under the License.
2897 */const pF=new Map,Wue={activated:!1,tokenObservers:[]},u3e={initialized:!1,enabled:!1};function Ci(t){return pF.get(t)||Object.assign({},Wue)}function d3e(t,e){return pF.set(t,e),pF.get(t)}function ij(){return u3e}/**
2898 * @license
2899 * Copyright 2020 Google LLC
2900 *
2901 * Licensed under the Apache License, Version 2.0 (the "License");
2902 * you may not use this file except in compliance with the License.
2903 * You may obtain a copy of the License at
2904 *
2905 *   http://www.apache.org/licenses/LICENSE-2.0
2906 *
2907 * Unless required by applicable law or agreed to in writing, software
2908 * distributed under the License is distributed on an "AS IS" BASIS,
2909 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2910 * See the License for the specific language governing permissions and
2911 * limitations under the License.
2912 */const Hue="https://content-firebaseappcheck.googleapis.com/v1",f3e="exchangeRecaptchaV3Token",h3e="exchangeDebugToken",S9={RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},p3e=1440*60*1e3;/**
2913 * @license
2914 * Copyright 2020 Google LLC
2915 *
2916 * Licensed under the Apache License, Version 2.0 (the "License");
2917 * you may not use this file except in compliance with the License.
2918 * You may obtain a copy of the License at
2919 *
2920 *   http://www.apache.org/licenses/LICENSE-2.0
2921 *
2922 * Unless required by applicable law or agreed to in writing, software
2923 * distributed under the License is distributed on an "AS IS" BASIS,
2924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2925 * See the License for the specific language governing permissions and
2926 * limitations under the License.
2927 */class m3e{constructor(e,r,n,i,s){if(this.operation=e,this.retryPolicy=r,this.getWaitDuration=n,this.lowerBound=i,this.upperBound=s,this.pending=null,this.nextErrorWaitInterval=i,i>s)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new rb,this.pending.promise.catch(r=>{}),await g3e(this.getNextRun(e)),this.pending.resolve(),await this.pending.promise,this.pending=new rb,this.pending.promise.catch(r=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(r){this.retryPolicy(r)?this.process(!1).catch(()=>{}):this.stop()}}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const r=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),r}}}function g3e(t){return new Promise(e=>{setTimeout(e,t)})}/**
2928 * @license
2929 * Copyright 2020 Google LLC
2930 *
2931 * Licensed under the Apache License, Version 2.0 (the "License");
2932 * you may not use this file except in compliance with the License.
2933 * You may obtain a copy of the License at
2934 *
2935 *   http://www.apache.org/licenses/LICENSE-2.0
2936 *
2937 * Unless required by applicable law or agreed to in writing, software
2938 * distributed under the License is distributed on an "AS IS" BASIS,
2939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2940 * See the License for the specific language governing permissions and
2941 * limitations under the License.
2942 */const y3e={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},sa=new If("appCheck","AppCheck",y3e);/**
2943 * @license
2944 * Copyright 2020 Google LLC
2945 *
2946 * Licensed under the Apache License, Version 2.0 (the "License");
2947 * you may not use this file except in compliance with the License.
2948 * You may obtain a copy of the License at
2949 *
2950 *   http://www.apache.org/licenses/LICENSE-2.0
2951 *
2952 * Unless required by applicable law or agreed to in writing, software
2953 * distributed under the License is distributed on an "AS IS" BASIS,
2954 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2955 * See the License for the specific language governing permissions and
2956 * limitations under the License.
2957 */function k9(t=!1){var e;return t?(e=self.grecaptcha)===null||e===void 0?void 0:e.enterprise:self.grecaptcha}function cB(t){if(!Ci(t).activated)throw sa.create("use-before-activation",{appName:t.name})}function que(t){const e=Math.round(t/1e3),r=Math.floor(e/(3600*24)),n=Math.floor((e-r*3600*24)/3600),i=Math.floor((e-r*3600*24-n*3600)/60),s=e-r*3600*24-n*3600-i*60;let a="";return r&&(a+=Y_(r)+"d:"),n&&(a+=Y_(n)+"h:"),a+=Y_(i)+"m:"+Y_(s)+"s",a}function Y_(t){return t===0?"00":t>=10?t.toString():"0"+t}/**
2958 * @license
2959 * Copyright 2020 Google LLC
2960 *
2961 * Licensed under the Apache License, Version 2.0 (the "License");
2962 * you may not use this file except in compliance with the License.
2963 * You may obtain a copy of the License at
2964 *
2965 *   http://www.apache.org/licenses/LICENSE-2.0
2966 *
2967 * Unless required by applicable law or agreed to in writing, software
2968 * distributed under the License is distributed on an "AS IS" BASIS,
2969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2970 * See the License for the specific language governing permissions and
2971 * limitations under the License.
2972 */async function uB({url:t,body:e},r){const n={"Content-Type":"application/json"},i=r.getImmediate({optional:!0});if(i){const f=await i.getHeartbeatsHeader();f&&(n["X-Firebase-Client"]=f)}const s={method:"POST",body:JSON.stringify(e),headers:n};let a;try{a=await fetch(t,s)}catch(f){throw sa.create("fetch-network-error",{originalErrorMessage:f?.message})}if(a.status!==200)throw sa.create("fetch-status-error",{httpStatus:a.status});let o;try{o=await a.json()}catch(f){throw sa.create("fetch-parse-error",{originalErrorMessage:f?.message})}const c=o.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw sa.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${o.ttl}`});const u=Number(c[1])*1e3,d=Date.now();return{token:o.token,expireTimeMillis:d+u,issuedAtTimeMillis:d}}
2972function v3e(t,e){const{projectId:r,appId:n,apiKey:i}=t.options;return{url:`${Hue}/projects/${r}/apps/${n}:${f3e}?key=${i}`,body:{recaptcha_v3_token:e}}}function Yue(t,e){const{projectId:r,appId:n,apiKey:i}=t.options;return{url:`${Hue}/projects/${r}/apps/${n}:${h3e}?key=${i}`,body:{debug_token:e}}}/**
2973 * @license
2974 * Copyright 2020 Google LLC
2975 *
2976 * Licensed under the Apache License, Version 2.0 (the "License");
2977 * you may not use this file except in compliance with the License.
2978 * You may obtain a copy of the License at
2979 *
2980 *   http://www.apache.org/licenses/LICENSE-2.0
2981 *
2982 * Unless required by applicable law or agreed to in writing, software
2983 * distributed under the License is distributed on an "AS IS" BASIS,
2984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2985 * See the License for the specific language governing permissions and
2986 * limitations under the License.
2987 */const x3e="firebase-app-check-database",b3e=1,hb="firebase-app-check-store",Kue="debug-token";let K_=null;function Que(){return K_||(K_=new Promise((t,e)=>{try{const r=indexedDB.open(x3e,b3e);r.onsuccess=n=>{t(n.target.result)},r.onerror=n=>{var i;e(sa.create("storage-open",{originalErrorMessage:(i=n.target.error)===null||i===void 0?void 0:i.message}))},r.onupgradeneeded=n=>{const i=n.target.result;switch(n.oldVersion){case 0:i.createObjectStore(hb,{keyPath:"compositeKey"})}}}catch(r){e(sa.create("storage-open",{originalErrorMessage:r?.message}))}}),K_)}function w3e(t){return Xue(Jue(t))}function _3e(t,e){return Zue(Jue(t),e)}function S3e(t){return Zue(Kue,t)}function k3e(){return Xue(Kue)}async function Zue(t,e){const n=(await Que()).transaction(hb,"readwrite"),s=n.objectStore(hb).put({compositeKey:t,value:e});return new Promise((a,o)=>{s.onsuccess=c=>{a()},n.onerror=c=>{var u;o(sa.create("storage-set",{originalErrorMessage:(u=c.target.error)===null||u===void 0?void 0:u.message}))}})}async function Xue(t){const r=(await Que()).transaction(hb,"readonly"),i=r.objectStore(hb).get(t);return new Promise((s,a)=>{i.onsuccess=o=>{const c=o.target.result;s(c?c.value:void 0)},r.onerror=o=>{var c;a(sa.create("storage-get",{originalErrorMessage:(c=o.target.error)===null||c===void 0?void 0:c.message}))}})}function Jue(t){return`${t.options.appId}-${t.name}`}/**
2988 * @license
2989 * Copyright 2020 Google LLC
2990 *
2991 * Licensed under the Apache License, Version 2.0 (the "License");
2992 * you may not use this file except in compliance with the License.
2993 * You may obtain a copy of the License at
2994 *
2995 *   http://www.apache.org/licenses/LICENSE-2.0
2996 *
2997 * Unless required by applicable law or agreed to in writing, software
2998 * distributed under the License is distributed on an "AS IS" BASIS,
2999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3000 * See the License for the specific language governing permissions and
3001 * limitations under the License.
3002 */const Gd=new GE("@firebase/app-check");/**
3003 * @license
3004 * Copyright 2020 Google LLC
3005 *
3006 * Licensed under the Apache License, Version 2.0 (the "License");
3007 * you may not use this file except in compliance with the License.
3008 * You may obtain a copy of the License at
3009 *
3010 *   http://www.apache.org/licenses/LICENSE-2.0
3011 *
3012 * Unless required by applicable law or agreed to in writing, software
3013 * distributed under the License is distributed on an "AS IS" BASIS,
3014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3015 * See the License for the specific language governing permissions and
3016 * limitations under the License.
3017 */async function T3e(t){if(UE()){let e;try{e=await w3e(t)}catch(r){Gd.warn(`Failed to read token from IndexedDB. Error: ${r}`)}return e}}function oA(t,e){return UE()?_3e(t,e).catch(r=>{Gd.warn(`Failed to write token to IndexedDB. Error: ${r}`)}):Promise.resolve()}async function C3e(){let t;try{t=await k3e()}catch{}if(t)return t;{const e=crypto.randomUUID();return S3e(e).catch(r=>Gd.warn(`Failed to persist debug token to IndexedDB. Error: ${r}`)),e}}/**
3018 * @license
3019 * Copyright 2020 Google LLC
3020 *
3021 * Licensed under the Apache License, Version 2.0 (the "License");
3022 * you may not use this file except in compliance with the License.
3023 * You may obtain a copy of the License at
3024 *
3025 *   http://www.apache.org/licenses/LICENSE-2.0
3026 *
3027 * Unless required by applicable law or agreed to in writing, softw
3027are
3028 * distributed under the License is distributed on an "AS IS" BASIS,
3029 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3030 * See the License for the specific language governing permissions and
3031 * limitations under the License.
3032 */function dB(){return ij().enabled}async function fB(){const t=ij();if(t.enabled&&t.token)return t.token.promise;throw Error(`
3033            Can't get debug token in production mode.
3034        `)}function E3e(){const t=woe(),e=ij();if(e.initialized=!0,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&t.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;e.enabled=!0;const r=new rb;e.token=r,typeof t.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?r.resolve(t.FIREBASE_APPCHECK_DEBUG_TOKEN):r.resolve(C3e())}/**
3035 * @license
3036 * Copyright 2020 Google LLC
3037 *
3038 * Licensed under the Apache License, Version 2.0 (the "License");
3039 * you may not use this file except in compliance with the License.
3040 * You may obtain a copy of the License at
3041 *
3042 *   http://www.apache.org/licenses/LICENSE-2.0
3043 *
3044 * Unless required by applicable law or agreed to in writing, software
3045 * distributed under the License is distributed on an "AS IS" BASIS,
3046 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3047 * See the License for the specific language governing permissions and
3048 * limitations under the License.
3049 */const j3e={error:"UNKNOWN_ERROR"};function N3e(t){return o3.encodeString(JSON.stringify(t),!1)}async function yT(t,e=!1,r=!1){const n=t.app;cB(n);const i=Ci(n);let s=i.token,a;if(s&&!lg(s)&&(i.token=void 0,s=void 0),!s){const u=await i.cachedTokenPromise;u&&(lg(u)?s=u:await oA(n,void 0))}if(!e&&s&&lg(s))return{token:s.token};let o=!1;if(dB())try{i.exchangeTokenPromise||(i.exchangeTokenPromise=uB(Yue(n,await fB()),t.heartbeatServiceProvider).finally(()=>{i.exchangeTokenPromise=void 0}),o=!0);const u=await i.exchangeTokenPromise;return await oA(n,u),i.token=u,{token:u.token}}catch(u){return u.code==="appCheck/throttled"||u.code==="appCheck/initial-throttle"?Gd.warn(u.message):r&&Gd.error(u),lA(u)}try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),o=!0),s=await Ci(n).exchangeTokenPromise}catch(u){u.code==="appCheck/throttled"||u.code==="appCheck/initial-throttle"?Gd.warn(u.message):r&&Gd.error(u),a=u}let c;return s?a?lg(s)?c={token:s.token,internalError:a}:c=lA(a):(c={token:s.token},i.token=s,await oA(n,s)):c=lA(a),o&&rde(n,c),c}async function P3e(t){const e=t.app;cB(e);const{provider:r}=Ci(e);if(dB()){const n=await fB(),{token:i}=await uB(Yue(e,n),t.heartbeatServiceProvider);return{token:i}}else{const{token:n}=await r.getToken();return{token:n}}}function ede(t,e,r,n){const{app:i}=t,s=Ci(i),a={next:r,error:n,type:e};if(s.tokenObservers=[...s.tokenObservers,a],s.token&&lg(s.token)){const o=s.token;Promise.resolve().then(()=>{r({token:o.token}),T9(t)}).catch(()=>{})}s.cachedTokenPromise.then(()=>T9(t))}function tde(t,e){const r=Ci(t),n=r.tokenObservers.filter(i=>i.next!==e);n.length===0&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),r.tokenObservers=n}function T9(t){const{app:e}=t,r=Ci(e);let n=r.tokenRefresher;n||(n=M3e(t),r.tokenRefresher=n),!n.isRunning()&&r.isTokenAutoRefreshEnabled&&n.start()}function M3e(t){const{app:e}=t;return new m3e(async()=>{const r=Ci(e);let n;if(r.token?n=await yT(t,!0):n=await yT(t),n.error)throw n.error;if(n.internalError)throw n.internalError},()=>!0,()=>{const r=Ci(e);if(r.token){let n=r.token.issuedAtTimeMillis+(r.token.expireTimeMillis-r.token.issuedAtTimeMillis)*.5+3e5;const i=r.token.expireTimeMillis-300*1e3;return n=Math.min(n,i),Math.max(0,n-Date.now())}else return 0},S9.RETRIAL_MIN_WAIT,S9.RETRIAL_MAX_WAIT)}function rde(t,e){const r=Ci(t).tokenObservers;for(const n of r)try{n.type==="EXTERNAL"&&e.error!=null?n.error(e.error):n.next(e)}catch{}}function lg(t){return t.expireTimeMillis-Date.now()>0}function lA(t){return{token:N3e(j3e),error:t}}/**
3050 * @license
3051 * Copyright 2020 Google LLC
3052 *
3053 * Licensed under the Apache License, Version 2.0 (the "License");
3054 * you may not use this file except in compliance with the License.
3055 * You may obtain a copy of the License at
3056 *
3057 *   http://www.apache.org/licenses/LICENSE-2.0
3058 *
3059 * Unless required by applicable law or agreed to in writing, softw
3059are
3060 * distributed under the License is distributed on an "AS IS" BASIS,
3061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3062 * See the License for the specific language governing permissions and
3063 * limitations under the License.
3064 */class A3e{constructor(e,r){this.app=e,this.heartbeatServiceProvider=r}_delete(){const{tokenObservers:e}=Ci(this.app);for(const r of e)tde(this.app,r.next);return Promise.resolve()}}function D3e(t,e){return new A3e(t,e)}function O3e(t){return{getToken:e=>yT(t,e),getLimitedUseToken:()=>P3e(t),addTokenListener:e=>ede(t,"INTERNAL",e),removeTokenListener:e=>tde(t.app,e)}}const R3e="@firebase/app-check",I3e="0.10.1";/**
3065 * @license
3066 * Copyright 2020 Google LLC
3067 *
3068 * Licensed under the Apache License, Version 2.0 (the "License");
3069 * you may not use this file except in compliance with the License.
3070 * You may obtain a copy of the License at
3071 *
3072 *   http://www.apache.org/licenses/LICENSE-2.0
3073 *
3074 * Unless required by applicable law or agreed to in writing, software
3075 * distributed under the License is distributed on an "AS IS" BASIS,
3076 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3077 * See the License for the specific language governing permissions and
3078 * limitations under the License.
3079 */const L3e="https://www.google.com/recaptcha/api.js";function $3e(t,e){const r=new rb,n=Ci(t);n.reCAPTCHAState={initialized:r};const i=F3e(t),s=k9(!1);return s?C9(t,e,s,i,r):V3e(()=>{const a=k9(!1);if(!a)throw new Error("no recaptcha");C9(t,e,a,i,r)}),r.promise}function C9(t,e,r,n,i){r.ready(()=>{B3e(t,e,r,n),i.resolve(r)})}function F3e(t){const e=`fire_app_check_${t.name}`,r=document.createElement("div");return r.id=e,r.style.display="none",document.body.appendChild(r),e}async function z3e(t){cB(t);const r=await Ci(t).reCAPTCHAState.initialized.promise;return new Promise((n,i)=>{const s=Ci(t).reCAPTCHAState;r.ready(()=>{n(r.execute(s.widgetId,{action:"fire_app_check"}))})})}function B3e(t,e,r,n){const i=r.render(n,{sitekey:e,size:"invisible",callback:()=>{Ci(t).reCAPTCHAState.succeeded=!0},"error-callback":()=>{Ci(t).reCAPTCHAState.succeeded=!1}}),s=Ci(t);s.reCAPTCHAState=Object.assign(Object.assign({},s.reCAPTCHAState),{widgetId:i})}function V3e(t){const e=document.createElement("script");e.src=L3e,e.onload=t,document.head.appendChild(e)}/**
3080 * @license
3081 * Copyright 2021 Google LLC
3082 *
3083 * Licensed under the Apache License, Version 2.0 (the "License");
3084 * you may not use this file except in compliance with the License.
3085 * You may obtain a copy of the License at
3086 *
3087 *   http://www.apache.org/licenses/LICENSE-2.0
3088 *
3089 * Unless required by applicable law or agreed to in writing, software
3090 * distributed under the License is distributed on an "AS IS" BASIS,
3091 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3092 * See the License for the specific language governing permissions and
3093 * limitations under the License.
3094 */class hB{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e,r,n;G3e(this._throttleData);const i=await z3e(this._app).catch(a=>{throw sa.create("recaptcha-error")});if(!(!((e=Ci(this._app).reCAPTCHAState)===null||e===void 0)&&e.succeeded))throw sa.create("recaptcha-error");let s;try{s=await uB(v3e(this._app,i),this._heartbeatServiceProvider)}catch(a){throw!((r=a.code)===null||r===void 0)&&r.includes("fetch-status-error")?(this._throttleData=U3e(Number((n=a.customData)===null||n===void 0?void 0:n.httpStatus),this._throttleData),sa.create("initial-throttle",{time:que(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):a}return this._throttleData=null,s}initialize(e){this._app=e,this._heartbeatServiceProvider=Gp(e,"heartbeat"),$3e(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof hB?this._siteKey===e._siteKey:!1}}function U3e(t,e){if(t===404||t===403)return{backoffCount:1,allowRequestsAfter:Date.now()+p3e,httpStatus:t};{const r=e?e.backoffCount:0,n=M$(r,1e3,2);return{backoffCount:r+1,allowRequestsAfter:Date.now()+n,httpStatus:t}}}function G3e(t){if(t&&Date.now()-t.allowRequestsAfter<=0)throw sa.create("throttled",{time:que(t.allowRequestsAfter-Date.now()),httpStatus:t.httpStatus})}/**
3095 * @license
3096 * Copyright 2020 Google LLC
3097 *
3098 * Licensed under the Apache License, Version 2.0 (the "License");
3099 * you may not use this file except in compliance with the License.
3100 * You may obtain a copy of the License at
3101 *
3102 *   http://www.apache.org/licenses/LICENSE-2.0
3103 *
3104 * Unless required by applicable law or agreed to in writing, software
3105 * distributed under the License is distributed on an "AS IS" BASIS,
3106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3107 * See the License for the specific language governing permissions and
3108 * limitations under the License.
3109 */function W3e(t=WE(),e){t=zn(t);const r=Gp(t,"app-check");if(ij().initialized||E3e(),dB()&&fB().then(i=>console.log(`App Check debug token: ${i}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),r.isInitialized()){const i=r.getImmediate(),s=r.getOptions();if(s.isTokenAutoRefreshEnabled===e.isTokenAutoRefreshEnabled&&s.provider.isEqual(e.provider))return i;throw sa.create("already-initialized",{appName:t.name})}const n=r.initialize({options:e});return H3e(t,e.provider,e.isTokenAutoRefreshEnabled),Ci(t).isTokenAutoRefreshEnabled&&ede(n,"INTERNAL",()=>{}),n}function H3e(t,e,r=!1){const n=d3e(t,Object.assign({},Wue));n.activated=!0,n.provider=e,n.cachedTokenPromise=T3e(t).then(i=>(i&&lg(i)&&(n.token=i,rde(t,{token:i.token})),i)),n.isTokenAutoRefreshEnabled=r&&t.automaticDataCollectionEnabled,!t.automaticDataCollectionEnabled&&r&&Gd.warn("`isTokenAutoRefreshEnabled` is true but `automaticDataCollectionEnabled` was set to false during `initializeApp()`. This blocks automatic token refresh."),n.provider.initialize(t)}async function q3e(t,e){const r=await yT(t,e);if(r.error)throw r.error;if(r.internalError)throw r.internalError;return{token:r.token}}const Y3e="app-check",E9="app-check-internal";function K3e(){Po(new Ba(Y3e,t=>{const e=t.getProvider("app").getImmediate(),r=t.getProvider("heartbeat");return D3e(e,r)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,r)=>{t.getProvider(E9).initialize()})),Po(new Ba(E9,t=>{const e=t.getProvider("app-check").getImmediate();return O3e(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),Ia(R3e,I3e)}K3e();/**
3110 * @license
3111 * Copyright 2017 Google LLC
3112 *
3113 * Licensed under the Apache License, Version 2.0 (the "License");
3114 * you may not use this file except in compliance with the License.
3115 * You may obtain a copy of the License at
3116 *
3117 *   http://www.apache.org/licenses/LICENSE-2.0
3118 *
3119 * Unless required by applicable law or agreed to in writing, software
3120 * distributed under the License is distributed on an "AS IS" BASIS,
3121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3122 * See the License for the specific language governing permissions and
3123 * limitations under the License.
3124 */const nde="firebasestorage.googleapis.com",ide="storageBucket",Q3e=120*1e3,Z3e=600*1e3;/**
3125 * @license
3126 * Copyright 2017 Google LLC
3127 *
3128 * Licensed under the Apache License, Version 2.0 (the "License");
3129 * you may not use this file except in compliance with the License.
3130 * You may obtain a copy of the License at
3131 *
3132 *   http://www.apache.org/licenses/LICENSE-2.0
3133 *
3134 * Unless required by applicable law or agreed to in writing, software
3135 * distributed under the License is distributed on an "AS IS" BASIS,
3136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3137 * See the License for the specific language governing permissions and
3138 * limitations under the License.
3139 */class Bn extends Ha{constructor(e,r,n=0){super(cA(e),`Firebase Storage: ${r} (${cA(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Bn.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return cA(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
3140${this.customData.serverResponse}`:this.message=this._baseMessage}}var $n;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVA
3140LID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})($n||($n={}));function cA(t){return"storage/"+t}function pB(){const t="An unknown error occurred, please check the error payload for server response.";return new Bn($n.UNKNOWN,t)}function X3e(t){return new Bn($n.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function J3e(t){return new Bn($n.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function eBe(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Bn($n.UNAUTHENTICATED,t)}function tBe(){return new Bn($n.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function rBe(t){return new Bn($n.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function nBe(){return new Bn($n.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function iBe(){return new Bn($n.CANCELED,"User canceled the upload/download.")}function sBe(t){return new Bn($n.INVALID_URL,"Invalid URL '"+t+"'.")}function aBe(t){return new Bn($n.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function oBe(){return new Bn($n.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+ide+"' property when initializing the app?")}function lBe(){return new Bn($n.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function cBe(){return new Bn($n.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function uBe(t){return new Bn($n.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function mF(t){return new Bn($n.INVALID_ARGUMENT,t)}function sde(){return new Bn($n.APP_DELETED,"The Firebase app was deleted.")}function dBe(t){return new Bn($n.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function Sx(t,e){return new Bn($n.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function hv(t){throw new Bn($n.INTERNAL_ERROR,"Internal error: "+t)}/**
3141 * @license
3142 * Copyright 2017 Google LLC
3143 *
3144 * Licensed under the Apache License, Version 2.0 (the "License");
3145 * you may not use this file except in compliance with the License.
3146 * You may obtain a copy of the License at
3147 *
3148 *   http://www.apache.org/licenses/LICENSE-2.0
3149 *
3150 * Unless required by applicable law or agreed to in writing, software
3151 * distributed under the License is distributed on an "AS IS" BASIS,
3152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3153 * See the License for the specific language governing permissions and
3154 * limitations under the License.
3155 */class Oa{constructor(e,r){this.bucket=e,this.path_=r}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,r){let n;try{n=Oa.makeFromUrl(e,r)}catch{return new Oa(e,"")}if(n.path==="")return n;throw aBe(e)}static makeFromUrl(e,r){let n=null;const i="([A-Za-z0-9.\\-_]+)";function s(E){E.path.charAt(E.path.length-1)==="/"&&(E.path_=E.path_.slice(0,-1))}const a="(/(.*))?$",o=new RegExp("^gs://"+i+a,"i"),c={bucket:1,path:3};function u(E){E.path_=decodeURIComponent(E.path)}const d="v[A-Za-z0-9_]+",f=r.replace(/[.]/g,"\\."),h="(/([^?#]*).*)?$",m=new RegExp(`^https?://${f}/${d}/b/${i}/o${h}`,"i"),y={bucket:1,path:3},x=r===nde?"(?:storage.googleapis.com|storage.cloud.google.com)":r,v="([^?#]*)",_=ne
vendor: 4,409 bytes, lines 3155-3219
3155w RegExp(`^https?://${x}/${i}/${v}`,"i"),k=[{regex:o,indices:c,postModify:s},{regex:m,indices:y,postModify:u},{regex:_,indices:{bucket:1,path:2},postModify:u}];for(let E=0;E<k.length;E++){const T=k[E],N=T.regex.exec(e);if(N){const j=N[T.indices.bucket];let M=N[T.indices.path];M||(M=""),n=new Oa(j,M),T.postModify(n);break}}if(n==null)throw sBe(e);return n}}class fBe{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
3156 * @license
3157 * Copyright 2017 Google LLC
3158 *
3159 * Licensed under the Apache License, Version 2.0 (the "License");
3160 * you may not use this file except in compliance with the License.
3161 * You may obtain a copy of the License at
3162 *
3163 *   http://www.apache.org/licenses/LICENSE-2.0
3164 *
3165 * Unless required by applicable law or agreed to in writing, software
3166 * distributed under the License is distributed on an "AS IS" BASIS,
3167 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3168 * See the License for the specific language governing permissions and
3169 * limitations under the License.
3170 */function hBe(t,e,r){let n=1,i=null,s=null,a=!1,o=0;function c(){return o===2}let u=!1;function d(...v){u||(u=!0,e.apply(null,v))}function f(v){i=setTimeout(()=>{i=null,t(m,c())},v)}function h(){s&&clearTimeout(s)}function m(v,..._){if(u){h();return}if(v){h(),d.call(null,v,..._);return}if(c()||a){h(),d.call(null,v,..._);return}n<64&&(n*=2);let k;o===1?(o=2,k=0):k=(n+Math.random())*1e3,f(k)}let y=!1;function x(v){y||(y=!0,h(),!u&&(i!==null?(v||(o=2),clearTimeout(i),f(0)):v||(o=1)))}return f(0),s=setTimeout(()=>{a=!0,x(!0)},r),x}function pBe(t){t(!1)}/**
3171 * @license
3172 * Copyright 2017 Google LLC
3173 *
3174 * Licensed under the Apache License, Version 2.0 (the "License");
3175 * you may not use this file except in compliance with the License.
3176 * You may obtain a copy of the License at
3177 *
3178 *   http://www.apache.org/licenses/LICENSE-2.0
3179 *
3180 * Unless required by applicable law or agreed to in writing, software
3181 * distributed under the License is distributed on an "AS IS" BASIS,
3182 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3183 * See the License for the specific language governing permissions and
3184 * limitations under the License.
3185 */function mBe(t){return t!==void 0}function gBe(t){return typeof t=="object"&&!Array.isArray(t)}function mB(t){return typeof t=="string"||t instanceof String}function j9(t){return gB()&&t instanceof Blob}function gB(){return typeof Blob<"u"}function N9(t,e,r,n){if(n<e)throw mF(`Invalid value for '${t}'. Expected ${e} or greater.`);if(n>r)throw mF(`Invalid value for '${t}'. Expected ${r} or less.`)}/**
3186 * @license
3187 * Copyright 2017 Google LLC
3188 *
3189 * Licensed under the Apache License, Version 2.0 (the "License");
3190 * you may not use this file except in compliance with the License.
3191 * You may obtain a copy of the License at
3192 *
3193 *   http://www.apache.org/licenses/LICENSE-2.0
3194 *
3195 * Unless required by applicable law or agreed to in writing, software
3196 * distributed under the License is distributed on an "AS IS" BASIS,
3197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3198 * See the License for the specific language governing permissions and
3199 * limitations under the License.
3200 */function yB(t,e,r){let n=e;return r==null&&(n=`https://${e}`),`${r}://${n}/v0${t}`}function ade(t){const e=encodeURIComponent;let r="?";for(const n in t)if(t.hasOwnProperty(n)){const i=e(n)+"="+e(t[n]);r=r+i+"&"}return r=r.slice(0,-1),r}var Zh;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Zh||(Zh={}));/**
3201 * @license
3202 * Copyright 2022 Google LLC
3203 *
3204 * Licensed under the Apache License, Version 2.0 (the "License");
3205 * you may not use this file except in compliance with the License.
3206 * You may obtain a copy of the License at
3207 *
3208 *   http://www.apache.org/licenses/LICENSE-2.0
3209 *
3210 * Unless required by applicable law or agreed to in writing, software
3211 * distributed under the License is distributed on an "AS IS" BASIS,
3212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3213 * See the License for the specific language governing permissions and
3214 * limitations under the License.
3215 */function yBe(t,e){const r=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return r||i||s}/**
3216 * @license
3217 * Copyright 2017 Google LLC
3218 *
3219 * Licensed under the Apache License, Version 2.0 (the "License");
3220 * you may not use this file except in compliance with the License.
3221 * You may obtain a copy of the License at
3222 *
3223 *   http://www.apache.org/licenses/LICENSE-2.0
3224 *
3225 * Unless required by applicable law or agreed to in writing, software
3226 * distributed under the License is distributed on an "AS IS" BASIS,
3227 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3228 * See the License for the specific language governing permissions and
3229 * limitations under the License.
3230 */class vBe{constructor(e,r,n,i,s,a,o,c,u,d,f,h=!0,m=!1){this.url_=e,this.method_=r,this.headers_=n,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=a,this.callback_=o,this.errorCallback_=c,this.timeout_=u,this.progressCallback_=d,this.connectionFactory_=f,this.retry=h,this.isUsingEmulator=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((y,x)=>{this.resolve_=y,this.reject_=x,this.start_()})}start_(){const e=(n,i)=>{if(i){n(!1,new Q_(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const a=o=>{const c=o.loaded,u=o.lengthComputable?o.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,u)};this.progressCallback_!==null&&s.addUploadProgressListener(a),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(a),this.pendingConnection_=null;const o=s.getErrorCode()===Zh.NO_ERROR,c=s.getStatus();if(!o||yBe(c,this.additionalRetryCodes_)&&this.retry){const d=s.getErrorCode()===Zh.ABORT;n(!1,new Q_(!1,null,d));return}const u=this.successCodes_.indexOf(c)!==-1;n(!0,new Q_(u,s))})},r=(n,i)=>{const s=this.resolve_,a=this.reject_,o=i.connection;if(i.wasSuccessCode)try{const c=this.callback_(o,o.getResponse());mBe(c)?s(c):s()}catch(c){a(c)}else if(o!==null){const c=pB();c.serverResponse=o.getErrorText(),this.errorCallback_?a(this.errorCallback_(o,c)):a(c)}else if(i.canceled){const c=this.appDelete_?sde():iBe();a(c)}else{const c=nBe();a(c)}};this.canceled_?r(!1,new Q_(!1,null,!0)):this.backoffId_=hBe(e,r,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&pBe(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Q_{constructor(e,r,n){this.wasSuccessCode=e,this.connection=r,this.canceled=!!n}}function xBe(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function bBe(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function wBe(t,e){e&&(t["X-Firebase-GMPID"]=e)}function _Be(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function SBe(t,e,r,n,i,s,a=!0,o=!1){const c=ade(t.urlParams),u=t.url+c,d=Object.assign({},t.headers);return wBe(d,e),xBe(d,r),bBe(d,s),_Be(d,n),new vBe(u,t.method,d,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,a,o)}/**
3231 * @license
3232 * Copyright 2017 Google LLC
3233 *
3234 * Licensed under the Apache License, Version 2.0 (the "License");
3235 * you may not use this file except in compliance with the License.
3236 * You may obtain a copy of the License at
3237 *
3238 *   http://www.apache.org/licenses/LICENSE-2.0
3239 *
3240 * Unless required by applicable law or agreed to in writing, software
3241 * distributed under the License is distributed on an "AS IS" BASIS,
3242 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3243 * See the License for the specific language governing permissions and
3244 * limitations under the License.
3245 */function kBe(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function TBe(...t){const e=kBe();if(e!==void 0){const r=new e;for(let n=0;n<t.length;n++)r.append(t[n]);return r.getBlob()}else{if(gB())return new Blob(t);throw new Bn($n.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function CBe(t,e,r){return t.webkitSlice?t.webkitSlice(e,r):t.mozSlice?t.mozSlice(e,r):t.slice?t.slice(e,r):null}/**
3246 * @license
3247 * Copyright 2021 Google LLC
3248 *
3249 * Licensed under the Apache License, Version 2.0 (the "License");
3250 * you may not use this file except in compliance with the License.
3251 * You may obtain a copy of the License at
3252 *
3253 *   http://www.apache.org/licenses/LICENSE-2.0
3254 *
3255 * Unless required by applicable law or agreed to in writing, software
3256 * distributed under the License is distributed on an "AS IS" BASIS,
3257 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3258 * See the License for the specific language governing permissions and
3259 * limitations under the License.
3260 */function EBe(t){if(typeof atob>"u")throw uBe("base-64");return atob(t)}/**
3261 * @license
3262 * Copyright 2017 Google LLC
3263 *
3264 * Licensed under the Apache License, Version 2.0 (the "License");
3265 * you may not use this file except in compliance with the License.
3266 * You may obtain a copy of the License at
3267 *
3268 *   http://www.apache.org/licenses/LICENSE-2.0
3269 *
3270 * Unless required by applicable law or agreed to in writing, software
3271 * distributed under the License is distributed on an "AS IS" BASIS,
3272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3273 * See the License for the specific language governing permissions and
3274 * limitations under the License.
3275 */const Vl={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class uA{constructor(e,r){this.data=e,this.contentType=r||null}}function jBe(t,e){switch(t){case Vl.RAW:return new uA(ode(e));case Vl.BASE64:case Vl.BASE64URL:return new uA(lde(t,e));case Vl.DATA_URL:return new uA(PBe(e),MBe(e))}throw pB()}function ode(t){const e=[];for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);if(n<=127)e.push(n);else if(n<=2047)e.push(192|n>>6,128|n&63);else if((n&64512)===55296)if(!(r<t.length-1&&(t.charCodeAt(r+1)&64512)===56320))e.push(239,191,189);else{const s=n,a=t.charCodeAt(++r);n=65536|(s&1023)<<10|a&1023,e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63)}else(n&64512)===56320?e.push(239,191,189):e.push(224|n>>12,128|n>>6&63,128|n&63)}return new Uint8Array(e)}function NBe(t){let e;try{e=decodeURIComponent(t)}catch{throw Sx(Vl.DATA_URL,"Malformed data URL.")}return ode(e)}function lde(t,e){switch(t){case Vl.BASE64:{const i=e.indexOf("-")!==-1,s=e.indexOf("_")!==-1;if(i||s)throw Sx(t,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case Vl.BASE64URL:{const i=e.indexOf("+")!==-1,s=e.indexOf("/")!==-1;if(i||s)throw Sx(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let r;try{r=EBe(e)}catch(i){throw i.message.includes("polyfill")?i:Sx(t,"Invalid character found")}const n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}class cde{constructor(e){this.base64=!1,this.contentType=null;const r=e.match(/^data:([^,]+)?,/);if(r===null)throw Sx(Vl.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=r[1]||null;n!=null&&(this.base64=ABe(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}function PBe(t){const e=new cde(t);return e.base64?lde(Vl.BASE64,e.rest):NBe(e.rest)}function MBe(t){return new cde(t).contentType}function ABe(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
3276 * @license
3277 * Copyright 2017 Google LLC
3278 *
3279 * Licensed under the Apache License, Version 2.0 (the "License");
3280 * you may not use this file except in compliance with the License.
3281 * You may obtain a copy of the License at
3282 *
3283 *   http://www.apache.org/licenses/LICENSE-2.0
3284 *
3285 * Unless required by applicable law or agreed to in writing, software
3286 * distributed under the License is distributed on an "AS IS" BASIS,
3287 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3288 * See the License for the specific language governing permissions and
3289 * limitations under the License.
3290 */class zd{constructor(e,r){let n=0,i="";j9(e)?(this.data_=e,n=e.size,i=e.type):e instanceof ArrayBuffer?(r?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(r?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=i}size(){return this.size_}type(){return this.type_}slice(e,r){if(j9(this.data_)){const n=this.data_,i=CBe(n,e,r);return i===null?null:new zd(i)}else{const n=new Uint8Array(this.data_.buffer,e,r-e);return new zd(n,!0)}}static getBlob(...e){if(gB()){const r=e.map(n=>n instanceof zd?n.data_:n);return new zd(TBe.apply(null,r))}else{const r=e.map(a=>mB(a)?jBe(Vl.RAW,a).data:a.data_);let n=0;r.forEach(a=>{n+=a.byteLength});const i=new Uint8Array(n);let s=0;return r.forEach(a=>{for(let o=0;o<a.length;o++)i[s++]=a[o]}),new zd(i,!0)}}uploadData(){return this.data_}}/**
3291 * @license
3292 * Copyright 2017 Google LLC
3293 *
3294 * Licensed under the Apache License, Version 2.0 (the "License");
3295 * you may not use this file except in compliance with the License.
3296 * You may obtain a copy of the License at
3297 *
3298 *   http://www.apache.org/licenses/LICENSE-2.0
3299 *
3300 * Unless required by applicable law or agreed to in writing, software
3301 * distributed under the License is distributed on an "AS IS" BASIS,
3302 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3303 * See the License for the specific language governing permissions and
3304 * limitations under the License.
3305 */function ude(t){let e;try{e=JSON.parse(t)}catch{return null}return gBe(e)?e:null}/**
3306 * @license
3307 * Copyright 2017 Google LLC
3308 *
3309 * Licensed under the Apache License, Version 2.0 (the "License");
3310 * you may not use this file except in compliance with the License.
3311 * You may obtain a copy of the License at
3312 *
3313 *   http://www.apache.org/licenses/LICENSE-2.0
3314 *
3315 * Unless required by applicable law or agreed to in writing, software
3316 * distributed under the License is distributed on an "AS IS" BASIS,
3317 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3318 * See the License for the specific language governing permissions and
3319 * limitations under the License.
3320 */function DBe(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function OBe(t,e){const r=e.split("/").filter(n=>n.length>0).join("/");return t.length===0?r:t+"/"+r}function dde(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
3321 * @license
3322 * Copyright 2017 Google LLC
3323 *
3324 * Licensed under the Apache License, Version 2.0 (the "License");
3325 * you may not use this file except in compliance with the License.
3326 * You may obtain a copy of the License at
3327 *
3328 *   http://www.apache.org/licenses/LICENSE-2.0
3329 *
3330 * Unless required by applicable law or agreed to in writing, software
3331 * distributed under the License is distributed on an "AS IS" BASIS,
3332 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3333 * See the License for the specific language governing permissions and
3334 * limitations under the License.
3335 */function RBe(t,e){return e}class Ns{constructor(e,r,n,i){this.server=e,this.local=r||e,this.writable=!!n,this.xform=i||RBe}}let Z_=null;function IBe(t){return!mB(t)||t.length<2?t:dde(t)}function fde(){if(Z_)return Z_;const t=[];t.push(new Ns("bucket")),t.push(new Ns("generation")),t.push(new Ns("metageneration")),t.push(new Ns("name","fullPath",!0));function e(s,a){return IBe(a)}const r=new Ns("name");r.xform=e,t.push(r);function n(s,a){return a!==void 0?Number(a):a}const i=new Ns("size");return i.xform=n,t.push(i),t.push(new Ns("timeCreated")),t.push(new Ns("updated")),t.push(new Ns("md5Hash",null,!0)),t.push(new Ns("cacheControl",null,!0)),t.push(new Ns("contentDisposition",null,!0)),t.push(new Ns("contentEncoding",null,!0)),t.push(new Ns("contentLanguage",null,!0)),t.push(new Ns("contentType",null,!0)),t.push(new Ns("metadata","customMetadata",!0)),Z_=t,Z_}function LBe(t,e){function r(){const n=t.bucket,i=t.fullPath,s=new Oa(n,i);return e._makeStorageReference(s)}Object.defineProperty(t,"ref",{get:r})}function $Be(t,e,r){const n={};n.type="file";const i=r.length;for(let s=0;s<i;s++){const a=r[s];n[a.local]=a.xform(n,e[a.server])}return LBe(n,t),n}function hde(t,e,r){const n=ude(e);return n===null?null:$Be(t,n,r)}function FBe(t,e,r,n){const i=ude(e);if(i===null||!mB(i.downloadTokens))return null;const s=i.downloadTokens;if(s.length===0)return null;const a=encodeURIComponent;return s.split(",").map(u=>{const d=t.bucket,f=t.fullPath,h="/b/"+a(d)+"/o/"+a(f),m=yB(h,r,n),y=ade({alt:"media",token:u});return m+y})[0]}function zBe(t,e){const r={},n=e.length;for(let i=0;i<n;i++){const s=e[i];s.writable&&(r[s.server]=t[s.local])}return JSON.stringify(r)}class pde{constructor(e,r,n,i){this.url=e,this.method=r,this.handler=n,this.timeout=i,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
3336 * @license
3337 * Copyright 2017 Google LLC
3338 *
3339 * Licensed under the Apache License, Version 2.0 (the "License");
3340 * you may not use this file except in compliance with the License.
3341 * You may obtain a copy of the License at
3342 *
3343 *   http://www.apache.org/licenses/LICENSE-2.0
3344 *
3345 * Unless required by applicable law or agreed to in writing, software
3346 * distributed under the License is distributed on an "AS IS" BASIS,
3347 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3348 * See the License for the specific language governing permissions and
3349 * limitations under the License.
3350 */function mde(t){if(!t)throw pB()}function BBe(t,e){function r(n,i){const s=hde(t,i,e);return mde(s!==null),s}return r}function VBe(t,e){function r(n,i){const s=hde(t,i,e);return mde(s!==null),FBe(s,i,t.host,t._protocol)}return r}function gde(t){function e(r,n){let i;return r.getStatus()===401?r.getErrorText().includes("Firebase App Check token is invalid")?i=tBe():i=eBe():r.getStatus()===402?i=J3e(t.bucket):r.getStatus()===403?i=rBe(t.path):i=n,i.status=r.getStatus(),i.serverResponse=n.serverResponse,i}return e}function UBe(t){const e=gde(t);function r(n,i){let s=e(n,i);return n.getStatus()===404&&(s=X3e(t.path)),s.serverResponse=i.serverResponse,s}return r}function GBe(t,e,r){const n=e.fullServerUrl(),i=yB(n,t.host,t._protocol),s="GET",a=t.maxOperationRetryTime,o=new pde(i,s,VBe(t,r),a);return o.errorHandler=UBe(e),o}function WBe(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function HBe(t,e,r){const n=Object.assign({},r);return n.fullPath=t.path,n.size=e.size(),n.contentType||(n.contentType=WBe(null,e)),n}function qBe(t,e,r,n,i){const s=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"};function o(){let k="";for(let E=0;E<2;E++)k=k+Math.random().toString().slice(2);return k}const c=o();a["Content-Type"]="multipart/related; boundary="+c;const u=HBe(e,n,i),d=zBe(u,r),f="--"+c+`\r
3351Content-Type: application/json; charset=utf-8\r
3352\r
3353`+d+`\r
3354--`+c+`\r
3355Content-Type: `+u.contentType+`\r
3356\r
3357`,h=`\r
3358--`+c+"--",m=zd.getBlob(f,n,h);if(m===null)throw lBe();const y={name:u.fullPath},x=yB(s,t.host,t._protocol),v="POST",_=t.maxUploadRetryTime,S=new pde(x,v,BBe(t,r),_);return S.urlParams=y,S.headers=a,S.body=m.uploadData(),S.errorHandler=gde(e),S}class YBe{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Zh.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Zh.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Zh.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,r,n,i,s){if(this.sent_)throw hv("cannot .send() more than once");if(Uy(e)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(r,e,!0),s!==void 0)for(const a in s)s.hasOwnProperty(a)&&this.xhr_.setRequestHeader(a,s[a].toString());return i!==void 0?this.xhr_.send(i):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw hv("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw hv("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw hv("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw hv("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class KBe extends YBe{initXhr(){this.xhr_.responseType="text"}}function yde(){return new KBe}/**
3359 * @license
3360 * Copyright 2019 Google LLC
3361 *
3362 * Licensed under the Apache License, Version 2.0 (the "License");
3363 * you may not use this file except in compliance with the License.
3364 * You may obtain a copy of the License at
3365 *
3366 *   http://www.apache.org/licenses/LICENSE-2.0
3367 *
3368 * Unless required by applicable law or agreed to in writing, software
3369 * distributed under the License is distributed on an "AS IS" BASIS,
3370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3371 * See the License for the specific language governing permissions and
3372 * limitations under the License.
3373 */class vp{constructor(e,r){this._service=e,r instanceof Oa?this._location=r:this._location=Oa.makeFromUrl(r,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,r){return new vp(e,r)}get root(){const e=new Oa(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return dde(this._location.path)}get storage(){return this._service}get parent(){const e=DBe(this._location.path);if(e===null)return null;const r=new Oa(this._location.bucket,e);return new vp(this._service,r)}_throwIfRoot(e){if(this._location.path==="")throw dBe(e)}}function QBe(t,e,r){t._throwIfRoot("uploadBytes");const n=qBe(t.storage,t._location,fde(),new zd(e,!0),r);return t.storage.makeRequestWithTokens(n,yde).then(i=>({metadata:i,ref:t}))}function ZBe(t){t._throwIfRoot("getDownloadURL");const e=GBe(t.storage,t._location,fde());return t.storage.makeRequestWithTokens(e,yde).then(r=>{if(r===null)throw cBe();return r})}function XBe(t,e){const r=OBe(t._location.path,e),n=new Oa(t._location.bucket,r);return new vp(t.storage,n)}/**
3374 * @license
3375 * Copyright 2017 Google LLC
3376 *
3377 * Licensed under the Apache License, Version 2.0 (the "License");
3378 * you may not use this file except in compliance with the License.
3379 * You may obtain a copy of the License at
3380 *
3381 *   http://www.apache.org/licenses/LICENSE-2.0
3382 *
3383 * Unless required by applicable law or agreed to in writing, software
3384 * distributed under the License is distributed on an "AS IS" BASIS,
3385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3386 * See the License for the specific language governing permissions and
3387 * limitations under the License.
3388 */function JBe(t){return/^[A-Za-z]+:\/\//.test(t)}function eVe(t,e){return new vp(t,e)}function vde(t,e){if(t instanceof vB){const r=t;if(r._bucket==null)throw oBe();const n=new vp(r,r._bucket);return e!=null?vde(n,e):n}else return e!==void 0?XBe(t,e):t}function tVe(t,e){if(e&&JBe(e)){if(t instanceof vB)return eVe(t,e);throw mF("To use ref(service, url), the first argument must be a Storage instance.")}else return vde(t,e)}function P9(t,e){const r=e?.[ide];return r==null?null:Oa.makeFromBucketSpec(r,t)}function rVe(t,e,r,n={}){t.host=`${e}:${r}`;const i=Uy(e);i&&(Toe(`https://${t.host}/b`),Coe("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=n;s&&(t._overrideAuthToken=typeof s=="string"?s:r2e(s,t.app.options.projectId))}class vB{constructor(e,r,n,i,s,a=!1){this.app=e,this._authProvider=r,this._appCheckProvider=n,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=a,this._bucket=null,this._host=nde,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=Q3e,this._maxUploadRetryTime=Z3e,this._requests=new Set,i!=null?this._bucket=Oa.makeFromBucketSpec(i,this._host):this._bucket=P9(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Oa.makeFromBucketSpec(this._url,e):this._bucket=P9(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){N9("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){N9("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const r=await e.getToken();if(r!==null)return r.accessToken}return null}async _getAppCheckToken(){if(Ma(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new vp(this,e)}_makeRequest(e,r,n,i,s=!0){if(this._deleted)return new fBe(sde());{const a=SBe(e,this._appId,n,i,r,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(a),a.getPromise().then(()=>this._requests.delete(a),()=>this._requests.delete(a)),a}}async makeRequestWithTokens(e,r){const[n,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,r,n,i).getPromise()}}const M9="@firebase/storage",A9="0.13.14";/**
3389 * @license
3390 * Copyright 2020 Google LLC
3391 *
3392 * Licensed under the Apache License, Version 2.0 (the "License");
3393 * you may not use this file except in compliance with the License.
3394 * You may obtain a copy of the License at
3395 *
3396 *   http://www.apache.org/licenses/LICENSE-2.0
3397 *
3398 * Unless required by applicable law or agreed to in writing, software
3399 * distributed under the License is distributed on an "AS IS" BASIS,
3400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3401 * See the License for the specific language governing permissions and
3402 * limitations under the License.
3403 */const xde="storage";function nVe(t,e,r){return t=zn(t),QBe(t,e,r)}function iVe(t){return t=zn(t),ZBe(t)}function sVe(t,e){return t=zn(t),tVe(t,e)}function aVe(t=WE(),e){t=zn(t);const n=Gp(t,xde).getImmediate({identifier:e}),i=t2e("storage");return i&&oVe(n,...i),n}function oVe(t,e,r,n={}){rVe(t,e,r,n)}function lVe(t,{instanceIdentifier:e}){const r=t.getProvider("app").getImmediate(),n=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new vB(r,n,i,e,Gy)}function cVe(){Po(new Ba(xde,lVe,"PUBLIC").setMultipleInstances(!0)),Ia(M9,A9,""),Ia(M9,A9,"esm2017")}cVe();const uVe={apiKey:"AIzaSyAk2pTEhWrDhYt96b6EF5eYt_Jae6i3WSI",authDomain:"mercilesstracker.firebaseapp.com",projectId:"mercilesstracker",storageBucket:"mercilesstracker.firebasestorage.app",messagingSenderId:"1021532931227",appId:"1:1021532931227:web:aa2c5a0d7354f865bf723e",measurementId:"G-5G4J5CKNKH"},sj=vAe().length===0?Aoe(uVe):WE(),ar=ej(sj),bde=aVe(sj),wde=()=>{if(typeof window>"u")return;if(window.__appCheck)return window.__appCheck;const t="6LdVXIUrAAAAAKI5dWv1k_dAAM6w9-7Wr3r4H-p0",e=W3e(sj,{provider:new hB(t),isTokenAutoRefreshEnabled:!0});return window.__appCheck=e,window.__appCheckInitialized=!0,e},dVe=Object.freeze(Object.defineProperty({__proto__:null,app:sj,auth:ar,getAppCheckInstance:wde,storage:bde},Symbol.toStringTag,{value:"Module"})),fVe=tt`
3404  query GetAllPlans {
3405    plan(where: { is_active: { _eq: true } }) {
3406      id
3407      name
3408      is_active
3409      benefits
3410      created_at
3411      description
3412      updated_at
3413      plan_prices(where: { active: { _eq: true } }) {
3414        id
3415        stripe_price_id
3416        amount
3417        interval
3418      }
3419    }
3420  }
3421`,hVe=tt`
3422  query GetAllPlansLanding {
3423    plan(where: { is_active: { _eq: true } }) {
3424      id
3425      name
3426      is_active
3427      benefits
3428      description
3429      plan_prices(where: { active: { _eq: true } }) {
3430        id
3431        amount
3432        interval
3433      }
3434    }
3435  }
3436`,_de=t=>{const e=t;return{id:e.id,name:e.name,isActive:e.is_active,benefits:e.benefits,description:e.description,createdAt:e.created_at,updatedAt:e.updated_at,planPrices:(e.plan_prices||[]).map(r=>{const n=r;return{id:n.id,stripePriceId:n.stripe_price_id,amount:n.amount,interval:n.interval}})}},D9={id:"ultimate",name:"Ultimate",stripePriceId:"",description:"The ultimate plan",features:[],locked:!0},pVe=t=>typeof t=="object"&&t?Object.values(t):[],Sde=t=>{const e=t.map((i,s)=>{const a=i.planPrices.find(c=>c.interval==="month"),o=i.planPrices.find(c=>c.interval==="year");return{id:i.id,name:i.name,prices:{month:{price:a?a.amount:null,stripePriceId:a?a.stripePriceId:""},year:{price:o?o.amount:null,stripePriceId:o?o.stripePriceId:""}},features:pVe(i.benefits),isPopular:i.name.toLowerCase().includes("pro"),locked:!1,isActive:i.isActive,description:i.description,index:s}}),r=e.find(i=>i.name.toLowerCase()==="free"),n=e.filter(i=>i.name.toLowerCase()!=="free");return r?[r,...n]:e},mVe=()=>({...D9,prices:{month:{price:0,stripePriceId:""},year:{price:0,stripePriceId:""}},features:[...D9.features]}),gVe=t=>{const e=Sde(t),r=mVe();return[...e,r]},yVe=(t,e)=>{if(!t||!e||t<=0||e<=0)return null;const r=t*12,i=(r-e)/r*100;return Math.max(0,Math.round(i))},vVe=(t,e)=>{const r=yVe(t.prices.month.price,t.prices.year.price);return!r||r===0?null:{label:`Save ${r}% when you pay yearly`,percentage:r}},Hs=Wp((t,e)=>({plans:[],proPlan:null,userCurrentPlan:null,userSubscription:null,isLoading:!1,error:null,isInitialized:!1,loadPlans:async()=>{const{userHasura:r,isLoading:n,isInitialized:i}=Gt.getState();if(e().isLoading||n||!i)return;t({isLoading:!0,error:null});const s=await Ug(xo.query({query:fVe,fetchPolicy:"cache-first"}));if(!s.ok){t({error:s.error instanceof Error?s.error.message:"Failed to load plans",isLoading:!1,isInitialized:!0});return}const a=s.data.data?.plan?Sde(s.data.data.plan.map(_de)):[],o=a.find(d=>d.name.toLowerCase().includes("pro"))||null,u=a.find(d=>d.name.toLowerCase().includes("free"))||null||a[0]||null;if(t({plans:a,proPlan:o,userCurrentPlan:u,isLoading:!1,isInitialized:!0}),r?.current_subscription_id){const d=await Ug(xo.query({query:Tze,variables:{subscriptionId:r.current_subscription_id}}));if(d.ok&&d.data.data?.user_subscription_by_pk){const f=d.data.data.user_subscription_by_pk,h=a.find(m=>m.id===f.planId);t({userSubscription:f,userCurrentPlan:h||u})}}},refetchPlans:async()=>{await e().loadPlans()},shouldShowProBanner:()=>{const{userCurrentPlan:r,proPlan:n}=e();return!r||!n?!1:r.name.toLowerCase()==="free"},hasActiveSubscription:()=>{const{userSubscription:r}=e();return r?.status==="active"},isSubscriptionCanceling:()=>{const{userSubscription:r}=e();return r?.cancelAtPeriodEnd===!0},clearPlans:()=>{t({plans:[],proPlan:null,userCurrentPlan:null,userSubscription:null,isLoading:!1,error:null,isInitialized:!1})},clearError:()=>{t({error:null})}})),Gt=Wp(t=>({user:null,userHasura:null,isLoading:!0,isInitialized:!1,initialProvider:null,setUser:e=>t(r=>!r.initialProvider&&e?.providerData?.[0]?.providerId?{user:e,initialProvider:e.providerData[0].providerId}:{user:e}),setUserHasura:e=>t({userHasura:e}),setLoading:e=>t({isLoading:e}),setInitialized:e=>t({isInitialized:e}),signOut:async()=>{t({user:null,userHasura:null,isLoading:!0,isInitialized:!1,initialProvider:null}),Hs.getState().clearPlans(),Fw.getState().clearPermissions(),await xo.clearStore(),await ar.signOut()},setInitialProvider:e=>t({initialProvider:e})}));function kde(){const{user:t,setUserHasura:e}=Gt(),r=t?.email,{data:n}=da($w,{variables:{email:r},skip:!r});b.useEffect(()=>{n&&Array.isArray(n.user)&&n.user.length>0&&e(n.user[0])},[n,e])}const xVe=()=>{const{user:t,userHasura:e}=Gt(yl(s=>({user:s.user,userHasura:s.userHasura}))),{isLoading:r,isInitialized:n}=Gt(yl(s=>({isLoading:s.isLoading,isInitialized:s.isInitialized}))),i=ns();return kde(),b.useEffect(()=>{Gt.setState({isLoading:!0});const s=lue(ar,a=>{Gt.setState({user:a,isLoading:!1,isInitialized:!0})});return()=>s()},[]),r||!n?l.jsx("div",{className:"min-h-screen bg-app-primary text-app-text-primary flex items-center justify-center",children:l.jsx("div",{className:"text-center",children:l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-app-border-color-accent mx-auto mb-4"})})}):t&&e&&!i.pathname.startsWith("/docs")?l.jsx(IE,{to:"/app/dashboard",replace:!0}):l.jsxs("main",{children:[l.jsx(kze,{user:t}),l.jsx(Y4,{}),l.jsx(pze,{})]})};var zw=t=>t.type==="checkbox",$h=t=>t instanceof Date,As=t=>t==null;const Tde=t=>typeof t=="object";var ci=t=>!As(t)&&!Array.isArray(t)&&Tde(t)&&!$h(t),Cde=t=>ci(t)&&t.target?zw(t.target)?t.target.checked:t.target.value:t,bVe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Ede=(t,e)=>t.has(bVe(e)),wVe=t=>{const e=t.constructor&&t.constructor.prototype;return ci(e)&&e.hasOwnProperty("isPrototypeOf")},xB=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wi(t){let e;const r=Array.isArray(t),n=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!(xB&&(t instanceof Blob||n))&&(r||ci(t)))if(e=r?[]:Object.create(Object.getPrototypeOf(t)),!r&&!wVe(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=wi(t[i]));else return t;return e}var aj=t=>/^\w*$/.test(t),Hn=t=>t===void 0,bB=t=>Array.isArray(t)?t.filter(Boolean):[],wB=t=>bB(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Ye=(t,e,r)=>{if(!e||!ci(t))return r;const n=(aj(e)?[e]:wB(e)).reduce((i,s)=>As(i)?i:i[s],t);return Hn(n)||n===t?Hn(t[e])?r:t[e]:n},Na=t=>typeof t=="boolean",Rr=(t,e,r)=>{let n=-1;const i=aj(e)?[e]:wB(e),s=i.length,a=s-1;for(;++n<s;){const o=i[n];let c=r;if(n!==a){const u=t[o];
3436c=ci(u)||Array.isArray(u)?u:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=c,t=t[o]}};const vT={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},nl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},zc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},_B=P.createContext(null);_B.displayName="HookFormContext";const oj=()=>P.useContext(_B),_Ve=t=>{const{children:e,...r}=t;return P.createElement(_B.Provider,{value:r},e)};var jde=(t,e,r,n=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const a=s;return e._proxyFormState[a]!==nl.all&&(e._proxyFormState[a]=!n||nl.all),r&&(r[a]=!0),t[a]}});return i};const SB=typeof window<"u"?P.useLayoutEffect:P.useEffect;function SVe(t){const e=oj(),{control:r=e.control,disabled:n,name:i,exact:s}=t||{},[a,o]=P.useState(r._formState),c=P.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return SB(()=>r._subscribe({name:i,formState:c.current,exact:s,callback:u=>{!n&&o({...r._formState,...u})}}),[i,n,s]),P.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),P.useMemo(()=>jde(a,r,c.current,!1),[a,r])}var Aa=t=>typeof t=="string",Nde=(t,e,r,n,i)=>Aa(t)?(n&&e.watch.add(t),Ye(r,t,i)):Array.isArray(t)?t.map(s=>(n&&e.watch.add(s),Ye(r,s))):(n&&(e.watchAll=!0),r),gF=t=>As(t)||!Tde(t);function Zc(t,e,r=new WeakSet){if(gF(t)||gF(e))return t===e;if($h(t)&&$h(e))return t.getTime()===e.getTime();const n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const s of n){const a=t[s];if(!i.includes(s))return!1;if(s!=="ref"){const o=e[s];if($h(a)&&$h(o)||ci(a)&&ci(o)||Array.isArray(a)&&Array.isArray(o)?!Zc(a,o,r):a!==o)return!1}}return!0}function kVe(t){const e=oj(),{control:r=e.control,name:n,defaultValue:i,disabled:s,exact:a,compute:o}=t||{},c=P.useRef(i),u=P.useRef(o),d=P.useRef(void 0);u.current=o;const f=P.useMemo(()=>r._getWatch(n,c.current),[r,n]),[h,m]=P.useState(u.current?u.current(f):f);return SB(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:y=>{if(!s){const x=Nde(n,r._names,y.values||r._formValues,!1,c.current);if(u.current){const v=u.current(x);Zc(v,d.current)||(m(v),d.current=v)}else m(x)}}}),[r,s,n,a]),P.useEffect(()=>r._removeUnmounted()),h}function TVe(t){const e=oj(),{name:r,disabled:n,control:i=e.control,shouldUnregister:s,defaultValue:a}=t,o=Ede(i._names.array,r),c=P.useMemo(()=>Ye(i._formValues,r,Ye(i._defaultValues,r,a)),[i,r,a]),u=kVe({control:i,name:r,defaultValue:c,exact:!0}),d=SVe({control:i,name:r,exact:!0}),f=P.useRef(t),h=P.useRef(void 0),m=P.useRef(i.register(r,{...t.rules,value:u,...Na(t.disabled)?{disabled:t.disabled}:{}}));f.current=t;const y=P.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ye(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Ye(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Ye(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Ye(d.validatingFields,r)},error:{enumerable:!0,get:()=>Ye(d.errors,r)}}),[d,r]),x=P.useCallback(k=>m.current.onChange({target:{value:Cde(k),name:r},type:vT.CHANGE}),[r]),v=P.useCallback(()=>m.current.onBlur({target:{value:Ye(i._formValues,r),name:r},type:vT.BLUR}),[r,i._formValues]),_=P.useCallback(k=>{const E=Ye(i._fields,r);E&&k&&(E._f.ref={focus:()=>k.focus&&k.focus(),select:()=>k.select&&k.select(),setCustomValidity:T=>k.setCustomValidity(T),reportValidity:()=>k.reportValidity()})},[i._fields,r]),S=P.useMemo(()=>({name:r,value:u,...Na(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:v,ref:_}),[r,n,d.disabled,x,v,_,u]);return P.useEffect(()=>{const k=i._options.shouldUnregister||s,E=h.current;E&&E!==r&&!o&&i.unregister(E),i.register(r,{...f.current.rules,...Na(f.current.disabled)?{disabled:f.current.disabled}:{}});const T=(N,j)=>{const M=Ye(i._fields,N);M&&M._f&&(M._f.mount=j)};if(T(r,!0),k){const N=wi(Ye(i._options.defaultValues,r));Rr(i._defaultValues,r,N),Hn(Ye(i._formValues,r))&&Rr(i._formValues,r,N)}return!o&&i.register(r),h.current=r,()=>{(o?k&&!i._state.action:k)?i.unregister(r):T(r,!1)}},[r,i,o,s]),P.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),P.useMemo(()=>({field:S,formState:d,fieldState:y}),[S,d,y])}const CVe=t=>t.render(TVe(t));var kB=(t,e,r,n,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:i||!0}}:{},kx=t=>Array.isArray(t)?t:[t],O9=()=>{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}};function Pde(t,e){const r={};for(const n in t)if(t.hasOwnProperty(n)){const i=t[n],s=e[n];if(i&&ci(i)&&s){const a=Pde(i,s);ci(a)&&(r[n]=a)}else t[n]&&(r[n]=s)}return r}var ra=t=>ci(t)&&!Object.keys(t).length,TB=t=>t.type==="file",il=t=>typeof t=="function",xT=t=>{if(!xB)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Mde=t=>t.type==="select-multiple",CB=t=>
vendor: 9,786 bytes, line 3436
3436t.type==="radio",EVe=t=>CB(t)||zw(t),dA=t=>xT(t)&&t.isConnected;function jVe(t,e){const r=e.slice(0,-1).length;let n=0;for(;n<r;)t=Hn(t)?n++:t[e[n++]];return t}function NVe(t){for(const e in t)if(t.hasOwnProperty(e)&&!Hn(t[e]))return!1;return!0}function ri(t,e){const r=Array.isArray(e)?e:aj(e)?[e]:wB(e),n=r.length===1?t:jVe(t,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(ci(n)&&ra(n)||Array.isArray(n)&&NVe(n))&&ri(t,r.slice(0,-1)),t}var PVe=t=>{for(const e in t)if(il(t[e]))return!0;return!1};function Ade(t){return Array.isArray(t)||ci(t)&&!PVe(t)}function yF(t,e={}){for(const r in t)Ade(t[r])?(e[r]=Array.isArray(t[r])?[]:{},yF(t[r],e[r])):As(t[r])||(e[r]=!0);return e}function Gm(t,e,r){r||(r=yF(e));for(const n in t)Ade(t[n])?Hn(e)||gF(r[n])?r[n]=yF(t[n],Array.isArray(t[n])?[]:{}):Gm(t[n],As(e)?{}:e[n],r[n]):r[n]=!Zc(t[n],e[n]);return r}const R9={value:!1,isValid:!1},I9={value:!0,isValid:!0};var Dde=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Hn(t[0].attributes.value)?Hn(t[0].value)||t[0].value===""?I9:{value:t[0].value,isValid:!0}:I9:R9}return R9},Ode=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>Hn(t)?t:e?t===""?NaN:t&&+t:r&&Aa(t)?new Date(t):n?n(t):t;const L9={isValid:!1,value:null};var Rde=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,L9):L9;function $9(t){const e=t.ref;return TB(e)?e.files:CB(e)?Rde(t.refs).value:Mde(e)?[...e.selectedOptions].map(({value:r})=>r):zw(e)?Dde(t.refs).value:Ode(Hn(e.value)?t.ref.value:e.value,t)}var MVe=(t,e,r,n)=>{const i={};for(const s of t){const a=Ye(e,s);a&&Rr(i,s,a._f)}return{criteriaMode:r,names:[...t],fields:i,shouldUseNativeValidation:n}},bT=t=>t instanceof RegExp,pv=t=>Hn(t)?t:bT(t)?t.source:ci(t)?bT(t.value)?t.value.source:t.value:t,F9=t=>({isOnSubmit:!t||t===nl.onSubmit,isOnBlur:t===nl.onBlur,isOnChange:t===nl.onChange,isOnAll:t===nl.all,isOnTouch:t===nl.onTouched});const z9="AsyncFunction";var AVe=t=>!!t&&!!t.validate&&!!(il(t.validate)&&t.validate.constructor.name===z9||ci(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===z9)),DVe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),B9=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length))));const Tx=(t,e,r,n)=>{for(const i of r||Object.keys(t)){const s=Ye(t,i);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],i)&&!n)return!0;if(a.ref&&e(a.ref,a.name)&&!n)return!0;if(Tx(o,e))break}else if(ci(o)&&Tx(o,e))break}}};function V9(t,e,r){const n=Ye(t,r);if(n||aj(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),a=Ye(e,s),o=Ye(t,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var OVe=(t,e,r,n)=>{r(t);const{name:i,...s}=t;return ra(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!n||nl.all))},RVe=(t,e,r)=>!t||!e||t===e||kx(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),IVe=(t,e,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(e||t):(r?n.isOnBlur:i.isOnBlur)?!t:(r?n.isOnChange:i.isOnChange)?t:!0,LVe=(t,e)=>!bB(Ye(t,e)).length&&ri(t,e),$Ve=(t,e,r)=>{const n=kx(Ye(t,r));return Rr(n,"root",e[r]),Rr(t,r,n),t};function U9(t,e,r="validate"){if(Aa(t)||Array.isArray(t)&&t.every(Aa)||Na(t)&&!t)return{type:r,message:Aa(t)?t:"",ref:e}}var Mm=t=>ci(t)&&!bT(t)?t:{value:t,message:""},G9=async(t,e,r,n,i,s)=>{const{ref:a,refs:o,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:m,validate:y,name:x,valueAsNumber:v,mount:_}=t._f,S=Ye(r,x);if(!_||e.has(x))return{};const k=o?o[0]:a,E=B=>{i&&k.reportValidity&&(k.setCustomValidity(Na(B)?"":B||""),k.reportValidity())},T={},N=CB(a),j=zw(a),M=N||j,O=(v||TB(a))&&Hn(a.value)&&Hn(S)||xT(a)&&a.value===""||S===""||Array.isArray(S)&&!S.length,R=kB.bind(null,x,n,T),I=(B,F,V,$=zc.maxLength,U=zc.minLength)=>{const z=B?F:V;T[x]={type:B?$:U,message:z,ref:a,...R(B?$:U,z)}};if(s?!Array.isArray(S)||!S.length:c&&(!M&&(O||As(S))||Na(S)&&!S||j&&!Dde(o).isValid||N&&!Rde(o).isValid)){const{value:B,message:F}=Aa(c)?{value:!!c,message:c}:Mm(c);if(B&&(T[x]={type:zc.required,message:F,ref:k,...R(zc.required,F)},!n))return E(F),T}if(!O&&(!As(f)||!As(h))){let B,F;const V=Mm(h),$=Mm(f);if(!As(S)&&!isNaN(S)){const U=a.valueAsNumber||S&&+S;As(V.value)||(B=U>V.value),As($.value)||(F=U<$.value)}else{const U=a.valueAsDate||new Date(S),z=K=>new Date(new Date().toDateString()+" "+K),L=a.type=="time",W=a.type=="week";Aa(V.value)&&S&&(B=L?z(S)>z(V.value):W?S>V.value:U>new Date(V.value)),Aa($.value)&&S&&(F=L?z(S)<z($.value):W?S<$.value:U<new Date($.value))}if((B||F)&&(I(!!B,V.message,$.message,zc.max,zc.min),!n))return E(T[x].message),T}if((u||d)&&!O&&(Aa(S)||s&&Array.isArray(S))){const B=Mm(u),F=Mm(d),V=!As(B.value)&&S.length>+B.value,$=!As(F.value)&&S.length<+F.value;if((V||$)&&(I(V,B.message,F.message),!n))return E(T[x].message),T}if(m&&!O&&Aa(S)){const{value:B,message:F}=Mm(m);if(bT(B)&&!S.match(B)&&(T[x]={type:zc.pattern,message:F,ref:a,...R(zc.pattern,F)},!n))return E(F),T}if(y){if(il(y)){const B=await y(S,r),F=U9(B,k);if(F&&(T[x]={...F,...R(zc.validate,F.message)},!n))return E(F.message),T}else if(ci(y)){let B={};for(const F in y){if(!ra(B)&&!n)break;const V=U9(await y[F](S,r),k,F);V&&(B={...V,...R(F,V.message)},E(V.message),n&&(T[x]=B))}if(!ra(B)&&(T[x]={ref:k,...B},!n))return T}}return E(!0),T};const FVe={mode:nl.onSubmit,reValidateMode:nl.onChange,shouldFocusError:!0};function zVe(t={}){let e={...FVe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:il(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},i=ci(e.defaultValues)||ci(e.values)?wi(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:wi(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...d};const h={array:O9(),state:O9()},m=e.criteriaMode===nl.all,y=X=>ae=>{clearTimeout(u),u=setTimeout(X,ae)},x=async X=>{if(!e.disabled&&(d.isValid||f.isValid||X)){const ae=e.resolver?ra((await j()).errors):await O(n,!0);ae!==r.isValid&&h.state.next({isValid:ae})}},v=(X,ae)=>{!e.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((X||Array.from(o.mount)).forEach(de=>{de&&(ae?Rr(r.validatingFields,de,ae):ri(r.validatingFields,de))}),h.state.next({validatingFields:r.validatingFields,isValidating:!ra(r.validatingFields)}))},_=(X,ae=[],de,Ee,Me=!0,Te=!0)=>{if(Ee&&de&&!e.disabled){if(a.action=!0,Te&&Array.isArray(Ye(n,X))){const Qe=de(Ye(n,X),Ee.argA,Ee.argB);Me&&Rr(n,X,Qe)}if(Te&&Array.isArray(Ye(r.errors,X))){const Qe=de(Ye(r.errors,X),Ee.argA,Ee.argB);Me&&Rr(r.errors,X,Qe),LVe(r.errors,X)}if((d.touchedFields||f.touchedFields)&&Te&&Array.isArray(Ye(r.touchedFields,X))){const Qe=de(Ye(r.touchedFields,X),Ee.argA,Ee.argB);Me&&Rr(r.touchedFields,X,Qe)}(d.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Gm(i,s)),h.state.next({name:X,isDirty:I(X,ae),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Rr(s,X,ae)},S=(X,ae)=>{Rr(r.errors,X,ae),h.state.next({errors:r.errors})},k=X=>{r.errors=X,h.state.next({errors:r.errors,isValid:!1})},E=(X,ae,de,Ee)=>{const Me=Ye(n,X);if(Me){const Te=Ye(s,X,Hn(de)?Ye(i,X):de);Hn(Te)||Ee&&Ee.defaultChecked||ae?Rr(s,X,ae?Te:$9(Me._f)):V(X,Te),a.mount&&x()}},T=(X,ae,de,Ee,Me)=>{let Te=!1,Qe=!1;const Nt={name:X};if(!e.disabled){if(!de||Ee){(d.isDirty||f.isDirty)&&(Qe=r.isDirty,r.isDirty=Nt.isDirty=I(),Te=Qe!==Nt.isDirty);const jt=Zc(Ye(i,X),ae);Qe=!!Ye(r.dirtyFields,X),jt?ri(r.dirtyFields,X):Rr(r.dirtyFields,X,!0),Nt.dirtyFields=r.dirtyFields,Te=Te||(d.dirtyFields||f.dirtyFields)&&Qe!==!jt}if(de){const jt=Ye(r.touchedFields,X);jt||(Rr(r.touchedFields,X,de),Nt.touchedFields=r.touchedFields,Te=Te||(d.touchedFields||f.touchedFields)&&jt!==de)}Te&&Me&&h.state.next(Nt)}return Te?Nt:{}},N=(X,ae,de,Ee)=>{const Me=Ye(r.errors,X),Te=(d.isValid||f.isValid)&&Na(ae)&&r.isValid!==ae;if(e.delayError&&de?(c=y(()=>S(X,de)),c(e.delayError)):(clearTimeout(u),c=null,de?Rr(r.errors,X,de):ri(r.errors,X)),(de?!Zc(Me,de):Me)||!ra(Ee)||Te){const Qe={...Ee,...Te&&Na(ae)?{isValid:ae}:{},errors:r.errors,name:X};r={...r,...Qe},h.state.next(Qe)}},j=async X=>{v(X,!0);const ae=await e.resolver(s,e.context,MVe(X||o.mount,n,e.criteriaMode,e.shouldUseNativeValidation));return v(X),ae},M=async X=>{const{errors:ae}=await j(X);if(X)for(const de of X){const Ee=Ye(ae,de);Ee?Rr(r.errors,de,Ee):ri(r.errors,de)}else r.errors=ae;return ae},O=async(X,ae,de={valid:!0})=>{for(const Ee in X){const Me=X[Ee];if(Me){const{_f:Te,...Qe}=Me;if(Te){const Nt=o.array.has(Te.name),jt=Me._f&&AVe(Me._f);jt&&d.validatingFields&&v([Te.name],!0);const jr=await G9(Me,o.disabled,s,m,e.shouldUseNativeValidation&&!ae,Nt);if(jt&&d.validatingFields&&v([Te.name]),jr[Te.name]&&(de.valid=!1,ae))break;!ae&&(Ye(jr,Te.name)?Nt?$Ve(r.errors,jr,Te.name):Rr(r.errors,Te.name,jr[Te.name]):ri(r.errors,Te.name))}!ra(Qe)&&await O(Qe,ae,de)}}return de.valid},R=()=>{for(const X of o.unMount){const ae=Ye(n,X);ae&&(ae._f.refs?ae._f.refs.every(de=>!dA(de)):!dA(ae._f.ref))&&oe(X)}o.unMount=new Set},I=(X,ae)=>!e.disabled&&(X&&ae&&Rr(s,X,ae),!Zc(K(),i)),B=(X,ae,de)=>Nde(X,o,{...a.mount?s:Hn(ae)?i:Aa(X)?{[X]:ae}:ae},de,ae),F=X=>bB(Ye(a.mount?s:i,X,e.shouldUnregister?Ye(i,X,[]):[])),V=(X,ae,de={})=>{const Ee=Ye(n,X);let Me=ae;if(Ee){const Te=Ee._f;
vendor: 9,680 bytes, line 3436
3436Te&&(!Te.disabled&&Rr(s,X,Ode(ae,Te)),Me=xT(Te.ref)&&As(ae)?"":ae,Mde(Te.ref)?[...Te.ref.options].forEach(Qe=>Qe.selected=Me.includes(Qe.value)):Te.refs?zw(Te.ref)?Te.refs.forEach(Qe=>{(!Qe.defaultChecked||!Qe.disabled)&&(Array.isArray(Me)?Qe.checked=!!Me.find(Nt=>Nt===Qe.value):Qe.checked=Me===Qe.value||!!Me)}):Te.refs.forEach(Qe=>Qe.checked=Qe.value===Me):TB(Te.ref)?Te.ref.value="":(Te.ref.value=Me,Te.ref.type||h.state.next({name:X,values:wi(s)})))}(de.shouldDirty||de.shouldTouch)&&T(X,Me,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&W(X)},$=(X,ae,de)=>{for(const Ee in ae){if(!ae.hasOwnProperty(Ee))return;const Me=ae[Ee],Te=X+"."+Ee,Qe=Ye(n,Te);(o.array.has(X)||ci(Me)||Qe&&!Qe._f)&&!$h(Me)?$(Te,Me,de):V(Te,Me,de)}},U=(X,ae,de={})=>{const Ee=Ye(n,X),Me=o.array.has(X),Te=wi(ae);Rr(s,X,Te),Me?(h.array.next({name:X,values:wi(s)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&de.shouldDirty&&h.state.next({name:X,dirtyFields:Gm(i,s),isDirty:I(X,Te)})):Ee&&!Ee._f&&!As(Te)?$(X,Te,de):V(X,Te,de),B9(X,o)&&h.state.next({...r,name:X}),h.state.next({name:a.mount?X:void 0,values:wi(s)})},z=async X=>{a.mount=!0;const ae=X.target;let de=ae.name,Ee=!0;const Me=Ye(n,de),Te=jt=>{Ee=Number.isNaN(jt)||$h(jt)&&isNaN(jt.getTime())||Zc(jt,Ye(s,de,jt))},Qe=F9(e.mode),Nt=F9(e.reValidateMode);if(Me){let jt,jr;const Vr=ae.type?$9(Me._f):Cde(X),Dr=X.type===vT.BLUR||X.type===vT.FOCUS_OUT,$r=!DVe(Me._f)&&!e.resolver&&!Ye(r.errors,de)&&!Me._f.deps||IVe(Dr,Ye(r.touchedFields,de),r.isSubmitted,Nt,Qe),Ur=B9(de,o,Dr);Rr(s,de,Vr),Dr?(!ae||!ae.readOnly)&&(Me._f.onBlur&&Me._f.onBlur(X),c&&c(0)):Me._f.onChange&&Me._f.onChange(X);const Ni=T(de,Vr,Dr),zi=!ra(Ni)||Ur;if(!Dr&&h.state.next({name:de,type:X.type,values:wi(s)}),$r)return(d.isValid||f.isValid)&&(e.mode==="onBlur"?Dr&&x():Dr||x()),zi&&h.state.next({name:de,...Ur?{}:Ni});if(!Dr&&Ur&&h.state.next({...r}),e.resolver){const{errors:Nn}=await j([de]);if(Te(Vr),Ee){const or=V9(r.errors,n,de),xt=V9(Nn,n,or.name||de);jt=xt.error,de=xt.name,jr=ra(Nn)}}else v([de],!0),jt=(await G9(Me,o.disabled,s,m,e.shouldUseNativeValidation))[de],v([de]),Te(Vr),Ee&&(jt?jr=!1:(d.isValid||f.isValid)&&(jr=await O(n,!0)));Ee&&(Me._f.deps&&(!Array.isArray(Me._f.deps)||Me._f.deps.length>0)&&W(Me._f.deps),N(de,jr,jt,Ni))}},L=(X,ae)=>{if(Ye(r.errors,ae)&&X.focus)return X.focus(),1},W=async(X,ae={})=>{let de,Ee;const Me=kx(X);if(e.resolver){const Te=await M(Hn(X)?X:Me);de=ra(Te),Ee=X?!Me.some(Qe=>Ye(Te,Qe)):de}else X?(Ee=(await Promise.all(Me.map(async Te=>{const Qe=Ye(n,Te);return await O(Qe&&Qe._f?{[Te]:Qe}:Qe)}))).every(Boolean),!(!Ee&&!r.isValid)&&x()):Ee=de=await O(n);return h.state.next({...!Aa(X)||(d.isValid||f.isValid)&&de!==r.isValid?{}:{name:X},...e.resolver||!X?{isValid:de}:{},errors:r.errors}),ae.shouldFocus&&!Ee&&Tx(n,L,X?Me:o.mount),Ee},K=(X,ae)=>{let de={...a.mount?s:i};return ae&&(de=Pde(ae.dirtyFields?r.dirtyFields:r.touchedFields,de)),Hn(X)?de:Aa(X)?Ye(de,X):X.map(Ee=>Ye(de,Ee))},q=(X,ae)=>({invalid:!!Ye((ae||r).errors,X),isDirty:!!Ye((ae||r).dirtyFields,X),error:Ye((ae||r).errors,X),isValidating:!!Ye(r.validatingFields,X),isTouched:!!Ye((ae||r).touchedFields,X)}),H=X=>{X&&kx(X).forEach(ae=>ri(r.errors,ae)),h.state.next({errors:X?r.errors:{}})},Y=(X,ae,de)=>{const Ee=(Ye(n,X,{_f:{}})._f||{}).ref,Me=Ye(r.errors,X)||{},{ref:Te,message:Qe,type:Nt,...jt}=Me;Rr(r.errors,X,{...jt,...ae,ref:Ee}),h.state.next({name:X,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&Ee&&Ee.focus&&Ee.focus()},J=(X,ae)=>il(X)?h.state.subscribe({next:de=>"values"in de&&X(B(void 0,ae),de)}):B(X,ae,!0),re=X=>h.state.subscribe({next:ae=>{RVe(X.name,ae.name,X.exact)&&OVe(ae,X.formState||d,Qt,X.reRenderRoot)&&X.callback({values:{...s},...r,...ae,defaultValues:i})}}).unsubscribe,me=X=>(a.mount=!0,f={...f,...X.formState},re({...X,formState:f})),oe=(X,ae={})=>{for(const de of X?kx(X):o.mount)o.mount.delete(de),o.array.delete(de),ae.keepValue||(ri(n,de),ri(s,de)),!ae.keepError&&ri(r.errors,de),!ae.keepDirty&&ri(r.dirtyFields,de),!ae.keepTouched&&ri(r.touchedFields,de),!ae.keepIsValidating&&ri(r.validatingFields,de),!e.shouldUnregister&&!ae.keepDefaultValue&&ri(i,de);h.state.next({values:wi(s)}),h.state.next({...r,...ae.keepDirty?{isDirty:I()}:{}}),!ae.keepIsValid&&x()},ge=({disabled:X,name:ae})=>{(Na(X)&&a.mount||X||o.disabled.has(ae))&&(X?o.disabled.add(ae):o.disabled.delete(ae))},le=(X,ae={})=>{let de=Ye(n,X);const Ee=Na(ae.disabled)||Na(e.disabled);return Rr(n,X,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:X}},name:X,mount:!0,...ae}}),o.mount.add(X),de?ge({disabled:Na(ae.disabled)?ae.disabled:e.disabled,name:X}):E(X,!0,ae.value),{...Ee?{disabled:ae.disabled||e.disabled}:{},...e.progressive?{required:!!ae.required,min:pv(ae.min),max:pv(ae.max),minLength:pv(ae.minLength),maxLength:pv(ae.maxLength),pattern:pv(ae.pattern)}:{},name:X,onChange:z,onBlur:z,ref:Me=>{if(Me){le(X,ae),de=Ye(n,X);const Te=Hn(Me.value)&&Me.querySelectorAll&&Me.querySelectorAll("input,select,textarea")[0]||Me,Qe=EVe(Te),Nt=de._f.refs||[];if(Qe?Nt.find(jt=>jt===Te):Te===de._f.ref)return;Rr(n,X,{_f:{...de._f,...Qe?{refs:[...Nt.filter(dA),Te,...Array.isArray(Ye(i,X))?[{}]:[]],ref:{type:Te.type,name:X}}:{ref:Te}}}),E(X,!1,void 0,Te)}else de=Ye(n,X,{}),de._f&&(de._f.mount=!1),(e.shouldUnregister||ae.shouldUnregister)&&!(Ede(o.array,X)&&a.action)&&o.unMount.add(X)}}},Se=()=>e.shouldFocusError&&Tx(n,L,o.mount),Ce=X=>{Na(X)&&(h.state.next({disabled:X}),Tx(n,(ae,de)=>{const Ee=Ye(n,de);Ee&&(ae.disabled=Ee._f.disabled||X,Array.isArray(Ee._f.refs)&&Ee._f.refs.forEach(Me=>{Me.disabled=Ee._f.disabled||X}))},0,!1))},he=(X,ae)=>async de=>{let Ee;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let Me=wi(s);if(h.state.next({isSubmitting:!0}),e.resolver){const{errors:Te,values:Qe}=await j();r.errors=Te,Me=wi(Qe)}else await O(n);if(o.disabled.size)for(const Te of o.disabled)ri(Me,Te);if(ri(r.errors,"root"),ra(r.errors)){h.state.next({errors:{}});try{await X(Me,de)}catch(Te){Ee=Te}}else ae&&await ae({...r.errors},de),Se(),setTimeout(Se);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ra(r.errors)&&!Ee,submitCount:r.submitCount+1,errors:r.errors}),Ee)throw Ee},Ct=(X,ae={})=>{Ye(n,X)&&(Hn(ae.defaultValue)?U(X,wi(Ye(i,X))):(U(X,ae.defaultValue),Rr(i,X,wi(ae.defaultValue))),ae.keepTouched||ri(r.touchedFields,X),ae.keepDirty||(ri(r.dirtyFields,X),r.isDirty=ae.defaultValue?I(X,wi(Ye(i,X))):I()),ae.keepError||(ri(r.errors,X),d.isValid&&x()),h.state.next({...r}))},De=(X,ae={})=>{const de=X?wi(X):i,Ee=wi(de),Me=ra(X),Te=Me?i:Ee;if(ae.keepDefaultValues||(i=de),!ae.keepValues){if(ae.keepDirtyValues){const Qe=new Set([...o.mount,...Object.keys(Gm(i,s))]);for(const Nt of Array.from(Qe))Ye(r.dirtyFields,Nt)?Rr(Te,Nt,Ye(s,Nt)):U(Nt,Ye(Te,Nt))}else{if(xB&&Hn(X))for(const Qe of o.mount){const Nt=Ye(n,Qe);if(Nt&&Nt._f){const jt=Array.isArray(Nt._f.refs)?Nt._f.refs[0]:Nt._f.ref;if(xT(jt)){const jr=jt.closest("form");if(jr){jr.reset();break}}}}if(ae.keepFieldsRef)for(const Qe of o.mount)U(Qe,Ye(Te,Qe));else n={}}s=e.shouldUnregister?ae.keepDefaultValues?wi(i):{}:wi(Te),h.array.next({values:{...Te}}),h.state.next({values:{...Te}})}o={mount:ae.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!ae.keepIsValid||!!ae.keepDirtyValues,a.watch=!!e.shouldUnregister,h.state.next({submitCount:ae.keepSubmitCount?r.submitCount:0,isDirty:Me?!1:ae.keepDirty?r.isDirty:!!(ae.keepDefaultValues&&!Zc(X,i)),isSubmitted:ae.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Me?{}:ae.keepDirtyValues?ae.keepDefaultValues&&s?Gm(i,s):r.dirtyFields:ae.keepDefaultValues&&X?Gm(i,X):ae.keepDirty?r.dirtyFields:{},touchedFields:ae.keepTouched?r.touchedFields:{},errors:ae.keepErrors?r.errors:{},isSubmitSuccessful:ae.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},It=(X,ae)=>De(il(X)?X(s):X,ae),Yt=(X,ae={})=>{const de=Ye(n,X),Ee=de&&de._f;if(Ee){const Me=Ee.refs?Ee.refs[0]:Ee.ref;Me.focus&&(Me.focus(),ae.shouldSelect&&il(Me.select)&&Me.select())}},Qt=X=>{r={...r,...X}},gr={control:{register:le,unregister:oe,getFieldState:q,handleSubmit:he,setError:Y,_subscribe:re,_runSchema:j,_focusError:Se,_getWatch:B,_getDirty:I,_setValid:x,_setFieldArray:_,_setDisabledField:ge,_setErrors:k,_getFieldArray:F,_reset:De,_resetDefaultValues:()=>il(e.defaultValues)&&e.defaultValues().then(X=>{It(X,e.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:R,_disableForm:Ce,_subjects:h,_proxyFormState:d,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(X){a=X},get _defaultValues(){return i},get _names(){return o},set _names(X){o=X},get _formState(){return r},get _options(){return e},set _options(X){e={...e,...X}}},subscribe:me,trigger:W,register:le,handleSubmit:he,watch:J,setValue:U,getValues:K,reset:It,resetField:Ct,clearErrors:H,unregister:oe,setError:Y,setFocus:Yt,getFieldState:q};return{...gr,formControl:gr}}function $o(t={}){const e=P.useRef(void 0),r=P.useRef(void 0),[n,i]=P.useState({isDirty:!1,isValidating:!1,isLoading:il(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:il(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!il(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:a,...o}=zVe(t);e.current={...o,formState:n}}const s=e.current.control;return s._options=t,SB(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}
3436),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),P.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),P.useEffect(()=>{t.mode&&(s._options.mode=t.mode),t.reValidateMode&&(s._options.reValidateMode=t.reValidateMode)},[s,t.mode,t.reValidateMode]),P.useEffect(()=>{t.errors&&(s._setErrors(t.errors),s._focusError())},[s,t.errors]),P.useEffect(()=>{t.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,t.shouldUnregister]),P.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),P.useEffect(()=>{t.values&&!Zc(t.values,r.current)?(s._reset(t.values,{keepFieldsRef:!0,...s._options.resetOptions}),r.current=t.values,i(a=>({...a}))):s._resetDefaultValues()},[s,t.values]),P.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=jde(n,s),e.current}const W9=(t,e,r)=>{if(t&&"reportValidity"in t){const n=Ye(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},vF=(t,e)=>{for(const r in e.fields){const n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?W9(n.ref,r,t):n&&n.refs&&n.refs.forEach(i=>W9(i,r,t))}},H9=(t,e)=>{e.shouldUseNativeValidation&&vF(t,e);const r={};for(const n in t){const i=Ye(e.fields,n),s=Object.assign(t[n]||{},{ref:i&&i.ref});if(BVe(e.names||Object.keys(t),n)){const a=Object.assign({},Ye(r,n));Rr(a,"root",s),Rr(r,n,a)}else Rr(r,n,s)}return r},BVe=(t,e)=>{const r=q9(e);return t.some(n=>q9(n).match(`^${r}\\.\\d+`))};function q9(t){return t.replace(/\]|\[/g,"")}function we(t,e,r){function n(o,c){var u;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(u=o._zod).traits??(u.traits=new Set),o._zod.traits.add(t),e(o,c);for(const d in a.prototype)d in o||Object.defineProperty(o,d,{value:a.prototype[d].bind(o)});o._zod.constr=a,o._zod.def=c}const i=r?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:t});function a(o){var c;const u=r?.Parent?new s:this;n(u,o),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}class pb extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Ide={};function xp(t){return Ide}function VVe(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function UVe(t,e){return typeof e=="bigint"?e.toString():e}function EB(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function jB(t){return t==null}function NB(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function GVe(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}function dn(t,e,r){Object.defineProperty(t,e,{get(){{const n=r();return t[e]=n,n}},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function PB(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function mv(t){return JSON.stringify(t)}const Lde=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function wT(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const WVe=EB(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function xF(t){if(wT(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(wT(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}const HVe=new Set(["string","number","symbol"]);function Bw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hp(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function St(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function qVe(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const YVe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function KVe(t,e){const r={},n=t._zod.def;for(const i in e){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&(r[i]=n.shape[i])}return Hp(t,{...t._zod.def,shape:r,checks:[]})}function QVe(t,e){const r={...t._zod.def.shape},n=t._zod.def;for(const i in e){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&delete r[i]}return Hp(t,{...t._zod.def,shape:r,checks:[]})}function ZVe(t,e){if(!xF(e))throw new Error("Invalid input to extend: expected a plain object");const r={...t._zod.def,get shape(){const n={...t._zod.def.shape,...e};return PB(this,"shape",n),n},checks:[]};return Hp(t,r)}function XVe(t,e){return Hp(t,{...t._zod.def,get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return PB(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function JVe(t,e,r){const n=e._zod.def.shape,i={...n};if(r)for(const s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(const s in n)i[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return Hp(e,{...e._zod.def,shape:i,checks:[]})}function eUe(t,e,r){const n=e._zod.def.shape,i={...n};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(const s in n)i[s]=new t({type:"nonoptional",innerType:n[s]});return Hp(e,{...e._zod.def,shape:i,checks:[]})}function Cx(t,e=0){for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function MB(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function X_(t){return typeof t=="string"?t:t?.message}function bp(t,e,r){const n={...t,path:t.path??[]};if(!t.message){const i=X_(t.inst?._zod.def?.error?.(t))??X_(e?.error?.(t))??X_(r.customError?.(t))??X_(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function AB(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function mb(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const $de=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,UVe,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},DB=we("$ZodError",$de),lj=we("$ZodError",$de,{Parent:Error});function tUe(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function rUe(t,e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>i({issues:o}));else if(a.code==="invalid_key")i({issues:a.issues});else if(a.code==="invalid_element")i({issues:a.issues});
vendor: 12,909 bytes, lines 3436-3438
3436else if(a.path.length===0)n._errors.push(r(a));else{let o=n,c=0;for(;c<a.path.length;){const u=a.path[c];c===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(a))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(t),n}const Fde=t=>(e,r,n,i)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new pb;if(a.issues.length){const o=new(i?.Err??t)(a.issues.map(c=>bp(c,s,xp())));throw Lde(o,i?.callee),o}return a.value},nUe=Fde(lj),zde=t=>async(e,r,n,i)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new(i?.Err??t)(a.issues.map(c=>bp(c,s,xp())));throw Lde(o,i?.callee),o}return a.value},iUe=zde(lj),Bde=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new pb;return s.issues.length?{success:!1,error:new(t??DB)(s.issues.map(a=>bp(a,i,xp())))}:{success:!0,data:s.value}},sUe=Bde(lj),Vde=t=>async(e,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(a=>bp(a,i,xp())))}:{success:!0,data:s.value}},aUe=Vde(lj),oUe=/^[cC][^\s-]{8,}$/,lUe=/^[0-9a-z]+$/,cUe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uUe=/^[0-9a-vA-V]{20}$/,dUe=/^[A-Za-z0-9]{27}$/,fUe=/^[a-zA-Z0-9_-]{21}$/,hUe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pUe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Y9=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,mUe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gUe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yUe(){return new RegExp(gUe,"u")}const vUe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xUe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,bUe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wUe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_Ue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ude=/^[A-Za-z0-9_-]*$/,SUe=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,kUe=/^\+(?:[0-9]){6,14}[0-9]$/,Gde="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",TUe=new RegExp(`^${Gde}$`);function Wde(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function CUe(t){return new RegExp(`^${Wde(t)}$`)}function EUe(t){const e=Wde({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Gde}T(?:${n})$`)}const jUe=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},NUe=/^\d+$/,PUe=/^-?\d+(?:\.\d+)?/i,MUe=/true|false/i,AUe=/^[^A-Z]*$/,DUe=/^[^a-z]*$/,pa=we("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Hde={number:"number",bigint:"bigint",object:"date"},qde=we("$ZodCheckLessThan",(t,e)=>{pa.init(t,e);const r=Hde[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Yde=we("$ZodCheckGreaterThan",(t,e)=>{pa.init(t,e);const r=Hde[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),OUe=we("$ZodCheckMultipleOf",(t,e)=>{pa.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):GVe(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),RUe=we("$ZodCheckNumberFormat",(t,e)=>{pa.init(t,e),e.format=e.format||"float64";const r=e.format?.includes("int"),n=r?"int":"number",[i,s]=YVe[e.format];t._zod.onattach.push(a=>{const o=a._zod.bag;o.format=e.format,o.minimum=i,o.maximum=s,r&&(o.pattern=NUe)}),t._zod.check=a=>{const o=a.value;if(r){if(!Number.isInteger(o)){a.issues.push({expected:n,format:e.format,code:"invalid_type",input:o,inst:t});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:t})}}),IUe=we("$ZodCheckMaxLength",(t,e)=>{var r;pa.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!jB(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{const i=n.value;if(i.length<=e.maximum)return;const a=AB(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),LUe=we("$ZodCheckMinLength",(t,e)=>{var r;pa.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!jB(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const a=AB(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),$Ue=we("$ZodCheckLengthEquals",(t,e)=>{var r;pa.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!jB(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,s=i.length;if(s===e.length)return;const a=AB(i),o=s>e.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),cj=we("$ZodCheckStringFormat",(t,e)=>{var r,n;pa.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),FUe=we("$ZodCheckRegex",(t,e)=>{cj.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),zUe=we("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=AUe),cj.init(t,e)}),BUe=we("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=DUe),cj.init(t,e)}),VUe=we("$ZodCheckIncludes",(t,e)=>{pa.init(t,e);const r=Bw(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),UUe=we("$ZodCheckStartsWith",(t,e)=>{pa.init(t,e);const r=new RegExp(`^${Bw(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),GUe=we("$ZodCheckEndsWith",(t,e)=>{pa.init(t,e);const r=new RegExp(`.*${Bw(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),WUe=we("$ZodCheckOverwrite",(t,e)=>{pa.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class HUe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(`
3437`).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,r=this?.args,i=[...(this?.content??[""]).map(s=>`  ${s}`)];return new e(...r,i.join(`
3438`))}}const qUe={major:4,minor:0,patch:0},xn=we("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=qUe;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const i of n)for(const s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(s,a,o)=>{let c=Cx(s),u;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;const f=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&o?.async===!1)throw new pb;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,s.issues.length!==f&&(c||(c=Cx(s,f)))});else{if(s.issues.length===f)continue;c||(c=Cx(s,f))}}return u?u.then(()=>s):s};t._zod.run=(s,a)=>{const o=t._zod.parse(s,a);if(o instanceof Promise){if(a.async===!1)throw new pb;return o.then(c=>i(c,n,a))}return i(o,n,a)}}t["~standard"]={validate:i=>{try{const s=sUe(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return aUe(t,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),OB=we("$ZodString",(t,e)=>{xn.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??jUe(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),bn=we("$ZodStringFormat",(t,e)=>{cj.init(t,e),OB.init(t,e)}),YUe=we("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=pUe),bn.init(t,e)}),KUe=we("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Y9(n))}else e.pattern??(e.pattern=Y9());bn.init(t,e)}),QUe=we("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=mUe),bn.init(t,e)}),ZUe=we("$ZodURL",(t,e)=>{bn.init(t,e),t._zod.check=r=>{try{const n=r.value,i=new URL(n),s=i.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:SUe.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),XUe=we("$ZodEmoji",(t,e)=>
vendor: 4,785 bytes, line 3438
3438{e.pattern??(e.pattern=yUe()),bn.init(t,e)}),JUe=we("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=fUe),bn.init(t,e)}),e6e=we("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=oUe),bn.init(t,e)}),t6e=we("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=lUe),bn.init(t,e)}),r6e=we("$ZodULID",(t,e)=>{e.pattern??(e.pattern=cUe),bn.init(t,e)}),n6e=we("$ZodXID",(t,e)=>{e.pattern??(e.pattern=uUe),bn.init(t,e)}),i6e=we("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=dUe),bn.init(t,e)}),s6e=we("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=EUe(e)),bn.init(t,e)}),a6e=we("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=TUe),bn.init(t,e)}),o6e=we("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=CUe(e)),bn.init(t,e)}),l6e=we("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=hUe),bn.init(t,e)}),c6e=we("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=vUe),bn.init(t,e),t._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv4"})}),u6e=we("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=xUe),bn.init(t,e),t._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),d6e=we("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=bUe),bn.init(t,e)}),f6e=we("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=wUe),bn.init(t,e),t._zod.check=r=>{const[n,i]=r.value.split("/");try{if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Kde(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const h6e=we("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=_Ue),bn.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Kde(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function p6e(t){if(!Ude.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Kde(r)}const m6e=we("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ude),bn.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{p6e(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),g6e=we("$ZodE164",(t,e)=>{e.pattern??(e.pattern=kUe),bn.init(t,e)});function y6e(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const v6e=we("$ZodJWT",(t,e)=>{bn.init(t,e),t._zod.check=r=>{y6e(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Qde=we("$ZodNumber",(t,e)=>{xn.init(t,e),t._zod.pattern=t._zod.bag.pattern??PUe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),x6e=we("$ZodNumber",(t,e)=>{RUe.init(t,e),Qde.init(t,e)}),b6e=we("$ZodBoolean",(t,e)=>{xn.init(t,e),t._zod.pattern=MUe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),w6e=we("$ZodUnknown",(t,e)=>{xn.init(t,e),t._zod.parse=r=>r}),_6e=we("$ZodNever",(t,e)=>{xn.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),S6e=we("$ZodDate",(t,e)=>{xn.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}const i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function K9(t,e,r){t.issues.length&&e.issues.push(...MB(r,t.issues)),e.value[r]=t.value}const k6e=we("$ZodArray",(t,e)=>{xn.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const o=i[a],c=e.element._zod.run({value:o,issues:[]},n);c instanceof Promise?s.push(c.then(u=>K9(u,r,a))):K9(c,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function J_(t,e,r){t.issues.length&&e.issues.push(...MB(r,t.issues)),e.value[r]=t.value}function Q9(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...MB(r,t.issues)):t.value===void 0?r in n&&
vendor: 15,369 bytes, lines 3438-3461
3438(e.value[r]=void 0):e.value[r]=t.value}const T6e=we("$ZodObject",(t,e)=>{xn.init(t,e);const r=EB(()=>{const f=Object.keys(e.shape);for(const m of f)if(!(e.shape[m]instanceof xn))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const h=qVe(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});dn(t._zod,"propValues",()=>{const f=e.shape,h={};for(const m in f){const y=f[m]._zod;if(y.values){h[m]??(h[m]=new Set);for(const x of y.values)h[m].add(x)}}return h});const n=f=>{const h=new HUe(["shape","payload","ctx"]),m=r.value,y=S=>{const k=mv(S);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};h.write("const input = payload.value;");const x=Object.create(null);let v=0;for(const S of m.keys)x[S]=`key_${v++}`;h.write("const newResult = {}");for(const S of m.keys)if(m.optionalKeys.has(S)){const k=x[S];h.write(`const ${k} = ${y(S)};`);const E=mv(S);h.write(`
3439        if (${k}.issues.length) {
3440          if (input[${E}] === undefined) {
3441            if (${E} in input) {
3442              newResult[${E}] = undefined;
3443            }
3444          } else {
3445            payload.issues = payload.issues.concat(
3446              ${k}.issues.map((iss) => ({
3447                ...iss,
3448                path: iss.path ? [${E}, ...iss.path] : [${E}],
3449              }))
3450            );
3451          }
3452        } else if (${k}.value === undefined) {
3453          if (${E} in input) newResult[${E}] = undefined;
3454        } else {
3455          newResult[${E}] = ${k}.value;
3456        }
3457        `)}else{const k=x[S];h.write(`const ${k} = ${y(S)};`),h.write(`
3458          if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
3459            ...iss,
3460            path: iss.path ? [${mv(S)}, ...iss.path] : [${mv(S)}]
3461          })));`),h.write(`newResult[${mv(S)}] = ${k}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");const _=h.compile();return(S,k)=>_(f,S,k)};let i;const s=wT,a=!Ide.jitless,c=a&&WVe.value,u=e.catchall;let d;t._zod.parse=(f,h)=>{d??(d=r.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;const y=[];if(a&&c&&h?.async===!1&&h.jitless!==!0)i||(i=n(e.shape)),f=i(f,h);else{f.value={};const k=d.shape;for(const E of d.keys){const T=k[E],N=T._zod.run({value:m[E],issues:[]},h),j=T._zod.optin==="optional"&&T._zod.optout==="optional";N instanceof Promise?y.push(N.then(M=>j?Q9(M,f,E,m):J_(M,f,E))):j?Q9(N,f,E,m):J_(N,f,E)}}if(!u)return y.length?Promise.all(y).then(()=>f):f;const x=[],v=d.keySet,_=u._zod,S=_.def.type;for(const k of Object.keys(m)){if(v.has(k))continue;if(S==="never"){x.push(k);continue}const E=_.run({value:m[k],issues:[]},h);E instanceof Promise?y.push(E.then(T=>J_(T,f,k))):J_(E,f,k)}return x.length&&f.issues.push({code:"unrecognized_keys",keys:x,input:m,inst:t}),y.length?Promise.all(y).then(()=>f):f}});function Z9(t,e,r,n){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(s=>bp(s,n,xp())))}),e}const Zde=we("$ZodUnion",(t,e)=>{xn.init(t,e),dn(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),dn(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),dn(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),dn(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){const r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>NB(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let i=!1;const s=[];for(const a of e.options){const o=a._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)s.push(o),i=!0;else{if(o.issues.length===0)return o;s.push(o)}}return i?Promise.all(s).then(a=>Z9(a,r,t,n)):Z9(s,r,t,n)}}),C6e=we("$ZodDiscriminatedUnion",(t,e)=>{Zde.init(t,e);const r=t._zod.parse;dn(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,c]of Object.entries(a)){i[o]||(i[o]=new Set);for(const u of c)i[o].add(u)}}return i});const n=EB(()=>{const i=e.options,s=new Map;for(const a of i){const o=a._zod.propValues[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const c of o){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!wT(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=n.value.get(a?.[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),i)}}),E6e=we("$ZodIntersection",(t,e)=>{xn.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,s=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>X9(r,c,u)):X9(r,s,a)}});function bF(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(xF(t)&&xF(e)){const r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};for(const s of n){const a=bF(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<t.length;n++){const i=t[n],s=e[n],a=bF(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function X9(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),Cx(t))return t;const n=bF(e.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}const j6e=we("$ZodEnum",(t,e)=>{xn.init(t,e);const r=VVe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>HVe.has(typeof n)).map(n=>typeof n=="string"?Bw(n):n.toString()).join("|")})$`),t._zod.parse=(n,i)=>{const s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),N6e=we("$ZodLiteral",(t,e)=>{xn.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?Bw(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{const i=r.value;return t._zod.values.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),P6e=we("$ZodTransform",(t,e)=>{xn.init(t,e),t._zod.parse=(r,n)=>{const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r));if(i instanceof Promise)throw new pb;return r.value=i,r}}),M6e=we("$ZodOptional",(t,e)=>{xn.init(t,e),t._zod.optin="optional",t._zod.optout="optional",dn(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),dn(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${NB(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),A6e=we("$ZodNullable",(t,e)=>{xn.init(t,e),dn(t._zod,"optin",()=>e.innerType._zod.optin),dn(t._zod,"optout",()=>e.innerType._zod.optout),dn(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${NB(r.source)}|null)$`):void 0}),dn(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),D6e=we("$ZodDefault",(t,e)=>{xn.init(t,e),t._zod.optin="optional",dn(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>J9(s,e)):J9(i,e)}});function J9(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const O6e=we("$ZodPrefault",(t,e)=>{xn.init(t,e),t._zod.optin="optional",dn(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),R6e=we("$ZodNonOptional",(t,e)=>{xn.init(t,e),dn(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>eY(s,t)):eY(i,t)}});function eY(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const I6e=we("$ZodCatch",(t,e)=>{xn.init(t,e),t._zod.optin="optional",dn(t._zod,"optout",()=>e.innerType._zod.optout),dn(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(a=>bp(a,n,xp()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(s=>bp(s,n,xp()))},input:r.value}),r.issues=[]),r)}}),L6e=we("$ZodPipe",(t,e)=>{xn.init(t,e),dn(t._zod,"values",()=>e.in._zod.values),dn(t._zod,"optin",()=>e.in._zod.optin),dn(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>tY(s,e,n)):tY(i,e,n)}});function tY(t,e,r){return Cx(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}const $6e=we("$ZodReadonly",(t,e)=>{xn.init(t,e),dn(t._zod,"propValues",()=>e.innerType._zod.propValues),dn(t._zod,"values",()=>e.innerType._zod.values),dn(t._zod,"optin",()=>e.innerType._zod.optin),dn(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(rY):rY(i)}});function rY(t){return t.value=Object.freeze(t.value),t}const F6e=we("$ZodCustom",(t,e)=>{pa.init(t,e),xn.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>nY(s,r,n,t));nY(i,r,n,t)}});function nY(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(mb(i))}}class z6e{constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){const n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function B6e(){return new z6e}const eS=B6e();function V6e(t,e){return new t({type:"string",...St(e)})}function Xde(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...St(e)})}function iY(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...St(e)})}function U6e(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...St(e)})}function G6e(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...St(e)})}function W6e(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...St(e)})}function H6e(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...St(e)})}function q6e(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...St(e)})}function Y6e(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...St(e)})}function K6e(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...St(e)})}function Q6e(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...St(e)})}function Z6e(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...St(e)})}function X6e(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...St(e)})}function J6e(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...St(e)})}function eGe(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...St(e)})}function tGe(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...St(e)})}function rGe(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...St(e)})}function nGe(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...St(e)})}function iGe(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...St(e)})}function sGe(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...St(e)})}function aGe(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...St(e)})}function oGe(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...St(e)})}function lGe(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...St(e)})}function cGe(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...St(e)})}function uGe(t,e){return new t({type:"string",format:"date",check:"string_format",...St(e)})}function dGe(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...St(e)})}function fGe(t,e){return new t({type:"string",format:"duration",check:"string_format",...St(e)})}function hGe(t,e){return new t({type:"number",checks:[],...St(e)})}function pGe(t,e){return new t({type:"number",coerce:!0,checks:[],...St(e)})}function mGe(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...St(e)})}function gGe(t,e){return new t({type:"boolean",...St(e)})}function yGe(t){return new t({type:"unknown"})}function vGe(t,e){return new t({type:"never",...St(e)})}function xGe(t,e){return new t({type:"date",...St(e)})}function sY(t,e){return new qde({check:"less_than",...St(e),value:t,inclusive:!1})}function Tk(t,e){return new qde({check:"less_than",...St(e),value:t,inclusive:!0})}function aY(t,e){return new Yde({check:"greater_than",...St(e),value:t,inclusive:!1})}function Ck(t,e){return new Yde({check:"greater_than",...St(e),value:t,inclusive:!0})}function oY(t,e){return new OUe({check:"multiple_of",...St(e),value:t})}function Jde(t,e){return new IUe({check:"max_length",...St(e),maximum:t})}function _T(t,e){return new LUe({check:"min_length",...St(e),minimum:t})}function efe(t,e){return new $Ue({check:"length_equals",...St(e),length:t})}function bGe(t,e){return new FUe({check:"string_format",format:"regex",...St(e),pattern:t})}function wGe(t){return new zUe({check:"string_format",format:"lowercase",...St(t)})}function _Ge(t){return new BUe({check:"string_format",format:"up
3461percase",...St(t)})}function SGe(t,e){return new VUe({check:"string_format",format:"includes",...St(e),includes:t})}function kGe(t,e){return new UUe({check:"string_format",format:"starts_with",...St(e),prefix:t})}function TGe(t,e){return new GUe({check:"string_format",format:"ends_with",...St(e),suffix:t})}function Vw(t){return new WUe({check:"overwrite",tx:t})}function CGe(t){return Vw(e=>e.normalize(t))}function EGe(){return Vw(t=>t.trim())}function jGe(){return Vw(t=>t.toLowerCase())}function NGe(){return Vw(t=>t.toUpperCase())}function PGe(t,e,r){return new t({type:"array",element:e,...St(r)})}function MGe(t,e,r){return new t({type:"custom",check:"custom",fn:e,...St(r)})}function lY(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function AGe(t,e){for(var r={};t.length;){var n=t[0],i=n.code,s=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[a]={message:o.message,type:o.code}}else r[a]={message:s,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return t.push(f)})}),e){var c=r[a].types,u=c&&c[n.code];r[a]=kB(a,e,r,i,u?[].concat(u,n.message):n.message)}t.shift()}return r}function DGe(t,e){for(var r={};t.length;){var n=t[0],i=n.code,s=n.message,a=n.path.join(".");if(!r[a])if(n.code==="invalid_union"&&n.errors.length>0){var o=n.errors[0][0];r[a]={message:o.message,type:o.code}}else r[a]={message:s,type:i};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(f){return t.push(f)})}),e){var c=r[a].types,u=c&&c[n.code];r[a]=kB(a,e,r,i,u?[].concat(u,n.message):n.message)}t.shift()}return r}function xl(t,e,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(t))return function(n,i,s){try{return Promise.resolve(lY(function(){return Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(a){return s.shouldUseNativeValidation&&vF({},s),{errors:{},values:r.raw?Object.assign({},n):a}})},function(a){if((function(o){return Array.isArray(o?.issues)})(a))return{values:{},errors:H9(AGe(a.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(t))return function(n,i,s){try{return Promise.resolve(lY(function(){return Promise.resolve((r.mode==="sync"?nUe:iUe)(t,n,e)).then(function(a){return s.shouldUseNativeValidation&&vF({},s),{errors:{},values:r.raw?Object.assign({},n):a}})},function(a){if((function(o){return o instanceof DB})(a))return{values:{},errors:H9(DGe(a.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const Wr=b.forwardRef(({hasIcon:t,iconLeft:e,icon:r,onIconClick:n,dropdown:i=!0,showPasswordToggle:s=!1,className:a="",type:o,...c},u)=>{const[d,f]=b.useState(!1),h=e??r,m=t&&h?h:null,y=!!n,x=o==="password",v=s&&x,_=x&&d?"text":o,S=y||v,k=()=>{f(E=>!E)};return l.jsxs("div",{className:ee("w-full",m||S?"relative":void 0),children:[m&&l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none",children:m}),S&&l.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[v&&l.jsx("button",{type:"button",onClick:k,className:"text-gray-400 hover:text-app-border-color-accent focus:outline-hidden focus:text-app-border-color-accent transition-colors 2k:text-xl","aria-label":d?"Hide password":"Show password",title:d?"Hide password":"Show password",children:d?l.jsx(uoe,{size:18,className:"2k:size-6"}):l.jsx(tb,{size:18,className:"2k:size-6"})}),i&&y&&l.jsx("button",{type:"button",onClick:n,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-emerald-400 focus:outline-hidden 2k:text-xl",children:l.jsx(Eu,{size:18,className:"2k:size-6"})})]}),l.jsx("input",{ref:u,type:_,className:ee("block w-full",t?"pl-10":"pl-3",S?"pr-10":"pr-3","py-2 border border-app-border-color rounded-lg bg-app-input-bg text-gray-100 placeholder-gray-400 focus:outline-hidden","focus-visible:border-app-border-color-accent transition-[color,border] duration-200  2k:text-2xl 2k:pl
3461-14 2k:py-6","disabled:cursor-not-allowed disabled:opacity-50",a),...c})]})});Wr.displayName="Input";const cY="6LdVXIUrAAAAAKI5dWv1k_dAAM6w9-7Wr3r4H-p0",OGe=({open:t,onClose:e})=>{const[r,n]=b.useState(""),[i,s]=b.useState(!1),a=async()=>{s(!0);try{if(!window.grecaptcha||!cY){Ft.error("reCAPTCHA not loaded. Please try again later."),s(!1);return}const o=await window.grecaptcha.execute(cY,{action:"reset_password"});await WFe(ej(),r),Ft.success("Password reset email sent."),e()}catch{Ft.error("Could not send reset email. Please check the email address.")}s(!1)};return t?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-app-primary/80",children:l.jsxs("div",{className:"bg-app-card rounded-2xl shadow-2xl p-8 max-w-md w-full text-center border border-app-border-color-soft 2k:max-w-2xl 2k:p-16",children:[l.jsx("h2",{className:"text-2xl font-bold mb-4 text-app-primary-foreground 2k:text-5xl 2k:mb-8",children:"Forgot your password?"}),l.jsx(Wr,{type:"email",className:"mb-4 2k:h-14 2k:text-xl 2k:mb-8",placeholder:"Enter your email",value:r,onChange:o=>n(o.target.value)}),l.jsx(ye,{onClick:a,disabled:i,className:"w-full mb-2 2k:h-14 2k:text-xl 2k:mb-4",children:i?"Sending...":"Send Reset Email"}),l.jsx("button",{onClick:e,className:"block w-full text-app-text-accent underline text-sm mt-2 hover:text-app-text-accent/80 transition 2k:text-lg 2k:mt-4",type:"button",children:"Back to login"})]})}):null},tn=({label:t,icon:e,error:r,children:n})=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-300 2k:text-2xl 2k:mb-4",children:t}),l.jsxs("div",{className:"relative",children:[e&&l.jsx(e,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 2k:size-7",size:20}),n]}),r&&l.jsx("p",{className:"text-sm text-red-500 2k:text-2xl",children:r})]}),RB=()=>l.jsx("nav",{className:"fixed top-0 left-0 right-0 bg-app-card border-b border-app-border-color-soft z-50",children:l.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 2k:max-w-[1800px] 2k:px-30",children:l.jsxs("div",{className:"flex items-center justify-between h-16 2k:h-28",children:[l.jsxs(At,{to:"/",className:"flex items-center gap-2 2k:gap-6",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"object-cover h-10 w-auto mr-1 2k:h-16 2k:mr-4"}),l.jsx("span",{className:"truncate font-semibold text-left text-base leading-tight",children:es})]}),l.jsxs("div",{className:"flex items-center gap-4 2k:gap-8",children:[l.jsx(ye,{variant:"secondary",asChild:!0,className:"2k:text-2xl 2k:px-8 2k:py-6",children:l.jsx(At,{to:"/login",children:"Login"})}),l.jsx(ye,{asChild:!0,className:"2k:text-2xl 2k:px-8 2k:py-6",children:l.jsx(At,{to:"/signup",children:"Sign Up"})})]})]})})}),RGe="modulepreload",IGe=function(t){return"/"+t},uY={},Ps=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let c=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=a?.nonce||a?.getAttribute("nonce");i=c(r.map(u=>{if(u=IGe(u),u in uY)return;uY[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":RGe,d||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),d)return new Promise((m,y)=>{h.addEventListener("load",m),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})},LGe=we("ZodISODateTime",(t,e)=>{s6e.init(t,e),jn.init(t,e)});function $Ge(t){return cGe(LGe,t)}const FGe=we("ZodISODate",(t,e)=>{a6e.init(t,e),jn.init(t,e)});function zGe(t){return uGe(FGe,t)}const BGe=we("ZodISOTime",(t,e)=>{o6e.init(t,e),jn.init(t,e)});function VGe(t){return dGe(BGe,t)}const UGe=we("ZodISODuration",(t,e)=>{l6e.init(t,e),jn.init(t,e)});function GGe(t){return fGe(UGe,t)}const WGe=(t,e)=>{DB.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>rUe(t,r)},flatten:{value:r=>tUe(t,r)},addIssue:{value:r=>t.issues.push(r)},addIssues:{value:r=>t.issues.push(...r)},isEmpty:{get(){return t.issues.length===0}}})},uj=we("ZodError",WGe,{Parent:Error}),HGe=Fde(uj),qGe=zde(uj),YGe=Bde(uj),KGe=Vde(uj),Vn=we("ZodType",(t,e)=>(xn.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>Hp(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>HGe(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>YGe(t,r,n),t.parseAsync=async(r,n)=>qGe(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>KGe(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(VWe(r,n)),t.superRefine=r=>t.check(UWe(r)),t.overwrite=r=>t.check(Vw(r)),t.optional=()=>pY(t),t.nullable=()=>mY(t),t.nullish=()=>pY(mY(t)),t.nonoptional=r=>OWe(t,r),t.array=()=>Uw(t),t.or=r=>cf([t,r]),t.and=r=>TWe(t,r),t.transform=r=>gY(t,jWe(r)),t.default=r=>MWe(t,r),t.prefault=r=>DWe(t,r),t.catch=r=>
vendor: 6,269 bytes, line 3461
3461IWe(t,r),t.pipe=r=>gY(t,r),t.readonly=()=>FWe(t),t.describe=r=>{const n=t.clone();return eS.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return eS.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return eS.get(t);const n=t.clone();return eS.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),tfe=we("_ZodString",(t,e)=>{OB.init(t,e),Vn.init(t,e);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(bGe(...n)),t.includes=(...n)=>t.check(SGe(...n)),t.startsWith=(...n)=>t.check(kGe(...n)),t.endsWith=(...n)=>t.check(TGe(...n)),t.min=(...n)=>t.check(_T(...n)),t.max=(...n)=>t.check(Jde(...n)),t.length=(...n)=>t.check(efe(...n)),t.nonempty=(...n)=>t.check(_T(1,...n)),t.lowercase=n=>t.check(wGe(n)),t.uppercase=n=>t.check(_Ge(n)),t.trim=()=>t.check(EGe()),t.normalize=(...n)=>t.check(CGe(...n)),t.toLowerCase=()=>t.check(jGe()),t.toUpperCase=()=>t.check(NGe())}),QGe=we("ZodString",(t,e)=>{OB.init(t,e),tfe.init(t,e),t.email=r=>t.check(Xde(rfe,r)),t.url=r=>t.check(q6e(ZGe,r)),t.jwt=r=>t.check(lGe(fWe,r)),t.emoji=r=>t.check(Y6e(XGe,r)),t.guid=r=>t.check(iY(dY,r)),t.uuid=r=>t.check(U6e(tS,r)),t.uuidv4=r=>t.check(G6e(tS,r)),t.uuidv6=r=>t.check(W6e(tS,r)),t.uuidv7=r=>t.check(H6e(tS,r)),t.nanoid=r=>t.check(K6e(JGe,r)),t.guid=r=>t.check(iY(dY,r)),t.cuid=r=>t.check(Q6e(eWe,r)),t.cuid2=r=>t.check(Z6e(tWe,r)),t.ulid=r=>t.check(X6e(rWe,r)),t.base64=r=>t.check(sGe(cWe,r)),t.base64url=r=>t.check(aGe(uWe,r)),t.xid=r=>t.check(J6e(nWe,r)),t.ksuid=r=>t.check(eGe(iWe,r)),t.ipv4=r=>t.check(tGe(sWe,r)),t.ipv6=r=>t.check(rGe(aWe,r)),t.cidrv4=r=>t.check(nGe(oWe,r)),t.cidrv6=r=>t.check(iGe(lWe,r)),t.e164=r=>t.check(oGe(dWe,r)),t.datetime=r=>t.check($Ge(r)),t.date=r=>t.check(zGe(r)),t.time=r=>t.check(VGe(r)),t.duration=r=>t.check(GGe(r))});function Mr(t){return V6e(QGe,t)}const jn=we("ZodStringFormat",(t,e)=>{bn.init(t,e),tfe.init(t,e)}),rfe=we("ZodEmail",(t,e)=>{QUe.init(t,e),jn.init(t,e)});function ST(t){return Xde(rfe,t)}const dY=we("ZodGUID",(t,e)=>{YUe.init(t,e),jn.init(t,e)}),tS=we("ZodUUID",(t,e)=>{KUe.init(t,e),jn.init(t,e)}),ZGe=we("ZodURL",(t,e)=>{ZUe.init(t,e),jn.init(t,e)}),XGe=we("ZodEmoji",(t,e)=>{XUe.init(t,e),jn.init(t,e)}),JGe=we("ZodNanoID",(t,e)=>{JUe.init(t,e),jn.init(t,e)}),eWe=we("ZodCUID",(t,e)=>{e6e.init(t,e),jn.init(t,e)}),tWe=we("ZodCUID2",(t,e)=>{t6e.init(t,e),jn.init(t,e)}),rWe=we("ZodULID",(t,e)=>{r6e.init(t,e),jn.init(t,e)}),nWe=we("ZodXID",(t,e)=>{n6e.init(t,e),jn.init(t,e)}),iWe=we("ZodKSUID",(t,e)=>{i6e.init(t,e),jn.init(t,e)}),sWe=we("ZodIPv4",(t,e)=>{c6e.init(t,e),jn.init(t,e)}),aWe=we("ZodIPv6",(t,e)=>{u6e.init(t,e),jn.init(t,e)}),oWe=we("ZodCIDRv4",(t,e)=>{d6e.init(t,e),jn.init(t,e)}),lWe=we("ZodCIDRv6",(t,e)=>{f6e.init(t,e),jn.init(t,e)}),cWe=we("ZodBase64",(t,e)=>{h6e.init(t,e),jn.init(t,e)}),uWe=we("ZodBase64URL",(t,e)=>{m6e.init(t,e),jn.init(t,e)}),dWe=we("ZodE164",(t,e)=>{g6e.init(t,e),jn.init(t,e)}),fWe=we("ZodJWT",(t,e)=>{v6e.init(t,e),jn.init(t,e)}),IB=we("ZodNumber",(t,e)=>{Qde.init(t,e),Vn.init(t,e),t.gt=(n,i)=>t.check(aY(n,i)),t.gte=(n,i)=>t.check(Ck(n,i)),t.min=(n,i)=>t.check(Ck(n,i)),t.lt=(n,i)=>t.check(sY(n,i)),t.lte=(n,i)=>t.check(Tk(n,i)),t.max=(n,i)=>t.check(Tk(n,i)),t.int=n=>t.check(fY(n)),t.safe=n=>t.check(fY(n)),t.positive=n=>t.check(aY(0,n)),t.nonnegative=n=>t.check(Ck(0,n)),t.negative=n=>t.check(sY(0,n)),t.nonpositive=n=>t.check(Tk(0,n)),t.multipleOf=(n,i)=>t.check(oY(n,i)),t.step=(n,i)=>t.check(oY(n,i)),t.finite=()=>t;const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Li(t){return hGe(IB,t)}const hWe=we("ZodNumberFormat",(t,e)=>{x6e.init(t,e),IB.init(t,e)});function fY(t){return mGe(hWe,t)}const pWe=we("ZodBoolean",(t,e)=>{b6e.init(t,e),Vn.init(t,e)});function wF(t){return gGe(pWe,t)}const mWe=we("ZodUnknown",(t,e)=>{w6e.init(t,e),Vn.init(t,e)});function hY(){return yGe(mWe)}const gWe=we("ZodNever",(t,e)=>{_6e.init(t,e),Vn.init(t,e)});function yWe(t){return vGe(gWe,t)}const vWe=we("ZodDate",(t,e)=>{S6e.init(t,e),Vn.init(t,e),t.min=(n,i)=>t.check(Ck(n,i)),t.max=(n,i)=>t.check(Tk(n,i));const r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function xWe(t){return xGe(vWe,t)}const bWe=we("ZodArray",(t,e)=>{k6e.init(t,e),Vn.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(_T(r,n)),t.nonempty=r=>t.check(_T(1,r)),t.max=(r,n)=>t.check(Jde(r,n)),t.length=(r,n)=>t.check(efe(r,n)),t.unwrap=()=>t.element});function Uw(t,e){return PGe(bWe,t,e)}const wWe=we("ZodObject",(t,e)=>{T6e.init(t,e),Vn.init(t,e),dn(t,"shape",()=>e.shape),t.keyof=()=>Gw(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:hY()}),t.loose=()=>t.clone({...t._zod.def,catchall:hY()}),t.strict=()=>t.clone({...t._zod.def,catchall:yWe()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>ZVe(t,r),t.merge=r=>XVe(t,r),t.pick=r=>KVe(t,r),t.omit=r=>QVe(t,r),t.partial=(...r)=>JVe(ife,t,r[0]),t.required=(...r)=>eUe(sfe,t,r[0])});function li(t,e){const r={type:"object",get shape(){return PB(this,"shape",{...t}),this.shape},...St(e)};return new wWe(r)}const nfe=we("ZodUnion",(t,e)=>{Zde.init(t,e),Vn.init(t,e),t.options=e.options});function cf(t,e){return new nfe({type:"union",options:t,...St(e)})}const _We=we("ZodDiscriminatedUnion",(t,e)=>{nfe.init(t,e),C6e.init(t,e)});function SWe(t,e,r){return new _We({type:"union",options:e,discriminator:t,...St(r)})}const kWe=we("ZodIntersection",(t,e)=>{E6e.init(t,e),Vn.init(t,e)});function TWe(t,e){return new kWe({type:"intersection",left:t,right:e})}const _F=we("ZodEnum",(t,e)=>{j6e.init(t,e),Vn.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);
3461return new _F({...e,checks:[],...St(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new _F({...e,checks:[],...St(i),entries:s})}});function Gw(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new _F({type:"enum",entries:r,...St(e)})}const CWe=we("ZodLiteral",(t,e)=>{N6e.init(t,e),Vn.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Il(t,e){return new CWe({type:"literal",values:Array.isArray(t)?t:[t],...St(e)})}const EWe=we("ZodTransform",(t,e)=>{P6e.init(t,e),Vn.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(mb(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),r.issues.push(mb(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r)):(r.value=i,r)}});function jWe(t){return new EWe({type:"transform",transform:t})}const ife=we("ZodOptional",(t,e)=>{M6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType});function pY(t){return new ife({type:"optional",innerType:t})}const NWe=we("ZodNullable",(t,e)=>{A6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mY(t){return new NWe({type:"nullable",innerType:t})}const PWe=we("ZodDefault",(t,e)=>{D6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function MWe(t,e){return new PWe({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const AWe=we("ZodPrefault",(t,e)=>{O6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType});function DWe(t,e){return new AWe({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const sfe=we("ZodNonOptional",(t,e)=>{R6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType});function OWe(t,e){return new sfe({type:"nonoptional",innerType:t,...St(e)})}const RWe=we("ZodCatch",(t,e)=>{I6e.init(t,e),Vn.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function IWe(t,e){return new RWe({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const LWe=we("ZodPipe",(t,e)=>{L6e.init(t,e),Vn.init(t,e),t.in=e.in,t.out=e.out});function gY(t,e){return new LWe({type:"pipe",in:t,out:e})}const $We=we("ZodReadonly",(t,e)=>{$6e.init(t,e),Vn.init(t,e)});function FWe(t){return new $We({type:"readonly",innerType:t})}const zWe=we("ZodCustom",(t,e)=>{F6e.init(t,e),Vn.init(t,e)});function BWe(t){const e=new pa({check:"custom"});return e._zod.check=t,e}function VWe(t,e={}){return MGe(zWe,t,e)}function UWe(t){const e=BWe(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(mb(n,r.value,e._zod.def));else{const i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),r.issues.push(mb(i))}},t(r.value,r)));return e}function yY(t){return pGe(IB,t)}const kT=(t,e)=>{if(typeof window>"u")return null;try{const r=window.localStorage.getItem(t);if(!r)return null;const n=JSON.parse(r),i=e.safeParse(n);return i.success?i.data:null}catch{return null}},Wc=(t,e)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,JSON.stringify(e))}catch{}};function GWe(t){if(!(t instanceof Ha))return"An unexpected error occurred. Please try again later.";switch(t.code){case"auth/invalid-login-credentials":case"auth/invalid-credential":case"auth/wrong-password":case"auth/user-not-found":return"Wrong email or password, please try again.";case"auth/account-exists-with-different-credential":return"An account with this email already exists using a different sign-in method.";case"auth/popup-closed-by-user":return"The sign-in window was closed before completing the process.";default:return"An unexpected error occurred. Please try again later."}}var Sr;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(a=>
vendor: 1,174 bytes, line 3461
3461typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Sr||(Sr={}));var vY;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(vY||(vY={}));const pt=Sr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ad=t=>{switch(typeof t){case"undefined":return pt.undefined;case"string":return pt.string;case"number":return Number.isNaN(t)?pt.nan:pt.number;case"boolean":return pt.boolean;case"function":return pt.function;case"bigint":return pt.bigint;case"symbol":return pt.symbol;case"object":return Array.isArray(t)?pt.array:t===null?pt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?pt.promise:typeof Map<"u"&&t instanceof Map?pt.map:typeof Set<"u"&&t instanceof Set?pt.set:typeof Date<"u"&&t instanceof Date?pt.date:pt.object;default:return pt.unknown}},Be=Sr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
3461d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ru extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let o=n,c=0;for(;c<a.path.length;){const u=a.path[c];c===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(a))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof Ru))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Sr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];r[s]=r[s]||[],r[s].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ru.create=t=>new Ru(t);const SF=(t,e)=>{let r;switch(t.code){case Be.invalid_type:t.received===pt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Be.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Sr.jsonStringifyReplacer)}`;break;case Be.unrecognized_keys:r=`Unrecognized key(s) in object: ${Sr.joinValues(t.keys,", ")}`;break;case Be.invalid_union:r="Invalid input";break;case Be.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Sr.joinValues(t.options)}`;break;case Be.invalid_enum_value:r=`Invalid enum value. Expected ${Sr.joinValues(t.options)}, received '${t.received}'`;break;case Be.invalid_arguments:r="Invalid function arguments";break;case Be.invalid_return_type:r="Invalid function return type";break;case Be.invalid_date:r="Invalid date";break;case Be.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Sr.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Be.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Be.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Be.custom:r="Invalid input";break;case Be.invalid_intersection_types:r="Intersection results could not be merged";break;case Be.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Be.not_finite:r="Number must be finite";break;default:r=e.defaultError,Sr.assertNever(t)}return{message:r}};let WWe=SF;function HWe(){return WWe}const qWe=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function Je(t,e){const r=HWe(),n=qWe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===SF?void 0:SF].filter(i=>!!i)});t.common.issues.push(n)}class Vs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return Vt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r){const s=await i.key,a=await i.value;n.push({key:s,value:a})}return Vs.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Vt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}}const Vt=Object.freeze({status:"aborted"}),Jv=t=>({status:"dirty",value:t}),Fo=t=>
vendor: 33,503 bytes, line 3461
3461({status:"valid",value:t}),xY=t=>t.status==="aborted",bY=t=>t.status==="dirty",Gg=t=>t.status==="valid",TT=t=>typeof Promise<"u"&&t instanceof Promise;var _t;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(_t||(_t={}));class hc{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const wY=(t,e)=>{if(Gg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ru(t.common.issues);return this._error=r,this._error}}};function nr(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:i}}class mr{get description(){return this._def.description}_getType(e){return Ad(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ad(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Vs,ctx:{common:e.parent.common,data:e.data,parsedType:Ad(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(TT(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ad(e)},i=this._parseSync({data:e,path:n.path,parent:n});return wY(n,i)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ad(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return Gg(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Gg(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ad(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(TT(i)?i:Promise.resolve(i));return wY(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:Be.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new qg({schema:this,typeName:Bt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return uf.create(this,this._def)}nullable(){return Yg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ec.create(this)}promise(){return PT.create(this,this._def)}or(e){return ET.create([this,e],this._def)}and(e){return jT.create(this,e,this._def)}transform(e){return new qg({...nr(this._def),schema:this,typeName:Bt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new EF({...nr(this._def),innerType:this,defaultValue:r,typeName:Bt.ZodDefault})}brand(){return new gHe({typeName:Bt.ZodBranded,type:this,...nr(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new jF({...nr(this._def),innerType:this,catchValue:r,typeName:Bt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return LB.create(this,e)}readonly(){return NF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YWe=/^c[^\s-]{8,}$/i,KWe=/^[0-9a-z]+$/,QWe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ZWe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,XWe=/^[a-z0-9_-]{21}$/i,JWe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eHe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tHe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fA;const nHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,aHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oHe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lHe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,afe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cHe=new RegExp(`^${afe}$`);function ofe(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function uHe(t){return new RegExp(`^${ofe(t)}$`)}function dHe(t){let e=`${afe}T${ofe(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function fHe(t,e){return!!((e==="v4"||!e)&&nHe.test(t)||(e==="v6"||!e)&&sHe.test(t))}function hHe(t,e){if(!JWe.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function pHe(t,e){return!!((e==="v4"||!e)&&iHe.test(t)||(e==="v6"||!e)&&aHe.test(t))}class tu extends mr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==pt.string){const s=this._getOrReturnCtx(e);return Je(s,{code:Be.invalid_type,expected:pt.string,received:s.parsedType}),Vt}const n=new Vs;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?Je(i,{code:Be.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&Je(i,{code:Be.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")tHe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"email",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")fA||(fA=new RegExp(rHe,"u")),fA.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"emoji",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ZWe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"uuid",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")XWe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"nanoid",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")YWe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")KWe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"cuid2",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")QWe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"ulid",code:Be.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Je(i,{validation:"url",code:Be.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"regex",code:Be.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?dHe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?cHe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?uHe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?eHe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"duration",code:Be.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?fHe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"ip",code:Be.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?hHe(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"jwt",code:Be.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?pHe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"cidr",code:Be.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?oHe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64",code:Be.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?lHe.test(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{validation:"base64url",code:Be.invalid_string,message:s.message}),n.dirty()):Sr.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:Be.invalid_string,..._t.errToObj(n)})}_addCheck(e){return new tu({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._t.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._t.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._t.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._t.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._t.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._t.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._t.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._t.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._t.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._t.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._t.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._t.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._t.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._t.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,..._t.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",..._t.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,..._t.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,..._t.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,..._t.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,..._t.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,..._t.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,..._t.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,..._t.errToObj(r)})}nonempty(e){return this.min(1,_t.errToObj(e))}trim(){return new tu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new tu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new tu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}tu.create=t=>new tu({checks:[],typeName:Bt.ZodString,coerce:t?.coerce??!1,...nr(t)});function mHe(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class Wg extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==pt.number){const s=this._getOrReturnCtx(e);return Je(s,{code:Be.invalid_type,expected:pt.number,received:s.parsedType}),Vt}let n;const i=new Vs;for(const s of this._def.checks)s.kind==="int"?Sr.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?mHe(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.not_finite,message:s.message}),i.dirty()):Sr.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,_t.toString(r))}gt(e,r){return this.setLimit("min",e,!1,_t.toString(r))}lte(e,r){return this.setLimit("max",e,!0,_t.toString(r))}lt(e,r){return this.setLimit("max",e,!1,_t.toString(r))}setLimit(e,r,n,i){return new Wg({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:_t.toString(i)}]})}_addCheck(e){return new Wg({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_t.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_t.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_t.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_t.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_t.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:_t.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:_t.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_t.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_t.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Sr.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Wg.create=t=>new Wg({checks:[],typeName:Bt.ZodNumber,coerce:t?.coerce||!1,...nr(t)});class gb extends mr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==pt.bigint)return this._getInvalidInput(e);let n;const i=new Vs;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Je(n,{code:Be.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Sr.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Je(r,{code:Be.invalid_type,expected:pt.bigint,received:r.parsedType}),Vt}gte(e,r){return this.setLimit("min",e,!0,_t.toString(r))}gt(e,r){return this.setLimit("min",e,!1,_t.toString(r))}lte(e,r){return this.setLimit("max",e,!0,_t.toString(r))}lt(e,r){return this.setLimit("max",e,!1,_t.toString(r))}setLimit(e,r,n,i){return new gb({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:_t.toString(i)}]})}_addCheck(e){return new gb({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_t.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_t.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_t.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_t.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:_t.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}gb.create=t=>new gb({checks:[],typeName:Bt.ZodBigInt,coerce:t?.coerce??!1,...nr(t)});class kF extends mr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==pt.boolean){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.boolean,received:n.parsedType}),Vt}return Fo(e.data)}}kF.create=t=>new kF({typeName:Bt.ZodBoolean,coerce:t?.coerce||!1,...nr(t)});class CT extends mr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==pt.date){const s=this._getOrReturnCtx(e);return Je(s,{code:Be.invalid_type,expected:pt.date,received:s.parsedType}),Vt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Je(s,{code:Be.invalid_date}),Vt}const n=new Vs;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Be.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Sr.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new CT({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:_t.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:_t.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}CT.create=t=>new CT({checks:[],coerce:t?.coerce||!1,typeName:Bt.ZodDate,...nr(t)});class _Y extends mr{_parse(e){if(this._getType(e)!==pt.symbol){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.symbol,received:n.parsedType}),Vt}return Fo(e.data)}}_Y.create=t=>new _Y({typeName:Bt.ZodSymbol,...nr(t)});class SY extends mr{_parse(e){if(this._getType(e)!==pt.undefined){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.undefined,received:n.parsedType}),Vt}return Fo(e.data)}}SY.create=t=>new SY({typeName:Bt.ZodUndefined,...nr(t)});class kY extends mr{_parse(e){if(this._getType(e)!==pt.null){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.null,received:n.parsedType}),Vt}return Fo(e.data)}}kY.create=t=>new kY({typeName:Bt.ZodNull,...nr(t)});class TY extends mr{constructor(){super(...arguments),this._any=!0}_parse(e){return Fo(e.data)}}TY.create=t=>new TY({typeName:Bt.ZodAny,...nr(t)});class TF extends mr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Fo(e.data)}}TF.create=t=>new TF({typeName:Bt.ZodUnknown,...nr(t)});class Cf extends mr{_parse(e){const r=this._getOrReturnCtx(e);return Je(r,{code:Be.invalid_type,expected:pt.never,received:r.parsedType}),Vt}}Cf.create=t=>new Cf({typeName:Bt.ZodNever,...nr(t)});class CY extends mr{_parse(e){if(this._getType(e)!==pt.undefined){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.void,received:n.parsedType}),Vt}return Fo(e.data)}}CY.create=t=>new CY({typeName:Bt.ZodVoid,...nr(t)});class ec extends mr{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==pt.array)return Je(r,{code:Be.invalid_type,expected:pt.array,received:r.parsedType}),Vt;if(i.exactLength!==null){const a=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(a||o)&&(Je(r,{code:a?Be.too_big:Be.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Je(r,{code:Be.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Je(r,{code:Be.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>i.type._parseAsync(new hc(r,a,r.path,o)))).then(a=>Vs.mergeArray(n,a));const s=[...r.data].map((a,o)=>i.type._parseSync(new hc(r,a,r.path,o)));return Vs.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new ec({...this._def,minLength:{value:e,message:_t.toString(r)}})}max(e,r){return new ec({...this._def,maxLength:{value:e,message:_t.toString(r)}})}length(e,r){return new ec({...this._def,exactLength:{value:e,message:_t.toString(r)}})}nonempty(e){return this.min(1,e)}}ec.create=(t,e)=>new ec({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Bt.ZodArray,...nr(e)});function Wm(t){if(t instanceof oi){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=uf.create(Wm(n))}return new oi({...t._def,shape:()=>e})}else return t instanceof ec?new ec({...t._def,type:Wm(t.element)}):t instanceof uf?uf.create(Wm(t.unwrap())):t instanceof Yg?Yg.create(Wm(t.unwrap())):t instanceof wp?wp.create(t.items.map(e=>Wm(e))):t}class oi extends mr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Sr.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==pt.object){const u=this._getOrReturnCtx(e);return Je(u,{code:Be.invalid_type,expected:pt.object,received:u.parsedType}),Vt}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Cf&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const c=[];for(const u of a){const d=s[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new hc(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Cf){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(Je(i,{code:Be.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new hc(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Vs.mergeObjectSync(n,u)):Vs.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return _t.errToObj,new oi({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:_t.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new oi({...this._def,unknownKeys:"strip"})}passthrough(){return new oi({...this._def,unknownKeys:"passthrough"})}extend(e){return new oi({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new oi({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Bt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new oi({...this._def,catchall:e})}pick(e){const r={};for(const n of Sr.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new oi({...this._def,shape:()=>r})}omit(e){const r={};for(const n of Sr.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new oi({...this._def,shape:()=>r})}deepPartial(){return Wm(this)}partial(e){const r={};for(const n of Sr.objectKeys(this.shape)){const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new oi({...this._def,shape:()=>r})}required(e){const r={};for(const n of Sr.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof uf;)s=s._def.innerType;r[n]=s}return new oi({...this._def,shape:()=>r})}keyof(){return lfe(Sr.objectKeys(this.shape))}}oi.create=(t,e)=>new oi({shape:()=>t,unknownKeys:"strip",catchall:Cf.create(),typeName:Bt.ZodObject,...nr(e)});oi.strictCreate=(t,e)=>new oi({shape:()=>t,unknownKeys:"strict",catchall:Cf.create(),typeName:Bt.ZodObject,...nr(e)});oi.lazycreate=(t,e)=>new oi({shape:t,unknownKeys:"strip",catchall:Cf.create(),typeName:Bt.ZodObject,...nr(e)});class ET extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Ru(o.ctx.common.issues));return Je(r,{code:Be.invalid_union,unionErrors:a}),Vt}if(r.common.async)return Promise.all(n.map(async s=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(c=>new Ru(c));return Je(r,{code:Be.invalid_union,unionErrors:o}),Vt}}get options(){return this._def.options}}ET.create=(t,e)=>new ET({options:t,typeName:Bt.ZodUnion,...nr(e)});function CF(t,e){const r=Ad(t),n=Ad(e);if(t===e)return{valid:!0,data:t};if(r===pt.object&&n===pt.object){const i=Sr.objectKeys(e),s=Sr.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const c=CF(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===pt.array&&n===pt.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],c=CF(a,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===pt.date&&n===pt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class jT extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(s,a)=>
vendor: 4,516 bytes, line 3461
3461{if(xY(s)||xY(a))return Vt;const o=CF(s.value,a.value);return o.valid?((bY(s)||bY(a))&&r.dirty(),{status:r.value,value:o.data}):(Je(n,{code:Be.invalid_intersection_types}),Vt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}jT.create=(t,e,r)=>new jT({left:t,right:e,typeName:Bt.ZodIntersection,...nr(r)});class wp extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.array)return Je(n,{code:Be.invalid_type,expected:pt.array,received:n.parsedType}),Vt;if(n.data.length<this._def.items.length)return Je(n,{code:Be.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Vt;!this._def.rest&&n.data.length>this._def.items.length&&(Je(n,{code:Be.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((a,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new hc(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>Vs.mergeArray(r,a)):Vs.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new wp({...this._def,rest:e})}}wp.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new wp({items:t,typeName:Bt.ZodTuple,rest:null,...nr(e)})};class NT extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.object)return Je(n,{code:Be.invalid_type,expected:pt.object,received:n.parsedType}),Vt;const i=[],s=this._def.keyType,a=this._def.valueType;for(const o in n.data)i.push({key:s._parse(new hc(n,o,n.path,o)),value:a._parse(new hc(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Vs.mergeObjectAsync(r,i):Vs.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof mr?new NT({keyType:e,valueType:r,typeName:Bt.ZodRecord,...nr(n)}):new NT({keyType:tu.create(),valueType:e,typeName:Bt.ZodRecord,...nr(r)})}}class EY extends mr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.map)return Je(n,{code:Be.invalid_type,expected:pt.map,received:n.parsedType}),Vt;const i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([o,c],u)=>({key:i._parse(new hc(n,o,n.path,[u,"key"])),value:s._parse(new hc(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of a){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Vt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of a){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Vt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),o.set(u.value,d.value)}return{status:r.value,value:o}}}}EY.create=(t,e,r)=>new EY({valueType:e,keyType:t,typeName:Bt.ZodMap,...nr(r)});class yb extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==pt.set)return Je(n,{code:Be.invalid_type,expected:pt.set,received:n.parsedType}),Vt;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Je(n,{code:Be.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Je(n,{code:Be.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function a(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Vt;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>s._parse(new hc(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new yb({...this._def,minSize:{value:e,message:_t.toString(r)}})}max(e,r){return new yb({...this._def,maxSize:{value:e,message:_t.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}yb.create=(t,e)=>new yb({valueType:t,minSize:null,maxSize:null,typeName:Bt.ZodSet,...nr(e)});
vendor: 4,190 bytes, line 3461
3461class jY extends mr{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}jY.create=(t,e)=>new jY({getter:t,typeName:Bt.ZodLazy,...nr(e)});class NY extends mr{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Je(r,{received:r.data,code:Be.invalid_literal,expected:this._def.value}),Vt}return{status:"valid",value:e.data}}get value(){return this._def.value}}NY.create=(t,e)=>new NY({value:t,typeName:Bt.ZodLiteral,...nr(e)});function lfe(t,e){return new Hg({values:t,typeName:Bt.ZodEnum,...nr(e)})}class Hg extends mr{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Je(r,{expected:Sr.joinValues(n),received:r.parsedType,code:Be.invalid_type}),Vt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Je(r,{received:r.data,code:Be.invalid_enum_value,options:n}),Vt}return Fo(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Hg.create(e,{...this._def,...r})}exclude(e,r=this._def){return Hg.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Hg.create=lfe;class PY extends mr{_parse(e){const r=Sr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==pt.string&&n.parsedType!==pt.number){const i=Sr.objectValues(r);return Je(n,{expected:Sr.joinValues(i),received:n.parsedType,code:Be.invalid_type}),Vt}if(this._cache||(this._cache=new Set(Sr.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Sr.objectValues(r);return Je(n,{received:n.data,code:Be.invalid_enum_value,options:i}),Vt}return Fo(e.data)}get enum(){return this._def.values}}PY.create=(t,e)=>new PY({values:t,typeName:Bt.ZodNativeEnum,...nr(e)});class PT extends mr{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==pt.promise&&r.common.async===!1)return Je(r,{code:Be.invalid_type,expected:pt.promise,received:r.parsedType}),Vt;const n=r.parsedType===pt.promise?r.data:Promise.resolve(r.data);return Fo(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}PT.create=(t,e)=>new PT({type:t,typeName:Bt.ZodPromise,...nr(e)});class qg extends mr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Bt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{Je(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(n.data,s);if(n.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Vt;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?Vt:c.status==="dirty"||r.value==="dirty"?Jv(c.value):c});{if(r.value==="aborted")return Vt;const o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?Vt:o.status==="dirty"||r.value==="dirty"?Jv(o.value):o}}if(i.type==="refinement"){const a=o=>{const c=i.refinement(o,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Vt:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?Vt:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Gg(a))return Vt;
3461const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Gg(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:r.value,value:o})):Vt);Sr.assertNever(i)}}qg.create=(t,e,r)=>new qg({schema:t,typeName:Bt.ZodEffects,effect:e,...nr(r)});qg.createWithPreprocess=(t,e,r)=>new qg({schema:e,effect:{type:"preprocess",transform:t},typeName:Bt.ZodEffects,...nr(r)});class uf extends mr{_parse(e){return this._getType(e)===pt.undefined?Fo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}uf.create=(t,e)=>new uf({innerType:t,typeName:Bt.ZodOptional,...nr(e)});class Yg extends mr{_parse(e){return this._getType(e)===pt.null?Fo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yg.create=(t,e)=>new Yg({innerType:t,typeName:Bt.ZodNullable,...nr(e)});class EF extends mr{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===pt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}EF.create=(t,e)=>new EF({innerType:t,typeName:Bt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...nr(e)});class jF extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return TT(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ru(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ru(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}jF.create=(t,e)=>new jF({innerType:t,typeName:Bt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...nr(e)});class MY extends mr{_parse(e){if(this._getType(e)!==pt.nan){const n=this._getOrReturnCtx(e);return Je(n,{code:Be.invalid_type,expected:pt.nan,received:n.parsedType}),Vt}return{status:"valid",value:e.data}}}MY.create=t=>new MY({typeName:Bt.ZodNaN,...nr(t)});class gHe extends mr{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class LB extends mr{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Vt:s.status==="dirty"?(r.dirty(),Jv(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Vt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new LB({in:e,out:r,typeName:Bt.ZodPipeline})}}class NF extends mr{_parse(e){const r=this._def.innerType._parse(e),n=i=>(Gg(i)&&(i.value=Object.freeze(i.value)),i);return TT(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}NF.create=(t,e)=>new NF({innerType:t,typeName:Bt.ZodReadonly,...nr(e)});var Bt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Bt||(Bt={}));const un=tu.create,hA=Wg.create,cfe=kF.create,$B=TF.create;Cf.create;const MT=ec.create,fa=oi.create,yHe=ET.create;jT.create;wp.create;const vHe=NT.create,pA=Hg.create;PT.create;uf.create;Yg.create;const xHe=fa({id:un(),email:un().email(),username:un().optional()}).passthrough(),bHe=fa({user:MT(xHe)}),wHe=fa({message:un(),locations:MT(fa({line:hA(),column:hA()})).optional(),path:MT(yHe([un(),hA()])).optional(),extensions:vHe($B()).optional()}),ufe=fa({errors:MT(wHe),data:$B().optional()}),_He=fa({code:un(),message:un(),name:un().optional()});function AT(t){try{return bHe.parse(t).user}catch(e){return console.warn("Failed to parse user query response:",ks(e)),[]}}function SHe(t,e){try{return ufe.parse(t).errors.some(n=>n.message.includes(e))}catch{return!1}}function kHe(t,e="An error occurred"){try{return ufe.parse(t).errors[0]?.message||e}catch{return e}}function PF(t,e){try{return _He.parse(t).code===e}catch{return!1}}async function THe({email:t,refetch:e}){try{const{data:r}=await e({email:t}),n=AT(r);return n.length>0?n[0]:null}catch(r){return console.error("Oops, there was an error while fetching user data:",ks(r)),null}}async function CHe({data:t,refetch:e,onSuccess:r,onError:n,recaptchaToken:i}){try{i&&window.grecaptcha&&await window.grecaptcha.execute(i,{action:"login"});const s=await qFe(ar,t.email,t.password),a=s.user.email;if(!a){n("Authentication succeeded but no email address was found on the account.");return}const o=await THe({email:a,refetch:e});if(!o){n("User not found in database.");return}r(s.user,o)}catch(s){n(GWe(s))}}function EHe(){return{setUser:Gt(t=>t.setUser),setUserHasura:Gt(t=>t.setUserHasura),user:Gt(t=>t.user),userHasura:Gt(t=>t.userHasura)}}function jHe(t){return!!(window.grecaptcha&&t)}const dfe=tt`
3462  mutation CreateUser($input: user_insert_input!) {
3463    insert_user_one(object: $input) {
3464      id
3465      first_name
3466      last_name
3467      email
3468      username
3469      profile_photo_url
3470      stripe_customer_id
3471      is_active
3472      created_at
3473    }
3474  }
3475`,ffe=tt`
3476  mutation UpdateOnboardingState($userId: uuid!, $input: user_set_input!) {
3477    update_user_by_pk(pk_columns: { id: $userId }, _set: $input) {
3478      id
3479      onboarding_state
3480    }
3481  }
3482`,hfe=tt`
3483  mutation UpdateUser($userId: uuid!, $input: user_set_input!) {
3484    update_user_by_pk(pk_columns: { id: $userId }, _set: $input) {
3485      id
3486      first_name
3487      last_name
3488      email
3489      username
3490      birth_date
3491      physical_state_config
3492      updated_at
3493    }
3494  }
3495`,NHe=tt`
3496  mutation UpdateUserProfilePhoto(
3497    $userId: uuid!
3498    $profilePhotoUrl: String!
3499    $updatedAt: timestamptz!
3500  ) {
3501    update_user_by_pk(
3502      pk_columns: { id: $userId }
3503      _set: { profile_photo_url: $profilePhotoUrl, updated_at: $updatedAt }
3504    ) {
3505      id
3506      profile_photo_url
3507      updated_at
3508    }
3509  }
3510`,PHe=tt`
3511  mutation UpdateUserInitialRisk($userId: uuid!, $initialRisk: numeric) {
3512    update_user_by_pk(pk_columns: { id: $userId }, _set: { initial_risk: $initialRisk }) {
3513      id
3514      initial_risk
3515    }
3516  }
3517`;function Ww(){const t="https://mo-backend-1021532931227.us-central1.run.app/api";return t.endsWith("/")?t.slice(0,-1):t}const dj=["1min","5min","15min","30min","60min","1D"],MHe=li({symbol:Mr().min(1,{message:"symbol is required"}).max(10,{message:"symbol must be <= 10 chars"}).transform(t=>t.trim().toUpperCase()),from:cf([Mr(),Li()]).transform(t=>typeof t=="string"?Number.parseInt(t,10):t).refine(t=>Number.isFinite(t),{message:"from must be a valid unix timestamp"}),to:cf([Mr(),Li()]).transform(t=>typeof t=="string"?Number.parseInt(t,10):t).refine(t=>Number.isFinite(t),{message:"to must be a valid unix timestamp"}),resolution:Gw(dj)}).refine(t=>t.from<t.to,{message:"from must be less than to",path:["from"]}),AHe=li({timestamp:Li(),open:Li(),high:Li(),low:Li(),close:Li(),volume:Li()}),DHe=li({bars:Uw(AHe),symbol:Mr(),resolution:Gw(dj),from:yY(),to:yY()}),Hw=async()=>{const t=ar.currentUser,e={};try{if(t?.uid&&(e["x-user-uid"]=t.uid),t){const r=await t.getIdToken();r&&(e.Authorization=`Bearer ${r}`)}if(typeof window<"u"){const r=wde();if(r){const n=await q3e(r,!1);n?.token&&(e["x-firebase-appcheck"]=n.token)}}}catch(r){throw new Error(`Failed to build authentication headers: ${r instanceof Error?r.message:"Unknown error"}`)}return e},OHe=async t=>{const e=MHe.parse({symbol:t.symbol,from:t.from.toString(),to:t.to.toString(),resolution:t.resolution}),n=`${Ww()}/market/candles`,i=new URLSearchParams({symbol:e.symbol,from:e.from.toString(),to:e.to.toString(),resolution:e.resolution}),s=`${n}?${i.toString()}`;try{const a=await Hw(),o=await fetch(s,{headers:a});if(!o.ok){const d=await o.text();throw new Error(`Stock Cloud API error: ${o.status} ${o.statusText}. ${d}`)}const c=await o.json(),u=DHe.safeParse(c.data);if(!u.success)throw new Error(`Invalid response from Stock Cloud API: ${JSON.stringify(u.error.issues)}`);return u.data.bars}catch(a){throw a instanceof Error?new Error(`Failed to fetch stock data from Stock Cloud API: ${a.message}`):new Error("Failed to fetch stock data from Stock Cloud API: Unknown error")}};async function DT(t){const r=`${Ww()}/users/check-identifier`,n=await Hw(),i=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify({value:t})});if(!i.ok){const c=await i.text();throw new Error(`Identifier API error: ${i.status} ${i.statusText}. ${c}`)}const s=await i.json(),o=li({success:wF(),message:Mr(),data:li({exists:wF()})}).safeParse(s);if(!o.success)throw new Error(`Invalid response from Identifier API: ${JSON.stringify(o.error.issues)}`);return o.data.data.exists}function RHe(){const[t]=tj(dfe),{refetch:e}=da($w,{skip:!0});return async(r,n)=>{if(!r?.email)return null;try{await t({variables:{input:{email:r.email,username:n?.username||r.displayName||r.email,first_name:n?.firstName||r.displayName||null,last_name:n?.lastName||null,profile_photo_url:r.photoURL||null,firebase_role_id:r.uid,onboarding_state:"VERIFY_EMAIL"}}});const{data:i}=await e({email:r.email}),s=AT(i);return s.length>0?s[0]:null}catch(i){return console.error(ks(i)),null}}}const IHe=async t=>{let e=0,r=t;for(;e<=20;){const n=await Ug(DT(r));if(!n.ok)return console.error("Error checking username availability:",ks(n.error)),r;if(!n.data)return r;const i=Math.floor(1e5+Math.random()*9e5);r=`${t}${i}`,e++}throw new Error("It was not possible to generate a unique username")};function LHe(t){return t.split("@")[0].replace(/\+.*$/,"").replace(/\./g,"")}async function pfe(t,e,r=10,n=1e3){for(let i=0;i<r;i++)if(await new Promise(s=>setTimeout(s,n)),t&&t.uid&&t.email){const s=await t.getIdTokenResult(!0);if(e){if(s.claims[e])return}else return}throw new Error("Firebase user not ready after maximum attempts")}function $He(){return async t=>{try{const e=new Qc,r=await v5e(t,e);return await pfe(r.user),{user:r.user,credential:r}}catch(e){if(PF(e,"auth/popup-closed-by-user"))throw new Error("Google sign-in was cancelled. Please try again.");if(PF(e,"auth/popup-blocked"))throw new Error("Pop-ups are blocked in your browser. Please enable pop-ups to sign in with Google.");const r=e instanceof Error?e.message:"Google authentication failed";throw new Error(r)}}}function mfe(){const t=$He(),[e]=tj(dfe),{refetch:r}=da($w,{skip:!0});return async n=>{const{auth:i,setUserHasura:s,onError:a}=n;try{const{user:o}=await t(i);if(!o.email)throw new Error("No email provided by Google");const{data:c}=await r({email:o.email}),u=AT(c);if(u.length>0){const y=u[0];return s(y),{user:o,hasuraUser:y}}const d=LHe(o.email),f=await IHe(d);await pfe(o,"https://hasura.io/jwt/claims");let h=null,m=null;for(let y=1;y<=3;y++)try{await e({variables:{input:{email:o.email,username:f,first_name:o.displayName||null,last_name:null,profile_photo_url:o.photoURL||null,firebase_role_id:o.uid,onboarding_state:"SET_PASSWORD"}}});const{data:x}=await r({email:o.email}),v=AT(x);if(v.length>0){h=v[0];break}y<3&&(await o.getIdToken(!0),await new Promise(_=>setTimeout(_,1e3)))}
3517catch(x){if(m=x,SHe(x,"claims key: 'https://hasura.io/jwt/claims' not found")&&y<3){await o.getIdToken(!0),await new Promise(v=>setTimeout(v,1e3));continue}break}if(!h){try{await cue(o)}catch{}const y=kHe(m,"Error creating account. Please try again.");throw a&&a(y,"hasura-error"),new Error(y)}return s(h),{user:o,hasuraUser:h}}catch(o){if(PF(o,"auth/account-exists-with-different-credential")){const u="An account with this email already exists using a different sign-in method.";throw a&&a(u,"hasura-error"),new Error(u)}const c=o instanceof Error?o.message:"Google authentication failed";throw a&&a(c,"unknown-error"),o}}}const AY="6LdVXIUrAAAAAKI5dWv1k_dAAM6w9-7Wr3r4H-p0",FHe=5,DY=3e4,rS="login_locked_until",nS="login_failed_attempts",zHe=Li(),BHe=Li();function VHe(){const[t,e]=b.useState(),[r,n]=b.useState(()=>kT(nS,BHe)??0),[i,s]=b.useState(!1),[a,o]=b.useState(!1),[c,u]=b.useState(()=>{const E=kT(rS,zHe);return E&&E>Date.now()?E:null}),[d,f]=b.useState(0);b.useEffect(()=>{if(!c)return;const E=()=>{const N=Math.max(0,c-Date.now());f(N),N<=0&&(u(null),n(0),Wc(rS,null),Wc(nS,0))};E();const T=setInterval(E,1e3);return()=>clearInterval(T)},[c]);const h=c!==null&&Date.now()<c,{setUser:m,setUserHasura:y}=EHe(),{refetch:x}=da($w,{skip:!0}),v=mfe(),_=b.useCallback(async E=>{if(e(void 0),h){const T=Math.ceil(d/1e3);e(`Too many failed attempts. Please wait ${T}s before trying again.`);return}s(!0);try{if(!jHe(AY)){e("reCAPTCHA not loaded. Please try again later.");return}await CHe({data:E,refetch:x,recaptchaToken:AY,onSuccess:(T,N)=>{m(T),y(N),n(0),Wc(nS,0),Wc(rS,null)},onError:T=>{const N=r+1;if(n(N),Wc(nS,N),N>=FHe){const j=Date.now()+DY;u(j),Wc(rS,j),e(`Too many failed attempts. Login is locked for ${DY/1e3} seconds.`)}else e(T)}})}finally{s(!1)}},[h,d,r,x,m,y]);return{error:t,failedAttempts:r,isEmailLoading:i,isGoogleLoading:a,isLockedOut:h,lockoutRemaining:d,handleEmailLogin:_,handleGoogleLogin:async()=>{e(void 0),o(!0);try{const{user:E}=await v({auth:(await Ps(async()=>{const{auth:T}=await Promise.resolve().then(()=>dVe);return{auth:T}},[])).auth,setUserHasura:y,onError:T=>{e(T)}});m(E),n(0)}catch{console.error("Oops! Something went wrong while logging in with Google")}finally{o(!1)}},clearError:()=>e(void 0)}}const UHe=fa({email:un().min(1,"Email is required").email("Please enter a valid email address"),password:un().min(1,"Password is required")}),GHe=fa({firstName:un().min(1,"First name is required").max(50,"First name must be less than 50 characters"),lastName:un().min(1,"Last name is required").max(50,"Last name must be less than 50 characters"),username:un().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters").regex(/^\w+$/,"Username can only contain letters, numbers, and underscores"),email:un().min(1,"Email is required").email("Please enter a valid email address"),password:un().min(8,"Password must be at least 8 characters").regex(/[a-z]/,"Password must include a lowercase letter").regex(/[A-Z]/,"Password must include an uppercase letter").regex(/\d/,"Password must include a number").regex(/[^a-z0-9]/i,"Password must include a special character"),confirmPassword:un().min(1,"Please confirm your password"),termsAccepted:cfe().refine(t=>t===!0,{message:"You must accept the terms"})}).refine(t=>t.password===t.confirmPassword,{message:"The passwords do not match",path:["confirmPassword"]});fa({email:un().min(1,"Email is required").email("Please enter a valid email address")});const WHe=()=>{const[t,e]=b.useState(!1),{error:r,failedAttempts:n,isEmailLoading:i,isGoogleLoading:s,handleEmailLogin:a,handleGoogleLogin:o,clearError:c}=VHe(),{register:u,handleSubmit:d,formState:{errors:f,isSubmitting:h}}=$o({resolver:xl(UHe),defaultValues:{email:"",password:""}}),m=x=>{c(),a(x)},y=()=>{c(),o()};return b.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),l.jsxs(l.Fragment,{children:[l.jsx(RB,{}),l.jsx(OGe,{open:t,onClose:()=>e(!1)}),l.jsx("div",{className:"min-h-screen bg-app-primary flex items-center justify-center p-4 pt-32 pb-8",children:l.jsxs("div",{className:"max-w-md w-full space-y-8 2k:max-w-3xl 2k:space-y-20 2k:p-16",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"h-10 w-20 mb-2 2k:h-20 2k:w-40"}),l.jsx("h2",{className:"mt-4 text-3xl font-bold text-gray-100 2k:text-6xl",children:"Welcome Back"}),l.jsx("p",{className:"mt-2 text-gray-400 2k:text-2xl",children:"Sign in to continue to your dashboard"})]}),l.jsxs(ye,{type:"button",onClick:y,disabled:s||h,variant:"accent",className:"w-full 2k:h-16 2k:text-2xl",children:[s?l.jsx(No,{className:"w-5 h-5 animate-spin"}):l.jsx("img",{src:"/google.svg",alt:"Google",className:"w-5 h-5"}),s?"Signing in with Google…":"Sign in with Google"]}),l.jsxs("p",{className:"mt-2 mb-2 text-sm text-gray-400 text-center 2k:text-xl",children:["By continuing you agree to all the specified in our"," ",l.jsx("a",{href:"/docs/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"text-app-button-bg-active hover:underline",children:"Terms of use"})]}),l.jsxs("div",{className:"flex items-center gap-2 my-2",children:[l.jsx("div",{className:"flex-1 h-px bg-gray-800"}),l.jsx("span",{className:"text-gray-500 text-xs 2k:text-lg",children:"or"}),l.jsx("div",{className:"flex-1 h-px bg-gray-800"})]}),l.jsxs("form",{onSubmit:d(m),className:"space-y-6 2k:space-y-12",children:[r&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2 2k:text-xl",children:[l.jsx(Ts,{size:16}),l.jsx("span",{children:r})]}),l.jsx(tn,{label:"Email",icon:fp,error:f.email?.message,children:l.jsx(Wr,{...u("email"),type:"email",hasIcon:!0,placeholder:"[email protected]",autoComplete:"email",className:"2k:h-16 2k:text-2xl"})}),l.jsx(tn,{label:"Password",icon:xs,error:f.password?.message,children:l.jsx(Wr,{...u("password"),type:"password",hasIcon:!0,placeholder:"••••••••",autoComplete:"current-password",className:"2k:h-16 2k:text-2xl"})}),l.jsxs(ye,{type:"submit",size:"lg",disabled:i||h,className:"w-full 2k:h-16 2k:text-2xl",children:[i||h&&l.jsx(No,{className:"w-4 h-4 animate-spin mr-2"}),i||h?"Signing in…":"Sign In"]}),l.jsx("button",{type:"button",className:"mt-4 text-app-text-accent underline hover:text-app-text-accent/80 transition-colors 2k:text-xl",onClick:()=>e(!0),children:"Forgot password?"}),n>=4&&l.jsx("div",{className:"text-red-500 rounded-lg p-3 text-sm bg-red-500/10 border border-red-500 2k:text-xl",children:l.jsxs("span",{children:["For further information please contact support at"," ",l.jsx("strong",{children:"[email protected]"})]})})]})]})})]})},FB=YHe();function en(t,...e){if(!FB)return;const r=qHe(t,...e);performance.mark(r);try{console.log(t,...e)}catch{console.log(r)}}function HHe(t,...e){FB&&console.warn(t,...e)}function qHe(t,...e){return t.replace(/%[sfdO]/g,r=>{const n=e.shift();return r==="%O"&&n?JSON.stringify(n).replace(/"([^"]+)":/g,"$1:"):String(n)})}function YHe(){try{const t="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(t,t);const e=localStorage.getItem(t)===t;return localStorage.removeItem(t),e&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const KHe={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cac
3517he. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Xy(t){return`[nuqs] ${KHe[t]}
3518  See https://err.47ng.com/NUQS-${t}`}function QHe(t){if(t.size===0)return"";const e=[];for(const[n,i]of t.entries()){const s=n.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");e.push(`${s}=${ZHe(i)}`)}return"?"+e.join("&")}function ZHe(t){return t.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}const _p=b.createContext({useAdapter(){throw new Error(Xy(404))}});_p.displayName="NuqsAdapterContext";FB&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==_p&&console.error(Xy(303)),window.__NuqsAdapterContext=_p);function XHe(t){return({children:e,defaultOptions:r,processUrlSearchParams:n,...i})=>b.createElement(_p.Provider,{...i,value:{useAdapter:t,defaultOptions:r,processUrlSearchParams:n}},e)}function JHe(t){const e=b.useContext(_p);if(!("useAdapter"in e))throw new Error(Xy(404));return e.useAdapter(t)}const e8e=()=>b.useContext(_p).defaultOptions,t8e=()=>b.useContext(_p).processUrlSearchParams;function r8e(){if(typeof window>"u"||!!!window.GestureEvent)return 50;try{const e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function n8e(t){return{method:"throttle",timeMs:t}}const Ex=n8e(r8e());function zB(){const t=new Map;return{all:t,on(e,r){const n=t.get(e)||[];return n.push(r),t.set(e,n),()=>this.off(e,r)},off(e,r){const n=t.get(e);n&&t.set(e,n.filter(i=>i!==r))},emit(e,r){t.get(e)?.forEach(i=>i(r))}}}function MF(t,e,r){function n(){t(),r.removeEventListener("abort",s)}const i=setTimeout(n,e);function s(){clearTimeout(i),r.removeEventListener("abort",s)}r.addEventListener("abort",s)}function AF(){const t=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let e=()=>{},r=()=>{};return{promise:new t((i,s)=>{e=i,r=s}),resolve:e,reject:r}}function i8e(t,e){let r=e;for(let n=t.length-1;n>=0;n--){const i=t[n];if(!i)continue;const s=r;r=()=>i(s)}r()}function gfe(){return new URLSearchParams(location.search)}var yfe=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=Ex.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;push({key:t,query:e,options:r},n=Ex.timeMs){en("[nuqs gtq] Enqueueing %s=%s %O",t,e,r),this.updateMap.set(t,e),r.history==="push"&&(this.options.history="push"),r.scroll&&(this.options.scroll=!0),r.shallow===!1&&(this.options.shallow=!1),r.startTransition&&this.transitions.add(r.startTransition),(!Number.isFinite(this.timeMs)||n>this.timeMs)&&(this.timeMs=n)}getQueuedQuery(t){return this.updateMap.get(t)}flush({getSearchParamsSnapshot:t=gfe,rateLimitFactor:e=1,...r}
3518,n){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return en("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(t());if(this.resolvers)return this.resolvers.promise;this.resolvers=AF();const i=()=>{this.lastFlushedAt=performance.now();const[a,o]=this.applyPendingUpdates({...r,autoResetQueueOnUpdate:r.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:t},n);o===null?this.resolvers.resolve(a):this.resolvers.reject(a),this.resolvers=null};return MF(()=>{const o=performance.now()-this.lastFlushedAt,c=this.timeMs,u=e*Math.max(0,c-o);en("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",u,c,e),u===0?i():MF(i,u,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const t=Array.from(this.updateMap.keys());return en("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=Ex.timeMs,t}applyPendingUpdates(t,e){const{updateUrl:r,getSearchParamsSnapshot:n}=t;let i=n();if(en("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const s=Array.from(this.updateMap.entries()),a={...this.options},o=Array.from(this.transitions);t.autoResetQueueOnUpdate&&this.reset(),en("[nuqs gtq] Flushing queue %O with options %O",s,a);for(const[c,u]of s)u===null?i.delete(c):i.set(c,u);e&&(i=e(i));try{return i8e(o,()=>{r(i,a)}),[i,null]}catch(c){return console.error(Xy(429),s.map(([u])=>u).join(),c),[i,c]}}};const vb=new yfe;function s8e(t,e,r){const n=b.useCallback(()=>{const a=Object.fromEntries(t.map(c=>[c,r(c)]));return[JSON.stringify(a),a]},[t.join(","),r]),i=b.useRef(null);i.current===null&&(i.current=n());const s=b.useCallback(a=>{const o=t.map(c=>e(c,a));return()=>o.forEach(c=>c())},[t.join(","),e]);return b.useSyncExternalStore(s,()=>{const[a,o]=n();return i.current[0]===a?i.current[1]:(i.current=[a,o],o)},()=>i.current[1])}var a8e=class{callback;resolvers=AF();controller=new AbortController;queuedValue=void 0;constructor(t){this.callback=t}abort(){this.controller.abort(),this.queuedValue=void 0}push(t,e){return this.queuedValue=t,this.controller.abort(),this.controller=new AbortController,MF(()=>{const r=this.resolvers;try{en("[nuqs dq] Flushing debounce queue",t);const n=this.callback(t);en("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=AF(),n.then(i=>r.resolve(i)).catch(i=>r.reject(i))}catch(n){this.queuedValue=void 0,r.reject(n)}},e,this.controller.signal),this.resolvers.promise}},o8e=class{throttleQueue;queues=new Map;queuedQuerySync=zB();constructor(t=new yfe){this.throttleQueue=t}useQueuedQueries(t){return s8e(t,(e,r)=>this.queuedQuerySync.on(e,r),e=>this.getQueuedQuery(e))}push(t,e,r){if(!Number.isFinite(e)){const s=r.getSearchParamsSnapshot??gfe;return Promise.resolve(s())}const n=t.key;if(!this.queues.has(n)){en("[nuqs dqc] Creating debounce queue for `%s`",n);const s=new a8e(a=>(this.throttleQueue.push(a),this.throttleQueue.flush(r).finally(()=>{this.queues.get(a.key)?.queuedValue===void 0&&(en("[nuqs dqc] Cleaning up empty queue for `%s`",a.key),this.queues.delete(a.key)),this.queuedQuerySync.emit(a.key)})));this.queues.set(n,s)}en("[nuqs dqc] Enqueueing debounce update %O",t);const i=this.queues.get(n).push(t,e);return this.queuedQuerySync.emit(n),i}abort(t){const e=this.queues.get(t);return e?(en("[nuqs dqc] Aborting debounce queue %s=%s",t,e.queuedValue?.query),this.queues.delete(t),e.abort(),this.queuedQuerySync.emit(t),r=>(r.then(e.resolvers.resolve,e.resolvers.reject),r)):r=>r}abortAll(){for(const[t,e]of this.queues.entries())en("[nuqs dqc] Aborting debounce queue %s=%s",t,e.queuedValue?.query),e.abort(),e.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(t){const e=this.queues.get(t)?.queuedValue?.query;return e!==void 0?e:this.throttleQueue.getQueuedQuery(t)}};const jx=new o8e(vb);function OY(t,e,r){return n=>{if(!(e.length===0?!0:e.some(a=>n.get(a)!==t.get(a))))return en("[nuqs `%s`] no change, returning previous",e.join(","),n),n;const s=DF(t,e,r);return en("[nuqs `%s`] subbed search params change\n  from %O\n  to   %O",e.join(","),n,s),s}}function DF(t,e,r){if(e.length===0)return t;const n=r?new URLSearchParams(t):t;for(const i of t.keys())e.includes(i)||n.delete(i);return n}let Ek=0;function l8e(t=1){Ek=t}function c8e(){Ek=Math.max(0,Ek-1),!(Ek>0)&&vfe()}function vfe(){en("[nuqs] Aborting queues"),jx.abortAll(),vb.abort().forEac
3518h(e=>jx.queuedQuerySync.emit(e))}const OF="__nuqs__";function u8e(t){if(t instanceof URL)return t.searchParams;if(t.startsWith("?"))return new URLSearchParams(t);try{return new URL(t,location.origin).searchParams}catch{return new URLSearchParams(t)}}function d8e(t){return typeof history>"u"?!1:history.nuqs?.version&&history.nuqs.version!=="0.0.0-inject-version-here"?(console.error(Xy(409),history.nuqs.version,"0.0.0-inject-version-here",t),!1):!history.nuqs?.adapters?.includes(t)}function f8e(t){history.nuqs=history.nuqs??{version:"0.0.0-inject-version-here",adapters:[]},history.nuqs.adapters.push(t)}function h8e(t,e){if(!d8e(e))return;let r=typeof location=="object"?location.search:"";t.on("update",a=>{const o=a.toString();r=o.length?"?"+o:""}),window.addEventListener("popstate",()=>{r=location.search,vfe()}),en("[nuqs %s] Patching history (%s adapter)","0.0.0-inject-version-here",e);function n(a){c8e();try{if(new URL(a,location.origin).search===r)return}catch{}try{t.emit("update",u8e(a))}catch(o){console.error(o)}}const i=history.pushState,s=history.replaceState;history.pushState=function(o,c,u){i.call(history,o,"",u),u&&c!==OF&&n(u)},history.replaceState=function(o,c,u){s.call(history,o,"",u),u&&c!==OF&&n(u)},f8e(e)}function p8e({adapter:t,useNavigate:e,useSearchParams:r}){const n=zB(),i=t!=="react-router-v6";function s(o){const c=b.useRef(!1);c.current&&(c.current=!1,vb.reset());const u=e(),d=a(o),f=b.useCallback((h,m)=>{b.startTransition(()=>{n.emit("update",h)});const y=new URL(location.href);y.search=QHe(h),en(`[nuqs ${t}] Updating url: %s`,y);const x=m.history==="push"?history.pushState:history.replaceState;l8e(m.shallow?1:2),x.call(history,history.state,OF,y),m.shallow===!1&&u({hash:y.hash,search:y.search},{replace:!0,preventScrollReset:!0,state:history.state?.usr}),m.scroll&&window.scrollTo(0,0),c.current=i},[u]);return{searchParams:d,updateUrl:f,autoResetQueueOnUpdate:!1}}function a(o=[]){const[c]=r(typeof location>"u"?new URLSearchParams:new URLSearchParams(location.search)),[u,d]=b.useState(()=>typeof location>"u"?DF(c,o,!0):DF(new URLSearchParams(location.search),o,!1));return b.useEffect(()=>{function f(){d(OY(new URLSearchParams(location.search),o,!1))}function h(m){d(OY(m,o,!0))}return n.on("update",h),window.addEventListener("popstate",f),()=>{n.off("update",h),window.removeEventListener("popstate",f)}},[o.join("&")]),u}return h8e(n,t),{NuqsAdapter:XHe(s),useOptimisticSearchParams:a}}const m8e=p8e({adapter:"react-router-v7",useNavigate:Ws,useSearchParams:aoe}),g8e=m8e.NuqsAdapter;var y8e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vt=y8e.reduce((t,e)=>{const r=kf(`Primitive.${e}`),n=b.forwardRef((i,s)=>{const{asChild:a,...o}=i,c=a?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function xfe(t,e){t&&bc.flushSync(()=>t.dispatchEvent(e))}var v8e="Separator",RY="horizontal",x8e=["horizontal","vertical"],bfe=b.forwardRef((t,e)=>{const{decorative:r,orientation:n=RY,...i}=t,s=b8e(n)?n:RY,o=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(vt.div,{"data-orientation":s,...o,...i,ref:e})});bfe.displayName=v8e;function b8e(t){return x8e.includes(t)}var w8e=bfe;const tc=b.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},i)=>l.jsx(w8e,{ref:i,"data-slot":"separator",decorative:r,orientation:e,className:Pe("bg-app-border-color-soft shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px rounded-full",t),...n}));tc.displayName="Separator";function He(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t?.(i),r===!1||!i.defaultPrevented)return e?.(i)}}function _8e(t,e){const r=b.createContext(e),n=s=>{const{children:a,...o}=s,c=b.useMemo(()=>o,Object.values(o));return l.jsx(r.Provider,{value:c,children:a})};n.displayName=t+"Provider";function i(s){const a=b.useContext(r);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[n,i]}function ma(t,e=[]){let r=[];function n(s,a){const o=b.createContext(a),c=r.length;r=[...r,a];const u=f=>{const{scope:h,children:m,...y}=f,x=h?.[t]?.[c]||o,v=b.useMemo(()=>y,Object.values(y));return l.jsx(x.Provider,{value:v,children:m})};u.displayName=s+"Provider";function d(f,h){const m=h?.[t]?.[c]||o,y=b.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=r.map(a=>b.createContext(a));return function(o){const c=o?.[t]||s;return b.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return i.scopeName=t,[n,S8e(i,...e)]}function S8e(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=n.reduce((o,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...o,...f}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}
vendor: 6,398 bytes, line 3518
3518),[a])}};return r.scopeName=e.scopeName,r}var rs=globalThis?.document?b.useLayoutEffect:()=>{},k8e=xf[" useId ".trim().toString()]||(()=>{}),T8e=0;function ts(t){const[e,r]=b.useState(k8e());return rs(()=>{r(n=>n??String(T8e++))},[t]),e?`radix-${e}`:""}var C8e=xf[" useInsertionEffect ".trim().toString()]||rs;function Ao({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[i,s,a]=E8e({defaultProp:e,onChange:r}),o=t!==void 0,c=o?t:i;{const d=b.useRef(t!==void 0);b.useEffect(()=>{const f=d.current;f!==o&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${o?"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.`),d.current=o},[o,n])}const u=b.useCallback(d=>{if(o){const f=j8e(d)?d(t):d;f!==t&&a.current?.(f)}else s(d)},[o,t,s,a]);return[c,u]}function E8e({defaultProp:t,onChange:e}){const[r,n]=b.useState(t),i=b.useRef(r),s=b.useRef(e);return C8e(()=>{s.current=e},[e]),b.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,n,s]}function j8e(t){return typeof t=="function"}function Ki(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...r)=>e.current?.(...r),[])}function N8e(t,e=globalThis?.document){const r=Ki(t);b.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var P8e="DismissableLayer",RF="dismissableLayer.update",M8e="dismissableLayer.pointerDownOutside",A8e="dismissableLayer.focusOutside",IY,wfe=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jy=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...c}=t,u=b.useContext(wfe),[d,f]=b.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=b.useState({}),y=Kt(e,j=>f(j)),x=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(v),S=d?x.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,T=R8e(j=>{const M=j.target,O=[...u.branches].some(R=>R.contains(M));!E||O||(i?.(j),a?.(j),j.defaultPrevented||o?.())},h),N=I8e(j=>{const M=j.target;[...u.branches].some(R=>R.contains(M))||(s?.(j),a?.(j),j.defaultPrevented||o?.())},h);return N8e(j=>{S===u.layers.size-1&&(n?.(j),!j.defaultPrevented&&o&&(j.preventDefault(),o()))},h),b.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(IY=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LY(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=IY)}},[d,h,r,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LY())},[d,u]),b.useEffect(()=>{const j=()=>m({});return document.addEventListener(RF,j),()=>document.removeEventListener(RF,j)},[]),l.jsx(vt.div,{...c,ref:y,style:{pointerEvents:k?E?"auto":"none":void 0,...t.style},onFocusCapture:He(t.onFocusCapture,N.onFocusCapture),onBlurCapture:He(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:He(t.onPointerDownCapture,T.onPointerDownCapture)})});Jy.displayName=P8e;var D8e="DismissableLayerBranch",O8e=b.forwardRef((t,e)=>{const r=b.useContext(wfe),n=b.useRef(null),i=Kt(e,n);return b.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),l.jsx(vt.div,{...t,ref:i})});O8e.displayName=D8e;function R8e(t,e=globalThis?.document){const r=Ki(t),n=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const s=o=>{if(o.target&&!n.current){let c=function(){_fe(M8e,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function I8e(t,e=globalThis?.document){const r=Ki(t),n=b.useRef(!1);return b.useEffect(()=>{const i=s=>{s.target&&!n.current&&_fe(A8e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function LY(){const t=new CustomEvent(RF);document.dispatchEvent(t)}function _fe(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?xfe(i,s):i.dispatchEvent(s)}var mA="focusScope.autoFocusOnMount",gA="focusScope.autoFocusOnUnmount",$Y={bubbles:!1,cancelable:!0},L8e="FocusScope",qw=b.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[o,c]=b.useState(null),u=Ki(i),d=Ki(s),f=b.useRef(null),h=Kt(e,x=>c(x)),m=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let x=function(k){if(m.paused||!o)return;const E=k.target;o.contains(E)?f.current=E:Nd(f.current,{select:!0})},v=function(k){if(m.paused||!o)return;const E=k.relatedTarget;E!==null&&(o.contains(E)||Nd(f.current,{select:!0}))},_=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&Nd(o)};document.addEventListener("focusin",x),document.addEventListener("focusout",v);const S=new MutationObserver(_);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",v),S.disconnect()}}},[n,o,m.paused]),b.useEffect(()=>{if(o){zY.add(m);const x=document.activeElement;if(!o.contains(x)){const _=new CustomEvent(mA,$Y);o.addEventListener(mA,u),o.dispatchEvent(_),_.defaultPrevented||($8e(U8e(Sfe(o)),{select:!0}),document.activeElement===x&&Nd(o))}return()=>{o.removeEventListener(mA,u),setTimeout(()=>{const _=new CustomEvent(gA,$Y);o.addEventListener(gA,d),o.dispatchEvent(_),_.defaultPrevented||Nd(x??document.body,{select:!0}),o.removeEventListener(gA,d),zY.remove(m)},0)}}},[o,u,d,m]);const y=b.useCallback(x=>{if(!r&&!n||m.paused)return;
vendor: 4,153 bytes, line 3518
3518const v=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,_=document.activeElement;if(v&&_){const S=x.currentTarget,[k,E]=F8e(S);k&&E?!x.shiftKey&&_===E?(x.preventDefault(),r&&Nd(k,{select:!0})):x.shiftKey&&_===k&&(x.preventDefault(),r&&Nd(E,{select:!0})):_===S&&x.preventDefault()}},[r,n,m.paused]);return l.jsx(vt.div,{tabIndex:-1,...a,ref:h,onKeyDown:y})});qw.displayName=L8e;function $8e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Nd(n,{select:e}),document.activeElement!==r)return}function F8e(t){const e=Sfe(t),r=FY(e,t),n=FY(e.reverse(),t);return[r,n]}function Sfe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function FY(t,e){for(const r of t)if(!z8e(r,{upTo:e}))return r}function z8e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function B8e(t){return t instanceof HTMLInputElement&&"select"in t}function Nd(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&B8e(t)&&e&&t.select()}}var zY=V8e();function V8e(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=BY(t,e),t.unshift(e)},remove(e){t=BY(t,e),t[0]?.resume()}}}function BY(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function U8e(t){return t.filter(e=>e.tagName!=="A")}var G8e="Portal",e0=b.forwardRef((t,e)=>{const{container:r,...n}=t,[i,s]=b.useState(!1);rs(()=>s(!0),[]);const a=r||i&&globalThis?.document?.body;return a?VE.createPortal(l.jsx(vt.div,{...n,ref:e}),a):null});e0.displayName=G8e;function W8e(t,e){return b.useReducer((r,n)=>e[r][n]??r,t)}var $i=t=>{const{present:e,children:r}=t,n=H8e(e),i=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),s=Kt(n.ref,q8e(i));return typeof r=="function"||n.isPresent?b.cloneElement(i,{ref:s}):null};$i.displayName="Presence";function H8e(t){const[e,r]=b.useState(),n=b.useRef(null),i=b.useRef(t),s=b.useRef("none"),a=t?"mounted":"unmounted",[o,c]=W8e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=iS(n.current);s.current=o==="mounted"?u:"none"},[o]),rs(()=>{const u=n.current,d=i.current;if(d!==t){const h=s.current,m=iS(u);t?c("MOUNT"):m==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),rs(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=m=>{const x=iS(n.current).includes(CSS.escape(m.animationName));if(m.target===e&&x&&(c("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},h=m=>{m.target===e&&(s.current=iS(n.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:b.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function iS(t){return t?.animationName||"none"}function q8e(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var yA=0;function fj(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??VY()),document.body.insertAdjacentElement("beforeend",t[1]??VY()),yA++,()=>{yA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,133 bytes, lines 3518-3533
3518=>e.remove()),yA--}},[])}function VY(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var jk="right-scroll-bar-position",Nk="width-before-scroll-bar",Y8e="with-scroll-bars-hidden",K8e="--removed-body-scroll-bar-size";function vA(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Q8e(t,e){var r=b.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}var Z8e=typeof window<"u"?b.useLayoutEffect:b.useEffect,UY=new WeakMap;function X8e(t,e){var r=Q8e(null,function(n){return t.forEach(function(i){return vA(i,n)})});return Z8e(function(){var n=UY.get(r);if(n){var i=new Set(n),s=new Set(t),a=r.current;i.forEach(function(o){s.has(o)||vA(o,null)}),s.forEach(function(o){i.has(o)||vA(o,a)})}UY.set(r,t)},[t]),r}function J8e(t){return t}function eqe(t,e){e===void 0&&(e=J8e);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var a=e(s,n);return r.push(a),function(){r=r.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(n=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(o){return s(o)},filter:function(){return r}}},assignMedium:function(s){n=!0;var a=[];if(r.length){var o=r;r=[],o.forEach(s),a=r}var c=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return i}function tqe(t){t===void 0&&(t={});var e=eqe(null);return e.options=yo({async:!0,ssr:!1},t),e}var kfe=function(t){var e=t.sideCar,r=mw(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,yo({},r))};kfe.isSideCarExport=!0;function rqe(t,e){return t.useMedium(e),kfe}var Tfe=tqe(),xA=function(){},hj=b.forwardRef(function(t,e){var r=b.useRef(null),n=b.useState({onScrollCapture:xA,onWheelCapture:xA,onTouchMoveCapture:xA}),i=n[0],s=n[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,y=t.noIsolation,x=t.inert,v=t.allowPinchZoom,_=t.as,S=_===void 0?"div":_,k=t.gapMode,E=mw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,N=X8e([r,e]),j=yo(yo({},E),i);return b.createElement(b.Fragment,null,d&&b.createElement(T,{sideCar:Tfe,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:x,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:k}),a?b.cloneElement(b.Children.only(o),yo(yo({},j),{ref:N})):b.createElement(S,yo({},j,{className:c,ref:N}),o))});hj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hj.classNames={fullWidth:Nk,zeroRight:jk};var nqe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iqe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=nqe();return e&&t.setAttribute("nonce",e),t}function sqe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function aqe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var oqe=function(){var t=0,e=null;return{add:function(r){t==0&&(e=iqe())&&(sqe(e,r),aqe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},lqe=function(){var t=oqe();return function(e,r){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Cfe=function(){var t=lqe(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},cqe={left:0,top:0,right:0,gap:0},bA=function(t){return parseInt(t||"",10)||0},uqe=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[bA(r),bA(n),bA(i)]},dqe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return cqe;var e=uqe(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},fqe=Cfe(),Sg="data-scroll-locked",hqe=function(t,e,r,n){var i=t.left,s=t.top,a=t.right,o=t.gap;return r===void 0&&(r="margin"),`
3519  .`.concat(Y8e,` {
3520   overflow: hidden `).concat(n,`;
3521   padding-right: `).concat(o,"px ").concat(n,`;
3522  }
3523  body[`).concat(Sg,`] {
3524    overflow: hidden `).concat(n,`;
3525    overscroll-behavior: contain;
3526    `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
3527    padding-left: `.concat(i,`px;
3528    padding-top: `).concat(s,`px;
3529    padding-right: `).concat(a,`px;
3530    margin-left:0;
3531    margin-top:0;
3532    margin-right: `).concat(o,"px ").concat(n,`;
3533    `),r==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";
3533")].filter(Boolean).join(""),`
3534  }
3535  
3536  .`).concat(jk,` {
3537    right: `).concat(o,"px ").concat(n,`;
3538  }
3539  
3540  .`).concat(Nk,` {
3541    margin-right: `).concat(o,"px ").concat(n,`;
3542  }
3543  
3544  .`).concat(jk," .").concat(jk,` {
3545    right: 0 `).concat(n,`;
3546  }
3547  
3548  .`).concat(Nk," .").concat(Nk,` {
3549    margin-right: 0 `).concat(n,`;
3550  }
3551  
3552  body[`).concat(Sg,`] {
3553    `).concat(K8e,": ").concat(o,`px;
3554  }
3555`)},GY=function(){var t=parseInt(document.body.getAttribute(Sg)||"0",10);return isFinite(t)?t:0},pqe=function(){b.useEffect(function(){return document.body.setAttribute(Sg,(GY()+1).toString()),function(){var t=GY()-1;t<=0?document.body.removeAttribute(Sg):document.body.setAttribute(Sg,t.toString())}},[])},mqe=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;pqe();var s=b.useMemo(function(){return dqe(i)},[i]);return b.createElement(fqe,{styles:hqe(s,!e,i,r?"":"!important")})},IF=!1;if(typeof window<"u")try{var sS=Object.defineProperty({},"passive",{get:function(){return IF=!0,!0}});window.addEventListener("test",sS,sS),window.removeEventListener("test",sS,sS)}catch{IF=!1}var Am=IF?{passive:!1}:!1,gqe=function(t){return t.tagName==="TEXTAREA"},Efe=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!gqe(t)&&r[e]==="visible")},yqe=function(t){return Efe(t,"overflowY")},vqe=function(t){return Efe(t,"overflowX")},WY=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=jfe(t,n);if(i){var s=Nfe(t,n),a=s[1],o=s[2];if(a>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},xqe=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},bqe=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},jfe=function(t,e){return t==="v"?yqe(e):vqe(e)},Nfe=function(t,e){return t==="v"?xqe(e):bqe(e)},wqe=function(t,e){return t==="h"&&e==="rtl"?-1:1},_qe=function(t,e,r,n,i){var s=wqe(t,window.getComputedStyle(e).direction),a=s*n,o=r.target,c=e.contains(o),u=!1,d=a>0,f=0,h=0;do{if(!o)break;var m=Nfe(t,o),y=m[0],x=m[1],v=m[2],_=x-v-s*y;(y||_)&&jfe(t,o)&&(f+=_,h+=y);var S=o.parentNode;o=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},aS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},HY=function(t){return[t.deltaX,t.deltaY]},qY=function(t){return t&&"current"in t?t.current:t},Sqe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},kqe=function(t){return`
3556  .block-interactivity-`.concat(t,` {pointer-events: none;}
3557  .allow-interactivity-`).concat(t,` {pointer-events: all;}
3558`)},Tqe=0,Dm=[];function Cqe(t){var e=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),i=b.useState(Tqe++)[0],s=b.useState(Cfe)[0],a=b.useRef(t);b.useEffect(function(){a.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=op([t.lockRef.current],(t.shards||[]).map(qY),!0).filter(Boolean);return x.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=b.useCallback(function(x,v){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var _=aS(x),S=r.current,k="deltaX"in x?x.deltaX:S[0]-_[0],E="deltaY"in x?x.deltaY:S[1]-_[1],T,N=x.target,j=Math.abs(k)>Math.abs(E)?"h":"v";if("touches"in x&&j==="h"&&N.type==="range")return!1;var M=WY(j,N);if(!M)return!0;if(M?T=j:(T=j==="v"?"h":"v",M=WY(j,N)),!M)return!1;if(!n.current&&"changedTouches"in x&&(k||E)&&(n.current=T),!T)return!0;var O=n.current||T;return _qe(O,v,x,O==="h"?k:E)},[]),c=b.useCallback(function(x){var v=x;if(!(!Dm.length||Dm[Dm.length-1]!==s)){var _="deltaY"in v?HY(v):aS(v),S=e.current.filter(function(T){return T.name===v.type&&(T.target===v.target||v.target===T.shadowParent)&&Sqe(T.delta,_)}
vendor: 6,356 bytes, line 3558
3558)[0];if(S&&S.should){v.cancelable&&v.preventDefault();return}if(!S){var k=(a.current.shards||[]).map(qY).filter(Boolean).filter(function(T){return T.contains(v.target)}),E=k.length>0?o(v,k[0]):!a.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),u=b.useCallback(function(x,v,_,S){var k={name:x,delta:v,target:_,should:S,shadowParent:Eqe(_)};e.current.push(k),setTimeout(function(){e.current=e.current.filter(function(E){return E!==k})},1)},[]),d=b.useCallback(function(x){r.current=aS(x),n.current=void 0},[]),f=b.useCallback(function(x){u(x.type,HY(x),x.target,o(x,t.lockRef.current))},[]),h=b.useCallback(function(x){u(x.type,aS(x),x.target,o(x,t.lockRef.current))},[]);b.useEffect(function(){return Dm.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Am),document.addEventListener("touchmove",c,Am),document.addEventListener("touchstart",d,Am),function(){Dm=Dm.filter(function(x){return x!==s}),document.removeEventListener("wheel",c,Am),document.removeEventListener("touchmove",c,Am),document.removeEventListener("touchstart",d,Am)}},[]);var m=t.removeScrollBar,y=t.inert;return b.createElement(b.Fragment,null,y?b.createElement(s,{styles:kqe(i)}):null,m?b.createElement(mqe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Eqe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const jqe=rqe(Tfe,Cqe);var Yw=b.forwardRef(function(t,e){return b.createElement(hj,yo({},t,{ref:e,sideCar:jqe}))});Yw.classNames=hj.classNames;var Nqe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Om=new WeakMap,oS=new WeakMap,lS={},wA=0,Pfe=function(t){return t&&(t.host||Pfe(t.parentNode))},Pqe=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Pfe(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Mqe=function(t,e,r,n){var i=Pqe(e,Array.isArray(t)?t:[t]);lS[r]||(lS[r]=new WeakMap);var s=lS[r],a=[],o=new Set,c=new Set(i),u=function(f){!f||o.has(f)||(o.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(o.has(h))d(h);else try{var m=h.getAttribute(n),y=m!==null&&m!=="false",x=(Om.get(h)||0)+1,v=(s.get(h)||0)+1;Om.set(h,x),s.set(h,v),a.push(h),x===1&&y&&oS.set(h,!0),v===1&&h.setAttribute(r,"true"),y||h.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return d(e),o.clear(),wA++,function(){a.forEach(function(f){var h=Om.get(f)-1,m=s.get(f)-1;Om.set(f,h),s.set(f,m),h||(oS.has(f)||f.removeAttribute(n),oS.delete(f)),m||f.removeAttribute(r)}),wA--,wA||(Om=new WeakMap,Om=new WeakMap,oS=new WeakMap,lS={})}},pj=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=Nqe(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),Mqe(n,i,r,"aria-hidden")):function(){return null}},mj="Dialog",[Mfe]=ma(mj),[Aqe,bl]=Mfe(mj),Afe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,o=b.useRef(null),c=b.useRef(null),[u,d]=Ao({prop:n,defaultProp:i??!1,onChange:s,caller:mj});return l.jsx(Aqe,{scope:e,triggerRef:o,contentRef:c,contentId:ts(),titleId:ts(),descriptionId:ts(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(f=>!f),[d]),modal:a,children:r})};Afe.displayName=mj;var Dfe="DialogTrigger",Ofe=b.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=bl(Dfe,r),s=Kt(e,i.triggerRef);return l.jsx(vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":UB(i.open),...n,ref:s,onClick:He(t.onClick,i.onOpenToggle)})});Ofe.displayName=Dfe;var BB="DialogPortal",[Dqe,Rfe]=Mfe(BB,{forceMount:void 0}),Ife=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=bl(BB,e);return l.jsx(Dqe,{scope:e,forceMount:r,children:b.Children.map(n,a=>l.jsx($i,{present:r||s.open,children:l.jsx(e0,{asChild:!0,container:i,children:a})}))})};Ife.displayName=BB;var OT="DialogOverlay",Lfe=b.forwardRef((t,e)=>{const r=Rfe(OT,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=bl(OT,t.__scopeDialog);return s.modal?l.jsx($i,{present:n||s.open,children:l.jsx(Rqe,{...i,ref:e})}):null});Lfe.displayName=OT;var Oqe=kf("DialogOverlay.RemoveScroll"),Rqe=b.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=bl(OT,r);return l.jsx(Yw,{as:Oqe,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(vt.div,{"data-state":UB(i.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Sp="DialogContent",$fe=b.forwardRef((t,e)=>{const r=Rfe(Sp,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=bl(Sp,t.__scopeDialog);return l.jsx($i,{present:n||s.open,children:s.modal?l.jsx(Iqe,{...i,ref:e}):l.jsx(Lqe,{...i,ref:e})})});$fe.displayName=Sp;var Iqe=b.forwardRef((t,e)=>{const r=bl(Sp,t.__scopeDialog),n=b.useRef(null),i=Kt(e,r.contentRef,n);return b.useEffect(()=>{const s=n.current;if(s)return pj(s)},[]),l.jsx(Ffe,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(t.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:He(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:He(t.onFocusOutside,s=>s.preventDefault())})}),Lqe=b.forwardRef((t,e)=>{const r=bl(Sp,t.__scopeDialog),n=b.useRef(!1),i=b.useRef(!1);return l.jsx(Ffe,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;r.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Ffe=b.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,o=bl(Sp,r),c=b.useRef(null),u=Kt(e,c);return fj(),l.jsxs(l.Fragment,{children:[l.jsx(qw,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Jy,{role:"dialog",id:o.c
vendor: 5,957 bytes, lines 3558-3562
3558ontentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":UB(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx($qe,{titleId:o.titleId}),l.jsx(zqe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),VB="DialogTitle",zfe=b.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=bl(VB,r);return l.jsx(vt.h2,{id:i.titleId,...n,ref:e})});zfe.displayName=VB;var Bfe="DialogDescription",Vfe=b.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=bl(Bfe,r);return l.jsx(vt.p,{id:i.descriptionId,...n,ref:e})});Vfe.displayName=Bfe;var Ufe="DialogClose",Gfe=b.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=bl(Ufe,r);return l.jsx(vt.button,{type:"button",...n,ref:e,onClick:He(t.onClick,()=>i.onOpenChange(!1))})});Gfe.displayName=Ufe;function UB(t){return t?"open":"closed"}var Wfe="DialogTitleWarning",[MAt,Hfe]=_8e(Wfe,{contentName:Sp,titleName:VB,docsSlug:"dialog"}),$qe=({titleId:t})=>{const e=Hfe(Wfe),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
3559
3560If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
3561
3562For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return b.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Fqe="DialogDescriptionWarning",zqe=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hfe(Fqe).contentName}}.`;return b.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},gj=Afe,qfe=Ofe,yj=Ife,vj=Lfe,xj=$fe,GB=zfe,WB=Vfe,bj=Gfe;function Bqe({...t}){return l.jsx(gj,{"data-slot":"sheet",...t})}function Vqe({...t}){return l.jsx(yj,{"data-slot":"sheet-portal",...t})}const Uqe=b.forwardRef(({className:t,...e},r)=>l.jsx(vj,{ref:r,"data-slot":"sheet-overlay",className:Pe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-xs sm:backdrop-blur-none",t),...e}));function Gqe({className:t,children:e,side:r="right",...n}){return l.jsxs(Vqe,{children:[l.jsx(Uqe,{}),l.jsxs(xj,{"data-slot":"sheet-content",className:Pe("bg-gray-900 fixed z-50 flex flex-col gap-4 shadow-lg transition-transform transition-opacity duration-300 ease-in-out data-[state=open]:opacity-100 data-[state=closed]:opacity-0 data-[state=open]:translate-x-0 data-[state=closed]:translate-x-full",r==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l border-gray-700 sm:max-w-sm",r==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r border-gray-700 sm:max-w-sm",r==="top"&&"inset-x-0 top-0 h-auto border-b border-gray-700",r==="bottom"&&"inset-x-0 bottom-0 h-auto border-t border-gray-700",t),...n,children:[e,l.jsxs(bj,{className:"ring-offset-gray-900 focus:ring-emerald-500 data-[state=open]:bg-gray-800 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[l.jsx(pi,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Wqe({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:Pe("flex flex-col gap-1.5 p-4",t),...e})}function Hqe({className:t,...e}){return l.jsx(GB,{"data-slot":"sheet-title",className:Pe("text-gray-100 font-semibold",t),...e})}function qqe({className:t,...e}){return l.jsx(WB,{"data-slot":"sheet-description",className:Pe("text-gray-400 text-sm",t),...e})}const Le=P.forwardRef(({className:t,...e},r)=>l.jsx("div",{ref:r,"data-slot":"skeleton",className:ee("bg-app-border-color-soft animate-pulse rounded-md",t),...e}));Le.displayName="Skeleton";const Yqe=["top","right","bottom","left"],Ef=Math.min,Pa=Math.max,RT=Math.round,cS=Math.floor,rc=t=>({x:t,y:t}),Kqe={left:"right",right:"left",bottom:"top",top:"bottom"},Qqe={start:"end",end:"start"};function LF(t,e,r){return Pa(t,Ef(e,r))}function Iu(t,e){return typeof t=="function"?t(e):t}function Lu(t){return t.split("-")[0]}function t0(t){return t.split("-")[1]}function HB(t){return t==="x"?"y":"x"}function qB(t){return t==="y"?"height":"width"}const Zqe=new Set(["top","bottom"]);function Ul(t){return Zqe.has(Lu(t))?"y":"x"}function YB(t){return HB(Ul(t))}function Xqe(t,e,r){r===void 0&&(r=!1);const n=t0(t),i=YB(t),s=qB(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=IT(a)),[a,IT(a)]}function Jqe(t){const e=IT(t);return[$F(t),e,$F(e)]}function $F(t){return t.replace(/start|end/g,e=>Qqe[e])}const YY=["left","right"],KY=["right","left"],e7e=["top","bottom"],t7e=["bottom","top"];function r7e(t,e,r){switch(t){case"top":case"bottom":return r?e?KY:YY:e?YY:KY;case"left":case"right":return e?e7e:t7e;default:return[]}}function n7e(t,e,r,n){const i=t0(t);let s=r7e(Lu(t),r==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map($F)))),s}function IT(t){return t.replace(/left|right|bottom|top/g,e=>Kqe[e])}function i7e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yfe(t){return typeof t!="number"?i7e(t):{top:t,right:t,bottom:t,left:t}}function LT(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function QY(t,e,r){let{reference:n,floating:i}=t;const s=Ul(e),a=YB(e),o=qB(a),c=Lu(e),u=s==="y",d=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,h=n[o]/2-i[o]/2;let m;switch(c){case"top":m={x:d,y:n.y-i.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-i.width,y:f};break;default:m={x:n.x,y:n.y}}switch(t0(e)){case"start":m[a]-=h*(r&&u?-1:1);break;case"end":m[a]+=h*(r&&u?-1:1);break}return m}const s7e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}
vendor: 10,711 bytes, line 3562
3562=r,o=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=QY(u,n,c),h=n,m={},y=0;for(let x=0;x<o.length;x++){const{name:v,fn:_}=o[x],{x:S,y:k,data:E,reset:T}=await _({x:d,y:f,initialPlacement:n,placement:h,strategy:i,middlewareData:m,rects:u,platform:a,elements:{reference:t,floating:e}});d=S??d,f=k??f,m={...m,[v]:{...m[v],...E}},T&&y<=50&&(y++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(u=T.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):T.rects),{x:d,y:f}=QY(u,h,c)),x=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:m}};async function xb(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:a,elements:o,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Iu(e,t),y=Yfe(m),v=o[h?f==="floating"?"reference":"floating":f],_=LT(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(v)))==null||r?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:c})),S=f==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),E=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},T=LT(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:k,strategy:c}):S);return{top:(_.top-T.top+y.top)/E.y,bottom:(T.bottom-_.bottom+y.bottom)/E.y,left:(_.left-T.left+y.left)/E.x,right:(T.right-_.right+y.right)/E.x}}const a7e=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:d=0}=Iu(t,e)||{};if(u==null)return{};const f=Yfe(d),h={x:r,y:n},m=YB(i),y=qB(m),x=await a.getDimensions(u),v=m==="y",_=v?"top":"left",S=v?"bottom":"right",k=v?"clientHeight":"clientWidth",E=s.reference[y]+s.reference[m]-h[m]-s.floating[y],T=h[m]-s.reference[m],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let j=N?N[k]:0;(!j||!await(a.isElement==null?void 0:a.isElement(N)))&&(j=o.floating[k]||s.floating[y]);const M=E/2-T/2,O=j/2-x[y]/2-1,R=Ef(f[_],O),I=Ef(f[S],O),B=R,F=j-x[y]-I,V=j/2-x[y]/2+M,$=LF(B,V,F),U=!c.arrow&&t0(i)!=null&&V!==$&&s.reference[y]/2-(V<B?R:I)-x[y]/2<0,z=U?V<B?V-B:V-F:0;return{[m]:h[m]+z,data:{[m]:$,centerOffset:V-$-z,...U&&{alignmentOffset:z}},reset:U}}}),o7e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...v}=Iu(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const _=Lu(i),S=Ul(o),k=Lu(o)===o,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),T=h||(k||!x?[IT(o)]:Jqe(o)),N=y!=="none";!h&&N&&T.push(...n7e(o,x,y,E));const j=[o,...T],M=await xb(e,v),O=[];let R=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&O.push(M[_]),f){const V=Xqe(i,a,E);O.push(M[V[0]],M[V[1]])}if(R=[...R,{placement:i,overflows:O}],!O.every(V=>V<=0)){var I,B;const V=(((I=s.flip)==null?void 0:I.index)||0)+1,$=j[V];if($&&(!(f==="alignment"?S!==Ul($):!1)||R.every(L=>Ul(L.placement)===S?L.overflows[0]>0:!0)))return{data:{index:V,overflows:R},reset:{placement:$}};let U=(B=R.filter(z=>z.overflows[0]<=0).sort((z,L)=>z.overflows[1]-L.overflows[1])[0])==null?void 0:B.placement;if(!U)switch(m){case"bestFit":{var F;const z=(F=R.filter(L=>{if(N){const W=Ul(L.placement);return W===S||W==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(W=>W>0).reduce((W,K)=>W+K,0)]).sort((L,W)=>L[1]-W[1])[0])==null?void 0:F[0];z&&(U=z);break}case"initialPlacement":U=o;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function ZY(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function XY(t){return Yqe.some(e=>t[e]>=0)}const l7e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Iu(t,e);switch(n){case"referenceHidden":{const s=await xb(e,{...i,elementContext:"reference"}),a=ZY(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:XY(a)}}}case"escaped":{const s=await xb(e,{...i,altBoundary:!0}),a=ZY(s,r.floating);return{data:{escapedOffsets:a,escaped:XY(a)}}}default:return{}}}}},Kfe=new Set(["left","top"]);async function c7e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=Lu(r),o=t0(r),c=Ul(r)==="y",u=Kfe.has(a)?-1:1,d=s&&c?-1:1,f=Iu(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(m=o==="end"?y*-1:y),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const u7e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:a,middlewareData:o}=e,c=await c7e(e,t);return a===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},d7e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:v=>{let{x:_,y:S}=v;return{x:_,y:S}}},...c}=Iu(t,e),u={x:r,y:n},d=await xb(e,c),f=Ul(Lu(i)),h=HB(f);let m=u[h],y=u[f];if(s){const v=h==="y"?"top":"left",_=h==="y"?"bottom":"right",S=m+d[v],k=m-d[_];m=LF(S,m,k)}if(a){const v=f==="y"?"top":"left",_=f==="y"?"bottom":"right",S=y+d[v],k=y-d[_];y=LF(S,y,k)}const x=o.fn({...e,[h]:m,[f]:y});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[h]:s,[f]:a}}}}}},f7e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Iu(t,e),d={x:r,y:n},f=Ul(i),h=HB(f);let m=d[h],y=d[f];const x=Iu(o,e),v=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const k=h==="y"?"height":"width",E=s.reference[h]-s.floating[k]+v.mainAxis,T=s.reference[h]+s.reference[k]-v.mainAxis;m<E?m=E:m>T&&(m=T)}if(u){var _,S;const k=h==="y"?"width":"height",E=Kfe.has(Lu(i)),T=s.reference[f]-s.floating[k]+(E&&((_=a.offset)==null?void 0:_[f])||0)+(E?0:v.crossAxis),N=s.reference[f]+s.reference[k]+(E?0:((S=a.offset)==null?void 0:S[f])||0)-(E?v.crossAxis:0);y<T?y=T:y>N&&(y=N)}return{[h]:m,[f]:y}}}},h7e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:c=()=>{},...u}=Iu(t,e),d=await xb(e,u),f=Lu(i),h=t0(i),m=Ul(i)==="y",{width:y,height:x}=s.floating;let v,_;f==="top"||f==="bottom"?(v=f,_=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(_=f,v=h==="end"?"top":"bottom");const S=x-d.top-d.bottom,k=y-d.left-d.right,E=Ef(x-d[v],S),T=Ef(y-d[_],k),N=!e.middlewareData.shift;let j=E,M=T;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(M=k),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(j=S),N&&!h){const R=Pa(d.left,0),I=Pa(d.right,0),B=Pa(d.top,0),F=Pa(d.bottom,0);m?M=y-2*(R!==0||I!==0?R+I:Pa(d.left,d.right)):j=x-2*(B!==0||F!==0?B+F:Pa(d.top,d.bottom))}await c({...e,availableWidth:M,availableHeight:j});const O=await a.getDimensions(o.floating);return y!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function wj(){return typeof window<"u"}function r0(t){return Qfe(t)?(t.nodeName||"").toLowerCase():"#document"}function La(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wc(t){var e;return(e=(Qfe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Qfe(t){return wj()?t instanceof Node||t instanceof La(t).Node:!1}function $s(t){return wj()?t instanceof Element||t instanceof La(t).Element:!1}function pc(t){return wj()?t instanceof HTMLElement||t instanceof La(t).HTMLElement:!1}function JY(t){return!wj()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof La(t).ShadowRoot}const p7e=new Set(["inline","contents"]);function Kw(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Do(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!p7e.has(i)}const m7e=new Set(["table","td","th"]);function g7e(t){return m7e.has(r0(t))}const y7e=[":popover-open",":modal"];function _j(t){return y7e.some(e=>{try{return t.matches(e)}catch{return!1}})}const v7e=["transform","translate","scale","rotate","perspective"],x7e=["transform","translate","scale","rotate","perspective","filter"],b7e=["paint","layout","strict","content"];function KB(t){const e=QB(),r=$s(t)?Do(t):t;return v7e.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||x7e.some(n=>(r.willChange||"").includes(n))||b7e.some(n=>(r.contain||"").includes(n))}function w7e(t){let e=jf(t);for(;pc(e)&&!Kg(e);){if(KB(e))return e;if(_j(e))return null;e=jf(e)}return null}function QB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _7e=new Set(["html","body","#document"]);function Kg(t){return _7e.has(r0(t))}function Do(t){return La(t).getComputedStyle(t)}function Sj(t){return $s(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function jf(t){if(r0(t)==="html")return t;const e=t.assignedSlot||t.parentNode||JY(t)&&t.host||wc(t);return JY(e)?e.host:e}function Zfe(t){const e=jf(t);return Kg(e)?t.ownerDocument?t.ownerDocument.body:t.body:pc(e)&&Kw(e)?e:Zfe(e)}function bb(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=Zfe(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),a=La(i);if(s){const o=FF(a);return e.concat(a,a.visualViewport||[],Kw(i)?i:[],o&&r?bb(o):[])}return e.concat(i,bb(i,[],r))}function FF(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xfe(t){const e=Do(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=pc(t),s=i?t.offsetWidth:r,a=i?t.offsetHeight:n,o=RT(r)!==s||RT(n)!==a;return o&&(r=s,n=a),{width:r,height:n,$:o}}function ZB(t){return $s(t)?t:t.contextElement}function kg(t){const e=ZB(t);if(!pc(e))return rc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=Xfe(e);let a=(s?RT(r.width):r.width)/n,o=(s?RT(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const S7e=rc(0);function Jfe(t){const e=La(t);
vendor: 12,222 bytes, line 3562
3562return!QB()||!e.visualViewport?S7e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function k7e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==La(t)?!1:e}function kp(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=ZB(t);let a=rc(1);e&&(n?$s(n)&&(a=kg(n)):a=kg(t));const o=k7e(s,r,n)?Jfe(s):rc(0);let c=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,f=i.height/a.y;if(s){const h=La(s),m=n&&$s(n)?La(n):n;let y=h,x=FF(y);for(;x&&n&&m!==y;){const v=kg(x),_=x.getBoundingClientRect(),S=Do(x),k=_.left+(x.clientLeft+parseFloat(S.paddingLeft))*v.x,E=_.top+(x.clientTop+parseFloat(S.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=k,u+=E,y=La(x),x=FF(y)}}return LT({width:d,height:f,x:c,y:u})}function kj(t,e){const r=Sj(t).scrollLeft;return e?e.left+r:kp(wc(t)).left+r}function ehe(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-kj(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function T7e(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",a=wc(n),o=e?_j(e.floating):!1;if(n===a||o&&s)return r;let c={scrollLeft:0,scrollTop:0},u=rc(1);const d=rc(0),f=pc(n);if((f||!f&&!s)&&((r0(n)!=="body"||Kw(a))&&(c=Sj(n)),pc(n))){const m=kp(n);u=kg(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const h=a&&!f&&!s?ehe(a,c):rc(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:r.y*u.y-c.scrollTop*u.y+d.y+h.y}}function C7e(t){return Array.from(t.getClientRects())}function E7e(t){const e=wc(t),r=Sj(t),n=t.ownerDocument.body,i=Pa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Pa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+kj(t);const o=-r.scrollTop;return Do(n).direction==="rtl"&&(a+=Pa(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}const eK=25;function j7e(t,e){const r=La(t),n=wc(t),i=r.visualViewport;let s=n.clientWidth,a=n.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;const d=QB();(!d||d&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}const u=kj(n);if(u<=0){const d=n.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(n.clientWidth-f.clientWidth-m);y<=eK&&(s-=y)}else u<=eK&&(s+=u);return{width:s,height:a,x:o,y:c}}const N7e=new Set(["absolute","fixed"]);function P7e(t,e){const r=kp(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=pc(t)?kg(t):rc(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,c=i*s.x,u=n*s.y;return{width:a,height:o,x:c,y:u}}function tK(t,e,r){let n;if(e==="viewport")n=j7e(t,r);else if(e==="document")n=E7e(wc(t));else if($s(e))n=P7e(e,r);else{const i=Jfe(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return LT(n)}function the(t,e){const r=jf(t);return r===e||!$s(r)||Kg(r)?!1:Do(r).position==="fixed"||the(r,e)}function M7e(t,e){const r=e.get(t);if(r)return r;let n=bb(t,[],!1).filter(o=>$s(o)&&r0(o)!=="body"),i=null;const s=Do(t).position==="fixed";let a=s?jf(t):t;for(;$s(a)&&!Kg(a);){const o=Do(a),c=KB(a);!c&&o.position==="fixed"&&(i=null),(s?!c&&!i:!c&&o.position==="static"&&!!i&&N7e.has(i.position)||Kw(a)&&!c&&the(t,a))?n=n.filter(d=>d!==a):i=o,a=jf(a)}return e.set(t,n),n}function A7e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const a=[...r==="clippingAncestors"?_j(e)?[]:M7e(e,this._c):[].concat(r),n],o=a[0],c=a.reduce((u,d)=>{const f=tK(e,d,i);return u.top=Pa(f.top,u.top),u.right=Ef(f.right,u.right),u.bottom=Ef(f.bottom,u.bottom),u.left=Pa(f.left,u.left),u},tK(e,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function D7e(t){const{width:e,height:r}=Xfe(t);return{width:e,height:r}}function O7e(t,e,r){const n=pc(e),i=wc(e),s=r==="fixed",a=kp(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=rc(0);function u(){c.x=kj(i)}if(n||!n&&!s)if((r0(e)!=="body"||Kw(i))&&(o=Sj(e)),n){const m=kp(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else i&&u();s&&!n&&i&&u();const d=i&&!n&&!s?ehe(i,o):rc(0),f=a.left+o.scrollLeft-c.x-d.x,h=a.top+o.scrollTop-c.y-d.y;return{x:f,y:h,width:a.width,height:a.height}}function _A(t){return Do(t).position==="static"}function rK(t,e){if(!pc(t)||Do(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return wc(t)===r&&(r=r.ownerDocument.body),r}function rhe(t,e){const r=La(t);if(_j(t))return r;if(!pc(t)){let i=jf(t);for(;i&&!Kg(i);){if($s(i)&&!_A(i))return i;i=jf(i)}return r}let n=rK(t,e);for(;n&&g7e(n)&&_A(n);)n=rK(n,e);return n&&Kg(n)&&_A(n)&&!KB(n)?r:n||w7e(t)||r}const R7e=async function(t){const e=this.getOffsetParent||rhe,r=this.getDimensions,n=await r(t.floating);return{reference:O7e(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function I7e(t){return Do(t).direction==="rtl"}const L7e={convertOffsetParentRelativeRectToViewportRelativeRect:T7e,getDocumentElement:wc,getClippingRect:A7e,getOffsetParent:rhe,getElementRects:R7e,getClientRects:C7e,getDimensions:D7e,getScale:kg,isElement:$s,isRTL:I7e};function nhe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $7e(t,e){let r=null,n;const i=wc(t);function s(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(o||e(),!h||!m)return;const y=cS(f),x=cS(i.clientWidth-(d+h)),v=cS(i.clientHeight-(f+m)),_=cS(d),k={rootMargin:-y+"px "+-x+"px "+-v+"px "+-_+"px",threshold:Pa(0,Ef(1,c))||1};let E=!0;function T(N){const j=N[0].intersectionRatio;if(j!==c){if(!E)return a();j?a(!1,j):n=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!nhe(u,t.getBoundingClientRect())&&a(),E=!1}try{r=new IntersectionObserver(T,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(T,k)}r.observe(t)}return a(!0),s}function ihe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ZB(t),d=i||s?[...u?bb(u):[],...bb(e)]:[];d.forEach(_=>{i&&_.addEventListener("scroll",r,{passive:!0}),s&&_.addEventListener("resize",r)});const f=u&&o?$7e(u,r):null;let h=-1,m=null;a&&(m=new ResizeObserver(_=>{let[S]=_;S&&S.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=m)==null||k.observe(e)})),r()}),u&&!c&&m.observe(u),m.observe(e));let y,x=c?kp(t):null;c&&v();function v(){const _=kp(t);x&&!nhe(x,_)&&r(),x=_,y=requestAnimationFrame(v)}return r(),()=>{var _;d.forEach(S=>{i&&S.removeEventListener("scroll",r),s&&S.removeEventListener("resize",r)}),f?.(),(_=m)==null||_.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const F7e=u7e,z7e=d7e,B7e=o7e,V7e=h7e,U7e=l7e,nK=a7e,G7e=f7e,W7e=(t,e,r)=>{const n=new Map,i={platform:L7e,...r},s={...i.platform,_c:n};return s7e(t,e,{...i,platform:s})};var H7e=typeof document<"u",q7e=function(){},Pk=H7e?b.useLayoutEffect:q7e;function $T(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!$T(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!$T(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function she(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iK(t,e){const r=she(t);return Math.round(e*r)/r}function SA(t){const e=b.useRef(t);return Pk(()=>{e.current=t}),e}function ahe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[d,f]=b.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=b.useState(n);$T(h,n)||m(n);const[y,x]=b.useState(null),[v,_]=b.useState(null),S=b.useCallback(L=>{L!==N.current&&(N.current=L,x(L))},[]),k=b.useCallback(L=>{L!==j.current&&(j.current=L,_(L))},[]),E=s||y,T=a||v,N=b.useRef(null),j=b.useRef(null),M=b.useRef(d),O=c!=null,R=SA(c),I=SA(i),B=SA(u),F=b.useCallback(()=>{if(!N.current||!j.current)return;const L={placement:e,strategy:r,middleware:h};I.current&&(L.platform=I.current),W7e(N.current,j.current,L).then(W=>{const K={...W,isPositioned:B.current!==!1};V.current&&!$T(M.current,K)&&(M.current=K,bc.flushSync(()=>{f(K)}))})},[h,e,r,I,B]);Pk(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const V=b.useRef(!1);Pk(()=>(V.current=!0,()=>{V.current=!1}),[]),Pk(()=>{if(E&&(N.current=E),T&&(j.current=T),E&&T){if(R.current)return R.current(E,T,F);F()}},[E,T,F,R,O]);const $=b.useMemo(()=>({reference:N,floating:j,setReference:S,setFloating:k}),[S,k]),U=b.useMemo(()=>({reference:E,floating:T}),[E,T]),z=b.useMemo(()=>{const L={position:r,left:0,top:0};if(!U.floating)return L;const W=iK(U.floating,d.x),K=iK(U.floating,d.y);return o?{...L,transform:"translate("+W+"px, "+K+"px)",...she(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:K}},[r,o,U.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:F,refs:$,elements:U,floatingStyles:z}),[d,F,$,U,z])}const Y7e=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?nK({element:n.current,padding:i}).fn(r):{}:n?nK({element:n,padding:i}).fn(r):{}}}},ohe=(t,e)=>({...F7e(t),options:[t,e]}),K7e=(t,e)=>({...z7e(t),options:[t,e]}),Q7e=(t,e)=>({...G7e(t),options:[t,e]}),lhe=(t,e)=>({...B7e(t),options:[t,e]}),Z7e=(t,e)=>({...V7e(t),options:[t,e]}),X7e=(t,e)=>({...U7e(t),options:[t,e]}),che=(t,e)=>({...Y7e(t),options:[t,e]});var J7e="Arrow",uhe=b.forwardRef((t,e)=>{const{children:r,width:n=10,height:i=5,...s}=t;return l.jsx(vt.svg,{...s,ref:e,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});uhe.displayName=J7e;var e9e=uhe;function XB(t){const[e,r]=b.useState(void 0);return rs(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;r({width:a,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var JB="Popper",[dhe,$f]=ma(JB),[t9e,fhe]=dhe(JB),hhe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=b.useState(null);return l.jsx(t9e,{scope:e,anchor:n,onAnchorChange:i,children:r})};hhe.displayName=JB;var phe="PopperAnchor",mhe=b.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=fhe(phe,r),a=b.useRef(null),o=Kt(e,a),c=b.useRef(null);return b.useEffect(()=>{const u=c.current;c.current=n?.current||a.current,u!==c.current&&s.onAnchorChange(c.current)}),n?null:l.jsx(vt.div,{...i,ref:o})});mhe.displayName=phe;var eV="PopperContent",[r9e,n9e]=dhe(eV),ghe=b.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...x}=t,v=fhe(eV,r),[_,S]=b.useState(null),k=Kt(e,oe=>S(oe)),[E,T]=b.useState(null),N=XB(E),j=N?.width??0,M=N?.height??0,O=n+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(u)?u:[u],B=I.length>0,F={padding:R,boundary:I.filter(s9e),altBoundary:B},{refs:V,floatingStyles:$,placement:U,isPositioned:z,middlewareData:L}=ahe({strategy:"fixed",placement:O,whileElementsMounted:(...oe)=>ihe(...oe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[ohe({mainAxis:i+M,alignmentAxis:a}),c&&K7e({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Q7e():void 0,...F}),c&&lhe({...F}),Z7e({...F,apply:({elements:oe,rects:ge,availableWidth:le,availableHeight:Se})=>{const{width:Ce,height:he}=ge.reference,Ct=oe.floating.style;
vendor: 11,598 bytes, line 3562
3562Ct.setProperty("--radix-popper-available-width",`${le}px`),Ct.setProperty("--radix-popper-available-height",`${Se}px`),Ct.setProperty("--radix-popper-anchor-width",`${Ce}px`),Ct.setProperty("--radix-popper-anchor-height",`${he}px`)}}),E&&che({element:E,padding:o}),a9e({arrowWidth:j,arrowHeight:M}),h&&X7e({strategy:"referenceHidden",...F})]}),[W,K]=xhe(U),q=Ki(y);rs(()=>{z&&q?.()},[z,q]);const H=L.arrow?.x,Y=L.arrow?.y,J=L.arrow?.centerOffset!==0,[re,me]=b.useState();return rs(()=>{_&&me(window.getComputedStyle(_).zIndex)},[_]),l.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:z?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(r9e,{scope:r,placedSide:W,onArrowChange:T,arrowX:H,arrowY:Y,shouldHideArrow:J,children:l.jsx(vt.div,{"data-side":W,"data-align":K,...x,ref:k,style:{...x.style,animation:z?void 0:"none"}})})})});ghe.displayName=eV;var yhe="PopperArrow",i9e={top:"bottom",right:"left",bottom:"top",left:"right"},vhe=b.forwardRef(function(e,r){const{__scopePopper:n,...i}=e,s=n9e(yhe,n),a=i9e[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(e9e,{...i,ref:r,style:{...i.style,display:"block"}})})});vhe.displayName=yhe;function s9e(t){return t!==null}var a9e=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:i}=e,a=i.arrow?.centerOffset!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,d]=xhe(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(i.arrow?.x??0)+o/2,m=(i.arrow?.y??0)+c/2;let y="",x="";return u==="bottom"?(y=a?f:`${h}px`,x=`${-c}px`):u==="top"?(y=a?f:`${h}px`,x=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,x=a?f:`${m}px`):u==="left"&&(y=`${n.floating.width+c}px`,x=a?f:`${m}px`),{data:{x:y,y:x}}}});function xhe(t){const[e,r="center"]=t.split("-");return[e,r]}var Tj=hhe,Qw=mhe,Cj=ghe,Ej=vhe,bhe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o9e="VisuallyHidden",whe=b.forwardRef((t,e)=>l.jsx(vt.span,{...t,ref:e,style:{...bhe,...t.style}}));whe.displayName=o9e;var l9e=whe,[jj]=ma("Tooltip",[$f]),Nj=$f(),_he="TooltipProvider",c9e=700,zF="tooltip.open",[u9e,tV]=jj(_he),She=t=>{const{__scopeTooltip:e,delayDuration:r=c9e,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=t,a=b.useRef(!0),o=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(u9e,{scope:e,isOpenDelayedRef:a,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:o,onPointerInTransitChange:b.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};She.displayName=_he;var wb="Tooltip",[d9e,Zw]=jj(wb),khe=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=t,c=tV(wb,t.__scopeTooltip),u=Nj(e),[d,f]=b.useState(null),h=ts(),m=b.useRef(0),y=a??c.disableHoverableContent,x=o??c.delayDuration,v=b.useRef(!1),[_,S]=Ao({prop:n,defaultProp:i??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(zF))):c.onClose(),s?.(j)},caller:wb}),k=b.useMemo(()=>_?v.current?"delayed-open":"instant-open":"closed",[_]),E=b.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,S(!0)},[S]),T=b.useCallback(()=>{window.clearTimeout(m.current),m.current=0,S(!1)},[S]),N=b.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,S(!0),m.current=0},x)},[x,S]);return b.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),l.jsx(Tj,{...u,children:l.jsx(d9e,{scope:e,contentId:h,open:_,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?N():E()},[c.isOpenDelayedRef,N,E]),onTriggerLeave:b.useCallback(()=>{y?T():(window.clearTimeout(m.current),m.current=0)},[T,y]),onOpen:E,onClose:T,disableHoverableContent:y,children:r})})};khe.displayName=wb;var BF="TooltipTrigger",The=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=Zw(BF,r),s=tV(BF,r),a=Nj(r),o=b.useRef(null),c=Kt(e,o,i.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(Qw,{asChild:!0,...a,children:l.jsx(vt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:He(t.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:He(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:He(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:He(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:He(t.onBlur,i.onClose),onClick:He(t.onClick,i.onClose)})})});The.displayName=BF;var rV="TooltipPortal",[f9e,h9e]=jj(rV,{forceMount:void 0}),Che=t=>{const{__scopeTooltip:e,forceMount:r,children:n,container:i}=t,s=Zw(rV,e);return l.jsx(f9e,{scope:e,forceMount:r,children:l.jsx($i,{present:r||s.open,children:l.jsx(e0,{asChild:!0,container:i,children:n})})})};Che.displayName=rV;var Qg="TooltipContent",Ehe=b.forwardRef((t,e)=>{const r=h9e(Qg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=t,a=Zw(Qg,t.__scopeTooltip);return l.jsx($i,{present:n||a.open,children:a.disableHoverableContent?l.jsx(jhe,{side:i,...s,ref:e}):l.jsx(p9e,{side:i,...s,ref:e})})}),p9e=b.forwardRef((t,e)=>{const r=Zw(Qg,t.__scopeTooltip),n=tV(Qg,t.__scopeTooltip),i=b.useRef(null),s=Kt(e,i),[a,o]=b.useState(null),{trigger:c,onClose:u}=r,d=i.current,{onPointerInTransitChange:f}=n,h=b.useCallback(()=>{o(null),f(!1)},[f]),m=b.useCallback((y,x)=>{const v=y.currentTarget,_={x:y.clientX,y:y.clientY},S=v9e(_,v.getBoundingClientRect()),k=x9e(_,S),E=b9e(x.getBoundingClientRect()),T=_9e([...k,...E]);o(T),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&d){const y=v=>m(v,d),x=v=>m(v,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",x)}}},[c,d,m,h]),b.useEffect(()=>{if(a){const y=x=>{const v=x.target,_={x:x.clientX,y:x.clientY},S=c?.contains(v)||d?.contains(v),k=!w9e(_,a);S?h():k&&(h(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,a,u,h]),l.jsx(jhe,{...t,ref:s})}),[m9e,g9e]=jj(wb,{isInside:!1}),y9e=GMe("TooltipContent"),jhe=b.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=t,c=Zw(Qg,r),u=Nj(r),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(zF,d),()=>document.removeEventListener(zF,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=h=>{h.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Jy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(Cj,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(y9e,{children:n}),l.jsx(m9e,{scope:r,isInside:!0,children:l.jsx(l9e,{id:c.contentId,role:"tooltip",children:i||n})})]})})});Ehe.displayName=Qg;var Nhe="TooltipArrow",Phe=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,i=Nj(r);return g9e(Nhe,r).isInside?null:l.jsx(Ej,{...i,...n,ref:e})});Phe.displayName=Nhe;function v9e(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function x9e(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function b9e(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function w9e(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],c=e[a],u=o.x,d=o.y,f=c.x,h=c.y;d>n!=h>n&&r<(f-u)*(n-d)/(h-d)+u&&(i=!i)}return i}function _9e(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),S9e(e)}function S9e(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const i=t[n];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var k9e=She,T9e=khe,C9e=The,E9e=Che,j9e=Ehe,N9e=Phe;function nV({delayDuration:t=0,...e}){return l.jsx(k9e,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function ui({...t}){return l.jsx(nV,{children:l.jsx(T9e,{"data-slot":"tooltip",...t})})}function di({...t}){return l.jsx(C9e,{"data-slot":"tooltip-trigger",...t})}function fi({className:t,sideOffset:e=0,children:r,...n}){return l.jsx(E9e,{children:l.jsxs(j9e,{"data-slot":"tooltip-content",sideOffset:e,className:ee("bg-app-button-bg text-app-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-xl px-3 py-2 text-sm text-balance z-9999 2k:px-6 2k:py-4 2k:text-2xl",t),...n,children:[r,l.jsx(N9e,{className:"bg-app-button-bg fill-app-button-bg z-9999 size-3 2k:size-5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]"})]})})}const sK="sidebar_state",P9e=3600*24*7,M9e="14rem",A9e="26rem",D9e="18rem",O9e="4rem",R9e="8rem",I9e="b",Mhe=b.createContext(null);function Ff(){const t=b.useContext(Mhe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function L9e(){const[t,e]=b.useState(!1);return b.useEffect(()=>{const r=window.matchMedia("(max-width: 1377px)"),n=()=>e(r.matches);
3562return r.addEventListener("change",n),e(r.matches),()=>r.removeEventListener("change",n)},[]),t}function $9e({defaultOpen:t=!0,open:e,onOpenChange:r,className:n,style:i,children:s,...a}){const o=L9e(),[c,u]=b.useState(!1),[d,f]=b.useState(!1);b.useEffect(()=>{const k=()=>f(window.innerWidth>=2048);return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const[h,m]=b.useState(()=>{try{const k=document.cookie.match(new RegExp(`${sK}=(true|false)`));if(k)return k[1]==="true"}catch{}return t}),y=e??h,x=b.useCallback(k=>{const E=typeof k=="function"?k(y):k;r?r(E):m(E),document.cookie=`${sK}=${E}; path=/; max-age=${P9e}`},[r,y]),v=b.useCallback(()=>o?u(k=>!k):x(k=>!k),[o,x,u]);b.useEffect(()=>{const k=E=>{E.key===I9e&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),v())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v]);const _=y?"expanded":"collapsed",S=b.useMemo(()=>({state:_,open:y,setOpen:x,isMobile:o,openMobile:c,setOpenMobile:u,toggleSidebar:v}),[_,y,x,o,c,u,v]);return l.jsx(Mhe.Provider,{value:S,children:l.jsx(nV,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":d?A9e:M9e,"--sidebar-width-icon":d?R9e:O9e,...i},className:Pe("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),...a,children:s})})})}function F9e({side:t="left",variant:e="sidebar",collapsible:r="offcanvas",className:n,children:i,...s}){const{isMobile:a,state:o,openMobile:c,setOpenMobile:u}=Ff();return r==="none"?l.jsx("div",{"data-slot":"sidebar",className:Pe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col hidden xl:flex",n),...s,children:i}):a?l.jsx(Bqe,{open:c,onOpenChange:u,...s,children:l.jsxs(Gqe,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":D9e},side:t,children:[l.jsxs(Wqe,{className:"sr-only",children:[l.jsx(Hqe,{children:"Sidebar"}),l.jsx(qqe,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):l.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":o,"data-collapsible":o==="collapsed"?r:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:Pe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container",className:Pe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-3.5 group-data-[collapsible=icon]:p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)] border-r border-app-border-color-soft":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r border-app-border-color-soft group-data-[side=right]:border-l",n),...s,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-xs px-2 2k:px-6",children:i})})]})}function z9e({className:t}){const{toggleSidebar:e}=Ff();return l.jsx(iV,{className:"my-4 2k:my-12",children:l.jsx(FT,{children:l.jsx(zT,{asChild:!0,onClick:e,size:"lg",tooltip:"Expand sidebar",className:Pe(t),children:l.jsxs("div",{className:"cursor-pointer flex items-center group-data-[collapsible=icon]:justify-center",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"object-cover group-data-[collapsible=icon]:h-4 lg:h-6 w-auto max-w-7 mr-1 2k:h-14 group-data-[collapsible=icon]:mr-0"}),l.jsx("span",{className:"truncate group-data-[collapsible=icon]:hidden font-semibold text-left text-lg lg:text-[24px] 2k:text-4xl leading-normal mb-[1.45px]",children:es})]})})})})}function B9e({className:t,...e}){const{toggleSidebar:r}=Ff();return l.jsx("button",{type:"button","data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Pe("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})}function V9e({className:t,...e}){return l.jsx("main",{"data-slot":"sidebar-inset",className:Pe("bg-app-primary relative flex w-full flex-1 flex-col","peer-data-[variant=inset]:min-
3562h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",t),...e})}function U9e({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Pe("flex flex-col gap-2 p-2",t),...e})}function G9e({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Pe("flex flex-col gap-2 p-2",t),...e})}function W9e({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Pe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function H9e({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Pe("relative flex w-full min-w-0 flex-col p-2",t),...e})}function q9e({className:t,asChild:e=!1,...r}){const n=e?Cw:"div";return l.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:Pe("text-sidebar-foreground/50 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 uppercase font-normal tracking-wider","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 2k:text-xl 2k:mb-2",t),...r})}function iV({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Pe("flex w-full min-w-0 flex-col gap-2",t),...e})}function FT({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Pe("group/menu-item relative",t),...e})}const Y9e=Rf("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-xl p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,border] ease-in-out duration-500 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent font-light active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-app-button-bg-active data-[active=true]:font-medium border border-transparent data-[active=true]:border-app-border-color-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>svg]:group-data-[collapsible=icon]:size-4 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 2k:h-16 2k:text-2xl 2k:gap-4 2k:[&>svg]:size-9 2k:group-data-[collapsible=icon]:size-16! 2k:group-data-[collapsible=icon]:p-3! 2k:[&>svg]:group-data-[collapsible=icon]:size-10",{variants:{variant:{default:"hover:bg-app-button-bg hover:text-sidebar-accent-foreground",outline:"bg-gray-950 shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-fit text-sm px-3.5 py-2",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0! 2k:group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function zT({asChild:t=!1,isActive:e=!1,variant:r="default",size:n="default",tooltip:i,className:s,...a}){const o=t?Cw:"button",{isMobile:c,state:u}=Ff(),d=l.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":e,className:Pe(Y9e({variant:r,size:n}),s,"cursor-pointer"),...a});return i?(typeof i=="string"&&(i={children:i}),l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:d}),l.jsx(fi,{side:"right",align:"center",hidden:u!=="collapsed"||c,...i})]})):d}const K9e=()=>{const{setOpenMobile:t}=Ff();return l.jsxs("header",{className:"fixed top-0 left-0 w-full z-40 flex items-center justify-between bg-app-primary border-b border-app-border-color-soft shadow-xs h-14 px-4 xl:hidden",children:[l.jsx("button",{className:"flex items-center justify-center rounded-full p-2 bg-app-card border border-app-border-color-soft shadow-sm",onClick:()=>t(!0),"aria-label":"Open menu",children:l.jsx(s3,{size:24})}),l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"h-7 w-auto object-cover mx-auto"}),l.jsx("div",{className:"w-10"})]})},Ahe=P.createContext(null),Q9e=({steps:t,onFinish:e,initialCurrent:r,children:n})=>{const[i,s]=P.useState({current:r,validMap:{},payloadMap:{}});P.useEffect(()=>{s(d=>({...d,current:r}))},[r]);const a=P.useCallback((d,f,h)=>s(m=>({...m,validMap:{...m.validMap,[d]:f},payloadMap:h===void 0?m.payloadMap:{...m.payloadMap,[d]:h}})),[]),o=P.useCallback(()=>s(d=>({...d,current:Math.min(d.current+1,t.length-1)})),[t.length]),c=P.useCallback(async()=>{await e(i.payloadMap)},[e,i.payloadMap]),u=P.useMemo(()=>({steps:t,...i,goNext:o,setStepValidity:a,finish:c}),[t,i,o,a,c]);return l.jsx(Ahe.Provider,{value:u,children:n})},sV=()=>{const t=P.useContext(Ahe);if(!t)throw new Error("useOnboarding must be used inside OnboardingProvider");return t},Hr={quad:[.25,.46,.45,.94],cubic:[.215,.61,.355,1],quart:[.165,.84,.44,1]},Z9e={quad:[.55,.085,.68,.53]},rn={fast:.15,normal:.2,smooth:.25,comfortable:.3,relaxed:.4},X9e=t=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?{}:t,J9e=({open:t})=>{const{steps:e,current:r,validMap:n,goNext:i,setStepValidity:s,payloadMap:a}=sV(),{userHasura:o}=Gt(),c=o?.id,[u,{loading:d}]=Zn(ffe),f=b.useRef(null),[h,m]=b.useState(!1),y=b.useCallback((E,T)=>s(r,E,T),[r,s]),x=async()=>
3562{if(!c)return;const E=e[r].id;if(E==="setPassword"){if(!await f.current?.submit())return;await u({variables:{userId:c,input:{onboarding_state:"SELECT_PLAN"}}});return}if(E==="verifyEmail"&&n[r]){await u({variables:{userId:c,input:{onboarding_state:"SELECT_PLAN"}}});return}i()},v=e[r]?.id,_=v==="selectPlan"||v==="paymentCompletion"?2:1;if(typeof document>"u"||!t)return null;const S=e[r].Component,k=!!n[r];return bc.createPortal(l.jsxs("div",{className:"fixed inset-0 z-9999 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-xs"}),l.jsxs("div",{className:"relative w-full sm:max-w-2xl lg:max-w-4xl mx-4 bg-app-card text-foreground rounded-2xl border border-white/10 shadow-[0_8px_64px_0_rgba(120,130,255,0.25),0_1.5px_8px_0_rgba(120,130,255,0.10)] p-6 sm:p-8 max-h-[90vh] overflow-y-auto 2k:p-16 2k:rounded-[2.5rem] 2k:text-3xl 2k:max-w-6xl",children:[l.jsx("h2",{className:"text-2xl font-semibold 2k:text-5xl",children:e[r].title}),l.jsx("div",{className:"mt-6 relative overflow-hidden flex 2k:mt-14",children:l.jsx(Ss,{mode:"wait",children:l.jsx(ct.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3,ease:Hr.quad},className:"w-full",children:l.jsx(S,{ref:e[r].id==="setPassword"?f:void 0,onValidChange:y,initialPayload:a[r],onSubmittingChange:e[r].id==="setPassword"?m:void 0})},r)})}),l.jsxs("div",{className:"mt-10 relative w-full 2k:mt-20",children:[l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex gap-2 2k:gap-6",children:[0,1].map(E=>l.jsx(ct.span,{initial:{opacity:.5},animate:{opacity:E<_?1:.5},transition:{duration:.2,ease:Hr.quad},className:`h-[6px] w-10 rounded-full 2k:h-3 2k:w-20 ${E<_?"bg-[#6366f1]":"bg-app-border-color-soft"}`},E))}),l.jsx("div",{className:"flex justify-end",children:v!=="selectPlan"&&v!=="paymentCompletion"&&l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx("span",{tabIndex:-1,className:"inline-block pointer-events-auto",children:l.jsx(ye,{variant:"text",onClick:x,disabled:!k||d||!c||h,className:"2k:text-2xl 2k:h-20 2k:px-12",children:h?l.jsxs(l.Fragment,{children:[l.jsx(No,{className:"animate-spin 2k:size-8",size:16}),l.jsx("span",{className:"2k:ml-4",children:"Setting password..."})]}):"Continue"})})}),(!k||d||!c||h)&&l.jsx(fi,{side:"top",sideOffset:8,children:h?"Setting your password...":"You need to complete the step to continue"})]})})]})]})]}),document.body)};tt`
3563  mutation CreateTrade($input: trade_insert_input!) {
3564    insert_trade_one(object: $input) {
3565      id
3566      user_id
3567      position_type
3568      symbol
3569      entry_price
3570      exit_price
3571      position_size
3572      commissions_fees
3573      risk
3574      entry_date
3575      exit_date
3576      notes
3577      pnl
3578      is_active
3579      created_at
3580      created_by
3581    }
3582  }
3583`;const Dhe=tt`
3584  mutation UpdateTrade($tradeId: uuid!, $input: trade_set_input!) {
3585    update_trade_by_pk(pk_columns: { id: $tradeId }, _set: $input) {
3586      id
3587      position_type
3588      symbol
3589      entry_price
3590      exit_price
3591      position_size
3592      commissions_fees
3593      risk
3594      entry_date
3595      exit_date
3596      notes
3597      pnl
3598      updated_at
3599      updated_by
3600    }
3601  }
3602`,eYe=tt`
3603  mutation CreateMultipleTrades($trades: [trade_insert_input!]!) {
3604    insert_trade(objects: $trades) {
3605      affected_rows
3606      returning {
3607        id
3608        user_id
3609        position_type
3610        symbol
3611        entry_price
3612        exit_price
3613        position_size
3614        commissions_fees
3615        risk
3616        entry_date
3617        exit_date
3618        pnl
3619        net_pnl
3620        created_at
3621        comm
3622        fees
3623      }
3624    }
3625  }
3626`,tYe=tt`
3627  mutation CreateMultipleTradeExecutions(
3628    $objects: [trade_execution_insert_input!]!
3629  ) {
3630    insert_trade_execution(objects: $objects) {
3631      affected_rows
3632      returning {
3633        id
3634        trade_id
3635        execution_time
3636        quantity
3637        price
3638        position_size
3639        commissions_fees
3640        commissions
3641        misc_fees
3642        created_at
3643      }
3644    }
3645  }
3646`;tt`
3647  mutation DeleteTradeById($tradeId: uuid!) {
3648    delete_trade_by_pk(id: $tradeId) {
3649      id
3650    }
3651  }
3652`;const Ohe=tt`
3653  mutation DeleteMultipleTrades($tradesId: [uuid!]) {
3654    delete_trade(where: { id: { _in: $tradesId } }) {
3655      affected_rows
3656      returning {
3657        id
3658        user_id
3659        __typename
3660      }
3661    }
3662  }
3663`,aV=tt`
3664  mutation LinkMultipleTagsToTrade($tradeTags: [trade_tag_insert_input!]!) {
3665    insert_trade_tag(objects: $tradeTags) {
3666      affected_rows
3667      returning {
3668        id
3669        trade_id
3670        tag_id
3671        user_id
3672        created_at
3673        tag {
3674          id
3675          name
3676          text_color
3677          background_color
3678        }
3679      }
3680    }
3681  }
3682`,Rhe=tt`
3683  mutation UpdateTradeRisk($tradeId: uuid!, $risk: numeric) {
3684    update_trade_by_pk(pk_columns: { id: $tradeId }, _set: { risk: $risk }) {
3685      id
3686      risk
3687    }
3688  }
3689`,Ihe=tt`
3690  mutation UpdateMultipleTradesRisk($tradesIds: [uuid!]!, $risk: numeric) {
3691    update_trade_many(
3692      updates: { where: { id: { _in: $tradesIds } }, _set: { risk: $risk } }
3693    ) {
3694      affected_rows
3695      returning {
3696        id
3697        risk
3698      }
3699    }
3700  }
3701`,Lhe=tt`
3702  mutation UpdateActiveUserTradesRisk($userId: uuid!, $risk: numeric) {
3703    update_trade(
3704      where: { is_active: { _is_null: false }, user_id: { _eq: $userId } }
3705      _set: { risk: $risk }
3706    ) {
3707      affected_rows
3708      returning {
3709        id
3710        risk
3711      }
3712    }
3713  }
3714`,rYe=Object.freeze(Object.defineProperty({__proto__:null,CREATE_MULTIPLE_EXECUTIONS:tYe,CREATE_MULTIPLE_TRADES:eYe,DELETE_MULTIPLE_TRADES:Ohe,LINK_MULTIPLE_TAGS_TO_TRADE:aV,UPDATE_ACTIVE_USER_TRADES_RISK:Lhe,UPDATE_MULTIPLE_TRADES_RISK:Ihe,UPDATE_TRADE:Dhe,UPDATE_TRADE_RISK:Rhe},Symbol.toStringTag,{value:"Module"})),nYe=tt`
3715  query GetTradeById($tradeId: uuid!) {
3716    trade_by_pk(id: $tradeId) {
3717      id
3718      userId: user_id
3719      positionType: position_type
3720      symbol
3721      entryPrice: entry_price
3722      exitPrice: exit_price
3723      positionSize: position_size
3724      entryDate: entry_date
3725      exitDate: exit_date
3726      status
3727      notes
3728      pnl
3729      netPnl: net_pnl
3730      commissionsFees: commissions_fees
3731      risk
3732      isActive: is_active
3733      createdAt: created_at
3734      updatedAt: updated_at
3735    }
3736  }
3737`;tt`
3738  query GetTradesByUser($userId: uuid!, $limit: Int = 50, $offset: Int = 0) {
3739    trade(
3740      where: {
3741        user_id: { _eq: $userId }
3742        is_active: { _eq: true }
3743        deleted_at: { _is_null: true }
3744      }
3745      limit: $limit
3746      offset: $offset
3747      order_by: { entry_date: desc }
3748    ) {
3749      id
3750      position_type
3751      symbol
3752      entry_price
3753      exit_price
3754      position_size
3755      entry_date
3756      exit_date
3757      notes
3758      pnl
3759      commissions_fees
3760      risk
3761      status
3762      created_at
3763      trade_tags {
3764        tag {
3765          id
3766          name
3767          text_color
3768          background_color
3769        }
3770      }
3771    }
3772  }
3773`;const iYe=tt`
3774  query GetUserTradesInsights(
3775    $userId: uuid!
3776    $startDate: timestamptz = "1900-01-01"
3777    $endDate: timestamptz = "2100-12-31"
3778  ) {
3779    trade(
3780      where: {
3781        _and: [
3782          { user_id: { _eq: $userId } }
3783          { entry_date: { _gte: $startDate } }
3784          { entry_date: { _lte: $endDate } }
3785        ]
3786      }
3787      order_by: { entry_date: desc }
3788    ) {
3789      id
3790      user_id
3791      symbol
3792      entry_price
3793      exit_price
3794      position_size
3795      position_type
3796      commissions_fees
3797      comm
3798      fees
3799      entry_date
3800      exit_date
3801      pnl
3802      risk
3803      net_pnl
3804      status
3805    }
3806  }
3807`,sYe=tt`
3808  query GetDailyRecapSummary(
3809    $userId: uuid!
3810    $limit: Int = 10
3811    $offset: Int = 0
3812    $startDate: date!
3813    $endDate: date!
3814  ) {
3815    dailyRecapSummary: daily_journal_summary(
3816      where: {
3817        user_id: { _eq: $userId }
3818        trade_day: { _gte: $startDate, _lte: $endDate }
3819      }
3820      limit: $limit
3821      offset: $offset
3822      order_by: { trade_day: desc }
3823    ) {
3824      tradeDay: trade_day
3825      totalPnl: total_pnl
3826      totalNetPnl: total_net_pnl
3827      tradeCount: trade_count
3828      trades {
3829        id
3830        pnl
3831        netPnl: net_pnl
3832        risk
3833        entryDate: entry_date
3834        exitDate: exit_date
3835        entryPrice: entry_price
3836        exitPrice: exit_price
3837        positionSize: position_size
3838        commissionsFees: commissions_fees
3839        positionType: position_type
3840        symbol
3841      }
3842    }
3843  }
3844`,aYe=tt`
3845  query GetDailyRecapAggregate(
3846    $userId: uuid!
3847    $startDate: date!
3848    $endDate: date!
3849  ) {
3850    dailyRecapSummaryAggregate: daily_journal_summary_aggregate(
3851      where: {
3852        user_id: { _eq: $userId }
3853        trade_day: { _gte: $startDate, _lte: $endDate }
3854      }
3855    ) {
3856      aggregate {
3857        count
3858      }
3859    }
3860  }
3861`,$he=tt`
3862  query GetTradesWithFilters(
3863    $where: trade_bool_exp!
3864    $orderBy: [trade_order_by!]
3865    $limit: Int = 50
3866    $offset: Int = 0
3867  ) {
3868    trade(where: $where, order_by: $orderBy, limit: $limit, offset: $offset) {
3869      id
3870      position_type
3871      symbol
3872      entry_price
3873      exit_price
3874      position_size
3875      entry_date
3876      exit_date
3877      pnl
3878      net_pnl
3879      commissions_fees
3880      risk
3881      status
3882      notes
3883      created_at
3884      trade_tags {
3885        id
3886        tag {
3887          id
3888          name
3889          text_color
3890          background_color
3891        }
3892      }
3893    }
3894    trade_aggregate(where: $where) {
3895      aggregate {
3896        count
3897      }
3898    }
3899  }
3900`;tt`
3901  query GetTradesBasicWithFilters(
3902    $where: trade_bool_exp!
3903    $orderBy: [trade_order_by!]
3904    $limit: Int = 50
3905    $offset: Int = 0
3906  ) {
3907    trade(where: $where, order_by: $orderBy, limit: $limit, offset: $offset) {
3908      id
3909      position_type
3910      symbol
3911      entry_price
3912      exit_price
3913      position_size
3914      entry_date
3915      exit_date
3916      pnl
3917      net_pnl
3918      commissions_fees
3919      risk
3920      status
3921      created_at
3922    }
3923    trade_aggregate(where: $where) {
3924      aggregate {
3925        count
3926      }
3927    }
3928  }
3929`;const AAt=tt`
3930  query CheckExistingTrades($where: trade_bool_exp!) {
3931    trade(where: $where) {
3932      id
3933      symbol
3934      entry_date
3935      exit_date
3936      position_type
3937      entry_price
3938      exit_price
3939      position_size
3940    }
3941  }
3942`,oYe=tt`
3943  query GetUserTradesStatsByDate(
3944    $totalWhere: trade_bool_exp!
3945    $profitableWhere: trade_bool_exp!
3946    $losingWhere: trade_bool_exp!
3947    $scratchWhere: trade_bool_exp!
3948  ) {
3949    trade_aggregate(where: $totalWhere) {
3950      aggregate {
3951        sum {
3952          pnl # Suma total del PnL
3953        }
3954        count(columns: id) # Conteo total de trades en el rango de fechas
3955      }
3956    }
3957    # Sub-query para trades con ganancias
3958    profitable_trades: trade_aggregate(where: $profitableWhere) {
3959      aggregate {
3960        count(columns: id)
3961      }
3962    }
3963    # Sub-query para trades con pérdidas
3964    losing_trades: trade_aggregate(where: $losingWhere) {
3965      aggregate {
3966        count(columns: id)
3967      }
3968    }
3969    # Sub-query para trades con pnl 0.00
3970    scratch_trades: trade_aggregate(where: $scratchWhere) {
3971      aggregate {
3972        count(columns: id)
3973      }
3974    }
3975  }
3976`,lYe=tt`
3977  query GetTradeExecutionsByTradeId(
3978    $tradeId: uuid!
3979    # $limit: Int = 20 // Not used for now, client-side pagination it's being used instead.
3980    # $offset: Int = 0
3981  ) {
3982    trade_execution(
3983      where: { trade_id: { _eq: $tradeId }, deleted_at: { _is_null: true } }
3984      order_by: { execution_time: asc }
3985      # limit: $limit
3986      # offset: $offset
3987    ) {
3988      id
3989      tradeId: trade_id
3990      executionTime: execution_time
3991      quantity
3992      price
3993      positionSize: position_size
3994      commissionsFees: commissions_fees
3995      createdAt: created_at
3996      updatedAt: updated_at
3997      miscFees: misc_fees
3998      side
3999    }
4000  }
4001`,Fhe=tt`
4002  query GetTradesCountByDate($userId: uuid!, $monthStart: timestamptz!) {
4003    trade_aggregate(
4004      where: { user_id: { _eq: $userId }, created_at: { _gte: $monthStart } }
4005    ) {
4006      aggregate {
4007        count
4008      }
4009    }
4010  }
4011`,cYe=tt`
4012  query GetTradesForExport(
4013    $userId: uuid!
4014    $startDate: timestamptz!
4015    $endDate: timestamptz!
4016  ) {
4017    trade(
4018      where: {
4019        _and: [
4020          { user_id: { _eq: $userId } }
4021          { is_active: { _eq: true } }
4022          { deleted_at: { _is_null: true } }
4023          { status: { _eq: "CLOSED" } }
4024          { entry_date: { _gte: $startDate } }
4025          { entry_date: { _lte: $endDate } }
4026        ]
4027      }
4028      order_by: { entry_date: asc }
4029    ) {
4030      id
4031      userId: user_id
4032      symbol
4033      positionType: position_type
4034      entryPrice: entry_price
4035      exitPrice: exit_price
4036      positionSize: position_size
4037      entryDate: entry_date
4038      exitDate: exit_date
4039      status
4040      notes
4041      pnl
4042      netPnl: net_pnl
4043      commissionsFees: commissions_fees
4044      risk
4045      trade_executions(
4046        where: { deleted_at: { _is_null: true } }
4047        order_by: { execution_time: asc }
4048      ) {
4049        id
4050        tradeId: trade_id
4051        executionTime: execution_time
4052        quantity
4053        price
4054        positionSize: position_size
4055        commissionsFees: commissions_fees
4056        miscFees: misc_fees
4057        side
4058      }
4059    }
4060  }
4061`,uYe=tt`
4062  query GetTradesWithExecutionsBySymbolAndDate(
4063    $userId: uuid!
4064    $symbol: String!
4065    $startDate: timestamptz!
4066    $endDate: timestamptz!
4067  ) {
4068    trade(
4069      where: {
4070        _and: [
4071          { user_id: { _eq: $userId } }
4072          { symbol: { _eq: $symbol } }
4073          { entry_date: { _gte: $startDate, _lte: $endDate } }
4074          { is_active: { _eq: true } }
4075          { deleted_at: { _is_null: true } }
4076        ]
4077      }
4078      order_by: { entry_date: asc }
4079    ) {
4080      id
4081      userId: user_id
4082      symbol
4083      positionType: position_type
4084      entryPrice: entry_price
4085      exitPrice: exit_price
4086      positionSize: position_size
4087      entryDate: entry_date
4088      exitDate: exit_date
4089      status
4090      notes
4091      pnl
4092      netPnl: net_pnl
4093      commissionsFees: commissions_fees
4094      risk
4095      trade_tags {
4096        id
4097        tag {
4098          id
4099          name
4100          text_color
4101          background_color
4102        }
4103      }
4104      trade_executions(
4105        where: { deleted_at: { _is_null: true } }
4106        order_by: { execution_time: asc }
4107      ) {
4108        id
4109        tradeId: trade_id
4110        executionTime: execution_time
4111        quantity
4112        price
4113        positionSize: position_size
4114        commissionsFees: commissions_fees
4115        miscFees: misc_fees
4116        side
4117      }
4118    }
4119  }
4120`,BT=100,zhe=()=>{const{userHasura:t}=Gt(),{shouldShowProBanner:e}=Hs(),r=()=>{const o=new Date;return new Date(o.getFullYear(),o.getMonth(),1)},{data:n,loading:i}=da(Fhe,{variables:{userId:t?.id,monthStart:r().toISOString()},skip:!t?.id,fetchPolicy:"cache-and-network"}),s=e();return{...P.useMemo(()=>{const o=n?.trade_aggregate?.aggregate?.count||0,c=s?BT:1/0,u=Math.max(0,c-o),d=u>0,f=s&&o>=BT;return{currentCount:o,monthlyLimit:c,remainingTrades:u,canImport:d,isFreePlan:s,isAtLimit:f}},[n?.trade_aggregate?.aggregate?.count,s]),isLoading:i}};function DAt(t,e){const r=[];for(let n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r}const aK=(t,e,r,n)=>{if(!e)return"Please select a trading platform first";if(!r)return"User not authenticated";if(e==="thinkorswim"||e==="das"||e==="tradezero"||e==="webull"||e==="universalimport"||e==="moredge"){if(!t)return null;if(!t.name.toLowerCase().endsWith(".csv"))return"Please upload a CSV file";if(e==="das"&&!n)return"Please select the trade date for DAS Trader"}return null};async function dYe(t,e,r,n,i){if(t.length===0||e.length===0)return null;try{i({current:0,total:1,phase:"Linking tags to trades"});const s=e.flatMap(c=>t.map(u=>({trade_id:c,tag_id:u,user_id:r,created_at:new Date().toISOString()}))),a=100,o=Array.from({length:Math.ceil(s.length/a)},(c,u)=>s.slice(u*a,(u+1)*a));for(const[c,u]of o.entries())await n.mutate({mutation:aV,variables:{tradeTags:u}}),i({current:c+1,total:o.length,phase:"Linking tags to trades"});return null}catch{return console.error("Oops! Something went wrong while linking tags to trades"),"Trades imported successfully, but some tags couldn't be applied."}}async function fYe(t,e){if(t.length===0)return{limitedTrades:t,limitMessage:null};const{shouldShowProBanner:r}=Hs.getState();if(!r())return{limitedTrades:t,limitMessage:null};const i=new Date(new Date().getFullYear(),new Date().getMonth(),1),{data:s}=await xo.query({query:Fhe,variables:{userId:e,monthStart:i.toISOString()}}),a=s?.trade_aggregate.aggregate.count||0,o=BT-a;if(t.length<=o)return{limitedTrades:t,limitMessage:null};const c=t.slice(0,o),d=`Monthly limit reached. ${t.length-o} trades were skipped due to the ${BT}-trade monthly limit.`;return{limitedTrades:c,limitMessage:d}}const oK={isUploading:!1,fileName:null,progress:null,result:null,error:null,status:"idle",isMinimized:!1,lastFile:null,lastPlatform:"",lastTradeDate:null,lastIsFutures:!1},n0=Wp((t,e)=>({...oK,startUpload:r=>{t({isUploading:!0,fileName:r,status:"uploading",progress:null,result:null,error:null,isMinimized:!0})},updateProgress:r=>{t({progress:r})},setSuccess:r=>{t({isUploading:!1,result:r,status:"success",progress:null,error:null,isMinimized:!1})},setError:r=>{t({isUploading:!1,error:r,status:"error",progress:null,result:null,isMinimized:!1})},resetUpload:()=>{t(oK)},toggleMinimized:()=>{t(r=>({isMinimized:!r.isMinimized}))},setUploadContext:(r,n,i)=>{t({lastFile:r,lastPlatform:n,lastTradeDate:i?.tradeDate??null,lastIsFutures:i?.isFutures??!1})},processFile:async(r,n,i,s)=>{t({lastFile:r,lastPlatform:n,lastTradeDate:s?.tradeDate??null,lastIsFutures:s?.isFutures??!1}
4120),t({isUploading:!0,fileName:r.name,status:"uploading",progress:null,result:null,error:null,isMinimized:!0});try{const a=await r.text(),o=await(async()=>{switch(n){case"thinkorswim":{const{parseThinkOrSwimCSV:S}=await Ps(async()=>{const{parseThinkOrSwimCSV:k}=await import("./parser-Bnw8YarV.js");return{parseThinkOrSwimCSV:k}},__vite__mapDeps([0,1,2]));return S(a,s?.timeZone||"America/New_York")}case"das":{const S=s?.tradeDate||e().lastTradeDate||void 0;if(!S)throw new Error("DAS Trader requires a trade date");t({lastTradeDate:S});const{parseDasCSV:k}=await Ps(async()=>{const{parseDasCSV:E}=await import("./dasTraderParser-BmSzzhbz.js");return{parseDasCSV:E}},__vite__mapDeps([3,1,2]));return k(a,S)}case"tradestation":{const{parseTradeStationText:S}=await Ps(async()=>{const{parseTradeStationText:k}=await import("./tradeStationParser-B9MvDzN6.js");return{parseTradeStationText:k}},__vite__mapDeps([4,2]));return S(a,s?.timeZone||"America/New_York")}case"tradezero":{const{parseTradeZeroCSV:S}=await Ps(async()=>{const{parseTradeZeroCSV:k}=await import("./tradeZeroParser-BX5qpx0v.js");return{parseTradeZeroCSV:k}},__vite__mapDeps([5,2]));return S(a)}case"webull":{const{parseWebullCSV:S}=await Ps(async()=>{const{parseWebullCSV:k}=await import("./webullParser-BfM1kmMO.js");return{parseWebullCSV:k}},__vite__mapDeps([6,2]));return S(a)}case"lightspeed":{const{parseLightspeedCSV:S}=await Ps(async()=>{const{parseLightspeedCSV:k}=await import("./lightSpeedParser-B-ft8K1t.js");return{parseLightspeedCSV:k}},__vite__mapDeps([7,2]));return S(a)}case"tradervue":{const{parseTradervueCSV:S}=await Ps(async()=>{const{parseTradervueCSV:k}=await import("./traderVueParser-BSt_kfm_.js");return{parseTradervueCSV:k}},__vite__mapDeps([8,2]));return S(a)}case"universalimport":{const{parseUniversalImportCSV:S}=await Ps(async()=>{const{parseUniversalImportCSV:k}=await import("./universalImportParser-BNkT7GGx.js");return{parseUniversalImportCSV:k}},__vite__mapDeps([9,1,2]));return S(a,s?.timeZone||"America/New_York")}case"moredge":{const{parseMorEdgeCSV:S}=await Ps(async()=>{const{parseMorEdgeCSV:k}=await import("./morEdgeParser-DwWg1kll.js");return{parseMorEdgeCSV:k}},[]);return S(a)}default:throw new Error("Unsupported platform")}})(),{matchTrades:c,convertOpenTradesToMatched:u}=await Ps(async()=>{const{matchTrades:S,convertOpenTradesToMatched:k}=await import("./tradeMatcher-047d2fGp.js");return{matchTrades:S,convertOpenTradesToMatched:k}},[]),{sortExecutionsByTime:d}=await Ps(async()=>{const{sortExecutionsByTime:S}=await import("./tradeSorting-zJ12DMO_.js");return{sortExecutionsByTime:S}},[]),f={tradeHistory:d(o.tradeHistory)},{matchedTrades:h,openTrades:m}=c(f,{platform:n,isFutures:s?.isFutures}),y=u(m),x=[...h,...y],{limitedTrades:v,limitMessage:_}=await fYe(x,i);if(v.length>0){const{CREATE_MULTIPLE_TRADES:S,CREATE_MULTIPLE_EXECUTIONS:k,DELETE_MULTIPLE_TRADES:E}=await Ps(async()=>{const{CREATE_MULTIPLE_TRADES:z,CREATE_MULTIPLE_EXECUTIONS:L,DELETE_MULTIPLE_TRADES:W}=await Promise.resolve().then(()=>rYe);return{CREATE_MULTIPLE_TRADES:z,CREATE_MULTIPLE_EXECUTIONS:L,DELETE_MULTIPLE_TRADES:W}},void 0),{executeParallelImport:T}=await Ps(async()=>{const{executeParallelImport:z}=await import("./parallelImport-DdK-MH8P.js");return{executeParallelImport:z}},[]),{apolloClient:N}=await Ps(async()=>{const{apolloClient:z}=await Promise.resolve().then(()=>Wze);return{apolloClient:z}},void 0),j=N,M=async({variables:z})=>({data:(await j.mutate({mutation:S,variables:z})).data}),O=async({variables:z})=>({data:(await j.mutate({mutation:k,variables:z})).data}),R=async({variables:z})=>({data:(await j.mutate({mutation:E,variables:z})).data}),I={tradeChunkSize:600,executionChunkSize:600,maxConcurrency:3},B=z=>t({progress:z}),{savedCount:F,duplicateCount:V,insertedTradeIds:$}=await T(v,i,M,O,B,I,R),U=await dYe(s?.tagIds||[],$,i,j,B);t({isUploading:!1,result:{totalTrades:o.tradeHistory.length,matchedTrades:h.length,savedTrades:F,duplicateTrades:V,openTrades:m.length,symbols:[...new Set(v.map(z=>z.symbol))],limitMessage:_||U||void 0},status:"success",progress:null,error:null,isMinimized:!1});try{j.cache.evict({id:"ROOT_QUERY",fieldName:"trade",broadcast:!0}),j.cache.evict({id:"ROOT_QUERY",fieldName:"trade_aggregate",broadcast:!0}),j.cache.gc()}
4120catch(z){console.warn("Failed to invalidate trade count cache:",ks(z))}}else t({isUploading:!1,error:"No valid trades found in the file",status:"error",progress:null,result:null,isMinimized:!1})}catch(a){const o=a instanceof Error?a.message:"Unknown error";t({isUploading:!1,error:o,status:"error",progress:null,result:null,isMinimized:!1})}},retryUpload:async r=>{const n=e();if(!n.lastFile||!n.lastPlatform||!r){t({isUploading:!1,error:"No upload context or user available for retry",status:"error",progress:null,result:null,isMinimized:!1});return}await e().processFile(n.lastFile,n.lastPlatform,r,{tradeDate:n.lastTradeDate??void 0,isFutures:n.lastIsFutures??void 0})}})),hYe=()=>n0(yl(t=>({status:t.status,isMinimized:t.isMinimized,fileName:t.fileName}))),pYe=()=>n0(t=>t.progress),Bhe=()=>n0(t=>t.result),mYe=()=>n0(t=>t.error),oV=()=>n0(yl(t=>({startUpload:t.startUpload,updateProgress:t.updateProgress,setSuccess:t.setSuccess,setError:t.setError,resetUpload:t.resetUpload,toggleMinimized:t.toggleMinimized,setUploadContext:t.setUploadContext,retryUpload:t.retryUpload,processFile:t.processFile}))),i0={idle:{bg:"bg-app-primary",border:"border-app-border-color-soft",text:"text-gray-200",accent:"text-gray-400",progress:"bg-gray-600",icon:"text-gray-400"},uploading:{bg:"bg-app-primary",border:"border-app-border-color-soft",text:"text-white",accent:"text-blue-300",progress:"bg-blue-500",icon:"text-blue-400"},success:{bg:"bg-app-primary",border:"border-app-border-color-soft",text:"text-white",accent:"text-app-positive-color",progress:"bg-green-500",icon:"text-green-400"},error:{bg:"bg-app-primary",border:"border-app-border-color-soft",text:"text-white",accent:"text-app-negative-color",progress:"bg-red-500",icon:"text-red-400"}},gYe=({fileName:t})=>{const e=mYe(),{retryUpload:r}=oV(),{userHasura:n}=Gt(),i=n?.id,s=i0.error,a=async()=>{try{await r(i)}catch{console.error("Oops! Something went wrong while retrying the upload")}};return l.jsxs(ct.div,{className:"space-y-4 w-full",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:rn.comfortable,ease:Hr.cubic},children:[l.jsxs("div",{className:"flex items-start space-x-3 flex-1 min-w-0",children:[l.jsx(ct.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,duration:rn.smooth,ease:Hr.quart},className:"mt-1",children:l.jsx(Ts,{className:"size-4 text-red-500"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:ee("text-sm",s.text),children:"Import failed"}),l.jsx("p",{className:ee("text-xs mt-0.5 truncate",s.accent),children:t})]})]}),e&&l.jsx(ct.div,{className:"pt-2 border-t border-white/10",initial:{opacity:0}
4120,animate:{opacity:1},transition:{delay:.3,duration:rn.comfortable,ease:Hr.cubic},children:l.jsxs("div",{className:"flex items-center justify-between text-xs gap-2",children:[l.jsx("span",{className:ee(s.accent),children:e}),l.jsx(tT,{className:"w-4 h-4"}),l.jsx(ct.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},transition:{delay:.2,duration:rn.comfortable,ease:Hr.cubic},children:l.jsxs(ye,{variant:"ghost",size:"sm",className:"hover:bg-white/10 border-white/20 text-white text-xs px-3 py-1.5 hover:no-underline",onClick:a,children:[l.jsx(poe,{className:"size-3 mr-1.5"}),"Retry"]})})]})})]})},yYe=({fileName:t,status:e,onMinimize:r,onClose:n,onOpenDetailsModal:i})=>{const s=()=>{switch(e){case"uploading":return l.jsx(CYe,{fileName:t});case"success":return l.jsx(TYe,{fileName:t,onOpenDetailsModal:i});case"error":return l.jsx(gYe,{fileName:t});default:return null}};return l.jsxs("div",{className:"flex flex-row-reverse items-start justify-center relative",children:[l.jsxs("div",{className:"flex items-center justify-end space-x-1 fixed top-3.5 right-3.5 2k:top-8 2k:right-8 2k:space-x-4",children:[l.jsx(ct.button,{onClick:r,className:"p-2 hover:bg-white/10 rounded-lg transition-colors text-gray-400 hover:text-gray-300 2k:p-4","aria-label":"Minimize banner",whileHover:{scale:1.05},whileTap:{scale:.95},transition:{duration:rn.fast,ease:Hr.cubic},children:l.jsx(nMe,{className:"size-3.5 2k:w-8 2k:h-8"})}),e!=="uploading"&&l.jsx(ct.button,{onClick:n,className:"p-2 hover:bg-white/10 rounded-lg transition-colors text-gray-400 hover:text-gray-300 2k:p-4","aria-label":"Close banner",whileHover:{scale:1.05,rotate:90},whileTap:{scale:.95},transition:{duration:rn.fast,ease:Hr.cubic},children:l.jsx(pi,{className:"size-3.5 2k:w-8 2k:h-8"})})]}),s()]})},on=({icon:t,label:e,value:r,subtitle:n,className:i=""})=>l.jsxs("div",{className:ee("space-y-2",i),children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-app-primary-foreground/70 [&>svg]:size-4 [&>svg]:text-app-primary-foreground/70",children:[t&&l.jsx(t,{}),l.jsx("span",{className:"text-xs uppercase tracking-wider",children:e})]}),l.jsx("div",{className:"text-base text-app-primary-foreground/90",children:r}),n&&l.jsx("div",{className:"text-sm text-app-primary-foreground/70",children:n})]});function Pj({...t}){return l.jsx(gj,{"data-slot":"dialog",...t})}function vYe({...t}){return l.jsx(qfe,{"data-slot":"dialog-trigger",...t})}function xYe({...t}){return l.jsx(yj,{"data-slot":"dialog-portal",...t})}function bYe({...t}){return l.jsx(bj,{"data-slot":"dialog-close",...t})}const Vhe=b.forwardRef(({className:t,...e},r)=>l.jsx(vj,{ref:r,"data-slot":"dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-xs",t),...e}));Vhe.displayName="DialogOverlay";const Xw=b.forwardRef(({className:t,children:e,showCloseButton:r=!0,...n},i)=>l.jsxs(xYe,{"data-slot":"dialog-portal",children:[l.jsx(Vhe,{}),l.jsxs(xj,{ref:i,"data-slot":"dialog-content",className:ee("bg-app-card border-app-border-color-soft data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-lg duration-200 sm:max-w-lg overflow-y-auto max-h-[calc(100%-2rem)]",t),...n,children:[e,r&&l.jsxs(bj,{"data-slot":"dialog-close",className:"focus:ring-app-border-color-accent data-[state=open]:bg-app-button-bg data-[state=open]:text-app-primary-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-1 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",children:[l.jsx(pi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xw.displayName="DialogContent";function Mj({className:t,...e}){return l.jsx("div",{"data-slot":"dialog-header",className:ee("flex flex-col gap-2 text-center sm:text-left",t),...e})}function _b({className:t,...e}){return l.jsx("div",{"data-slot":"dialog-footer",className:ee("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}const Jw=b.forwardRef(({className:t,...e},r)=>l.jsx(GB,{ref:r,"data-slot":"dialog-title",className:ee("text-lg leading-none font-semibold",t),...e}));Jw.displayName="DialogTitle";const Aj=b.forwardRef(({className:t,...e},r)=>l.jsx(WB,{ref:r,"data-slot":"dialog-description",className:ee("text-app-primary-foreground
4120/70 text-sm",t),...e}));Aj.displayName="DialogDescription";const wYe=({isOpen:t,onClose:e,result:r,fileName:n})=>{const{userHasura:i}=Gt();if(!r)return null;const s=r.totalTrades>0?Math.round(r.duplicateTrades/r.totalTrades*100):0;return l.jsx(Pj,{open:t,onOpenChange:e,children:l.jsxs(Xw,{className:"min-w-2xl rounded-2xl",children:[l.jsxs(Mj,{children:[l.jsx(Jw,{children:"Import Details"}),l.jsx(Aj,{"aria-hidden":!0,className:"sr-only"})]}),l.jsxs("div",{className:"space-y-6 2k:space-y-10",children:[l.jsxs("div",{className:"flex items-center gap-3 2k:gap-6",children:[l.jsx(e3,{className:"size-5 text-app-primary-foreground/70 2k:w-10 2k:h-10"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-app-primary-foreground/70 2k:text-xl",children:"Imported File"}),l.jsx("p",{className:"font-mono text-white",children:n||"Unknown file"})]})]}),i?.initial_risk&&i.initial_risk!==0&&l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-4 font-normal bg-app-button-bg border-none text-app-primary-foreground/90 [&>svg]:text-app-primary-foreground/90",children:[l.jsx(i3,{className:"size-5 mt-1"}),l.jsx(Dw,{className:"font-medium max-w-sm leading-relaxed",children:"Initial Risk Applied"}),l.jsxs(_o,{className:"font-light leading-relaxed text-app-primary-foreground/80",children:["A default initial risk of"," ",l.jsxs("span",{className:"font-semibold",children:["$",i.initial_risk.toLocaleString()]})," ","from your account settings was automatically applied to all imported trades.",l.jsx("br",{}),l.jsxs(At,{to:"/app/profile",onClick:e,className:"inline-flex items-center text-app-primary-foreground/80 hover:text-app-primary-foreground underline underline-offset-4 transition-all duration-300 focus:outline-hidden focus:ring-4 focus:ring-app-primary-foreground/20 focus:ring-offset-0 rounded-xs decoration-app-border-color-accent group mt-1",children:["Manage your risk settings",l.jsx(Cs,{className:"ml-1 h-3 w-3 translate-y-0 translate-x-0 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-transform duration-300"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6 2k:gap-10",children:[l.jsx(on,{icon:_s,label:"Open Trades",value:r.openTrades,subtitle:"Trades that are still open"}),l.jsx(on,{icon:ooe,label:"Total Executions",value:r.totalTrades,subtitle:"Raw executions found in CSV"}),l.jsx(on,{icon:X4,label:"Matched Trades",value:r.matchedTrades,subtitle:`${r.matchedTrades} trades matched`}),l.jsx(on,{icon:moe,label:"Saved Trades",value:r.savedTrades,subtitle:"New trades added to portfolio"}),l.jsx(on,{icon:coe,label:"Duplicate Trades",value:r.duplicateTrades,subtitle:s>0?`${s}% of total`:"No duplicates found"})]}),r.symbols.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-xs font-normal uppercase tracking-wider text-app-primary-foreground/70 mb-3 2k:text-xl",children:["Symbols Imported (",r.symbols.length,")"]}),l.jsx("div",{className:"flex flex-wrap gap-2 2k:gap-4",children:r.symbols.map(a=>l.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-app-button-bg text-gray-300 2k:text-xl 2k:px-4 2k:py-2",children:a},a))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-normal uppercase tracking-wider text-app-primary-foreground/70 mb-3 2k:text-xl",children:"Import Summary"}),l.jsxs("p",{className:"text-sm text-app-primary-foreground/90 2k:text-xl [&>strong]:font-semibold [&>strong]:text-app-primary-foreground",children:["Successfully processed"," ",l.jsx("strong",{children:r.savedTrades})," ","new trades from"," ",l.jsx("strong",{children:r.totalTrades})," ","total executions.",r.duplicateTrades>0&&l.jsxs("span",{children:[" ","Found and skipped"," ",r.duplicateTrades," ","duplicate trades."]})]})]}),r.limitMessage&&l.jsx("div",{className:"p-4 bg-yellow-900/20 border border-yellow-700 rounded-lg 2k:p-8",children:l.jsx("p",{className:"text-sm text-yellow-200 2k:text-xl",children:r.limitMessage})}),r.errors&&r.errors.length>0&&l.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-700 rounded-lg 2k:p-8",children:[l.jsx("h3",{className:"font-medium text-red-300 mb-2 2k:text-2xl",children:"Import Errors"}),l.jsx("ul",{className:"text-sm text-red-200 space-y-1 2k:text-xl",children:r.errors.map(a=>l.jsxs("li",{className:"flex items-start gap-2 2k:gap-4",children:[l.jsx("span",{className:"text-red-400 mt-0.5 2k:text-2xl",children:"•"}),a]},a))})]})]}),l.jsx(_b,{children:l.jsxs(ye,{onClick:e,variant:"secondary",className:"2k:text-2xl 2k:px-8 2k:py-4 border-none",children:[l.jsx(pi,{className:"size-4 mr-2 2k:w-8 2k:h-8"}),"Close"]})})]})})},gn=({size:t="md",className:e,iconClassName:r})=>{const n={sm:"size-3",md:"size-8",lg:"size-12"};return l.jsx("div",{className:ee("flex justify-center items-center",e),children:l.jsx("div",{className:ee("animate-spin rounded-full border-b-2 border-app-border-color-accent",n[t],r),role:"status","aria-label":"Loading"})})};function _Ye({children:t,as:e="p",className:r,duration:n=2,spread:i=2}){const s=ct.create(e),a=b.useMemo(()=>t.length*i,[t,i]);return l.jsx(s,{className:ee("relative inline-block bg-size-[250%_100%,auto] bg-clip-text","text-transparent [--base-color:#71717a] [--base-gradient-color:#ffffff]","[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]","dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]",r),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:n,ease:"linear"},style:{"--spread":`${a}px`,backgroundImage:"var(--bg), linear-gradient(var(--base-color), var(--base-color))"},children:t})}const lV=P.memo(_Ye),SYe=({fileName:t,status:e,onExpand:r})=>{const n=i0[e],i=()=>{switch(e){case"uploading":return l.jsx(gn,{size:"sm",className:"2k:w-8 2k:h-8"});case"success":return l.jsx(ei,{className:"size-4 text-app-positive-color 2k:w-8 2k:h-8"});case"error":return l.jsx(Ts,{className:"size-4 text-red-500 2k:w-8 2k:h-8"});default:return null}},s=()=>{switch(e){case"uploading":return"Importing trades...";case"success":return"Import complete";case"error":return"Import failed";default:return""}};return l.jsx(ct.button,{onClick:r,className:"flex items-center justify-between w-full px-4 py-2.5 hover:bg-white/5 transition-colors duration-200 rounded-full group 2k:px-8 2k:py-5","aria-label":`Expand upload details for ${t}`,whileHover:{scale:1.02},whileTap:{scale:.98},transition:{duration:rn.fast,ease:Hr.cubic},children:l.jsxs("div",{className:"flex flex-row items-center gap-3.5 justify-between w-full 2k:gap-8",children:[l.jsx("div",{className:"shrink-0",children:i()}),l.jsx("div",{className:"flex-1 min-w-0 text-center text-xs 2k:text-2xl",children:e==="uploading"?l.jsx(lV,{className:"text-sm 2k:text-2xl",children:s()}):l.jsx("span",{className:ee("text-sm 2k:text-2xl",n.text),children:s()})}),l.jsx(rMe,{className:"size-3.5 text-gray-400 group-hover:text-gray-300 transition-colors 2k:w-8 2k:h-8"})]})})},kYe=({value:t,status:e})=>{const r=i0[e],n=Math.min(Math.max(t,0),100);return l.jsx("div",{className:"w-full h-1.5 bg-gray-800/60 rounded-full overflow-hidden 2k:h-4",children:l.jsx(ct.div,{className:ee("h-full rounded-full",r.progress),initial:{width:0},animate:{width:`${n}%`},transition:{duration:rn.comfortable,ease:Hr.quad}})})},TYe=({fileName:t,onOpenDetailsModal:e})=>{const r=Bhe(),n=i0.success;return l.jsxs(ct.div,{className:"space-y-4 w-full",initial:{opacity:0,y:8}
4120,animate:{opacity:1,y:0},transition:{duration:rn.comfortable,ease:Hr.cubic},children:[l.jsxs("div",{className:"flex items-start space-x-3 flex-1 min-w-0 2k:space-x-8",children:[l.jsx(ct.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,duration:rn.smooth,ease:Hr.quart},className:"mt-1",children:l.jsx(ei,{className:"size-4 text-green-400 2k:w-10 2k:h-10"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:ee("text-sm font-semibold 2k:text-2xl",n.text),children:"Import complete"}),l.jsx("p",{className:ee("text-xs mt-0.5 truncate 2k:text-xl",n.accent),children:t})]})]}),r&&l.jsxs(ct.div,{className:"pt-2 border-t border-white/10",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3,duration:rn.comfortable,ease:Hr.cubic},children:[l.jsxs("div",{className:"flex items-center justify-between text-xs gap-2 2k:text-xl 2k:gap-6",children:[l.jsxs("span",{className:ee(n.accent),children:[r.savedTrades.toLocaleString()," ","trades imported"]}),l.jsx(tT,{className:"w-4 h-4 2k:w-8 2k:h-8"}),l.jsxs("span",{className:ee("text-red-400"),children:[r.duplicateTrades.toLocaleString()," ","duplicates"]}),l.jsx(tT,{className:"w-4 h-4 2k:w-8 2k:h-8"}),l.jsx(ct.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},transition:{delay:.2,duration:rn.comfortable,ease:Hr.cubic},children:l.jsx(ye,{variant:"ghost",size:"sm",className:"hover:bg-white/10 border-white/20 text-white text-xs px-3 py-1.5 hover:no-underline 2k:text-xl 2k:px-6 2k:py-3",onClick:e,children:"View Details"})})]}),r.limitMessage&&l.jsx(ct.div,{className:"mt-2 pt-2 border-t border-white/10",initial:{opacity:0}
4120,animate:{opacity:1},transition:{delay:.4,duration:rn.comfortable,ease:Hr.cubic},children:l.jsx("p",{className:ee("text-xs text-yellow-400 2k:text-xl"),children:r.limitMessage})})]})]})},CYe=({fileName:t})=>{const e=pYe(),r=i0.uploading;return l.jsxs(ct.div,{className:"space-y-4 w-full",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:rn.comfortable,ease:Hr.cubic},children:[l.jsxs("div",{className:"flex items-start space-x-3 flex-1 min-w-0 2k:space-x-8",children:[l.jsx(gn,{size:"sm",className:"mt-1 text-blue-400 2k:w-10 2k:h-10"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:ee("text-sm font-medium 2k:text-2xl",r.text),children:"Importing trades"}),l.jsx("p",{className:ee("text-xs mt-0.5 truncate 2k:text-xl",r.accent),children:t})]})]}),e&&l.jsxs(ct.div,{className:"pt-2 border-t border-white/10",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:rn.comfortable,ease:Hr.cubic},children:[l.jsxs("div",{className:"flex items-center justify-between text-xs gap-2 2k:text-xl 2k:gap-6",children:[l.jsx("span",{className:ee(r.accent),children:e.phase}),l.jsx(tT,{className:"w-4 h-4 2k:w-8 2k:h-8"}),l.jsxs("span",{className:ee("font-mono tabular-nums",r.accent),children:[e.current.toLocaleString()," ","/"," ",e.total.toLocaleString()]})]}),l.jsx("div",{className:"mt-2 2k:mt-4",children:l.jsx(kYe,{value:e.current/e.total*100,status:"uploading"})})]})]})},EYe=({containerProp:t})=>{const[e,r]=b.useState(!1),[n,i]=b.useState(!1),{status:s,isMinimized:a,fileName:o}=hYe(),{toggleMinimized:c,resetUpload:u}=oV(),d=Bhe(),f=i0[s],h=x=>(x.preventDefault(),"Upload in progress. Are you sure you want to leave?");if(b.useEffect(()=>{r(!0)},[]),b.useEffect(()=>{if(s==="uploading")return window.addEventListener("beforeunload",h),()=>{window.removeEventListener("beforeunload",h)}},[s]),!e||s==="idle"||!o)return null;const m=l.jsx(Ss,{mode:"wait",children:l.jsx(ct.div,{initial:{opacity:0,y:-60,scale:.9,x:"-50%"},animate:{opacity:1,y:0,scale:1,x:"-50%"},exit:{opacity:0,y:-60,x:"-50%",scale:.9,transition:{duration:rn.comfortable,ease:Z9e.quad}},transition:{duration:rn.relaxed,ease:Hr.cubic},className:ee("fixed top-6 left-1/2 z-50 backdrop-blur-xl select-none border rounded-3xl",f.bg,f.border,a?"px-1.5 py-1.5 min-w-[160px] max-w-[300px] 2k:max-w-[760px]":"px-6 py-5 min-w-[320px] max-w-[420px] 2k:max-w-[720px]"),style:{backdropFilter:"blur(20px) saturate(180%)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05)",transformOrigin:"center top"},role:"banner","aria-live":"polite","aria-label":"Upload progress banner",children:l.jsx(Ss,{mode:"wait",children:a?l.jsx(ct.div,{initial:{opacity:0}
4120,animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},children:l.jsx(SYe,{fileName:o,status:s,onExpand:c})},"minimized"):l.jsx(ct.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},children:l.jsx(yYe,{fileName:o,status:s,onMinimize:c,onClose:u,onOpenDetailsModal:()=>i(!0)})},"expanded")})},`banner-${s}-${a?"min":"exp"}`)}),y=t??(e?globalThis.document?.body:null);return y?l.jsxs(l.Fragment,{children:[VE.createPortal(m,y),l.jsx(wYe,{isOpen:n,onClose:()=>i(!1),result:d,fileName:o})]}):null},jYe=()=>{const{isLoading:t,userHasura:e,isInitialized:r}=Gt(),{loadPlans:n,isInitialized:i}=Hs();b.useEffect(()=>{!r||t||!e?.id||i||n()},[r,t,e?.id,i,n])},NYe=tt`
4121  subscription GetUserSubscriptionStatus($userId: uuid!) {
4122    user_by_pk(id: $userId) {
4123      id
4124      current_subscription_id
4125    }
4126  }
4127`,Uhe=(t=!0,e=3e4)=>{const{userHasura:r}=Gt(),[n,i]=b.useState(!1),[s,a]=b.useState(null),[o,c]=b.useState(null),u=b.useRef(null),{loading:d,error:f}=bEe(NYe,{variables:{userId:r?.id},skip:!t||!r?.id,onError:h=>{c(`Subscription failed: ${h.message}`)},onData:({data:h})=>{if(u.current&&(clearTimeout(u.current),u.current=null),h?.data?.user_by_pk){const m=h.data.user_by_pk;!!m.current_subscription_id?(i(!0),a(m.current_subscription_id),c(null)):(i(!1),a(null),u.current=setTimeout(()=>{c("Payment confirmation timeout. Please try again or contact support.")},e))}}});return b.useEffect(()=>((!t||!r?.id)&&(i(!1),a(null),c(null),u.current&&(clearTimeout(u.current),u.current=null)),()=>{u.current&&clearTimeout(u.current)}),[t,r?.id]),{isActive:t&&!!r?.id,isConfirmed:n,subscriptionId:s,error:o||(f?f.message:null),loading:d}},PYe=(t,e)=>{const[r,n]=b.useState(t),i=b.useRef(e),s=b.useRef();return b.useEffect(()=>{i.current=e},[e]),b.useEffect(()=>(s.current&&clearInterval(s.current),n(t),t>0&&(s.current=setInterval(()=>{n(a=>a<=1?(s.current&&clearInterval(s.current),i.current(),0):a-1)},1e3)),()=>{s.current&&clearInterval(s.current)}),[t]),r},uS=({onValidChange:t})=>{const{finish:e}=sV(),{isConfirmed:r,loading:n,error:i}=Uhe(!0,3e4),s=P.useCallback(()=>{t(!0,{subscriptionConfirmed:!0}),e()},[t,e]),a=PYe(r?4:0,s);return n?l.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6",children:l.jsxs("div",{className:"text-center max-w-lg mx-auto",children:[l.jsx(gn,{size:"md",className:"mb-4"}),l.jsx("div",{className:"flex items-center justify-center gap-3 p-4 mb-6 rounded-lg border border-blue-500/40 bg-blue-500/10",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-blue-700",children:"Verifying Payment"}),l.jsx("p",{className:"text-xs text-blue-600",children:"Please wait while we confirm your subscription..."})]})})]})}):i||!r?l.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6",children:l.jsx("div",{className:"text-center max-w-lg mx-auto",children:l.jsxs("div",{className:"flex items-center justify-center gap-3 p-4 mb-6 rounded-lg border border-red-500/40 bg-red-500/10",children:[l.jsx(Ts,{size:16}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-red-700",children:"Payment Not Confirmed"}),l.jsx("p",{className:"text-xs text-red-600",children:"Please return to the plan selection step to complete your payment."})]})]})})}):l.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6",children:l.jsxs("div",{className:"text-center max-w-lg mx-auto",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsx("div",{className:"relative",children:l.jsx("div",{className:"relative bg-app-card border border-app-border-color-soft rounded-full p-6 shadow-2xl",children:l.jsx(X4,{size:48,className:"text-green-500",strokeWidth:1.5})})})}),l.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Payment Successful!"}),l.jsxs("p",{className:"text-lg text-app-primary-foreground/70 mb-8 leading-relaxed",children:["Thank you for your purchase! Your subscription has been activated."," ",a>0&&l.jsxs("span",{children:["Redirecting in",a," ","seconds..."]})]}),l.jsxs("div",{className:"mt-8 p-6 bg-app-card/50 border border-app-border-color-soft rounded-xl backdrop-blur-xs",children:[l.jsx("p",{className:"text-sm text-app-primary-foreground
4127/60 mb-2",children:l.jsx("strong",{children:"What's next?"})}),l.jsx("p",{className:"text-sm text-app-primary-foreground/60",children:"You'll receive a confirmation email shortly. Your subscription is now active."})]})]})})};function MYe(t,{urlKeys:e={}}={}){function r(n,{strict:i=!1}={}){if(n instanceof Promise)return n.then(o=>r(o,{strict:i}));const s=AYe(n),a={};for(const[o,c]of Object.entries(t)){const u=e[o]??o,d=s.get(u);if(d===null){a[o]=c.defaultValue??null;continue}let f;try{f=c.parse(d)}catch(h){if(i)throw new Error(`[nuqs] Error while parsing query \`${d}\` for key \`${o}\`: ${h}`);f=null}if(i&&d&&f===null)throw new Error(`[nuqs] Failed to parse query \`${d}\` for key \`${o}\` (got null)`);a[o]=f??c.defaultValue??null}return a}return r}function AYe(t){try{if(t instanceof Request)return t.url?new URL(t.url).searchParams:new URLSearchParams;if(t instanceof URL)return t.searchParams;if(t instanceof URLSearchParams)return t;if(typeof t=="object"){const e=new URLSearchParams;for(const[r,n]of Object.entries(t))if(Array.isArray(n))for(const i of n)e.append(r,i);else n!==void 0&&e.set(r,n);return e}if(typeof t=="string")return URL.hasOwnProperty("canParse")&&URL.canParse(t)?new URL(t).searchParams:new URLSearchParams(t)}catch{}return new URLSearchParams}function cV(t,e,r){try{return t(e)}catch(n){return HHe("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),e,n,r),null}}function zo(t){function e(r){if(typeof r>"u")return null;let n="";if(Array.isArray(r)){if(r[0]===void 0)return null;n=r[0]}return typeof r=="string"&&(n=r),cV(t.parse,n)}return{eq:(r,n)=>r===n,...t,parseServerSide:e,withDefault(r){return{...this,defaultValue:r,parseServerSide(n){return e(n)??r}}},withOptions(r){return{...this,...r}}}}const lK=zo({parse:t=>t,serialize:String}),Zg=zo({parse:t=>{const e=parseInt(t);return e==e?e:null},serialize:t=>""+Math.round(t)});zo({parse:t=>{const e=parseInt(t);return e==e?e-1:null},serialize:t=>""+Math.round(t+1)});zo({parse:t=>{const e=parseInt(t,16);return e==e?e:null},serialize:t=>{const e=Math.round(t).toString(16);return(e.length&1?"0":"")+e}});const cK=zo({parse:t=>{const e=parseFloat(t);return e==e?e:null},serialize:String});zo({parse:t=>t==="true",serialize:String});function uV(t,e){return t.valueOf()===e.valueOf()}zo({parse:t=>{const e=parseInt(t);return e==e?new Date(e):null},serialize:t=>""+t.valueOf(),eq:uV});const uK=zo({parse:t=>{const e=new Date(t);return e.valueOf()==e.valueOf()?e:null},serialize:t=>t.toISOString(),eq:uV});zo({parse:t=>{const e=new Date(t.slice(0,10));return e.valueOf()==e.valueOf()?e:null},serialize:t=>t.toISOString().slice(0,10),eq:uV});function df(t){return zo({parse:e=>{const r=e;return t.includes(r)?r:null},serialize:String})}function Ghe(t,e=","){const r=t.eq??((i,s)=>i===s),n=encodeURIComponent(e);return zo({parse:i=>i===""?[]:i.split(e).map((s,a)=>cV(t.parse,s.replaceAll(n,e),`[${a}]`)).filter(s=>s!=null),serialize:i=>i.map(s=>(t.serialize?t.serialize(s):String(s)).replaceAll(e,n)).join(e),eq(i,s){return i===s?!0:i.length!==s.length?!1:i.every((a,o)=>r(a,s[o]))}})}const kA=zB(),DYe={};function Dj(t,e={}){const r=b.useId(),n=e8e(),i=t8e(),{history:s="replace",scroll:a=n?.scroll??!1,shallow:o=n?.shallow??!0,throttleMs:c=Ex.timeMs,limitUrlUpdates:u=n?.limitUrlUpdates,clearOnDefault:d=n?.clearOnDefault??!0,startTransition:f,urlKeys:h=DYe}=e,m=Object.keys(t).join(","),y=b.useMemo(()=>Object.fromEntries(Object.keys(t).map(O=>[O,h[O]??O])),[m,JSON.stringify(h)]),x=JHe(Object.values(y)),v=x.searchParams,_=b.useRef({}),S=b.useMemo(()=>Object.fromEntries(Object.keys(t).map(O=>[O,t[O].defaultValue??null])),[Object.values(t).map(({defaultValue:O})=>O).join(",")]),k=jx.useQueuedQueries(Object.values(y)),[E,T]=b.useState(()=>{const O=v??new URLSearchParams;return TA(t,h,O,k).state}),N=b.useRef(E);if(en("[nuq+ %s `%s`] render - state: %O, iSP: %s",r,m,E,v),Object.keys(_.current).join("&")!==Object.values(y).join("&")){const{state:O,hasChanged:R}=TA(t,h,v,k,_.current,N.current);R&&(en("[nuq+ %s `%s`] State changed: %O",r,m,{state:O,initialSearchParams:v,queuedQueries:k,queryRef:_.current,stateRef:N.current}),N.current=O,T(O)),_.current=Object.fromEntries(Object.values(y).map(I=>[I,v?.get(I)??null]))}b.useEffect(()=>{const{state:O,hasChanged:R}=TA(t,h,v,k,_.current,N.current);R&&(en("[nuq+ %s `%s`] State changed: %O",r,m,{state:O,initialSearchParams:v,queuedQueries:k,queryRef:_.current,stateRef:N.current}),N.current=O,T(O))},[Object.values(y).map(O=>`${O}=${v?.get(O)}`).join("&"),JSON.stringify(k)]),b.useEffect(()=>{function O(I){en("[nuq+ %s `%s`] updateInternalState %O",r,m,I),N.current=I,T(I)}const R=Object.keys(t).reduce((I,B)=>(I[B]=({state:F,query:V})=>{const{defaultValue:$}=t[B],U=y[B];N.current={...N.current,[B]:F??$??null},_.current[U]=V,en("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). Resolved: %O",r,m,U,F,$,N.current),O(N.current)},I),{});for(const I of Object.keys(t)){const B=y[I];en("[nuq+ %s `%s`] Subscribing to sync for `%s`",r,B,m),kA.on(B,R[I])}return()=>{for(const I of Object.keys(t)){const B=y[I];en("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",r,B,m),kA.off(B,R[I])}}},[m,y]);const j=b.useCallback((O,R={})=>{const I=Object.fromEntries(Object.keys(t).map(z=>[z,null])),B=typeof O=="function"?O(dK(N.current,S))??I:O??I;en("[nuq+ %s `%s`] setState: %O",r,m,B);let F,V=0;const $=[];for(let[z,L]of Object.entries(B)){const W=t[z],K=y[z];if(!W)continue;(R.clearOnDefault??W.clearOnDefault??d)&&L!==null&&W.defaultValue!==void 0&&(W.eq??((Y,J)=>Y===J))(L,W.defaultValue)&&(L=null);const q=L===null?null:(W.serialize??String)(L);kA.emit(K,{state:L,query:q});
4127const H={key:K,query:q,options:{history:R.history??W.history??s,shallow:R.shallow??W.shallow??o,scroll:R.scroll??W.scroll??a,startTransition:R.startTransition??W.startTransition??f}};if(R?.limitUrlUpdates?.method==="debounce"||u?.method==="debounce"||W.limitUrlUpdates?.method==="debounce"){H.options.shallow===!0&&console.warn(Xy(422));const Y=R?.limitUrlUpdates?.timeMs??u?.timeMs??W.limitUrlUpdates?.timeMs??Ex.timeMs,J=jx.push(H,Y,x);V<Y&&(F=J,V=Y)}else{const Y=R?.limitUrlUpdates?.timeMs??W?.limitUrlUpdates?.timeMs??u?.timeMs??R.throttleMs??W.throttleMs??c;$.push(jx.abort(K)),vb.push(H,Y)}}const U=$.reduce((z,L)=>L(z),vb.flush(x,i));return F??U},[m,s,o,a,c,u?.method,u?.timeMs,f,y,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,i,S]);return[b.useMemo(()=>dK(E,S),[E,S]),j]}function TA(t,e,r,n,i,s){let a=!1;const o=Object.keys(t).reduce((c,u)=>{const d=e?.[u]??u,{parse:f}=t[u],h=n[d],m=h===void 0?r?.get(d)??null:h;if(i&&s&&(i[d]??null)===m)return c[u]=s[u]??null,c;a=!0;const y=m===null?null:cV(f,m,u);return c[u]=y??null,i&&(i[d]=m),c},{});if(!a){const c=Object.keys(t),u=Object.keys(s??{});a=c.length!==u.length||c.some(d=>!u.includes(d))}return{state:o,hasChanged:a}}function dK(t,e){return Object.fromEntries(Object.keys(t).map(r=>[r,t[r]??e[r]??null]))}function ys(t,e={}){const{parse:r=d=>d,serialize:n,eq:i,defaultValue:s,...a}=e,[{[t]:o},c]=Dj({[t]:{parse:r,serialize:n,eq:i,defaultValue:s}},a),u=b.useCallback((d,f={})=>c(h=>({[t]:typeof d=="function"?d(h[t]):d}),f),[t,c]);return[o,u]}const OYe=({interval:t,onIntervalChange:e})=>l.jsx("div",{className:"flex justify-center mb-2",children:l.jsxs("div",{className:"inline-flex bg-app-input-bg rounded-full p-1 border border-app-border-color-soft",children:[l.jsx("button",{className:`px-6 py-2 rounded-full text-sm font-semibold transition-colors 2k:text-2xl ${t==="month"?"bg-app-button-bg-active text-white":"text-gray-400"}`,onClick:()=>e("month"),children:"Monthly"}),l.jsx("button",{className:`px-6 py-2 rounded-full text-sm font-semibold transition-colors 2k:text-2xl 2k:px-10 ${t==="year"?"bg-app-button-bg-active text-white":"text-gray-400"}`,onClick:()=>e("year"),children:"Yearly"})]})}),RYe=(t,e)=>t==null?e:e==null?t:Math.max(t,e),CA=new WeakMap,dV={onUpdate(t,e,r){if(CA.set(r,void 0),!r.computedTrend)return;const n=e.integer.concat(e.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.find(o=>!i.find(c=>c.pos===o.pos&&c.value===o.value)),a=i.find(o=>!n.find(c=>o.pos===c.pos&&o.value===c.value));CA.set(r,RYe(s?.pos,a?.pos))},getDelta(t,e,r){const n=t-e,i=CA.get(r.flow);if(!n&&i!=null&&i>=r.pos)return r.length*r.flow.computedTrend}},ff=(t,e,r)=>{const n=document.createElement(t),[i,s]=Array.isArray(e)?[void 0,e]:[e,r];return i&&Object.assign(n,i),s?.forEach(a=>n.appendChild(a)),n},IYe=(t,e)=>{var r;return e==="left"?t.offsetLeft:(((r=t.offsetParent instanceof HTMLElement?t.offsetParent:null)==null?void 0:r.offsetWidth)??0)-t.offsetWidth-t.offsetLeft},LYe=t=>t.offsetWidth>0&&t.offsetHeight>0,$Ye=(t,e)=>{!customElements.get(t)&&customElements.define(t,e)};function FYe(t,e,{reverse:r=!1}={}){const n=t.length;for(let i=r?n-1:0;r?i>=0:i<n;r?i--:i++)e(t[i],i)}function zYe(t,e,r,n){const i=e.formatToParts(t);r&&i.unshift({type:"prefix",value:r}),n&&i.push({type:"suffix",value:n});const s=[],a=[],o=[],c=[],u={},d=x=>`${x}:${u[x]=(u[x]??-1)+1}`;let f="",h=!1,m=!1;for(const x of i){f+=x.value;const v=x.type==="minusSign"||x.type==="plusSign"?"sign":x.type;v==="integer"?(h=!0,a.push(...x.value.split("").map(_=>({type:v,value:parseInt(_)})))):v==="group"?a.push({type:v,value:x.value}):v==="decimal"?(m=!0,o.push({type:v,value:x.value,key:d(v)})):v==="fraction"?o.push(...x.value.split("").map(_=>({type:v,value:parseInt(_),key:d(v),pos:-1-u[v]}))):(h||m?c:s).push({type:v,value:x.value,key:d(v)})}const y=[];for(let x=a.length-1;x>=0;x--){const v=a[x];y.unshift(v.type==="integer"?{...v,key:d(v.type),pos:u[v.type]}:{...v,key:d(v.type)})}return{pre:s,integer:y,fraction:o,post:c,valueAsString:f,value:typeof t=="string"?parseFloat(t):t}}const BYe=String.raw,VYe=(()=>{try{document.createElement("div").animate({opacity:0}
4127,{easing:"linear(0, 1)"})}catch{return!1}return!0})(),UYe=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),fK=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,VT="--_number-flow-d-opacity",fV="--_number-flow-d-width",UT="--_number-flow-dx",hV="--_number-flow-d",GYe=(()=>{try{return CSS.registerProperty({name:VT,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:UT,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:fV,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:hV,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),WYe="var(--number-flow-char-height, 1em)",Pd="var(--number-flow-mask-height, 0.25em)",hK=`calc(${Pd} / 2)`,VF="var(--number-flow-mask-width, 0.5em)",ph=`calc(${VF} / var(--scale-x))`,dS="#000 0, transparent 71%",pK=BYe`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${WYe} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${fV}) / var(--width));transform:translateX(var(${UT})) scaleX(var(--scale-x));margin:0 calc(-1 * ${VF});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${ph},#000 calc(100% - ${ph}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Pd},#000 calc(100% - ${Pd}),transparent 100% ),radial-gradient(at bottom right,${dS}),radial-gradient(at bottom left,${dS}),radial-gradient(at top left,${dS}),radial-gradient(at top right,${dS});-webkit-mask-size:100% calc(100% - ${Pd} * 2),calc(100% - ${ph} * 2) 100%,${ph} ${Pd},${ph} ${Pd},${ph} ${Pd},${ph} ${Pd};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${hK} ${VF};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${UT})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${hV})}.digit__num,.number .section::after{padding:${hK} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${VT}))}`,HYe=HTMLElement,qYe=UYe&&VYe&&GYe;let fS,Whe=class extends HYe{constructor(){super(),this.created=!1,this.batched=!1;const{animated:e,...r}=this.constructor.defaultProps;this._animated=this.computedAnimated=e,Object.assign(this,r)}get animated(){return this._animated}set animated(e){var r;this.animated!==e&&(this._animated=e,(r=this.shadowRoot)==null||r.getAnimations().forEach(n=>n.finish()))}set data(e){var r;if(e==null)return;const{pre:n,integer:i,fraction:s,post:a,value:o}=e;if(this.created){const c=this._data;this._data=e,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,o):this.trend,this.computedAnimated=qYe&&this._animated&&(!this.respectMotionPreference||!(fK!=null&&fK.matches))&&LYe(this),(r=this.plugins)==null||r.forEach(u=>{var d;return(d=u.onUpdate)==null?void 0:d.call(u,e,c,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:i,fraction:s}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=e,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)fS||(fS=new CSSStyleSheet,fS.replaceSync(pK)),this.shadowRoot.adoptedStyleSheets=[fS];else{const c=document.createElement("style");c.textContent=pK,this.shadowRoot.appendChild(c)}this._pre=new gK(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new YYe(this,i,s),this.shadowRoot.appendChild(this._num.el),this._post=new gK(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=e.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.
vendor: 6,021 bytes, line 4127
4127willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const e=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(r=>r.finished)).then(()=>{e.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=e}};Whe.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(t,e)=>Math.sign(e-t),respectMotionPreference:!0,plugins:void 0,digits:void 0};let YYe=class{constructor(e,r,n,{className:i,...s}={}){this.flow=e,this._integer=new mK(e,r,{justify:"right",part:"integer"}),this._fraction=new mK(e,n,{justify:"left",part:"fraction"}),this._inner=ff("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=ff("span",{...s,part:"number",className:`number ${i??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:e,fraction:r}){this._integer.update(e),this._fraction.update(r)}didUpdate(){const e=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const r=this._prevLeft-e.left,n=this.el.offsetWidth,i=this._prevWidth-n;this.el.style.setProperty("--width",String(n)),this.el.animate({[UT]:[`${r}px`,"0px"],[fV]:[i,0]},{...this.flow.transformTiming,composite:"accumulate"})}},Hhe=class{constructor(e,r,{justify:n,className:i,...s},a){this.flow=e,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=n;const o=r.map(c=>this.addChar(c).el);this.el=ff("span",{...s,className:`section section--justify-${n} ${i??""}`},a?a(o):o)}addChar(e,{startDigitsAtZero:r=!1,...n}={}){const i=e.type==="integer"||e.type==="fraction"?new Yhe(this,e.type,r?0:e.value,e.pos,{...n,onRemove:this.onCharRemove(e.key)}):new KYe(this,e.type,e.value,{...n,onRemove:this.onCharRemove(e.key)});return this.children.set(e.key,i),i}unpop(e){e.el.removeAttribute("inert"),e.el.style.top="",e.el.style[this.justify]=""}pop(e){e.forEach(r=>{r.el.style.top=`${r.el.offsetTop}px`,r.el.style[this.justify]=`${IYe(r.el,this.justify)}px`}),e.forEach(r=>{r.el.setAttribute("inert",""),r.present=!1})}addNewAndUpdateExisting(e){const r=new Map,n=new Map,i=this.justify==="left",s=i?"prepend":"append";if(FYe(e,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),n.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),r.set(a,o)),this.el[s](o.el)},{reverse:i}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();r.forEach(o=>{o.willUpdate(a)})}r.forEach((a,o)=>{a.update(o.value)}),n.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const e=this.el.getBoundingClientRect();this._prevOffset=e[this.justify],this.children.forEach(r=>r.willUpdate(e))}didUpdate(){const e=this.el.getBoundingClientRect();this.children.forEach(i=>i.didUpdate(e));const r=e[this.justify],n=this._prevOffset-r;n&&this.children.size&&this.el.animate({transform:[`translateX(${n}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}},mK=class extends Hhe{update(e){const r=new Map;this.children.forEach((n,i)=>{e.find(s=>s.key===i)||r.set(i,n),this.unpop(n)}),this.addNewAndUpdateExisting(e),r.forEach(n=>{n instanceof Yhe&&n.update(0)}),this.pop(r)}},gK=class extends Hhe{update(e){const r=new Map;this.children.forEach((n,i)=>{e.find(s=>s.key===i)||r.set(i,n)}),this.pop(r),this.addNewAndUpdateExisting(e)}},UF=class{constructor(e,r,{onRemove:n,animateIn:i=!1}={}){this.flow=e,this.el=r,this._present=!0,this._remove=()=>{var s;this.el.remove(),(s=this._onRemove)==null||s.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&i&&this.el.animate({[VT]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=n}get present(){return this._present}set present(e){if(this._present!==e){if(this._present=e,e?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){e||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",e?"0":"-.999"),this.el.animate({[VT]:e?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),e?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}},qhe=class extends UF{constructor(e,r,n,i){super(e.flow,n,i),this.section=e,this.value=r,this.el=n}},Yhe=class extends qhe{constructor(e,r,n,i,s){var a,o;const c=(((o=(a=e.flow.digits)==null?void 0:a[i])==null?void 0:o.max)??9)+1,u=Array.from({length:c}).map((f,h)=>{const m=ff("span",{className:"digit__num"},[document.createTextNode(String(h))]);return h!==n&&m.setAttribute("inert",""),m.style.setProperty("--n",String(h)),m}),d=ff("span",{part:`digit ${r}-digit`,className:"digit"},u);d.style.setProperty("--current",String(n)),d.style.setProperty("--length",String(c)),super(e,n,d,s),this.pos=i,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(e){const r=this.el.getBoundingClientRect();this._prevValue=this.value;const n=r[this.section.justify]-e[this.section.justify],i=r.width/2;this._prevCenter=this.section.justify==="left"?n+i:n-i}update(e){this.el.style.setProperty("--current",String(e)),this._numbers.forEac
4127h((r,n)=>n===e?r.removeAttribute("inert"):r.setAttribute("inert","")),this.value=e}didUpdate(e){const r=this.el.getBoundingClientRect(),n=r[this.section.justify]-e[this.section.justify],i=r.width/2,s=this.section.justify==="left"?n+i:n-i,a=this._prevCenter-s;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[hV]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var e;if(this.flow.plugins)for(const i of this.flow.plugins){const s=(e=i.getDelta)==null?void 0:e.call(i,this.value,this._prevValue,this);if(s!=null)return s}const r=this.value-this._prevValue,n=this.flow.computedTrend||Math.sign(r);return n<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:n>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:r}},KYe=class extends qhe{constructor(e,r,n,i){const s=ff("span",{className:"symbol__value",textContent:n});super(e,n,ff("span",{part:`symbol ${r}`,className:"symbol"},[s]),i),this.type=r,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(n,new UF(this.flow,s,{onRemove:this._onChildRemove(n)}))}willUpdate(e){if(this.type==="decimal")return;const r=this.el.getBoundingClientRect();this._prevOffset=r[this.section.justify]-e[this.section.justify]}update(e){if(this.value!==e){const r=this._children.get(this.value);r&&(r.present=!1);const n=this._children.get(e);if(n)n.present=!0;else{const i=ff("span",{className:"symbol__value",textContent:e});this.el.appendChild(i),this._children.set(e,new UF(this.flow,i,{animateIn:!0,onRemove:this._onChildRemove(e)}))}}this.value=e}didUpdate(e){if(this.type==="decimal")return;const r=this.el.getBoundingClientRect()[this.section.justify]-e[this.section.justify],n=this._prevOffset-r;n&&this.el.animate({transform:[`translateX(${n}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};const QYe=parseInt(b.version.match(/^(\d+)\./)?.[1]),pV=QYe>=19,ZYe=["data","digits"];class mV extends Whe{attributeChangedCallback(e,r,n){this[e]=JSON.parse(n)}}mV.observedAttributes=pV?[]:ZYe;$Ye("number-flow-react",mV);const XYe={},yK=pV?t=>t:JSON.stringify;function vK(t){const{transformTiming:e,spinTiming:r,opacityTiming:n,animated:i,respectMotionPreference:s,trend:a,plugins:o,...c}=t;return[{transformTiming:e,spinTiming:r,opacityTiming:n,animated:i,respectMotionPreference:s,trend:a,plugins:o},c]}class JYe extends b.Component{updateProperties(e){if(!this.el)return;this.el.batched=!this.props.isolate;const[r]=vK(this.props);Object.entries(r).forEach(([n,i])=>{this.el[n]=i??mV.defaultProps[n]}),e?.onAnimationsStart&&this.el.removeEventListener("animationsstart",e.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),e?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",e.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),pV&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(e){if(this.updateProperties(e),e.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(e,r,n){n?.()}handleRef(e){this.props.innerRef&&(this.props.innerRef.current=e),this.el=e}render(){const[e,{innerRef:r,className:n,data:i,willChange:s,isolate:a,group:o,digits:c,onAnimationsStart:u,onAnimationsFinish:d,...f}]=vK(this.props);return b.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":s?"":void 0,class:n,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:yK(c),data:yK(i)})}constructor(e){super(e),this.handleRef=this.handleRef.bind(this)}}const gV=b.forwardRef(function({value:e,locales:r,format:n,prefix:i,suffix:s,...a},o){b.useImperativeHandle(o,()=>c.current,[]);const c=b.useRef(),u=b.useContext(eKe);u?.useRegister(c);const d=b.useMemo(()=>r?JSON.stringify(r):"",[r]),f=b.useMemo(()=>n?JSON.stringify(n):"",[n]),h=b.useMemo(()=>{const m=XYe[`${d}:${f}`]??=new Intl.NumberFormat(r,n);return zYe(e,m,i,s)},[e,d,f,i,s]);return b.createElement(JYe,{...a,group:u,data:h,innerRef:c})}),eKe=b.createContext(void 0);var Khe="basil",tKe=function(e){return e===3?"v3":e},Qhe="https://js.stripe.com",rKe="".concat(Qhe,"/").concat(Khe,"/stripe.js"),nKe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,iKe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var sKe=function(e){return nKe.test(e)||iKe.test(e)},aKe=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Qhe,'"]')),r=0;r<e.length;r++){var n=e[r];if(sKe(n.src))return n}return null},xK=function(e){var r="",n=document.createElement("script");n.src="".concat(rKe).concat(r);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(n),n},oKe=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"7.9.0",startTime:r})},gv=null,hS=null,pS=null,lKe=function(e){return function(r){e(new Error("Failed to load Stripe.js",{cause:r}))}},cKe=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},uKe=function(e){return gv!==null?gv:(gv=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe){r(window.Stripe);return}try{var i=aKe();if(!(i&&e)){if(!i)i=xK(e);else if(i&&pS!==null&&hS!==null){var s;i.removeEventListener("load",pS),i.removeEventListener("error",hS),(s=i.parentNode)===null||s===void 0||s.removeChild(i),i=xK(e)}}pS=cKe(r,n),hS=lKe(n),i.addEventListener("load",pS),i.addEventListener("error",hS)}catch(a){n(a);return}}),gv.catch(function(r){return gv=null,Promise.reject(r)}))},dKe=function(e,r,n){if(e===null)return null;var i=r[0],s=i.match(/^pk_test/),a=tKe(e.version),o=Khe;s&&a!==o&&console.warn("Stripe.js@".concat(a," was loaded on the page, but @stripe/stripe-js@").concat("7.9.0"," expected Stripe.js@").concat(o,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var c=e.apply(void 0,r);return oKe(c,n),c}
4127,yv,Zhe=!1,Xhe=function(){return yv||(yv=uKe(null).catch(function(e){return yv=null,Promise.reject(e)}),yv)};Promise.resolve().then(function(){return Xhe()}).catch(function(t){Zhe||console.warn(t)});var fKe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];Zhe=!0;var i=Date.now();return Xhe().then(function(s){return dKe(s,r,i)})};const hKe=fa({checkoutUrl:un().min(1),sessionId:un().min(1),customerId:un().min(1)}),pKe=fa({portalUrl:un().min(1),customerId:un().min(1)}),Jhe=fa({success:cfe(),data:$B(),message:un()}),mKe=async(t,e,r,n,i,s)=>{if(!r)throw new Error("User authentication required");if(!n)throw new Error("Hasura user ID is required");try{const a=Ww(),o=await Hw(),c=await fetch(`${a}/billing/create-checkout-session`,{method:"POST",headers:{"Content-Type":"application/json",...o},body:JSON.stringify({hasuraUserId:n,userEmail:r.email,priceId:t,hasuraPlanId:e,successUrl:i,cancelUrl:s})});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);const u=await c.json(),d=Jhe.safeParse(u);if(!d.success)throw new Error(`Invalid response envelope from Stripe API: ${JSON.stringify(d.error.issues)}`);if(!d.data.success)throw new Error(`Stripe API error: ${d.data.message||"Unknown error"}`);const f=hKe.safeParse(d.data.data);if(!f.success)throw new Error(`Invalid response from Stripe API: ${JSON.stringify(f.error.issues)}`);return f.data}catch(a){throw a instanceof Error?new Error(`Failed to create Stripe checkout: ${a.message}`):new Error("Failed to create Stripe checkout: Unknown error")}},gKe=async t=>{const e=await fKe("pk_live_51RW8h2HHCuISMcFKjEQjIpKuyfpicgLDoT9tXzaJhRVNT9p1MLjGCcLywiBuLNIwB2ArhleZIedR0Agc8n8BrbMm00VHUo4JUN");if(!e)throw new Error("Stripe failed to initialize");const{error:r}=await e.redirectToCheckout({sessionId:t});if(r)throw new Error(`Stripe redirect failed: ${r.message}`)},yKe=async(t,e,r,n,i,s)=>{const a=await mKe(t,e,r,n,i,s);await gKe(a.sessionId)},vKe=async(t,e,r,n)=>{if(!t)throw new Error("User authentication required");if(!e)throw new Error("Hasura user ID is required");try{const i=Ww(),s=await Hw(),a=await fetch(`${i}/billing/create-customer-portal-session`,{method:"POST",headers:{"Content-Type":"application/json",...s},body:JSON.stringify({hasuraUserId:e,userEmail:t.email,subscriptionId:r,priceId:n})});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);const o=await a.json(),c=Jhe.safeParse(o);if(!c.success)throw new Error(`Invalid response envelope from Stripe API: ${JSON.stringify(c.error.issues)}`);if(!c.data.success)throw new Error(`Stripe API error: ${c.data.message||"Unknown error"}`);const u=pKe.safeParse(c.data.data);if(!u.success)throw new Error(`Invalid response from Stripe API: ${JSON.stringify(u.error.issues)}`);return u.data.portalUrl}catch(i){throw i instanceof Error?new Error(`Failed to create Stripe portal session: ${i.message}`):new Error("Failed to create Stripe portal session: Unknown error")}},xKe=t=>{try{const e=new URL(t);return e.protocol==="https:"&&(e.hostname==="stripe.com"||e.hostname.endsWith(".stripe.com"))}catch{return!1}},bK=async(t,e,r,n)=>{const i=await vKe(t,e,r,n);if(!xKe(i))throw new Error("Invalid Stripe portal URL: redirect blocked for security");window.location.href=i},bKe=({plan:t,user:e,userHasura:r,interval:n,disabled:i=!1})=>{const[s,a]=b.useState(!1),[o,c]=b.useState(null),u=t.name.toLowerCase().includes("pro"),d=async()=>{if(!e||!r)return;a(!0),c(null);const m=t.prices[n].stripePriceId;if(m)try{await yKe(m,t.id,e,r.id,`${window.location.origin}/app/dashboard?interval=${n}&payment=success`,`${window.location.origin}/app/dashboard?interval=${n}&payment=cancelled`)}catch(y){c(qy(y))}finally{a(!1)}},f=()=>t.isActive?s?"Processing...":i?"Verifying Payment...":"Select Plan":"Coming Soon",h=()=>u?"default":"outline-solid";return l.jsxs("div",{className:`relative rounded-2xl bg-app-card/50 border backdrop-blur-xs p-6 flex flex-col h-full
4128        ${u?"border-app-button-bg-active shadow-2xl z-10 shadow-app-button-bg-active/30":"border-app-border-color"}
4129      `,children:[u&&t.isActive&&l.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:l.jsx("div",{className:"bg-app-button-bg-active text-app-primary-foreground px-4 py-1 rounded-full text-sm font-medium min-w-[120px] text-center 2k:text-2xl",children:"Recommended"})}),l.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center relative bg-app-input-bg my-6 2k:w-16 2k:h-16",children:l.jsx("div",{className:"text-app-primary-foreground",children:u?l.jsx(af,{className:"w-6 h-6 2k:size-9"}):l.jsx(xs,{className:"w-6 h-6 2k:size-9"})})}),l.jsx("h3",{className:"text-xl font-semibold text-app-primary-foreground mb-3 text-left 2k:text-3xl",children:t.name}),l.jsxs("div",{className:"mb-8 flex items-baseline gap-1 justify-start text-5xl font-bold text-app-primary-foreground",children:[t.prices[n].price!=null?l.jsx(gV,{value:Number(n==="month"?t.prices.month.price:t.prices.year.price),plugins:[dV],format:{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:2},willChange:!0}
4129):"-",l.jsxs("span",{className:"text-app-primary-foreground/60 text-sm 2k:text-xl",children:["/"," ",n]})]}),l.jsxs("div",{className:"flex-1 mb-4",children:[l.jsx("p",{className:"text-app-primary-foreground font-medium mb-4 text-left",children:"This Plan includes"}),l.jsx("ul",{className:"space-y-3",children:t.features&&t.features.length>0?t.features.map((m,y)=>l.jsxs("li",{className:"flex items-start gap-3",children:[l.jsx(ei,{className:"w-5 h-5 text-app-border-color-accent mt-0.5 shrink-0 2k:size-6"}),l.jsx("span",{className:"text-app-primary-foreground/70 text-sm text-left 2k:text-lg",children:m})]},y)):l.jsx("li",{className:"text-sm text-gray-400 italic text-left 2k:text-xl",children:"No features listed"})})]}),o&&l.jsx("div",{className:"text-red-500 text-sm mb-4 text-center",children:o}),l.jsx("div",{className:"mt-8 flex justify-start",children:l.jsxs(ye,{onClick:d,disabled:s||!t.isActive||i,className:"w-full 2k:text-2xl 2k:py-6 2k:px-6",variant:h(),children:[(s||i)&&l.jsx(gn,{size:"sm"}),f()]})})]})},mS=({onValidChange:t})=>{const[e,r]=ys("interval",df(["month","year"])),[n,i]=ys("payment",df(["success","cancelled"])),{plans:s,isLoading:a,error:o}=Hs(),{user:c,userHasura:u}=Gt(),{current:d,steps:f,goNext:h}=sV(),m=f[d]?.id==="selectPlan",y=m&&m,{isConfirmed:x,loading:v}=Uhe(y,3e4),_=y&&v&&!x&&n==="success";return b.useEffect(()=>{x&&(t(!0,{subscriptionConfirmed:!0}),i(null),r(null),h())},[x,t,h,i,r]),l.jsxs("section",{className:"flex flex-col justify-center h-full 2k:gap-10 2k:px-12",children:[l.jsx(OYe,{interval:e||"month",onIntervalChange:r,className:"2k:mb-8"}),n==="cancelled"&&l.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-lg border border-orange-500/40 bg-orange-500/10 p-3 text-orange-600 2k:text-xl 2k:p-6 2k:gap-4",children:[l.jsx(Tw,{size:16,className:"2k:size-8"}),l.jsx("span",{className:"text-sm 2k:text-xl",children:"Payment was cancelled. Please try again to complete your subscription."})]}),_&&l.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-lg border border-blue-500/40 bg-blue-500/10 p-3 text-blue-600 2k:text-xl 2k:p-6 2k:gap-4",children:[l.jsx(gn,{size:"sm",className:"2k:size-8"}),l.jsx("span",{className:"text-sm 2k:text-xl",children:"Verifying your payment... Please wait while we confirm your subscription."})]}),l.jsx("div",{className:"relative mt-4 2k:mt-10",children:a?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 min-h-[300px] 2k:gap-6 2k:py-20 2k:min-h-[400px]",children:[l.jsx(gn,{size:"lg",className:"2k:size-16"}),l.jsx("span",{className:"text-sm text-muted-foreground 2k:text-2xl",children:"Loading plans…"})]}):o?l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-500/40 bg-red-500/10 p-4 text-red-600 min-h-[300px] justify-center 2k:text-xl 2k:p-8 2k:gap-4 2k:min-h-[400px]",children:[l.jsx(Ts,{size:16,className:"2k:size-8"}),l.jsx("span",{children:o})]}):l.jsxs(l.Fragment,{children:[l.jsx(Zy,{}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 2k:gap-10",children:s.map(S=>l.jsx(bKe,{plan:S,interval:e||"month",user:c,userHasura:u,disabled:_,className:"2k:text-2xl"},S.id))})]})})]})},wKe=un().min(8,"Must be at least 8 characters").regex(/[a-z]/,"Must include a lowercase letter").regex(/[A-Z]/,"Must include an uppercase letter").regex(/\d/,"Must include a number").regex(/[^a-z0-9]/i,"Must include special characters"),_Ke=fa({password:wKe,confirm:un()}).refine(t=>t.password===t.confirm,{path:["confirm"],message:"Passwords must match"}),epe=b.forwardRef(({onValidChange:t,onSubmittingChange:e},r)=>{const{register:n,handleSubmit:i,formState:{errors:s,isValid:a}}=$o({resolver:xl(_Ke),mode:"onChange"}),[o,c]=b.useState(!1),u=Ws();b.useEffect(()=>t(a),[a]),b.useEffect(()=>{e?.(o)},[o,e]),b.useEffect(()=>{ar.currentUser||dF(ar).finally(()=>{u("/login",{replace:!0})})},[]);const d=async()=>{let f=!1;return await i(async h=>{if(ar.currentUser){c(!0);try{await oue(ar.currentUser,h.password),Ft.success("Password set successfully!"),f=!0}catch(m){typeof m=="object"&&m!==null&&"code"in m&&m.code==="auth/requires-recent-login"?(Ft.error("Your session has expired. Please log in again to continue."),await dF(ar),u("/login",{replace:!0})):Ft.error(qy(m)),f=!1}finally{c(!1)}}})(),f};return b.useImperativeHandle(r,()=>({submit:d})),l.jsxs("form",{className:"space-y-4 2k:space-y-8",children:[l.jsx("div",{className:"mb-2 text-gray-400 text-sm 2k:text-xl 2k:mb-6",children:"For your security, you need to set a strong password for your account. Please choose a password that is at least 8 characters long and includes uppercase and lowercase letters, a number, and a special character."}),s.root&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2 2k:text-lg 2k:p-6 2k:gap-4",children:[l.jsx(Ts,{size:16,className:"2k:size-8"}),l.jsx("span",{children:s.root.message})]}),l.jsx(tn,{label:"New Password",icon:xs,error:s.password?.message,className:"2k:text-xl",children:l.jsx(Wr,{...n("password"),type:"password",hasIcon:!0,showPasswordToggle:!0,iconLeft:l.jsx(xs,{size:16}),placeholder:"Enter new password",className:"2k:h-16 2k:text-xl"})}),l.jsx(tn,{label:"Confirm New Password",icon:xs,error:s.confirm?.message,className:"2k:text-xl",children:l.jsx(Wr,{...n("confirm"),type:"password",hasIcon:!0,iconLeft:l.jsx(xs,{size:16}),showPasswordToggle:!0,placeholder:"Confirm new password",className:"2k:h-16 2k:text-xl"})}),l.jsx(ye,{type:"submit",className:"hidden",disabled:o})]})});epe.displayName="SetPasswordStep";const qp=Wp((t,e)=>({mode:"viewing",verificationCooldown:!1,cooldownTimer:0,canEditProfile:!1,startEditing:()=>t({mode:"editing"}),finishEditing:()=>t({mode:"viewing"}),startPasswordChange:()=>t({mode:"settingPassword"}),finishPasswordChange:()=>t({mode:"viewing"}),startUploading:()=>t({mode:"uploading"}),finishUploading:()=>t({mode:"viewing"}),startCooldown:()=>{t({verificationCooldown:!0,cooldownTimer:60});const r=setInterval(()=>{const n=e().cooldownTimer;n<=1?(t({verificationCooldown:!1,cooldownTimer:0}),clearInterval(r)):t({cooldownTimer:n-1})},1e3)}})),SKe=t=>({startEditing:t.startEditing,finishEditing:t.finishEditing,startPasswordChange:t.startPasswordChange,finishPasswordChange:t.finishPasswordChange,startUploading:t.startUploading,finishUploading:t.finishUploading}),kKe=()=>qp(yl(SKe)),TKe=()=>qp(yl(t=>({cooldown:t.verificationCooldown,timer:t.cooldownTimer,startCooldown:t.startCooldown}))),CKe=()=>qp(t=>t.finishEditing),EKe=()=>qp(t=>t.startPasswordChange),jKe=()=>qp(t=>t.finishPasswordChange),NKe=({user:t})=>{const{cooldown:e,timer:r,startCooldown:n}=TKe(),i=ar.currentUser?.emailVerified??!1,s=t?.email||ar.currentUser?.email||"",a=async()=>
4129{if(ar.currentUser)try{await tB(ar.currentUser,{url:`${window.location.origin}/app/dashboard`,handleCodeInApp:!0}),Ft.success("Verification email sent! Please check your inbox."),n()}catch(o){Ft.error(qy(o))}};return i?l.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/20 rounded-lg p-4 flex items-center gap-3 2k:p-10 2k:gap-8",children:[l.jsx("div",{className:"shrink-0 w-10 h-10 bg-emerald-500/20 rounded-full flex items-center justify-center 2k:w-20 2k:h-20",children:l.jsx(ei,{className:"w-5 h-5 text-emerald-500 2k:w-10 2k:h-10"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base font-semibold text-emerald-300 2k:text-3xl",children:"Your email was successfully verified!"}),l.jsx("p",{className:"text-xs text-emerald-200/80 mt-1 2k:text-xl 2k:mt-4",children:"You can now continue to the next step of onboarding."})]})]}):l.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-lg p-4 space-y-3 2k:p-10 2k:space-y-8",children:[l.jsxs("div",{className:"flex items-center gap-3 2k:gap-8",children:[l.jsx("div",{className:"shrink-0 w-10 h-10 bg-amber-500/20 rounded-full flex items-center justify-center 2k:w-20 2k:h-20",children:l.jsx(Ts,{className:"w-5 h-5 text-amber-500 2k:w-10 2k:h-10"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-sm font-medium text-amber-200 2k:text-2xl",children:"Email Verification Required"}),l.jsx("p",{className:"text-xs text-amber-300/80 mt-1 2k:text-xl 2k:mt-4",children:"Please verify your email address to secure your account"})]})]}),l.jsx("div",{className:"bg-black/20 rounded-md p-3 border border-amber-500/10 2k:p-6",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm 2k:text-xl 2k:gap-4",children:[l.jsx(fp,{className:"w-4 h-4 text-amber-400 2k:w-8 2k:h-8"}),l.jsx("span",{className:"text-amber-100",children:s})]})}),l.jsxs("div",{className:"flex items-center justify-between 2k:gap-8",children:[l.jsx("div",{className:"flex items-center gap-2 text-xs text-amber-300/70 2k:text-lg 2k:gap-4",children:e?l.jsxs(l.Fragment,{children:[l.jsx(Is,{className:"w-3 h-3 2k:w-6 2k:h-6"}),l.jsx("span",{children:"Email sent! Check your inbox"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ts,{className:"w-3 h-3 2k:w-6 2k:h-6"}),l.jsx("span",{children:"Click to send verification email"})]})}),l.jsx(ye,{onClick:a,disabled:e,size:"sm",variant:"secondary",className:`
4130            ${e?"bg-emerald-500/20 border-emerald-500/30 text-emerald-300":"bg-amber-500/20 border-amber-500/30 text-amber-200 hover:bg-amber-500/30"}
4131            2k:text-2xl 2k:h-16 2k:px-8
4132          `,children:e?l.jsxs(l.Fragment,{children:[l.jsx(ei,{className:"w-3 h-3 mr-1 2k:w-6 2k:h-6 2k:mr-3"}),l.jsxs("span",{className:"2k:text-xl",children:["Sent (",r,"s)"]})]}):l.jsxs(l.Fragment,{children:[l.jsx(fp,{className:"w-3 h-3 mr-1 2k:w-6 2k:h-6 2k:mr-3"}),l.jsx("span",{className:"2k:text-xl",children:"Send Verification"})]})})]}),l.jsx("div",{className:"text-xs text-amber-300/60 pt-4 border-t border-amber-500/10 2k:text-lg 2k:pt-8",children:l.jsx("p",{children:"Don't see the email? Check your spam folder or try resending after the countdown."})})]})},PKe=({onValidChange:t})=>{const[e,r]=b.useState(ar.currentUser?.emailVerified??!1);return b.useEffect(()=>{let n=null;const i=async()=>{if(ar.currentUser){await ar.currentUser.reload();const s=ar.currentUser.emailVerified;r(s),t(s)}};return n=setInterval(i,2e3),i(),()=>{n&&clearInterval(n)}},[t]),l.jsx(NKe,{user:ar.currentUser})},MKe=t=>{switch(t){case"SET_PASSWORD":return[{id:"setPassword",title:"Set your password",Component:epe},{id:"selectPlan",title:"Choose a plan",Component:mS},{id:"paymentCompletion",title:"Payment Complete",Component:uS}];case"VERIFY_EMAIL":return[{id:"verifyEmail",title:"Verify your email",Component:PKe},{id:"selectPlan",title:"Choose a plan",Component:mS},{id:"paymentCompletion",title:"Payment Complete",Component:uS}];case"SELECT_PLAN":return[{id:"selectPlan",title:"Choose a plan",Component:mS},{id:"paymentCompletion",title:"Payment Complete",Component:uS}];default:return[{id:"selectPlan",title:"Choose a plan",Component:mS},{id:"paymentCompletion",title:"Payment Complete",Component:uS}]}},AKe=()=>{const{userHasura:t,isLoading:e,isInitialized:r}=Gt(),{loadPermissions:n,clearPermissions:i}=Fw();b.useEffect(()=>{e||!r||(t?.role_id?n(t.role_id):i())}
4132,[e,r,t?.id,t?.role_id,n,i])},Rm={DASHBOARD:"/app/dashboard",INSIGHTS:"/app/insights",CALENDAR:"/app/calendar",PROFILE:"/app/profile",TRADES:"/app/trades",RECAP:"/app/recap"};function DKe({items:t}){const{isMobile:e,setOpenMobile:r}=Ff(),n=()=>{e&&r(!1)};return l.jsxs(H9e,{children:[l.jsx(q9e,{children:"Navigation"}),l.jsx(iV,{children:t.map(i=>l.jsx(FT,{children:l.jsx(Q4,{to:i.url,onClick:n,children:({isActive:s})=>l.jsxs(zT,{tooltip:i.title,isActive:s,children:[i.icon&&l.jsx(i.icon,{size:22,className:"mr-1 size-5"}),l.jsx("span",{children:i.title})]})})},i.url))})]})}const OKe=[{feature:"DASHBOARD",url:Rm.DASHBOARD,icon:QPe,title:"Dashboard"},{feature:"INSIGHTS",url:Rm.INSIGHTS,icon:_f,title:"Insights"},{feature:"DASHBOARD",url:"/app/edge",icon:sf,title:"Edge"},{feature:"CALENDAR",url:Rm.CALENDAR,icon:Cu,title:"Calendar"},{feature:"TRADES",url:Rm.TRADES,icon:XPe,title:"Trades"},{feature:"TRADES",url:Rm.RECAP,icon:KPe,title:"Recap"},{feature:"PROFILE",url:Rm.PROFILE,icon:FPe,title:"Profile"}];function RKe({...t}){const{signOut:e}=Gt(),{hasReadAccess:r,hasWriteAccess:n}=Fw(),{isMobile:i,setOpenMobile:s}=Ff(),a=()=>{i&&s(!1)};return l.jsxs(F9e,{collapsible:"icon",variant:"inset",...t,children:[l.jsx(U9e,{children:l.jsx(z9e,{})}),l.jsx(W9e,{children:l.jsx(DKe,{items:OKe.filter(o=>r(o.feature))})}),l.jsxs(G9e,{className:"my-4",children:[l.jsxs(iV,{children:[n("TRADES")&&l.jsx(FT,{children:l.jsx(zT,{tooltip:"Import trades",asChild:!0,isActive:!0,children:l.jsxs(Q4,{to:"/app/trade-entry",onClick:a,children:[l.jsx(n3,{size:22,className:"mr-1 size-5"}),l.jsx("span",{children:"Import Trades"})]})})}),l.jsx(FT,{children:l.jsxs(zT,{onClick:e,tooltip:"Sign Out",children:[l.jsx(eMe,{size:22,className:"mr-1 size-5"}),l.jsx("span",{children:"Sign Out"})]})})]}),l.jsx("div",{className:"px-2 py-0.5  group-data-[collapsible=icon]:hidden",children:l.jsxs("p",{className:"text-xs font-mono text-sidebar-foreground/50 text-center",children:["v",D$e]})})]}),l.jsx(B9e,{})]})}const IKe=({open:t,onClose:e})=>{const{user:r}=Gt(),[n,i]=b.useState(!1),s=async()=>{if(r){i(!0);try{await tB(r),Ft.success("Verification email resent.")}catch{Ft.error("Could not resend the email. Please try again later.")}i(!1)}};return t?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-app-primary/80",children:l.jsxs("div",{className:"relative bg-app-card rounded-2xl shadow-2xl p-8 max-w-md w-full text-center border border-app-border-color-soft",children:[l.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-app-primary-foreground/60 hover:text-app-primary-foreground transition-colors","aria-label":"Close",children:l.jsx(pi,{size:24})}),l.jsx(fp,{size:56,className:"mx-auto text-app-text-accent mb-4"}),l.jsx("h2",{className:"text-2xl font-bold mb-2 text-app-primary-foreground",children:"One more step to enjoy everything!"}),l.jsx("p",{className:"mb-4 text-app-primary-foreground/80",children:"To secure your account and unlock all features, please verify your email address. It's quick and easy."}),l.jsx("p",{className:"mb-6 text-app-primary-foreground/60",children:"Check your inbox (or spam folder) for the email we sent you. If you can't find it, click the button below."}),r?l.jsx(ye,{onClick:s,disabled:n,className:"w-full bg-app-button-bg-active hover:bg-app-button-bg text-app-primary-foreground font-bold text-lg py-2",children:n?"Sending...":"Resend Verification Email"}):l.jsx("div",{className:"w-full py-2 text-center text-app-primary-foreground/60 text-sm",children:"Loading user..."})]})}):null},LKe=({open:t,onClose:e,onGoToProfile:r})=>t?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-app-primary/80",children:l.jsxs("div",{className:"relative bg-app-card rounded-2xl shadow-2xl p-8 max-w-md w-full text-center border border-app-border-color-soft",children:[l.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-app-primary-foreground/60 hover:text-app-primary-foreground transition-colors","aria-label":"Close",children:l.jsx(pi,{size:24})}),l.jsx(xs,{size:56,className:"mx-auto text-app-text-accent mb-4"}),l.jsx("h2",{className:"text-2xl font-bold mb-2 text-app-primary-foreground",children:"Secure your account with a password"}
4132),l.jsx("p",{className:"mb-4 text-app-primary-foreground/80",children:"You signed up with Google. For extra security and to enable email login, please set a password for your account."}),l.jsx(ye,{onClick:r,className:"w-full bg-app-button-bg-active hover:bg-app-button-bg text-app-primary-foreground font-bold text-lg py-2",children:"Go to Profile to Set Password"})]})}):null,$Ke=Wp(t=>({isEmailVerificationDialogOpen:!1,showEmailVerificationDialog:()=>t({isEmailVerificationDialogOpen:!0}),hideEmailVerificationDialog:()=>t({isEmailVerificationDialogOpen:!1}),isSetPasswordDialogOpen:!1,setPasswordCallback:null,showSetPasswordDialog:e=>t({isSetPasswordDialogOpen:!0,setPasswordCallback:e||null}),hideSetPasswordDialog:()=>t({isSetPasswordDialogOpen:!1,setPasswordCallback:null})})),FKe=()=>{const{isEmailVerificationDialogOpen:t,hideEmailVerificationDialog:e,isSetPasswordDialogOpen:r,setPasswordCallback:n,hideSetPasswordDialog:i}=$Ke(),s=()=>{i(),n&&n()};return l.jsxs(l.Fragment,{children:[l.jsx(IKe,{open:t,onClose:e}),l.jsx(LKe,{open:r,onClose:i,onGoToProfile:s})]})},zKe=()=>l.jsxs($9e,{className:"text-app-primary-foreground",children:[l.jsx(K9e,{}),l.jsx(RKe,{}),l.jsx(V9e,{className:"overflow-visible bg-transparent pt-14 xl:pt-0 relative",children:l.jsx("div",{className:"w-full max-w-full px-4 sm:px-6 md:px-10 lg:px-10 pt-4 pb-6 sm:pb-0 md:pb-8 lg:pb-0 space-y-6 md:space-y-8 mx-auto",children:l.jsx(Y4,{})})}),l.jsx(EYe,{}),l.jsx(FKe,{}),l.jsx(ioe,{})]}),BKe=()=>{const{user:t,setUser:e,setInitialized:r,setLoading:n,isLoading:i,userHasura:s,initialProvider:a,setInitialProvider:o,setUserHasura:c}=Gt(),u=s?.id,[d]=Zn(ffe);b.useEffect(()=>{n(!0);const v=lue(ar,async _=>{if(_)try{await _.reload(),await _.getIdToken(!0),!a&&_.providerData?.[0]?.providerId&&o(_.providerData[0].providerId)}catch{console.error("Error refreshing token after email change")}e(_),n(!1),r(!0)});return()=>v()},[r,n,e,a,o]),kde(),AKe(),jYe();const f=s?.onboarding_state??null,h=f!=="DONE",m=MKe(f),y=0,x=async()=>{if(u)try{await d({variables:{userId:u,input:{onboarding_state:"DONE"}}}),s&&c({...s,onboarding_state:"DONE"})}catch{console.error("Oops! Something went wrong while finalizing onboarding")}};return i?l.jsx(kV,{}):t?l.jsx(g8e,{children:h?l.jsx(Q9e,{steps:m,onFinish:x,initialCurrent:y,children:l.jsx(J9e,{open:!0,disableClose:!0})}):l.jsx(zKe,{})}):l.jsx(IE,{to:"/login",replace:!0})},VKe=Rf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 2k:text-xl",{variants:{variant:{default:"border-app-border-color-accent bg-app-button-bg-active text-app-primary-foreground",secondary:"border-transparent bg-app-primary text-app-primary-foreground hover:bg-app-primary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/80",outline:"text-app-primary-foreground"}},defaultVariants:{variant:"default"}});function nc({className:t,variant:e,...r}){return l.jsx("div",{className:ee(VKe({variant:e}),t),...r})}const Oj=({message:t="This feature is only available with a PRO plan or above.",className:e,showTooltip:r=!0,tooltipContent:n})=>{const i=l.jsxs(nc,{className:ee(e),children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"MT logo",className:"mr-1 size-2.5 2k:size-5"}),l.jsx("p",{className:"text-xs",children:"PRO"})]});return r?l.jsxs(ui,{children:[l.jsx(di,{className:"cursor-default",children:i}),l.jsx(fi,{side:"bottom",children:n||l.jsx("p",{className:"text-xs leading-relaxed",children:t})})]}):i},_c=({title:t,loadingText:e="Loading chart data...",height:r="400px",className:n})=>l.jsxs("div",{className:"bg-app-card/50 border border-app-border-color-soft p-4 rounded-2xl min-h-[400px] relative flex flex-col",children:[t&&l.jsx("div",{className:"flex items-center justify-between gap-4 mt-2 mb-3 h-8",children:t&&l.jsxs("div",{className:"flex items-center gap-4 roun
4132ded-lg bg-app-input-bg px-2.5 py-1.5",children:[l.jsx("h2",{className:"text-sm text-app-primary-foreground/90 uppercase tracking-wider space-x-2",children:t}),l.jsx(Oj,{})]})}),l.jsx("div",{className:ee("rounded-2xl min-h-[400px] relative flex flex-col items-center justify-center",n),style:{minHeight:r},children:l.jsx(lV,{children:e})})]}),tpe=({title:t="No trades available in this range",subtitle:e="Start trading to see how your performance varies across different stock price ranges",imageSrc:r="/empty-chart.png"})=>l.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[450px] w-full space-y-2 text-center",children:[l.jsx("img",{src:r,alt:"No data available",className:"w-auto h-[160px] object-cover object-center 2k:h-[200px]"}),l.jsx("p",{className:"text-app-primary-foreground/60 font-medium text-lg max-w-md 2k:text-3xl",children:t}),l.jsx("p",{className:"text-app-primary-foreground/40 text-sm max-w-xs 2k:text-lg 2k:max-w-md",children:e})]}),UKe=({title:t="Something went wrong",message:e,onRetry:r,retryLabel:n="Try Again",className:i=""})=>l.jsxs("div",{className:`flex flex-col items-center justify-center space-y-4 p-8 ${i}`,children:[l.jsxs("div",{className:"flex items-center space-x-2 text-red-500",children:[l.jsx(Ts,{size:24}),l.jsx("h3",{className:"text-lg font-medium",children:t})]}),l.jsx("p",{className:"text-sm text-gray-400 text-center max-w-md",children:e}),r&&l.jsxs("button",{onClick:r,className:"flex items-center space-x-2 px-4 py-2 bg-emerald-500 hover:bg-emerald-600 text-white rounded-lg transition-colors",children:[l.jsx(T$,{size:16}),l.jsx("span",{children:n})]})]}),GKe={visible:{transition:{staggerChildren:.1}}},wK={hidden:{opacity:0},visible:{opacity:1}},WKe={fade:{},slide:{hidden:{y:20},visible:{y:0}},scale:{hidden:{scale:.8},visible:{scale:1}},blur:{hidden:{filter:"blur(4px)"},visible:{filter:"blur(0px)"}},"blur-slide":{hidden:{filter:"blur(4px)",y:20},visible:{filter:"blur(0px)",y:0}},zoom:{hidden:{scale:.5},visible:{scale:1,transition:{type:"spring",stiffness:300,damping:20}}},flip:{hidden:{rotateX:-90},visible:{rotateX:0,transition:{type:"spring",stiffness:300,damping:20}}},bounce:{hidden:{y:-50},visible:{y:0,transition:{type:"spring",stiffness:400,damping:10}}},rotate:{hidden:{rotate:-180},visible:{rotate:0,transition:{type:"spring",stiffness:200,damping:15}}},swing:{hidden:{rotate:-10},visible:{rotate:0,transition:{type:"spring",stiffness:300,damping:8}}}},_K=t=>({hidden:{...wK.hidden,...t.hidden},visible:{...wK.visible,...t.visible}}),Xh=b.forwardRef(({children:t,className:e,variants:r,preset:n,as:i="div",asChild:s="div",viewport:a={once:!0,margin:"-100px"},wrapperStyle:o="block"},c)=>{const u={item:_K(n?WKe[n]:{}),container:_K(GKe)},d=r?.container||u.container,f=r?.item||u.item,h=ct.create(i),m=ct.create(s);return l.jsx(h,{ref:c,initial:"hidden",whileInView:"visible",viewport:a,variants:d,className:e,children:P.Children.map(t,(y,x)=>l.jsx(m,{variants:f,style:{display:o==="contents"?"contents":void 0},children:y},x))})}),yV=({title:t,description:e,icon:r,actionText:n,onAction:i,actionLink:s,className:a,animated:o=!0})=>{const c=l.jsxs("div",{className:ee("text-center py-12 flex flex-1 flex-col items-center justify-center min-h-[500px]",a),children:[r&&l.jsx("div",{className:"mb-4",children:l.jsx("div",{className:"mx-auto size-12",children:r})}),l.jsx("h3",{className:"text-lg font-medium text-app-primary-foreground mb-2",children:t}),e&&l.jsx("p",{className:"text-app-primary-foreground/70 max-w-xs mx-auto",children:e}),n&&(i||s)&&l.jsx("div",{className:"mt-4",children:s?l.jsx(ye,{variant:"default",className:"group duration-300 transition-colors",asChild:!0,children:s}):l.jsx(ye,{variant:"default",className:"group duration-300 transition-colors",onClick:i,children:n})})]});return o?l.jsx(Xh,{preset:"blur",children:c}):c},rpe=6048e5,HKe=864e5,Rj=6e4,Ij=36e5,qKe=1e3,SK=Symbol.for("constructDateFrom");function xr(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&SK in t?t[SK](e):t instanceof Date?new t.constructor(e):new Date(e)}function st(t,e){return xr(e||t,t)}function $a(t,e,r){const n=st(t,r?.in);return isNaN(e)?xr(r?.in||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Va(t,e,r){const n=st(t,r?.in);if(isNaN(e))return xr(t,NaN);if(!e)return n;const i=n.getDate(),s=xr(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}function YKe(t,e){const r=st(t,e?.in).getDay();return r===0||r===6}function npe(t,e,r){return xr(t,+st(t)+e)}function ipe(t,e,r){return npe(t,e*Ij)}let KKe={};function Yp(){return KKe}function mi(t,e){const r=Yp(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=st(t,e?.in),s=i.getDay(),a=(s<n?7:0)+s-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function Tp(t,e){return mi(t,{...e,weekStartsOn:1}
4132)}function spe(t,e){const r=st(t,e?.in),n=r.getFullYear(),i=xr(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const s=Tp(i),a=xr(r,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Tp(a);return r.getTime()>=s.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function GT(t){const e=st(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function qa(t,...e){const r=xr.bind(null,t||e.find(n=>typeof n=="object"));return e.map(r)}function Us(t,e){const r=st(t,e?.in);return r.setHours(0,0,0,0),r}function Nf(t,e,r){const[n,i]=qa(r?.in,t,e),s=Us(n),a=Us(i),o=+s-GT(s),c=+a-GT(a);return Math.round((o-c)/HKe)}function QKe(t,e){const r=spe(t,e),n=xr(t,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Tp(n)}function GF(t,e,r){const n=st(t,r?.in);return n.setTime(n.getTime()+e*Rj),n}function vV(t,e,r){return Va(t,e*3,r)}function ZKe(t,e,r){return npe(t,e*1e3)}function Xg(t,e,r){return $a(t,e*7,r)}function ml(t,e,r){return Va(t,e*12,r)}function WF(t,e){let r,n=e?.in;return t.forEach(i=>{!n&&typeof i=="object"&&(n=xr.bind(null,i));const s=st(i,n);(!r||r<s||isNaN(+s))&&(r=s)}),xr(n,r||NaN)}function HF(t,e){let r,n=e?.in;return t.forEach(i=>{!n&&typeof i=="object"&&(n=xr.bind(null,i));const s=st(i,n);(!r||r>s||isNaN(+s))&&(r=s)}),xr(n,r||NaN)}function EA(t,e){const r=+st(t)-+st(e);return r<0?-1:r>0?1:r}function XKe(t){return xr(t,Date.now())}function Lj(t,e,r){const[n,i]=qa(r?.in,t,e);return+Us(n)==+Us(i)}function ic(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function WT(t){return!(!ic(t)&&typeof t!="number"||isNaN(+st(t)))}function Jg(t,e,r){const[n,i]=qa(r?.in,t,e),s=n.getFullYear()-i.getFullYear(),a=n.getMonth()-i.getMonth();return s*12+a}function Jh(t,e){const r=st(t,e?.in);return Math.trunc(r.getMonth()/3)+1}function HT(t,e,r){const[n,i]=qa(r?.in,t,e),s=n.getFullYear()-i.getFullYear(),a=Jh(n)-Jh(i);return s*4+a}function qT(t,e,r){const[n,i]=qa(r?.in,t,e);return n.getFullYear()-i.getFullYear()}function ape(t,e,r){const[n,i]=qa(r?.in,t,e),s=kK(n,i),a=Math.abs(Nf(n,i));n.setDate(n.getDate()-s*a);const o=+(kK(n,i)===-s),c=s*(a-o);return c===0?0:c}function kK(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function Zi(t,e){const r=st(t,e?.in);return r.setHours(23,59,59,999),r}function ga(t,e){const r=st(t,e?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function JKe(t,e){const r=st(t,e?.in);return+Zi(r,e)==+ga(r,e)}function eQe(t,e,r){const[n,i,s]=qa(r?.in,t,t,e),a=EA(i,s),o=Math.abs(Jg(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let c=EA(i,s)===-a;JKe(n)&&o===1&&EA(n,s)===1&&(c=!1);const u=a*(o-+c);return u===0?0:u}function ope(t,e){const[r,n]=qa(t,e.start,e.end);return{start:r,end:n}}function tQe(t,e){const{start:r,end:n}=ope(e?.in,t);let i=+r>+n;const s=i?+r:+n,a=i?n:r;a.setHours(0,0,0,0);let o=1;const c=[];for(;+a<=s;)c.push(xr(r,a)),a.setDate(a.getDate()+o),a.setHours(0,0,0,0);return i?c.reverse():c}function rQe(t,e){const{start:r,end:n}=ope(e?.in,t);let i=+r>+n;const s=i?+r:+n,a=i?n:r;a.setHours(0,0,0,0),a.setDate(1);let o=1;const c=[];for(;+a<=s;)c.push(xr(r,a)),a.setMonth(a.getMonth()+o);return i?c.reverse():c}function qF(t,e){const r=st(t,e?.in),n=r.getMonth(),i=n-n%3;return r.setMonth(i,1),r.setHours(0,0,0,0),r}function Gs(t,e){const r=st(t,e?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function $j(t,e){const r=st(t,e?.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function Zu(t,e){const r=st(t,e?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function nQe(t,e){const r=st(t,e?.in);return r.setMinutes(59,59,999),r}function $u(t,e){const r=Yp(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=st(t,e?.in),s=i.getDay(),a=(s<n?-7:0)+6-(s-n);return i.setDate(i.getDate()+a),i.setHours(23,59,59,999),i}function iQe(t,e){return $u(t,{...e,weekStartsOn:1}
vendor: 13,522 bytes, line 4132
4132)}const sQe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},aQe=(t,e,r)=>{let n;const i=sQe[t];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function jA(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const oQe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lQe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cQe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uQe={date:jA({formats:oQe,defaultWidth:"full"}),time:jA({formats:lQe,defaultWidth:"full"}),dateTime:jA({formats:cQe,defaultWidth:"full"})},dQe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fQe=(t,e,r,n)=>dQe[t];function vv(t){return(e,r)=>{const n=r?.context?String(r.context):"standalone";let i;if(n==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=r?.width?String(r.width):a;i=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=r?.width?String(r.width):t.defaultWidth;i=t.values[o]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const hQe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pQe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mQe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gQe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yQe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vQe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xQe=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},bQe={ordinalNumber:xQe,era:vv({values:hQe,defaultWidth:"wide"}),quarter:vv({values:pQe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vv({values:mQe,defaultWidth:"wide"}),day:vv({values:gQe,defaultWidth:"wide"}),dayPeriod:vv({values:yQe,defaultWidth:"wide",formattingValues:vQe,defaultFormattingWidth:"wide"})};function xv(t){return(e,r={})=>{const n=r.width,i=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],o=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?_Qe(o,f=>f.test(a)):wQe(o,f=>f.test(a));let u;u=t.valueCallback?t.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=e.slice(a.length);return{value:u,rest:d}}}function wQe(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function _Qe(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function SQe(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const i=n[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=r.valueCallback?r.valueCallback(a):a;const o=e.slice(i.length);return{value:a,rest:o}}}const kQe=/^(\d+)(th|st|nd|rd)?/i,TQe=/\d+/i,CQe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},EQe={any:[/^b/i,/^(a|c)/i]},jQe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NQe={any:[/1/i,/2/i,/3/i,/4/i]},PQe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},MQe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},AQe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},DQe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},OQe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},RQe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},IQe={ordinalNumber:SQe({matchPattern:kQe,parsePattern:TQe,valueCallback:t=>parseInt(t,10)}),era:xv({matchPatterns:CQe,defaultMatchWidth:"wide",parsePatterns:EQe,defaultParseWidth:"any"}),quarter:xv({matchPatterns:jQe,defaultMatchWidth:"wide",parsePatterns:NQe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:xv({matchPatterns:PQe,defaultMatchWidth:"wide",parsePatterns:MQe,defaultParseWidth:"any"}),day:xv({matchPatterns:AQe,defaultMatchWidth:"wide",parsePatterns:DQe,defaultParseWidth:"any"}),dayPeriod:xv({matchPatterns:OQe,defaultMatchWidth:"any",parsePatterns:RQe,defaultParseWidth:"any"})},Fj={code:"en-US",formatDistance:aQe,formatLong:uQe,formatRelative:fQe,localize:bQe,match:IQe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function LQe(t,e){const r=st(t,e?.in);return Nf(r,Zu(r))+1}function zj(t,e){const r=st(t,e?.in),n=+Tp(r)-+QKe(r);return Math.round(n/rpe)+1}function xV(t,e){const r=st(t,e?.in),n=r.getFullYear(),i=Yp(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=xr(e?.in||t,0);a.setFullYear(n+1,0,s),a.setHours(0,0,0,0);const o=mi(a,e),c=xr(e?.in||t,0);c.setFullYear(n,0,s),c.setHours(0,0,0,0);const u=mi(c,e);return+r>=+o?n+1:+r>=+u?n:n-1}function $Qe(t,e){const r=Yp(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=xV(t,e),s=xr(e?.in||t,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),mi(s,e)}function bV(t,e){const r=st(t,e?.in),n=+mi(r,e)-+$Qe(r,e);return Math.round(n/rpe)+1}function Ir(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const kd={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return Ir(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):Ir(r+1,2)},d(t,e){return Ir(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return Ir(t.getHours()%12||12,e.length)},H(t,e){return Ir(t.getHours(),e.length)},m(t,e){return Ir(t.getMinutes(),e.length)},s(t,e){return Ir(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return Ir(i,e.length)}},Im={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TK={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return kd.y(t,e)},Y:function(t,e,r,n){const i=xV(t,n),s=i>0?i:1-i;if(e==="YY"){const a=s%100;return Ir(a,2)}return e==="Yo"?r.ordinalNumber(s,{unit:"year"}):Ir(s,e.length)},R:function(t,e){const r=spe(t);return Ir(r,e.length)},u:function(t,e){const r=t.getFullYear();return Ir(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ir(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ir(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return kd.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ir(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const i=bV(t,n);return e==="wo"?r.ordinalNumber(i,{unit:"week"}):Ir(i,e.length)},I:function(t,e,r){const n=zj(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):Ir(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):kd.d(t,e)},D:function(t,e,r){const n=LQe(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ir(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const i=t.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ir(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const i=t.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ir(s,e.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return Ir(i,e.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let i;switch(n===12?i=Im.noon:n===0?i=Im.midnight:i=n/12>
vendor: 4,446 bytes, line 4132
4132=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let i;switch(n>=17?i=Im.evening:n>=12?i=Im.afternoon:n>=4?i=Im.morning:i=Im.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return kd.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):kd.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ir(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ir(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):kd.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):kd.s(t,e)},S:function(t,e){return kd.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return EK(n);case"XXXX":case"XX":return _h(n);case"XXXXX":case"XXX":default:return _h(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return EK(n);case"xxxx":case"xx":return _h(n);case"xxxxx":case"xxx":default:return _h(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+CK(n,":");case"OOOO":default:return"GMT"+_h(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+CK(n,":");case"zzzz":default:return"GMT"+_h(n,":")}},t:function(t,e,r){const n=Math.trunc(+t/1e3);return Ir(n,e.length)},T:function(t,e,r){return Ir(+t,e.length)}};function CK(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=Math.trunc(n/60),s=n%60;return s===0?r+String(i):r+String(i)+e+Ir(s,2)}function EK(t,e){return t%60===0?(t>0?"-":"+")+Ir(Math.abs(t)/60,2):_h(t,e)}function _h(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=Ir(Math.trunc(n/60),2),s=Ir(n%60,2);return r+i+e+s}const jK=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},lpe=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},FQe=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return jK(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",jK(n,e)).replace("{{time}}",lpe(i,e))},YF={p:lpe,P:FQe},zQe=/^D+$/,BQe=/^Y+$/,VQe=["D","DD","YY","YYYY"];function cpe(t){return zQe.test(t)}function upe(t){return BQe.test(t)}function KF(t,e,r){const n=UQe(t,e,r);if(console.warn(n),VQe.includes(t))throw new RangeError(n)}function UQe(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GQe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WQe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HQe=/^'([^]*?)'?$/,qQe=/''/g,YQe=/[a-zA-Z]/;function sr(t,e,r){const n=Yp(),i=r?.locale??n.locale??Fj,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=st(t,r?.in);if(!WT(o))throw new RangeError("Invalid time value");let c=e.match(WQe).map(d=>{const f=d[0];if(f==="p"||f==="P"){const h=YF[f];return h(d,i.formatLong)}return d}).join("").match(GQe).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const f=d[0];if(f==="'")return{isToken:!1,value:KQe(d)};if(TK[f])return{isToken:!0,value:d};
vendor: 4,636 bytes, line 4132
4132if(f.match(YQe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});i.localize.preprocessor&&(c=i.localize.preprocessor(o,c));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return c.map(d=>{if(!d.isToken)return d.value;const f=d.value;(!r?.useAdditionalWeekYearTokens&&upe(f)||!r?.useAdditionalDayOfYearTokens&&cpe(f))&&KF(f,e,String(t));const h=TK[f[0]];return h(o,f,i.localize,u)}).join("")}function KQe(t){const e=t.match(HQe);return e?e[1].replace(qQe,"'"):t}function NK(t,e){return st(t,e?.in).getDate()}function Mk(t,e){return st(t,e?.in).getDay()}function QQe(t,e){const r=st(t,e?.in),n=r.getFullYear(),i=r.getMonth(),s=xr(r,0);return s.setFullYear(n,i+1,0),s.setHours(0,0,0,0),s.getDate()}function dpe(){return Object.assign({},Yp())}function du(t,e){return st(t,e?.in).getHours()}function ZQe(t,e){const r=st(t,e?.in).getDay();return r===0?7:r}function fu(t,e){return st(t,e?.in).getMinutes()}function Qi(t,e){return st(t,e?.in).getMonth()}function hf(t){return st(t).getSeconds()}function QF(t){return+st(t)}function tr(t,e){return st(t,e?.in).getFullYear()}function Fu(t,e){return+st(t)>+st(e)}function ll(t,e){return+st(t)<+st(e)}function XQe(t,e){return+st(t)==+st(e)}function JQe(t,e){const r=eZe(e)?new e(0):xr(e,0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}function eZe(t){return typeof t=="function"&&t.prototype?.constructor===t}const tZe=10;class fpe{subPriority=0;validate(e,r){return!0}}class rZe extends fpe{constructor(e,r,n,i,s){super(),this.value=e,this.validateValue=r,this.setValue=n,this.priority=i,s&&(this.subPriority=s)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,n){return this.setValue(e,r,this.value,n)}}class nZe extends fpe{priority=tZe;subPriority=-1;constructor(e,r){super(),this.context=e||(n=>xr(r,n))}set(e,r){return r.timestampIsSet?e:xr(e,JQe(e,this.context))}}class Er{run(e,r,n,i){const s=this.parse(e,r,n,i);return s?{setter:new rZe(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(e,r,n){return!0}}class iZe extends Er{priority=140;parse(e,r,n){switch(r){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,r,n){return r.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const Kn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},$l={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Qn(t,e){return t&&{value:e(t.value),rest:t.rest}}function En(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function Fl(t,e){const r=e.match(t);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const n=r[1]==="+"?1:-1,i=r[2]?parseInt(r[2],10):0,s=r[3]?parseInt(r[3],10):0,a=r[5]?parseInt(r[5],10):0;return{value:n*(i*Ij+s*Rj+a*qKe),rest:e.slice(r[0].length)}}function hpe(t){return En(Kn.anyDigitsSigned,t)}function Fn(t,e){switch(t){case 1:return En(Kn.singleDigit,e);case 2:return En(Kn.twoDigits,e);case 3:return En(Kn.threeDigits,e);case 4:return En(Kn.fourDigits,e);default:return En(new RegExp("^\\d{1,"+t+"}"),e)}}function YT(t,e){switch(t){case 1:return En(Kn.singleDigitSigned,e);case 2:return En(Kn.twoDigitsSigned,e);case 3:return En(Kn.threeDigitsSigned,e);case 4:return En(Kn.fourDigitsSigned,e);default:return En(new RegExp("^-?\\d{1,"+t+"}"),e)}}function wV(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ppe(t,e){const r=e>0,n=r?e:1-e;let i;if(n<=50)i=t||100;else{const s=n+50,a=Math.trunc(s/100)*100,o=t>=s%100;i=t+a-(o?100:0)}return r?i:1-i}function mpe(t){return t%400===0||t%4===0&&t%100!==0}
4132class sZe extends Er{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,n){const i=s=>({year:s,isTwoDigitYear:r==="yy"});switch(r){case"y":return Qn(Fn(4,e),i);case"yo":return Qn(n.ordinalNumber(e,{unit:"year"}),i);default:return Qn(Fn(r.length,e),i)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,n){const i=e.getFullYear();if(n.isTwoDigitYear){const a=ppe(n.year,i);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const s=!("era"in r)||r.era===1?n.year:1-n.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class aZe extends Er{priority=130;parse(e,r,n){const i=s=>({year:s,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Qn(Fn(4,e),i);case"Yo":return Qn(n.ordinalNumber(e,{unit:"year"}),i);default:return Qn(Fn(r.length,e),i)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,n,i){const s=xV(e,i);if(n.isTwoDigitYear){const o=ppe(n.year,s);return e.setFullYear(o,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),mi(e,i)}const a=!("era"in r)||r.era===1?n.year:1-n.year;return e.setFullYear(a,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),mi(e,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class oZe extends Er{priority=130;parse(e,r){return YT(r==="R"?4:r.length,e)}set(e,r,n){const i=xr(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Tp(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lZe extends Er{priority=130;parse(e,r){return YT(r==="u"?4:r.length,e)}set(e,r,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class cZe extends Er{priority=120;parse(e,r,n){switch(r){case"Q":case"QQ":return Fn(r.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class uZe extends Er{priority=120;parse(e,r,n){switch(r){case"q":case"qq":return Fn(r.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class dZe extends Er{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,n){const i=s=>s-1;switch(r){case"M":return Qn(En(Kn.month,e),i);case"MM":return Qn(Fn(2,e),i);case"Mo":return Qn(n.ordinalNumber(e,{unit:"month"}),i);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class fZe extends Er{priority=110;parse(e,r,n){const i=s=>s-1;switch(r){case"L":return Qn(En(Kn.month,e),i);case"LL":return Qn(Fn(2,e),i);case"Lo":return Qn(n.ordinalNumber(e,{unit:"month"}),i);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function hZe(t,e,r){const n=st(t,r?.in),i=bV(n,r)-e;return n.setDate(n.getDate()-i*7),st(n,r?.in)}
4132class pZe extends Er{priority=100;parse(e,r,n){switch(r){case"w":return En(Kn.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return Fn(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,n,i){return mi(hZe(e,n,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mZe(t,e,r){const n=st(t,r?.in),i=zj(n,r)-e;return n.setDate(n.getDate()-i*7),n}class gZe extends Er{priority=100;parse(e,r,n){switch(r){case"I":return En(Kn.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return Fn(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,n){return Tp(mZe(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const yZe=[31,28,31,30,31,30,31,31,30,31,30,31],vZe=[31,29,31,30,31,30,31,31,30,31,30,31];class xZe extends Er{priority=90;subPriority=1;parse(e,r,n){switch(r){case"d":return En(Kn.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return Fn(r.length,e)}}validate(e,r){const n=e.getFullYear(),i=mpe(n),s=e.getMonth();return i?r>=1&&r<=vZe[s]:r>=1&&r<=yZe[s]}set(e,r,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class bZe extends Er{priority=90;subpriority=1;parse(e,r,n){switch(r){case"D":case"DD":return En(Kn.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return Fn(r.length,e)}}validate(e,r){const n=e.getFullYear();return mpe(n)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function _V(t,e,r){const n=Yp(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=st(t,r?.in),a=s.getDay(),c=(e%7+7)%7,u=7-i,d=e<0||e>6?e-(a+u)%7:(c+u)%7-(a+u)%7;return $a(s,d,r)}class wZe extends Er{priority=90;parse(e,r,n){switch(r){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,n,i){return e=_V(e,n,i),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class _Ze extends Er{priority=90;parse(e,r,n,i){const s=a=>{const o=Math.floor((a-1)/7)*7;return(a+i.weekStartsOn+6)%7+o};switch(r){case"e":case"ee":return Qn(Fn(r.length,e),s);case"eo":return Qn(n.ordinalNumber(e,{unit:"day"}),s);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,n,i){return e=_V(e,n,i),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class SZe extends Er{priority=90;parse(e,r,n,i){const s=a=>{const o=Math.floor((a-1)/7)*7;return(a+i.weekStartsOn+6)%7+o};switch(r){case"c":case"cc":return Qn(Fn(r.length,e),s);case"co":return Qn(n.ordinalNumber(e,{unit:"day"}),s);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,n,i){return e=_V(e,n,i),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function kZe(t,e,r){const n=st(t,r?.in),i=ZQe(n,r),s=e-i;return $a(n,s,r)}
vendor: 4,139 bytes, line 4132
4132class TZe extends Er{priority=90;parse(e,r,n){const i=s=>s===0?7:s;switch(r){case"i":case"ii":return Fn(r.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return Qn(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return Qn(n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return Qn(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);case"iiii":default:return Qn(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,r){return r>=1&&r<=7}set(e,r,n){return e=kZe(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class CZe extends Er{priority=80;parse(e,r,n){switch(r){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,n){return e.setHours(wV(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class EZe extends Er{priority=80;parse(e,r,n){switch(r){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,n){return e.setHours(wV(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class jZe extends Er{priority=80;parse(e,r,n){switch(r){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,n){return e.setHours(wV(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class NZe extends Er{priority=70;parse(e,r,n){switch(r){case"h":return En(Kn.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return Fn(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,n){const i=e.getHours()>=12;return i&&n<12?e.setHours(n+12,0,0,0):!i&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class PZe extends Er{priority=70;parse(e,r,n){switch(r){case"H":return En(Kn.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return Fn(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class MZe extends Er{priority=70;parse(e,r,n){switch(r){case"K":return En(Kn.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return Fn(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class AZe extends Er{priority=70;parse(e,r,n){switch(r){case"k":return En(Kn.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return Fn(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,n){const i=n<=24?n%24:n;return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class DZe extends Er{priority=60;parse(e,r,n){switch(r){case"m":return En(Kn.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return Fn(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}
4132class OZe extends Er{priority=50;parse(e,r,n){switch(r){case"s":return En(Kn.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return Fn(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class RZe extends Er{priority=30;parse(e,r){const n=i=>Math.trunc(i*Math.pow(10,-r.length+3));return Qn(Fn(r.length,e),n)}set(e,r,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class IZe extends Er{priority=10;parse(e,r){switch(r){case"X":return Fl($l.basicOptionalMinutes,e);case"XX":return Fl($l.basic,e);case"XXXX":return Fl($l.basicOptionalSeconds,e);case"XXXXX":return Fl($l.extendedOptionalSeconds,e);case"XXX":default:return Fl($l.extended,e)}}set(e,r,n){return r.timestampIsSet?e:xr(e,e.getTime()-GT(e)-n)}incompatibleTokens=["t","T","x"]}class LZe extends Er{priority=10;parse(e,r){switch(r){case"x":return Fl($l.basicOptionalMinutes,e);case"xx":return Fl($l.basic,e);case"xxxx":return Fl($l.basicOptionalSeconds,e);case"xxxxx":return Fl($l.extendedOptionalSeconds,e);case"xxx":default:return Fl($l.extended,e)}}set(e,r,n){return r.timestampIsSet?e:xr(e,e.getTime()-GT(e)-n)}incompatibleTokens=["t","T","X"]}class $Ze extends Er{priority=40;parse(e){return hpe(e)}set(e,r,n){return[xr(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class FZe extends Er{priority=20;parse(e){return hpe(e)}set(e,r,n){return[xr(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const zZe={G:new iZe,y:new sZe,Y:new aZe,R:new oZe,u:new lZe,Q:new cZe,q:new uZe,M:new dZe,L:new fZe,w:new pZe,I:new gZe,d:new xZe,D:new bZe,E:new wZe,e:new _Ze,c:new SZe,i:new TZe,a:new CZe,b:new EZe,B:new jZe,h:new NZe,H:new PZe,K:new MZe,k:new AZe,m:new DZe,s:new OZe,S:new RZe,X:new IZe,x:new LZe,t:new $Ze,T:new FZe},BZe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VZe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,UZe=/^'([^]*?)'?$/,GZe=/''/g,WZe=/\S/,HZe=/[a-zA-Z]/;function qZe(t,e,r,n){const i=()=>xr(n?.in||r,NaN),s=dpe(),a=n?.locale??s.locale??Fj,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!e)return t?i():st(r,n?.in);const u={firstWeekContainsDate:o,weekStartsOn:c,locale:a},d=[new nZe(n?.in,r)],f=e.match(VZe).map(v=>{const _=v[0];if(_ in YF){const S=YF[_];return S(v,a.formatLong)}return v}).join("").match(BZe),h=[];for(let v of f){!n?.useAdditionalWeekYearTokens&&upe(v)&&KF(v,e,t),!n?.useAdditionalDayOfYearTokens&&cpe(v)&&KF(v,e,t);const _=v[0],S=zZe[_];if(S){const{incompatibleTokens:k}=S;if(Array.isArray(k)){const T=h.find(N=>k.includes(N.token)||N.token===_);if(T)throw new RangeError(`The format string mustn't contain \`${T.fullToken}\` and \`${v}\` at the same time`)}else if(S.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${v}\` and any other token at the same time`);h.push({token:_,fullToken:v});const E=S.run(t,v,a.match,u);if(!E)return i();d.push(E.setter),t=E.rest}else{if(_.match(HZe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(v==="''"?v="'":_==="'"&&(v=YZe(v)),t.indexOf(v)===0)t=t.slice(v.length);else return i()}}if(t.length>0&&WZe.test(t))return i();const m=d.map(v=>v.priority).sort((v,_)=>_-v).filter((v,_,S)=>S.indexOf(v)===_).map(v=>d.filter(_=>_.priority===v).sort((_,S)=>S.subPriority-_.subPriority)).map(v=>v[0]);let y=st(r,n?.in);if(isNaN(+y))return i();const x={};for(const v of m){if(!v.validate(y,u))return i();const _=v.set(y,x,u);Array.isArray(_)?(y=_[0],Object.assign(x,_[1])):y=_}return y}function YZe(t){return t.match(UZe)[1].replace(GZe,"'")}function KT(t,e){const r=st(t,e?.in);return r.setMinutes(0,0,0),r}function KZe(t,e,r){const[n,i]=qa(r?.in,t,e);return+KT(n)==+KT(i)}function QZe(t,e,r){const[n,i]=qa(r?.in,t,e);return+mi(n,r)==+mi(i,r)}function ZZe(t,e){const r=st(t,e?.in);return r.setSeconds(0,0),r}function Bj(t,e,r){const[n,i]=qa(r?.in,t,e);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}function XZe(t,e,r){const[n,i]=qa(r?.in,t,e);return+qF(n)==+qF(i)}function SV(t,e,r){const[n,i]=qa(r?.in,t,e);return n.getFullYear()===i.getFullYear()}function JZe(t,e){return Lj(xr(t,t),XKe(t))}function Sb(t,e,r){const n=+st(t,r?.in),[i,s]=[+st(e.start,r?.in),+st(e.end,r?.in)].sort((a,o)=>a-o);return n>=i&&n<=s}function eXe(t,e,r){return $a(t,-1,r)}function tXe(t,e){const r=()=>xr(e?.in,NaN),i=sXe(t);let s;if(i.date){const u=aXe(i.date,2);s=oXe(u.restDateString,u.year)}if(!s||isNaN(+s))return r();const a=+s;let o=0,c;if(i.time&&(o=lXe(i.time),isNaN(o)))return r();if(i.timezone){if(c=cXe(i.timezone),isNaN(c))return r()}else{const u=new Date(a+o),d=st(0,e?.in);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return st(a+o+c,e?.in)}
4132const gS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},rXe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,nXe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,iXe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function sXe(t){const e={},r=t.split(gS.dateTimeDelimiter);let n;if(r.length>2)return e;if(/:/.test(r[0])?n=r[0]:(e.date=r[0],n=r[1],gS.timeZoneDelimiter.test(e.date)&&(e.date=t.split(gS.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){const i=gS.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function aXe(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:s===null?i:s*100,restDateString:t.slice((n[1]||n[2]).length)}}function oXe(t,e){if(e===null)return new Date(NaN);const r=t.match(rXe);if(!r)return new Date(NaN);const n=!!r[4],i=bv(r[1]),s=bv(r[2])-1,a=bv(r[3]),o=bv(r[4]),c=bv(r[5])-1;if(n)return pXe(e,o,c)?uXe(e,o,c):new Date(NaN);{const u=new Date(0);return!fXe(e,s,a)||!hXe(e,i)?new Date(NaN):(u.setUTCFullYear(e,s,Math.max(i,a)),u)}}function bv(t){return t?parseInt(t):1}function lXe(t){const e=t.match(nXe);if(!e)return NaN;const r=NA(e[1]),n=NA(e[2]),i=NA(e[3]);return mXe(r,n,i)?r*Ij+n*Rj+i*1e3:NaN}function NA(t){return t&&parseFloat(t.replace(",","."))||0}function cXe(t){if(t==="Z")return 0;const e=t.match(iXe);if(!e)return 0;const r=e[1]==="+"?-1:1,n=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return gXe(n,i)?r*(n*Ij+i*Rj):NaN}function uXe(t,e,r){const n=new Date(0);n.setUTCFullYear(t,0,4);const i=n.getUTCDay()||7,s=(e-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+s),n}const dXe=[31,null,31,30,31,30,31,31,30,31,30,31];function gpe(t){return t%400===0||t%4===0&&t%100!==0}function fXe(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(dXe[e]||(gpe(t)?29:28))}function hXe(t,e){return e>=1&&e<=(gpe(t)?366:365)}function pXe(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function mXe(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function gXe(t,e){return e>=0&&e<=59}function fs(t,e,r){const n=st(t,r?.in),i=n.getFullYear(),s=n.getDate(),a=xr(t,0);a.setFullYear(i,e,15),a.setHours(0,0,0,0);const o=QQe(a);return n.setMonth(e,Math.min(s,o)),n}function Ak(t,e,r){const n=st(t,r?.in);return n.setHours(e),n}function Dk(t,e,r){const n=st(t,r?.in);return n.setMinutes(e),n}function Hm(t,e,r){const n=st(t,r?.in),i=Math.trunc(n.getMonth()/3)+1,s=e-i;return fs(n,n.getMonth()+s*3)}function Ok(t,e,r){const n=st(t,r?.in);return n.setSeconds(e),n}function po(t,e,r){const n=st(t,r?.in);return isNaN(+n)?xr(t,NaN):(n.setFullYear(e),n)}function ep(t,e,r){return Va(t,-e,r)}function ype(t,e,r){return vV(t,-1,r)}function PK(t,e,r){return Xg(t,-1,r)}function ey(t,e,r){return ml(t,-e,r)}const vpe=["today","this_week","this_month","year_to_date","custom"],yXe=(t,e)=>{if(!t||!e)return null;const r=new Date,n=Us(r),i=Zi(r);if(t.getTime()===n.getTime()&&e.getTime()===i.getTime())return"today";const s=mi(r,{weekStartsOn:1}),a=$u(r,{weekStartsOn:1});if(t.getTime()===s.getTime()&&e.getTime()===a.getTime())return"this_week";const o=Gs(r),c=Zi(ga(r));if(t.getTime()===o.getTime()&&e.getTime()===c.getTime())return"this_month";const u=Zu(r),d=Zi(r);return t.getTime()===u.getTime()&&e.getTime()===d.getTime()?"year_to_date":null},s0=({onChange:t}={})=>{const{monthStart:e,monthEnd:r}=Hoe(),[n,i]=Dj({from:uK.withDefault(e),to:uK.withDefault(r),option:df(vpe).withDefault("this_month")});return{dateRange:n,setDateRangeWithPresetCheck:o=>{if(o.option){i(o),t?.();return}if(!o.from||!o.to){i({...o,option:"custom"}),t?.();return}const c=Zi(o.to),u={...o,to:c},f=yXe(o.from,c)||"custom";i({...u,option:f}),t?.()},resetToDefault:()=>{i({from:e,to:r,option:"this_month"}),t?.()}}},vXe={today:"Today",this_week:"This week",this_month:"This month",year_to_date:"Year to date",custom:"Custom"},xXe=t=>{const e=new Date;switch(t){case"today":{const r=Us(e),n=Zi(e);return{startDate:r,endDate:n}}case"this_week":{const r=mi(e,{weekStartsOn:1}
4132),n=$u(e,{weekStartsOn:1});return{startDate:r,endDate:n}}case"this_month":{const r=Gs(e),n=Zi(ga(e));return{startDate:r,endDate:n}}case"year_to_date":{const r=Zu(e),n=Zi(e);return{startDate:r,endDate:n}}case"custom":default:return{startDate:new Date,endDate:new Date}}},Vj=({options:t,className:e,label:r})=>{const n=t??[...vpe],{dateRange:i,setDateRangeWithPresetCheck:s}=s0(),a=o=>{const{startDate:c,endDate:u}=xXe(o);c&&u&&s({from:c,to:u,option:o})};return l.jsxs("div",{className:Pe("flex flex-col",e),children:[r&&l.jsx("p",{className:"uppercase text-xs tracking-wider text-app-primary-foreground/70 mb-2 2k:text-2xl 2k:mb-4",children:r}),l.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:n.map(o=>l.jsx("button",{type:"button",className:Pe("px-4 rounded-xl transition-colors text-sm border 2k:text-xl 2k:px-5 2k:py-2.5 cursor-pointer leading-0 h-9",i?.option===o?"bg-app-button-bg-active text-app-primary-foreground border-app-border-color-accent":"bg-app-input-bg/50 text-app-primary-foreground/70 border-app-border-color hover:bg-app-input-bg hover:text-app-primary-foreground border-dashed",o==="custom"&&"pointer-events-none opacity-70","focus-visible:border-app-border-color-accent focus-visible:ring-3 focus-visible:ring-app-border-color-accent/40 focus-visible:outline-hidden"),onClick:()=>a(o),children:vXe[o]},o))})]})},bXe=()=>l.jsx("section",{className:"fixed inset-0 z-50 flex items-center justify-center bg-linear-to-br from-app-primary via-gray-900 to-app-primary motion-reduce:transition-none motion-reduce:animate-none",children:l.jsxs(ct.div,{className:"text-center space-y-6 2k:space-y-16",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",stiffness:300,damping:30},children:[l.jsx(ct.div,{initial:{opacity:0}
4132,animate:{opacity:1},transition:{delay:.1,duration:.3},className:"mb-8 2k:mb-16",children:l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"h-16 w-16 mx-auto object-contain 2k:h-40 2k:w-40"})}),l.jsxs("div",{className:"flex flex-col items-center gap-4 2k:gap-10",children:[l.jsx(gn,{size:"md",className:"2k:w-20! 2k:h-20!"}),l.jsx(lV,{className:"text-app-primary-foreground/70 text-lg 2k:text-4xl",children:"Setting up this app for you..."})]})]})}),kV=P.memo(bXe);function wXe(){const[t,e]=b.useState("account"),[r,n]=b.useState(),[i,s]=b.useState(!1),[a,o]=b.useState(!1),[c,u]=b.useState(),d=Gt(_=>_.setUserHasura),f=RHe(),h=mfe();return{step:t,error:r,isEmailLoading:i,isGoogleLoading:a,signupData:c,handleSignupSubmit:async _=>{n(void 0);const{confirmPassword:S,termsAccepted:k,...E}=_;u(E),s(!0),e("processing");try{const T=await HFe(ar,E.email,E.password);if(T.user){await KFe(T.user,{displayName:E.firstName}),await new Promise(j=>setTimeout(j,1500)),await T.user.getIdToken(!0),await new Promise(j=>setTimeout(j,1500));const N=await f({email:T.user.email,displayName:E.firstName,photoURL:T.user.photoURL||void 0,uid:T.user.uid},{firstName:E.firstName,lastName:E.lastName,username:E.username});if(!N){try{await cue(T.user)}catch{}n("Error creating user in database. Please try again."),e("account");return}d(N)}}catch(T){if(T&&typeof T=="object"&&"code"in T&&T.code==="auth/email-already-in-use"){n("An account with this email already exists. Please sign in or use password recovery."),e("account");return}const N=T instanceof Error?T.message:"Signup failed";n(N),e("account")}finally{s(!1)}},handleGoogleSignup:async()=>{n(void 0),o(!0);try{const{user:_}=await h({auth:ar,setUserHasura:d,onError:S=>{n(S)}})}catch(_){console.error("Google authentication failed:",ks(_))}finally{o(!1)}},clearError:()=>n(void 0),resetSignup:()=>{e("account"),n(void 0),u(void 0),s(!1),o(!1)},setStep:e}}const _Xe=({onSubmit:t,error:e,isLoading:r})=>{const{register:n,handleSubmit:i,setError:s,formState:{errors:a,isSubmitting:o}}=$o({resolver:xl(GHe),defaultValues:{firstName:"",lastName:"",username:"",email:"",password:"",confirmPassword:"",termsAccepted:!1}}),c=async u=>{const d=await Ug(DT(u.username));if(!d.ok){console.error("Error checking username availability:",ks(d.error)),s("username",{type:"manual",message:"Unable to verify username availability. Please try again."});return}if(d.data){s("username",{type:"manual",message:"Username already exists. Please choose another."});return}await t(u)};return l.jsxs("form",{onSubmit:i(c),className:"space-y-6 2k:space-y-12",children:[e&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2 2k:text-xl",children:[l.jsx(Ts,{size:16}),l.jsx("span",{children:e})]}),l.jsx(tn,{label:"First Name",icon:af,error:a.firstName?.message,children:l.jsx(Wr,{...n("firstName"),hasIcon:!0,placeholder:"John",autoComplete:"given-name",className:"2k:h-16 2k:text-2xl"})}),l.jsx(tn,{label:"Last Name",icon:af,error:a.lastName?.message,children:l.jsx(Wr,{...n("lastName"),hasIcon:!0,placeholder:"Doe",autoComplete:"family-name",className:"2k:h-16 2k:text-2xl"})}),l.jsx(tn,{label:"Username",icon:af,error:a.username?.message,children:l.jsx(Wr,{...n("username"),hasIcon:!0,placeholder:"johndoe",autoComplete:"username",className:"2k:h-16 2k:text-2xl"})}),l.jsx(tn,{label:"Email",icon:fp,error:a.email?.message,children:l.jsx(Wr,{...n("email"),type:"email",hasIcon:!0,placeholder:"[email protected]",autoComplete:"email",className:"2k:h-16 2k:text-2xl"})}),l.jsx(tn,{label:"Password",icon:xs,error:a.password?.message,children:l.jsx(Wr,{...n("password"),type:"password",hasIcon:!0,placeholder:"••••••••",autoComplete:"new-password",className:"2k:h-16 2k:text-2xl"})}),l.jsx("span",{children:l.jsx("p",{className:"text-xs text-gray-400 mt-1 2k:text-lg",children:"Must be at least 8 characters, include uppercase, lowercase, a number, and a special characters."})}),l.jsx(tn,{label:"Confirm Password",icon:xs,error:a.confirmPassword?.message,children:l.jsx(Wr,{...n("confirmPassword"),type:"password",hasIcon:!0,placeholder:"••••••••",autoComplete:"new-password",className:"2k:h-16 2k:text-2xl"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("label",{className:"flex items-center gap-3 text-sm text-white select-none 2k:text-xl 2k:gap-6",children:[l.jsxs("div",{className:"relative flex items-center justify-center size-5 2k:size-8",children:[l.jsx("input",{type:"checkbox",...n("termsAccepted"),
4132className:"peer appearance-none size-[17px] border border-white/60 rounded-xs bg-black checked:bg-white checked:border-white transition-all duration-200 2k:size-7"}),l.jsx("span",{className:"absolute text-[0.8rem] text-black font-bold pointer-events-none peer-checked:opacity-100 opacity-0 transition 2k:text-2xl",children:"✓"})]}),l.jsxs("p",{className:"text-sm text-gray-400 text-center",children:["By continuing you agree to all the specified in our"," ",l.jsx("a",{href:"/docs/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"text-app-button-bg-active hover:underline",children:"Terms of use"})]})]}),a.termsAccepted&&l.jsx("p",{className:"text-red-500 text-sm 2k:text-xl",children:a.termsAccepted.message})]}),l.jsxs(ye,{type:"submit",disabled:r||o,className:"w-full 2k:h-16 2k:text-2xl",size:"lg",children:[(r||o)&&l.jsx(No,{className:"w-4 h-4 animate-spin mr-2 2k:w-8 2k:h-8"}),r||o?"Creating Account...":"Continue"]})]})},SXe=()=>{const{step:t,error:e,isEmailLoading:r,isGoogleLoading:n,handleSignupSubmit:i,handleGoogleSignup:s,clearError:a}=wXe(),o=()=>{a(),s()};return b.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),l.jsxs(l.Fragment,{children:[l.jsx(RB,{}),l.jsx("div",{className:"min-h-screen bg-app-primary flex items-center justify-center p-4 pt-28 pb-8 2k:pt-40",children:l.jsxs("div",{className:Pe("w-full space-y-8 max-w-xl 2k:max-w-4xl 2k:space-y-20 2k:p-16",t!=="account"&&"max-w-4xl 2k:max-w-5xl"),children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("img",{src:"/mt-logo-svg.svg",alt:"Market Metrics",className:"h-10 w-20 mb-2 2k:h-20 2k:w-40"}),l.jsx("h2",{className:"mt-6 text-3xl font-bold text-gray-100 2k:text-6xl",children:t==="account"&&"Create Your Account"}),l.jsx("p",{className:"mt-2 text-gray-400 2k:text-2xl",children:t==="account"&&"Start your trading journey today"})]}),l.jsx("div",{className:"mt-8 2k:mt-16",children:t==="processing"?l.jsx(kV,{}):l.jsx(l.Fragment,{children:t==="account"&&l.jsxs(l.Fragment,{children:[l.jsxs(ye,{type:"button",onClick:o,disabled:n,variant:"accent",className:"w-full 2k:h-16 2k:text-2xl",children:[n?l.jsx(No,{className:"w-5 h-5 animate-spin 2k:w-8 2k:h-8"}):l.jsx("img",{src:"/google.svg",alt:"Google",className:"w-5 h-5 2k:w-8 2k:h-8"}),n?"Signing up with Google...":"Sign up with Google"]}),l.jsxs("p",{className:"mt-8 text-sm text-gray-400 text-center 2k:text-xl 2k:mt-16",children:["By continuing you agree to all the specified in our"," ",l.jsx("a",{href:"/docs/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"text-app-button-bg-active hover:underline",children:"Terms of use"})]}),l.jsxs("div",{className:"flex items-center gap-2 mb-4 mt-8 2k:mb-8 2k:mt-16",children:[l.jsx("div",{className:"flex-1 h-px bg-gray-800"}),l.jsx("span",{className:"text-gray-500 text-xs 2k:text-lg",children:"or"}),l.jsx("div",{className:"flex-1 h-px bg-gray-800"})]}),l.jsx(_Xe,{onSubmit:i,error:e,isLoading:r})]})})})]})})]})},kXe=()=>{const t=ar.currentUser,[e,r]=b.useState(!1),[n,i]=b.useState(!1),[s,a]=b.useState(),[o,c]=b.useState(),u=async()=>{if(a(void 0),c(void 0),t)try{await tB(t),r(!0),c("Verification email sent! Please check your inbox.")}catch{a("Error sending verification email.")}},d=async()=>{a(void 0),c(void 0),i(!0);try{t&&(await Lce(t),t.emailVerified?(c("Email verified! Redirecting..."),setTimeout(()=>window.location.reload(),1200)):a("Email not verified yet. Please check your inbox."))}catch{a("Error checking verification status.")}finally{i(!1)}};return l.jsxs(l.Fragment,{children:[l.jsx(RB,{}),l.jsx("div",{className:"min-h-screen bg-app-primary flex items-center justify-center p-4",children:l.jsxs("div",{className:"max-w-md w-full space-y-8",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx(tMe,{className:"text-app-button-bg-active w-12 h-12"}),l.jsx("h2",{className:"mt-6 text-3xl font-bold text-app-primary",children:"Verify your email"}),l.jsxs("p",{className:"mt-2 text-gray-400",children:["We sent a verification link to"," ",l.jsx("span",{className:"font-semibold",children:t?.email}),".",l.jsx("br",{}),"Please check your inbox and click the link to verify your account."]})]}),s&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2",children:[l.jsx("span",{children:"⚠️"}),l.jsx("span",{children:s})]}),o&&l.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500 text-emerald-500 rounded-lg p-3 text-sm flex items-center gap-2",children:[l.jsx("span",{children:"✅"}),l.jsx("span",{children:o})]}),l.jsxs("div",{className:"flex flex-col gap-3 mt-4",children:[l.jsx(ye,{onClick:u,disabled:e,className:"w-full",variant:"secondary",children:e?"Verification email sent!":"Resend verification email"}),l.jsx(ye,{onClick:d,disabled:n,className:"w-full",children:n?"Checking...":"I have verified my email"})]})]})})]})};function TXe(){return l.jsx(kXe,{})}const CXe={char:.03,word:.05,line:.1},qm={hidden:{opacity:0}
4132,visible:{opacity:1,transition:{staggerChildren:.05}},exit:{transition:{staggerChildren:.05,staggerDirection:-1}}},EXe={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},jXe={blur:{container:qm,item:{hidden:{opacity:0,filter:"blur(12px)"},visible:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(12px)"}}},"fade-in-blur":{container:qm,item:{hidden:{opacity:0,y:20,filter:"blur(12px)"},visible:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:20,filter:"blur(12px)"}}},scale:{container:qm,item:{hidden:{opacity:0,scale:0},visible:{opacity:1,scale:1},exit:{opacity:0,scale:0}}},fade:{container:qm,item:{hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}}},slide:{container:qm,item:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0},exit:{opacity:0,y:20}}}},xpe=P.memo(({segment:t,variants:e,per:r,segmentWrapperClassName:n})=>{const i=r==="line"?l.jsx(ct.span,{variants:e,className:"block",children:t}):r==="word"?l.jsx(ct.span,{"aria-hidden":"true",variants:e,className:"inline-block whitespace-pre",children:t}):l.jsx(ct.span,{className:"inline-block whitespace-pre",children:t.split("").map((a,o)=>l.jsx(ct.span,{"aria-hidden":"true",variants:e,className:"inline-block whitespace-pre",children:a},`char-${o}`))});if(!n)return i;const s=r==="line"?"block":"inline-block";return l.jsx("span",{className:Pe(s,n),children:i})});xpe.displayName="AnimationComponent";const NXe=(t,e)=>e==="line"?t.split(`
4133`):t.split(/(\s+)/),QT=t=>t?typeof t=="object"&&"transition"in t:!1,MK=(t,e)=>{if(!e)return t;const{exit:r,...n}=e;return{...t,visible:{...t.visible,transition:{...QT(t.visible)?t.visible.transition:{},...n}},exit:{...t.exit,transition:{...QT(t.exit)?t.exit.transition:{},...n,staggerDirection:-1}}}};function ty({children:t,per:e="word",as:r="p",variants:n,className:i,preset:s="fade",delay:a=0,speedReveal:o=1,speedSegment:c=1,trigger:u=!0,onAnimationComplete:d,onAnimationStart:f,segmentWrapperClassName:h,containerTransition:m,segmentTransition:y,style:x,viewport:v}){const _=NXe(t,e),S=ct[r],k=s?jXe[s]:{container:qm,item:EXe},E=CXe[e]/o,T=.3/c,N=QT(n?.container?.visible??{})?(n?.container?.visible).transition?.staggerChildren:void 0,j=QT(n?.container?.visible??{})?(n?.container?.visible).transition?.delayChildren:void 0,M={container:MK(n?.container||k.container,{staggerChildren:N??E,delayChildren:j??a,...m,exit:{staggerChildren:N??E,staggerDirection:-1}}),item:MK(n?.item||k.item,{duration:T,...y})},O=v?{initial:"hidden",whileInView:"visible",viewport:v}:{initial:"hidden",animate:"visible",exit:"exit"};return l.jsx(Ss,{mode:"popLayout",children:u&&l.jsxs(S,{...O,variants:M.container,className:i,onAnimationComplete:d,onAnimationStart:f,style:x,children:[e!=="line"?l.jsx("span",{className:"sr-only",children:t}):null,_.map((R,I)=>l.jsx(xpe,{segment:R,variants:M.item,per:e,segmentWrapperClassName:h},`${e}-${I}-${R}`))]})})}const PA={hidden:{opacity:0,filter:"blur(12px)",y:12},visible:{opacity:1,filter:"blur(0px)",y:0,transition:{type:"spring",bounce:.3,duration:1.5}}},PXe=[{icon:BE,title:"Lightning Fast",description:"Real-time trade analysis and instant performance metrics to keep you ahead of the market."},{icon:ooe,title:"Comprehensive Analytics",description:"Deep insights into your trading patterns, P&L analysis, and performance metrics across all timeframes."},{icon:zE,title:"Secure & Private",description:"Your trading data is encrypted and secure. We prioritize your privacy and never share your information."}];function MXe(){return l.jsx("section",{id:"features",className:"py-16 md:py-32",children:l.jsxs("div",{className:"mx-auto max-w-6xl space-y-12 px-6",children:[l.jsx(Xh,{variants:PA,viewport:{once:!0,margin:"-50px"},children:l.jsxs("div",{className:"relative z-10 grid items-center gap-4 md:grid-cols-2 md:gap-12",children:[l.jsx(ty,{preset:"fade-in-blur",speedSegment:.3,as:"h2",className:"text-4xl font-semibold",viewport:{once:!0,margin:"-50px"},children:"Advanced trading analytics designed for serious traders"}),l.jsx(ty,{preset:"fade-in-blur",speedSegment:.3,delay:.2,as:"p",className:"max-w-sm sm:ml-auto text-app-primary-foreground
4133/70 2k:max-w-md 2k:text-xl",viewport:{once:!0,margin:"-50px"},children:"Transform your trading performance with comprehensive analytics, detailed journaling, and actionable insights that help you identify patterns and improve your strategy."})]})}),l.jsx(Xh,{variants:{container:{visible:{transition:{staggerChildren:.1,delayChildren:.3}}},item:PA},viewport:{once:!0,margin:"-200px"},children:l.jsxs("div",{className:"relative overflow-hidden px-6 sm:mr-0",children:[l.jsx("div",{"aria-hidden":!0,className:"bg-linear-to-b to-app-primary absolute inset-0 z-10 from-transparent from-15% to-95%"}),l.jsx("div",{className:"ring-app-border-color-soft bg-app-primary relative mx-auto max-w-6xl overflow-hidden rounded-2xl p-4 ring-2 mt-1",children:l.jsx("img",{className:"bg-app-primary aspect-15/8 object-cover object-center relative block rounded-2xl",src:"/insights-ss.png",alt:"Trading journal application interface",width:"2700",height:"1440"})})]})}),l.jsx(Xh,{variants:{container:{visible:{transition:{staggerChildren:.1,delayChildren:.5}}},item:PA},className:"relative mx-auto grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-6 sm:gap-8 lg:grid-cols-3",viewport:{once:!0,margin:"-100px"},children:PXe.map((t,e)=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(t.icon,{className:"size-7 text-app-button-bg-active"}),l.jsx("h3",{className:"text-base font-medium 2k:text-2xl",children:t.title})]}),l.jsx("p",{className:"text-app-primary-foreground/70 text-sm leading-relaxed 2k:text-xl",children:t.description})]},e))})]})})}const AXe=()=>{const{data:t,loading:e,error:r}=da(hVe),n=b.useMemo(()=>t?.plan?gVe(t.plan.map(_de)):[],[t?.plan]),i=e,s=r?.message||null;return{plans:n,isLoading:i,error:s}},DXe={0:l.jsx(pMe,{className:"w-6 h-6 2k:w-12 2k:h-12"}),1:l.jsx(BE,{className:"w-6 h-6 2k:w-12 2k:h-12"}),2:l.jsx(APe,{className:"w-6 h-6 2k:w-12 2k:h-12"})};function OXe({title:t="Choose your trading plan",description:e="Select the plan that matches your trading goals and unlock your full potential"}){const{plans:r}=AXe(),[n,i]=b.useState(!0);return l.jsxs("section",{id:"pricing",className:"container py-8 mx-auto relative px-6 2k:py-20 2k:px-24",children:[l.jsx(Zy,{}),l.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 text-center mb-12 2k:max-w-6xl 2k:space-y-12 2k:mb-20",children:[l.jsx(ty,{preset:"fade-in-blur",speedSegment:.3,as:"h2",className:"text-4xl font-semibold lg:text-5xl text-app-primary-foreground",viewport:{once:!0,margin:"-50px"},children:t}),l.jsx(ty,{preset:"fade-in-blur",speedSegment:.3,as:"p",className:"text-lg text-app-primary-foreground/70 2k:text-2xl",viewport:{once:!0,margin:"-50px"},children:e})]}),l.jsxs("div",{className:"flex flex-col items-center gap-4 lg:mb-12 2k:gap-8",children:[l.jsx("div",{className:"relative",children:l.jsxs("div",{className:"relative bg-app-input-bg/80 backdrop-blur-xs border border-app-border-color rounded-2xl p-1.5 flex items-center gap-1 2k:p-4 2k:gap-4",children:[l.jsx(ct.div,{className:"absolute top-1.5 h-[calc(100%-12px)] bg-linear-to-r from-app-button-bg-active to-app-button-bg-active/80 rounded-xl shadow-lg shadow-app-button-bg-active/25 2k:top-2 2k:h-[calc(100%-16px)]",animate:{left:n?"6px":"50%",width:"calc(50% - 8px)"},transition:{type:"spring",stiffness:300,damping:30}}),l.jsx("button",{onClick:()=>i(!0),className:ee("relative z-10 px-6 py-3 rounded-xl text-sm font-medium transition-all duration-200 flex-1 text-center min-w-[100px] 2k:text-xl 2k:px-12 2k:py-5",n?"text-app-primary-foreground":"text-app-primary-foreground/60 hover:text-app-primary-foreground/80"),children:"Monthly"}),l.jsx("button",{onClick:()=>i(!1),className:ee("relative z-10 px-6 py-3 rounded-xl text-sm font-medium transition-all duration-200 flex-1 text-center min-w-[100px] 2k:text-xl 2k:px-12 2k:py-5",n?"text-app-primary-foreground/60 hover:text-app-primary-foreground/80":"text-app-primary-foreground"),children:"Annual"})]})}),l.jsx(ct.div,{initial:{opacity:0,y:10,scale:.8},animate:{opacity:n?0:1,y:n?10:0,scale:n?.8:1},transition:{type:"spring",stiffness:400,damping:25},className:"flex items-center gap-2 2k:gap-6",children:l.jsx("div",{className:"bg-linear-to-r from-app-button-bg-active to-app-button-bg-active/80 text-app-primary-foreground px-3 py-1.5 rounded-full text-xs font-semibold shadow-lg shadow-app-button-bg-active/25 2k:text-lg 2k:px-8 2k:py-3",children:"Save up to 34% paying yearly"})})]}),l.jsx("div",{className:"flex flex-col lg:flex-row gap-10 md:gap-6 max-w-6xl justify-center items-center mx-auto 2k:gap-16 2k:max-w-[90vw]",children:r.map((s,a)=>l.jsxs(ct.div,{initial:{y:50,opacity:0}
4133,whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{duration:.8,type:"spring",stiffness:100,damping:30,delay:a*.1},className:ee("relative rounded-2xl bg-app-card/50 border backdrop-blur-xs p-10 md:min-w-[400px] w-full 2k:p-16 2k:rounded-[2.5rem] 2k:min-w-[480px]",s.isPopular?"border-app-button-bg-active shadow-2xl z-10 shadow-app-button-bg-active/30":"border-app-border-color md:my-10","flex flex-col h-full",!s.isActive&&"opacity-60 pointer-events-none"),children:[s.isPopular&&s.isActive&&l.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:l.jsx("div",{className:"bg-app-button-bg-active text-app-primary-foreground px-4 py-1 rounded-full text-sm font-medium 2k:text-xl 2k:px-8 2k:py-2",children:"Recommended"})}),!s.isActive&&l.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:l.jsx("div",{className:"bg-app-card text-app-primary-foreground/80 px-4 py-1 rounded-full text-sm font-medium border border-app-border-color 2k:text-xl 2k:px-8 2k:py-2",children:"Coming Soon"})}),l.jsx("div",{className:"mb-6 2k:mb-12",children:l.jsx("div",{className:ee("w-12 h-12 rounded-lg flex items-center justify-center relative 2k:w-24 2k:h-24",s.isPopular&&s.isActive?"bg-app-button-bg-active":"bg-app-input-bg"),children:l.jsx("div",{className:"text-app-primary-foreground",children:DXe[a]})})}),l.jsxs("div",{className:"mb-6 2k:mb-12",children:[l.jsx("h3",{className:"text-xl font-semibold text-app-primary-foreground mb-3 2k:text-4xl 2k:mb-6",children:s.name}),l.jsx("p",{className:"text-app-primary-foreground/60 text-sm leading-relaxed 2k:text-xl",children:s.description})]}),l.jsx("div",{className:"mb-8 2k:mb-14",children:l.jsxs("div",{className:"flex items-baseline gap-1 2k:gap-4",children:[l.jsxs("span",{className:"text-5xl font-bold text-app-primary-foreground 2k:text-7xl",children:[s.isActive&&l.jsx(gV,{value:Number(n?s.prices.month.price:s.prices.year.price),plugins:[dV],format:{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:2},willChange:!0}),!s.isActive&&l.jsx("span",{className:"text-5xl font-bold text-app-primary-foreground 2k:text-7xl",children:"-"})]}),l.jsxs("span",{className:"text-app-primary-foreground/60 text-sm 2k:text-2xl",children:["/"," ",n?"Month":"Year"]})]})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-app-primary-foreground font-medium mb-4 2k:text-2xl 2k:mb-8",children:"This plan includes"}),l.jsxs("ul",{className:"space-y-3 2k:space-y-6",children:[s.features.length>0&&s.features.map((o,c)=>l.jsxs("li",{className:"flex items-start gap-3 2k:gap-6",children:[l.jsx(ei,{className:"w-5 h-5 text-app-border-color-accent mt-0.5 shrink-0 2k:w-8 2k:h-8"}),l.jsx("span",{className:"text-app-primary-foreground/70 text-sm 2k:text-xl",children:o})]},c)),s.features.length===0&&l.jsx("li",{className:"flex items-start gap-3 2k:gap-6",children:l.jsx("span",{className:"text-app-primary-foreground/70 text-sm 2k:text-xl",children:"No features available"})})]})]}),l.jsx("div",{className:"mt-8 2k:mt-16",children:l.jsx(ye,{asChild:!0,variant:s.isPopular?"default":"outline-solid",disabled:!s.isActive,className:"2k:h-20 2k:text-2xl",children:l.jsx(At,{to:s.isActive?"/signup":"#",className:ee("w-full inline-flex items-center justify-center px-6 py-3 rounded-xl font-medium transition-all duration-200 2k:text-2xl 2k:px-16 2k:py-6",s.isPopular?"bg-app-button-bg-active hover:bg-app-button-bg-active/90 text-app-primary-foreground shadow-lg shadow-app-button-bg-active/30":"bg-app-input-bg hover:bg-app-input-bg/80 text-app-primary-foreground border border-app-border-color",!s.isActive&&"cursor-not-allowed opacity-50"),children:s.isActive?"Get Started":"Coming Soon"})})})]},a))})]})}const bpe=({number:t=20,minDelay:e=.2,maxDelay:r=1.2,minDuration:n=2,maxDuration:i=10,angle:s=215,className:a})=>{const[o,c]=b.useState([]);return b.useEffect(()=>{const u=[...new Array(t)].map(()=>({"--angle":`${-s}deg`,top:"-5%",left:`calc(0% + ${Math.floor(Math.random()*window.innerWidth)}px)`,animationDelay:`${Math.random()*(r-e)+e}s`,animationDuration:`${Math.floor(Math.random()*(i-n)+n)}s`}));c(u)},[t,e,r,n,i,s]),l.jsx(l.Fragment,{children:[...o].map((u,d)=>l.jsx("span",{style:{...u},className:ee("pointer-events-none absolute size-0.5 rotate-(--angle) animate-meteor rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]",a),children:l.jsx("div",{className:"pointer-events-none absolute top-1/2 -z-10 h-px w-[50px] -translate-y-1/2 bg-linear-to-r from-zinc-500 to-transparent"})},d))})},RXe=()=>l.jsxs("section",{id:"cta",className:"relative flex w-full flex-col items-center justify-center h-full overflow-hidden py-24",children:[l.jsx("h2",{className:"pointer-events-none whitespace-pre-wrap bg-linear-to-b bg-clip-text text-4xl md:text-6xl lg:text-8xl font-semibold leading-none text-transparent from-white to-slate-900/30 mx-auto text-center max-w-4xl",children:"Join thousands of traders who are taking control of their trading journey"}),l.jsx(ye,{size:"lg",className:"mt-12",asChild:!0,children:l.jsxs(At,{to:"/signup",className:"flex items-center gap-2 2k:text-2xl 2k:py-8",children:["Get started",l.jsx(Cs,{className:"size-5"})]})}),l.jsx(bpe,{number:25,angle:90,maxDuration:10})]});function IXe({width:t=40,height:e=40,x:r=-1,y:n=-1,strokeDasharray:i=0,numSquares:s=50,className:a,maxOpacity:o=.5,duration:c=4,...u}){const d=b.useId(),f=b.useRef(null),[h,m]=b.useState({width:0,height:0}),[y,x]=b.useState(()=>_(s));function v(){return[Math.floor(Math.random()*h.width/t),Math.floor(Math.random()*h.height/e)]}function _(k){return Array.from({length:k},(E,T)=>({id:T,pos:v()}))}const S=k=>{x(E=>E.map(T=>T.id===k?{...T,pos:v()}:T))};return b.useEffect(()=>{h.width&&h.height&&x(_(s))},[h,s]),b.useEffect(()=>{const k=new ResizeObserver(E=>{for(const T of E)m({width:T.contentRect.width,height:T.contentRect.height})});return f.current&&k.observe(f.current),()=>{f.current&&k.unobserve(f.current)}},[f]),l.jsxs("svg",{ref:f,"aria-hidden":"true",className:ee("pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30",a),...u,children:[l.jsx("defs",{children:l.jsx("pattern",{id:d,width:t,height:e,patternUnits:"userSpaceOnUse",x:r,y:n,children:l.jsx("path",{d:`M.5 ${e}V.5H${t}`,fill:"none",strokeDasharray:i})})}),l.jsx("rect",{width:"100%",height:"100%",fill:`url(#${d})`}),l.jsx("svg",{x:r,y:n,className:"overflow-visible",children:y.map(({pos:[k,E],id:T},N)=>l.jsx(ct.rect,{initial:{opacity:0}
4133,animate:{opacity:o},transition:{duration:c,repeat:1,delay:N*.1,repeatType:"reverse"},onAnimationComplete:()=>S(T),width:t-1,height:e-1,x:k*t+1,y:E*e+1,fill:"currentColor",strokeWidth:"0"},`${k}-${E}-${N}`))})]})}const MA={hidden:{opacity:0,filter:"blur(12px)",y:12},visible:{opacity:1,filter:"blur(0px)",y:0,transition:{type:"spring",bounce:.3,duration:1.5}}},LXe=`${es} is the new way to track your trading`;function $Xe(){return l.jsxs("section",{id:"hero",className:"overflow-hidden relative",children:[l.jsx(IXe,{numSquares:30,maxOpacity:.1,duration:3,className:Pe("mask-[radial-gradient(1000px_circle_at_center,white,transparent)]","inset-x-0 inset-y-[-40%] h-[200%] skew-y-12")}),l.jsxs("div",{"aria-hidden":!0,className:"absolute inset-0 isolate hidden opacity-80 contain-strict lg:block",children:[l.jsx("div",{className:"absolute left-0 top-0 w-140 h-320 -translate-y-87.5 -rotate-45 rounded-full bg-[radial-gradient(68.54%_68.72%_at_55.02%_31.46%,hsla(0,0%,85%,.08)_0,hsla(0,0%,55%,.02)_50%,hsla(0,0%,45%,0)_80%)]"}),l.jsx("div",{className:"absolute left-0 top-0 w-60 h-320 -rotate-45 rounded-full bg-[radial-gradient(50%_50%_at_50%_50%,hsla(0,0%,85%,.06)_0,hsla(0,0%,45%,.02)_80%,transparent_100%)] translate-x-[5%] -translate-y-1/2"}),l.jsx("div",{className:"absolute left-0 top-0 w-60 h-320 -translate-y-87.5 -rotate-45 bg-[radial-gradient(50%_50%_at_50%_50%,hsla(0,0%,85%,.04)_0,hsla(0,0%,45%,.02)_80%,transparent_100%)]"})]}),l.jsx("section",{children:l.jsxs("div",{className:"relative pt-24 md:pt-36",children:[l.jsx("div",{className:"mx-auto max-w-7xl px-6",children:l.jsxs("div",{className:"text-center sm:mx-auto lg:mr-auto lg:mt-0",children:[l.jsx(Xh,{variants:MA,children:l.jsxs(At,{to:"/signup",className:"hover:bg-app-primary bg-app-input-bg group mx-auto flex w-fit items-center gap-4 roun
4133ded-full border border-app-border-color p-1 pl-4 transition-colors duration-300",children:[l.jsx("span",{className:"text-foreground text-sm",children:"Professional Trading Journal Platform"}),l.jsx("span",{className:"dark:border-background block h-4 w-0.5 border-l bg-white dark:bg-zinc-700"}),l.jsx("div",{className:"bg-background group-hover:bg-muted size-6 overflow-hidden rounded-full duration-500",children:l.jsxs("div",{className:"flex w-12 -translate-x-1/2 duration-500 ease-in-out group-hover:translate-x-0",children:[l.jsx("span",{className:"flex size-6",children:l.jsx(Jx,{className:"m-auto size-3"})}),l.jsx("span",{className:"flex size-6",children:l.jsx(Jx,{className:"m-auto size-3"})})]})})]})}),l.jsx(ty,{preset:"fade-in-blur",speedSegment:.3,as:"h1",className:"mt-8 text-balance text-6xl md:text-7xl lg:mt-16 xl:text-[5.25rem]  ",children:LXe}),l.jsx(ty,{per:"line",preset:"fade-in-blur",speedSegment:.3,delay:.5,as:"p",className:"mx-auto mt-8 max-w-2xl text-balance text-lg text-gray-400 2k:text-2xl 2k:max-w-3xl",children:"Track, analyze, and improve your trading performance with our professional-grade journal platform. Make data-driven decisions and elevate your trading strategy."}),l.jsxs(Xh,{variants:{container:{visible:{transition:{staggerChildren:.05,delayChildren:.75}}},item:MA},className:"mt-12 flex flex-col items-center justify-center gap-4 md:flex-row",children:[l.jsx(ye,{asChild:!0,size:"lg",className:"rounded-xl px-5 text-base",children:l.jsx(At,{to:"/signup",children:l.jsx("span",{className:"text-nowrap 2k:text-2xl",children:"Start Trading Journal"})})},1),l.jsx(ye,{asChild:!0,variant:"outline",size:"lg",className:"rounded-xl px-5 text-base",children:l.jsx(At,{to:"#features",children:l.jsx("span",{className:"text-nowrap 2k:text-2xl",children:"Learn More"})})},2)]})]})}),l.jsx(Xh,{variants:{container:{visible:{transition:{staggerChildren:.05,delayChildren:.75}}},item:MA},children:l.jsxs("div",{className:"relative -mr-56 mt-8 overflow-hidden px-6 lg:px-2 sm:mr-0 sm:mt-12 md:mt-20 w-screen",children:[l.jsx("div",{"aria-hidden":!0,className:"bg-linear-to-b to-app-primary absolute inset-0 z-10 from-transparent from-35%"}),l.jsx("div",{className:"ring-app-border-color-soft bg-app-primary relative mx-auto max-w-6xl overflow-hidden rounded-2xl p-4 shadow-zinc-950/15 ring-2 mt-1",children:l.jsx("img",{className:"bg-app-primary aspect-15/8 relative block rounded-2xl object-cover object-center",src:"/dashboard-ss.png",alt:"Trading journal application interface",width:"2700",height:"1440"})})]})})]})})]})}const FXe=()=>{const t=ns();return b.useEffect(()=>{const r=new URLSearchParams(t.search).get("scrollTo");if(!r)return;const n=window.setTimeout(()=>{const i=document.getElementById(r);i&&i.scrollIntoView({behavior:"smooth"})},100);return()=>{clearTimeout(n)}},[t.search]),l.jsxs("div",{className:"min-h-screen bg-app-primary overflow-hidden",children:[l.jsx($Xe,{}),l.jsx(MXe,{}),l.jsx(OXe,{}),l.jsx(RXe,{})]})},zXe=[{path:"/",element:l.jsx(xVe,{}),children:[{element:l.jsx(FXe,{}),index:!0},{path:"login",element:l.jsx(WHe,{})},{path:"signup",element:l.jsx(SXe,{})},{path:"verify-email",element:l.jsx(TXe,{})},{path:"docs",element:l.jsx(E$e,{}),children:[{index:!0,element:l.jsx($$e,{})},{path:"terms-of-use",element:l.jsx(V$e,{})},{path:"privacy-policy",element:l.jsx(z$e,{})},{path:"common-issues",element:l.jsx(R$e,{})},{path:"import-thinkorswim",element:l.jsx(F$e,{})},{path:"import-das-trader",element:l.jsx(L$e,{})},{path:"contact-support",element:l.jsx(I$e,{})},{path:"report-bug",element:l.jsx(B$e,{})},{path:"cancel-subscription",element:l.jsx(O$e,{})}]}]}],Sa=({feature:t,action:e="READ",children:r})=>{const{isLoading:n,isInitialized:i,hasPermission:s}=Fw();return n||!i?l.jsx(kV,{}):s(t,e)?r:l.jsxs("div",{className:"min-h-screen bg-app-primary text-app-primary-foreground",children:[l.jsx("div",{className:"absolute inset-0 bg-linear-to-br from-app-primary via-app-primary to-app-card opacity-50"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(120,119,198,0.1),transparent_50%)]"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_70%_80%,rgba(120,119,198,0.05),transparent_50%)]"}),l.jsx("div",{className:"relative flex flex-col items-center justify-center min-h-screen px-6",children:l.jsxs("div",{className:"text-center max-w-lg mx-auto",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 bg-app-button-bg-active/20 rounded-full blur-xl scale-150"}),l.jsx("div",{className:"relative bg-app-card border border-app-border-color-soft rounded-full p-6 shadow-2xl",children:l.jsx(zE,{size:48,className:"text-app-text-accent",strokeWidth:1.5})})]})}),l.jsx("h1",{className:"text-4xl font-bold mb-4 bg-linear-to-r from-app-primary-foreground to-app-text-accent bg-clip-text text-transparent",children:"Access Restricted"}
4133),l.jsx("p",{className:"text-lg text-app-primary-foreground/70 mb-8 leading-relaxed",children:"You don't have permission to access this feature. Please contact your administrator to request access or upgrade your plan."}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[l.jsxs(ye,{onClick:()=>window.history.back(),variant:"outline",size:"lg",className:"w-full sm:w-auto group",children:[l.jsx(Tu,{size:18,className:"group-hover:-translate-x-1 transition-transform duration-300"}),"Go Back"]}),l.jsx(ye,{onClick:()=>window.location.href="/app/dashboard",variant:"default",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsxs(At,{to:"/app/dashboard",children:[l.jsx(kw,{size:18}),"Dashboard"]})})]}),l.jsx("div",{className:"mt-12 p-6 bg-app-card/50 border border-app-border-color-soft rounded-xl backdrop-blur-xs",children:l.jsx("p",{className:"text-sm text-app-primary-foreground/60",children:"Need access to this feature? Contact support or check your subscription plan for available features."})})]})})]})},Sh=({onClick:t,icon:e,ariaLabel:r,variant:n="primary",size:i="sm",disabled:s=!1,tooltip:a})=>{const o={primary:"bg-app-primary/20 hover:bg-app-primary/30 border-app-border-color-soft hover:border-app-border-color text-app-primary-foreground hover:text-app-primary-foreground/80",outline:"bg-transparent border-app-border-color-soft hover:border-app-border-color text-app-primary-foreground hover:text-app-primary-foreground/80",secondary:"bg-app-primary/20 hover:bg-app-primary/30 border-app-border-color-soft hover:border-app-border-color text-app-primary-foreground hover:text-app-primary-foreground/80",accent:"bg-app-button-bg-active hover:bg-app-button-bg-active/80 border-app-border-color-soft hover:border-app-border-color text-app-primary-foreground hover:text-app-primary-foreground/80",insights:"bg-app-button-bg border border-app-border-color text-white hover:bg-app-input-bg-hover"},c={sm:"p-2 2k:p-4",md:"p-2.5",lg:"p-4",input:"p-3"},u={sm:16,md:20,lg:24};return l.jsxs("div",{className:"relative group",children:[l.jsxs("button",{type:"button",onClick:t,disabled:s,"aria-label":r,className:Pe("relative border rounded-xl transition-all duration-300 ease-out focus:outline-hidden focus:ring-2 focus:ring-app-border-color-accent hover:shadow-lg",o[n],c[i],s?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:[l.jsx(e,{size:u[i],strokeWidth:1.5,className:"2k:w-7 2k:h-7"}),l.jsx("div",{className:"absolute inset-0 rounded-xl bg-white/5 opacity-0 group-active:opacity-100 transition-opacity duration-150"})]}),a&&l.jsxs("div",{className:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-app-button-bg text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none whitespace-nowrap",children:[a,l.jsx("div",{className:"absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-app-button-bg"})]})]})};var BXe=Object.defineProperty,VXe=(t,e,r)=>e in t?BXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AA=(t,e,r)=>(VXe(t,typeof e!="symbol"?e+"":e,r),r);let UXe=class{constructor(){AA(this,"current",this.detect()),AA(this,"handoffState","pending"),AA(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new UXe;function Uj(t){var e,r;return hu.isServer?null:t?"ownerDocument"in t?t.ownerDocument:"current"in t?(r=(e=t.current)==null?void 0:e.ownerDocument)!=null?r:document:null:document}function Gj(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Xu(){let t=[],e={addEventListener(r,n,i,s){return r.addEventListener(n,i,s),e.add(()=>r.removeEventListener(n,i,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Gj(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:s}
vendor: 8,845 bytes, lines 4133-4136
4133)})},group(r){let n=Xu();return r(n),this.add(()=>n.dispose())},add(r){return t.includes(r)||t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function Wj(){let[t]=b.useState(Xu);return b.useEffect(()=>()=>t.dispose(),[t]),t}let ca=(t,e)=>{hu.isServer?b.useEffect(t,e):b.useLayoutEffect(t,e)};function Kp(t){let e=b.useRef(t);return ca(()=>{e.current=t},[t]),e}let Yr=function(t){let e=Kp(t);return P.useCallback((...r)=>e.current(...r),[e])};function e1(t){return b.useMemo(()=>t,Object.values(t))}let GXe=b.createContext(void 0);function WXe(){return b.useContext(GXe)}function ZF(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function zu(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zu),n}var ZT=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(ZT||{}),Wd=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Wd||{});function Bo(){let t=qXe();return b.useCallback(e=>HXe({mergeRefs:t,...e}),[t])}function HXe({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:s=!0,name:a,mergeRefs:o}){o=o??YXe;let c=wpe(e,t);if(s)return yS(c,r,n,a,o);let u=i??0;if(u&2){let{static:d=!1,...f}=c;if(d)return yS(f,r,n,a,o)}if(u&1){let{unmount:d=!0,...f}=c;return zu(d?0:1,{0(){return null},1(){return yS({...f,hidden:!0,style:{display:"none"}},r,n,a,o)}})}return yS(c,r,n,a,o)}function yS(t,e={},r,n,i){let{as:s=r,children:a,refName:o="ref",...c}=DA(t,["unmount","static"]),u=t.ref!==void 0?{[o]:t.ref}:{},d=typeof a=="function"?a(e):a;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(e)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(e){let h=!1,m=[];for(let[y,x]of Object.entries(e))typeof x=="boolean"&&(h=!0),x===!0&&m.push(y.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(h){f["data-headlessui-state"]=m.join(" ");for(let y of m)f[`data-${y}`]=""}}if(Nx(s)&&(Object.keys(kh(c)).length>0||Object.keys(kh(f)).length>0))if(!b.isValidElement(d)||Array.isArray(d)&&d.length>1||QXe(d)){if(Object.keys(kh(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(kh(c)).concat(Object.keys(kh(f))).map(h=>`  - ${h}`).join(`
4134`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>`  - ${h}`).join(`
4135`)].join(`
4136`))}else{let h=d.props,m=h?.className,y=typeof m=="function"?(..._)=>ZF(m(..._),c.className):ZF(m,c.className),x=y?{className:y}:{},v=wpe(d.props,kh(DA(c,["ref"])));for(let _ in f)_ in v&&delete f[_];return b.cloneElement(d,Object.assign({},v,f,u,{ref:i(KXe(d),u.ref)},x))}return b.createElement(s,Object.assign({},DA(c,["ref"]),!Nx(s)&&u,!Nx(s)&&f),d)}function qXe(){let t=b.useRef([]),e=b.useCallback(r=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return t.current=r,e}}function YXe(...t){return t.every(e=>e==null)?void 0:e=>{for(let r of t)r!=null&&(typeof r=="function"?r(e):r.current=e)}}function wpe(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];if(e.disabled||e["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[i=>{var s;return(s=i?.preventDefault)==null?void 0:s.call(i)}]);for(let n in r)Object.assign(e,{[n](i,...s){let a=r[n];for(let o of a){if((i instanceof Event||i?.nativeEvent instanceof Event)&&i.defaultPrevented)return;o(i,...s)}}});return e}function ya(t){var e;return Object.assign(b.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function kh(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function DA(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function KXe(t){return P.version.split(".")[0]>="19"?t.props.ref:t.ref}function Nx(t){return t===b.Fragment||t===Symbol.for("react.fragment")}function QXe(t){return Nx(t.type)}let ZXe="span";var XT=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(XT||{});function XXe(t,e){var r;let{features:n=1,...i}=t,s={ref:e,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Bo()({ourProps:s,theirProps:i,slot:{},defaultTag:ZXe,name:"Hidden"})}let XF=ya(XXe);function JXe(t){return typeof t!="object"||t===null?!1:"nodeType"in t}function pf(t){return JXe(t)&&"tagName"in t}function Cp(t){return pf(t)&&"accessKey"in t}function Hd(t){return pf(t)&&"tabIndex"in t}function eJe(t){return pf(t)&&"style"in t}function tJe(t){return Cp(t)&&t.nodeName==="IFRAME"}function rJe(t){return Cp(t)&&t.nodeName==="INPUT"}let _pe=Symbol();function nJe(t,e=!0){return Object.assign(t,{[_pe]:e})}function Sc(...t){let e=b.useRef(t);b.useEffect(()=>{e.current=t},[t]);let r=Yr(n=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return t.every(n=>n==null||n?.[_pe])?void 0:r}let TV=b.createContext(null);TV.displayName="DescriptionContext";function Spe(){let t=b.useContext(TV);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Spe),e}return t}function iJe(){let[t,e]=b.useState([]);return[t.length>0?t.join(" "):void 0,b.useMemo(()=>function(r){let n=Yr(s=>(e(a=>[...a,s]),()=>e(a=>{let o=a.slice(),c=o.indexOf(s);return c!==-1&&o.splice(c,1),o}))),i=b.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return P.createElement(TV.Provider,{value:i},r.children)},[e])]}let sJe="p";function aJe(t,e){let r=b.useId(),n=WXe(),{id:i=`headlessui-description-${r}`,...s}=t,a=Spe(),o=Sc(e);ca(()=>a.register(i),[i,a.register]);let c=e1({...a.slot,disabled:n||!1}),u={ref:o,...a.props,id:i};return Bo()({ourProps:u,theirProps:s,slot:c,defaultTag:sJe,name:a.name||"Description"})}let oJe=ya(aJe),kpe=Object.assign(oJe,{});var Tpe=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(Tpe||{});let lJe=b.createContext(()=>{});function cJe({value:t,children:e}){return P.createElement(lJe.Provider,{value:t},e)}let Cpe=class extends Map{constructor(e){super(),this.factory=e}get(e){let r=super.get(e);return r===void 0&&(r=this.factory(e),this.set(e,r)),r}};var uJe=Object.defineProperty,dJe=(t,e,r)=>e in t?uJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fJe=(t,e,r)=>(dJe(t,e+"",r),r),Epe=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},to=(t,e,r)=>(Epe(t,e,"read from private field"),r?r.call(t):e.get(t)),OA=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},AK=(t,e,r,n)=>(Epe(t,e,"write to private field"),e.set(t,r),r),Al,ex,tx;let hJe=class{constructor(e){OA(this,Al,{}),OA(this,ex,new Cpe(()=>new Set)),OA(this,tx,new Set),fJe(this,"disposables",Xu()),AK(this,Al,e),hu.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return to(this,Al)}subscribe(e,r){if(hu.isServer)return()=>{};let n={selector:e,callback:r,current:e(to(this,Al))};return to(this,tx).add(n),this.disposables.add(()=>{to(this,tx).delete(n)})}on(e,r){return hu.isServer?()=>{}:(to(this,ex).get(e).add(r),this.disposables.add(()=>{to(this,ex).get(e).delete(r)}))}send(e){let r=this.reduce(to(this,Al),e);if(r!==to(this,Al)){AK(this,Al,r);for(let n of to(this,tx)){let i=n.selector(to(this,Al));jpe(n.current,i)||(n.current=i,n.callback(i))}for(let n of to(this,ex).get(e.type))n(to(this,Al),e)}}};Al=new WeakMap,ex=new WeakMap,tx=new WeakMap;function jpe(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:RA(t[
vendor: 5,169 bytes, lines 4136-4144
4136Symbol.iterator](),e[Symbol.iterator]()):t instanceof Map&&e instanceof Map||t instanceof Set&&e instanceof Set?t.size!==e.size?!1:RA(t.entries(),e.entries()):DK(t)&&DK(e)?RA(Object.entries(t)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function RA(t,e){do{let r=t.next(),n=e.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function DK(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}var pJe=Object.defineProperty,mJe=(t,e,r)=>e in t?pJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,OK=(t,e,r)=>(mJe(t,typeof e!="symbol"?e+"":e,r),r),gJe=(t=>(t[t.Push=0]="Push",t[t.Pop=1]="Pop",t))(gJe||{});let yJe={0(t,e){let r=e.id,n=t.stack,i=t.stack.indexOf(r);if(i!==-1){let s=t.stack.slice();return s.splice(i,1),s.push(r),n=s,{...t,stack:n}}return{...t,stack:[...t.stack,r]}},1(t,e){let r=e.id,n=t.stack.indexOf(r);if(n===-1)return t;let i=t.stack.slice();return i.splice(n,1),{...t,stack:i}}},vJe=class Npe extends hJe{constructor(){super(...arguments),OK(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),OK(this,"selectors",{isTop:(e,r)=>e.stack[e.stack.length-1]===r,inStack:(e,r)=>e.stack.includes(r)})}static new(){return new Npe({stack:[]})}reduce(e,r){return zu(r.type,yJe,e,r)}};const Ppe=new Cpe(()=>vJe.new());var IA={exports:{}},LA={};/**
4137 * @license React
4138 * use-sync-external-store-with-selector.production.js
4139 *
4140 * Copyright (c) Meta Platforms, Inc. and affiliates.
4141 *
4142 * This source code is licensed under the MIT license found in the
4143 * LICENSE file in the root directory of this source tree.
4144 */var RK;function xJe(){if(RK)return LA;RK=1;var t=bE();function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,o=t.useDebugValue;return LA.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var m=i(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function v(T){if(!_){if(_=!0,S=T,T=f(T),h!==void 0&&y.hasValue){var N=y.value;if(h(N,T))return k=N}return k=T}if(N=k,r(S,T))return N;var j=f(T);return h!==void 0&&h(N,j)?(S=T,N):(S=T,k=j)}var _=!1,S,k,E=d===void 0?null:d;return[function(){return v(u())},E===null?void 0:function(){return v(E())}]},[u,d,f,h]);var x=n(c,m[0],m[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),o(x),x},LA}var IK;function bJe(){return IK||(IK=1,IA.exports=xJe()),IA.exports}var wJe=bJe();function Mpe(t,e,r=jpe){return wJe.useSyncExternalStoreWithSelector(Yr(n=>t.subscribe(_Je,n)),Yr(()=>t.state),Yr(()=>t.state),Yr(e),r)}function _Je(t){return t}function t1(t,e){let r=b.useId(),n=Ppe.get(e),[i,s]=Mpe(n,b.useCallback(a=>[n.selectors.isTop(a,r),n.selectors.inStack(a,r)],[n,r]));return ca(()=>{if(t)return n.actions.push(r),()=>n.actions.pop(r)},[n,t,r]),t?s?i:!0:!1}let JF=new Map,Px=new Map;function LK(t){var e;let r=(e=Px.get(t))!=null?e:0;return Px.set(t,r+1),r!==0?()=>$K(t):(JF.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>$K(t))}function $K(t){var e;let r=(e=Px.get(t))!=null?e:1;if(r===1?Px.delete(t):Px.set(t,r-1),r!==1)return;let n=JF.get(t);n&&(n["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",n["aria-hidden"]),t.inert=n.inert,JF.delete(t))}function SJe(t,{allowed:e,disallowed:r}={}){let n=t1(t,"inert-others");ca(()=>{var i,s;if(!n)return;let a=Xu();for(let c of(i=r?.())!=null?i:[])c&&a.add(LK(c));let o=(s=e?.())!=null?s:[];for(let c of o){if(!c)continue;let u=Uj(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let f of d.children)o.some(h=>f.contains(h))||a.add(LK(f));d=d.parentElement}}return a.dispose},[n,e,r])}function kJe(t,e,r){let n=Kp(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});b.useEffect(()=>{if(!t)return;let i=e===null?null:Cp(e)?e:e.current;if(!i)return;let s=Xu();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>n.current(i));a.observe(i),s.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>n.current(i));a.observe(i),s.add(()=>a.disconnect())}return()=>s.dispose()},[e,n,t])}let JT=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),TJe=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var Xc=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(Xc||{}),e5=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(e5||{}),CJe=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(CJe||{});function EJe(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(JT)).sort((e,r)=>
vendor: 4,446 bytes, line 4144
4144Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function jJe(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(TJe)).sort((e,r)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ape=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(Ape||{});function NJe(t,e=0){var r;return t===((r=Uj(t))==null?void 0:r.body)?!1:zu(e,{0(){return t.matches(JT)},1(){let n=t;for(;n!==null;){if(n.matches(JT))return!0;n=n.parentElement}return!1}})}var PJe=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(PJe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function pu(t){t?.focus({preventScroll:!0})}let MJe=["textarea","input"].join(",");function AJe(t){var e,r;return(r=(e=t?.matches)==null?void 0:e.call(t,MJe))!=null?r:!1}function DJe(t,e=r=>r){return t.slice().sort((r,n)=>{let i=e(r),s=e(n);if(i===null||s===null)return 0;let a=i.compareDocumentPosition(s);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Mx(t,e,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let s=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,a=Array.isArray(t)?r?DJe(t):t:e&64?jJe(t):EJe(t);i.length>0&&a.length>1&&(a=a.filter(m=>!i.some(y=>y!=null&&"current"in y?y?.current===m:y===m))),n=n??s.activeElement;let o=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,a.indexOf(n))-1;if(e&4)return Math.max(0,a.indexOf(n))+1;if(e&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=e&32?{preventScroll:!0}:{},d=0,f=a.length,h;do{if(d>=f||d+f<=0)return 0;let m=c+d;if(e&16)m=(m+f)%f;else{if(m<0)return 3;if(m>=f)return 1}h=a[m],h?.focus(u),d+=o}while(h!==s.activeElement);return e&6&&AJe(h)&&h.select(),2}function Dpe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function OJe(){return/Android/gi.test(window.navigator.userAgent)}function FK(){return Dpe()||OJe()}function vS(t,e,r,n){let i=Kp(r);b.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return document.addEventListener(e,s,n),()=>document.removeEventListener(e,s,n)},[t,e,n])}function Ope(t,e,r,n){let i=Kp(r);b.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return window.addEventListener(e,s,n),()=>window.removeEventListener(e,s,n)},[t,e,n])}const zK=30;function RJe(t,e,r){let n=Kp(r),i=b.useCallback(function(o,c){if(o.defaultPrevented)return;let u=c(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=(function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]})(e);for(let f of d)if(f!==null&&(f.contains(u)||o.composed&&o.composedPath().includes(f)))return;return!NJe(u,Ape.Loose)&&u.tabIndex!==-1&&o.preventDefault(),n.current(o,u)},[n,e]),s=b.useRef(null);vS(t,"pointerdown",o=>{var c,u;FK()||(s.current=((u=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:u[0])||o.target)},!0),vS(t,"pointerup",o=>{if(FK()||!s.current)return;let c=s.current;return s.current=null,i(o,()=>c)},!0);let a=b.useRef({x:0,y:0});vS(t,"touchstart",o=>{a.current.x=o.touches[0].clientX,a.current.y=o.touches[0].clientY},!0),vS(t,"touchend",o=>{let c={x:o.changedTouches[0].clientX,y:o.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=zK||Math.abs(c.y-a.current.y)>=zK))return i(o,()=>Hd(o.target)?o.target:null)},!0),Ope(t,"blur",o=>i(o,()=>tJe(window.document.activeElement)?window.document.activeElement:null),!0)}function Hj(...t){return b.useMemo(()=>Uj(...t),[...t])}function Rpe(t,e,r,n){let i=Kp(r);b.useEffect(()=>{t=t??window;function s(a){i.current(a)}return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s,n)},[t,e,n])}function IJe(t){return b.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}function LJe(t,e){let r=t(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...s){let a=e[i].call(r,...s);
vendor: 2,136 bytes, line 4144
4144a&&(r=a,n.forEach(o=>o()))}}}function $Je(){let t;return{before({doc:e}){var r;let n=e.documentElement,i=(r=e.defaultView)!=null?r:window;t=Math.max(0,i.innerWidth-n.clientWidth)},after({doc:e,d:r}){let n=e.documentElement,i=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,t-i);r.style(n,"paddingRight",`${s}px`)}}}function FJe(){return Dpe()?{before({doc:t,d:e,meta:r}){function n(i){return r.containers.flatMap(s=>s()).some(s=>s.contains(i))}e.microTask(()=>{var i;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let o=Xu();o.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>o.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,a=null;e.addEventListener(t,"click",o=>{if(Hd(o.target))try{let c=o.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=t.querySelector(u);Hd(d)&&!n(d)&&(a=d)}catch{}},!0),e.addEventListener(t,"touchstart",o=>{if(Hd(o.target)&&eJe(o.target))if(n(o.target)){let c=o.target;for(;c.parentElement&&n(c.parentElement);)c=c.parentElement;e.style(c,"overscrollBehavior","contain")}else e.style(o.target,"touchAction","none")}),e.addEventListener(t,"touchmove",o=>{if(Hd(o.target)){if(rJe(o.target))return;if(n(o.target)){let c=o.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&o.preventDefault()}else o.preventDefault()}},{passive:!1}),e.add(()=>{var o;let c=(o=window.scrollY)!=null?o:window.pageYOffset;s!==c&&window.scrollTo(0,s),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function zJe(){return{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}}function BJe(t){let e={};for(let r of t)Object.assign(e,r(e));return e}let Fh=LJe(()=>new Map,{PUSH(t,e){var r;let n=(r=this.get(t))!=null?r:{doc:t,count:0,d:Xu(),meta:new Set};return n.count++,n.meta.add(e),this.set(t,n),this},POP(t,e){let r=this.get(t);return r&&(r.count--,r.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:r}){let n={doc:t,d:e,meta:BJe(r)},i=[FJe(),$Je(),zJe()];i.forEach(({before:s})=>
vendor: 4,882 bytes, lines 4144-4145
4144s?.(n)),i.forEach(({after:s})=>s?.(n))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});Fh.subscribe(()=>{let t=Fh.getSnapshot(),e=new Map;for(let[r]of t)e.set(r,r.documentElement.style.overflow);for(let r of t.values()){let n=e.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&Fh.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&Fh.dispatch("TEARDOWN",r)}});function VJe(t,e,r=()=>({containers:[]})){let n=IJe(Fh),i=e?n.get(e):void 0,s=i?i.count>0:!1;return ca(()=>{if(!(!e||!t))return Fh.dispatch("PUSH",e,r),()=>Fh.dispatch("POP",e,r)},[t,e]),s}function UJe(t,e,r=()=>[document.body]){let n=t1(t,"scroll-lock");VJe(n,e,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],r]}})}function GJe(t=0){let[e,r]=b.useState(t),n=b.useCallback(c=>r(c),[]),i=b.useCallback(c=>r(u=>u|c),[]),s=b.useCallback(c=>(e&c)===c,[e]),a=b.useCallback(c=>r(u=>u&~c),[]),o=b.useCallback(c=>r(u=>u^c),[]);return{flags:e,setFlag:n,addFlag:i,hasFlag:s,removeFlag:a,toggleFlag:o}}var WJe={},BK,VK;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((BK=process==null?void 0:WJe)==null?void 0:BK.NODE_ENV)==="test"&&typeof((VK=Element?.prototype)==null?void 0:VK.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
4145`)),[]});var HJe=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(HJe||{});function qJe(t){let e={};for(let r in t)t[r]===!0&&(e[`data-${r}`]="");return e}function YJe(t,e,r,n){let[i,s]=b.useState(r),{hasFlag:a,addFlag:o,removeFlag:c}=GJe(t&&i?3:0),u=b.useRef(!1),d=b.useRef(!1),f=Wj();return ca(()=>{var h;if(t){if(r&&s(!0),!e){r&&o(3);return}return(h=n?.start)==null||h.call(n,r),KJe(e,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(r?(o(3),c(4)):(o(4),c(2)))},run(){d.current?r?(c(3),o(4)):(c(4),o(3)):r?c(1):o(1)},done(){var m;d.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(u.current=!1,c(7),r||s(!1),(m=n?.end)==null||m.call(n,r))}})}},[t,r,e,f]),t?[i,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function KJe(t,{prepare:e,run:r,done:n,inFlight:i}){let s=Xu();return ZJe(t,{prepare:e,inFlight:i}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(QJe(t,n))})}),s.dispose}function QJe(t,e){var r,n;let i=Xu();if(!t)return i.dispose;let s=!1;i.add(()=>{s=!0});let a=(n=(r=t.getAnimations)==null?void 0:r.call(t).filter(o=>o instanceof CSSTransition))!=null?n:[];return a.length===0?(e(),i.dispose):(Promise.allSettled(a.map(o=>o.finished)).then(()=>{s||e()}),i.dispose)}function ZJe(t,{inFlight:e,prepare:r}){if(e!=null&&e.current){r();return}let n=t.style.transition;t.style.transition="none",r(),t.offsetHeight,t.style.transition=n}function CV(t,e){let r=b.useRef([]),n=Yr(t);b.useEffect(()=>{let i=[...r.current];for(let[s,a]of e.entries())if(r.current[s]!==a){let o=n(e,i);return r.current=e,o}},[n,...e])}let qj=b.createContext(null);qj.displayName="OpenClosedContext";var cl=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(cl||{});function Yj(){return b.useContext(qj)}function XJe({value:t,children:e}){return P.createElement(qj.Provider,{value:t},e)}function JJe({children:t}){return P.createElement(qj.Provider,{value:null},t)}function eet(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Bd=[];eet(()=>{function t(e){if(!Hd(e.target)||e.target===document.body||Bd[0]===e.target)return;let r=e.target;r=r.closest(JT),Bd.unshift(r??e.target),Bd=Bd.filter(n=>n!=null&&n.isConnected),Bd.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function Ipe(t){let e=Yr(t),r=b.useRef(!1);b.useEffect(()=>(r.current=!1,()=>{r.current=!0,Gj(()=>{r.current&&e()})}),[e])}let Lpe=b.createContext(!1);function tet(){return b.useContext(Lpe)}function UK(t){return P.createElement(Lpe.Provider,{value:t.force},t.children)}function ret(t){let e=tet(),r=b.useContext(Fpe),[n,i]=b.useState(()=>{var s;if(!e&&r!==null)return(s=r.current)!=null?s:null;if(hu.isServer)return null;let a=t?.getElementById("headlessui-portal-root");
vendor: 2,660 bytes, line 4145
4145if(a)return a;if(t===null)return null;let o=t.createElement("div");return o.setAttribute("id","headlessui-portal-root"),t.body.appendChild(o)});return b.useEffect(()=>{n!==null&&(t!=null&&t.body.contains(n)||t==null||t.body.appendChild(n))},[n,t]),b.useEffect(()=>{e||r!==null&&i(r.current)},[r,i,e]),n}let $pe=b.Fragment,net=ya(function(t,e){let{ownerDocument:r=null,...n}=t,i=b.useRef(null),s=Sc(nJe(h=>{i.current=h}),e),a=Hj(i),o=r??a,c=ret(o),u=b.useContext(t5),d=Wj(),f=Bo();return Ipe(()=>{var h;c&&c.childNodes.length<=0&&((h=c.parentElement)==null||h.removeChild(c))}),c?bc.createPortal(P.createElement("div",{"data-headlessui-portal":"",ref:h=>{d.dispose(),u&&h&&d.add(u.register(h))}},f({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:$pe,name:"Portal"})),c):null});function iet(t,e){let r=Sc(e),{enabled:n=!0,ownerDocument:i,...s}=t,a=Bo();return n?P.createElement(net,{...s,ownerDocument:i,ref:r}):a({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:$pe,name:"Portal"})}let set=b.Fragment,Fpe=b.createContext(null);function aet(t,e){let{target:r,...n}=t,i={ref:Sc(e)},s=Bo();return P.createElement(Fpe.Provider,{value:r},s({ourProps:i,theirProps:n,defaultTag:set,name:"Popover.Group"}))}let t5=b.createContext(null);function oet(){let t=b.useContext(t5),e=b.useRef([]),r=Yr(s=>(e.current.push(s),t&&t.register(s),()=>n(s))),n=Yr(s=>{let a=e.current.indexOf(s);a!==-1&&e.current.splice(a,1),t&&t.unregister(s)}),i=b.useMemo(()=>({register:r,unregister:n,portals:e}),[r,n,e]);return[e,b.useMemo(()=>function({children:s}){return P.createElement(t5.Provider,{value:i},s)},[i])]}let cet=ya(iet),zpe=ya(aet),uet=Object.assign(cet,{Group:zpe});function det(t,e=typeof document<"u"?document.defaultView:null,r){let n=t1(t,"escape");Rpe(e,"keydown",i=>{n&&(i.defaultPrevented||i.key===Tpe.Escape&&r(i))})}function fet(){var t;let[e]=b.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=b.useState((t=e?.matches)!=null?t:!1);return ca(()=>{if(!e)return;function i(s){n(s.matches)}return e.addEventListener("change",i),()=>e.removeEventListener("change",i)},[e]),r}function het({defaultContainers:t=[],portals:e,mainTreeNode:r}={}){let n=Hj(r),i=Yr(()=>{var s,a;let o=[];for(let c of t)c!==null&&(pf(c)?o.push(c):"current"in c&&pf(c.current)&&o.push(c.current));if(e!=null&&e.current)for(let c of e.current)o.push(c);for(let c of(s=n?.querySelectorAll("html > *, body > *"))!=null?s:[])c!==document.body&&c!==document.head&&pf(c)&&c.id!=="headlessui-portal-root"&&(r&&(c.contains(r)||c.contains((a=r?.getRootNode())==null?void 0:a.host))||o.some(u=>c.contains(u))||o.push(c));return o});
vendor: 5,836 bytes, line 4145
4145return{resolveContainers:i,contains:Yr(s=>i().some(a=>a.contains(s)))}}let Bpe=b.createContext(null);function GK({children:t,node:e}){let[r,n]=b.useState(null),i=Vpe(e??r);return P.createElement(Bpe.Provider,{value:i},t,i===null&&P.createElement(XF,{features:XT.Hidden,ref:s=>{var a,o;if(s){for(let c of(o=(a=Uj(s))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?o:[])if(c!==document.body&&c!==document.head&&pf(c)&&c!=null&&c.contains(s)){n(c);break}}}}))}function Vpe(t=null){var e;return(e=b.useContext(Bpe))!=null?e:t}function pet(){let t=typeof document>"u";return"useSyncExternalStore"in xf?(e=>e.useSyncExternalStore)(xf)(()=>()=>{},()=>!1,()=>!t):!1}function Kj(){let t=pet(),[e,r]=b.useState(hu.isHandoffComplete);return e&&hu.isHandoffComplete===!1&&r(!1),b.useEffect(()=>{e!==!0&&r(!0)},[e]),b.useEffect(()=>hu.handoff(),[]),t?!1:e}function EV(){let t=b.useRef(!1);return ca(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var rx=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(rx||{});function met(){let t=b.useRef(0);return Ope(!0,"keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}function Upe(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let e=new Set;for(let r of t.current)pf(r.current)&&e.add(r.current);return e}let get="div";var Nh=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(Nh||{});function yet(t,e){let r=b.useRef(null),n=Sc(r,e),{initialFocus:i,initialFocusFallback:s,containers:a,features:o=15,...c}=t;Kj()||(o=0);let u=Hj(r);wet(o,{ownerDocument:u});let d=_et(o,{ownerDocument:u,container:r,initialFocus:i,initialFocusFallback:s});ket(o,{ownerDocument:u,container:r,containers:a,previousActiveElement:d});let f=met(),h=Yr(S=>{if(!Cp(r.current))return;let k=r.current;(E=>E())(()=>{zu(f.current,{[rx.Forwards]:()=>{Mx(k,Xc.First,{skipElements:[S.relatedTarget,s]})},[rx.Backwards]:()=>{Mx(k,Xc.Last,{skipElements:[S.relatedTarget,s]})}})})}),m=t1(!!(o&2),"focus-trap#tab-lock"),y=Wj(),x=b.useRef(!1),v={ref:n,onKeyDown(S){S.key=="Tab"&&(x.current=!0,y.requestAnimationFrame(()=>{x.current=!1}))},onBlur(S){if(!(o&4))return;let k=Upe(a);Cp(r.current)&&k.add(r.current);let E=S.relatedTarget;Hd(E)&&E.dataset.headlessuiFocusGuard!=="true"&&(Gpe(k,E)||(x.current?Mx(r.current,zu(f.current,{[rx.Forwards]:()=>Xc.Next,[rx.Backwards]:()=>Xc.Previous})|Xc.WrapAround,{relativeTo:S.target}):Hd(S.target)&&pu(S.target)))}},_=Bo();return P.createElement(P.Fragment,null,m&&P.createElement(XF,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:XT.Focusable}),_({ourProps:v,theirProps:c,defaultTag:get,name:"FocusTrap"}),m&&P.createElement(XF,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:XT.Focusable}))}let vet=ya(yet),xet=Object.assign(vet,{features:Nh});function bet(t=!0){let e=b.useRef(Bd.slice());return CV(([r],[n])=>{n===!0&&r===!1&&Gj(()=>{e.current.splice(0)}),n===!1&&r===!0&&(e.current=Bd.slice())},[t,Bd,e]),Yr(()=>{var r;return(r=e.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function wet(t,{ownerDocument:e}){let r=!!(t&8),n=bet(r);CV(()=>{r||e?.activeElement===e?.body&&pu(n())},[r]),Ipe(()=>{r&&pu(n())})}function _et(t,{ownerDocument:e,container:r,initialFocus:n,initialFocusFallback:i}){let s=b.useRef(null),a=t1(!!(t&1),"focus-trap#initial-focus"),o=EV();return CV(()=>{if(t===0)return;if(!a){i!=null&&i.current&&pu(i.current);return}let c=r.current;c&&Gj(()=>{if(!o.current)return;let u=e?.activeElement;if(n!=null&&n.current){if(n?.current===u){s.current=u;return}}else if(c.contains(u)){s.current=u;return}if(n!=null&&n.current)pu(n.current);else{if(t&16){if(Mx(c,Xc.First|Xc.AutoFocus)!==e5.Error)return}else if(Mx(c,Xc.First)!==e5.Error)return;if(i!=null&&i.current&&(pu(i.current),e?.activeElement===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}s.current=e?.activeElement})},[i,a,t]),s}function ket(t,{ownerDocument:e,container:r,containers:n,previousActiveElement:i}){let s=EV(),a=!!(t&4);Rpe(e?.defaultView,"focus",o=>{if(!a||!s.current)return;let c=Upe(n);Cp(r.current)&&c.add(r.current);let u=i.current;if(!u)return;let d=o.target;Cp(d)?Gpe(c,d)?(i.current=d,pu(d)):(o.preventDefault(),o.stopPropagation(),pu(u)):pu(i.current)},!0)}function Gpe(t,e){for(let r of t)if(r.contains(e))return!0;return!1}function Wpe(t){var e;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||!Nx((e=t.as)!=null?e:qpe)||P.Children.count(t.children)===1}let Qj=b.createContext(null);Qj.displayName="TransitionContext";var Tet=(t=>(t.Visible="visible",t.Hidden="hidden",t))(Tet||{});function Cet(){let t=b.useContext(Qj);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function Eet(){let t=b.useContext(Zj);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let Zj=b.createContext(null);Zj.displayName="NestingContext";function Xj(t){return"children"in t?Xj(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Hpe(t,e){let r=Kp(t),n=b.useRef([]),i=EV(),s=Wj(),a=Yr((m,y=Wd.Hidden)=>{let x=n.current.findIndex(({el:v})=>v===m);x!==-1&&(zu(y,{[Wd.Unmount](){n.current.splice(x,1)},[Wd.Hidden](){n.current[x].state="hidden"}}),s.microTask(()=>{var v;!Xj(n)&&i.current&&((v=r.current)==null||v.call(r))}))}),o=Yr(m=>{let y=n.current.find(({el:x})=>x===m);return y?y.state!=="visible"&&(y.state="visible"):n.current.push({el:m,state:"visible"}),()=>a(m,Wd.Unmount)}),c=b.useRef([]),u=b.useRef(Promise.resolve()),d=b.useRef({enter:[],leave:[]}
vendor: 8,605 bytes, line 4145
4145),f=Yr((m,y,x)=>{c.current.splice(0),e&&(e.chains.current[y]=e.chains.current[y].filter(([v])=>v!==m)),e?.chains.current[y].push([m,new Promise(v=>{c.current.push(v)})]),e?.chains.current[y].push([m,new Promise(v=>{Promise.all(d.current[y].map(([_,S])=>S)).then(()=>v())})]),y==="enter"?u.current=u.current.then(()=>e?.wait.current).then(()=>x(y)):x(y)}),h=Yr((m,y,x)=>{Promise.all(d.current[y].splice(0).map(([v,_])=>_)).then(()=>{var v;(v=c.current.shift())==null||v()}).then(()=>x(y))});return b.useMemo(()=>({children:n,register:o,unregister:a,onStart:f,onStop:h,wait:u,chains:d}),[o,a,n,f,h,d,u])}let qpe=b.Fragment,Ype=ZT.RenderStrategy;function jet(t,e){var r,n;let{transition:i=!0,beforeEnter:s,afterEnter:a,beforeLeave:o,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:h,leave:m,leaveFrom:y,leaveTo:x,...v}=t,[_,S]=b.useState(null),k=b.useRef(null),E=Wpe(t),T=Sc(...E?[k,e,S]:e===null?[]:[e]),N=(r=v.unmount)==null||r?Wd.Unmount:Wd.Hidden,{show:j,appear:M,initial:O}=Cet(),[R,I]=b.useState(j?"visible":"hidden"),B=Eet(),{register:F,unregister:V}=B;ca(()=>F(k),[F,k]),ca(()=>{if(N===Wd.Hidden&&k.current){if(j&&R!=="visible"){I("visible");return}return zu(R,{hidden:()=>V(k),visible:()=>F(k)})}},[R,k,F,V,j,N]);let $=Kj();ca(()=>{if(E&&$&&R==="visible"&&k.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[k,R,$,E]);let U=O&&!M,z=M&&j&&O,L=b.useRef(!1),W=Hpe(()=>{L.current||(I("hidden"),V(k))},B),K=Yr(oe=>{L.current=!0;let ge=oe?"enter":"leave";W.onStart(k,ge,le=>{le==="enter"?s?.():le==="leave"&&o?.()})}),q=Yr(oe=>{let ge=oe?"enter":"leave";L.current=!1,W.onStop(k,ge,le=>{le==="enter"?a?.():le==="leave"&&c?.()}),ge==="leave"&&!Xj(W)&&(I("hidden"),V(k))});b.useEffect(()=>{E&&i||(K(j),q(j))},[j,E,i]);let H=!(!i||!E||!$||U),[,Y]=YJe(H,_,j,{start:K,end:q}),J=kh({ref:T,className:((n=ZF(v.className,z&&u,z&&d,Y.enter&&u,Y.enter&&Y.closed&&d,Y.enter&&!Y.closed&&f,Y.leave&&m,Y.leave&&!Y.closed&&y,Y.leave&&Y.closed&&x,!Y.transition&&j&&h))==null?void 0:n.trim())||void 0,...qJe(Y)}),re=0;R==="visible"&&(re|=cl.Open),R==="hidden"&&(re|=cl.Closed),j&&R==="hidden"&&(re|=cl.Opening),!j&&R==="visible"&&(re|=cl.Closing);let me=Bo();return P.createElement(Zj.Provider,{value:W},P.createElement(XJe,{value:re},me({ourProps:J,theirProps:v,defaultTag:qpe,features:Ype,visible:R==="visible",name:"Transition.Child"})))}function Net(t,e){let{show:r,appear:n=!1,unmount:i=!0,...s}=t,a=b.useRef(null),o=Wpe(t),c=Sc(...o?[a,e]:e===null?[]:[e]);Kj();let u=Yj();if(r===void 0&&u!==null&&(r=(u&cl.Open)===cl.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=b.useState(r?"visible":"hidden"),h=Hpe(()=>{r||f("hidden")}),[m,y]=b.useState(!0),x=b.useRef([r]);ca(()=>{m!==!1&&x.current[x.current.length-1]!==r&&(x.current.push(r),y(!1))},[x,r]);let v=b.useMemo(()=>({show:r,appear:n,initial:m}),[r,n,m]);ca(()=>{r?f("visible"):!Xj(h)&&a.current!==null&&f("hidden")},[r,h]);let _={unmount:i},S=Yr(()=>{var T;m&&y(!1),(T=t.beforeEnter)==null||T.call(t)}),k=Yr(()=>{var T;m&&y(!1),(T=t.beforeLeave)==null||T.call(t)}),E=Bo();return P.createElement(Zj.Provider,{value:h},P.createElement(Qj.Provider,{value:v},E({ourProps:{..._,as:b.Fragment,children:P.createElement(Kpe,{ref:c,..._,...s,beforeEnter:S,beforeLeave:k})},theirProps:{},defaultTag:b.Fragment,features:Ype,visible:d==="visible",name:"Transition"})))}function Pet(t,e){let r=b.useContext(Qj)!==null,n=Yj()!==null;return P.createElement(P.Fragment,null,!r&&n?P.createElement(r5,{ref:e,...t}):P.createElement(Kpe,{ref:e,...t}))}let r5=ya(Net),Kpe=ya(jet),jV=ya(Pet),Met=Object.assign(r5,{Child:jV,Root:r5});var Aet=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(Aet||{}),Det=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(Det||{});let Oet={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},NV=b.createContext(null);NV.displayName="DialogContext";function Jj(t){let e=b.useContext(NV);if(e===null){let r=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Jj),r}return e}function Ret(t,e){return zu(e.type,Oet,t,e)}let WK=ya(function(t,e){let r=b.useId(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:s,initialFocus:a,role:o="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=t,h=b.useRef(!1);o=(function(){return o==="dialog"||o==="alertdialog"?o:(h.current||(h.current=!0,console.warn(`Invalid role [${o}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let m=Yj();i===void 0&&m!==null&&(i=(m&cl.Open)===cl.Open);let y=b.useRef(null),x=Sc(y,e),v=Hj(y),_=i?0:1,[S,k]=b.useReducer(Ret,{titleId:null,descriptionId:null,panelRef:b.createRef()}),E=Yr(()=>s(!1)),T=Yr(Y=>k({type:0,id:Y})),N=Kj()?_===0:!1,[j,M]=oet(),O={get current(){var Y;return(Y=S.panelRef.current)!=null?Y:y.current}},R=Vpe(),{resolveContainers:I}=het({mainTreeNode:R,portals:j,defaultContainers:[O]}),B=m!==null?(m&cl.Closing)===cl.Closing:!1;SJe(u||B?!1:N,{allowed:Yr(()=>{var Y,J;return[(J=(Y=y.current)==null?void 0:Y.closest("[data-headlessui-portal]"))!=null?J:null]}),disallowed:Yr(()=>{var Y;return[(Y=R?.closest("body > *:not(#headlessui-portal-root)"))!=null?Y:null]})});let F=Ppe.get(null);ca(()=>{if(N)return F.actions.push(n),()=>F.actions.pop(n)},[F,n,N]);let V=Mpe(F,b.useCallback(Y=>F.selectors.isTop(Y,n),[F,n]));RJe(V,I,Y=>{Y.preventDefault(),E()}),det(V,v?.defaultView,Y=>{Y.preventDefault(),Y.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),E()}),UJe(u||B?!1:N,v,I),kJe(N,y,E);let[$,U]=iJe(),z=b.useMemo(()=>[{dialogState:_,close:E,setTitleId:T,unmount:d},S],[_,E,T,d,S]),L=e1({open:_===0}),W={ref:x,id:n,role:o,tabIndex:-1,"aria-modal":u?void 0:_===0?!0:void 0,"aria-labelledby":S.titleId,"aria-describedby":$,unmount:d},K=!fet(),q=Nh.None;N&&!u&&(q|=Nh.RestoreFocus,q|=Nh.TabLock,c&&(q|=Nh.AutoFocus),K&&(q|=Nh.InitialFocus));let H=Bo();return P.createElement(JJe,null,P.createElement(UK,{force:!0},P.createElement(uet,null,P.createElement(NV.Provider,{value:z},P.createElement(zpe,{target:y},P.createElement(UK,{force:!1},P.createElement(U,{slot:L},P.createElement(M,null,P.createElement(xet,{initialFocus:a,initialFocusFallback:y,containers:I,features:q},P.createElement(cJe,{value:E},H({ourProps:W,theirProps:f,slot:L,defaultTag:Iet,features:Let,visible:_===0,name:"Dialog"})))))))))))}),Iet="div",Let=ZT.RenderStrategy|ZT.Static;function $et(t,e){let{transition:r=!1,open:n,...i}=t,s=Yj(),a=t.hasOwnProperty("open")||s!==null,o=t.hasOwnProperty("onClose");if(!a&&!o)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!o)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(n!==void 0||r)&&!i.static?P.createElement(GK,null,P.createElement(Met,{show:n,transition:r,unmount:i.unmount},P.createElement(WK,{ref:e,...i}))):P.createElement(GK,null,P.createElement(WK,{ref:e,open:n,...i}))}let Fet="div";function zet(t,e){let r=b.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:i=!1,...s}=t,[{dialogState:a,unmount:o},c]=Jj("Dialog.Panel"),u=Sc(e,c.panelRef),d=e1({open:a===0}),f=Yr(v=>{v.stopPropagation()}),h={ref:u,id:n,onClick:f},m=i?jV:b.Fragment,y=i?{unmount:o}:{},x=Bo();return P.createElement(m,{...y},x({ourProps:h,theirProps:s,slot:d,defaultTag:Fet,name:"Dialog.Panel"}))}let Bet="div";function Vet(t,e){let{transition:r=!1,...n}=t,[{dialogState:i,unmount:s}]=Jj("Dialog.Backdrop"),a=e1({open:i===0}),o={ref:e,"aria-hidden":!0},c=r?jV:b.Fragment,u=r?{unmount:s}:{},d=Bo();return P.createElement(c,{...u},d({ourProps:o,theirProps:n,slot:a,defaultTag:Bet,name:"Dialog.Backdrop"}))}let Uet="h2";function Get(t,e){let r=b.useId(),{id:n=`headlessui-dialog-title-${r}`,...i}=t,[{dialogState:s,setTitleId:a}]=Jj("Dialog.Title"),o=Sc(e);b.useEffect(()=>(a(n),()=>a(null)),[n,a]);let c=e1({open:s===0}),u={ref:o,id:n};return Bo()({ourProps:u,theirProps:i,slot:c,defaultTag:Uet,name:"Dialog.Title"})}let Wet=ya($et),PV=ya(zet),Qpe=ya(Vet),MV=ya(Get),Zpe=Object.assign(Wet,{Panel:P
4145V,Title:MV,Description:kpe});const AV=({isOpen:t,onClose:e,title:r,children:n,maxWidth:i="max-w-sm",hideDefaultFooter:s,icon:a,variant:o="default",disableClose:c=!1})=>l.jsxs(Zpe,{open:t,onClose:c?()=>{}:e,className:"relative z-50",children:[l.jsx(Qpe,{transition:!0,className:"fixed inset-0 bg-black/40 duration-200 ease-out data-closed:opacity-0"}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:l.jsxs(PV,{transition:!0,className:`w-full ${i} rounded-xl p-6 border duration-200 ease-out data-closed:scale-95 data-closed:opacity-0
4146          ${o==="warning"?"bg-yellow-500/10 border-yellow-500/30 text-yellow-100":"bg-app-card border-app-border-color-soft text-white"}
4147        `,children:[l.jsxs(MV,{className:"mb-4 text-lg font-semibold text-left flex items-center gap-2 2k:text-3xl",children:[a&&l.jsx("p",{className:"text-warning",children:a}),r]}),n,!s&&l.jsx("button",{className:"mt-6 w-full rounded-md bg-app-button-bg py-2 text-sm hover:bg-app-input-bg",type:"button",onClick:e,disabled:c,children:"Close"})]})})]}),eC={Moon:sMe,Zap:BE,Clock:Is,Activity:b$,Heart:YPe,Smile:uMe,Battery:PPe,Coffee:zPe,Flame:GPe,Brain:sf,Sun:hMe,Star:fMe,Dumbbell:VPe,Trophy:zl,Award:eb,Shield:zE,Settings:fl,HelpCircle:r3},mo=(t,e)=>eC[t]||eC[e]||r3,Wi={sleep_quality:{name:"Sleep Quality",icon:"Moon"},energy_level:{name:"Energy Level",icon:"Zap"},sleep_hours:{name:"Sleep Hours Obtained",icon:"Clock"}},Het=({isOpen:t,onClose:e})=>{const{userHasura:r,setUserHasura:n}=Gt(),[i,{loading:s}]=tj(hfe),a=r?.physical_state_config||Wi,[o,c]=b.useState(""),[u,d]=b.useState(""),[f,h]=b.useState(""),[m,y]=b.useState(""),[x,v]=b.useState(""),[_,S]=b.useState("");b.useEffect(()=>{t&&(c(a.sleep_quality?.name||Wi.sleep_quality.name),d(a.sleep_quality?.icon||Wi.sleep_quality.icon),h(a.energy_level?.name||Wi.energy_level.name),y(a.energy_level?.icon||Wi.energy_level.icon),v(a.sleep_hours?.name||Wi.sleep_hours.name),S(a.sleep_hours?.icon||Wi.sleep_hours.icon))},[t,a]);const k=async()=>{if(!r?.id)return;const N={sleep_quality:{name:o.trim()||Wi.sleep_quality.name,icon:u||Wi.sleep_quality.icon},energy_level:{name:f.trim()||Wi.energy_level.name,icon:m||Wi.energy_level.icon},sleep_hours:{name:x.trim()||Wi.sleep_hours.name,icon:_||Wi.sleep_hours.icon}};try{const{data:j}=await i({variables:{userId:r.id,input:{physical_state_config:N}}});if(j?.update_user_by_pk)n({...r,physical_state_config:j.update_user_by_pk.physical_state_config}),Ft.success("Physical state settings updated successfully!"),e();else throw new Error("No data returned from mutation")}catch(j){console.error("Error saving physical state config:",j),Ft.error("Failed to save settings. Please try again.")}},E=Object.keys(eC),T=({selectedIcon:N,onChange:j})=>l.jsx("div",{className:"grid grid-cols-6 sm:grid-cols-9 gap-1.5 p-2 bg-app-input-bg border border-app-border-color-soft rounded-lg max-h-[120px] overflow-y-auto",children:E.map(M=>{const O=eC[M],R=N===M;return l.jsx("button",{type:"button",onClick:()=>j(M),className:`p-1.5 flex items-center justify-center rounded-md border transition-all ${R?"bg-emerald-500/20 border-emerald-500 text-emerald-400 scale-105":"bg-transparent border-transparent text-app-primary-foreground/60 hover:text-white hover:bg-white/5"}`,title:M,children:l.jsx(O,{size:16})},M)})});return l.jsxs(AV,{isOpen:t,onClose:e,title:"Customize Physical State Rating",icon:l.jsx(fl,{className:"w-5 h-5 text-emerald-500"}),maxWidth:"max-w-xl",hideDefaultFooter:!0,disableClose:s,children:[l.jsxs("div",{className:"space-y-5 max-h-[70vh] overflow-y-auto pr-1",children:[l.jsx("p",{className:"text-xs text-app-primary-foreground/70 leading-relaxed mb-1",children:"Customize the labels and icons for the three tracked metrics. These settings will update how metrics appear in your guided journal sessions, daily summaries, calendar cells, and insights."}),l.jsxs("div",{className:"bg-app-button-bg/20 border border-app-border-color-soft p-4 rounded-xl space-y-3",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"text-xs font-semibold text-emerald-400 uppercase tracking-wider",children:"Metric 1"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground
4147/80 block",children:"Label Name"}),l.jsx("input",{type:"text",value:o,onChange:N=>c(N.target.value),placeholder:"e.g. Sleep Quality",className:"w-full p-2.5 bg-app-input-bg border border-app-border-color rounded-lg text-sm text-app-primary-foreground focus:ring-1 focus:ring-emerald-500 focus:outline-none"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/80 block",children:"Icon"}),l.jsx(T,{selectedIcon:u,onChange:d})]})]}),l.jsxs("div",{className:"bg-app-button-bg/20 border border-app-border-color-soft p-4 rounded-xl space-y-3",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"text-xs font-semibold text-emerald-400 uppercase tracking-wider",children:"Metric 2"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/80 block",children:"Label Name"}),l.jsx("input",{type:"text",value:f,onChange:N=>h(N.target.value),placeholder:"e.g. Energy Level",className:"w-full p-2.5 bg-app-input-bg border border-app-border-color rounded-lg text-sm text-app-primary-foreground focus:ring-1 focus:ring-emerald-500 focus:outline-none"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/80 block",children:"Icon"}),l.jsx(T,{selectedIcon:m,onChange:y})]})]}),l.jsxs("div",{className:"bg-app-button-bg/20 border border-app-border-color-soft p-4 rounded-xl space-y-3",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"text-xs font-semibold text-emerald-400 uppercase tracking-wider",children:"Metric 3"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/80 block",children:"Label Name"}),l.jsx("input",{type:"text",value:x,onChange:N=>v(N.target.value),placeholder:"e.g. Sleep Hours",className:"w-full p-2.5 bg-app-input-bg border border-app-border-color rounded-lg text-sm text-app-primary-foreground focus:ring-1 focus:ring-emerald-500 focus:outline-none"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/80 block",children:"Icon"}),l.jsx(T,{selectedIcon:_,onChange:S})]})]})]}),l.jsxs("div",{className:"flex gap-3 mt-6",children:[l.jsx(ye,{variant:"secondary",className:"flex-1",onClick:e,disabled:s,children:"Cancel"}),l.jsxs(ye,{className:"flex-1",onClick:k,disabled:s,children:[s?l.jsx(No,{className:"animate-spin mr-2",size:16}):null,s?"Saving Changes...":"Save Settings"]})]})]})},HK={A:"bg-green-500 text-white",B:"bg-blue-500 text-white",C:"bg-yellow-500 text-white",D:"bg-orange-500 text-white",F:"bg-red-500 text-white"},qet=({grade:t,notes:e,sleepQuality:r,sleepHours:n,energyLevel:i,onEdit:s,compact:a=!1})=>{const{userHasura:o}=Gt(),c=o?.physical_state_config||Wi;return a?l.jsx("div",{className:Pe("inline-flex items-center justify-center w-6 h-6 rounded-full font-bold text-xs",HK[t]),children:t}):l.jsxs("div",{className:"flex flex-col md:flex-row gap-4 p-4 bg-app-card/50 rounded-xl border border-app-border-color",children:[l.jsxs("div",{className:"flex-1 flex items-start gap-4",children:[l.jsx("div",{className:Pe("flex items-center justify-center w-12 h-12 rounded-xl font-bold text-xl shrink-0",HK[t]),children:t}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("h4",{className:"text-sm font-medium text-app-primary-foreground",children:"Daily Grade"}),s&&l.jsx(ye,{variant:"ghost",size:"sm",onClick:s,className:"p-1 md:hidden",children:l.jsx(eq,{size:14})})]}),e&&l.jsx("p",{className:"text-sm text-app-primary-foreground/70 whitespace-pre-wrap break-words",children:e})]})]}),(r||n||i)&&l.jsxs("div",{className:"flex flex-row md:flex-col gap-4 border-t md:border-t-0 md:border-l border-app-border-color-soft pt-4 md:pt-0 md:pl-4 min-w-[150px]",children:[r&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-app-primary-foreground/80",children:[P.createElement(mo(c.sleep_quality?.icon,"Moon"),{size:14,className:"text-emerald-500"}),l.jsxs("span",{children:[c.sleep_quality?.name||"Sleep",": ",r,"/5"]})]}),n&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-app-primary-foreground
4147/80",children:[P.createElement(mo(c.sleep_hours?.icon,"Clock"),{size:14,className:"text-blue-400"}),l.jsxs("span",{children:[c.sleep_hours?.name||"Hours",": ",n,"h"]})]}),i&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-app-primary-foreground/80",children:[P.createElement(mo(c.energy_level?.icon,"Zap"),{size:14,className:"text-yellow-500"}),l.jsxs("span",{children:[c.energy_level?.name||"Energy",": ",i,"/5"]})]})]}),s&&l.jsx("div",{className:"hidden md:block",children:l.jsx(ye,{variant:"ghost",size:"sm",onClick:s,className:"p-1",children:l.jsx(eq,{size:14})})})]})};function Dd(t,e=2){return t==null||Number.isNaN(t)?"--":new Intl.NumberFormat("en-US",{minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function Ke(t,e=2){return t==null||Number.isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function fn(t,e=2){return t==null||Number.isNaN(t)?"0.00R":`${Dd(t,e)}R`}function r1(t,e=2){if(t==null||Number.isNaN(t))return"$0.00";const r=Math.abs(t);if(r<1e3)return Ke(t,e);const n=[{threshold:1e12,suffix:"T"},{threshold:1e9,suffix:"B"},{threshold:1e6,suffix:"M"},{threshold:1e3,suffix:"K"}];for(const{threshold:i,suffix:s}of n)if(r>=i){let o=(r/i).toFixed(2);return o.includes(".")&&(o=o.replace(/\.00$/,"").replace(/(\.[1-9])0$/,"$1")),`${t<0?"-":""}$${o}${s}`}return Ke(t,e)}const Xpe=()=>l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"absolute left-px top-px z-10 h-3 w-px origin-top scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute left-px top-px z-10 h-px w-3 origin-left scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute bottom-px right-px z-10 h-3 w-px origin-bottom scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute bottom-px right-px z-10 h-px w-3 origin-right scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute bottom-px left-px z-10 h-3 w-px origin-bottom scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute bottom-px left-px z-10 h-px w-3 origin-left scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute right-px top-px z-10 h-3 w-px origin-top scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"}),l.jsx("span",{className:"absolute right-px top-px z-10 h-px w-3 origin-right scale-0 bg-app-button-bg-active transition-all duration-500 group-hover:group-data-[has-trades=true]:scale-100 group-hover:group-data-[has-activity=true]:scale-100"})]}),DV=t=>t>0?"text-green-500":t<0?"text-red-500":"text-gray-400",OV=t=>t>0?_s:t<0?Kl:ju,Yet=t=>{const e=new Map;return t.forEach(r=>{const n=r.exit_date||r.entry_date;if(!n)return;const i=new Date(n);if(Number.isNaN(i.getTime()))return;const s=sr(i,"yyyy-MM-dd");e.has(s)||e.set(s,[]),e.get(s).push(r)}),e},Ket=(t,e="net",r="usd")=>{const n=new Map,i=s=>e==="net"?s.net_pnl??s.pnl??0:s.pnl??0;return t.forEach(s=>{const a=s.exit_date||s.entry_date;if(!a)return;const o=new Date(a);if(Number.isNaN(o.getTime()))return;const c=sr(mi(o),"yyyy-MM-dd"),u=i(s),d=r==="r"?s.risk&&s.risk>0?u/s.risk:0:u;n.set(c,(n.get(c)||0)+d)}),n},Qet=(t,e="net",r="usd")=>{const n=i=>e==="net"?i.net_pnl??i.pnl??0:i.pnl??0;return t.reduce((i,s)=>{const a=s.exit_date||s.entry_date;if(!a)return i;const o=new Date(a);if(Number.isNaN(o.getTime()))return i;const c=n(s),u=r==="r"?s.risk&&s.risk>0?c/s.risk:0:c;return i+u},0)},Zet=(t,e="net",r="usd")=>{const n=Yet(t),i=Ket(t,e,r),s=Qet(t,e,r);return{tradesByDate:n,weeklyPnL:i,monthlyTotal:s}},Xet=({date:t,trades:e,currentDate:r,mode:n,currency:i,tradeCount:s="show",grade:a,onDayCl
4147ick:o})=>{const{userHasura:c}=Gt(),u=c?.physical_state_config||Wi,d=Bj(t,r),f=JZe(t),m=(i==="r"?e.filter(N=>N.risk!==null&&N.risk!==0):e).reduce((N,j)=>{const O=(R=>n==="net"?R.net_pnl??R.pnl??0:R.pnl??0)(j);return i==="r"&&j.risk&&j.risk>0?N+O/j.risk:N+O},0),y=DV(m),x=OV(m),v=e.length>0,_=!YKe(t),S=v||_,k=()=>{S&&o()},E=N=>{S&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),o())},T=N=>N>=4?"text-emerald-400":N<=2?"text-red-400":"text-yellow-400";return l.jsxs("div",{className:Pe("group relative h-full p-2 border-b border-r border-app-border-color-soft flex flex-col justify-between",!d&&"opacity-50",S&&"cursor-pointer hover:bg-app-primary/20 transition-colors duration-500 ease-in-out"),"data-has-trades":v,role:"gridcell","aria-label":`${sr(t,"MMMM d, yyyy")} - ${e.length} trades, ${m>0?"profit":m<0?"loss":"break even"} ${Ke(Math.abs(m))}`,"aria-pressed":S?"false":void 0,tabIndex:S?0:-1,onClick:k,onKeyDown:E,children:[v&&l.jsx(Xpe,{}),l.jsxs("div",{className:"flex flex-col h-full w-full",children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("span",{className:Pe("font-light text-sm py-1.5 px-2.5 rounded-lg 2k:text-2xl",f&&"bg-white text-black"),children:sr(t,"d")}),v&&l.jsx(Cs,{size:16,className:"text-app-button-bg-active opacity-0 group-hover:group-data-[has-trades=true]:opacity-100 transition-opacity duration-300 ease-in-out my-1.5 mr-1.5"})]}),v&&l.jsx("div",{className:"flex flex-col gap-2",children:l.jsxs("div",{className:"flex flex-col gap-1",children:[s!=="hide"&&l.jsxs("span",{className:"text-xs bg-app-button-bg px-2 py-1 rounded-full text-app-primary-foreground/70 w-fit 2k:text-lg",children:[e.length," ","trade",e.length!==1?"s":""]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:`text-sm font-medium ${y} 2k:text-2xl`,children:i==="usd"?Ke(m):fn(m)}),l.jsx(x,{size:16,strokeWidth:1.5,className:`${y} 2k:w-7 2k:h-7`,"aria-hidden":"true"})]})]})}),a&&l.jsx("div",{className:"mt-1",children:l.jsx(qet,{grade:a.grade,compact:!0})}),a&&(a.sleepQuality||a.energyLevel||a.sleepHours)&&l.jsx("div",{className:"mt-auto pt-2 flex items-center justify-end gap-2",children:l.jsxs(nV,{children:[a.sleepQuality&&l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-0.5",children:[P.createElement(mo(u.sleep_quality?.icon,"Moon"),{size:12,className:Pe(T(a.sleepQuality),"2k:w-5 2k:h-5")}),l.jsx("span",{className:Pe("text-[10px] 2k:text-sm font-medium",T(a.sleepQuality)),children:a.sleepQuality})]})}),l.jsx(fi,{className:"bg-gray-900 border-gray-800 text-xs",children:l.jsxs("p",{children:[u.sleep_quality?.name||"Sleep Quality",": ",a.sleepQuality,"/5"]})})]}),a.energyLevel&&l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-0.5",children:[P.createElement(mo(u.energy_level?.icon,"Zap"),{size:12,className:Pe(T(a.energyLevel),"2k:w-5 2k:h-5"),fill:a.energyLevel>=4?"currentColor":"none"}),l.jsx("span",{className:Pe("text-[10px] 2k:text-sm font-medium",T(a.energyLevel)),children:a.energyLevel})]})}),l.jsxs(fi,{className:"bg-gray-900 border-gray-800 text-xs",children:[u.energy_level?.name||"Energy Level",": ",a.energyLevel,"/5"]})]}),a.sleepHours&&l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-0.5",children:[P.createElement(mo(u.sleep_hours?.icon,"Clock"),{size:12,className:Pe("text-blue-400","2k:w-5 2k:h-5")}),l.jsxs("span",{className:Pe("text-[10px] 2k:text-sm font-medium text-blue-400"),children:[a.sleepHours,"h"]})]})}),l.jsxs(fi,{className:"bg-gray-900 border-gray-800 text-xs",children:[u.sleep_hours?.name||"Sleep Hours",": ",a.sleepHours,"h"]})]})]})})]})]})},Jet=t=>{const{currentPlan:e,plans:r}=t;return b.useMemo(()=>{const n=r.length>1&&e.name.toLowerCase()==="free",i=n?r.find(s=>s.name.toLowerCase().includes("pro")&&s.id!==e.id):null;return{shouldShowUpgradeColumn:n,nextPlan:i,layout:n&&i?"upgrade":"standard"}},[e,r])},Jpe=t=>{const{currentPlan:e,interval:r}=t,[n,i]=b.useState(null),{userHasura:s,user:a}=Gt(),{userSubscription:o}=Hs(),{price:c}=e.prices[r],u=oje({mutationKey:["manage-subscription"],mutationFn:async f=>{if(!a||!s||!o)return;if(f&&e.name.toLowerCase()==="free"){const y=f.prices[r]?.stripePriceId;if(!y)throw new Error("Invalid upgrade plan configuration");await bK(a,s.id,o.stripeSubscriptionId,y)}else await bK(a,s.id)},onError:f=>{i(qy(f))},onMutate:()=>{i(null)}}),d=async f=>{await u.mutateAsync(f)};return{interval:r,isProcessing:u.isPending,error:n,handleManageSubscription:d,price:c}},eN=({plan:t,interval:e="month",className:r})=>{const n={currentPlan:t,interval:e},{isProcessing:i,handleManageSubscription:s}=Jpe(n),a=b.useCallback(()=>{s()},[s]);return l.jsxs("div",{className:Pe("absolute inset-0 rounded-xl p-8 flex flex-col items-center justify-center text-center mx-auto overflow-hidden","bg-linear-to-br from-app-border-color-accent/0 via-app-border-color-accent/5 to-app-border-color-accent/10","backdrop-blur-lg z-50",r),children:[l.jsx(Zy,{className:"opacity-70",numCircles:3}),l.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center",children:[l.jsx("div",{className:"mb-6",children:l.jsx(JPe,{className:"size-16 rotate-10"})}),l.jsxs("div",{className:"mb-6 max-w-md",children:[l.jsx("h3",{className:"text-2xl font-bold mb-3 bg-linear-to-r from-app-border-color-accent to-app-text-accent bg-clip-text",children:"Feature Locked"}
4147),l.jsxs("p",{className:"text-app-primary-foreground/80 text-base leading-relaxed font-light",children:["This feature is only available with"," ",l.jsx("span",{className:"font-semibold",children:t.name}),". Upgrade to unlock advanced trading insights and analytics."]})]}),l.jsx(ye,{onClick:a,disabled:i,children:i?l.jsxs(l.Fragment,{children:[l.jsx(gn,{size:"sm",className:"mr-1.5"}),"Processing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Kc,{className:"size-4 mr-1.5"}),"Upgrade to"," ",t.name]})})]})]})},ett=t=>{switch(t){case"success":return{iconColor:"text-green-400",valueColor:"text-green-400"};case"warning":return{iconColor:"text-yellow-500",valueColor:"text-yellow-500"};case"danger":return{iconColor:"text-red-400",valueColor:"text-red-400"};case"neutral":default:return{iconColor:"text-emerald-500",valueColor:"text-white"}}},qd=({title:t,value:e,icon:r,variant:n="neutral",className:i})=>{const s=ett(n);return l.jsxs("div",{className:Pe("flex flex-row items-start justify-between bg-app-card rounded-xl p-4 gap-2 w-full 2k:p-10 2k:gap-8 border border-app-border-color-soft",i),children:[l.jsxs("div",{className:Pe("flex items-center justify-center rounded-xl gap-3"),children:[l.jsx("div",{className:"flex items-center justify-center rounded-xl bg-app-button-bg p-2",children:l.jsx(r,{className:"size-4 2k:size-10"})}),l.jsx("div",{className:"text-sm text-app-primary-foreground/70 2k:text-2xl",children:t})]}),l.jsx("div",{className:Pe("text-xl sm:text-2xl 2k:text-3xl",s.valueColor),children:e})]})},Ep=({options:t,value:e,onSelect:r,placeholder:n="Select...",disabled:i=!1,icon:s,minWidth:a="min-w-32",width:o="w-40",maxHeight:c="max-h-80 2k:max-h-96",className:u="",buttonClassName:d="",dropdownClassName:f="",ariaLabel:h,enableSearch:m=!1})=>{const[y,x]=b.useState(!1),[v,_]=b.useState(!1),[S,k]=b.useState(null),E=b.useRef(null),T=b.useRef(null),N=b.useRef(null),[j,M]=b.useState(""),O=t.find(L=>L.value===e),R=L=>L?typeof L.label=="string"?L.label:L.searchText??"":"",I=j.trim().toLowerCase(),B=R(O).toLowerCase(),F=I===B?"":I,V=m?t.filter(L=>R(L).toLowerCase().includes(F)):t,$=()=>{const L=E.current,W=T.current;if(!L||!W)return;const K=L.getBoundingClientRect(),q=K.top,H=window.innerHeight-K.bottom,Y=W.offsetHeight;_(H<Y&&q>H)};b.useEffect(()=>{const L=W=>{E.current&&!E.current.contains(W.target)&&x(!1)};return y&&document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}},[y]),b.useEffect(()=>{if(y)return $(),window.addEventListener("scroll",$,{passive:!0}),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$),window.removeEventListener("resize",$)}},[y,V.length]),b.useEffect(()=>{if(!m)return;const L=t.find(K=>K.value===e),W=L&&typeof L.label=="string"?L.label:L?.searchText??"";M(W)},[e,t,m]);const U=L=>{const W=t.find(K=>K.value===L);if(W){const K=typeof W.label=="string"?W.label:W.searchText??"";M(K)}r(L),m||x(!1),k(null)},z=L=>{if(!i)switch(L.key){case"Enter":case" ":L.preventDefault(),y&&S!==null?U(V[S].value):x(!y);break;case"Escape":x(!1),k(null);break;case"ArrowDown":if(L.preventDefault(),!y)x(!0);else{const W=S===null?0:Math.min(S+1,t.length-1);k(W)}break;case"ArrowUp":if(L.preventDefault(),y&&S!==null){const W=Math.max(S-1,0);k(W)}break}};return l.jsxs("div",{ref:E,className:`relative ${u}`,children:[m?l.jsxs("div",{className:Pe("group relative flex items-center justify-between px-3 py-2 bg-app-button-bg backdrop-blur-xs","border border-app-border-color rounded-xl","text-white text-sm 2k:text-xl",a,o,i?"opacity-50 cursor-not-allowed":"cursor-pointer",y&&"bg-app-primary/20 border-app-border-color shadow-lg",d),"aria-label":h||"Select input","aria-haspopup":"listbox",onClick:()=>{i||(x(!0),N.current?.focus())},children:[l.jsx("input",{ref:N,type:"text",value:j,onChange:L=>{M(L.target.value),x(!0)},onClick:()=>!i&&x(!0),onKeyDown:z,disabled:i,placeholder:n,className:Pe("bg-transparent outline-hidden border-none w-full text-sm text-white",!O&&"text-app-primary-foreground/70","2k:text-2xl"),"aria-expanded":y,"aria-autocomplete":"list","aria-controls":"select-options"}),!i&&l.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),x(W=>!W)},className:"ml-2 p-1 hover:bg-app-primary/10 rounded-sm transition-colors 2k:text-2xl","aria-label":"Toggle dropdown",tabIndex:-1,
4147children:l.jsx(Eu,{size:16,className:Pe("text-app-primary-foreground/70 transition-all duration-300","group-hover:text-app-primary-foreground",y&&"rotate-180 text-app-primary-foreground","2k:w-7 2k:h-7")})})]}):l.jsxs("button",{onClick:()=>!i&&x(!y),onKeyDown:z,disabled:i,className:Pe("group relative flex items-center justify-between px-3 py-2 bg-app-button-bg backdrop-blur-xs","border border-app-border-color rounded-xl","text-white text-sm pl-6","hover:border-app-border-color-accent","focus:outline-hidden focus:border-app-border-color-accent",a,o,i?"opacity-50 cursor-not-allowed":"cursor-pointer",y&&"bg-app-primary/20 border-app-border-color shadow-lg",d),"aria-label":h||`Select option, currently ${O?.label||n}`,"aria-expanded":y,"aria-haspopup":"listbox",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[s&&l.jsx(s,{className:"text-app-primary-foreground/70 group-hover:text-app-primary-foreground transition-colors duration-200 size-3.5 2k:size-7"}),l.jsx("span",{className:`truncate 2k:text-2xl ${O?"":"text-app-primary-foreground/70"}`,children:O?.label||n})]}),l.jsx(Eu,{size:16,className:Pe("text-app-primary-foreground/70 transition-all duration-300","group-hover:text-app-primary-foreground",y&&"rotate-180 text-app-primary-foreground","2k:w-7 2k:h-7")})]}),l.jsx("div",{ref:T,className:Pe("absolute left-0 mt-2 w-full z-50",v?"bottom-full mb-2 origin-bottom":"top-full mt-2 origin-top",a,"transition-all duration-300 ease-out origin-top",y?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-2 pointer-events-none"),children:l.jsx("div",{className:Pe("bg-app-button-bg backdrop-blur-xl rounded-xl border border-app-border-color shadow-2xl overflow-hidden",f),children:l.jsx("div",{className:Pe("overflow-y-auto",c),role:"listbox","aria-label":"Option selection",id:"select-options",children:V.length===0?l.jsx("div",{className:"px-4 py-3 text-sm text-gray-400 2k:text-xl",children:"No matching options"}):V.map((L,W)=>{const K=L.value===e;return l.jsxs("button",{onClick:()=>U(L.value),onMouseEnter:()=>k(W),onMouseLeave:()=>k(null),className:Pe("w-full px-4 py-3 text-left text-sm font-medium relative overflow-hidden transition-all duration-200 ease-out",d?.includes("font-mono")?"font-mono":"",K?"bg-app-button-bg-active/60 text-app-primary-foreground border-l-2 border-app-border-color-accent":L.isHighlighted?"text-app-primary-foreground":"text-app-primary-foreground/70 hover:text-app-primary-foreground",S===W?"bg-app-primary/20":""),role:"option","aria-selected":K,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"relative z-10 2k:text-2xl",children:L.label}),L.isHighlighted&&L.highlightLabel&&l.jsx("span",{className:"text-sm font-sans text-app-primary-foreground/70 italic 2k:text-xl",children:L.highlightLabel})]}),l.jsx("div",{className:Pe("absolute inset-0 bg-app-button-bg-active transition-opacity duration-200 ease-out",S===W?"opacity-100":"opacity-0")})]},`${L.value}-${W}`)})})})})]})},RV=b.forwardRef(({className:t,...e},r)=>l.jsx("textarea",{className:Pe("flex min-h-[80px] w-full bg-app-button-bg border border-app-border-color rounded-lg px-3 py-2 text-app-primary-foreground/90 text-sm hover:border-app-border-color-accent focus:outline-hidden  focus:border-app-border-color-accent placeholder:text-app-primary-foreground/60 disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-300 ease-out",t),ref:r,...e}));RV.displayName="Textarea";const qK=["January","February","March","April","May","June","July","August","September","October","November","December"],YK=({currentMonth:t,onSelect:e,disabled:r=!1})=>{const n=b.useMemo(()=>qK.map((i,s)=>({value:s,label:i,isHighlighted:s===t})),[t]);return l.jsx(Ep,{options:n,value:t,onSelect:e,icon:Cu,minWidth:"min-w-28",width:"w-32 sm:w-36 md:w-40 2k:w-56 2k:h-14",ariaLabel:`Select month, currently ${qK[t]}`,disabled:r,buttonClassName:"h-9 px-2 text-sm font-mono sm:h-10 sm:px-3"})},KK=({currentYear:t,onSelect:e,disabled:r=!1,yearRange:n=10})=>{const i=new Date().getFullYear(),s=i-Math.floor(n/2),a=Array.from({length:n},(c,u)=>s+u),o=b.useMemo(()=>a.map(c=>({value:c,label:c.toString(),isHighlighted:c===i})),[a,i]);return l.jsx(Ep,{options:o,value:t,onSelect:e,icon:qPe,minWidth:"min-w-24",width:"w-26 sm:w-36 md:w-40 2k:w-56 2k:h-14",ariaLabel:`Select year, currently ${t}`,disabled:r,buttonClassName:"h-9 px-2 text-sm font-mono sm:h-10 sm:px-3"})},ttt=({currentDate:t,monthlyPnL:e,currency:r,onPrevMonth:n,onNextMonth:i,onMonthSelect:s,onYearSelect:a,onReset:o,onMonthClick:c})=>{const u=()=>{const h=new Date;return t.getFullYear()===h.getFullYear()&&t.getMonth()===h.getMonth()},d=OV(e),f=DV(e);return l.jsxs("div",{className:"w-full pt-4",children:[l.jsxs("div",{className:"hidden md:flex lg:hidden flex-col gap-4 px-4 md:px-8",children:[l.jsxs("div",{className:"flex justify-between items-center bg-app-card-bg/80 rounded-2xl p-4",children:[l.jsx("h2",{className:"text-2xl font-bold",children:sr(t,"MMMM yyyy")}),l.jsxs("button",{type:"button",className:"flex items-center gap-3 py-2 px-3 bg-app-primary/20 border border-app-border-color-soft rounded-xl hover:bg-app-primary/30 hover:border-app-border-color-accent/60 transition-colors duration-300 group focus:outline-hidden focu
4147s:ring-2 focus:ring-app-button-bg-active cursor-pointer",onClick:c,"aria-label":`View all trades for ${sr(t,"MMMM yyyy")} - Total P&L: ${Ke(e)}`,children:[l.jsx("div",{className:`p-2 rounded-lg transition-colors duration-200 ${e>0?"bg-green-500/10 border border-green-500/20 group-hover:bg-green-500/20":e<0?"bg-red-500/10 border border-red-500/20 group-hover:bg-red-500/20":"bg-gray-500/10 border border-gray-500/20 group-hover:bg-gray-500/20"}`,children:l.jsx(d,{size:16,strokeWidth:1.5,className:f})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-gray-400",children:"Month Total"}),l.jsx("p",{className:`text-lg font-medium ${f}`,children:r==="usd"?Ke(e):fn(e)})]})]})]}),l.jsxs("div",{className:"flex flex-wrap justify-center gap-2 px-2",children:[l.jsx(Sh,{onClick:n,variant:"outline",icon:up,ariaLabel:"Previous month",tooltip:"Previous month"}),l.jsx(YK,{currentMonth:t.getMonth(),onSelect:s}),l.jsx(KK,{currentYear:t.getFullYear(),onSelect:a}),l.jsx(Sh,{onClick:i,icon:Sf,variant:"outline",ariaLabel:"Next month",tooltip:"Next month"}),l.jsx(Sh,{onClick:o,icon:Cu,ariaLabel:"Go to current month",variant:u()?"secondary":"accent",tooltip:"Current month",disabled:u()})]})]}),l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4 lg:gap-0 px-4 md:px-8 md:hidden lg:flex",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4 md:gap-6 w-full sm:w-auto sm:min-w-[320px] sm:pl-2 bg-app-card-bg/80 sm:bg-transparent rounded-2xl sm:rounded-none p-4 sm:p-0 md:p-6 mb-2 sm:mb-0 2k:p-8",children:[l.jsx("h2",{className:"text-2xl font-bold text-center sm:text-left w-full sm:w-auto mb-1 sm:mb-0 2k:text-4xl",children:sr(t,"MMMM yyyy")}),l.jsxs("button",{type:"button",className:"flex items-center gap-3 py-2 px-3 bg-app-primary/20 border border-app-border-color-soft rounded-xl w-full sm:flex-1 lg:w-auto sm:max-w-[420px] 2k:max-w-[520px] mx-auto sm:mx-0 hover:bg-app-primary/30 hover:border-app-border-color-accent/60 transition-colors duration-300 group focus:outline-hidden focus:ring-2 focus:ring-app-button-bg-active 2k:py-4 2k:px-6 2k:gap-6 2k:rounded-2xl cursor-pointer",onClick:c,"aria-label":`View all trades for ${sr(t,"MMMM yyyy")} - Total P&L: ${Ke(e)}`,children:[l.jsx("div",{className:`p-2 rounded-lg transition-colors duration-200 2k:p-4 2k:rounded-xl ${e>0?"bg-green-500/10 border border-green-500/20 group-hover:bg-green-500/20":e<0?"bg-red-500/10 border border-red-500/20 group-hover:bg-red-500/20":"bg-gray-500/10 border border-gray-500/20 group-hover:bg-gray-500/20"}`,children:l.jsx(d,{size:16,className:`${f} 2k:w-8 2k:h-8`,strokeWidth:1.5})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-gray-400 2k:text-lg",children:"Month Total"}),l.jsx("p",{className:`text-lg font-medium ${f} 2k:text-2xl`,children:r==="usd"?Ke(e):fn(e)})]})]})]}),l.jsxs("div",{className:"w-full sm:w-auto flex flex-wrap gap-2 items-center justify-center sm:justify-end min-w-[340px] sm:min-w-[400px] px-2 sm:px-2 2k:gap-6",children:[l.jsx(Sh,{onClick:n,variant:"outline",icon:up,ariaLabel:"Previous month",tooltip:"Previous month"}),l.jsx(YK,{currentMonth:t.getMonth(),onSelect:s}),l.jsx(KK,{currentYear:t.getFullYear(),onSelect:a}),l.jsx(Sh,{onClick:i,icon:Sf,variant:"outline",ariaLabel:"Next month",tooltip:"Next month"}),l.jsx(Sh,{onClick:o,icon:Cu,ariaLabel:"Go to current month",variant:u()?"secondary":"accent",tooltip:"Current month",disabled:u()})]})]})]})},QK=({weeklyPnL:t,currency:e,onWeekClick:r})=>{const n=DV(t),i=OV(t),s=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r())},a=t!==0;return l.jsxs("div",{className:Pe("group relative h-full p-4 border-b border-app-border-color-soft bg-app-primary/20 flex flex-col justify-center items-center group","cursor-pointer hover:bg-app-primary/30 transition-colors duration-500 ease-in-out"),"data-has-activity":a,role:"gridcell","aria-label":`Weekly P&L: ${t>0?"profit":t<0?"loss":"break even"} ${Ke(Math.abs(t))}`,tabIndex:0,onClick:r,onKeyDown:s,children:[a&&l.jsx(Xpe,{}),l.jsx("div",{className:`p-2 rounded-lg mb-2 ${t>0?"bg-green-500/10 border border-green-500/20":t<0?"bg-red-500/10 border border-red-500/20":"bg-gray-500/10 border border-gray-500/20"}`,children:l.jsx(i,{size:20,strokeWidth:1.5,className:`${n} 2k:w-7 2k:h-7`})}),l.jsx("span",{className:`text-sm font-medium ${n} 2k:text-2xl`,children:e==="usd"?Ke(t):fn(t)}),l.jsx("span",{className:"text-xs text-gray-400 mt-1 2k:text-xl",children:"Week Total"})]})},rtt=({currentDate:t,tradesByDate:e,weeklyPnL:r,monthlyTotal:n,gradesMap:i,mode:s,currency:a,tradeCount:o,onDayCl
4147ick:c,onWeekClick:u,...d})=>{const f=Gs(t),h=ga(t),m=tQe({start:f,end:h}),y=Array.from({length:Mk(f)},()=>null),x=b.useMemo(()=>m.map(S=>{const k=sr(S,"yyyy-MM-dd"),E=mi(S),T=$u(S),N=sr(E,"yyyy-MM-dd"),j=sr(T,"yyyy-MM-dd"),M=Mk(S)===6;return{date:S,formattedDate:k,weekStart:E,weekEnd:T,weekStartFormatted:N,weekEndFormatted:j,isLastDayOfWeek:M,trades:e.get(k)||[],weekPnL:r.get(N)||0}}),[m,e,r]),v=b.useMemo(()=>{const S=Mk(h),k=S!==6&&S>0,E=k?mi(h):null,T=k?$u(h):null,N=E&&r.get(sr(E,"yyyy-MM-dd"))||0;return{shouldShowFinalWeekPnL:k,finalWeekPnL:N,finalWeekStart:E?sr(E,"yyyy-MM-dd"):"",finalWeekEnd:T?sr(T,"yyyy-MM-dd"):"",endFillCells:6-S}},[h,r]),_=b.useMemo(()=>{const S=y.length+m.length+v.endFillCells;return Math.ceil(S/7)},[y.length,m.length,v.endFillCells]);return l.jsxs("div",{className:"bg-app-card border border-app-border-color-soft rounded-xl h-full flex flex-col overflow-visible 2k:rounded-2xl 2k:p-8",children:[l.jsx(ttt,{currency:a,currentDate:t,monthlyPnL:n,...d}),l.jsxs("div",{className:"w-full mt-6 overflow-x-auto no-scrollbar",children:[l.jsx("div",{className:"grid grid-cols-8 text-center border-b border-app-border-color-soft shrink-0 min-w-[700px] md:min-w-[900px] text-xs sm:text-sm 2k:text-2xl",role:"row",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Week P&L"].map(S=>l.jsx("div",{className:"py-2 text-gray-400 font-light 2k:py-4",role:"columnheader",children:S},S))}),l.jsxs("div",{className:"grid grid-cols-8 flex-1 min-w-[700px] md:min-w-[900px] text-xs sm:text-sm 2k:text-xl",style:{gridTemplateRows:`repeat(${_}, 1fr)`},role:"grid","aria-label":`Trading calendar for ${sr(t,"MMMM yyyy")}`,children:[y.map((S,k)=>l.jsx("div",{className:"h-full p-1 sm:p-4 border-b border-r border-app-border-color-soft bg-app-primary/20 2k:p-6",role:"gridcell","aria-hidden":"true"},`empty-${k}`)),x.map(S=>l.jsxs(P.Fragment,{children:[l.jsx(Xet,{date:S.date,trades:S.trades,currentDate:t,mode:s,currency:a,tradeCount:o,grade:i.get(S.formattedDate)||null,onDayClick:()=>c(S.formattedDate)}),S.isLastDayOfWeek&&l.jsx(QK,{weeklyPnL:S.weekPnL,currency:a,onWeekClick:()=>u(S.weekStartFormatted,S.weekEndFormatted)})]},S.date.toISOString())),Array.from({length:v.endFillCells},()=>null).map((S,k)=>l.jsx("div",{className:"h-full p-4 border-b border-r border-app-border-color-soft bg-app-primary/20 2k:p-6",role:"gridcell","aria-hidden":"true"},`end-empty-${k}`)),v.shouldShowFinalWeekPnL&&l.jsx(QK,{weeklyPnL:v.finalWeekPnL,currency:a,onWeekClick:()=>u(v.finalWeekStart,v.finalWeekEnd)})]})]})]})};var ntt="Label",eme=b.forwardRef((t,e)=>l.jsx(vt.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));eme.displayName=ntt;var itt=eme;function stt({className:t,...e}){return l.jsx(itt,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}const tN=_Ve,tme=b.createContext({}),kb=({...t})=>l.jsx(tme.Provider,{value:{name:t.name},children:l.jsx(CVe,{...t})}),rN=()=>{const t=b.useContext(tme),e=b.useContext(rme),{getFieldState:r,formState:n}=oj(),i=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:s}=e;return{id:s,name:t.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},rme=b.createContext({}),ry=b.forwardRef(({className:t,...e},r)=>{const n=b.useId();return l.jsx(rme.Provider,{value:{id:n},children:l.jsx("div",{ref:r,className:ee("space-y-2.5",t),...e})})});ry.displayName="FormItem";const ny=b.forwardRef(({className:t,...e},r)=>{const{error:n,formItemId:i}=rN();return l.jsx(stt,{ref:r,className:ee("font-light",n&&"text-red-400 font-medium",t),htmlFor:i,...e})});ny.displayName="FormLabel";const n1=b.forwardRef(({...t},e)=>{const{error:r,formItemId:n,formDescriptionId:i,formMessageId:s}=rN();return l.jsx(Cw,{ref:e,id:n,"aria-describedby":r?`${i} ${s}`:`${i}`,"aria-invalid":!!r,...t})});n1.displayName="FormControl";const nN=b.forwardRef(({className:t,...e},r)=>{const{formDescriptionId:n}=rN();return l.jsx("p",{ref:r,id:n,className:ee("text-[0.8rem] font-light text-app-primary-foreground
4147/80",t),...e})});nN.displayName="FormDescription";const iN=b.forwardRef(({className:t,children:e,...r},n)=>{const{error:i,formMessageId:s}=rN(),a=i?String(i?.message??""):e;return a?l.jsx("p",{ref:n,id:s,className:ee("text-[0.8rem] font-medium text-red-400",t),...r,children:a}):null});iN.displayName="FormMessage";var sN="Popover",[nme]=ma(sN,[$f]),i1=$f(),[att,zf]=nme(sN),ime=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!1}=t,o=i1(e),c=b.useRef(null),[u,d]=b.useState(!1),[f,h]=Ao({prop:n,defaultProp:i??!1,onChange:s,caller:sN});return l.jsx(Tj,{...o,children:l.jsx(att,{scope:e,contentId:ts(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:b.useCallback(()=>d(!0),[]),onCustomAnchorRemove:b.useCallback(()=>d(!1),[]),modal:a,children:r})})};ime.displayName=sN;var sme="PopoverAnchor",ott=b.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=zf(sme,r),s=i1(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return b.useEffect(()=>(a(),()=>o()),[a,o]),l.jsx(Qw,{...s,...n,ref:e})});ott.displayName=sme;var ame="PopoverTrigger",ome=b.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=zf(ame,r),s=i1(r),a=Kt(e,i.triggerRef),o=l.jsx(vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fme(i.open),...n,ref:a,onClick:He(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:l.jsx(Qw,{asChild:!0,...s,children:o})});ome.displayName=ame;var IV="PopoverPortal",[ltt,ctt]=nme(IV,{forceMount:void 0}),lme=t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,s=zf(IV,e);return l.jsx(ltt,{scope:e,forceMount:r,children:l.jsx($i,{present:r||s.open,children:l.jsx(e0,{asChild:!0,container:i,children:n})})})};lme.displayName=IV;var iy="PopoverContent",cme=b.forwardRef((t,e)=>{const r=ctt(iy,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=zf(iy,t.__scopePopover);return l.jsx($i,{present:n||s.open,children:s.modal?l.jsx(dtt,{...i,ref:e}):l.jsx(ftt,{...i,ref:e})})});cme.displayName=iy;var utt=kf("PopoverContent.RemoveScroll"),dtt=b.forwardRef((t,e)=>{const r=zf(iy,t.__scopePopover),n=b.useRef(null),i=Kt(e,n),s=b.useRef(!1);return b.useEffect(()=>{const a=n.current;if(a)return pj(a)},[]),l.jsx(Yw,{as:utt,allowPinchZoom:!0,children:l.jsx(ume,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:He(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:He(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ftt=b.forwardRef((t,e)=>{const r=zf(iy,t.__scopePopover),n=b.useRef(!1),i=b.useRef(!1);return l.jsx(ume,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;r.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),ume=b.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,h=zf(iy,r),m=i1(r);return fj(),l.jsx(qw,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Jy,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(Cj,{"data-state":fme(h.open),role:"dialog",id:h.contentId,...m,...f,ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dme="PopoverClose",htt=b.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=zf(dme,r);return l.jsx(vt.button,{type:"button",...n,ref:e,onClick:He(t.onClick,()=>i.onOpenChange(!1))})});htt.displayName=dme;var ptt="PopoverArrow",mtt=b.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=i1(r);return l.jsx(Ej,{...i,...n,ref:e})});mtt.displayName=ptt;function fme(t){return t?"open":"closed"}var gtt=ime,ytt=ome,vtt=lme,xtt=cme;function Bf({...t}){return l.jsx(gtt,{"data-slot":"popover",...t})}function Vf({...t}){return l.jsx(ytt,{"data-slot":"popover-trigger",className:"group",...t})}function Uf({className:t,align:e="center",sideOffset:r=4,...n}){return l.jsx(vtt,{children:l.jsx(xtt,{"data-slot":"popover-content",align:e,sideOffset:r,className:Pe("bg-app-card text-app-primary-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
4147de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-xl border border-app-border-color-soft p-4 outline-hidden",t),...n})})}function LV(t){const e=t+"CollectionProvider",[r,n]=ma(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:v,children:_}=x,S=P.useRef(null),k=P.useRef(new Map).current;return l.jsx(i,{scope:v,itemMap:k,collectionRef:S,children:_})};a.displayName=e;const o=t+"CollectionSlot",c=kf(o),u=P.forwardRef((x,v)=>{const{scope:_,children:S}=x,k=s(o,_),E=Kt(v,k.collectionRef);return l.jsx(c,{ref:E,children:S})});u.displayName=o;const d=t+"CollectionItemSlot",f="data-radix-collection-item",h=kf(d),m=P.forwardRef((x,v)=>{const{scope:_,children:S,...k}=x,E=P.useRef(null),T=Kt(v,E),N=s(d,_);return P.useEffect(()=>(N.itemMap.set(E,{ref:E,...k}),()=>void N.itemMap.delete(E))),l.jsx(h,{[f]:"",ref:T,children:S})});m.displayName=d;function y(x){const v=s(t+"CollectionConsumer",x);return P.useCallback(()=>{const S=v.collectionRef.current;if(!S)return[];const k=Array.from(S.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((N,j)=>k.indexOf(N.ref.current)-k.indexOf(j.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},y,n]}var btt=b.createContext(void 0);function a0(t){const e=b.useContext(btt);return t||e||"ltr"}var $A="rovingFocusGroup.onEntryFocus",wtt={bubbles:!1,cancelable:!0},s1="RovingFocusGroup",[n5,hme,_tt]=LV(s1),[Stt,o0]=ma(s1,[_tt]),[ktt,Ttt]=Stt(s1),pme=b.forwardRef((t,e)=>l.jsx(n5.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(n5.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(Ctt,{...t,ref:e})})}));pme.displayName=s1;var Ctt=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,h=b.useRef(null),m=Kt(e,h),y=a0(s),[x,v]=Ao({prop:a,defaultProp:o??null,onChange:c,caller:s1}),[_,S]=b.useState(!1),k=Ki(u),E=hme(r),T=b.useRef(!1),[N,j]=b.useState(0);return b.useEffect(()=>{const M=h.current;if(M)return M.addEventListener($A,k),()=>M.removeEventListener($A,k)},[k]),l.jsx(ktt,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:x,onItemFocus:b.useCallback(M=>v(M),[v]),onItemShiftTab:b.useCallback(()=>S(!0),[]),onFocusableItemAdd:b.useCallback(()=>j(M=>M+1),[]),onFocusableItemRemove:b.useCallback(()=>j(M=>M-1),[]),children:l.jsx(vt.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:He(t.onMouseDown,()=>{T.current=!0}),onFocus:He(t.onFocus,M=>{const O=!T.current;if(M.target===M.currentTarget&&O&&!_){const R=new CustomEvent($A,wtt);if(M.currentTarget.dispatchEvent(R),!R.defaultPrevented){const I=E().filter(U=>U.focusable),B=I.find(U=>U.active),F=I.find(U=>U.id===x),$=[B,F,...I].filter(Boolean).map(U=>U.ref.current);yme($,d)}}T.current=!1}),onBlur:He(t.onBlur,()=>S(!1))})})}),mme="RovingFocusGroupItem",gme=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:a,...o}=t,c=ts(),u=s||c,d=Ttt(mme,r),f=d.currentTabStopId===u,h=hme(r),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:x}=d;return b.useEffect(()=>{if(n)return m(),()=>y()},[n,m,y]),l.jsx(n5.ItemSlot,{scope:r,id:u,focusable:n,active:i,children:l.jsx(vt.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:He(t.onMouseDown,v=>{n?d.onItemFocus(u):v.preventDefault()}),onFocus:He(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:He(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const _=Ntt(v,d.orientation,d.dir);if(_!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let k=h().filter(E=>E.focusable).map(E=>E.ref.current);if(_==="last")k.reverse();else if(_==="prev"||_==="next"){_==="prev"&&k.reverse();const E=k.indexOf(v.currentTarget);k=d.loop?Ptt(k,E+1):k.slice(E+1)}setTimeout(()=>yme(k))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:x!=null}):a})})});gme.displayName=mme;var Ett={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jtt(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Ntt(t,e,r){const n=jtt(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ett[n]}function yme(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Ptt(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var $V=pme,FV=gme;function zV(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var BV="Radio",[Mtt,vme]=ma(BV),[Att,Dtt]=Mtt(BV),xme=b.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:c,form:u,...d}=t,[f,h]=b.useState(null),m=Kt(e,v=>h(v)),y=b.useRef(!1),x=f?u||!!f.closest("form"):!0;return l.jsxs(Att,{scope:r,checked:i,disabled:a,children:[l.jsx(vt.button,{type:"button",role:"radio","aria-checked":i,"data-state":Sme(i),"data-disabled":a?"":void 0,disabled:a,value:o,...d,ref:m,onClick:He(t.onClick,v=>{i||c?.(),x&&(y.current=v.isPropagationStopped(),y.current||v.stopPropagation())})}),x&&l.jsx(_me,{control:f,bubbles:!y.current,name:n,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});xme.displayName=BV;var bme="RadioIndicator",wme=b.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Dtt(bme,r);return l.jsx($i,{present:n||s.checked,children:l.jsx(vt.span,{"data-state":Sme(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});wme.displayName=bme;var Ott="RadioBubbleInput",_me=b.forwardRef(({__scopeRadio:t,control:e,checked:r,bubbles:n=!0,...i},s)=>
vendor: 1,769 bytes, line 4147
4147{const a=b.useRef(null),o=Kt(a,s),c=zV(r),u=XB(e);return b.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&m){const y=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(y)}},[c,r,n]),l.jsx(vt.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_me.displayName=Ott;function Sme(t){return t?"checked":"unchecked"}var Rtt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],aN="RadioGroup",[Itt]=ma(aN,[o0,vme]),kme=o0(),Tme=vme(),[Ltt,$tt]=Itt(aN),Cme=b.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=t,m=kme(r),y=a0(u),[x,v]=Ao({prop:s,defaultProp:i??null,onChange:f,caller:aN});return l.jsx(Ltt,{scope:r,name:n,required:a,disabled:o,value:x,onValueChange:v,children:l.jsx($V,{asChild:!0,...m,orientation:c,dir:y,loop:d,children:l.jsx(vt.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:y,...h,ref:e})})})});Cme.displayName=aN;var Eme="RadioGroupItem",jme=b.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=$tt(Eme,r),a=s.disabled||n,o=kme(r),c=Tme(r),u=b.useRef(null),d=Kt(e,u),f=s.value===i.value,h=b.useRef(!1);return b.useEffect(()=>{const m=x=>{Rtt.includes(x.key)&&(h.current=!0)},y=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",y)}},[]),l.jsx(FV,{asChild:!0,...o,focusable:!a,active:f,children:l.jsx(xme,{disabled:a,required:s.required,
4147checked:f,...c,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:He(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:He(i.onFocus,()=>{h.current&&u.current?.click()})})})});jme.displayName=Eme;var Ftt="RadioGroupIndicator",Nme=b.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=Tme(r);return l.jsx(wme,{...i,...n,ref:e})});Nme.displayName=Ftt;var Pme=Cme,Mme=jme,ztt=Nme;const VV=b.forwardRef(({className:t,...e},r)=>l.jsx(Pme,{className:ee("grid gap-2",t),...e,ref:r}));VV.displayName=Pme.displayName;const tC=b.forwardRef(({className:t,...e},r)=>l.jsx(Mme,{ref:r,className:ee("aspect-square size-5 rounded-full border border-app-border-color text-app-primary-foreground shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-app-border-color-accent disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",t),...e,children:l.jsx(ztt,{className:"flex items-center justify-center",children:l.jsx(loe,{className:"h-3.5 w-3.5 fill-app-border-color-accent text-app-border-color "})})}));tC.displayName=Mme.displayName;const Btt=fa({currencyMode:pA(["usd","r"]),pnlMode:pA(["net","gross"]),tradeCountMode:pA(["show","hide"])}),Vtt=({value:t,label:e,description:r,isSelected:n})=>l.jsxs("label",{htmlFor:t,className:ee("flex items-start gap-3 rounded-xl border border-app-border-color bg-app-input-bg px-4 py-3 text-sm cursor-pointer transition-colors flex-1",n&&"border-app-border-color-accent"),children:[l.jsx(tC,{value:t,id:t,className:"mt-0.5"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsx("span",{children:e}),l.jsx("p",{className:"text-app-primary-foreground/80 text-xs leading-relaxed font-light max-w-md",children:r})]})]}),a1=({mode:t,currency:e,tradeCount:r="show",setFilter:n,className:i})=>{const s=$o({resolver:xl(Btt),defaultValues:{currencyMode:e,pnlMode:t,tradeCountMode:r}}),u=[{key:"currencyMode",label:"Value display format",icon:Yc,options:[{value:"usd",label:"USD amounts",description:"Show all values in dollars for easy comparison with account balances and real-world costs."},{value:"r",label:"Risk multiples",description:"Express values as multiples of risk (R) to standardize position sizing across different instruments."}],onChange:d=>{const f=d;n({currency:f}),s.setValue("currencyMode",f)}},{key:"pnlMode",label:"Profit & loss calculation",icon:_s,options:[{value:"net",label:"Net (After fees)",description:"Include all trading costs (commissions and fees) for true Profit/Loss that reflects actual money gained or lost in y
4147our account."},{value:"gross",label:"Gross (Before fees)",description:"Exclude all trading costs to focus purely on price movement performance and strategy effectiveness without cost distractions."}],onChange:d=>{const f=d;n({mode:f}),s.setValue("pnlMode",f)}},{key:"tradeCountMode",label:"Trade count display",icon:tb,options:[{value:"show",label:"Show trade counts",description:"Display total trade counts and win/loss/scratch metrics across calendar and recap views."},{value:"hide",label:"Hide trade counts (P&L only)",description:"Hide trade counts and win/loss/scratch metrics for clean social media graphics."}],onChange:d=>{const f=d;n({tradeCount:f}),s.setValue("tradeCountMode",f)}}];return l.jsx("div",{className:ee("relative",i),children:l.jsxs(Bf,{children:[l.jsx(Vf,{asChild:!0,children:l.jsxs(ye,{variant:"secondary",className:"h-9 bg-app-input-bg/50 border border-dashed",children:[l.jsx(a3,{className:"size-3.5"}),l.jsx("span",{children:"View settings"}),(t!=="net"||e!=="usd"||r!=="show")&&l.jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-emerald-500 px-1 text-[10px] font-bold text-white",children:(t!=="net"?1:0)+(e!=="usd"?1:0)+(r!=="show"?1:0)})]})}),l.jsx(Uf,{align:"end",className:"max-w-xs md:max-w-2xl rounded-2xl w-fit max-h-[80vh] overflow-y-auto",children:l.jsx(tN,{...s,children:l.jsx("div",{className:"p-1 space-y-6",children:u.map(d=>l.jsx(kb,{control:s.control,name:d.key,render:({field:f})=>l.jsxs(ry,{className:"space-y-3",children:[l.jsxs(ny,{className:"text-xs text-app-primary-foreground/90 uppercase tracking-wider flex items-center gap-2",children:[l.jsx(d.icon,{className:"size-3.5"}),d.label]}),l.jsx(n1,{children:l.jsx(VV,{value:f.value,onValueChange:d.onChange,className:"flex flex-col md:flex-row gap-0 md:[&>*:last-child]:rounded-l-none md:[&>*:first-child]:!rounded-r-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none md:[&>*:first-child]:rounded-b-xl md:[&>*:last-child]:rounded-t-xl",children:d.options.map(h=>l.jsx(Vtt,{value:h.value,label:h.label,description:h.description,isSelected:f.value===h.value},h.value))})})]})},d.key))})})})]})})},Utt=t=>{const e=[{user_id:{_eq:t.userId}},{is_active:{_eq:!0}},{deleted_at:{_is_null:!0}},{entry_date:{_gte:t.entryDate}},{entry_date:{_lte:t.exitDate}}];return t.symbol&&e.push({symbol:{_ilike:`%${t.symbol}%`}}),t.positionType&&e.push({position_type:{_eq:t.positionType}}),t.minPnL!=null&&e.push({pnl:{_gte:t.minPnL}}),t.maxPnL!=null&&e.push({pnl:{_lte:t.maxPnL}}),{_and:e}},Gtt=t=>{if(t.dateRange)return{startDate:t.dateRange.start,endDate:t.dateRange.end};if(t.currentDate){const e=Gs(t.currentDate).toISOString(),r=ga(t.currentDate).toISOString();return{startDate:e,endDate:r}}throw new Error("Either currentDate or dateRange must be provided")},Ame=({currentDate:t,dateRange:e,enabled:r=!0,limit:n=999999999,page:i=1})=>{const{userHasura:s}=Gt(),{startDate:a,endDate:o}=b.useMemo(()=>{try{return Gtt({currentDate:t,dateRange:e})}catch{const y=new Date,x=sr(Gs(y),"yyyy-MM-dd"),v=sr(ga(y),"yyyy-MM-dd");return{startDate:x,endDate:v}}},[t,e]),c=b.useMemo(()=>s?.id?{where:Utt({userId:s.id,entryDate:Mu(a),exitDate:Mu(o,!0)}),orderBy:[{entry_date:"desc"}],limit:n,offset:(i-1)*n}:null,[s?.id,a,o,n,i]),{data:u,loading:d,error:f,refetch:h}=da($he,{variables:c,skip:!c||!r,notifyOnNetworkStatusChange:!0,returnPartialData:!0}),m=u?.trade||[];return{trades:m,total:m.length,isLoading:d,error:f,refetch:h}},Wtt=(t,e=!0)=>Ame({currentDate:t,enabled:e}),Htt=(t,e)=>{const r=Ws(),[n,i]=Dj({date:{defaultValue:wq(),parse:M=>M||wq()}}),s=b.useMemo(()=>{const M=new Date(n.date);return Number.isNaN(M.getTime())?new Date:M},[n.date]),a=M=>{if(!M||Number.isNaN(M.getTime())){console.warn("Invalid date provided to updateDate");return}i({date:M.toISOString().split("T")[0]})},{trades:o,isLoading:c,error:u,refetch:d}=Wtt(s),{tradesByDate:f,weeklyPnL:h,monthlyTotal:m}=b.useMemo(()=>Zet(o,t,e),[o,t,e]);return{currentDate:s,trades:o,tradesByDate:f,weeklyPnL:h,monthlyTotal:m,isLoading:c,isError:!!u,error:u,handlePrevMonth:()=>{a(fs(s,s.getMonth()-1))},handleNextMonth:()=>{a(fs(s,s.getMonth()+1))},handleMonthSelect:M=>{a(fs(s,M))},handleYearSelect:M=>{a(po(s,M))},handleGoToCurrentMonth:()=>{a(new Date)},handleReset:()=>{a(new Date)},handleRetry:()=>{d()},handleDayClick:M=>{r(`/app/recap/${M}`)},handleWeekClick:(M,O)=>{const R=new URLSearchParams;R.set("start",M),R.set("end",O),r(`/app/trades?${R.toString()}`)},handleMonthClick:()=>{const M=sr(Gs(s),"yyyy-MM-dd"),O=sr(ga(s),"yyyy-MM-dd"),R=new URLSearchParams;R.set("start",M),R.set("end",O),R.set("timeRange","this_month"),r(`/app/trades?${R.toString()}`)}}}
4147,qtt=tt`
4148  query GetDailyGrade($userId: uuid!, $tradeDay: date!) {
4149    daily_grade(
4150      where: { user_id: { _eq: $userId }, trade_day: { _eq: $tradeDay } }
4151      limit: 1
4152    ) {
4153      id
4154      userId: user_id
4155      tradeDay: trade_day
4156      grade
4157      notes
4158      sleepQuality: sleep_quality
4159      sleepHours: sleep_hours
4160      energyLevel: energy_level
4161      goal
4162      reminders
4163      segments
4164      learned
4165      changes
4166      overview
4167      easiestMoneyTradeId: easiest_money_trade_id
4168      easiestMoneyNotes: easiest_money_notes
4169      createdAt: created_at
4170      updatedAt: updated_at
4171    }
4172  }
4173`,UV=tt`
4174  query GetDailyGradesInRange(
4175    $userId: uuid!
4176    $startDate: date!
4177    $endDate: date!
4178  ) {
4179    daily_grade(
4180      where: {
4181        user_id: { _eq: $userId }
4182        trade_day: { _gte: $startDate, _lte: $endDate }
4183      }
4184      order_by: { trade_day: desc }
4185    ) {
4186      id
4187      tradeDay: trade_day
4188      grade
4189      notes
4190      sleepQuality: sleep_quality
4191      sleepHours: sleep_hours
4192      energyLevel: energy_level
4193    }
4194  }
4195`,Ytt=tt`
4196  query GetLastDailyGrade($userId: uuid!, $currentDate: date!) {
4197    daily_grade(
4198      where: { user_id: { _eq: $userId }, trade_day: { _lt: $currentDate } }
4199      order_by: { trade_day: desc }
4200      limit: 1
4201    ) {
4202      id
4203      goal
4204      reminders
4205      segments
4206      tradeDay: trade_day
4207    }
4208  }
4209`,Ktt=(t,e)=>{const{userHasura:r}=Gt(),{data:n,loading:i,refetch:s}=ws(UV,{variables:{userId:r?.id||"",startDate:t,endDate:e},skip:!r?.id||!t||!e}),a=new Map(n?.daily_grade?.map(o=>[o.tradeDay,o])||[]);return{grades:n?.daily_grade||[],gradesMap:a,loading:i,refetch:s}},Qtt=["net","gross"],Ztt=["usd","r"],Xtt=["show","hide"],Jtt=li({mode:cf([Il("net"),Il("gross")]).optional(),currency:cf([Il("usd"),Il("r")]).optional(),tradeCount:cf([Il("show"),Il("hide")]).optional()}),o1=t=>{const e=b.useMemo(()=>kT(t,Jtt),[t]),[r,n]=Dj({mode:df(Qtt).withDefault(e?.mode??"net"),currency:df(Ztt).withDefault(e?.currency??"usd"),tradeCount:df(Xtt).withDefault(e?.tradeCount??"show")}),i=b.useCallback(s=>{const a={mode:r.mode,currency:r.currency,tradeCount:r.tradeCount},o=s(a),c={mode:o.mode??a.mode,currency:o.currency??a.currency,tradeCount:o.tradeCount??a.tradeCount};n(o),Wc(t,c)},[r.currency,r.mode,r.tradeCount,n,t]);return{viewSettings:{mode:r.mode,currency:r.currency,tradeCount:r.tradeCount},updateViewSettings:i}},ert=()=>{const{viewSettings:t,updateViewSettings:e}=o1("mt:calendar:viewPrefs"),{currentDate:r,tradesByDate:n,weeklyPnL:i,monthlyTotal:s,error:a,isError:o,handlePrevMonth:c,handleNextMonth:u,handleMonthSelect:d,handleYearSelect:f,handleGoToCurrentMonth:h,handleReset:m,handleRetry:y,handleDayClick:x,handleWeekClick:v,handleMonthClick:_}=Htt(t.mode,t.currency),S=Gs(r),k=ga(r),{gradesMap:E}=Ktt(sr(S,"yyyy-MM-dd"),sr(k,"yyyy-MM-dd")),T=N=>{e(()=>N)};return o?l.jsx(UKe,{title:"Failed to load calendar data",message:a?.message||"Unable to fetch trading data. Please try again.",onRetry:y,className:"min-h-screen"}):l.jsxs("div",{className:"h-full flex flex-col space-y-6 2k:mt-8",children:[l.jsxs("div",{className:"flex flex-row justify-between items-center gap-2 sm:gap-0 mt-4",children:[l.jsx("h1",{className:"text-3xl font-bold 2k:text-5xl",children:"Calendar"}),l.jsx(a1,{mode:t.mode,currency:t.currency,tradeCount:t.tradeCount,setFilter:T})]}),l.jsx(rtt,{currentDate:r,tradesByDate:n,weeklyPnL:i,monthlyTotal:s,gradesMap:E,mode:t.mode,currency:t.currency,tradeCount:t.tradeCount,onPrevMonth:c,onNextMonth:u,onMonthSelect:d,onYearSelect:f,onGoToCurrentMonth:h,onReset:m,onDayClick:x,onWeekClick:v,onMonthClick:_})]})},GV=()=>l.jsx("div",{className:"flex justify-center items-center h-32",children:l.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-app-button-bg-active 2k:h-12 2k:w-12"})});function ZK(t,e,r){const n=dpe(),i=nrt(t,r.timeZone,r.locale??n.locale);return"formatToParts"in i?trt(i,e):rrt(i,e)}function trt(t,e){const r=t.formatToParts(e);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function rrt(t,e){const r=t.format(e).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function nrt(t,e,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:e,timeZoneName:t})}function irt(t,e){const r=crt(e);return"formatToParts"in r?art(r,t):ort(r,t)}const srt={year:0,month:1,day:2,hour:3,minute:4,second:5};function art(t,e){try{const r=t.formatToParts(e),n=[];for(let i=0;i<r.length;i++){const s=srt[r[i].type];s!==void 0&&(n[s]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function ort(t,e){const r=t.format(e),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const FA={},XK=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/Ne
4209w_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),lrt=XK==="06/25/2014, 00:00:00"||XK==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function crt(t){return FA[t]||(FA[t]=lrt?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),FA[t]}function Dme(t,e,r,n,i,s,a){const o=new Date(0);return o.setUTCFullYear(t,e,r),o.setUTCHours(n,i,s,a),o}const JK=36e5,urt=6e4,zA={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function WV(t,e,r){if(!t)return 0;let n=zA.timezoneZ.exec(t);if(n)return 0;let i,s;if(n=zA.timezoneHH.exec(t),n)return i=parseInt(n[1],10),eQ(i)?-(i*JK):NaN;if(n=zA.timezoneHHMM.exec(t),n){i=parseInt(n[2],10);const a=parseInt(n[3],10);return eQ(i,a)?(s=Math.abs(i)*JK+a*urt,n[1]==="+"?-s:s):NaN}if(hrt(t)){e=new Date(e||Date.now());const a=r?e:drt(e),o=i5(a,t);return-(r?o:frt(e,o,t))}return NaN}function drt(t){return Dme(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}function i5(t,e){const r=irt(t,e),n=Dme(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=t.getTime();const s=i%1e3;return i-=s>=0?s:1e3+s,n-i}function frt(t,e,r){let i=t.getTime()-e;const s=i5(new Date(i),r);if(e===s)return e;i-=s-e;const a=i5(new Date(i),r);return s===a?s:Math.max(s,a)}function eQ(t,e){return-23<=t&&t<=23&&(e==null||0<=e&&e<=59)}const tQ={};function hrt(t){if(tQ[t])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:t}),tQ[t]=!0,!0}catch{return!1}}const prt=60*1e3,mrt={X:function(t,e,r){const n=BA(r.timeZone,t);if(n===0)return"Z";switch(e){case"X":return rQ(n);case"XXXX":case"XX":return Ym(n);case"XXXXX":case"XXX":default:return Ym(n,":")}},x:function(t,e,r){const n=BA(r.timeZone,t);switch(e){case"x":return rQ(n);case"xxxx":case"xx":return Ym(n);case"xxxxx":case"xxx":default:return Ym(n,":")}},O:function(t,e,r){const n=BA(r.timeZone,t);switch(e){case"O":case"OO":case"OOO":return"GMT"+grt(n,":");case"OOOO":default:return"GMT"+Ym(n,":")}},z:function(t,e,r){switch(e){case"z":case"zz":case"zzz":return ZK("short",t,r);case"zzzz":default:return ZK("long",t,r)}}};function BA(t,e){const r=t?WV(t,e,!0)/prt:e?.getTimezoneOffset()??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+t);return r}function rC(t,e){const r=t<0?"-":"";let n=Math.abs(t).toString();for(;n.length<e;)n="0"+n;return r+n}function Ym(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=rC(Math.floor(n/60),2),s=rC(Math.floor(n%60),2);return r+i+e+s}function rQ(t,e){return t%60===0?(t>0?"-":"+")+rC(Math.abs(t)/60,2):Ym(t,e)}function grt(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=Math.floor(n/60),s=n%60;return s===0?r+String(i):r+String(i)+e+rC(s,2)}function nQ(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+t-+e}const yrt=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,VA=36e5,iQ=6e4,vrt=2,Rs={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:yrt};function Ome(t,e={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(t===null)return new Date(NaN);const r=e.additionalDigits==null?vrt:Number(e.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]")return new Date(t.getTime());if(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")return new Date(t);if(Object.prototype.toString.call(t)!=="[object String]")return new Date(NaN);const n=xrt(t),{year:i,restDateString:s}=brt(n.date,r),a=wrt(s,i);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let c=0,u;if(n.time&&(c=_rt(n.time),c===null||isNaN(c)))return new Date(NaN);if(n.timeZone||e.timeZone){if(u=WV(n.timeZone||e.timeZone,new Date(o+c)),isNaN(u))return new Date(NaN)}else u=nQ(new Date(o+c)),u=nQ(new Date(o+c+u));return new Date(o+c+u)}else return new Date(NaN)}function xrt(t){const e={};let r=Rs.dateTimePattern.exec(t),n;if(r?(e.date=r[1],n=r[3]):(r=Rs.datePattern.exec(t),r?(e.date=r[1],n=r[2]):(e.date=null,n=t)),n){const i=Rs.timeZone.exec(n);i?(e.time=n.replace(i[1],""),e.timeZone=i[1].trim()):e.time=n}return e}function brt(t,e){if(t){const r=Rs.YYY[e],n=Rs.YYYYY[e];let i=Rs.YYYY.exec(t)||n.exec(t);if(i){const s=i[1];return{year:parseInt(s,10),restDateString:t.slice(s.length)}}if(i=Rs.YY.exec(t)||r.exec(t),i){const s=i[1];return{year:parseInt(s,10)*100,restDateString:t.slice(s.length)}}}return{year:null}}function wrt(t,e){if(e===null)return null;let r,n,i;if(!t||!t.length)return r=new Date(0),r.setUTCFullYear(e),r;let s=Rs.MM.exec(t);if(s)return r=new Date(0),n=parseInt(s[1],10)-1,aQ(e,n)?(r.setUTCFullYear(e,n),r):new Date(NaN);if(s=Rs.DDD.exec(t),s){r=new Date(0);const a=parseInt(s[1],10);return Trt(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(s=Rs.MMDD.exec(t),s){r=new Date(0),n=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return aQ(e,n,a)?(r.setUTCFullYear(e,n,a),r):new Date(NaN)}if(s=Rs.Www.exec(t),s)return i=parseInt(s[1],10)-1,oQ(i)?sQ(e,i):new Date(NaN);if(s=Rs.WwwD.exec(t),s){i=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return oQ(i,a)?sQ(e,i,a):new Date(NaN)}return null}function _rt(t){let e,r,n=Rs.HH.exec(t);if(n)return e=parseFloat(n[1].replace(",",".")),UA(e)?e%24*VA:NaN;if(n=Rs.HHMM.exec(t),n)return e=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),UA(e,r)?e%24*VA+r*iQ:NaN;if(n=Rs.HHMMSS.exec(t),n){e=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return UA(e,r,i)?e%24*VA+r*iQ+i*1e3:NaN}return null}function sQ(t,e,r){e=e||0,r=r||0;const n=new Date(0);n.setUTCFullYear(t,0,4);const i=n.getUTCDay()||7,s=e*7+r+1-i;return n.setUTCDate(n.getUTCDate()+s),n}const Srt=[31,28,31,30,31,30,31,31,30,31,30,31],krt=[31,29,31,30,31,30,31,31,30,31,30,31];function Rme(t){return t%400===0||t%4===0&&t%100!==0}function aQ(t,e,r){if(e<0||e>11)return!1;if(r!=null){if(r<1)return!1;const n=Rme(t);if(n&&r>krt[e]||!n&&r>Srt[e])return!1}return!0}function Trt(t,e){if(e<1)return!1;const r=Rme(t);return!(r&&e>366||!r&&e>365)}function oQ(t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function UA(t,e,r){return!(t<0||t>=25||e!=null&&(e<0||e>=60)||r!=null&&(r<0||r>=60))}const Crt=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ra(t,e,r={}){e=String(e);const n=e.match(Crt);if(n){const i=Ome(r.originalDate||t,r);e=n.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),c=s[o-1]==="'",u=s.replace(a,"'"+mrt[a[0]](i,a,r)+"'");return c?u.substring(0,o-1)+u.substring(o+1):u},e)}return sr(t,e,r)}function jp(t,e,r){t=Ome(t,r);const n=WV(e,t,!0),i=new Date(t.getTime()-n),s=new Date(0);return s.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),s.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),s}function Ert(t,e,r,n){return n={...n,timeZone:e,originalDate:t},Ra(jp(t,e,{timeZone:n.timeZone}
4209),r,n)}const jrt={default:"MMM d, yyyy HH:mm:ss",withPeriod:"MMM d, yyyy 'at' hh:mm:ss a",short:"MMM d, yyyy",longWithTime:"MMMM d, yyyy HH:mm:ss",longWithPeriod:"MMMM d, yyyy 'at' hh:mm:ss a",compact:"M/d/yy",iso:"yyyy-MM-dd HH:mm:ss"};function tp(t,e="default"){try{const r=new Date(t),n=jp(r,"America/New_York"),i=jrt[e];return Ra(n,i,{timeZone:"America/New_York"})}catch(r){return console.error("Error formatting date:",ks(r)),"Invalid Date"}}const Ime=(t,e,r)=>!t||!e?"Pick a date":r?`${Ra(t,"MMM d")} - ${Ra(e,"MMM d")}`:`${Ra(t,"PPP")} - ${Ra(e,"PPP")}`,Lme=t=>t.risk!=null&&t.risk>0,$me=(t,e)=>e==="net"?t.net_pnl??t.pnl??0:t.pnl??t.net_pnl??0,oN=(t,e,r)=>{const n=$me(t,e);return r==="r"?Lme(t)?n/t.risk:null:n},lN=(t,e)=>e==="r"?t.filter(Lme):t,nC=(t,e,r=2)=>e==="usd"?Ke(t,r):fn(t,r),Nrt=t=>{const{stats:e,isLoading:r,hasTrades:n,onViewDetails:i,currency:s}=t,a=u=>nC(Math.abs(u),s),o=u=>`+${a(u)}`,c=u=>`-${a(u)}`;return l.jsxs("div",{className:"bg-app-card p-6 rounded-xl border border-app-border-color-soft 2k:p-12",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4 2k:mb-8",children:[l.jsx("h2",{className:"text-xl font-bold 2k:text-3xl",children:"Performance metrics"}),n&&l.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2 text-app-text-accent hover:text-app-text-accent/80 transition-colors group duration-300 ease-out text-sm 2k:text-xl",children:["View details",l.jsx(Jx,{size:14,className:"group-hover:translate-x-0.5 transition-transform duration-300 ease-out 2k:w-7 2k:h-7"})]})]}),r?l.jsx(GV,{}):l.jsxs("div",{className:"grid grid-cols-2 gap-6 2k:gap-12",children:[l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsxs("div",{className:"flex items-center gap-2 justify-start",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs bg-green-600"}),l.jsx("h3",{className:"text-base text-app-primary-foreground/80",children:"Winning trades"})]}),l.jsxs("div",{className:"space-y-6 2k:space-y-8",children:[l.jsx(on,{label:"Avg win",value:l.jsx("span",{className:"text-green-500",children:o(e.averageWin)}),icon:_s}),l.jsx(on,{label:"Avg hold time",value:e.averageWinHoldTime,icon:Is}),l.jsx(on,{label:"Largest win",value:e.largestWin.id?l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs(At,{to:`/app/trades/${e.largestWin.id}`,className:"group inline-flex items-center gap-2 cursor-pointer",children:[l.jsx("span",{className:"text-green-500",children:o(e.largestWin.value)}),l.jsx(Cs,{className:"size-3.5 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-all duration-300 shrink-0 text-app-primary-foreground/70 self-start"})]})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs",children:"View trade details"})})]}):l.jsx("div",{className:"inline-flex items-center gap-2",children:l.jsx("span",{className:"text-green-500",children:o(e.largestWin.value)})}),icon:_s})]})]}),l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsxs("div",{className:"flex items-center gap-2 justify-start",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs bg-red-600"}),l.jsx("h3",{className:"text-base text-app-primary-foreground/80",children:"Losing trades"})]}),l.jsxs("div",{className:"space-y-6 2k:space-y-8",children:[l.jsx(on,{label:"Avg loss",value:l.jsx("span",{className:"text-red-500",children:c(e.averageLoss)}),icon:Kl}),l.jsx(on,{label:"Avg hold time",value:e.averageLossHoldTime,icon:Is}),l.jsx(on,{label:"Largest loss",value:e.largestLoss.id?l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs(At,{to:`/app/trades/${e.largestLoss.id}`,className:"group inline-flex items-center gap-2 cursor-pointer",children:[l.jsx("span",{className:"text-red-500",children:c(e.largestLoss.value)}),l.jsx(Cs,{className:"size-3.5 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-all duration-300 shrink-0 text-app-primary-foreground/70 self-start"})]})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs",children:"View trade details"})})]}):l.jsx("div",{className:"inline-flex items-center gap-2",children:l.jsx("span",{className:"text-red-500",children:c(e.largestLoss.value)})}),icon:Kl})]})]}),l.jsxs("div",{className:"col-span-2 grid grid-cols-2 gap-6 border-t border-gray-800 pt-6 2k:gap-12 2k:pt-12",children:[l.jsx(on,{label:"Profit factor",value:l.jsx("span",{className:e.profitFactor>0?"text-green-500":"text-red-500",children:Dd(Math.abs(e.profitFactor),2)}),icon:e.profitFactor>0?_s:Kl}),l.jsx(on,{label:"Break-even trades",value:e.breakEvenTrades,icon:hk})]})]})]})};function qr(t){var e=t.width,r=t.height;if(e<0)throw new Error("Negative width is not allowed for Size");if(r<0)throw new Error("Negative height is not allowed for Size");return{width:e,height:r}}function rp(t,e){return t.width===e.width&&t.height===e.height}var Prt=(function(){function t(e){var r=this;this._resolutionListener=function(){return r._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return t.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(t.prototype,"value",{get:function(){return this._window.devicePixelRatio}
4209,enumerable:!1,configurable:!0}),t.prototype.subscribe=function(e){var r=this,n={next:e};return this._observers.push(n),{unsubscribe:function(){r._observers=r._observers.filter(function(i){return i!==n})}}},t.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(e,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},t.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},t.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},t.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(r){return r.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},t})();function Mrt(t){return new Prt(t)}var Art=(function(){function t(e,r,n){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=qr({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=r??(function(s){return s}),this._allowResizeObserver=(i=n?.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return t.prototype.dispose=function(){var e,r;if(this._canvasElement===null)throw new Error("Object is disposed");(e=this._canvasElementResizeObserver)===null||e===void 0||e.disconnect(),this._canvasElementResizeObserver=null,(r=this._devicePixelRatioObservable)===null||r===void 0||r.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(t.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bitmapSize",{get:function(){return qr({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),t.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=qr(e),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},t.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},t.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(r){return r!==e})},Object.defineProperty(t.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),t.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},t.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(r){return r!==e})},t.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},t.prototype._resizeBitmap=function(e){var r=this.bitmapSize;rp(r,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(r,e))},t.prototype._emitBitmapSizeChanged=function(e,r){var n=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(n,e,r)})},t.prototype._suggestNewBitmapSize=function(e){var r=this._suggestedBitmapSize,n=qr(this._transformBitmapSize(e,this._canvasElementClientSize)),i=rp(this.bitmapSize,n)?null:n;r===null&&i===null||r!==null&&i!==null&&rp(r,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(r,i))},t.prototype._emitSuggestedBitmapSizeChanged=function(e,r){var n=this;
4209this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(n,e,r)})},t.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}Ort().then(function(r){return r?e._initResizeObserver():e._initDevicePixelRatioObservable()})},t.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var r=lQ(this._canvasElement);if(r===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=Mrt(r),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},t.prototype._invalidateBitmapSize=function(){var e,r;if(this._canvasElement!==null){var n=lQ(this._canvasElement);if(n!==null){var i=(r=(e=this._devicePixelRatioObservable)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:n.devicePixelRatio,s=this._canvasElement.getClientRects(),a=s[0]!==void 0?Rrt(s[0],i):qr({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(a)}}},t.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(r){var n=r.find(function(a){return a.target===e._canvasElement});if(!(!n||!n.devicePixelContentBoxSize||!n.devicePixelContentBoxSize[0])){var i=n.devicePixelContentBoxSize[0],s=qr({width:i.inlineSize,height:i.blockSize});e._suggestNewBitmapSize(s)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},t})();function Drt(t,e){return new Art(t,e.transform,e.options)}function lQ(t){return t.ownerDocument.defaultView}function Ort(){return new Promise(function(t){var e=new ResizeObserver(function(r){t(r.every(function(n){return"devicePixelContentBoxSize"in n})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function Rrt(t,e){return qr({width:Math.round(t.left*e+t.width*e)-Math.round(t.left*e),height:Math.round(t.top*e+t.height*e)-Math.round(t.top*e)})}var Irt=(function(){function t(e,r,n){if(r.width===0||r.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=r,n.width===0||n.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=n,this._context=e}return t.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},t.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(t.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),t})();function Np(t,e){var r=t.canvasElementClientSize;if(r.width===0||r.height===0)return null;var n=t.bitmapSize;if(n.width===0||n.height===0)return null;var i=t.canvasElement.getContext("2d",e);return i===null?null:new Irt(i,r,n)}/*!
4210 * @license
4211 * TradingView Lightweight Charts™ v5.0.8
4212 * Copyright (c) 2025 TradingView, Inc.
4213 * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
4214 */const Fme={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var cQ,s5;function Pp(t,e){const r={0:[],1:[t.lineWidth,t.lineWidth],2:[2*t.lineWidth,2*t.lineWidth],3:[6*t.lineWidth,6*t.lineWidth],4:[t.lineWidth,4*t.lineWidth]}[e];t.setLineDash(r)}function zme(t,e,r,n){t.beginPath();const i=t.lineWidth%2?.5:0;t.moveTo(r,e+i),t.lineTo(n,e+i),t.stroke()}function Yi(t,e){if(!t)throw new Error("Assertion failed"+(e?": "+e:""))}function ha(t){if(t===void 0)throw new Error("Value is undefined");return t}function Fe(t){if(t===null)throw new Error("Value is null");return t}function Yd(t){return Fe(ha(t))}
4214(function(t){t[t.Simple=0]="Simple",t[t.WithSteps=1]="WithSteps",t[t.Curved=2]="Curved"})(cQ||(cQ={})),(function(t){t[t.Solid=0]="Solid",t[t.Dotted=1]="Dotted",t[t.Dashed=2]="Dashed",t[t.LargeDashed=3]="LargeDashed",t[t.SparseDotted=4]="SparseDotted"})(s5||(s5={}));let Xn=class{constructor(){this.t=[]}i(e,r,n){const i={h:e,l:r,o:n===!0};this.t.push(i)}_(e){const r=this.t.findIndex((n=>e===n.h));r>-1&&this.t.splice(r,1)}u(e){this.t=this.t.filter((r=>r.l!==e))}p(e,r,n){const i=[...this.t];this.t=this.t.filter((s=>!s.o)),i.forEach((s=>s.h(e,r,n)))}v(){return this.t.length>0}m(){this.t=[]}};function Fa(t,...e){for(const r of e)for(const n in r)r[n]!==void 0&&Object.prototype.hasOwnProperty.call(r,n)&&!["__proto__","constructor","prototype"].includes(n)&&(typeof r[n]!="object"||t[n]===void 0||Array.isArray(r[n])?t[n]=r[n]:Fa(t[n],r[n]));return t}function sy(t){return typeof t=="number"&&isFinite(t)}function Tb(t){return typeof t=="number"&&t%1==0}function l1(t){return typeof t=="string"}function xS(t){return typeof t=="boolean"}function ru(t){const e=t;if(!e||typeof e!="object")return e;let r,n,i;for(n in r=Array.isArray(e)?[]:{},e)e.hasOwnProperty(n)&&(i=e[n],r[n]=i&&typeof i=="object"?ru(i):i);return r}function Lrt(t){return t!==null}function Cb(t){return t===null?void 0:t}const Bme="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function iC(t,e,r){return e===void 0&&(e=Bme),`${r=r!==void 0?`${r} `:""}${t}px ${e}`}let $rt=class{constructor(e){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=e}N(){const e=this.M,r=this.F(),n=this.W();return e.P===r&&e.T===n||(e.P=r,e.T=n,e.k=iC(r,n),e.A=2.5/12*r,e.V=e.A,e.I=r/12*e.C,e.B=r/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}};function GA(t){return t<0?0:t>255?255:Math.round(t)||0}function uQ(t){return .199*t[0]+.687*t[1]+.114*t[2]}let Frt=class{constructor(e,r){this.q=new Map,this.Y=e,r&&(this.q=r)}j(e,r){if(e==="transparent")return e;const n=this.K(e),i=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${r*i})`}X(e){const r=this.K(e);return{Z:`rgb(${r[0]}, ${r[1]}, ${r[2]})`,G:uQ(r)>160?"black":"white"}}J(e){return uQ(this.K(e))}tt(e,r,n){const[i,s,a,o]=this.K(e),[c,u,d,f]=this.K(r),h=[GA(i+n*(c-i)),GA(s+n*(u-s)),GA(a+n*(d-a)),(m=o+n*(f-o),m<=0||m>1?Math.min(Math.max(m,0),1):Math.round(1e4*m)/1e4)];var m;return`rgba(${h[0]}, ${h[1]}, ${h[2]}, ${h[3]})`}K(e){const r=this.q.get(e);if(r)return r;const n=(function(a){const o=document.createElement("div");o.style.display="none",document.body.appendChild(o),o.style.color=a;const c=window.getComputedStyle(o).color;return document.body.removeChild(o),c})(e),i=n.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!i){if(this.Y.length)for(const a of this.Y){const o=a(e);if(o)return this.q.set(e,o),o}throw new Error(`Failed to parse color: ${e}`)}const s=[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),i[4]?parseFloat(i[4]):1];return this.q.set(e,s),s}},Vme=class{constructor(){this.it=[]}st(e){this.it=e}nt(e,r,n){this.it.forEach((i=>{i.nt(e,r,n)}))}};class Ju{nt(e,r,n){e.useBitmapCoordinateSpace((i=>this.et(i,r,n)))}}let zrt=class extends Ju{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:r,verticalPixelRatio:n}){if(this.rt===null||this.rt.lt===null)return;const i=this.rt.lt,s=this.rt,a=Math.max(1,Math.floor(r))%2/2,o=c=>{e.beginPath();for(let u=i.to-1;u>=i.from;--u){const d=s.ot[u],f=Math.round(d._t*r)+a,h=d.ut*n,m=c*n+a;e.moveTo(f,h),e.arc(f,h,m,0,2*Math.PI)}e.fill()};s.ct>0&&(e.fillStyle=s.dt,o(s.ft+s.ct)),e.fillStyle=s.vt,o(s.ft)}};function Brt(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const Vrt={from:0,to:1};let Urt=class{constructor(e,r,n){this.Mt=new Vme,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=r,this.Pt=n,this.Mt.st(this.bt)}kt(e){this.yt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Mt}yt(){const e=this.Pt.Dt();e.length!==this.bt.length&&(this.St=e.map(Brt),this.bt=this.St.map((r=>{const n=new zrt;return n.ht(r),n})),this.Mt.st(this.bt))}Rt(){const e=this.Ct.N().mode===2||!this.Ct.Vt(),r=this.Pt.It(),n=this.Ct.Bt(),i=this.O.Et();this.yt(),r.forEach(((s,a)=>{const o=this.St[a],c=s.At(n),u=s.zt();!e&&c!==null&&s.Vt()&&u!==null?(o.vt=c.Lt,o.ft=c.ft,o.ct=c.Ot,o.ot[0].gt=c.gt,o.ot[0].ut=s.Ft().Nt(c.gt,u.Wt),o.dt=c.Ht??this.O.Ut(o.ot[0].ut/s.Ft().$t()),o.ot[0].wt=n,o.ot[0]._t=i.qt(n),o.lt=Vrt):o.lt=null}))}};class Grt extends Ju{constructor(e){super(),this.Yt=e}et({context:e,bitmapSize:r,horizontalPixelRatio:n,verticalPixelRatio:i}){if(this.Yt===null)return;const s=this.Yt.jt.Vt,a=this.Yt.Kt.Vt;if(!s&&!a)return;const o=Math.round(this.Yt._t*n),c=Math.round(this.Yt.ut*i);e.lineCap="butt",s&&o>=0&&(e.lineWidth=Math.floor(this.Yt.jt.ct*n),e.strokeStyle=this.Yt.jt.R,e.fillStyle=this.Yt.jt.R,Pp(e,this.Yt.jt.Xt),(function(u,d,f,h){u.beginPath();const m=u.lineWidth%2?.5:0;u.moveTo(d+m,f),u.lineTo(d+m,h),u.stroke()})(e,o,0,r.height)),a&&c>=0&&(e.lineWidth=Math.floor(this.Yt.Kt.ct*i),e.strokeStyle=this.Yt.Kt.R,e.fillStyle=this.Yt.Kt.R,Pp(e,this.Yt.Kt.Xt),zme(e,c,0,r.width))}}class Wrt{constructor(e,r){this.xt=!0,this.Zt={jt:{ct:1,Xt:0,R:"",Vt:!1},Kt:{ct:1,Xt:0,R:"",Vt:!1},_t:0,ut:0},this.Gt=new Grt(this.Zt),this.Jt=e,this.Pt=r}kt(){this.xt=!0}Tt(e){return this.xt&&(this.Rt(),this.xt=!1),this.Gt}Rt(){const e=this.Jt.Vt(),r=this.Pt.Qt().N().crosshair,n=this.Zt;if(r.mode===2)return n.Kt.Vt=!1,void(n.jt.Vt=!1);n.Kt.Vt=e&&this.Jt.ti(this.Pt),n.jt.Vt=e&&this.Jt.ii(),n.Kt.ct=r.horzLine.width,n.Kt.Xt=r.horzLine.style,n.Kt.R=r.horzLine.color,n.jt.ct=r.vertLine.width,n.jt.Xt=r.vertLine.style,n.jt.R=r.vertLine.color,n._t=this.Jt.si(),n.ut=this.Jt.ni()}}function Hrt(t,e,r,n,i,s){t.fillRect(e+s,r,n-2*s,s),t.fillRect(e+s,r+i-s,n-2*s,s),t.fillRect(e,r,s,i),t.fillRect(e+n-s,r,s,i)}function cN(t,e,r,n,i,s){t.save(),t.globalCompositeOperation="copy",t.fillStyle=s,t.fillRect(e,r,n,i),t.restore(
vendor: 10,769 bytes, line 4214
4214)}function dQ(t,e,r,n,i,s){t.beginPath(),t.roundRect?t.roundRect(e,r,n,i,s):(t.lineTo(e+n-s[1],r),s[1]!==0&&t.arcTo(e+n,r,e+n,r+s[1],s[1]),t.lineTo(e+n,r+i-s[2]),s[2]!==0&&t.arcTo(e+n,r+i,e+n-s[2],r+i,s[2]),t.lineTo(e+s[3],r+i),s[3]!==0&&t.arcTo(e,r+i,e,r+i-s[3],s[3]),t.lineTo(e,r+s[0]),s[0]!==0&&t.arcTo(e,r,e+s[0],r,s[0]))}function fQ(t,e,r,n,i,s,a=0,o=[0,0,0,0],c=""){if(t.save(),!a||!c||c===s)return dQ(t,e,r,n,i,o),t.fillStyle=s,t.fill(),void t.restore();const u=a/2;var d;dQ(t,e+u,r+u,n-a,i-a,(d=-u,o.map((f=>f===0?f:f+d)))),s!=="transparent"&&(t.fillStyle=s,t.fill()),c!=="transparent"&&(t.lineWidth=a,t.strokeStyle=c,t.closePath(),t.stroke()),t.restore()}function Ume(t,e,r,n,i,s,a){t.save(),t.globalCompositeOperation="copy";const o=t.createLinearGradient(0,0,0,i);o.addColorStop(0,s),o.addColorStop(1,a),t.fillStyle=o,t.fillRect(e,r,n,i),t.restore()}let hQ=class{constructor(e,r){this.ht(e,r)}ht(e,r){this.Yt=e,this.ei=r}$t(e,r){return this.Yt.Vt?e.P+e.A+e.V:0}nt(e,r,n,i){if(!this.Yt.Vt||this.Yt.ri.length===0)return;const s=this.Yt.R,a=this.ei.Z,o=e.useBitmapCoordinateSpace((c=>{const u=c.context;u.font=r.k;const d=this.hi(c,r,n,i),f=d.ai;return d.li?fQ(u,f.oi,f._i,f.ui,f.ci,a,f.di,[f.ft,0,0,f.ft],a):fQ(u,f.fi,f._i,f.ui,f.ci,a,f.di,[0,f.ft,f.ft,0],a),this.Yt.pi&&(u.fillStyle=s,u.fillRect(f.fi,f.mi,f.wi-f.fi,f.gi)),this.Yt.Mi&&(u.fillStyle=r.D,u.fillRect(d.li?f.bi-f.di:0,f._i,f.di,f.Si-f._i)),d}));e.useMediaCoordinateSpace((({context:c})=>{const u=o.xi;c.font=r.k,c.textAlign=o.li?"right":"left",c.textBaseline="middle",c.fillStyle=s,c.fillText(this.Yt.ri,u.Ci,(u._i+u.Si)/2+u.Pi)}))}hi(e,r,n,i){const{context:s,bitmapSize:a,mediaSize:o,horizontalPixelRatio:c,verticalPixelRatio:u}=e,d=this.Yt.pi||!this.Yt.ki?r.C:0,f=this.Yt.yi?r.S:0,h=r.A+this.ei.Ti,m=r.V+this.ei.Ri,y=r.I,x=r.B,v=this.Yt.ri,_=r.P,S=n.Di(s,v),k=Math.ceil(n.Vi(s,v)),E=_+h+m,T=r.S+y+x+k+d,N=Math.max(1,Math.floor(u));let j=Math.round(E*u);j%2!=N%2&&(j+=1);const M=f>0?Math.max(1,Math.floor(f*c)):0,O=Math.round(T*c),R=Math.round(d*c),I=this.ei.Ii??this.ei.Bi,B=Math.round(I*u)-Math.floor(.5*u),F=Math.floor(B+N/2-j/2),V=F+j,$=i==="right",U=$?o.width-f:f,z=$?a.width-M:M;let L,W,K;return $?(L=z-O,W=z-R,K=U-d-y-f):(L=z+O,W=z+R,K=U+d+y),{li:$,ai:{_i:F,mi:B,Si:V,ui:O,ci:j,ft:2*c,di:M,oi:L,fi:z,wi:W,gi:N,bi:a.width},xi:{_i:F/u,Si:V/u,Ci:K,Pi:S}}}},uN=class{constructor(e){this.Ei={Bi:0,Z:"#000",Ri:0,Ti:0},this.Ai={ri:"",Vt:!1,pi:!0,ki:!1,Ht:"",R:"#FFF",Mi:!1,yi:!1},this.zi={ri:"",Vt:!1,pi:!1,ki:!0,Ht:"",R:"#FFF",Mi:!0,yi:!0},this.xt=!0,this.Li=new(e||hQ)(this.Ai,this.Ei),this.Oi=new(e||hQ)(this.zi,this.Ei)}ri(){return this.Ni(),this.Ai.ri}Bi(){return this.Ni(),this.Ei.Bi}kt(){this.xt=!0}$t(e,r=!1){return Math.max(this.Li.$t(e,r),this.Oi.$t(e,r))}Fi(){return this.Ei.Ii||0}Wi(e){this.Ei.Ii=e}Hi(){return this.Ni(),this.Ai.Vt||this.zi.Vt}Ui(){return this.Ni(),this.Ai.Vt}Tt(e){return this.Ni(),this.Ai.pi=this.Ai.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Li.ht(this.Ai,this.Ei),this.Oi.ht(this.zi,this.Ei),this.Li}$i(){return this.Ni(),this.Li.ht(this.Ai,this.Ei),this.Oi.ht(this.zi,this.Ei),this.Oi}Ni(){this.xt&&(this.Ai.pi=!0,this.zi.pi=!1,this.qi(this.Ai,this.zi,this.Ei))}},qrt=class extends uN{constructor(e,r,n){super(),this.Jt=e,this.Yi=r,this.ji=n}qi(e,r,n){if(e.Vt=!1,this.Jt.N().mode===2)return;const i=this.Jt.N().horzLine;if(!i.labelVisible)return;const s=this.Yi.zt();if(!this.Jt.Vt()||this.Yi.Ki()||s===null)return;const a=this.Yi.Xi().X(i.labelBackgroundColor);n.Z=a.Z,e.R=a.G;const o=2/12*this.Yi.P();n.Ti=o,n.Ri=o;const c=this.ji(this.Yi);n.Bi=c.Bi,e.ri=this.Yi.Zi(c.gt,s),e.Vt=!0}};const Yrt=/[1-9]/g;let Gme=class{constructor(){this.Yt=null}ht(e){this.Yt=e}nt(e,r){if(this.Yt===null||this.Yt.Vt===!1||this.Yt.ri.length===0)return;const n=e.useMediaCoordinateSpace((({context:h})=>(h.font=r.k,Math.round(r.Gi.Vi(h,Fe(this.Yt).ri,Yrt)))));if(n<=0)return;const i=r.Ji,s=n+2*i,a=s/2,o=this.Yt.Qi;let c=this.Yt.Bi,u=Math.floor(c-a)+.5;u<0?(c+=Math.abs(0-u),u=Math.floor(c-a)+.5):u+s>o&&(c-=Math.abs(o-(u+s)),u=Math.floor(c-a)+.5);const d=u+s,f=Math.ceil(0+r.S+r.C+r.A+r.P+r.V);e.useBitmapCoordinateSpace((({context:h,horizontalPixelRatio:m,verticalPixelRatio:y})=>{const x=Fe(this.Yt);h.fillStyle=x.Z;const v=Math.round(u*m),_=Math.round(0*y),S=Math.round(d*m),k=Math.round(f*y),E=Math.round(2*m);if(h.beginPath(),h.moveTo(v,_),h.lineTo(v,k-E),h.arcTo(v,k,v+E,k,E),h.lineTo(S-E,k),h.arcTo(S,k,S,k-E,E),h.lineTo(S,_),h.fill(),x.pi){const T=Math.round(x.Bi*m),N=_,j=Math.round((N+r.C)*y);h.fillStyle=x.R;const M=Math.max(1,Math.floor(m)),O=Math.floor(.5*m);h.fillRect(T-O,N,M,j-N)}})),e.useMediaCoordinateSpace((({context:h})=>{const m=Fe(this.Yt),y=0+r.S+r.C+r.A+r.P/2;h.font=r.k,h.textAlign="left",h.textBaseline="middle",h.fillStyle=m.R;const x=r.Gi.Di(h,"Apr0");h.translate(u+i,y+x),h.fillText(m.ri,0,0)}))}},Krt=class{constructor(e,r,n){this.xt=!0,this.Gt=new Gme,this.Zt={Vt:!1,Z:"#4c525e",R:"white",ri:"",Qi:0,Bi:NaN,pi:!0},this.Ct=e,this.ts=r,this.ji=n}kt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Gt.ht(this.Zt),this.Gt}Rt(){const e=this.Zt;if(e.Vt=!1,this.Ct.N().mode===2)return;const r=this.Ct.N().vertLine;if(!r.labelVisible)return;const n=this.ts.Et();if(n.Ki())return;e.Qi=n.Qi();const i=this.ji();if(i===null)return;e.Bi=i.Bi;const s=n.ss(this.Ct.Bt());e.ri=n.ns(Fe(s)),e.Vt=!0;const a=this.ts.Xi().X(r.labelBackgroundColor);e.Z=a.Z,e.R=a.G,e.pi=n.N().ticksVisible}};class Wme{constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(e){this.rs=e}Ft(){return this.es}_s(e){this.es=e}us(e){return[]}cs(){return[]}Vt(){return!0}}var a5;(function(t){t[t.Normal=0]="Normal",t[t.Magnet=1]="Magnet",t[t.Hidden=2]="Hidden",t[t.MagnetOHLC=3]="MagnetOHLC"})(a5||(a5={}));let Qrt=class extends Wme{constructor(e,r){super(),this.Pt=null,this.ds=NaN,this.fs=0,this.ps=!1,this.vs=new Map,this.ws=!1,this.gs=new WeakMap,this.Ms=new WeakMap,this.bs=NaN,this.Ss=NaN,this.xs=NaN,this.Cs=NaN,this.ts=e,this.Ps=r,this.ks=((i,s)=>a=>{const o=s(),c=i();if(a===Fe(this.Pt).ys())return{gt:c,Bi:o};{const u=Fe(a.zt());return{gt:a.Ts(o,u),Bi:o}}})((()=>this.ds),(()=>this.Ss));const n=((i,s)=>()=>{const a=this.ts.Et().Rs(i()),o=s();return a&&Number.isFinite(o)?{wt:a,Bi:o}:null})((()=>this.fs),(()=>this.si()));this.Ds=new Krt(this,e,n)}N(){return this.Ps}Vs(e,r){this.xs=e,this.Cs=r}Is(){this.xs=NaN,this.Cs=NaN}Bs(){return this.xs}Es(){return this.Cs}As(e,r,n){this.ws||(this.ws=!0),this.ps=!0,this.zs(e,r,n)}Bt(){return this.fs}si(){return this.bs}ni(){return this.Ss}Vt(){return this.ps}Ls(){this.ps=!1,this.Os(),this.ds=NaN,this.bs=NaN,this.Ss=NaN,this.Pt=null,this.Is(),this.Ns()}Fs(e){let r=this.gs.get(e);r||(r=new Wrt(this,e),this.gs.set(e,r));let n=this.Ms.get(e);return n||(n=new Urt(this.ts,this,e),this.Ms.set(e,n)),[r,n]}ti(e){return e===this.Pt&&this.Ps.horzLine.visible}ii(){return this.Ps.vertLine.visible}Ws(e,r){this.ps&&this.Pt===e||this.vs.clear();const n=[];return this.Pt===e&&n.push(this.Hs(this.vs,r,this.ks)),n}cs(){return this.ps?[this.Ds]:[]}Us(){return this.Pt}Ns(){this.ts.$s().forEach((e=>{this.gs.get(e)?.kt(),this.Ms.get(e)?.kt()})),this.vs.forEach((e=>e.kt())),this.Ds.kt()}qs(e){return e&&!e.ys().Ki()?e.ys():null}zs(e,r,n){this.Ys(e,r,n)&&this.Ns()}Ys(e,r,n){const i=this.bs,s=this.Ss,a=this.ds,o=this.fs,c=this.Pt,u=this.qs(n);this.fs=e,this.bs=isNaN(e)?NaN:this.ts.Et().qt(e),this.Pt=n;const d=u!==null?u.zt():null;return u!==null&&d!==null?(this.ds=r,this.Ss=u.Nt(r,d)):(this.ds=NaN,this.Ss=NaN),i!==this.bs||s!==this.Ss||o!==this.fs||a!==this.ds||c!==this.Pt}Os(){const e=this.ts.js().map((n=>n.Xs().Ks())).filter(Lrt),r=e.length===0?null:Math.max(...e);this.fs=r!==null?r:NaN}Hs(e,r,n){let i=e.get(r);return i===void 0&&(i=new qrt(this,r,n),e.set(r,i)),i}};function dN(t){return t==="left"||t==="right"}let ta=class o5{constructor(e){this.Zs=new Map,this.Gs=[],this.Js=e}Qs(e,r){const n=(function(i,s){return i===void 0?s:{tn:Math.max(i.tn,s.tn),sn:i.sn||s.sn}})(this.Zs.get(e),r);this.Zs.set(e,n)}nn(){return this.Js}en(e){const r=this.Zs.get(e);return r===void 0?{tn:this.Js}:{tn:Math.max(this.Js,r.tn),sn:r.sn}}rn(){this.hn(),this.Gs=[{an:0}]}ln(e){this.hn(),this.Gs=[{an:1,Wt:e}]}_n(e){this.un(),this.Gs.push({an:5,Wt:e})}hn(){this.un(),this.Gs.push({an:6})}cn(){this.hn(),this.Gs=[{an:4}]}dn(e){this.hn(),this.Gs.push({an:2,Wt:e})}fn(e){this.hn(),this.Gs.push({an:3,Wt:e})}pn(){return this.Gs}vn(e){for(const r of e.Gs)this.mn(r);this.Js=Math.max(this.Js,e.Js),e.Zs.forEach(((r,n)=>{this.Qs(n,r)}))}static wn(){return new o5(2)}static gn(){return new o5(3)}mn(e){switch(e.an){case 0:this.rn();break;case 1:this.ln(e.Wt);break;case 2:this.dn(e.Wt);break;case 3:this.fn(e.Wt);break;case 4:this.cn();break;case 5:this._n(e.Wt);break;case 6:this.un()}}un(){const e=this.Gs.findIndex((r=>r.an===5));e!==-1&&this.Gs.splice(e,1)}},Hme=class{formatTickmarks(e){return e.map((r=>this.format(r)))}};const pQ=".";function nu(t,e){if(!sy(t))return"n/a";if(!Tb(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return e===0?t.toString():("0000000000000000"+t.toString()).slice(-e)}class fN extends Hme{constructor(e,r){if(super(),r||(r=1),sy(e)&&Tb(e)||(e=100),e<0)throw new TypeError("invalid base");this.Yi=e,this.Mn=r,this.bn()}format(e){const r=e<0?"−":"";return e=Math.abs(e),r+this.Sn(e)}bn(){if(this.xn=0,this.Yi>0&&this.Mn>0){let e=this.Yi;for(;e>1;)e/=10,this.xn++}}Sn(e){const r=this.Yi/this.Mn;let n=Math.floor(e),i="";const s=this.xn!==void 0?this.xn:NaN;if(r>1){let a=+(Math.round(e*r)-n*r).toFixed(this.xn);a>=r&&(a-=r,n+=1),i=pQ+nu(+a.toFixed(this.xn)*this.Mn,s)}else n=Math.round(n*r)/r,s>0&&(i=pQ+nu(0,s));return n.toFixed(0)+i}}class qme extends fN{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class Zrt extends Hme{constructor(e){super(),this.Cn=e}format(e){let r="";return e<0&&(r="-",e=-e),e<995?r+this.Pn(e):e<999995?r+this.Pn(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),r+this.Pn(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),r+this.Pn(e/1e9)+"B")}Pn(e){let r;const n=Math.pow(10,this.Cn);return r=(e=Math.round(e*n)/n)>=1e-15&&e<1?e.toFixed(this.Cn).replace(/\.?0+$/,""):String(e),r.replace(/(\.[1-9]*)0+$/,((i,s)=>s))}}const Xrt=/[2-9]/g;class sC{constructor(e=50){this.kn=0,this.yn=1,this.Tn=1,this.Rn={},this.Dn=new Map,this.Vn=e}In(){this.kn=0,this.Dn.clear(),this.yn=1,this.Tn=1,this.Rn={}}Vi(e,r,n){return this.Bn(e,r,n).width}Di(e,r,n){const i=this.Bn(e,r,n);return((i.actualBoundingBoxAscent||0)-(i.actualBoundingBoxDescent||0))/2}Bn(e,r,n){const i=n||Xrt,s=String(r).replace(i,"0");if(this.Dn.has(s))return ha(this.Dn.get(s)).En;if(this.kn===this.Vn){const o=this.Rn[this.Tn];delete this.Rn[this.Tn],this.Dn.delete(o),this.Tn++,this.kn--}e.save(),e.textBaseline="middle";const a=e.measureText(s);
4214return e.restore(),a.width===0&&r.length||(this.Dn.set(s,{En:a,An:this.yn}),this.Rn[this.yn]=s,this.kn++,this.yn++),a}}class Jrt{constructor(e){this.zn=null,this.M=null,this.Ln="right",this.On=e}Nn(e,r,n){this.zn=e,this.M=r,this.Ln=n}nt(e){this.M!==null&&this.zn!==null&&this.zn.nt(e,this.M,this.On,this.Ln)}}class Yme{constructor(e,r,n){this.Fn=e,this.On=new sC(50),this.Wn=r,this.O=n,this.F=-1,this.Gt=new Jrt(this.On)}Tt(){const e=this.O.Hn(this.Wn);if(e===null)return null;const r=e.Un(this.Wn)?e.$n():this.Wn.Ft();if(r===null)return null;const n=e.qn(r);if(n==="overlay")return null;const i=this.O.Yn();return i.P!==this.F&&(this.F=i.P,this.On.In()),this.Gt.Nn(this.Fn.$i(),i,n),this.Gt}}class ent extends Ju{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}jn(e,r){if(!this.Yt?.Vt)return null;const{ut:n,ct:i,Kn:s}=this.Yt;return r>=n-i-7&&r<=n+i+7?{Xn:this.Yt,Kn:s}:null}et({context:e,bitmapSize:r,horizontalPixelRatio:n,verticalPixelRatio:i}){if(this.Yt===null||this.Yt.Vt===!1)return;const s=Math.round(this.Yt.ut*i);s<0||s>r.height||(e.lineCap="butt",e.strokeStyle=this.Yt.R,e.lineWidth=Math.floor(this.Yt.ct*n),Pp(e,this.Yt.Xt),zme(e,s,0,r.width))}}class HV{constructor(e){this.Zn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Xt:0,Vt:!1},this.Gn=new ent,this.xt=!0,this.Jn=e,this.Qn=e.Qt(),this.Gn.ht(this.Zn)}kt(){this.xt=!0}Tt(){return this.Jn.Vt()?(this.xt&&(this.te(),this.xt=!1),this.Gn):null}}class tnt extends HV{constructor(e){super(e)}te(){this.Zn.Vt=!1;const e=this.Jn.Ft(),r=e.ie().ie;if(r!==2&&r!==3)return;const n=this.Jn.N();if(!n.baseLineVisible||!this.Jn.Vt())return;const i=this.Jn.zt();i!==null&&(this.Zn.Vt=!0,this.Zn.ut=e.Nt(i.Wt,i.Wt),this.Zn.R=n.baseLineColor,this.Zn.ct=n.baseLineWidth,this.Zn.Xt=n.baseLineStyle)}}class rnt extends Ju{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}se(){return this.Yt}et({context:e,horizontalPixelRatio:r,verticalPixelRatio:n}){const i=this.Yt;if(i===null)return;const s=Math.max(1,Math.floor(r)),a=s%2/2,o=Math.round(i.ne.x*r)+a,c=i.ne.y*n;e.fillStyle=i.ee,e.beginPath();const u=Math.max(2,1.5*i.re)*r;e.arc(o,c,u,0,2*Math.PI,!1),e.fill(),e.fillStyle=i.he,e.beginPath(),e.arc(o,c,i.ft*r,0,2*Math.PI,!1),e.fill(),e.lineWidth=s,e.strokeStyle=i.ae,e.beginPath(),e.arc(o,c,i.ft*r+s/2,0,2*Math.PI,!1),e.stroke()}}const nnt=[{le:0,oe:.25,_e:4,ue:10,ce:.25,de:0,fe:.4,pe:.8},{le:.25,oe:.525,_e:10,ue:14,ce:0,de:0,fe:.8,pe:0},{le:.525,oe:1,_e:14,ue:14,ce:0,de:0,fe:0,pe:0}];class int{constructor(e){this.Gt=new rnt,this.xt=!0,this.ve=!0,this.me=performance.now(),this.we=this.me-1,this.ge=e}Me(){this.we=this.me-1,this.kt()}be(){if(this.kt(),this.ge.N().lastPriceAnimation===2){const e=performance.now(),r=this.we-e;if(r>0)return void(r<650&&(this.we+=2600));this.me=e,this.we=e+2600}}kt(){this.xt=!0}Se(){this.ve=!0}Vt(){return this.ge.N().lastPriceAnimation!==0}xe(){switch(this.ge.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.we}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ve=!1):this.ve&&(this.Ce(),this.ve=!1),this.Gt}Rt(){this.Gt.ht(null);const e=this.ge.Qt().Et(),r=e.Pe(),n=this.ge.zt();if(r===null||n===null)return;const i=this.ge.ke(!0);if(i.ye||!r.Te(i.Re))return;const s={x:e.qt(i.Re),y:this.ge.Ft().Nt(i.gt,n.Wt)},a=i.R,o=this.ge.N().lineWidth,c=this.De(this.Ve(),a);this.Gt.ht({ee:a,re:o,he:c.he,ae:c.ae,ft:c.ft,ne:s})}Ce(){const e=this.Gt.se();if(e!==null){const r=this.De(this.Ve(),e.ee);e.he=r.he,e.ae=r.ae,e.ft=r.ft}}Ve(){return this.xe()?performance.now()-this.me:2599}Ie(e,r,n,i){const s=n+(i-n)*r;return this.ge.Qt().Xi().j(e,s)}De(e,r){const n=e%2600/2600;let i;for(const u of nnt)if(n>=u.le&&n<=u.oe){i=u;break}Yi(i!==void 0,"Last price animation internal logic error");const s=(n-i.le)/(i.oe-i.le);return{he:this.Ie(r,s,i.ce,i.de),ae:this.Ie(r,s,i.fe,i.pe),ft:(a=s,o=i._e,c=i.ue,o+(c-o)*a)};var a,o,c}}class snt extends HV{constructor(e){super(e)}te(){const e=this.Zn;e.Vt=!1;const r=this.Jn.N();if(!r.priceLineVisible||!this.Jn.Vt())return;const n=this.Jn.ke(r.priceLineSource===0);n.ye||(e.Vt=!0,e.ut=n.Bi,e.R=this.Jn.Be(n.R),e.ct=r.priceLineWidth,e.Xt=r.priceLineStyle)}
4214}class ant extends uN{constructor(e){super(),this.Jt=e}qi(e,r,n){e.Vt=!1,r.Vt=!1;const i=this.Jt;if(!i.Vt())return;const s=i.N(),a=s.lastValueVisible,o=i.Ee()!=="",c=s.seriesLastValueMode===0,u=i.ke(!1);if(u.ye)return;a&&(e.ri=this.Ae(u,a,c),e.Vt=e.ri.length!==0),(o||c)&&(r.ri=this.ze(u,a,o,c),r.Vt=r.ri.length>0);const d=i.Be(u.R),f=this.Jt.Qt().Xi().X(d);n.Z=f.Z,n.Bi=u.Bi,r.Ht=i.Qt().Ut(u.Bi/i.Ft().$t()),e.Ht=d,e.R=f.G,r.R=f.G}ze(e,r,n,i){let s="";const a=this.Jt.Ee();return n&&a.length!==0&&(s+=`${a} `),r&&i&&(s+=this.Jt.Ft().Le()?e.Oe:e.Ne),s.trim()}Ae(e,r,n){return r?n?this.Jt.Ft().Le()?e.Ne:e.Oe:e.ri:""}}function mQ(t,e,r,n){const i=Number.isFinite(e),s=Number.isFinite(r);return i&&s?t(e,r):i||s?i?e:r:n}class zs{constructor(e,r){this.Fe=e,this.We=r}He(e){return e!==null&&this.Fe===e.Fe&&this.We===e.We}Ue(){return new zs(this.Fe,this.We)}$e(){return this.Fe}qe(){return this.We}Ye(){return this.We-this.Fe}Ki(){return this.We===this.Fe||Number.isNaN(this.We)||Number.isNaN(this.Fe)}vn(e){return e===null?this:new zs(mQ(Math.min,this.$e(),e.$e(),-1/0),mQ(Math.max,this.qe(),e.qe(),1/0))}je(e){if(!sy(e)||this.We-this.Fe===0)return;const r=.5*(this.We+this.Fe);let n=this.We-r,i=this.Fe-r;n*=e,i*=e,this.We=r+n,this.Fe=r+i}Ke(e){sy(e)&&(this.We+=e,this.Fe+=e)}Xe(){return{minValue:this.Fe,maxValue:this.We}}static Ze(e){return e===null?null:new zs(e.minValue,e.maxValue)}}class aC{constructor(e,r){this.Ge=e,this.Je=r||null}Qe(){return this.Ge}tr(){return this.Je}Xe(){return{priceRange:this.Ge===null?null:this.Ge.Xe(),margins:this.Je||void 0}}static Ze(e){return e===null?null:new aC(zs.Ze(e.priceRange),e.margins)}}class ont extends HV{constructor(e,r){super(e),this.ir=r}te(){const e=this.Zn;e.Vt=!1;const r=this.ir.N();if(!this.Jn.Vt()||!r.lineVisible)return;const n=this.ir.sr();n!==null&&(e.Vt=!0,e.ut=n,e.R=r.color,e.ct=r.lineWidth,e.Xt=r.lineStyle,e.Kn=this.ir.N().id)}}class lnt extends uN{constructor(e,r){super(),this.ge=e,this.ir=r}qi(e,r,n){e.Vt=!1,r.Vt=!1;const i=this.ir.N(),s=i.axisLabelVisible,a=i.title!=="",o=this.ge;if(!s||!o.Vt())return;const c=this.ir.sr();if(c===null)return;a&&(r.ri=i.title,r.Vt=!0),r.Ht=o.Qt().Ut(c/o.Ft().$t()),e.ri=this.nr(i.price),e.Vt=!0;const u=this.ge.Qt().Xi().X(i.axisLabelColor||i.color);n.Z=u.Z;const d=i.axisLabelTextColor||u.G;e.R=d,r.R=d,n.Bi=c}nr(e){const r=this.ge.zt();return r===null?"":this.ge.Ft().Zi(e,r.Wt)}}class cnt{constructor(e,r){this.ge=e,this.Ps=r,this.er=new ont(e,this),this.Fn=new lnt(e,this),this.rr=new Yme(this.Fn,e,e.Qt())}hr(e){Fa(this.Ps,e),this.kt(),this.ge.Qt().ar()}N(){return this.Ps}lr(){return this.er}_r(){return this.rr}ur(){return this.Fn}kt(){this.er.kt(),this.Fn.kt()}sr(){const e=this.ge,r=e.Ft();if(e.Qt().Et().Ki()||r.Ki())return null;const n=e.zt();return n===null?null:r.Nt(this.Ps.price,n.Wt)}}class unt extends Wme{constructor(e){super(),this.ts=e}Qt(){return this.ts}}const dnt={Bar:(t,e,r,n)=>{const i=e.upColor,s=e.downColor,a=Fe(t(r,n)),o=Yd(a.Wt[0])<=Yd(a.Wt[3]);return{cr:a.R??(o?i:s)}},Candlestick:(t,e,r,n)=>{const i=e.upColor,s=e.downColor,a=e.borderUpColor,o=e.borderDownColor,c=e.wickUpColor,u=e.wickDownColor,d=Fe(t(r,n)),f=Yd(d.Wt[0])<=Yd(d.Wt[3]);return{cr:d.R??(f?i:s),dr:d.Ht??(f?a:o),pr:d.vr??(f?c:u)}},Custom:(t,e,r,n)=>({cr:Fe(t(r,n)).R??e.color}),Area:(t,e,r,n)=>{const i=Fe(t(r,n));return{cr:i.vt??e.lineColor,vt:i.vt??e.lineColor,mr:i.mr??e.topColor,wr:i.wr??e.bottomColor}},Baseline:(t,e,r,n)=>{const i=Fe(t(r,n));return{cr:i.Wt[3]>=e.baseValue.price?e.topLineColor:e.bottomLineColor,gr:i.gr??e.topLineColor,Mr:i.Mr??e.bottomLineColor,br:i.br??e.topFillColor1,Sr:i.Sr??e.topFillColor2,Cr:i.Cr??e.bottomFillColor1,Pr:i.Pr??e.bottomFillColor2}},Line:(t,e,r,n)=>{const i=Fe(t(r,n));return{cr:i.R??e.color,vt:i.R??e.color}},Histogram:(t,e,r,n)=>({cr:Fe(t(r,n)).R??e.color})};class fnt{constructor(e){this.kr=(r,n)=>n!==void 0?n.Wt:this.ge.Xs().yr(r),this.ge=e,this.Tr=dnt[e.Rr()]}Dr(e,r){return this.Tr(this.kr,this.ge.N(),e,r)}}function Kme(t,e,r,n,i=0,s=e.length){let a=s-i;for(;0<a;){const o=a>>1,c=i+o;n(e[c],r)===t?(i=c+1,a-=o+1):a=o}return i}const ay=Kme.bind(null,!0),Qme=Kme.bind(null,!1);var gQ;(function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.None=0]="None",t[t.NearestRight=1]="NearestRight"})(gQ||(gQ={}));const Td=30;class hnt{constructor(){this.Vr=[],this.Ir=new Map,this.Br=new Map,this.Er=[]}Ar(){return this.zr()>0?this.Vr[this.Vr.length-1]:null}Lr(){return this.zr()>0?this.Or(0):null}Ks(){return this.zr()>0?this.Or(this.Vr.length-1):null}zr(){return this.Vr.length}Ki(){return this.zr()===0}Te(e){return this.Nr(e,0)!==null}yr(e){return this.Fr(e)}Fr(e,r=0){const n=this.Nr(e,r);return n===null?null:{...this.Wr(n),Re:this.Or(n)}}Hr(){return this.Vr}Ur(e,r,n){if(this.Ki())return null;let i=null;for(const s of n)i=bS(i,this.$r(e,r,s));return i}ht(e){this.Br.clear(),this.Ir.clear(),this.Vr=e,this.Er=e.map((r=>r.Re))}qr(){return this.Er}Or(e){return this.Vr[e].Re}Wr(e){return this.Vr[e]}Nr(e,r){const n=this.Yr(e);if(n===null&&r!==0)switch(r){case-1:return this.jr(e);case 1:return this.Kr(e);default:throw new TypeError("Unknown search mode")}return n}jr(e){let r=this.Xr(e);return r>0&&(r-=1),r!==this.Vr.length&&this.Or(r)<e?r:null}Kr(e){const r=this.Zr(e);return r!==this.Vr.length&&e<this.Or(r)?r:null}Yr(e){const r=this.Xr(e);return r===this.Vr.length||e<this.Vr[r].Re?null:r}Xr(e){return ay(this.Vr,e,((r,n)=>r.Re<n))}Zr(e){return Qme(this.Vr,e,((r,n)=>r.Re>n))}Gr(e,r,n){let i=null;for(let s=e;s<r;s++){const a=this.Vr[s].Wt[n];
4214Number.isNaN(a)||(i===null?i={Jr:a,Qr:a}:(a<i.Jr&&(i.Jr=a),a>i.Qr&&(i.Qr=a)))}return i}$r(e,r,n){if(this.Ki())return null;let i=null;const s=Fe(this.Lr()),a=Fe(this.Ks()),o=Math.max(e,s),c=Math.min(r,a),u=Math.ceil(o/Td)*Td,d=Math.max(u,Math.floor(c/Td)*Td);{const h=this.Xr(o),m=this.Zr(Math.min(c,u,r));i=bS(i,this.Gr(h,m,n))}let f=this.Ir.get(n);f===void 0&&(f=new Map,this.Ir.set(n,f));for(let h=Math.max(u+1,o);h<d;h+=Td){const m=Math.floor(h/Td);let y=f.get(m);if(y===void 0){const x=this.Xr(m*Td),v=this.Zr((m+1)*Td-1);y=this.Gr(x,v,n),f.set(m,y)}i=bS(i,y)}{const h=this.Xr(d),m=this.Zr(c);i=bS(i,this.Gr(h,m,n))}return i}}function bS(t,e){return t===null?e:e===null?t:{Jr:Math.min(t.Jr,e.Jr),Qr:Math.max(t.Qr,e.Qr)}}class pnt{constructor(e){this.th=e}nt(e,r,n){this.th.draw(e)}ih(e,r,n){this.th.drawBackground?.(e)}}class mnt{constructor(e){this.Dn=null,this.sh=e}Tt(){const e=this.sh.renderer();if(e===null)return null;if(this.Dn?.nh===e)return this.Dn.eh;const r=new pnt(e);return this.Dn={nh:e,eh:r},r}rh(){return this.sh.zOrder?.()??"normal"}}class Zme{constructor(e){this.hh=null,this.ah=e}oh(){return this.ah}Ns(){this.ah.updateAllViews?.()}Fs(){const e=this.ah.paneViews?.()??[];if(this.hh?.nh===e)return this.hh.eh;const r=e.map((n=>new mnt(n)));return this.hh={nh:e,eh:r},r}jn(e,r){return this.ah.hitTest?.(e,r)??null}}let gnt=class extends Zme{us(){return[]}};class ynt{constructor(e){this.th=e}nt(e,r,n){this.th.draw(e)}ih(e,r,n){this.th.drawBackground?.(e)}}class yQ{constructor(e){this.Dn=null,this.sh=e}Tt(){const e=this.sh.renderer();if(e===null)return null;if(this.Dn?.nh===e)return this.Dn.eh;const r=new ynt(e);return this.Dn={nh:e,eh:r},r}rh(){return this.sh.zOrder?.()??"normal"}}function Xme(t){return{ri:t.text(),Bi:t.coordinate(),Ii:t.fixedCoordinate?.(),R:t.textColor(),Z:t.backColor(),Vt:t.visible?.()??!0,pi:t.tickVisible?.()??!0}}class vnt{constructor(e,r){this.Gt=new Gme,this._h=e,this.uh=r}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...Xme(this._h)}),this.Gt}}class xnt extends uN{constructor(e,r){super(),this._h=e,this.Yi=r}qi(e,r,n){const i=Xme(this._h);n.Z=i.Z,e.R=i.R;const s=2/12*this.Yi.P();n.Ti=s,n.Ri=s,n.Bi=i.Bi,n.Ii=i.Ii,e.ri=i.ri,e.Vt=i.Vt,e.pi=i.pi}}class bnt extends Zme{constructor(e,r){super(e),this.dh=null,this.fh=null,this.ph=null,this.mh=null,this.ge=r}cs(){const e=this.ah.timeAxisViews?.()??[];if(this.dh?.nh===e)return this.dh.eh;const r=this.ge.Qt().Et(),n=e.map((i=>new vnt(i,r)));return this.dh={nh:e,eh:n},n}Ws(){const e=this.ah.priceAxisViews?.()??[];if(this.fh?.nh===e)return this.fh.eh;const r=this.ge.Ft(),n=e.map((i=>new xnt(i,r)));return this.fh={nh:e,eh:n},n}wh(){const e=this.ah.priceAxisPaneViews?.()??[];if(this.ph?.nh===e)return this.ph.eh;const r=e.map((n=>new yQ(n)));return this.ph={nh:e,eh:r},r}gh(){const e=this.ah.timeAxisPaneViews?.()??[];if(this.mh?.nh===e)return this.mh.eh;const r=e.map((n=>new yQ(n)));return this.mh={nh:e,eh:r},r}Mh(e,r){return this.ah.autoscaleInfo?.(e,r)??null}}function WA(t,e,r,n){t.forEach((i=>{e(i).forEach((s=>{s.rh()===r&&n.push(s)}))}))}function HA(t){return t.Fs()}function wnt(t){return t.wh()}function _nt(t){return t.gh()}const Snt=["Area","Line","Baseline"];class hN extends unt{constructor(e,r,n,i,s){super(e),this.Yt=new hnt,this.er=new snt(this),this.bh=[],this.Sh=new tnt(this),this.xh=null,this.Ch=null,this.Ph=null,this.kh=[],this.Ps=n,this.yh=r;const a=new ant(this);this.vs=[a],this.rr=new Yme(a,this,e),Snt.includes(this.yh)&&(this.xh=new int(this)),this.Th(),this.sh=i(this,this.Qt(),s)}m(){this.Ph!==null&&clearTimeout(this.Ph)}Be(e){return this.Ps.priceLineColor||e}ke(e){const r={ye:!0},n=this.Ft();if(this.Qt().Et().Ki()||n.Ki()||this.Yt.Ki())return r;const i=this.Qt().Et().Pe(),s=this.zt();if(i===null||s===null)return r;let a,o;if(e){const f=this.Yt.Ar();if(f===null)return r;a=f,o=f.Re}else{const f=this.Yt.Fr(i.bi(),-1);if(f===null||(a=this.Yt.yr(f.Re),a===null))return r;o=f.Re}const c=a.Wt[3],u=this.Rh().Dr(o,{Wt:a}),d=n.Nt(c,s.Wt);return{ye:!1,gt:c,ri:n.Zi(c,s.Wt),Oe:n.Dh(c),Ne:n.Vh(c,s.Wt),R:u.cr,Bi:d,Re:o}}Rh(){return this.Ch!==null||(this.Ch=new fnt(this)),this.Ch}N(){return this.Ps}hr(e){const r=e.priceScaleId;r!==void 0&&r!==this.Ps.priceScaleId&&this.Qt().Ih(this,r),Fa(this.Ps,e),e.priceFormat!==void 0&&(this.Th(),this.Qt().Bh()),this.Qt().Eh(this),this.Qt().Ah(),this.sh.kt("options")}ht(e,r){this.Yt.ht(e),this.sh.kt("data"),this.xh!==null&&(r&&r.zh?this.xh.be():e.length===0&&this.xh.Me());const n=this.Qt().Hn(this);this.Qt().Lh(n),this.Qt().Eh(this),this.Qt().Ah(),this.Qt().ar()}Oh(e){const r=new cnt(this,e);return this.bh.push(r),this.Qt().Eh(this),r}Nh(e){const r=this.bh.indexOf(e);r!==-1&&this.bh.splice(r,1),this.Qt().Eh(this)}Fh(){return this.bh}Rr(){return this.yh}zt(){const e=this.Wh();return e===null?null:{Wt:e.Wt[3],Hh:e.wt}}Wh(){const e=this.Qt().Et().Pe();if(e===null)return null;const r=e.Uh();return this.Yt.Fr(r,1)}Xs(){return this.Yt}$h(e){const r=this.Yt.yr(e);return r===null?null:this.yh==="Bar"||this.yh==="Candlestick"||this.yh==="Custom"?{qh:r.Wt[0],Yh:r.Wt[1],jh:r.Wt[2],Kh:r.Wt[3]}:r.Wt[3]}Xh(e){const r=[];WA(this.kh,HA,"top",r);const n=this.xh;return n!==null&&n.Vt()&&(this.Ph===null&&n.xe()&&(this.Ph=setTimeout((()=>{this.Ph=null,this.Qt().Zh()}),0)),n.Se(),r.unshift(n)),r}Fs(){const e=[];this.Gh()||e.push(this.Sh),e.push(this.sh,this.er);const r=this.bh.map((n=>n.lr()));return e.push(...r),WA(this.kh,HA,"normal",e),e}Jh(){return this.Qh(HA,"bottom")}ta(e){return this.Qh(wnt,e)}ia(e){return this.Qh(_nt,e)}sa(e,r){return this.kh.map((n=>n.jn(e,r))).filter((n=>n!==null))}us(){return[this.rr,...this.bh.map((e=>e._r()))]}Ws(e,r){if(r!==this.es&&!this.Gh())return[];const n=[...this.vs];for(const i of this.bh)n.push(i.ur());
4214return this.kh.forEach((i=>{n.push(...i.Ws())})),n}cs(){const e=[];return this.kh.forEach((r=>{e.push(...r.cs())})),e}Mh(e,r){if(this.Ps.autoscaleInfoProvider!==void 0){const n=this.Ps.autoscaleInfoProvider((()=>{const i=this.na(e,r);return i===null?null:i.Xe()}));return aC.Ze(n)}return this.na(e,r)}ea(){return this.Ps.priceFormat.minMove}ra(){return this.ha}Ns(){this.sh.kt();for(const e of this.vs)e.kt();for(const e of this.bh)e.kt();this.er.kt(),this.Sh.kt(),this.xh?.kt(),this.kh.forEach((e=>e.Ns()))}Ft(){return Fe(super.Ft())}At(e){if(!((this.yh==="Line"||this.yh==="Area"||this.yh==="Baseline")&&this.Ps.crosshairMarkerVisible))return null;const r=this.Yt.yr(e);return r===null?null:{gt:r.Wt[3],ft:this.aa(),Ht:this.la(),Ot:this.oa(),Lt:this._a(e)}}Ee(){return this.Ps.title}Vt(){return this.Ps.visible}ua(e){this.kh.push(new bnt(e,this))}ca(e){this.kh=this.kh.filter((r=>r.oh()!==e))}da(){if(this.yh==="Custom")return e=>this.sh.fa(e)}pa(){if(this.yh==="Custom")return e=>this.sh.va(e)}ma(){return this.Yt.qr()}Gh(){return!dN(this.Ft().wa())}na(e,r){if(!Tb(e)||!Tb(r)||this.Yt.Ki())return null;const n=this.yh==="Line"||this.yh==="Area"||this.yh==="Baseline"||this.yh==="Histogram"?[3]:[2,1],i=this.Yt.Ur(e,r,n);let s=i!==null?new zs(i.Jr,i.Qr):null,a=null;if(this.Rr()==="Histogram"){const o=this.Ps.base,c=new zs(o,o);s=s!==null?s.vn(c):c}return this.kh.forEach((o=>{const c=o.Mh(e,r);if(c?.priceRange){const u=new zs(c.priceRange.minValue,c.priceRange.maxValue);s=s!==null?s.vn(u):u}c?.margins&&(a=c.margins)})),new aC(s,a)}aa(){switch(this.yh){case"Line":case"Area":case"Baseline":return this.Ps.crosshairMarkerRadius}return 0}la(){switch(this.yh){case"Line":case"Area":case"Baseline":{const e=this.Ps.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}oa(){switch(this.yh){case"Line":case"Area":case"Baseline":return this.Ps.crosshairMarkerBorderWidth}return 0}_a(e){switch(this.yh){case"Line":case"Area":case"Baseline":{const r=this.Ps.crosshairMarkerBackgroundColor;if(r.length!==0)return r}}return this.Rh().Dr(e).cr}Th(){switch(this.Ps.priceFormat.type){case"custom":{const e=this.Ps.priceFormat.formatter;this.ha={format:e,formatTickmarks:this.Ps.priceFormat.tickmarksFormatter??(r=>r.map(e))};break}case"volume":this.ha=new Zrt(this.Ps.priceFormat.precision);break;case"percent":this.ha=new qme(this.Ps.priceFormat.precision);break;default:{const e=Math.pow(10,this.Ps.priceFormat.precision);this.ha=new fN(e,this.Ps.priceFormat.minMove*e)}}this.es!==null&&this.es.ga()}Qh(e,r){const n=[];return WA(this.kh,e,r,n),n}}const knt=[3],Tnt=[0,1,2,3];class Cnt{constructor(e){this.Ps=e}Ma(e,r,n){let i=e;if(this.Ps.mode===0)return i;const s=n.ys(),a=s.zt();if(a===null)return i;const o=s.Nt(e,a),c=n.ba().filter((d=>d instanceof hN)).reduce(((d,f)=>{if(n.Un(f)||!f.Vt())return d;const h=f.Ft(),m=f.Xs();if(h.Ki()||!m.Te(r))return d;const y=m.yr(r);if(y===null)return d;const x=Yd(f.zt()),v=this.Ps.mode===3?Tnt:knt;return d.concat(v.map((_=>h.Nt(y.Wt[_],x.Wt))))}),[]);if(c.length===0)return i;c.sort(((d,f)=>Math.abs(d-o)-Math.abs(f-o)));const u=c[0];return i=s.Ts(u,a),i}}function Tg(t,e,r){return Math.min(Math.max(t,e),r)}function wS(t,e,r){return e-t<=r}class Ent extends Ju{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}et({context:e,bitmapSize:r,horizontalPixelRatio:n,verticalPixelRatio:i}){if(this.Yt===null)return;const s=Math.max(1,Math.floor(n));e.lineWidth=s,(function(a,o){a.save(),a.lineWidth%2&&a.translate(.5,.5),o(),a.restore()})(e,(()=>{const a=Fe(this.Yt);if(a.Sa){e.strokeStyle=a.xa,Pp(e,a.Ca),e.beginPath();for(const o of a.Pa){const c=Math.round(o.ka*n);e.moveTo(c,-s),e.lineTo(c,r.height+s)}e.stroke()}if(a.ya){e.strokeStyle=a.Ta,Pp(e,a.Ra),e.beginPath();for(const o of a.Da){const c=Math.round(o.ka*i);e.moveTo(-s,c),e.lineTo(r.width+s,c)}e.stroke()}}))}}class jnt{constructor(e){this.Gt=new Ent,this.xt=!0,this.Pt=e}kt(){this.xt=!0}Tt(){if(this.xt){const e=this.Pt.Qt().N().grid,r={ya:e.horzLines.visible,Sa:e.vertLines.visible,Ta:e.horzLines.color,xa:e.vertLines.color,Ra:e.horzLines.style,Ca:e.vertLines.style,Da:this.Pt.ys().Va(),Pa:(this.Pt.Qt().Et().Va()||[]).map((n=>({ka:n.coord})))};this.Gt.ht(r),this.xt=!1}return this.Gt}}class Nnt{constructor(e){this.sh=new jnt(e)}lr(){return this.sh}}const qA={Ia:4,Ba:1e-4};function cg(t,e){const r=100*(t-e)/e;return e<0?-r:r}function Pnt(t,e){const r=cg(t.$e(),e),n=cg(t.qe(),e);return new zs(r,n)}function Ax(t,e){const r=100*(t-e)/e+100;return e<0?-r:r}function Mnt(t,e){const r=Ax(t.$e(),e),n=Ax(t.qe(),e);return new zs(r,n)}function oC(t,e){const r=Math.abs(t);if(r<1e-15)return 0;const n=Math.log10(r+e.Ba)+e.Ia;return t<0?-n:n}function Dx(t,e){const r=Math.abs(t);if(r<1e-15)return 0;const n=Math.pow(10,r-e.Ia)-e.Ba;return t<0?-n:n}function wv(t,e){if(t===null)return null;const r=oC(t.$e(),e),n=oC(t.qe(),e);return new zs(r,n)}function nx(t,e){if(t===null)return null;const r=Dx(t.$e(),e),n=Dx(t.qe(),e);return new zs(r,n)}function YA(t){if(t===null)return qA;const e=Math.abs(t.qe()-t.$e());if(e>=1||e<1e-15)return qA;const r=Math.ceil(Math.abs(Math.log10(e))),n=qA.Ia+r;return{Ia:n,Ba:1/Math.pow(10,n)}}class KA{constructor(e,r){if(this.Ea=e,this.Aa=r,(function(n){if(n<0)return!1;for(let i=n;i>1;i/=10)if(i%10!=0)return!1;return!0})(this.Ea))this.za=[2,2.5,2];else{this.za=[];for(let n=this.Ea;n!==1;){if(n%2==0)this.za.push(2),n/=2;else{if(n%5!=0)throw new Error("unexpected base");this.za.push(2,2.5),n/=5}if(this.za.length>100)throw new Error("something wrong with base")}}}La(e,r,n){const i=this.Ea===0?0:1/this.Ea;let s=Math.pow(10,Math.max(0,Math.ceil(Math.log10(e-r)))),a=0,o=this.Aa[0];for(;;){const f=wS(s,i,1e-14)&&s>i+1e-14,h=wS(s,n*o,1e-14),m=wS(s,1,1e-14);if(!(f&&h&&m))break;s/=o,o=this.Aa[++a%this.Aa.length]}if(s<=i+1e-14&&(s=i),s=Math.max(1,s),this.za.length>0&&(c=s,u=1,d=1e-14,Math.abs(c-u)<d))for(a=0,o=this.za[0];wS(s,n*o,1e-14)&&s>i+1e-14;)s/=o,o=this.za[++a%this.za.length];var c,u,d;return s}}class vQ{constructor(e,r,n,i){this.Oa=[],this.Yi=e,this.Ea=r,this.Na=n,this.Fa=i}La(e,r){if(e<r)throw new Error("high < low");const n=this.Yi.$t(),i=(e-r)*this.Wa()/n,s=new KA(this.Ea,[2,2.5,2]),a=new KA(this.Ea,[2,2,2.5]),o=new KA(this.Ea,[2.5,2,2]),c=[];
4214return c.push(s.La(e,r,i),a.La(e,r,i),o.La(e,r,i)),(function(u){if(u.length<1)throw Error("array is empty");let d=u[0];for(let f=1;f<u.length;++f)u[f]<d&&(d=u[f]);return d})(c)}Ha(){const e=this.Yi,r=e.zt();if(r===null)return void(this.Oa=[]);const n=e.$t(),i=this.Na(n-1,r),s=this.Na(0,r),a=this.Yi.N().entireTextOnly?this.Ua()/2:0,o=a,c=n-1-a,u=Math.max(i,s),d=Math.min(i,s);if(u===d)return void(this.Oa=[]);const f=this.La(u,d);if(this.$a(r,f,u,d,o,c),e.qa()&&this.Ya(f,d,u)){const y=this.Yi.ja();this.Ka(r,f,o,c,y,2*y)}const h=this.Oa.map((y=>y.Xa)),m=this.Yi.Za(h);for(let y=0;y<this.Oa.length;y++)this.Oa[y].Ga=m[y]}Va(){return this.Oa}Ua(){return this.Yi.P()}Wa(){return Math.ceil(2.5*this.Ua())}$a(e,r,n,i,s,a){const o=this.Oa,c=this.Yi;let u=n%r;u+=u<0?r:0;const d=n>=i?1:-1;let f=null,h=0;for(let m=n-u;m>i;m-=r){const y=this.Fa(m,e,!0);f!==null&&Math.abs(y-f)<this.Wa()||y<s||y>a||(h<o.length?(o[h].ka=y,o[h].Ga=c.Ja(m),o[h].Xa=m):o.push({ka:y,Ga:c.Ja(m),Xa:m}),h++,f=y,c.Qa()&&(r=this.La(m*d,i)))}o.length=h}Ka(e,r,n,i,s,a){const o=this.Oa,c=this.tl(e,n,s,a),u=this.tl(e,i,-a,-s),d=this.Fa(0,e,!0)-this.Fa(r,e,!0);o.length>0&&o[0].ka-c.ka<d/2&&o.shift(),o.length>0&&u.ka-o[o.length-1].ka<d/2&&o.pop(),o.unshift(c),o.push(u)}tl(e,r,n,i){const s=(n+i)/2,a=this.Na(r+n,e),o=this.Na(r+i,e),c=Math.min(a,o),u=Math.max(a,o),d=Math.max(.1,this.La(u,c)),f=this.Na(r+s,e),h=f-f%d,m=this.Fa(h,e,!0);return{Ga:this.Yi.Ja(h),ka:m,Xa:h}}Ya(e,r,n){let i=Yd(this.Yi.Qe());return this.Yi.Qa()&&(i=nx(i,this.Yi.il())),i.$e()-r<e&&n-i.qe()<e}}function Jme(t){return t.slice().sort(((e,r)=>Fe(e.hs())-Fe(r.hs())))}var xQ;(function(t){t[t.Normal=0]="Normal",t[t.Logarithmic=1]="Logarithmic",t[t.Percentage=2]="Percentage",t[t.IndexedTo100=3]="IndexedTo100"})(xQ||(xQ={}));const bQ=new qme,wQ=new fN(100,1);class Ant{constructor(e,r,n,i,s){this.sl=0,this.nl=null,this.Ge=null,this.el=null,this.rl={hl:!1,al:null},this.ll=!1,this.ol=0,this._l=0,this.ul=new Xn,this.cl=new Xn,this.dl=[],this.fl=null,this.pl=null,this.vl=null,this.ml=null,this.wl=null,this.ha=wQ,this.gl=YA(null),this.Ml=e,this.Ps=r,this.bl=n,this.Sl=i,this.xl=s,this.Cl=new vQ(this,100,this.Pl.bind(this),this.kl.bind(this))}wa(){return this.Ml}N(){return this.Ps}hr(e){if(Fa(this.Ps,e),this.ga(),e.mode!==void 0&&this.yl({ie:e.mode}),e.scaleMargins!==void 0){const r=ha(e.scaleMargins.top),n=ha(e.scaleMargins.bottom);if(r<0||r>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${r}`);if(n<0||n>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${n}`);if(r+n>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${r+n}`);this.Tl(),this.vl=null}}Rl(){return this.Ps.autoScale}Dl(){return this.ll}Qa(){return this.Ps.mode===1}Le(){return this.Ps.mode===2}Vl(){return this.Ps.mode===3}il(){return this.gl}ie(){return{sn:this.Ps.autoScale,Il:this.Ps.invertScale,ie:this.Ps.mode}}yl(e){const r=this.ie();let n=null;e.sn!==void 0&&(this.Ps.autoScale=e.sn),e.ie!==void 0&&(this.Ps.mode=e.ie,e.ie!==2&&e.ie!==3||(this.Ps.autoScale=!0),this.rl.hl=!1),r.ie===1&&e.ie!==r.ie&&((function(s,a){if(s===null)return!1;const o=Dx(s.$e(),a),c=Dx(s.qe(),a);return isFinite(o)&&isFinite(c)})(this.Ge,this.gl)?(n=nx(this.Ge,this.gl),n!==null&&this.Bl(n)):this.Ps.autoScale=!0),e.ie===1&&e.ie!==r.ie&&(n=wv(this.Ge,this.gl),n!==null&&this.Bl(n));const i=r.ie!==this.Ps.mode;i&&(r.ie===2||this.Le())&&this.ga(),i&&(r.ie===3||this.Vl())&&this.ga(),e.Il!==void 0&&r.Il!==e.Il&&(this.Ps.invertScale=e.Il,this.El()),this.cl.p(r,this.ie())}Al(){return this.cl}P(){return this.bl.fontSize}$t(){return this.sl}zl(e){this.sl!==e&&(this.sl=e,this.Tl(),this.vl=null)}Ll(){if(this.nl)return this.nl;const e=this.$t()-this.Ol()-this.Nl();return this.nl=e,e}Qe(){return this.Fl(),this.Ge}Bl(e,r){const n=this.Ge;(r||n===null&&e!==null||n!==null&&!n.He(e))&&(this.vl=null,this.Ge=e)}Wl(e){this.Bl(e),this.Hl(e!==null)}Ki(){return this.Fl(),this.sl===0||!this.Ge||this.Ge.Ki()}Ul(e){return this.Il()?e:this.$t()-1-e}Nt(e,r){return this.Le()?e=cg(e,r):this.Vl()&&(e=Ax(e,r)),this.kl(e,r)}$l(e,r,n){this.Fl();const i=this.Nl(),s=Fe(this.Qe()),a=s.$e(),o=s.qe(),c=this.Ll()-1,u=this.Il(),d=c/(o-a),f=n===void 0?0:n.from,h=n===void 0?e.length:n.to,m=this.ql();for(let y=f;y<h;y++){const x=e[y],v=x.gt;if(isNaN(v))continue;let _=v;m!==null&&(_=m(x.gt,r));const S=i+d*(_-a),k=u?S:this.sl-1-S;x.ut=k}}Yl(e,r,n){this.Fl();const i=this.Nl(),s=Fe(this.Qe()),a=s.$e(),o=s.qe(),c=this.Ll()-1,u=this.Il(),d=c/(o-a),f=n===void 0?0:n.from,h=n===void 0?e.length:n.to,m=this.ql();for(let y=f;y<h;y++){const x=e[y];let v=x.qh,_=x.Yh,S=x.jh,k=x.Kh;m!==null&&(v=m(x.qh,r),_=m(x.Yh,r),S=m(x.jh,r),k=m(x.Kh,r));let E=i+d*(v-a),T=u?E:this.sl-1-E;x.jl=T,E=i+d*(_-a),T=u?E:this.sl-1-E,x.Kl=T,E=i+d*(S-a),T=u?E:this.sl-1-E,x.Xl=T,E=i+d*(k-a),T=u?E:this.sl-1-E,x.Zl=T}}Ts(e,r){const n=this.Pl(e,r);return this.Gl(n,r)}Gl(e,r){let n=e;return this.Le()?n=(function(i,s){return s<0&&(i=-i),i/100*s+s})(n,r):this.Vl()&&(n=(function(i,s){return i-=100,s<0&&(i=-i),i/100*s+s})(n,r)),n}ba(){return this.dl}Dt(){return this.pl||(this.pl=Jme(this.dl)),this.pl}Jl(e){this.dl.indexOf(e)===-1&&(this.dl.push(e),this.ga(),this.Ql())}io(e){const r=this.dl.indexOf(e);if(r===-1)throw new Error("source is not attached to scale");this.dl.splice(r,1),this.dl.length===0&&(this.yl({sn:!0}),this.Bl(null)),this.ga(),this.Ql()}zt(){let e=null;for(const r of this.dl){const n=r.zt();n!==null&&(e===null||n.Hh<e.Hh)&&(e=n)}return e===null?null:e.Wt}Il(){return this.Ps.invertScale}Va(){const e=this.zt()===null;if(this.vl!==null&&(e||this.vl.so===e))return this.vl.Va;this.Cl.Ha();const r=this.Cl.Va();return this.vl={Va:r,so:e},this.ul.p(),r}no(){return this.ul}eo(e){this.Le()||this.Vl()||this.ml===null&&this.el===null&&(this.Ki()||(this.ml=this.sl-e,this.el=Fe(this.Qe()).Ue()))}ro(e){if(this.Le()||this.Vl()||this.ml===null)return;this.yl({sn:!1}),(e=this.sl-e)<0&&(e=0);let r=(this.ml+.2*(this.sl-1))/(e+.2*(this.sl-1));const n=Fe(this.el).Ue();r=Math.max(r,.1),n.je(r),this.Bl(n)}ho(){this.Le()||this.Vl()||(this.ml=null,this.el=null)}ao(e){this.Rl()||this.wl===null&&this.el===null&&(this.Ki()||(this.wl=e,this.el=Fe(this.Qe()).Ue()))}lo(e){if(this.Rl()||this.wl===null)return;
4214const r=Fe(this.Qe()).Ye()/(this.Ll()-1);let n=e-this.wl;this.Il()&&(n*=-1);const i=n*r,s=Fe(this.el).Ue();s.Ke(i),this.Bl(s,!0),this.vl=null}oo(){this.Rl()||this.wl!==null&&(this.wl=null,this.el=null)}ra(){return this.ha||this.ga(),this.ha}Zi(e,r){switch(this.Ps.mode){case 2:return this._o(cg(e,r));case 3:return this.ra().format(Ax(e,r));default:return this.nr(e)}}Ja(e){switch(this.Ps.mode){case 2:return this._o(e);case 3:return this.ra().format(e);default:return this.nr(e)}}Za(e){switch(this.Ps.mode){case 2:return this.uo(e);case 3:return this.ra().formatTickmarks(e);default:return this.co(e)}}Dh(e){return this.nr(e,Fe(this.fl).ra())}Vh(e,r){return e=cg(e,r),this._o(e,bQ)}do(){return this.dl}fo(e){this.rl={al:e,hl:!1}}Ns(){this.dl.forEach((e=>e.Ns()))}qa(){return this.Ps.ensureEdgeTickMarksVisible&&this.Rl()}ja(){return this.P()/2}ga(){this.vl=null;let e=1/0;this.fl=null;for(const n of this.dl)n.hs()<e&&(e=n.hs(),this.fl=n);let r=100;this.fl!==null&&(r=Math.round(1/this.fl.ea())),this.ha=wQ,this.Le()?(this.ha=bQ,r=100):this.Vl()?(this.ha=new fN(100,1),r=100):this.fl!==null&&(this.ha=this.fl.ra()),this.Cl=new vQ(this,r,this.Pl.bind(this),this.kl.bind(this)),this.Cl.Ha()}Ql(){this.pl=null}Xi(){return this.xl}Hl(e){this.ll=e}Ol(){return this.Il()?this.Ps.scaleMargins.bottom*this.$t()+this._l:this.Ps.scaleMargins.top*this.$t()+this.ol}Nl(){return this.Il()?this.Ps.scaleMargins.top*this.$t()+this.ol:this.Ps.scaleMargins.bottom*this.$t()+this._l}Fl(){this.rl.hl||(this.rl.hl=!0,this.po())}Tl(){this.nl=null}kl(e,r){if(this.Fl(),this.Ki())return 0;e=this.Qa()&&e?oC(e,this.gl):e;const n=Fe(this.Qe()),i=this.Nl()+(this.Ll()-1)*(e-n.$e())/n.Ye();return this.Ul(i)}Pl(e,r){if(this.Fl(),this.Ki())return 0;const n=this.Ul(e),i=Fe(this.Qe()),s=i.$e()+i.Ye()*((n-this.Nl())/(this.Ll()-1));return this.Qa()?Dx(s,this.gl):s}El(){this.vl=null,this.Cl.Ha()}po(){if(this.Dl()&&!this.Rl())return;const e=this.rl.al;if(e===null)return;let r=null;const n=this.do();let i=0,s=0;for(const c of n){if(!c.Vt())continue;const u=c.zt();if(u===null)continue;const d=c.Mh(e.Uh(),e.bi());let f=d&&d.Qe();if(f!==null){switch(this.Ps.mode){case 1:f=wv(f,this.gl);break;case 2:f=Pnt(f,u.Wt);break;case 3:f=Mnt(f,u.Wt)}if(r=r===null?f:r.vn(Fe(f)),d!==null){const h=d.tr();h!==null&&(i=Math.max(i,h.above),s=Math.max(s,h.below))}}}if(this.qa()&&(i=Math.max(i,this.ja()),s=Math.max(s,this.ja())),i===this.ol&&s===this._l||(this.ol=i,this._l=s,this.vl=null,this.Tl()),r!==null){if(r.$e()===r.qe()){const c=this.fl,u=5*(c===null||this.Le()||this.Vl()?1:c.ea());this.Qa()&&(r=nx(r,this.gl)),r=new zs(r.$e()-u,r.qe()+u),this.Qa()&&(r=wv(r,this.gl))}if(this.Qa()){const c=nx(r,this.gl),u=YA(c);if(a=u,o=this.gl,a.Ia!==o.Ia||a.Ba!==o.Ba){const d=this.el!==null?nx(this.el,this.gl):null;this.gl=u,r=wv(c,u),d!==null&&(this.el=wv(d,u))}}this.Bl(r)}else this.Ge===null&&(this.Bl(new zs(-.5,.5)),this.gl=YA(null));var a,o}ql(){return this.Le()?cg:this.Vl()?Ax:this.Qa()?e=>oC(e,this.gl):null}vo(e,r,n){return r===void 0?(n===void 0&&(n=this.ra()),n.format(e)):r(e)}mo(e,r,n){return r===void 0?(n===void 0&&(n=this.ra()),n.formatTickmarks(e)):r(e)}nr(e,r){return this.vo(e,this.Sl.priceFormatter,r)}co(e,r){const n=this.Sl.priceFormatter;return this.mo(e,this.Sl.tickmarksPriceFormatter??(n?i=>i.map(n):void 0),r)}_o(e,r){return this.vo(e,this.Sl.percentageFormatter,r)}uo(e,r){const n=this.Sl.percentageFormatter;return this.mo(e,this.Sl.tickmarksPercentageFormatter??(n?i=>i.map(n):void 0),r)}}function _Q(t){return t instanceof hN}class SQ{constructor(e,r){this.dl=[],this.wo=new Map,this.sl=0,this.Mo=0,this.bo=1,this.pl=null,this.So=!1,this.xo=new Xn,this.kh=[],this.uh=e,this.ts=r,this.Co=new Nnt(this);const n=r.N();this.Po=this.ko("left",n.leftPriceScale),this.yo=this.ko("right",n.rightPriceScale),this.Po.Al().i(this.To.bind(this,this.Po),this),this.yo.Al().i(this.To.bind(this,this.yo),this),this.Ro(n)}Ro(e){if(e.leftPriceScale&&this.Po.hr(e.leftPriceScale),e.rightPriceScale&&this.yo.hr(e.rightPriceScale),e.localization&&(this.Po.ga(),this.yo.ga()),e.overlayPriceScales){const r=Array.from(this.wo.values());for(const n of r){const i=Fe(n[0].Ft());i.hr(e.overlayPriceScales),e.localization&&i.ga()}}}Do(e){switch(e){case"left":return this.Po;case"right":return this.yo}return this.wo.has(e)?ha(this.wo.get(e))[0].Ft():null}m(){this.Qt().Vo().u(this),this.Po.Al().u(this),this.yo.Al().u(this),this.dl.forEach((e=>{e.m&&e.m()})),this.kh=this.kh.filter((e=>{const r=e.oh();return r.detached&&r.detached(),!1})),this.xo.p()}Io(){return this.bo}Bo(e){this.bo=e}Qt(){return this.ts}Qi(){return this.Mo}$t(){return this.sl}Eo(e){this.Mo=e,this.Ao()}zl(e){this.sl=e,this.Po.zl(e),this.yo.zl(e),this.dl.forEach((r=>{if(this.Un(r)){const n=r.Ft();n!==null&&n.zl(e)}})),this.Ao()}zo(e){this.So=e}Lo(){return this.So}Oo(){return this.dl.filter(_Q)}ba(){return this.dl}Un(e){const r=e.Ft();return r===null||this.Po!==r&&this.yo!==r}Jl(e,r,n){this.No(e,r,n?e.hs():this.dl.length)}io(e,r){const n=this.dl.indexOf(e);Yi(n!==-1,"removeDataSource: invalid data source"),this.dl.splice(n,1),r||this.dl.forEach(((a,o)=>a.ls(o)));const i=Fe(e.Ft()).wa();if(this.wo.has(i)){const a=ha(this.wo.get(i)),o=a.indexOf(e);o!==-1&&(a.splice(o,1),a.length===0&&this.wo.delete(i))}const s=e.Ft();s&&s.ba().indexOf(e)>=0&&(s.io(e),this.Fo(s)),this.pl=null}qn(e){return e===this.Po?"left":e===this.yo?"right":"overlay"}Wo(){return this.Po}Ho(){return this.yo}Uo(e,r){e.eo(r)}$o(e,r){e.ro(r),this.Ao()}qo(e){e.ho()}Yo(e,r){e.ao(r)}jo(e,r){e.lo(r),this.Ao()}Ko(e){e.oo()}Ao(){this.dl.forEach((e=>{e.Ns()}))}ys(){let e=null;return this.ts.N().rightPriceScale.visible&&this.yo.ba().length!==0?e=this.yo:this.ts.N().leftPriceScale.visible&&this.Po.ba().length!==0?e=this.Po:this.dl.length!==0&&(e=this.dl[0].Ft()),e===null&&(e=this.yo),e}$n(){let e=null;return this.ts.N().rightPriceScale.visible?e=this.yo:this.ts.N().leftPriceScale.visible&&(e=this.Po),e}Fo(e){e!==null&&e.Rl()&&this.Xo(e)}Zo(e){const r=this.uh.Pe();e.yl({sn:!0}),r!==null&&e.fo(r),this.Ao()}Go(){this.Xo(this.Po),this.Xo(this.yo)}Jo(){this.Fo(this.Po),this.Fo(this.yo),this.dl.forEach((e=>{this.Un(e)&&this.Fo(e.Ft())})),this.Ao(),this.ts.ar()}Dt(){return this.pl===null&&(this.pl=Jme(this.dl)),this.pl}Qo(e,r){r=Tg(r,0,this.dl.length-1);const n=this.dl.indexOf(e);Yi(n!==-1,"setSeriesOrder: invalid data source"),this.dl.splice(n,1),this.dl.splice(r,0,e),this.dl.forEach(((i,s)=>i.ls(s))),this.pl=null;for(const i of[this.Po,this.yo])i.Ql(),i.ga();this.ts.ar()}It(){return this.Dt().filter(_Q)}t_(){return this.xo}i_(){return this.Co}ua(e){this.kh.push(new gnt(e))}ca(e){this.kh=this.kh.filter((r=>r.oh()!==e)),e.detached&&e.detached(),this.ts.ar()}s_(){return this.kh}sa(e,r){return this.kh.map((n=>n.jn(e,r))).filter((n=>n!==null))}Xo(e){const r=e.do();if(r&&r.length>0&&!this.uh.Ki()){const n=this.uh.Pe();n!==null&&e.fo(n)}e.Ns()}No(e,r,n){let i=this.Do(r);if(i===null&&(i=this.ko(r,this.ts.N().overlayPriceScales)),this.dl.splice(n,0,e),!dN(r)){const s=this.wo.get(r)||[];s.push(e),this.wo.set(r,s)}e.ls(n),i.Jl(e),e._s(i),this.Fo(i),this.pl=null}To(e,r,n){r.ie!==n.ie&&this.Xo(e)}ko(e,r){const n={visible:!0,autoScale:!0,...ru(r)},i=new Ant(e,n,this.ts.N().layout,this.ts.N().localization,this.ts.Xi());return i.zl(this.$t()),i}}function _S(t){return{n_:t.n_,e_:{Kn:t.r_.externalId},h_:t.r_.cursorStyle}}function Dnt(t,e,r,n){for(const i of t){const s=i.Tt(n);if(s!==null&&s.jn){const a=s.jn(e,r);if(a!==null)return{a_:i,e_:a}}}return null}function Ont(t){return t.Fs!==void 0}function ege(t,e,r){const n=[t,...t.Dt()],i=(function(s,a,o){let c,u;for(const h of s){const m=h.sa?.(a,o)??[];for(const y of m)d=y.zOrder,f=c?.zOrder,(!f||d==="top"&&f!=="top"||d==="normal"&&f==="bottom")&&(c=y,u=h)}var d,f;return c&&u?{r_:c,n_:u}:null})(n,e,r);if(i?.r_.zOrder==="top")return _S(i);for(const s of n){if(i&&i.n_===s&&i.r_.zOrder!=="bottom"&&!i.r_.isBackgroun
4214d)return _S(i);if(Ont(s)){const a=Dnt(s.Fs(t),e,r,t);if(a!==null)return{n_:s,a_:a.a_,e_:a.e_}}if(i&&i.n_===s&&i.r_.zOrder!=="bottom"&&i.r_.isBackground)return _S(i)}return i?.r_?_S(i):null}class Rnt{constructor(e,r,n=50){this.kn=0,this.yn=1,this.Tn=1,this.Dn=new Map,this.Rn=new Map,this.l_=e,this.o_=r,this.Vn=n}__(e){const r=e.time,n=this.o_.cacheKey(r),i=this.Dn.get(n);if(i!==void 0)return i.u_;if(this.kn===this.Vn){const a=this.Rn.get(this.Tn);this.Rn.delete(this.Tn),this.Dn.delete(ha(a)),this.Tn++,this.kn--}const s=this.l_(e);return this.Dn.set(n,{u_:s,An:this.yn}),this.Rn.set(this.yn,n),this.kn++,this.yn++,s}}class Ox{constructor(e,r){Yi(e<=r,"right should be >= left"),this.c_=e,this.d_=r}Uh(){return this.c_}bi(){return this.d_}f_(){return this.d_-this.c_+1}Te(e){return this.c_<=e&&e<=this.d_}He(e){return this.c_===e.Uh()&&this.d_===e.bi()}}function kQ(t,e){return t===null||e===null?t===e:t.He(e)}class Int{constructor(){this.p_=new Map,this.Dn=null,this.v_=!1}m_(e){this.v_=e,this.Dn=null}w_(e,r){this.g_(r),this.Dn=null;for(let n=r;n<e.length;++n){const i=e[n];let s=this.p_.get(i.timeWeight);s===void 0&&(s=[],this.p_.set(i.timeWeight,s)),s.push({index:n,time:i.time,weight:i.timeWeight,originalTime:i.originalTime})}}M_(e,r,n,i,s){const a=Math.ceil(r/e);return this.Dn!==null&&this.Dn.b_===a&&s===this.Dn.S_&&n===this.Dn.x_||(this.Dn={S_:s,x_:n,Va:this.C_(a,n,i),b_:a}),this.Dn.Va}g_(e){if(e===0)return void this.p_.clear();const r=[];this.p_.forEach(((n,i)=>{e<=n[0].index?r.push(i):n.splice(ay(n,e,(s=>s.index<e)),1/0)}));for(const n of r)this.p_.delete(n)}C_(e,r,n){let i=[];const s=a=>!r||n.has(a.index);for(const a of Array.from(this.p_.keys()).sort(((o,c)=>c-o))){if(!this.p_.get(a))continue;const o=i;i=[];const c=o.length;let u=0;const d=ha(this.p_.get(a)),f=d.length;let h=1/0,m=-1/0;for(let y=0;y<f;y++){const x=d[y],v=x.index;for(;u<c;){const _=o[u],S=_.index;if(!(S<v&&s(_))){h=S;break}u++,i.push(_),m=S,h=1/0}if(h-v>=e&&v-m>=e&&s(x))i.push(x),m=v;else if(this.v_)return o}for(;u<c;u++)s(o[u])&&i.push(o[u])}return i}}class Cg{constructor(e){this.P_=e}k_(){return this.P_===null?null:new Ox(Math.floor(this.P_.Uh()),Math.ceil(this.P_.bi()))}y_(){return this.P_}static T_(){return new Cg(null)}}function Lnt(t,e){return t.weight>e.weight?t:e}class $nt{constructor(e,r,n,i){this.Mo=0,this.R_=null,this.D_=[],this.wl=null,this.ml=null,this.V_=new Int,this.I_=new Map,this.B_=Cg.T_(),this.E_=!0,this.A_=new Xn,this.z_=new Xn,this.L_=new Xn,this.O_=null,this.N_=null,this.F_=new Map,this.W_=-1,this.H_=[],this.Ps=r,this.Sl=n,this.U_=r.rightOffset,this.q_=r.barSpacing,this.ts=e,this.o_=i,this.Y_(),this.V_.m_(r.uniformDistribution),this.j_()}N(){return this.Ps}K_(e){Fa(this.Sl,e),this.X_(),this.Y_()}hr(e,r){Fa(this.Ps,e),this.Ps.fixLeftEdge&&this.Z_(),this.Ps.fixRightEdge&&this.G_(),e.barSpacing!==void 0&&this.ts.dn(e.barSpacing),e.rightOffset!==void 0&&this.ts.fn(e.rightOffset),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.ts.dn(e.barSpacing??this.q_),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.Ps.ignoreWhitespaceIndices&&this.j_(),this.X_(),this.Y_(),this.L_.p()}Rs(e){return this.D_[e]?.time??null}ss(e){return this.D_[e]??null}J_(e,r){if(this.D_.length<1)return null;if(this.o_.key(e)>this.o_.key(this.D_[this.D_.length-1].time))return r?this.D_.length-1:null;const n=ay(this.D_,this.o_.key(e),((i,s)=>this.o_.key(i.time)<s));return this.o_.key(e)<this.o_.key(this.D_[n].time)?r?n:null:n}Ki(){return this.Mo===0||this.D_.length===0||this.R_===null}Q_(){return this.D_.length>0}Pe(){return this.tu(),this.B_.k_()}iu(){return this.tu(),this.B_.y_()}su(){const e=this.Pe();if(e===null)return null;const r={from:e.Uh(),to:e.bi()};return this.nu(r)}nu(e){const r=Math.round(e.from),n=Math.round(e.to),i=Fe(this.eu()),s=Fe(this.ru());return{from:Fe(this.ss(Math.max(i,r))),to:Fe(this.ss(Math.min(s,n)))}}hu(e){return{from:Fe(this.J_(e.from,!0)),to:Fe(this.J_(e.to,!0))}}Qi(){return this.Mo}Eo(e){if(!isFinite(e)||e<=0||this.Mo===e)return;const r=this.iu(),n=this.Mo;if(this.Mo=e,this.E_=!0,this.Ps.lockVisibleTimeRangeOnResize&&n!==0){const i=this.q_*e/n;this.q_=i}if(this.Ps.fixLeftEdge&&r!==null&&r.Uh()<=0){const i=n-e;this.U_-=Math.round(i/this.q_)+1,this.E_=!0}this.au(),this.lu()}qt(e){if(this.Ki()||!Tb(e))return 0;const r=this.ou()+this.U_-e;return this.Mo-(r+.5)*this.q_-1}_u(e,r){const n=this.ou(),i=r===void 0?0:r.from,s=r===void 0?e.length:r.to;for(let a=i;a<s;a++){const o=e[a].wt,c=n+this.U_-o,u=this.Mo-(c+.5)*this.q_-1;e[a]._t=u}}uu(e,r){const n=Math.ceil(this.cu(e));return r&&this.Ps.ignoreWhitespaceIndices&&!this.du(n)?this.fu(n):n}fn(e){this.E_=!0,this.U_=e,this.lu(),this.ts.pu(),this.ts.ar()}vu(){return this.q_}dn(e){this.mu(e),this.lu(),this.ts.pu(),this.ts.ar()}wu(){return this.U_}Va(){if(this.Ki())return null;if(this.N_!==null)return this.N_;const e=this.q_,r=5*(this.ts.N().layout.fontSize+4)/8*(this.Ps.tickMarkMaxCharacterLength||8),n=Math.round(r/e),i=Fe(this.Pe()),s=Math.max(i.Uh(),i.Uh()-n),a=Math.max(i.bi(),i.bi()-n),o=this.V_.M_(e,r,this.Ps.ignoreWhitespaceIndices,this.F_,this.W_),c=this.eu()+n,u=this.ru()-n,d=this.gu(),f=this.Ps.fixLeftEdge||d,h=this.Ps.fixRightEdge||d;let m=0;for(const y of o){if(!(s<=y.index&&y.index<=a))continue;let x;m<this.H_.length?(x=this.H_[m],x.coord=this.qt(y.index),x.label=this.Mu(y),x.weight=y.weight):(x={needAlignCoordinate:!1,coord:this.qt(y.index),label:this.Mu(y),weight:y.weight},this.H_.push(x)),this.q_>r/2&&!d?x.needAlignCoordinate=!1:x.needAlignCoordinate=f&&y.index<=c||h&&y.index>=u,m++}return this.H_.length=m,this.N_=this.H_,this.H_}bu(){this.E_=!0,this.dn(this.Ps.barSpacing),this.fn(this.Ps.rightOffset)}Su(e){this.E_=!0,this.R_=e,this.lu(),this.Z_()}xu(e,r){const n=this.cu(e),i=this.vu(),s=i+r*(i/10);this.dn(s),this.Ps.rightBarStaysOnScroll||this.fn(this.wu()+(n-this.cu(e)))}eo(e){this.wl&&this.oo(),this.ml===null&&this.O_===null&&(this.Ki()||(this.ml=e,this.Cu()))}ro(e){if(this.O_===null)return;const r=Tg(this.Mo-e,0,this.Mo),n=Tg(this.Mo-Fe(this.ml),0,this.Mo);r!==0&&n!==0&&this.dn(this.O_.vu*r/n)}ho(){this.ml!==null&&(this.ml=null,this.Pu())}ao(e){this.wl===null&&this.O_===null&&(this.Ki()||(this.wl=e,this.Cu()))}lo(e){if(this.wl===null)return;const r=(this.wl-e)/this.vu();this.U_=Fe(this.O_).wu+r,this.E_=!0,this.lu()}oo(){this.wl!==null&&(this.wl=null,this.Pu())}ku(){this.yu(this.Ps.rightOffset)}yu(e,r=400){if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(!isFinite(r)||r<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const n=this.U_,i=performance.now();this.ts._n({Tu:s=>(s-i)/r>=1,Ru:s=>{const a=(s-i)/r;return a>=1?e:n+(e-n)*a}})}kt(e,r){this.E_=!0,this.D_=e,this.V_.w_(e,r),this.lu()}Du(){return this.A_}Vu(){return this.z_}Iu(){return this.L_}ou(){return this.R_||0}Bu(e){const r=e.f_();this.mu(this.Mo/r),this.U_=e.bi()-this.ou(),this.lu(),this.E_=!0,this.ts.pu(),this.ts.ar()}Eu(){const e=this.eu(),r=this.ru();e!==null&&r!==null&&this.Bu(new Ox(e,r+this.Ps.rightOffset))}Au(e){const r=new Ox(e.from,e.to);this.Bu(r)}ns(e){return this.Sl.timeFormatter!==void 0?this.Sl.timeFormatter(e.originalTime):this.o_.formatHorzItem(e.time)}j_(){if(!this.Ps.ignoreWhitespaceIndices)return;this.F_.clear();const e=this.ts.js();for(const r of e)for(const n of r.ma())this.F_.set(n,!0);this.W_++}gu(){const e=this.ts.N().handleScroll,r=this.ts.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||r.axisDoubleClickReset.time||r.axisPressedMouseMove.time||r.mouseWheel||r.pinch)}eu(){return this.D_.length===0?null:0}ru(){return this.D_.length===0?null:this.D_.length-1}zu(e){return(this.Mo-1-e)/this.q_}cu(e){const r=this.zu(e),n=this.ou()+this.U_-r;return Math.round(1e6*n)/1e6}mu(e){const r=this.q_;this.q_=e,this.au(),r!==this.q_&&(this.E_=!0,this.Lu())}tu(){if(!this.E_)return;if(this.E_=!1,this.Ki())return void this.Ou(Cg.T_());const e=this.ou(),r=this.Mo/this.q_,n=this.U_+e,i=new Ox(n-r+1,n);this.Ou(new Cg(i))}au(){const e=Tg(this.q_,this.Nu(),this.Fu());this.q_!==e&&(this.q_=e,this.E_=!0)}Fu(){return this.Ps.maxBarSpacing>0?this.Ps.maxBarSpacing:.5*this.Mo}Nu(){return this.Ps.fixLeftEdge&&this.Ps.fixRightEdge&&this.D_.length!==0?this.Mo/this.D_.length:this.Ps.minBarSpacing}lu(){const e=this.Wu();e!==null&&this.U_<e&&(this.U_=e,this.E_=!0);const r=this.Hu();this.U_>r&&(this.U_=r,this.E_=!0)}Wu(){const e=this.eu(),r=this.R_;return e===null||r===null?null:e-r-1+(this.Ps.fixLeftEdge?this.Mo/this.q_:Math.min(2,this.D_.length))}Hu(){return this.Ps.fixRightEdge?0:this.Mo/this.q_-Math.min(2,this.D_.length)}Cu(){this.O_={vu:this.vu(),wu:this.wu()}}Pu(){this.O_=null}Mu(e){let r=this.I_.get(e.weight);return r===void 0&&(r=new Rnt((n=>this.Uu(n)),this.o_),this.I_.set(e.weight,r)),r.__(e)}Uu(e){return this.o_.formatTickmark(e,this.Sl)}Ou(e){const r=this.B_;this.B_=e,kQ(r.k_(),this.B_.k_())||this.A_.p(),kQ(r.y_(),this.B_.y_())||this.z_.p(),this.Lu()}Lu(){this.N_=null}X_(){this.Lu(),this.I_.clear()}Y_(){this.o_.updateFormatter(this.Sl)}
4214Z_(){if(!this.Ps.fixLeftEdge)return;const e=this.eu();if(e===null)return;const r=this.Pe();if(r===null)return;const n=r.Uh()-e;if(n<0){const i=this.U_-n-1;this.fn(i)}this.au()}G_(){this.lu(),this.au()}du(e){return!this.Ps.ignoreWhitespaceIndices||this.F_.get(e)||!1}fu(e){const r=(function*(i){const s=Math.round(i),a=s<i;let o=1;for(;;)a?(yield s+o,yield s-o):(yield s-o,yield s+o),o++})(e),n=this.ru();for(;n;){const i=r.next().value;if(this.F_.get(i))return i;if(i<0||i>n)break}return e}}var TQ,CQ,EQ,Eb,jQ;(function(t){t[t.OnTouchEnd=0]="OnTouchEnd",t[t.OnNextTap=1]="OnNextTap"})(TQ||(TQ={}));class Fnt{constructor(e,r,n){this.$u=[],this.qu=[],this.Mo=0,this.Yu=null,this.ju=new Xn,this.Ku=new Xn,this.Xu=null,this.Zu=e,this.Ps=r,this.o_=n,this.xl=new Frt(this.Ps.layout.colorParsers),this.Gu=new $rt(this),this.uh=new $nt(this,r.timeScale,this.Ps.localization,n),this.Ct=new Qrt(this,r.crosshair),this.Ju=new Cnt(r.crosshair),r.addDefaultPane&&(this.Qu(0),this.$u[0].Bo(2)),this.tc=this.sc(0),this.nc=this.sc(1)}Bh(){this.ec(ta.gn())}ar(){this.ec(ta.wn())}Zh(){this.ec(new ta(1))}Eh(e){const r=this.rc(e);this.ec(r)}hc(){return this.Yu}ac(e){if(this.Yu?.n_===e?.n_&&this.Yu?.e_?.Kn===e?.e_?.Kn)return;const r=this.Yu;this.Yu=e,r!==null&&this.Eh(r.n_),e!==null&&e.n_!==r?.n_&&this.Eh(e.n_)}N(){return this.Ps}hr(e){Fa(this.Ps,e),this.$u.forEach((r=>r.Ro(e))),e.timeScale!==void 0&&this.uh.hr(e.timeScale),e.localization!==void 0&&this.uh.K_(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.ju.p(),this.tc=this.sc(0),this.nc=this.sc(1),this.Bh()}lc(e,r,n=0){const i=this.$u[n];if(i===void 0)return;if(e==="left")return Fa(this.Ps,{leftPriceScale:r}),i.Ro({leftPriceScale:r}),this.ju.p(),void this.Bh();if(e==="right")return Fa(this.Ps,{rightPriceScale:r}),i.Ro({rightPriceScale:r}),this.ju.p(),void this.Bh();const s=this.oc(e,n);s!==null&&(s.Ft.hr(r),this.ju.p())}oc(e,r){const n=this.$u[r];if(n===void 0)return null;const i=n.Do(e);return i!==null?{Us:n,Ft:i}:null}Et(){return this.uh}$s(){return this.$u}_c(){return this.Ct}uc(){return this.Ku}cc(e,r){e.zl(r),this.pu()}Eo(e){this.Mo=e,this.uh.Eo(this.Mo),this.$u.forEach((r=>r.Eo(e))),this.pu()}dc(e){this.$u.length!==1&&(Yi(e>=0&&e<this.$u.length,"Invalid pane index"),this.$u.splice(e,1),this.Bh())}fc(e,r){if(this.$u.length<2)return;Yi(e>=0&&e<this.$u.length,"Invalid pane index");const n=this.$u[e],i=this.$u.reduce(((f,h)=>f+h.Io()),0),s=this.$u.reduce(((f,h)=>f+h.$t()),0),a=s-30*(this.$u.length-1);r=Math.min(a,Math.max(30,r));const o=i/s,c=n.$t();n.Bo(r*o);let u=r-c,d=this.$u.length-1;for(const f of this.$u)if(f!==n){const h=Math.min(a,Math.max(30,f.$t()-u/d));u-=f.$t()-h,d-=1;const m=h*o;f.Bo(m)}this.Bh()}vc(e,r){Yi(e>=0&&e<this.$u.length&&r>=0&&r<this.$u.length,"Invalid pane index");const n=this.$u[e],i=this.$u[r];this.$u[e]=i,this.$u[r]=n,this.Bh()}mc(e,r){if(Yi(e>=0&&e<this.$u.length&&r>=0&&r<this.$u.length,"Invalid pane index"),e===r)return;const[n]=this.$u.splice(e,1);this.$u.splice(r,0,n),this.Bh()}Uo(e,r,n){e.Uo(r,n)}$o(e,r,n){e.$o(r,n),this.Ah(),this.ec(this.wc(e,2))}qo(e,r){e.qo(r),this.ec(this.wc(e,2))}Yo(e,r,n){r.Rl()||e.Yo(r,n)}jo(e,r,n){r.Rl()||(e.jo(r,n),this.Ah(),this.ec(this.wc(e,2)))}Ko(e,r){r.Rl()||(e.Ko(r),this.ec(this.wc(e,2)))}Zo(e,r){e.Zo(r),this.ec(this.wc(e,2))}gc(e){this.uh.eo(e)}Mc(e,r){const n=this.Et();if(n.Ki()||r===0)return;const i=n.Qi();e=Math.max(1,Math.min(e,i)),n.xu(e,r),this.pu()}bc(e){this.Sc(0),this.xc(e),this.Cc()}Pc(e){this.uh.ro(e),this.pu()}kc(){this.uh.ho(),this.ar()}Sc(e){this.uh.ao(e)}xc(e){this.uh.lo(e),this.pu()}Cc(){this.uh.oo(),this.ar()}js(){return this.qu}yc(e,r,n,i,s){this.Ct.Vs(e,r);let a=NaN,o=this.uh.uu(e,!0);const c=this.uh.Pe();c!==null&&(o=Math.min(Math.max(c.Uh(),o),c.bi()));const u=i.ys(),d=u.zt();if(d!==null&&(a=u.Ts(r,d)),a=this.Ju.Ma(a,o,i),this.Ct.As(o,a,i),this.Zh(),!s){const f=ege(i,e,r);this.ac(f&&{n_:f.n_,e_:f.e_,h_:f.h_||null}),this.Ku.p(this.Ct.Bt(),{x:e,y:r},n)}}Tc(e,r,n){const i=n.ys(),s=i.zt(),a=i.Nt(e,Fe(s)),o=this.uh.J_(r,!0),c=this.uh.qt(Fe(o));this.yc(c,a,null,n,!0)}Rc(e){this._c().Ls(),this.Zh(),e||this.Ku.p(null,null,null)}Ah(){const e=this.Ct.Us();if(e!==null){const r=this.Ct.Bs(),n=this.Ct.Es();this.yc(r,n,null,e)}this.Ct.Ns()}Dc(e,r,n){const i=this.uh.Rs(0);r!==void 0&&n!==void 0&&this.uh.kt(r,n);const s=this.uh.Rs(0),a=this.uh.ou(),o=this.uh.Pe();if(o!==null&&i!==null&&s!==null){const c=o.Te(a),u=this.o_.key(i)>this.o_.key(s),d=e!==null&&e>a&&!u,f=this.uh.N().allowShiftVisibleRangeOnWhitespaceReplacement,h=c&&(n!==void 0||f)&&this.uh.N().shiftVisibleRangeOnNewBar;if(d&&!h){const m=e-a;this.uh.fn(this.uh.wu()-m)}}this.uh.Su(e)}Lh(e){e!==null&&e.Jo()}Hn(e){if((function(n){return n instanceof SQ})(e))return e;const r=this.$u.find((n=>n.Dt().includes(e)));return r===void 0?null:r}pu(){this.$u.forEach((e=>e.Jo())),this.Ah()}m(){this.$u.forEach((e=>e.m())),this.$u.length=0,this.Ps.localization.priceFormatter=void 0,this.Ps.localization.percentageFormatter=void 0,this.Ps.localization.timeFormatter=void 0}Vc(){return this.Gu}Yn(){return this.Gu.N()}Vo(){return this.ju}Ic(e,r){const n=this.Qu(r);this.Bc(e,n),this.qu.push(e),this.qu.length===1?this.Bh():this.ar()}
4214Ec(e){const r=this.Hn(e),n=this.qu.indexOf(e);Yi(n!==-1,"Series not found");const i=Fe(r);this.qu.splice(n,1),i.io(e),e.m&&e.m(),this.uh.j_(),this.Ac(i)}Ih(e,r){const n=Fe(this.Hn(e));n.io(e,!0),n.Jl(e,r,!0)}Eu(){const e=ta.wn();e.rn(),this.ec(e)}zc(e){const r=ta.wn();r.ln(e),this.ec(r)}cn(){const e=ta.wn();e.cn(),this.ec(e)}dn(e){const r=ta.wn();r.dn(e),this.ec(r)}fn(e){const r=ta.wn();r.fn(e),this.ec(r)}_n(e){const r=ta.wn();r._n(e),this.ec(r)}hn(){const e=ta.wn();e.hn(),this.ec(e)}Lc(){return this.Ps.rightPriceScale.visible?"right":"left"}Oc(e,r){if(Yi(r>=0,"Index should be greater or equal to 0"),r===this.Nc(e))return;const n=Fe(this.Hn(e));n.io(e);const i=this.Qu(r);this.Bc(e,i),n.ba().length===0&&this.Ac(n),this.Bh()}Fc(){return this.nc}$(){return this.tc}Ut(e){const r=this.nc,n=this.tc;if(r===n)return r;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.Xu===null||this.Xu.mr!==n||this.Xu.wr!==r)this.Xu={mr:n,wr:r,Wc:new Map};else{const s=this.Xu.Wc.get(e);if(s!==void 0)return s}const i=this.xl.tt(n,r,e/100);return this.Xu.Wc.set(e,i),i}Hc(e){return this.$u.indexOf(e)}Xi(){return this.xl}Uc(){return this.$c()}$c(e){const r=new SQ(this.uh,this);this.$u.push(r);const n=e??this.$u.length-1,i=ta.gn();return i.Qs(n,{tn:0,sn:!0}),this.ec(i),r}Qu(e){return Yi(e>=0,"Index should be greater or equal to 0"),(e=Math.min(this.$u.length,e))<this.$u.length?this.$u[e]:this.$c(e)}Nc(e){return this.$u.findIndex((r=>r.Oo().includes(e)))}wc(e,r){const n=new ta(r);if(e!==null){const i=this.$u.indexOf(e);n.Qs(i,{tn:r})}return n}rc(e,r){return r===void 0&&(r=2),this.wc(this.Hn(e),r)}ec(e){this.Zu&&this.Zu(e),this.$u.forEach((r=>r.i_().lr().kt()))}Bc(e,r){const n=e.N().priceScaleId,i=n!==void 0?n:this.Lc();r.Jl(e,i),dN(i)||e.hr(e.N())}sc(e){const r=this.Ps.layout;return r.background.type==="gradient"?e===0?r.background.topColor:r.background.bottomColor:r.background.color}Ac(e){!e.Lo()&&e.ba().length===0&&this.$u.length>1&&this.$u.splice(this.Hc(e),1)}}function l5(t){return!sy(t)&&!l1(t)}function tge(t){return sy(t)}(function(t){t[t.Disabled=0]="Disabled",t[t.Continuous=1]="Continuous",t[t.OnDataUpdate=2]="OnDataUpdate"})(CQ||(CQ={})),(function(t){t[t.LastBar=0]="LastBar",t[t.LastVisible=1]="LastVisible"})(EQ||(EQ={})),(function(t){t.Solid="solid",t.VerticalGradient="gradient"})(Eb||(Eb={})),(function(t){t[t.Year=0]="Year",t[t.Month=1]="Month",t[t.DayOfMonth=2]="DayOfMonth",t[t.Time=3]="Time",t[t.TimeWithSeconds=4]="TimeWithSeconds"})(jQ||(jQ={}));const NQ=t=>t.getUTCFullYear();function znt(t,e,r){return e.replace(/yyyy/g,(n=>nu(NQ(n),4))(t)).replace(/yy/g,(n=>nu(NQ(n)%100,2))(t)).replace(/MMMM/g,((n,i)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(t,r)).replace(/MMM/g,((n,i)=>new Date(n.getUTCFullYear(),n.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(t,r)).replace(/MM/g,(n=>nu((i=>i.getUTCMonth()+1)(n),2))(t)).replace(/dd/g,(n=>nu((i=>i.getUTCDate())(n),2))(t))}class rge{constructor(e="yyyy-MM-dd",r="default"){this.qc=e,this.Yc=r}__(e){return znt(e,this.qc,this.Yc)}}class Bnt{constructor(e){this.jc=e||"%h:%m:%s"}__(e){return this.jc.replace("%h",nu(e.getUTCHours(),2)).replace("%m",nu(e.getUTCMinutes(),2)).replace("%s",nu(e.getUTCSeconds(),2))}}const Vnt={Kc:"yyyy-MM-dd",Xc:"%h:%m:%s",Zc:" ",Gc:"default"};class Unt{constructor(e={}){const r={...Vnt,...e};this.Jc=new rge(r.Kc,r.Gc),this.Qc=new Bnt(r.Xc),this.td=r.Zc}__(e){return`${this.Jc.__(e)}${this.td}${this.Qc.__(e)}`}}function SS(t){return 60*t*60*1e3}function QA(t){return 60*t*1e3}const kS=[{sd:(PQ=1,1e3*PQ),nd:10},{sd:QA(1),nd:20},{sd:QA(5),nd:21},{sd:QA(30),nd:22},{sd:SS(1),nd:30},{sd:SS(3),nd:31},{sd:SS(6),nd:32},{sd:SS(12),nd:33}];var PQ;function MQ(t,e){if(t.getUTCFullYear()!==e.getUTCFullYear())return 70;if(t.getUTCMonth()!==e.getUTCMonth())return 60;if(t.getUTCDate()!==e.getUTCDate())return 50;for(let r=kS.length-1;r>=0;--r)if(Math.floor(e.getTime()/kS[r].sd)!==Math.floor(t.getTime()/kS[r].sd))return kS[r].nd;return 0}function ZA(t){let e=t;if(l1(t)&&(e=qV(t)),!l5(e))throw new Error("time must be of type BusinessDay");const r=new Date(Date.UTC(e.year,e.month-1,e.day,0,0,0,0));return{ed:Math.round(r.getTime()/1e3),rd:e}}function AQ(t){if(!tge(t))throw new Error("time must be of type isUTCTimestamp");return{ed:t}}function qV(t){const e=new Date(t);if(isNaN(e.getTime()))throw new Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);return{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}}function DQ(t){l1(t.time)&&(t.time=qV(t.time))}class OQ{options(){return this.Ps}setOptions(e){this.Ps=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?(function(r){r.forEach(DQ)})(e):DQ(e)}createConverterToInternalObj(e){return Fe((function(r){return r.length===0?null:l5(r[0].time)||l1(r[0].time)?ZA:AQ})(e))}key(e){return typeof e=="object"&&"ed"in e?e.ed:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){const r=e;return r.rd===void 0?new Date(1e3*r.ed).getTime():new Date(Date.UTC(r.rd.year,r.rd.month-1,r.rd.day)).getTime()}convertHorzItemToInternal(e){return tge(r=e)?AQ(r):l5(r)?ZA(r):ZA(qV(r));var r}updateFormatter(e){if(!this.Ps)return;const r=e.dateFormat;this.Ps.timeScale.timeVisible?this.hd=new Unt({Kc:r,Xc:this.Ps.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Zc:"   ",Gc:e.locale}):this.hd=new rge(r,e.locale)}formatHorzItem(e){const r=e;return this.hd.__(new Date(1e3*r.ed))}formatTickmark(e,r){const n=(function(s,a,o){switch(s){case 0:case 10:return a?o?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return a?3:2;case 50:return 2;case 60:return 1;case 70:return 0}})(e.weight,this.Ps.timeScale.timeVisible,this.Ps.timeScale.secondsVisible),i=this.Ps.timeScale;if(i.tickMarkFormatter!==void 0){const s=i.tickMarkFormatter(e.originalTime,n,r.locale);if(s!==null)return s}return(function(s,a,o){const c={};switch(a){case 0:c.year="numeric";break;case 1:c.month="short";break;case 2:c.day="numeric";break;case 3:c.hour12=!1,c.hour="2-digit",c.minute="2-digit";break;case 4:c.hour12=!1,c.hour="2-digit",c.minute="2-digit",c.second="2-digit"}const u=s.rd===void 0?new Date(1e3*s.ed):new Date(Date.UTC(s.rd.year,s.rd.month-1,s.rd.day));return new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate(),u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()).toLocaleStr
4214ing(o,c)})(e.time,n,r.locale)}maxTickMarkWeight(e){let r=e.reduce(Lnt,e[0]).weight;return r>30&&r<50&&(r=30),r}fillWeightsForPoints(e,r){(function(n,i=0){if(n.length===0)return;let s=i===0?null:n[i-1].time.ed,a=s!==null?new Date(1e3*s):null,o=0;for(let c=i;c<n.length;++c){const u=n[c],d=new Date(1e3*u.time.ed);a!==null&&(u.timeWeight=MQ(d,a)),o+=u.time.ed-(s||u.time.ed),s=u.time.ed,a=d}if(i===0&&n.length>1){const c=Math.ceil(o/(n.length-1)),u=new Date(1e3*(n[0].time.ed-c));n[0].timeWeight=MQ(new Date(1e3*n[0].time.ed),u)}})(e,r)}static ad(e){return Fa({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}const oy=typeof window<"u";function RQ(){return!!oy&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function XA(){return!!oy&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function c5(t){return t+t%2}function Gnt(t){oy&&window.chrome!==void 0&&t.addEventListener("mousedown",(e=>{if(e.button===1)return e.preventDefault(),!1}))}class pN{constructor(e,r,n){this.ld=0,this.od=null,this._d={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.ud=0,this.dd=null,this.fd={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.pd=null,this.vd=!1,this.md=null,this.wd=null,this.gd=!1,this.Md=!1,this.bd=!1,this.Sd=null,this.xd=null,this.Cd=null,this.Pd=null,this.kd=null,this.yd=null,this.Td=null,this.Rd=0,this.Dd=!1,this.Vd=!1,this.Id=!1,this.Bd=0,this.Ed=null,this.Ad=!XA(),this.zd=i=>{this.Ld(i)},this.Od=i=>{if(this.Nd(i)){const s=this.Fd(i);if(++this.ud,this.dd&&this.ud>1){const{Wd:a}=this.Hd(Ml(i),this.fd);a<30&&!this.bd&&this.Ud(s,this.qd.$d),this.Yd()}}else{const s=this.Fd(i);if(++this.ld,this.od&&this.ld>1){const{Wd:a}=this.Hd(Ml(i),this._d);a<5&&!this.Md&&this.jd(s,this.qd.Kd),this.Xd()}}},this.Zd=e,this.qd=r,this.Ps=n,this.Gd()}m(){this.Sd!==null&&(this.Sd(),this.Sd=null),this.xd!==null&&(this.xd(),this.xd=null),this.Pd!==null&&(this.Pd(),this.Pd=null),this.kd!==null&&(this.kd(),this.kd=null),this.yd!==null&&(this.yd(),this.yd=null),this.Cd!==null&&(this.Cd(),this.Cd=null),this.Jd(),this.Xd()}Qd(e){this.Pd&&this.Pd();const r=this.tf.bind(this);if(this.Pd=()=>{this.Zd.removeEventListener("mousemove",r)},this.Zd.addEventListener("mousemove",r),this.Nd(e))return;const n=this.Fd(e);this.jd(n,this.qd.if),this.Ad=!0}Xd(){this.od!==null&&clearTimeout(this.od),this.ld=0,this.od=null,this._d={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Yd(){this.dd!==null&&clearTimeout(this.dd),this.ud=0,this.dd=null,this.fd={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}tf(e){if(this.Id||this.wd!==null||this.Nd(e))return;const r=this.Fd(e);this.jd(r,this.qd.sf),this.Ad=!0}nf(e){const r=JA(e.changedTouches,Fe(this.Ed));if(r===null||(this.Bd=TS(e),this.Td!==null)||this.Vd)return;this.Dd=!0;const n=this.Hd(Ml(r),Fe(this.wd)),{ef:i,rf:s,Wd:a}=n;if(this.gd||!(a<5)){if(!this.gd){const o=.5*i,c=s>=o&&!this.Ps.hf(),u=o>s&&!this.Ps.af();c||u||(this.Vd=!0),this.gd=!0,this.bd=!0,this.Jd(),this.Yd()}if(!this.Vd){const o=this.Fd(e,r);this.Ud(o,this.qd.lf),Lm(e)}}}_f(e){if(e.button!==0)return;const r=this.Hd(Ml(e),Fe(this.md)),{Wd:n}=r;if(n>=5&&(this.Md=!0,this.Xd()),this.Md){const i=this.Fd(e);this.jd(i,this.qd.uf)}}Hd(e,r){const n=Math.abs(r._t-e._t),i=Math.abs(r.ut-e.ut);return{ef:n,rf:i,Wd:n+i}}cf(e){let r=JA(e.changedTouches,Fe(this.Ed));if(r===null&&e.touches.length===0&&(r=e.changedTouches[0]),r===null)return;this.Ed=null,this.Bd=TS(e),this.Jd(),this.wd=null,this.yd&&(this.yd(),this.yd=null);const n=this.Fd(e,r);if(this.Ud(n,this.qd.df),++this.ud,this.dd&&this.ud>1){const{Wd:i}=this.Hd(Ml(r),this.fd);i<30&&!this.bd&&this.Ud(n,this.qd.$d),this.Yd()}else this.bd||(this.Ud(n,this.qd.ff),this.qd.ff&&Lm(e));this.ud===0&&Lm(e),e.touches.length===0&&this.vd&&(this.vd=!1,Lm(e))}Ld(e){if(e.button!==0)return;const r=this.Fd(e);if(this.md=null,this.Id=!1,this.kd&&(this.kd(),this.kd=null),RQ()&&this.Zd.ownerDocument.documentElement.removeEventListener("mouseleave",this.zd),!this.Nd(e))if(this.jd(r,this.qd.pf),++this.ld,this.od&&this.ld>1){const{Wd:n}=this.Hd(Ml(e),this._d);n<5&&!this.Md&&this.jd(r,this.qd.Kd),this.Xd()}else this.Md||this.jd(r,this.qd.vf)}Jd(){this.pd!==null&&(clearTimeout(this.pd),this.pd=null)}mf(e){if(this.Ed!==null)return;const r=e.changedTouches[0];this.Ed=r.identifier,this.Bd=TS(e);const n=this.Zd.ownerDocument.documentElement;this.bd=!1,this.gd=!1,this.Vd=!1,this.wd=Ml(r),this.yd&&(this.yd(),this.yd=null);{const s=this.nf.bind(this),a=this.cf.bind(this);this.yd=()=>{n.removeEventListener("touchmove",s),n.removeEventListener("touchend",a)},n.addEventListener("touchmove",s,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),this.Jd(),this.pd=setTimeout(this.wf.bind(this,e),240)}const i=this.Fd(e,r);this.Ud(i,this.qd.gf),this.dd||(this.ud=0,this.dd=setTimeout(this.Yd.bind(this),500),this.fd=Ml(r))}Mf(e){if(e.button!==0)return;const r=this.Zd.ownerDocument.documentElement;RQ()&&r.addEventListener("mouseleave",this.zd),this.Md=!1,this.md=Ml(e),this.kd&&(this.kd(),this.kd=null);{const i=this._f.bind(this),s=this.Ld.bind(this);this.kd=()=>{r.removeEventListener("mousemove",i),r.removeEventListener("mouseup",s)},r.addEventListener("mousemove",i),r.addEventListener("mouseup",s)}if(this.Id=!0,this.Nd(e))return;const n=this.Fd(e);this.jd(n,this.qd.bf),this.od||(this.ld=0,this.od=setTimeout(this.Xd.bind(this),500),this._d=Ml(e))}Gd(){this.Zd.addEventListener("mouseenter",this.Qd.bind(this)),this.Zd.addEventListener("touchcancel",this.Jd.bind(this));{const e=this.Zd.ownerDocument,r=n=>{this.qd.Sf&&(n.composed&&this.Zd.contains(n.composedPath()[0])||n.target&&this.Zd.contains(n.target)||this.qd.Sf())};this.xd=()=>{e.removeEventListener("touchstart",r)},this.Sd=()=>{e.removeEventListener("mousedown",r)},e.addEventListener("mousedown",r),e.addEventListener("touchstart",r,{passive:!0})}XA()&&(this.Cd=()=>{this.Zd.removeEventListener("dblclick",this.Od)},this.Zd.addEventListener("dblclick",this.Od)),this.Zd.addEventListener("mouseleave",this.xf.bind(this)),this.Zd.addEventListener("touchstart",this.mf.bind(this),{passive:!0}),Gnt(this.Zd),this.Zd.addEventListener("mousedown",this.Mf.bind(this)),this.Cf(),this.Zd.addEventListener("touchmove",(()=>{}),{passive:!1})}Cf(){this.qd.Pf===void 0&&this.qd.kf===void 0&&this.qd.yf===void 0||(this.Zd.addEventListener("touchstart",(e=>this.Tf(e.touches)),{passive:!0}),this.Zd.addEventListener("touchmove",(e=>{if(e.touches.length===2&&this.Td!==null&&this.qd.kf!==void 0){const r=IQ(e.touches[0],e.touches[1])/this.Rd;this.qd.kf(this.Td,r),Lm(e)}}),{passive:!1}),this.Zd.addEventListener("touchend",(e=>{this.Tf(e.touches)})))}Tf(e){e.length===1&&(this.Dd=!1),e.length!==2||this.Dd||this.vd?this.Rf():this.Df(e)}Df(e){const r=this.Zd.getBoundingClientRect()||{left:0,top:0};this.Td={_t:(e[0].clientX-r.left+(e[1].clientX-r.left))/2,ut:(e[0].clientY-r.top+(e[1].clientY-r.top))/2},this.Rd=IQ(e[0],e[1]),this.qd.Pf!==void 0&&this.qd.Pf(),this.Jd()}Rf(){this.Td!==null&&(this.Td=null,this.qd.yf!==void 0&&this.qd.yf())}xf(e){if(this.Pd&&this.Pd(),this.Nd(e)||!this.Ad)return;const r=this.Fd(e);this.jd(r,this.qd.Vf),this.Ad=!XA()}wf(e){const r=JA(e.touches,Fe(this.Ed));if(r===null)return;const n=this.Fd(e,r);this.Ud(n,this.qd.If),this.bd=!0,this.vd=!0}Nd(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:TS(e)<this.Bd+500}Ud(e,r){r&&r.call(this.qd,e)}jd(e,r){r&&r.call(this.qd,e)}Fd(e,r){const n=r||e,i=this.Zd.getBoundingClientRect()||{left:0,top:0};return{clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,localX:n.clientX-i.left,localY:n.clientY-i.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Bf:!e.type.startsWith("mouse")&&e.type!=="contextmenu"&&e.type!=="click",Ef:e.type,Af:n.target,a_:e.view,zf:()=>{e.type!=="touchstart"&&Lm(e)}}}}function IQ(t,e){const r=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(r*r+n*n)}function Lm(t){t.cancelable&&t.preventDefault()}function Ml(t){return{_t:t.pageX,ut:t.pageY}}function TS(t){return t.timeStamp||performance.now()}function JA(t,e){for(let r=0;r<t.length;++r)if(t[r].identifier===e)return t[r];return null}class Wnt{constructor(e,r,n){this.Lf=null,this.Of=null,this.Nf=!0,this.Ff=null,this.Wf=e,this.Hf=e.Uf()[r],this.$f=e.Uf()[n],this.qf=document.createElement("tr"),this.qf.style.height="1px",this.Yf=document.createElement("td"),this.Yf.style.position="relative",this.Yf.style.padding="0",this.Yf.style.margin="0",this.Yf.setAttribute("colspan","3"),this.jf(),this.qf.appendChild(this.Yf),this.Nf=this.Wf.N().layout.panes.enableResize,this.Nf?this.Kf():(this.Lf=null,this.Of=null)}m(){this.Of!==null&&this.Of.m()}Xf(){return this.qf}Zf(){return qr({width:this.Hf.Zf().width,height:1})}Gf(){return qr({width:this.Hf.Gf().width,height:1*window.devicePixelRatio})}Jf(e,r,n){const i=this.Gf();e.fillStyle=this.Wf.N().layout.panes.separatorColor,e.fillRect(r,
4214n,i.width,i.height)}kt(){this.jf(),this.Wf.N().layout.panes.enableResize!==this.Nf&&(this.Nf=this.Wf.N().layout.panes.enableResize,this.Nf?this.Kf():(this.Lf!==null&&(this.Yf.removeChild(this.Lf.Qf),this.Yf.removeChild(this.Lf.tp),this.Lf=null),this.Of!==null&&(this.Of.m(),this.Of=null)))}Kf(){const e=document.createElement("div"),r=e.style;r.position="fixed",r.display="none",r.zIndex="49",r.top="0",r.left="0",r.width="100%",r.height="100%",r.cursor="row-resize",this.Yf.appendChild(e);const n=document.createElement("div"),i=n.style;i.position="absolute",i.zIndex="50",i.top="-4px",i.height="9px",i.width="100%",i.backgroundColor="",i.cursor="row-resize",this.Yf.appendChild(n);const s={if:this.ip.bind(this),Vf:this.sp.bind(this),bf:this.np.bind(this),gf:this.np.bind(this),uf:this.ep.bind(this),lf:this.ep.bind(this),pf:this.rp.bind(this),df:this.rp.bind(this)};this.Of=new pN(n,s,{hf:()=>!1,af:()=>!0}),this.Lf={tp:n,Qf:e}}jf(){this.Yf.style.background=this.Wf.N().layout.panes.separatorColor}ip(e){this.Lf!==null&&(this.Lf.tp.style.backgroundColor=this.Wf.N().layout.panes.separatorHoverColor)}sp(e){this.Lf!==null&&this.Ff===null&&(this.Lf.tp.style.backgroundColor="")}np(e){if(this.Lf===null)return;const r=this.Hf.hp().Io()+this.$f.hp().Io(),n=r/(this.Hf.Zf().height+this.$f.Zf().height),i=30*n;r<=2*i||(this.Ff={ap:e.pageY,lp:this.Hf.hp().Io(),op:r-i,_p:r,up:n,cp:i},this.Lf.Qf.style.display="block")}ep(e){const r=this.Ff;if(r===null)return;const n=(e.pageY-r.ap)*r.up,i=Tg(r.lp+n,r.cp,r.op);this.Hf.hp().Bo(i),this.$f.hp().Bo(r._p-i),this.Wf.Qt().Bh()}rp(e){this.Ff!==null&&this.Lf!==null&&(this.Ff=null,this.Lf.Qf.style.display="none")}}function eD(t,e){return t.dp-e.dp}function tD(t,e,r){const n=(t.dp-e.dp)/(t.wt-e.wt);return Math.sign(n)*Math.min(Math.abs(n),r)}class Hnt{constructor(e,r,n,i){this.fp=null,this.pp=null,this.vp=null,this.mp=null,this.wp=null,this.gp=0,this.Mp=0,this.bp=e,this.Sp=r,this.xp=n,this.Mn=i}Cp(e,r){if(this.fp!==null){if(this.fp.wt===r)return void(this.fp.dp=e);if(Math.abs(this.fp.dp-e)<this.Mn)return}this.mp=this.vp,this.vp=this.pp,this.pp=this.fp,this.fp={wt:r,dp:e}}le(e,r){if(this.fp===null||this.pp===null||r-this.fp.wt>50)return;let n=0;const i=tD(this.fp,this.pp,this.Sp),s=eD(this.fp,this.pp),a=[i],o=[s];if(n+=s,this.vp!==null){const u=tD(this.pp,this.vp,this.Sp);if(Math.sign(u)===Math.sign(i)){const d=eD(this.pp,this.vp);if(a.push(u),o.push(d),n+=d,this.mp!==null){const f=tD(this.vp,this.mp,this.Sp);if(Math.sign(f)===Math.sign(i)){const h=eD(this.vp,this.mp);a.push(f),o.push(h),n+=h}}}}let c=0;for(let u=0;u<a.length;++u)c+=o[u]/n*a[u];Math.abs(c)<this.bp||(this.wp={dp:e,wt:r},this.Mp=c,this.gp=(function(u,d){const f=Math.log(d);return Math.log(1*f/-u)/f})(Math.abs(c),this.xp))}Ru(e){const r=Fe(this.wp),n=e-r.wt;return r.dp+this.Mp*(Math.pow(this.xp,n)-1)/Math.log(this.xp)}Tu(e){return this.wp===null||this.Pp(e)===this.gp}Pp(e){const r=e-Fe(this.wp).wt;return Math.min(r,this.gp)}}class qnt{constructor(e,r){this.kp=void 0,this.yp=void 0,this.Tp=void 0,this.ps=!1,this.Rp=e,this.Dp=r,this.Vp()}kt(){this.Vp()}Ip(){this.kp&&this.Rp.removeChild(this.kp),this.yp&&this.Rp.removeChild(this.yp),this.kp=void 0,this.yp=void 0}Bp(){return this.ps!==this.Ep()||this.Tp!==this.Ap()}Ap(){return this.Dp.Qt().Xi().J(this.Dp.N().layout.textColor)>160?"dark":"light"}Ep(){return this.Dp.N().layout.attributionLogo}zp(){const e=new URL(location.href);return e.hostname?"&utm_source="+e.hostname+e.pathname:""}Vp(){this.Bp()&&(this.Ip(),this.ps=this.Ep(),this.ps&&(this.Tp=this.Ap(),this.yp=document.createElement("style"),this.yp.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.kp=document.createElement("a"),this.kp.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.zp()}`,this.kp.title="Charting by TradingView",this.kp.id="tv-attr-logo",this.kp.target="_blank",this.kp.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.kp.toggleAttribute("data-dark",this.Tp==="dark"),this.Rp.appendChild(this.yp),this.Rp.appendChild(this.kp)))}}function Mp(t,e){const r=Fe(t.ownerDocument).createElement("canvas");t.appendChild(r);const n=Drt(r,{options:{allowResizeObserver:!0},transform:(i,s)=>({width:Math.max(i.width,s.width),height:Math.max(i.height,s.height)})});return n.resizeCanvasElement(e),n}function Ap(t){t.width=1,t.height=1,t.getContext("2d")?.clearRect(0,0,1,1)}function u5(t,e,r,n){t.ih&&t.ih(e,r,n)}function Rk(t,e,r,n){t.nt(e,r,n)}function d5(t,e,r,n){const i=t(r,n);for(const s of i){const a=s.Tt(n);a!==null&&e(a)}}function rD(t,e){return r=>(function(n){return n.Ft!==void 0})(r)?(r.Ft()?.wa()??"")!==e?[]:r.ta?.(t)??[]:[]}function LQ(t,e,r,n){if(!t.length)return;let i=0;const s=t[0].$t(n,!0);let a=e===1?r/2-(t[0].Fi()-s/2):t[0].Fi()-s/2-r/2;a=Math.max(0,a);for(let o=1;o<t.length;
4214o++){const c=t[o],u=t[o-1],d=u.$t(n,!1),f=c.Fi(),h=u.Fi();if(e===1?f>h-d:f<h+d){const m=h-d*e;c.Wi(m);const y=m-e*d/2;if((e===1?y<0:y>r)&&a>0){const x=e===1?-1-y:y-r,v=Math.min(x,a);for(let _=i;_<t.length;_++)t[_].Wi(t[_].Fi()+e*v);a-=v}}else i=o,a=e===1?h-d-f:f-(h+d)}}class $Q{constructor(e,r,n,i){this.Yi=null,this.Lp=null,this.Op=!1,this.Np=new sC(200),this.Fp=null,this.Wp=0,this.Hp=!1,this.Up=()=>{this.Hp||this.Pt.$p().Qt().ar()},this.qp=()=>{this.Hp||this.Pt.$p().Qt().ar()},this.Pt=e,this.Ps=r,this.bl=r.layout,this.Gu=n,this.Yp=i==="left",this.jp=rD("normal",i),this.Kp=rD("top",i),this.Xp=rD("bottom",i),this.Yf=document.createElement("div"),this.Yf.style.height="100%",this.Yf.style.overflow="hidden",this.Yf.style.width="25px",this.Yf.style.left="0",this.Yf.style.position="relative",this.Zp=Mp(this.Yf,qr({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const s=this.Zp.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Gp=Mp(this.Yf,qr({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const a=this.Gp.canvasElement;a.style.position="absolute",a.style.zIndex="2",a.style.left="0",a.style.top="0";const o={bf:this.np.bind(this),gf:this.np.bind(this),uf:this.ep.bind(this),lf:this.ep.bind(this),Sf:this.Jp.bind(this),pf:this.rp.bind(this),df:this.rp.bind(this),Kd:this.Qp.bind(this),$d:this.Qp.bind(this),if:this.tv.bind(this),Vf:this.sp.bind(this)};this.Of=new pN(this.Gp.canvasElement,o,{hf:()=>!this.Ps.handleScroll.vertTouchDrag,af:()=>!0})}m(){this.Of.m(),this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),Ap(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),Ap(this.Zp.canvasElement),this.Zp.dispose(),this.Yi!==null&&this.Yi.no().u(this),this.Yi=null}Xf(){return this.Yf}P(){return this.bl.fontSize}iv(){const e=this.Gu.N();return this.Fp!==e.k&&(this.Np.In(),this.Fp=e.k),e}sv(){if(this.Yi===null)return 0;let e=0;const r=this.iv(),n=Fe(this.Zp.canvasElement.getContext("2d",{colorSpace:this.Pt.$p().N().layout.colorSpace}));n.save();const i=this.Yi.Va();n.font=this.nv(),i.length>0&&(e=Math.max(this.Np.Vi(n,i[0].Ga),this.Np.Vi(n,i[i.length-1].Ga)));const s=this.ev();for(let u=s.length;u--;){const d=this.Np.Vi(n,s[u].ri());d>e&&(e=d)}const a=this.Yi.zt();if(a!==null&&this.Lp!==null&&(o=this.Ps.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){const u=this.Yi.Ts(1,a),d=this.Yi.Ts(this.Lp.height-2,a);e=Math.max(e,this.Np.Vi(n,this.Yi.Zi(Math.floor(Math.min(u,d))+.11111111111111,a)),this.Np.Vi(n,this.Yi.Zi(Math.ceil(Math.max(u,d))-.11111111111111,a)))}var o;n.restore();const c=e||34;return c5(Math.ceil(r.S+r.C+r.I+r.B+5+c))}rv(e){this.Lp!==null&&rp(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`)}hv(){return Fe(this.Lp).width}_s(e){this.Yi!==e&&(this.Yi!==null&&this.Yi.no().u(this),this.Yi=e,e.no().i(this.ul.bind(this),this))}Ft(){return this.Yi}In(){const e=this.Pt.hp();this.Pt.$p().Qt().Zo(e,Fe(this.Ft()))}av(e){if(this.Lp===null)return;const r={colorSpace:this.Pt.$p().N().layout.colorSpace};if(e!==1){this.lv(),this.Zp.applySuggestedBitmapSize();const i=Np(this.Zp,r);i!==null&&(i.useBitmapCoordinateSpace((s=>{this.ov(s),this._v(s)})),this.Pt.uv(i,this.Xp),this.cv(i),this.Pt.uv(i,this.jp),this.dv(i))}this.Gp.applySuggestedBitmapSize();const n=Np(this.Gp,r);n!==null&&(n.useBitmapCoordinateSpace((({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)})),this.fv(n),this.Pt.uv(n,this.Kp))}Gf(){return this.Zp.bitmapSize}Jf(e,r,n){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,r,n)}kt(){this.Yi?.Va()}np(e){if(this.Yi===null||this.Yi.Ki()||!this.Ps.handleScale.axisPressedMouseMove.price)return;const r=this.Pt.$p().Qt(),n=this.Pt.hp();this.Op=!0,r.Uo(n,this.Yi,e.localY)}ep(e){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const r=this.Pt.$p().Qt(),n=this.Pt.hp(),i=this.Yi;r.$o(n,i,e.localY)}Jp(){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const e=this.Pt.$p().Qt(),r=this.Pt.hp(),n=this.Yi;this.Op&&(this.Op=!1,e.qo(r,n))}rp(e){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const r=this.Pt.$p().Qt(),n=this.Pt.hp();this.Op=!1,r.qo(n,this.Yi)}Qp(e){this.Ps.handleScale.axisDoubleClickReset.price&&this.In()}tv(e){this.Yi!==null&&(!this.Pt.$p().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Le()||this.Yi.Vl()||this.pv(1))}sp(e){this.pv(0)}ev(){const e=[],r=this.Yi===null?void 0:this.Yi;return(n=>{for(let i=0;i<n.length;++i){const s=n[i].Ws(this.Pt.hp(),r);for(let a=0;a<s.length;
4214a++)e.push(s[a])}})(this.Pt.hp().Dt()),e}ov({context:e,bitmapSize:r}){const{width:n,height:i}=r,s=this.Pt.hp().Qt(),a=s.$(),o=s.Fc();a===o?cN(e,0,0,n,i,a):Ume(e,0,0,n,i,a,o)}_v({context:e,bitmapSize:r,horizontalPixelRatio:n}){if(this.Lp===null||this.Yi===null||!this.Yi.N().borderVisible)return;e.fillStyle=this.Yi.N().borderColor;const i=Math.max(1,Math.floor(this.iv().S*n));let s;s=this.Yp?r.width-i:0,e.fillRect(s,0,i,r.height)}cv(e){if(this.Lp===null||this.Yi===null)return;const r=this.Yi.Va(),n=this.Yi.N(),i=this.iv(),s=this.Yp?this.Lp.width-i.C:0;n.borderVisible&&n.ticksVisible&&e.useBitmapCoordinateSpace((({context:a,horizontalPixelRatio:o,verticalPixelRatio:c})=>{a.fillStyle=n.borderColor;const u=Math.max(1,Math.floor(c)),d=Math.floor(.5*c),f=Math.round(i.C*o);a.beginPath();for(const h of r)a.rect(Math.floor(s*o),Math.round(h.ka*c)-d,f,u);a.fill()})),e.useMediaCoordinateSpace((({context:a})=>{a.font=this.nv(),a.fillStyle=n.textColor??this.bl.textColor,a.textAlign=this.Yp?"right":"left",a.textBaseline="middle";const o=this.Yp?Math.round(s-i.I):Math.round(s+i.C+i.I),c=r.map((u=>this.Np.Di(a,u.Ga)));for(let u=r.length;u--;){const d=r[u];a.fillText(d.Ga,o,d.ka+c[u])}}))}lv(){if(this.Lp===null||this.Yi===null)return;let e=this.Lp.height/2;const r=[],n=this.Yi.Dt().slice(),i=this.Pt.hp(),s=this.iv();this.Yi===i.$n()&&this.Pt.hp().Dt().forEach((c=>{i.Un(c)&&n.push(c)}));const a=this.Yi.ba()[0],o=this.Yi;n.forEach((c=>{const u=c.Ws(i,o);u.forEach((d=>{d.Wi(null),d.Hi()&&r.push(d)})),a===c&&u.length>0&&(e=u[0].Bi())})),r.forEach((c=>c.Wi(c.Bi()))),this.Yi.N().alignLabels&&this.vv(r,s,e)}vv(e,r,n){if(this.Lp===null)return;const i=e.filter((a=>a.Bi()<=n)),s=e.filter((a=>a.Bi()>n));i.sort(((a,o)=>o.Bi()-a.Bi())),i.length&&s.length&&s.push(i[0]),s.sort(((a,o)=>a.Bi()-o.Bi()));for(const a of e){const o=Math.floor(a.$t(r)/2),c=a.Bi();c>-o&&c<o&&a.Wi(o),c>this.Lp.height-o&&c<this.Lp.height+o&&a.Wi(this.Lp.height-o)}LQ(i,1,this.Lp.height,r),LQ(s,-1,this.Lp.height,r)}dv(e){if(this.Lp===null)return;const r=this.ev(),n=this.iv(),i=this.Yp?"right":"left";r.forEach((s=>{s.Ui()&&s.Tt(Fe(this.Yi)).nt(e,n,this.Np,i)}))}fv(e){if(this.Lp===null||this.Yi===null)return;const r=this.Pt.$p().Qt(),n=[],i=this.Pt.hp(),s=r._c().Ws(i,this.Yi);s.length&&n.push(s);const a=this.iv(),o=this.Yp?"right":"left";n.forEach((c=>{c.forEach((u=>{u.Tt(Fe(this.Yi)).nt(e,a,this.Np,o)}))}))}pv(e){this.Yf.style.cursor=e===1?"ns-resize":"default"}ul(){const e=this.sv();this.Wp<e&&this.Pt.$p().Qt().Bh(),this.Wp=e}nv(){return iC(this.bl.fontSize,this.bl.fontFamily)}}function Ynt(t,e){return t.Jh?.(e)??[]}function FQ(t,e){return t.Fs?.(e)??[]}function zQ(t,e){return t.us?.(e)??[]}function Knt(t,e){return t.Xh?.(e)??[]}class YV{constructor(e,r){this.Lp=qr({width:0,height:0}),this.mv=null,this.wv=null,this.gv=null,this.Mv=null,this.bv=!1,this.Sv=new Xn,this.xv=new Xn,this.Cv=0,this.Pv=!1,this.kv=null,this.yv=!1,this.Tv=null,this.Rv=null,this.Hp=!1,this.Up=()=>{this.Hp||this.Dv===null||this.ts().ar()},this.qp=()=>{this.Hp||this.Dv===null||this.ts().ar()},this.Dp=e,this.Dv=r,this.Dv.t_().i(this.Vv.bind(this),this,!0),this.Iv=document.createElement("td"),this.Iv.style.padding="0",this.Iv.style.position="relative";const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="relative",n.style.overflow="hidden",this.Bv=document.createElement("td"),this.Bv.style.padding="0",this.Ev=document.createElement("td"),this.Ev.style.padding="0",this.Iv.appendChild(n),this.Zp=Mp(n,qr({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const i=this.Zp.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.Gp=Mp(n,qr({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const s=this.Gp.canvasElement;s.style.position="absolute",s.style.zIndex="2",s.style.left="0",s.style.top="0",this.qf=document.createElement("tr"),this.qf.appendChild(this.Bv),this.qf.appendChild(this.Iv),this.qf.appendChild(this.Ev),this.Av(),this.Of=new pN(this.Gp.canvasElement,this,{hf:()=>this.kv===null&&!this.Dp.N().handleScroll.vertTouchDrag,af:()=>this.kv===null&&!this.Dp.N().handleScroll.horzTouchDrag})}m(){this.mv!==null&&this.mv.m(),this.wv!==null&&this.wv.m(),this.gv=null,this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),Ap(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),Ap(this.Zp.canvasElement),this.Zp.dispose(),this.Dv!==null&&(this.Dv.t_().u(this),this.Dv.m()),this.Of.m()}hp(){return Fe(this.Dv)}zv(e){this.Dv!==null&&this.Dv.t_().u(this),this.Dv=e,this.Dv!==null&&this.Dv.t_().i(YV.prototype.Vv.bind(this),this,!0),this.Av(),this.Dp.Uf().indexOf(this)===this.Dp.Uf().length-1?(this.gv=this.gv??new qnt(this.Iv,this.Dp),this.gv.kt()):(this.gv?.Ip(),this.gv=null)}$p(){return this.Dp}Xf(){return this.qf}Av(){if(this.Dv!==null&&(this.Lv(),this.ts().js().length!==0)){if(this.mv!==null){const e=this.Dv.Wo();this.mv._s(Fe(e))}if(this.wv!==null){const e=this.Dv.Ho();this.wv._s(Fe(e))}}}Ov(){this.mv!==null&&this.mv.kt(),this.wv!==null&&this.wv.kt()}Io(){return this.Dv!==null?this.Dv.Io():0}Bo(e){this.Dv&&this.Dv.Bo(e)}if(e){if(!this.Dv)return;this.Nv();const r=e.localX,n=e.localY;this.Fv(r,n,e)}bf(e){this.Nv(),this.Wv(),this.Fv(e.localX,e.localY,e)}sf(e){if(!this.Dv)return;this.Nv();const r=e.localX,n=e.localY;this.Fv(r,n,e)}vf(e){this.Dv!==null&&(this.Nv(),this.Hv(e))}Kd(e){this.Dv!==null&&this.Uv(this.xv,e)}$d(e){this.Kd(e)}uf(e){this.Nv(),this.$v(e),this.Fv(e.localX,e.localY,e)}pf(e){this.Dv!==null&&(this.Nv(),this.Pv=!1,this.qv(e))}ff(e){this.Dv!==null&&this.Hv(e)}If(e){if(this.Pv=!0,this.kv===null){const r={x:e.localX,y:e.localY};this.Yv(r,r,e)}}Vf(e){this.Dv!==null&&(this.Nv(),this.Dv.Qt().ac(null),this.jv())}Kv(){return this.Sv}Xv(){return this.xv}Pf(){this.Cv=1,this.ts().hn()}kf(e,r){if(!this.Dp.N().handleScale.pinch)return;const n=5*(r-this.Cv);this.Cv=r,this.ts().Mc(e._t,n)}gf(e){this.Pv=!1,this.yv=this.kv!==null,this.Wv();const r=this.ts()._c();this.kv!==null&&r.Vt()&&(this.Tv={x:r.si(),y:r.ni()},this.kv={x:e.localX,y:e.localY})}lf(e){if(this.Dv===null)return;const r=e.localX,n=e.localY;if(this.kv===null)this.$v(e);else{this.yv=!1;const i=Fe(this.Tv),s=i.x+(r-this.kv.x),a=i.y+(n-this.kv.y);this.Fv(s,a,e)}}df(e){this.$p().N().trackingMode.exitMode===0&&(this.yv=!0),this.Zv(),this.qv(e)}jn(e,r){const n=this.Dv;return n===null?null:ege(n,e,r)}Gv(e,r){Fe(r==="left"?this.mv:this.wv).rv(qr({width:e,height:this.Lp.height}))}Zf(){return this.Lp}rv(e){rp(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Iv.style.width=e.width+"px",this.Iv.style.height=e.height+"px")}Jv(){const e=Fe(this.Dv);e.Fo(e.Wo()),e.Fo(e.Ho());for(const r of e.ba())if(e.Un(r)){const n=r.Ft();n!==null&&e.Fo(n),r.Ns()}for(const r of e.s_())r.Ns()}Gf(){return this.Zp.bitmapSize}Jf(e,r,n){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,r,n)}av(e){if(e===0||this.Dv===null)return;e>1&&this.Jv(),this.mv!==null&&this.mv.av(e),this.wv!==null&&this.wv.av(e);const r={colorSpace:this.Dp.N().layout.colorSpace};if(e!==1){this.Zp.applySuggestedBitmapSize();const i=Np(this.Zp,r);i!==null&&(i.useBitmapCoordinateSpace((s=>{this.ov(s)})),this.Dv&&(this.Qv(i,Ynt),this.tm(i),this.Qv(i,FQ),this.Qv(i,zQ)))}this.Gp.applySuggestedBitmapSize();const n=Np(this.Gp,r);n!==null&&(n.useBitmapCoordinateSpace((({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)})),this.im(n),this.Qv(n,Knt),this.Qv(n,zQ))}sm(){return this.mv}nm(){return this.wv}
4214uv(e,r){this.Qv(e,r)}Vv(){this.Dv!==null&&this.Dv.t_().u(this),this.Dv=null}Hv(e){this.Uv(this.Sv,e)}Uv(e,r){const n=r.localX,i=r.localY;e.v()&&e.p(this.ts().Et().uu(n),{x:n,y:i},r)}ov({context:e,bitmapSize:r}){const{width:n,height:i}=r,s=this.ts(),a=s.$(),o=s.Fc();a===o?cN(e,0,0,n,i,o):Ume(e,0,0,n,i,a,o)}tm(e){const r=Fe(this.Dv),n=r.i_().lr().Tt(r);n!==null&&n.nt(e,!1)}im(e){this.rm(e,FQ,Rk,this.ts()._c())}Qv(e,r){const n=Fe(this.Dv),i=n.Dt(),s=n.s_();for(const a of s)this.rm(e,r,u5,a);for(const a of i)this.rm(e,r,u5,a);for(const a of s)this.rm(e,r,Rk,a);for(const a of i)this.rm(e,r,Rk,a)}rm(e,r,n,i){const s=Fe(this.Dv),a=s.Qt().hc(),o=a!==null&&a.n_===i,c=a!==null&&o&&a.e_!==void 0?a.e_.Xn:void 0;d5(r,(u=>n(u,e,o,c)),i,s)}Lv(){if(this.Dv===null)return;const e=this.Dp,r=this.Dv.Wo().N().visible,n=this.Dv.Ho().N().visible;r||this.mv===null||(this.Bv.removeChild(this.mv.Xf()),this.mv.m(),this.mv=null),n||this.wv===null||(this.Ev.removeChild(this.wv.Xf()),this.wv.m(),this.wv=null);const i=e.Qt().Vc();r&&this.mv===null&&(this.mv=new $Q(this,e.N(),i,"left"),this.Bv.appendChild(this.mv.Xf())),n&&this.wv===null&&(this.wv=new $Q(this,e.N(),i,"right"),this.Ev.appendChild(this.wv.Xf()))}hm(e){return e.Bf&&this.Pv||this.kv!==null}am(e){return Math.max(0,Math.min(e,this.Lp.width-1))}lm(e){return Math.max(0,Math.min(e,this.Lp.height-1))}Fv(e,r,n){this.ts().yc(this.am(e),this.lm(r),n,Fe(this.Dv))}jv(){this.ts().Rc()}Zv(){this.yv&&(this.kv=null,this.jv())}Yv(e,r,n){this.kv=e,this.yv=!1,this.Fv(r.x,r.y,n);const i=this.ts()._c();this.Tv={x:i.si(),y:i.ni()}}ts(){return this.Dp.Qt()}qv(e){if(!this.bv)return;const r=this.ts(),n=this.hp();if(r.Ko(n,n.ys()),this.Mv=null,this.bv=!1,r.Cc(),this.Rv!==null){const i=performance.now(),s=r.Et();this.Rv.le(s.wu(),i),this.Rv.Tu(i)||r._n(this.Rv)}}Nv(){this.kv=null}Wv(){if(this.Dv){if(this.ts().hn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)Fe(document.activeElement).blur();else{const e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Dv.ys().Ki()&&this.ts().Et().Ki()}}$v(e){if(this.Dv===null)return;const r=this.ts(),n=r.Et();if(n.Ki())return;const i=this.Dp.N(),s=i.handleScroll,a=i.kineticScroll;if((!s.pressedMouseMove||e.Bf)&&(!s.horzTouchDrag&&!s.vertTouchDrag||!e.Bf))return;const o=this.Dv.ys(),c=performance.now();if(this.Mv!==null||this.hm(e)||(this.Mv={x:e.clientX,y:e.clientY,ed:c,om:e.localX,_m:e.localY}),this.Mv!==null&&!this.bv&&(this.Mv.x!==e.clientX||this.Mv.y!==e.clientY)){if(e.Bf&&a.touch||!e.Bf&&a.mouse){const u=n.vu();this.Rv=new Hnt(.2/u,7/u,.997,15/u),this.Rv.Cp(n.wu(),this.Mv.ed)}else this.Rv=null;o.Ki()||r.Yo(this.Dv,o,e.localY),r.Sc(e.localX),this.bv=!0}this.bv&&(o.Ki()||r.jo(this.Dv,o,e.localY),r.xc(e.localX),this.Rv!==null&&this.Rv.Cp(n.wu(),c))}}class BQ{constructor(e,r,n,i,s){this.xt=!0,this.Lp=qr({width:0,height:0}),this.Up=()=>this.av(3),this.Yp=e==="left",this.Gu=n.Vc,this.Ps=r,this.um=i,this.dm=s,this.Yf=document.createElement("div"),this.Yf.style.width="25px",this.Yf.style.height="100%",this.Yf.style.overflow="hidden",this.Zp=Mp(this.Yf,qr({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up)}m(){this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),Ap(this.Zp.canvasElement),this.Zp.dispose()}Xf(){return this.Yf}Zf(){return this.Lp}rv(e){rp(this.Lp,e)||(this.Lp=e,this.Zp.resizeCanvasElement(e),this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`,this.xt=!0)}av(e){if(e<3&&!this.xt||this.Lp.width===0||this.Lp.height===0)return;this.xt=!1,this.Zp.applySuggestedBitmapSize();const r=Np(this.Zp,{colorSpace:this.Ps.layout.colorSpace});r!==null&&r.useBitmapCoordinateSpace((n=>{this.ov(n),this._v(n)}))}Gf(){return this.Zp.bitmapSize}Jf(e,r,n){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,r,n)}_v({context:e,bitmapSize:r,horizontalPixelRatio:n,verticalPixelRatio:i}){if(!this.um())return;e.fillStyle=this.Ps.timeScale.borderColor;const s=Math.floor(this.Gu.N().S*n),a=Math.floor(this.Gu.N().S*i),o=this.Yp?r.width-s:0;e.fillRect(o,0,s,a)}ov({context:e,bitmapSize:r}){cN(e,0,0,r.width,r.height,this.dm())}}function KV(t){return e=>e.ia?.(t)??[]}const Qnt=KV("normal"),Znt=KV("top"),Xnt=KV("bottom");class Jnt{constructor(e,r){this.fm=null,this.pm=null,this.M=null,this.vm=!1,this.Lp=qr({width:0,height:0}),this.wm=new Xn,this.Np=new sC(5),this.Hp=!1,this.Up=()=>{this.Hp||this.Dp.Qt().ar()},this.qp=()=>{this.Hp||this.Dp.Qt().ar()},this.Dp=e,this.o_=r,this.Ps=e.N().layout,this.kp=document.createElement("tr"),this.gm=document.createElement("td"),this.gm.style.padding="0",this.Mm=document.createElement("td"),this.Mm.style.padding="0",this.Yf=document.createElement("td"),this.Yf.style.height="25px",this.Yf.style.padding="0",this.bm=document.createElement("div"),this.bm.style.width="100%",this.bm.style.height="100%",this.bm.style.position="relative",this.bm.style.overflow="hidden",this.Yf.appendChild(this.bm),this.Zp=Mp(this.bm,qr({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const n=this.Zp.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.Gp=Mp(this.bm,qr({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const i=this.Gp.canvasElement;i.style.position="absolute",i.style.zIndex="2",i.style.left="0",i.style.top="0",this.kp.appendChild(this.gm),this.kp.appendChild(this.Yf),this.kp.appendChild(this.Mm),this.Sm(),this.Dp.Qt().Vo().i(this.Sm.bind(this),this),this.Of=new pN(this.Gp.canvasElement,this,{hf:()=>!0,af:()=>!this.Dp.N().handleScroll.horzTouchDrag})}m(){this.Of.m(),this.fm!==null&&this.fm.m(),this.pm!==null&&this.pm.m(),this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),Ap(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),Ap(this.Zp.canvasElement),this.Zp.dispose()}Xf(){return this.kp}xm(){return this.fm}Cm(){return this.pm}bf(e){if(this.vm)return;this.vm=!0;const r=this.Dp.Qt();!r.Et().Ki()&&this.Dp.N().handleScale.axisPressedMouseMove.time&&r.gc(e.localX)}gf(e){this.bf(e)}Sf(){const e=this.Dp.Qt();!e.Et().Ki()&&this.vm&&(this.vm=!1,this.Dp.N().handleScale.axisPressedMouseMove.time&&e.kc())}uf(e){const r=this.Dp.Qt();!r.Et().Ki()&&this.Dp.N().handleScale.axisPressedMouseMove.time&&r.Pc(e.localX)}lf(e){this.uf(e)}pf(){this.vm=!1;const e=this.Dp.Qt();e.Et().Ki()&&!this.Dp.N().handleScale.axisPressedMouseMove.time||e.kc()}df(){this.pf()}Kd(){this.Dp.N().handleScale.axisDoubleClickReset.time&&this.Dp.Qt().cn()}$d(){this.Kd()}if(){this.Dp.Qt().N().handleScale.axisPressedMouseMove.time&&this.pv(1)}Vf(){this.pv(0)}Zf(){return this.Lp}Pm(){return this.wm}km(e,r,n){rp(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`,this.wm.p(e)),this.fm!==null&&this.fm.rv(qr({width:r,height:e.height})),this.pm!==null&&this.pm.rv(qr({width:n,height:e.height}))}ym(){const e=this.Tm();return Math.ceil(e.S+e.C+e.P+e.A+e.V+e.Rm)}kt(){this.Dp.Qt().Et().Va()}Gf(){return this.Zp.bitmapSize}Jf(e,r,n){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,r,n)}av(e){if(e===0)return;const r={colorSpace:this.Ps.colorSpace};if(e!==1){this.Zp.applySuggestedBitmapSize();const i=Np(this.Zp,r);i!==null&&(i.useBitmapCoordinateSpace((s=>{this.ov(s),this._v(s),this.Dm(i,Xnt)})),this.cv(i),this.Dm(i,Qnt)),this.fm!==null&&this.fm.av(e),this.pm!==null&&this.pm.av(e)}this.Gp.applySuggestedBitmapSize();const n=Np(this.Gp,r);n!==null&&(n.useBitmapCoordinateSpace((({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)})),this.Vm([...this.Dp.Qt().js(),this.Dp.Qt()._c()],n),this.Dm(n,Znt))}Dm(e,r){const n=this.Dp.Qt().js();for(const i of n)d5(r,(s=>u5(s,e,!1,void 0)),i,void 0);for(const i of n)d5(r,(s=>Rk(s,e,!1,void 0)),i,void 0)}ov({context:e,bitmapSize:r}){cN(e,0,0,r.width,r.height,this.Dp.Qt().Fc())}_v({context:e,bitmapSize:r,verticalPixelRatio:n}){if(this.Dp.N().timeScale.borderVisible){e.fillStyle=this.Im();const i=Math.max(1,Math.floor(this.Tm().S*n));e.fillRect(0,0,r.width,i)}}cv(e){const r=this.Dp.Qt().Et(),n=r.Va();if(!n||n.length===0)return;const i=this.o_.maxTickMarkWeight(n),s=this.Tm(),a=r.N();a.borderVisible&&a.ticksVisible&&e.useBitmapCoordinateSpace((({context:o,horizontalPixelRatio:c,verticalPixelRatio:u})=>{o.strokeStyle=this.Im(),o.fillStyle=this.Im();const d=Math.max(1,Math.floor(c)),f=Math.floor(.5*c);o.beginPath();const h=Math.round(s.C*u);for(let m=n.length;m--;){const y=Math.round(n[m].coord*c);o.rect(y-f,0,d,h)}o.fill()})),e.useMediaCoordinateSpace((({context:o})=>{const c=s.S+s.C+s.A+s.P/2;o.textAlign="center",o.textBaseline="middle",o.fillStyle=this.H(),o.font=this.nv();for(const u of n)if(u.weight<i){const d=u.needAlignCoordinate?this.Bm(o,u.coord,u.label):u.coord;o.fillText(u.label,d,c)}this.Dp.N().timeScale.allowBoldLabels&&(o.font=this.Em());for(const u of n)if(u.weight>=i){const d=u.needAlignCoordinate?this.Bm(o,u.coord,u.label):u.coord;o.fillText(u.label,d,c)}}))}Bm(e,r,n){const i=this.Np.Vi(e,n),s=i/2,a=Math.floor(r-s)+.5;return a<0?r+=Math.abs(0-a):a+i>this.Lp.width&&(r-=Math.abs(this.Lp.width-(a+i))),r}Vm(e,r){const n=this.Tm();
4214for(const i of e)for(const s of i.cs())s.Tt().nt(r,n)}Im(){return this.Dp.N().timeScale.borderColor}H(){return this.Ps.textColor}F(){return this.Ps.fontSize}nv(){return iC(this.F(),this.Ps.fontFamily)}Em(){return iC(this.F(),this.Ps.fontFamily,"bold")}Tm(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Gi:new sC,Rm:0});const e=this.M,r=this.nv();if(e.k!==r){const n=this.F();e.P=n,e.k=r,e.A=3*n/12,e.V=3*n/12,e.Ji=9*n/12,e.L=0,e.Rm=4*n/12,e.Gi.In()}return this.M}pv(e){this.Yf.style.cursor=e===1?"ew-resize":"default"}Sm(){const e=this.Dp.Qt(),r=e.N();r.leftPriceScale.visible||this.fm===null||(this.gm.removeChild(this.fm.Xf()),this.fm.m(),this.fm=null),r.rightPriceScale.visible||this.pm===null||(this.Mm.removeChild(this.pm.Xf()),this.pm.m(),this.pm=null);const n={Vc:this.Dp.Qt().Vc()},i=()=>r.leftPriceScale.borderVisible&&e.Et().N().borderVisible,s=()=>e.Fc();r.leftPriceScale.visible&&this.fm===null&&(this.fm=new BQ("left",r,n,i,s),this.gm.appendChild(this.fm.Xf())),r.rightPriceScale.visible&&this.pm===null&&(this.pm=new BQ("right",r,n,i,s),this.Mm.appendChild(this.pm.Xf()))}}const eit=!!oy&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>t.brand.includes("Chromium")))&&!!oy&&(navigator?.userAgentData?.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class tit{constructor(e,r,n){var i;this.Am=[],this.zm=[],this.Lm=0,this.sl=0,this.Mo=0,this.Om=0,this.Nm=0,this.Fm=null,this.Wm=!1,this.Sv=new Xn,this.xv=new Xn,this.Ku=new Xn,this.Hm=null,this.Um=null,this.Rp=e,this.Ps=r,this.o_=n,this.kp=document.createElement("div"),this.kp.classList.add("tv-lightweight-charts"),this.kp.style.overflow="hidden",this.kp.style.direction="ltr",this.kp.style.width="100%",this.kp.style.height="100%",(i=this.kp).style.userSelect="none",i.style.webkitUserSelect="none",i.style.msUserSelect="none",i.style.MozUserSelect="none",i.style.webkitTapHighlightColor="transparent",this.$m=document.createElement("table"),this.$m.setAttribute("cellspacing","0"),this.kp.appendChild(this.$m),this.qm=this.Ym.bind(this),nD(this.Ps)&&this.jm(!0),this.ts=new Fnt(this.Zu.bind(this),this.Ps,n),this.Qt().uc().i(this.Km.bind(this),this),this.Xm=new Jnt(this,this.o_),this.$m.appendChild(this.Xm.Xf());const s=r.autoSize&&this.Zm();let a=this.Ps.width,o=this.Ps.height;if(s||a===0||o===0){const c=e.getBoundingClientRect();a=a||c.width,o=o||c.height}this.Gm(a,o),this.Jm(),e.appendChild(this.kp),this.Qm(),this.ts.Et().Iu().i(this.ts.Bh.bind(this.ts),this),this.ts.Vo().i(this.ts.Bh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.Ps}Uf(){return this.Am}tw(){return this.Xm}m(){this.jm(!1),this.Lm!==0&&window.cancelAnimationFrame(this.Lm),this.ts.uc().u(this),this.ts.Et().Iu().u(this),this.ts.Vo().u(this),this.ts.m();for(const e of this.Am)this.$m.removeChild(e.Xf()),e.Kv().u(this),e.Xv().u(this),e.m();this.Am=[];for(const e of this.zm)this.iw(e);this.zm=[],Fe(this.Xm).m(),this.kp.parentElement!==null&&this.kp.parentElement.removeChild(this.kp),this.Ku.m(),this.Sv.m(),this.xv.m(),this.sw()}Gm(e,r,n=!1){if(this.sl===r&&this.Mo===e)return;const i=(function(o){const c=Math.floor(o.width),u=Math.floor(o.height);return qr({width:c-c%2,height:u-u%2})})(qr({width:e,height:r}));this.sl=i.height,this.Mo=i.width;const s=this.sl+"px",a=this.Mo+"px";Fe(this.kp).style.height=s,Fe(this.kp).style.width=a,this.$m.style.height=s,this.$m.style.width=a,n?this.nw(ta.gn(),performance.now()):this.ts.Bh()}av(e){e===void 0&&(e=ta.gn());for(let r=0;r<this.Am.length;r++)this.Am[r].av(e.en(r).tn);this.Ps.timeScale.visible&&this.Xm.av(e.nn())}hr(e){const r=nD(this.Ps);this.ts.hr(e);const n=nD(this.Ps);n!==r&&this.jm(n),e.layout?.panes&&this.ew(),this.Qm(),this.rw(e)}Kv(){return this.Sv}Xv(){return this.xv}uc(){return this.Ku}hw(){this.Fm!==null&&(this.nw(this.Fm,performance.now()),this.Fm=null);const e=this.aw(null),r=document.createElement("canvas");r.width=e.width,r.height=e.height;const n=Fe(r.getContext("2d"));return this.aw(n),r}lw(e){return e==="left"&&!this.ow()||e==="right"&&!this._w()||this.Am.length===0?0:Fe(e==="left"?this.Am[0].sm():this.Am[0].nm()).hv()}uw(){return this.Ps.autoSize&&this.Hm!==null}tp(){return this.kp}cw(e){this.Um=e,this.Um?this.tp().style.setProperty("cursor",e):this.tp().style.removeProperty("cursor")}dw(){return this.Um}fw(e){return ha(this.Am[e]).Zf()}ew(){this.zm.forEach((e=>{e.kt()}))}rw(e){(e.autoSize!==void 0||!this.Hm||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.Hm&&this.Zm(),e.autoSize===!1&&this.Hm!==null&&this.sw(),e.autoSize||e.width===void 0&&e.height===void 0||this.Gm(e.width||this.Mo,e.height||this.sl))}aw(e){let r=0,n=0;const i=this.Am[0],s=(o,c)=>{let u=0;for(let d=0;d<this.Am.length;d++){const f=this.Am[d],h=Fe(o==="left"?f.sm():f.nm()),m=h.Gf();if(e!==null&&h.Jf(e,c,u),u+=m.height,d<this.Am.length-1){const y=this.zm[d],x=y.Gf();e!==null&&y.Jf(e,c,u),u+=x.height}}};this.ow()&&(s("left",0),r+=Fe(i.sm()).Gf().width);for(let o=0;o<this.Am.length;o++){const c=this.Am[o],u=c.Gf();if(e!==null&&c.Jf(e,r,n),n+=u.height,o<this.Am.length-1){const d=this.zm[o],f=d.Gf();e!==null&&d.Jf(e,r,n),n+=f.height}}r+=i.Gf().width,this._w()&&(s("right",r),r+=Fe(i.nm()).Gf().width);const a=(o,c,u)=>{Fe(o==="left"?this.Xm.xm():this.Xm.Cm()).Jf(Fe(e),c,u)};if(this.Ps.timeScale.visible){const o=this.Xm.Gf();if(e!==null){let c=0;this.ow()&&(a("left",c,n),c=Fe(i.sm()).Gf().width),this.Xm.Jf(e,c,n),c+=o.width,this._w()&&a("right",c,n)}n+=o.height}return qr({width:r,height:n})}pw(){let e=0,r=0,n=0;for(const v of this.Am)this.ow()&&(r=Math.max(r,Fe(v.sm()).sv(),this.Ps.leftPriceScale.minimumWidth)),this._w()&&(n=Math.max(n,Fe(v.nm()).sv(),this.Ps.rightPriceScale.minimumWidth)),e+=v.Io();r=c5(r),n=c5(n);const i=this.Mo,s=this.sl,a=Math.max(i-r-n,0),o=1*this.zm.length,c=this.Ps.timeScale.visible;let u=c?Math.max(this.Xm.ym(),this.Ps.timeScale.minimumHeight):0;var d;u=(d=u)+d%2;const f=o+u,h=s<f?0:s-f,m=h/e;let y=0;const x=window.devicePixelRatio||1;for(let v=0;v<this.Am.length;++v){const _=this.Am[v];_.zv(this.ts.$s()[v]);let S=0,k=0;
4214k=v===this.Am.length-1?Math.ceil((h-y)*x)/x:Math.round(_.Io()*m*x)/x,S=Math.max(k,2),y+=S,_.rv(qr({width:a,height:S})),this.ow()&&_.Gv(r,"left"),this._w()&&_.Gv(n,"right"),_.hp()&&this.ts.cc(_.hp(),S)}this.Xm.km(qr({width:c?a:0,height:u}),c?r:0,c?n:0),this.ts.Eo(a),this.Om!==r&&(this.Om=r),this.Nm!==n&&(this.Nm=n)}jm(e){e?this.kp.addEventListener("wheel",this.qm,{passive:!1}):this.kp.removeEventListener("wheel",this.qm)}mw(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return eit?1/window.devicePixelRatio:1}Ym(e){if(!(e.deltaX!==0&&this.Ps.handleScroll.mouseWheel||e.deltaY!==0&&this.Ps.handleScale.mouseWheel))return;const r=this.mw(e),n=r*e.deltaX/100,i=-r*e.deltaY/100;if(e.cancelable&&e.preventDefault(),i!==0&&this.Ps.handleScale.mouseWheel){const s=Math.sign(i)*Math.min(1,Math.abs(i)),a=e.clientX-this.kp.getBoundingClientRect().left;this.Qt().Mc(a,s)}n!==0&&this.Ps.handleScroll.mouseWheel&&this.Qt().bc(-80*n)}nw(e,r){const n=e.nn();n===3&&this.ww(),n!==3&&n!==2||(this.gw(e),this.Mw(e,r),this.Xm.kt(),this.Am.forEach((i=>{i.Ov()})),this.Fm?.nn()===3&&(this.Fm.vn(e),this.ww(),this.gw(this.Fm),this.Mw(this.Fm,r),e=this.Fm,this.Fm=null)),this.av(e)}Mw(e,r){for(const n of e.pn())this.mn(n,r)}gw(e){const r=this.ts.$s();for(let n=0;n<r.length;n++)e.en(n).sn&&r[n].Go()}mn(e,r){const n=this.ts.Et();switch(e.an){case 0:n.Eu();break;case 1:n.Au(e.Wt);break;case 2:n.dn(e.Wt);break;case 3:n.fn(e.Wt);break;case 4:n.bu();break;case 5:e.Wt.Tu(r)||n.fn(e.Wt.Ru(r))}}Zu(e){this.Fm!==null?this.Fm.vn(e):this.Fm=e,this.Wm||(this.Wm=!0,this.Lm=window.requestAnimationFrame((r=>{if(this.Wm=!1,this.Lm=0,this.Fm!==null){const n=this.Fm;this.Fm=null,this.nw(n,r);for(const i of n.pn())if(i.an===5&&!i.Wt.Tu(r)){this.Qt()._n(i.Wt);break}}})))}ww(){this.Jm()}iw(e){this.$m.removeChild(e.Xf()),e.m()}Jm(){const e=this.ts.$s(),r=e.length,n=this.Am.length;for(let i=r;i<n;i++){const s=ha(this.Am.pop());this.$m.removeChild(s.Xf()),s.Kv().u(this),s.Xv().u(this),s.m();const a=this.zm.pop();a!==void 0&&this.iw(a)}for(let i=n;i<r;i++){const s=new YV(this,e[i]);if(s.Kv().i(this.bw.bind(this,s),this),s.Xv().i(this.Sw.bind(this,s),this),this.Am.push(s),i>0){const a=new Wnt(this,i-1,i);this.zm.push(a),this.$m.insertBefore(a.Xf(),this.Xm.Xf())}this.$m.insertBefore(s.Xf(),this.Xm.Xf())}for(let i=0;i<r;i++){const s=e[i],a=this.Am[i];a.hp()!==s?a.zv(s):a.Av()}this.Qm(),this.pw()}xw(e,r,n,i){const s=new Map;e!==null&&this.ts.js().forEach((f=>{const h=f.Xs().Fr(e);h!==null&&s.set(f,h)}));let a;if(e!==null){const f=this.ts.Et().ss(e)?.originalTime;f!==void 0&&(a=f)}const o=this.Qt().hc(),c=o!==null&&o.n_ instanceof hN?o.n_:void 0,u=o!==null&&o.e_!==void 0?o.e_.Kn:void 0,d=this.Cw(i);return{Pw:a,Re:e??void 0,kw:r??void 0,yw:d!==-1?d:void 0,Tw:c,Rw:s,Dw:u,Vw:n??void 0}}Cw(e){let r=-1;if(e)r=this.Am.indexOf(e);else{const n=this.Qt()._c().Us();n!==null&&(r=this.Qt().$s().indexOf(n))}return r}bw(e,r,n,i){this.Sv.p((()=>this.xw(r,n,i,e)))}Sw(e,r,n,i){this.xv.p((()=>this.xw(r,n,i,e)))}Km(e,r,n){this.cw(this.Qt().hc()?.h_??null),this.Ku.p((()=>this.xw(e,r,n)))}Qm(){const e=this.Ps.timeScale.visible?"":"none";this.Xm.Xf().style.display=e}ow(){return this.Am[0].hp().Wo().N().visible}_w(){return this.Am[0].hp().Ho().N().visible}Zm(){return"ResizeObserver"in window&&(this.Hm=new ResizeObserver((e=>{const r=e[e.length-1];r&&this.Gm(r.contentRect.width,r.contentRect.height)})),this.Hm.observe(this.Rp,{box:"border-box"}),!0)}sw(){this.Hm!==null&&this.Hm.disconnect(),this.Hm=null}}function nD(t){return!!(t.handleScroll.mouseWheel||t.handleScale.mouseWheel)}function rit(t){return t.open===void 0&&t.value===void 0}function nit(t){return(function(e){return e.open!==void 0})(t)||(function(e){return e.value!==void 0})(t)}function VQ(t,e,r,n){const i=r.value,s={Re:e,wt:t,Wt:[i,i,i,i],Pw:n};return r.color!==void 0&&(s.R=r.color),s}function iit(t,e,r,n){const i=r.value,s={Re:e,wt:t,Wt:[i,i,i,i],Pw:n};return r.lineColor!==void 0&&(s.vt=r.lineColor),r.topColor!==void 0&&(s.mr=r.topColor),r.bottomColor!==void 0&&(s.wr=r.bottomColor),s}function sit(t,e,r,n){const i=r.value,s={Re:e,wt:t,Wt:[i,i,i,i],Pw:n};return r.topLineColor!==void 0&&(s.gr=r.topLineColor),r.bottomLineColor!==void 0&&(s.Mr=r.bottomLineColor),r.topFillColor1!==void 0&&(s.br=r.topFillColor1),r.topFillColor2!==void 0&&(s.Sr=r.topFillColor2),r.bottomFillColor1!==void 0&&(s.Cr=r.bottomFillColor1),r.bottomFillColor2!==void 0&&(s.Pr=r.bottomFillColor2),s}function ait(t,e,r,n){const i={Re:e,wt:t,Wt:[r.open,r.high,r.low,r.close],Pw:n};return r.color!==void 0&&(i.R=r.color),i}function oit(t,e,r,n){const i={Re:e,wt:t,Wt:[r.open,r.high,r.low,r.close],Pw:n};return r.color!==void 0&&(i.R=r.color),r.borderColor!==void 0&&(i.Ht=r.borderColor),r.wickColor!==void 0&&(i.vr
4214=r.wickColor),i}function lit(t,e,r,n,i){const s=ha(i)(r),a=Math.max(...s),o=Math.min(...s),c=s[s.length-1],u=[c,a,o,c],{time:d,color:f,...h}=r;return{Re:e,wt:t,Wt:u,Pw:n,se:h,R:f}}function _v(t){return t.Wt!==void 0}function UQ(t,e){return e.customValues!==void 0&&(t.Iw=e.customValues),t}function mh(t){return(e,r,n,i,s,a)=>(function(o,c){return c?c(o):rit(o)})(n,a)?UQ({wt:e,Re:r,Pw:i},n):UQ(t(e,r,n,i,s),n)}function GQ(t){return{Candlestick:mh(oit),Bar:mh(ait),Area:mh(iit),Baseline:mh(sit),Histogram:mh(VQ),Line:mh(VQ),Custom:mh(lit)}[t]}function WQ(t){return{Re:0,Bw:new Map,Hh:t}}function HQ(t,e){if(t!==void 0&&t.length!==0)return{Ew:e.key(t[0].wt),Aw:e.key(t[t.length-1].wt)}}function qQ(t){let e;return t.forEach((r=>{e===void 0&&(e=r.Pw)})),ha(e)}class cit{constructor(e){this.zw=new Map,this.Lw=new Map,this.Ow=new Map,this.Nw=[],this.o_=e}m(){this.zw.clear(),this.Lw.clear(),this.Ow.clear(),this.Nw=[]}Fw(e,r){let n=this.zw.size!==0,i=!1;const s=this.Lw.get(e);if(s!==void 0)if(this.Lw.size===1)n=!1,i=!0,this.zw.clear();else for(const c of this.Nw)c.pointData.Bw.delete(e)&&(i=!0);let a=[];if(r.length!==0){const c=r.map((m=>m.time)),u=this.o_.createConverterToInternalObj(r),d=GQ(e.Rr()),f=e.da(),h=e.pa();a=r.map(((m,y)=>{const x=u(m.time),v=this.o_.key(x);let _=this.zw.get(v);_===void 0&&(_=WQ(x),this.zw.set(v,_),i=!0);const S=d(x,_.Re,m,c[y],f,h);return _.Bw.set(e,S),S}))}n&&this.Ww(),this.Hw(e,a);let o=-1;if(i){const c=[];this.zw.forEach((u=>{c.push({timeWeight:0,time:u.Hh,pointData:u,originalTime:qQ(u.Bw)})})),c.sort(((u,d)=>this.o_.key(u.time)-this.o_.key(d.time))),o=this.Uw(c)}return this.$w(e,o,(function(c,u,d){const f=HQ(c,d),h=HQ(u,d);if(f!==void 0&&h!==void 0)return{qw:!1,zh:f.Aw>=h.Aw&&f.Ew>=h.Ew}})(this.Lw.get(e),s,this.o_))}Ec(e){return this.Fw(e,[])}Yw(e,r,n){const i=r;(function(v){v.Pw===void 0&&(v.Pw=v.time)})(i),this.o_.preprocessData(r);const s=this.o_.createConverterToInternalObj([r])(r.time),a=this.Ow.get(e);if(!n&&a!==void 0&&this.o_.key(s)<this.o_.key(a))throw new Error(`Cannot update oldest data, last time=${a}, new time=${s}`);let o=this.zw.get(this.o_.key(s));if(n&&o===void 0)throw new Error("Cannot update non-existing data point when historicalUpdate is true");const c=o===void 0;o===void 0&&(o=WQ(s),this.zw.set(this.o_.key(s),o));const u=GQ(e.Rr()),d=e.da(),f=e.pa(),h=u(s,o.Re,r,i.Pw,d,f);o.Bw.set(e,h),n?this.jw(e,h,o.Re):this.Kw(e,h);const m={zh:_v(h),qw:n};if(!c)return this.$w(e,-1,m);const y={timeWeight:0,time:o.Hh,pointData:o,originalTime:qQ(o.Bw)},x=ay(this.Nw,this.o_.key(y.time),((v,_)=>this.o_.key(v.time)<_));this.Nw.splice(x,0,y);for(let v=x;v<this.Nw.length;++v)iD(this.Nw[v].pointData,v);return this.o_.fillWeightsForPoints(this.Nw,x),this.$w(e,x,m)}Kw(e,r){let n=this.Lw.get(e);n===void 0&&(n=[],this.Lw.set(e,n));const i=n.length!==0?n[n.length-1]:null;i===null||this.o_.key(r.wt)>this.o_.key(i.wt)?_v(r)&&n.push(r):_v(r)?n[n.length-1]=r:n.splice(-1,1),this.Ow.set(e,r.wt)}jw(e,r,n){const i=this.Lw.get(e);if(i===void 0)return;const s=ay(i,n,((a,o)=>a.Re<o));_v(r)?i[s]=r:i.splice(s,1)}Hw(e,r){r.length!==0?(this.Lw.set(e,r.filter(_v)),this.Ow.set(e,r[r.length-1].wt)):(this.Lw.delete(e),this.Ow.delete(e))}Ww(){for(const e of this.Nw)e.pointData.Bw.size===0&&this.zw.delete(this.o_.key(e.time))}Uw(e){let r=-1;for(let n=0;n<this.Nw.length&&n<e.length;++n){const i=this.Nw[n],s=e[n];if(this.o_.key(i.time)!==this.o_.key(s.time)){r=n;break}s.timeWeight=i.timeWeight,iD(s.pointData,n)}if(r===-1&&this.Nw.length!==e.length&&(r=Math.min(this.Nw.length,e.length)),r===-1)return-1;for(let n=r;n<e.length;++n)iD(e[n].pointData,n);return this.o_.fillWeightsForPoints(e,r),this.Nw=e,r}Xw(){if(this.Lw.size===0)return null;let e=0;return this.Lw.forEach((r=>{r.length!==0&&(e=Math.max(e,r[r.length-1].Re))})),e}$w(e,r,n){const i={Oo:new Map,Et:{ou:this.Xw()}};if(r!==-1)this.Lw.forEach(((s,a)=>{i.Oo.set(a,{se:s,Zw:a===e?n:void 0})})),this.Lw.has(e)||i.Oo.set(e,{se:[],Zw:n}),i.Et.Gw=this.Nw,i.Et.Jw=r;else{const s=this.Lw.get(e);i.Oo.set(e,{se:s||[],Zw:n})}return i}}function iD(t,e){t.Re=e,t.Bw.forEach((r=>{r.Re=e}))}function uit(t,e){return t.wt<e}function dit(t,e){return e<t.wt}function fit(t,e,r){const n=e.Uh(),i=e.bi(),s=ay(t,n,uit),a=Qme(t,i,dit);if(!r)return{from:s,to:a};let o=s,c=a;return s>0&&s<t.length&&t[s].wt>=n&&(o=s-1),a>0&&a<t.length&&t[a-1].wt<=i&&(c=a+1),{from:o,to:c}}let QV=class{constructor(e,r,n){this.Qw=!0,this.tg=!0,this.ig=!0,this.sg=[],this.ng=null,this.Jn=e,this.Qn=r,this.eg=n}kt(e){this.Qw=!0,e==="data"&&(this.tg=!0),e==="options"&&(this.ig=!0)}Tt(){return this.Jn.Vt()?(this.rg(),this.ng===null?null:this.hg):null}ag(){this.sg=this.sg.map((e=>({...e,...this.Jn.Rh().Dr(e.wt)}
4214)))}lg(){this.ng=null}rg(){this.tg&&(this.og(),this.tg=!1),this.ig&&(this.ag(),this.ig=!1),this.Qw&&(this._g(),this.Qw=!1)}_g(){const e=this.Jn.Ft(),r=this.Qn.Et();if(this.lg(),r.Ki()||e.Ki())return;const n=r.Pe();if(n===null||this.Jn.Xs().zr()===0)return;const i=this.Jn.zt();i!==null&&(this.ng=fit(this.sg,n,this.eg),this.ug(e,r,i.Wt),this.cg())}};class hit{constructor(e,r){this.dg=e,this.Yi=r}nt(e,r,n){this.dg.draw(e,this.Yi,r,n)}}class pit extends QV{constructor(e,r,n){super(e,r,!1),this.sh=n,this.hg=new hit(this.sh.renderer(),(i=>{const s=e.zt();return s===null?null:e.Ft().Nt(i,s.Wt)}))}fa(e){return this.sh.priceValueBuilder(e)}va(e){return this.sh.isWhitespace(e)}og(){const e=this.Jn.Rh();this.sg=this.Jn.Xs().Hr().map((r=>({wt:r.Re,_t:NaN,...e.Dr(r.Re),fg:r.se})))}ug(e,r){r._u(this.sg,Cb(this.ng))}cg(){this.sh.update({bars:this.sg.map(mit),barSpacing:this.Qn.Et().vu(),visibleRange:this.ng},this.Jn.N())}}function mit(t){return{x:t._t,time:t.wt,originalData:t.fg,barColor:t.cr}}const git={color:"#2196f3"},yit=(t,e,r)=>{const n=Yd(r);return new pit(t,e,n)};function ZV(t){const e={value:t.Wt[3],time:t.Pw};return t.Iw!==void 0&&(e.customValues=t.Iw),e}function YQ(t){const e=ZV(t);return t.R!==void 0&&(e.color=t.R),e}function vit(t){const e=ZV(t);return t.vt!==void 0&&(e.lineColor=t.vt),t.mr!==void 0&&(e.topColor=t.mr),t.wr!==void 0&&(e.bottomColor=t.wr),e}function xit(t){const e=ZV(t);
4214return t.gr!==void 0&&(e.topLineColor=t.gr),t.Mr!==void 0&&(e.bottomLineColor=t.Mr),t.br!==void 0&&(e.topFillColor1=t.br),t.Sr!==void 0&&(e.topFillColor2=t.Sr),t.Cr!==void 0&&(e.bottomFillColor1=t.Cr),t.Pr!==void 0&&(e.bottomFillColor2=t.Pr),e}function nge(t){const e={open:t.Wt[0],high:t.Wt[1],low:t.Wt[2],close:t.Wt[3],time:t.Pw};return t.Iw!==void 0&&(e.customValues=t.Iw),e}function bit(t){const e=nge(t);return t.R!==void 0&&(e.color=t.R),e}function wit(t){const e=nge(t),{R:r,Ht:n,vr:i}=t;return r!==void 0&&(e.color=r),n!==void 0&&(e.borderColor=n),i!==void 0&&(e.wickColor=i),e}function f5(t){return{Area:vit,Line:YQ,Baseline:xit,Histogram:YQ,Bar:bit,Candlestick:wit,Custom:_it}[t]}function _it(t){const e=t.Pw;return{...t.se,time:e}}const Sit={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},kit={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},Tit={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Bme,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},sD={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1},Cit={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function KQ(){return{addDefaultPane:!0,width:0,height:0,autoSize:!1,layout:Tit,crosshair:Sit,grid:kit,overlayPriceScales:{...sD},leftPriceScale:{...sD,visible:!1},rightPriceScale:{...sD,visible:!0},timeScale:Cit,localization:{locale:oy?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class ige{constructor(e,r,n){this.Wf=e,this.pg=r,this.vg=n??0}applyOptions(e){this.Wf.Qt().lc(this.pg,e,this.vg)}options(){return this.Yi().N()}width(){return dN(this.pg)?this.Wf.lw(this.pg):0}setVisibleRange(e){this.setAutoScale(!1),this.Yi().Wl(new zs(e.from,e.to))}getVisibleRange(){const e=this.Yi().Qe();return e===null?null:{from:e.$e(),to:e.qe()}}setAutoScale(e){this.applyOptions({autoScale:e})}Yi(){return Fe(this.Wf.Qt().oc(this.pg,this.vg)).Ft}}class Eit{constructor(e,r,n,i){this.Wf=e,this.Pt=n,this.mg=r,this.wg=i}getHeight(){return this.Pt.$t()}setHeight(e){const r=this.Wf.Qt(),n=r.Hc(this.Pt);r.fc(n,e)}getStretchFactor(){return this.Pt.Io()}setStretchFactor(e){this.Pt.Bo(e),this.Wf.Qt().Bh()}paneIndex(){return this.Wf.Qt().Hc(this.Pt)}moveTo(e){const r=this.paneIndex();r!==e&&(Yi(e>=0&&e<this.Wf.Uf().length,"Invalid pane index"),this.Wf.Qt().mc(r,e))}getSeries(){return this.Pt.Oo().map((e=>this.mg(e)))??[]}getHTMLElement(){const e=this.Wf.Uf();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].Xf():null}attachPrimitive(e){this.Pt.ua(e),e.attached&&e.attached({chart:this.wg,requestUpdate:()=>this.Pt.Qt().Bh()})}detachPrimitive(e){this.Pt.ca(e)}priceScale(e){if(this.Pt.Do(e)===null)throw new Error(`Cannot find price scale with id: ${e}`);return new ige(this.Wf,e,this.paneIndex())}setPreserveEmptyPane(e){this.Pt.zo(e)}preserveEmptyPane(){return this.Pt.Lo()}addCustomSeries(e,r={},n=0){return this.wg.addCustomSeries(e,r,n)}addSeries(e,r={}){return this.wg.addSeries(e,r,this.paneIndex())}}const jit={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class QQ{constructor(e){this.ir=e}applyOptions(e){this.ir.hr(e)}options(){return this.ir.N()}gg(){return this.ir}}class Nit{constructor(e,r,n,i,s,a){this.Mg=new Xn,this.Jn=e,this.bg=r,this.Sg=n,this.o_=s,this.wg=i,this.xg=a}m(){this.Mg.m()}priceFormatter(){return this.Jn.ra()}priceToCoordinate(e){const r=this.Jn.zt();return r===null?null:this.Jn.Ft().Nt(e,r.Wt)}coordinateToPrice(e){const r=this.Jn.zt();return r===null?null:this.Jn.Ft().Ts(e,r.Wt)}barsInLogicalRange(e){if(e===null)return null;const r=new Cg(new Ox(e.from,e.to)).k_(),n=this.Jn.Xs();if(n.Ki())return null;const i=n.Fr(r.Uh(),1),s=n.Fr(r.bi(),-1),a=Fe(n.Lr()),o=Fe(n.Ks());if(i!==null&&s!==null&&i.Re>s.Re)return{barsBefore:e.from-a,barsAfter:o-e.to};const c={barsBefore:i===null||i.Re===a?e.from-a:i.Re-a,barsAfter:s===null||s.Re===o?o-e.to:o-s.Re};return i!==null&&s!==null&&(c.from=i.Pw,c.to=s.Pw),c}setData(e){this.o_,this.Jn.Rr(),this.bg.Cg(this.Jn,e),this.Pg("full")}update(e,r=!1){this.Jn.Rr(),this.bg.kg(this.Jn,e,r),this.Pg("update")}dataByIndex(e,r){const n=this.Jn.Xs().Fr(e,r);return n===null?null:f5(this.seriesType())(n)}data(){const e=f5(this.seriesType());return this.Jn.Xs().Hr().map((r=>e(r)))}subscribeDataChanged(e){this.Mg.i(e)}unsubscribeDataChanged(e){this.Mg._(e)}
4214applyOptions(e){this.Jn.hr(e)}options(){return ru(this.Jn.N())}priceScale(){return this.Sg.priceScale(this.Jn.Ft().wa(),this.getPane().paneIndex())}createPriceLine(e){const r=Fa(ru(jit),e),n=this.Jn.Oh(r);return new QQ(n)}removePriceLine(e){this.Jn.Nh(e.gg())}priceLines(){return this.Jn.Fh().map((e=>new QQ(e)))}seriesType(){return this.Jn.Rr()}attachPrimitive(e){this.Jn.ua(e),e.attached&&e.attached({chart:this.wg,series:this,requestUpdate:()=>this.Jn.Qt().Bh(),horzScaleBehavior:this.o_})}detachPrimitive(e){this.Jn.ca(e),e.detached&&e.detached(),this.Jn.Qt().Bh()}getPane(){const e=this.Jn,r=Fe(this.Jn.Qt().Hn(e));return this.xg(r)}moveToPane(e){this.Jn.Qt().Oc(this.Jn,e)}seriesOrder(){const e=this.Jn.Qt().Hn(this.Jn);return e===null?-1:e.Oo().indexOf(this.Jn)}setSeriesOrder(e){const r=this.Jn.Qt().Hn(this.Jn);r!==null&&r.Qo(this.Jn,e)}Pg(e){this.Mg.v()&&this.Mg.p(e)}}class Pit{constructor(e,r,n){this.yg=new Xn,this.z_=new Xn,this.wm=new Xn,this.ts=e,this.uh=e.Et(),this.Xm=r,this.uh.Du().i(this.Tg.bind(this)),this.uh.Vu().i(this.Rg.bind(this)),this.Xm.Pm().i(this.Dg.bind(this)),this.o_=n}m(){this.uh.Du().u(this),this.uh.Vu().u(this),this.Xm.Pm().u(this),this.yg.m(),this.z_.m(),this.wm.m()}scrollPosition(){return this.uh.wu()}scrollToPosition(e,r){r?this.uh.yu(e,1e3):this.ts.fn(e)}scrollToRealTime(){this.uh.ku()}getVisibleRange(){const e=this.uh.su();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){const r={from:this.o_.convertHorzItemToInternal(e.from),to:this.o_.convertHorzItemToInternal(e.to)},n=this.uh.hu(r);this.ts.zc(n)}getVisibleLogicalRange(){const e=this.uh.iu();return e===null?null:{from:e.Uh(),to:e.bi()}}setVisibleLogicalRange(e){Yi(e.from<=e.to,"The from index cannot be after the to index."),this.ts.zc(e)}resetTimeScale(){this.ts.cn()}fitContent(){this.ts.Eu()}logicalToCoordinate(e){const r=this.ts.Et();return r.Ki()?null:r.qt(e)}coordinateToLogical(e){return this.uh.Ki()?null:this.uh.uu(e)}timeToIndex(e,r){const n=this.o_.convertHorzItemToInternal(e);return this.uh.J_(n,r)}timeToCoordinate(e){const r=this.timeToIndex(e,!1);return r===null?null:this.uh.qt(r)}coordinateToTime(e){const r=this.ts.Et(),n=r.uu(e),i=r.ss(n);return i===null?null:i.originalTime}width(){return this.Xm.Zf().width}height(){return this.Xm.Zf().height}subscribeVisibleTimeRangeChange(e){this.yg.i(e)}unsubscribeVisibleTimeRangeChange(e){this.yg._(e)}subscribeVisibleLogicalRangeChange(e){this.z_.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.z_._(e)}subscribeSizeChange(e){this.wm.i(e)}unsubscribeSizeChange(e){this.wm._(e)}applyOptions(e){this.uh.hr(e)}options(){return{...ru(this.uh.N()),barSpacing:this.uh.vu()}}Tg(){this.yg.v()&&this.yg.p(this.getVisibleRange())}Rg(){this.z_.v()&&this.z_.p(this.getVisibleLogicalRange())}Dg(e){this.wm.p(e.width,e.height)}}function Mit(t){if(t===void 0||t.type==="custom")return;const e=t;e.minMove!==void 0&&e.precision===void 0&&(e.precision=(function(r){if(r>=1)return 0;let n=0;for(;n<8;n++){const i=Math.round(r);if(Math.abs(i-r)<1e-8)return n;r*=10}return n})(e.minMove))}function ZQ(t){return(function(e){if(xS(e.handleScale)){const n=e.handleScale;e.handleScale={axisDoubleClickReset:{time:n,price:n},axisPressedMouseMove:{time:n,price:n},mouseWheel:n,pinch:n}}else if(e.handleScale!==void 0){const{axisPressedMouseMove:n,axisDoubleClickReset:i}=e.handleScale;xS(n)&&(e.handleScale.axisPressedMouseMove={time:n,price:n}),xS(i)&&(e.handleScale.axisDoubleClickReset={time:i,price:i})}const r=e.handleScroll;xS(r)&&(e.handleScroll={horzTouchDrag:r,vertTouchDrag:r,mouseWheel:r,pressedMouseMove:r})})(t),t}class Ait{constructor(e,r,n){this.Vg=new Map,this.Ig=new Map,this.Bg=new Xn,this.Eg=new Xn,this.Ag=new Xn,this.$u=new WeakMap,this.zg=new cit(r);const i=n===void 0?ru(KQ()):Fa(ru(KQ()),ZQ(n));this.Lg=r,this.Wf=new tit(e,i,r),this.Wf.Kv().i((a=>{this.Bg.v()&&this.Bg.p(this.Og(a()))}),this),this.Wf.Xv().i((a=>{this.Eg.v()&&this.Eg.p(this.Og(a()))}),this),this.Wf.uc().i((a=>{this.Ag.v()&&this.Ag.p(this.Og(a()))}),this);const s=this.Wf.Qt();this.Ng=new Pit(s,this.Wf.tw(),this.Lg)}remove(){this.Wf.Kv().u(this),this.Wf.Xv().u(this),this.Wf.uc().u(this),this.Ng.m(),this.Wf.m(),this.Vg.clear(),this.Ig.clear(),this.Bg.m(),this.Eg.m(),this.Ag.m(),this.zg.m()}resize(e,r,n){this.autoSizeActive()||this.Wf.Gm(e,r,n)}addCustomSeries(e,r={},n=0){const i=(s=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...git,...s.defaultOptions()},Fg:yit,Wg:s}))(Yd(e));return this.Hg(i,r,n)}addSeries(e,r={},n=0){return this.Hg(e,r,n)}removeSeries(e){const r=ha(this.Vg.get(e)),n=this.zg.Ec(r);this.Wf.Qt().Ec(r),this.Ug(n),this.Vg.delete(e),this.Ig.delete(r)}Cg(e,r){this.Ug(this.zg.Fw(e,r))}kg(e,r,n){this.Ug(this.zg.Yw(e,r,n))}subscribeClick(e){this.Bg.i(e)}unsubscribeClick(e){this.Bg._(e)}subscribeCrosshairMove(e){this.Ag.i(e)}unsubscribeCrosshairMove(e){this.Ag._(e)}subscribeDblClick(e){this.Eg.i(e)}unsubscribeDblClick(e){this.Eg._(e)}priceScale(e,r=0){return new ige(this.Wf,e,r)}timeScale(){return this.Ng}applyOptions(e){this.Wf.hr(ZQ(e))}options(){return this.Wf.N()}takeScreenshot(){return this.Wf.hw()}
4214addPane(e=!1){const r=this.Wf.Qt().Uc();return r.zo(e),this.$g(r)}removePane(e){this.Wf.Qt().dc(e)}swapPanes(e,r){this.Wf.Qt().vc(e,r)}autoSizeActive(){return this.Wf.uw()}chartElement(){return this.Wf.tp()}panes(){return this.Wf.Qt().$s().map((e=>this.$g(e)))}paneSize(e=0){const r=this.Wf.fw(e);return{height:r.height,width:r.width}}setCrosshairPosition(e,r,n){const i=this.Vg.get(n);if(i===void 0)return;const s=this.Wf.Qt().Hn(i);s!==null&&this.Wf.Qt().Tc(e,r,s)}clearCrosshairPosition(){this.Wf.Qt().Rc(!0)}horzBehaviour(){return this.Lg}Hg(e,r={},n=0){Yi(e.Fg!==void 0),Mit(r.priceFormat),e.type==="Candlestick"&&(function(c){c.borderColor!==void 0&&(c.borderUpColor=c.borderColor,c.borderDownColor=c.borderColor),c.wickColor!==void 0&&(c.wickUpColor=c.wickColor,c.wickDownColor=c.wickColor)})(r);const i=Fa(ru(Fme),ru(e.defaultOptions),r),s=e.Fg,a=new hN(this.Wf.Qt(),e.type,i,s,e.Wg);this.Wf.Qt().Ic(a,n);const o=new Nit(a,this,this,this,this.Lg,(c=>this.$g(c)));return this.Vg.set(o,a),this.Ig.set(a,o),o}Ug(e){const r=this.Wf.Qt();r.Dc(e.Et.ou,e.Et.Gw,e.Et.Jw),e.Oo.forEach(((n,i)=>i.ht(n.se,n.Zw))),r.Et().j_(),r.pu()}qg(e){return ha(this.Ig.get(e))}Og(e){const r=new Map;e.Rw.forEach(((i,s)=>{const a=s.Rr(),o=f5(a)(i);if(a!=="Custom")Yi(nit(o));else{const c=s.pa();Yi(!c||c(o)===!1)}r.set(this.qg(s),o)}));const n=e.Tw!==void 0&&this.Ig.has(e.Tw)?this.qg(e.Tw):void 0;return{time:e.Pw,logical:e.Re,point:e.kw,paneIndex:e.yw,hoveredSeries:n,hoveredObjectId:e.Dw,seriesData:r,sourceEvent:e.Vw}}$g(e){let r=this.$u.get(e);return r||(r=new Eit(this.Wf,(n=>this.qg(n)),e,this),this.$u.set(e,r)),r}}function Dit(t){if(l1(t)){const e=document.getElementById(t);return Yi(e!==null,`Cannot find element in DOM with id=${t}`),e}return t}function Oit(t,e,r){const n=Dit(t),i=new Ait(n,e,r);return e.setOptions(i.options()),i}function sge(t,e){return Oit(t,new OQ,OQ.ad(e))}class XV extends QV{constructor(e,r){super(e,r,!0)}ug(e,r,n){r._u(this.sg,Cb(this.ng)),e.$l(this.sg,n,Cb(this.ng))}Yg(e,r){return{wt:e,gt:r,_t:NaN,ut:NaN}}og(){const e=this.Jn.Rh();this.sg=this.Jn.Xs().Hr().map((r=>{const n=r.Wt[3];return this.jg(r.Re,n,e)}))}}function age(t,e,r,n,i,s,a){if(e.length===0||n.from>=e.length||n.to<=0)return;const{context:o,horizontalPixelRatio:c,verticalPixelRatio:u}=t,d=e[n.from];let f=s(t,d),h=d;if(n.to-n.from<2){const m=i/2;o.beginPath();const y={_t:d._t-m,ut:d.ut},x={_t:d._t+m,ut:d.ut};o.moveTo(y._t*c,y.ut*u),o.lineTo(x._t*c,x.ut*u),a(t,f,y,x)}else{const m=(x,v)=>{a(t,f,h,v),o.beginPath(),f=x,h=v};let y=h;o.beginPath(),o.moveTo(d._t*c,d.ut*u);for(let x=n.from+1;x<n.to;++x){y=e[x];const v=s(t,y);switch(r){case 0:o.lineTo(y._t*c,y.ut*u);break;case 1:o.lineTo(y._t*c,e[x-1].ut*u),v!==f&&(m(v,y),o.lineTo(y._t*c,e[x-1].ut*u)),o.lineTo(y._t*c,y.ut*u);break;case 2:{const[_,S]=Rit(e,x-1,x);o.bezierCurveTo(_._t*c,_.ut*u,S._t*c,S.ut*u,y._t*c,y.ut*u);break}}r!==1&&v!==f&&(m(v,y),o.moveTo(y._t*c,y.ut*u))}(h!==y||h===y&&r===1)&&a(t,f,h,y)}}const XQ=6;function aD(t,e){return{_t:t._t-e._t,ut:t.ut-e.ut}}function JQ(t,e){return{_t:t._t/e,ut:t.ut/e}}function Rit(t,e,r){const n=Math.max(0,e-1),i=Math.min(t.length-1,r+1);var s,a;return[(s=t[e],a=JQ(aD(t[r],t[n]),XQ),{_t:s._t+a._t,ut:s.ut+a.ut}),aD(t[r],JQ(aD(t[i],t[e]),XQ))]}function Iit(t,e){const r=t.context;r.strokeStyle=e,r.stroke()}class Lit extends Ju{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:r,lt:n,Kg:i,Xg:s,ct:a,Xt:o,Zg:c}=this.rt;if(n===null)return;const u=e.context;u.lineCap="butt",u.lineWidth=a*e.verticalPixelRatio,Pp(u,o),u.lineJoin="round";const d=this.Gg.bind(this);s!==void 0&&age(e,r,s,n,i,d,Iit),c&&(function(f,h,m,y,x){if(y.to-y.from<=0)return;const{horizontalPixelRatio:v,verticalPixelRatio:_,context:S}=f;let k=null;const E=Math.max(1,Math.floor(v))%2/2,T=m*_+E;for(let N=y.to-1;N>=y.from;--N){const j=h[N];if(j){const M=x(f,j);M!==k&&(S.beginPath(),k!==null&&S.fill(),S.fillStyle=M,k=M);const O=Math.round(j._t*v)+E,R=j.ut*_;S.moveTo(O,R),S.arc(O,R,T,0,2*Math.PI)}}S.fill()})(e,r,c,n,d)}}class oge extends Lit{Gg(e,r){return r.vt}}class $it extends XV{constructor(){super(...arguments),this.hg=new oge}jg(e,r,n){return{...this.Yg(e,r),...n.Dr(e)}}cg(){const e=this.Jn.N(),r={ot:this.sg,Xt:e.lineStyle,Xg:e.lineVisible?e.lineType:void 0,ct:e.lineWidth,Zg:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,lt:this.ng,Kg:this.Qn.Et().vu()};this.hg.ht(r)}}const Fit={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroun
vendor: 6,386 bytes, line 4214
4214dColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Fg:(t,e)=>new $it(t,e)};function zit(t,e,r,n,i){const{context:s,horizontalPixelRatio:a,verticalPixelRatio:o}=e;s.lineTo(i._t*a,t*o),s.lineTo(n._t*a,t*o),s.closePath(),s.fillStyle=r,s.fill()}class Bit extends Ju{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;const{ot:r,lt:n,Kg:i,ct:s,Xt:a,Xg:o}=this.rt,c=this.rt.eM??(this.rt.rM?0:e.mediaSize.height);if(n===null)return;const u=e.context;u.lineCap="butt",u.lineJoin="round",u.lineWidth=s,Pp(u,a),u.lineWidth=1,age(e,r,o,n,i,this.hM.bind(this),zit.bind(null,c))}}let Vit=class{aM(e,r){const n=this.lM,{oM:i,_M:s,uM:a,cM:o,eM:c,dM:u,fM:d}=r;if(this.pM===void 0||n===void 0||n.oM!==i||n._M!==s||n.uM!==a||n.cM!==o||n.eM!==c||n.dM!==u||n.fM!==d){const{verticalPixelRatio:f}=e,h=c||u>0?f:1,m=u*h,y=d===e.bitmapSize.height?d:d*h,x=(c??0)*h,v=e.context.createLinearGradient(0,m,0,y);if(v.addColorStop(0,i),c!=null){const _=Tg((x-m)/(y-m),0,1);v.addColorStop(_,s),v.addColorStop(_,a)}v.addColorStop(1,o),this.pM=v,this.lM=r}return this.pM}},Uit=class extends Bit{constructor(){super(...arguments),this.vM=new Vit}hM(e,r){return this.vM.aM(e,{oM:r.mr,_M:"",uM:"",cM:r.wr,dM:this.rt?.dM??0,fM:e.bitmapSize.height})}},Git=class extends XV{constructor(e,r){super(e,r),this.hg=new Vme,this.MM=new Uit,this.bM=new oge,this.hg.st([this.MM,this.bM])}jg(e,r,n){return{...this.Yg(e,r),...n.Dr(e)}}cg(){const e=this.Jn.N();if(this.ng===null||this.sg.length===0)return;let r;if(e.relativeGradient){r=this.sg[this.ng.from].ut;for(let n=this.ng.from;n<this.ng.to;n++){const i=this.sg[n];i.ut<r&&(r=i.ut)}}this.MM.ht({Xg:e.lineType,ot:this.sg,Xt:e.lineStyle,ct:e.lineWidth,eM:null,dM:r,rM:e.invertFilledArea,lt:this.ng,Kg:this.Qn.Et().vu()}),this.bM.ht({Xg:e.lineVisible?e.lineType:void 0,ot:this.sg,Xt:e.lineStyle,ct:e.lineWidth,lt:this.ng,Kg:this.Qn.Et().vu(),Zg:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0})}};const eZ={type:"Area",isBuiltIn:!0,defaultOptions:{topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,relativeGradient:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Fg:(t,e)=>new Git(t,e)};class Wit extends QV{constructor(e,r){super(e,r,!1)}ug(e,r,n){r._u(this.sg,Cb(this.ng)),e.Yl(this.sg,n,Cb(this.ng))}yM(e,r,n){return{wt:e,qh:r.Wt[0],Yh:r.Wt[1],jh:r.Wt[2],Kh:r.Wt[3],_t:NaN,jl:NaN,Kl:NaN,Xl:NaN,Zl:NaN}}og(){const e=this.Jn.Rh();this.sg=this.Jn.Xs().Hr().map((r=>this.jg(r.Re,r,e)))}}let Hit=class extends Ju{constructor(){super(...arguments),this.Yt=null,this.SM=0}ht(e){this.Yt=e}et(e){if(this.Yt===null||this.Yt.Xs.length===0||this.Yt.lt===null)return;const{horizontalPixelRatio:r}=e;this.SM=(function(s,a){if(s>=2.5&&s<=4)return Math.floor(3*a);const o=1-.2*Math.atan(Math.max(4,s)-4)/(.5*Math.PI),c=Math.floor(s*o*a),u=Math.floor(s*a),d=Math.min(c,u);return Math.max(Math.floor(a),d)})(this.Yt.vu,r),this.SM>=2&&Math.floor(r)%2!=this.SM%2&&this.SM--;const n=this.Yt.Xs;this.Yt.TM&&this.RM(e,n,this.Yt.lt),this.Yt.Mi&&this._v(e,n,this.Yt.lt);const i=this.DM(r);(!this.Yt.Mi||this.SM>2*i)&&this.VM(e,n,this.Yt.lt)}RM(e,r,n){if(this.Yt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:a}=e;let o="",c=Math.min(Math.floor(s),Math.floor(this.Yt.vu*s));c=Math.max(Math.floor(s),Math.min(c,this.SM));const u=Math.floor(.5*c);let d=null;for(let f=n.from;f<n.to;f++){const h=r[f];h.pr!==o&&(i.fillStyle=h.pr,o=h.pr);const m=Math.round(Math.min(h.jl,h.Zl)*a),y=Math.round(Math.max(h.jl,h.Zl)*a),x=Math.round(h.Kl*a),v=Math.round(h.Xl*a);let _=Math.round(s*h._t)-u;const S=_+c-1;d!==null&&(_=Math.max(d+1,_),_=Math.min(_,S));const k=S-_+1;i.fillRect(_,x,k,m-x),i.fillRect(_,y+1,k,v-y),d=S}}DM(e){let r=Math.floor(1*e);this.SM<=2*r&&(r=Math.floor(.5*(this.SM-1)));const n=Math.max(Math.floor(e),r);return this.SM<=2*n?Math.max(Math.floor(e),Math.floor(1*e)):n}_v(e,r,n){if(this.Yt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:a}=e;let o="";const c=this.DM(s);let u=null;for(let d=n.from;d<n.to;d++){const f=r[d];f.dr!==o&&(i.fillStyle=f.dr,o=f.dr);let h=Math.round(f._t*s)-Math.floor(.5*this.SM);const m=h+this.SM-1,y=Math.round(Math.min(f.jl,f.Zl)*a),x=Math.round(Math.max(f.jl,f.Zl)*a);if(u!==null&&(h=Math.max(u+1,h),h=Math.min(h,m)),this.Yt.vu*s>2*c)Hrt(i,h,y,m-h+1,x-y+1,c);else{const v=m-h+1;i.fillRect(h,y,v,x-y+1)}u=m}}VM(e,r,n){if(this.Yt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:a}=e;let o="";const c=this.DM(s);for(let u=n.from;u<n.to;u++){const d=r[u];let f=Math.round(Math.min(d.jl,d.Zl)*a),h=Math.round(Math.max(d.jl,d.Zl)*a),m=Math.round(d._t*s)-Math.floor(.5*this.SM),y=m+this.SM-1;if(d.cr!==o){const x=d.cr;i.fillStyle=x,o=x}this.Yt.Mi&&(m+=c,f+=c,y-=c,h-=c),f>h||i.fillRect(m,f,y-m+1,h-f+1)}}},qit=class extends Wit{constructor(){super(...arguments),this.hg=new Hit}jg(e,r,n){return{...this.yM(e,r,n),...n.Dr(e)}}cg(){const e=this.Jn.N();this.hg.ht({Xs:this.sg,vu:this.Qn.Et().vu(),TM:e.wickVisible,Mi:e.borderVisible,lt:this.ng})}};const Yit={type:"Candlestick",isBuiltIn:!0,defaultOptions:{upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},Fg:(t,e)=>new qit(t,e)};let Kit=class extends Ju{constructor(){super(...arguments),this.Yt=null,this.IM=[]}ht(e){this.Yt=e,this.IM=[]}et({context:e,horizontalPixelRatio:r,verticalPixelRatio:n}){if(this.Yt===null||this.Yt.ot.length===0||this.Yt.lt===null)return;this.IM.length||this.BM(r);const i=Math.max(1,Math.floor(n)),s=Math.round(this.Yt.EM*n)-Math.floor(i/2),a=s+i;for(let o=this.Yt.lt.from;o<this.Yt.lt.to;o++){const c=this.Yt.ot[o],u=this.IM[o-this.Yt.lt.from],d=Math.round(c.ut*n);let f,h;e.fillStyle=c.cr,d<=s?(f=d,h=a):(f=s,h=d-Math.floor(i/2)+i),e.fillRect(u.Uh,f,u.bi-u.Uh+1,h-f)}}BM(e){if(this.Yt===null||this.Yt.ot.length===0||this.Yt.lt===null)return void(this.IM=[]);const r=Math.ceil(this.Yt.vu*e)<=1?0:Math.max(1,Math.floor(e)),n=Math.round(this.Yt.vu*e)-r;this.IM=new Array(this.Yt.lt.to-this.Yt.lt.from);for(let s=this.Yt.lt.from;s<this.Yt.lt.to;
4214s++){const a=this.Yt.ot[s],o=Math.round(a._t*e);let c,u;if(n%2){const d=(n-1)/2;c=o-d,u=o+d}else{const d=n/2;c=o-d,u=o+d-1}this.IM[s-this.Yt.lt.from]={Uh:c,bi:u,AM:o,ne:a._t*e,wt:a.wt}}for(let s=this.Yt.lt.from+1;s<this.Yt.lt.to;s++){const a=this.IM[s-this.Yt.lt.from],o=this.IM[s-this.Yt.lt.from-1];a.wt===o.wt+1&&a.Uh-o.bi!==r+1&&(o.AM>o.ne?o.bi=a.Uh-r-1:a.Uh=o.bi+r+1)}let i=Math.ceil(this.Yt.vu*e);for(let s=this.Yt.lt.from;s<this.Yt.lt.to;s++){const a=this.IM[s-this.Yt.lt.from];a.bi<a.Uh&&(a.bi=a.Uh);const o=a.bi-a.Uh+1;i=Math.min(o,i)}if(r>0&&i<4)for(let s=this.Yt.lt.from;s<this.Yt.lt.to;s++){const a=this.IM[s-this.Yt.lt.from];a.bi-a.Uh+1>i&&(a.AM>a.ne?a.bi-=1:a.Uh+=1)}}},Qit=class extends XV{constructor(){super(...arguments),this.hg=new Kit}jg(e,r,n){return{...this.Yg(e,r),...n.Dr(e)}}cg(){const e={ot:this.sg,vu:this.Qn.Et().vu(),lt:this.ng,EM:this.Jn.Ft().Nt(this.Jn.N().base,Fe(this.Jn.zt()).Wt)};this.hg.ht(e)}};const Zit={type:"Histogram",isBuiltIn:!0,defaultOptions:{color:"#26a69a",base:0},Fg:(t,e)=>new Qit(t,e)};({...Fme});const oD=["intraday-swings"],Xit=()=>{const t=df(["intraday-swings","intraday-closed"]),[e,r]=ys("pnlView",Ghe(t).withDefault(oD)),n=s=>s.length===0?oD:s;return{selectedModes:e,setSelectedModes:s=>{if(s===null){r(oD);return}const a=n(s);r(a)}}};function Qp(t){const[e,r]=b.useState(!1);return b.useEffect(()=>{const n=window.matchMedia(t),i=s=>{r(s.matches)};return r(n.matches),n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[t]),e}const lge=(t,e,r)=>{const n=new Date(e),i=new Date(r),s=ape(i,n),a=eQe(i,n);switch(t){case"today":return{interval:"hour"};case"this_week":return{interval:"day"};case"this_month":return{interval:"day"};case"year_to_date":return a>24?{interval:"year"}:s>60?{interval:"month"}:{interval:"day"};case"custom":default:return a>24?{interval:"year"}:s>60?{interval:"month"}:{interval:"day"}}},mN=(t,e,r)=>{const n=[];let i=t;for(;i<=e;){let s,a;switch(r){case"hour":s=KT(i),a=nQe(i),i=ipe(i,1);break;case"day":s=Us(i),a=Zi(i),i=$a(i,1);break;case"week":s=mi(i,{weekStartsOn:1}),a=$u(i,{weekStartsOn:1}),i=Xg(i,1);break;case"month":s=Gs(i),a=ga(i),i=Va(i,1);break;case"year":s=Zu(i),a=$j(i),i=ml(i,1);break}s<=e&&a>=t&&n.push({start:s,end:a,timestamp:Math.floor(a.getTime()/1e3)})}return n},cge=(t,e,r)=>{if(!t.exit_date)return!1;const n=new Date(t.exit_date);switch(r){case"hour":return KZe(n,e.start);case"day":return Lj(n,e.start);case"week":return QZe(n,e.start,{weekStartsOn:1});case"month":return Bj(n,e.start);case"year":return SV(n,e.start);default:return!1}},Jit=(t,e,r,n,i,s)=>{const o=lN(t,s).filter(h=>h.status==="CLOSED"&&h.exit_date).map(h=>{const m=oN(h,i,s);return m==null?null:{trade:h,displayPnL:m}}).filter(h=>h!=null).sort((h,m)=>new Date(h.trade.exit_date).getTime()-new Date(m.trade.exit_date).getTime()),c=lge(e,r,n),u=mN(new Date(r),new Date(n),c.interval);if(u.length===0)return[];const d=[];let f=0;for(const h of u){const m=Math.floor(h.start.getTime()/1e3),y=o.filter(_=>cge(_.trade,h,c.interval)),x=new Map;let v=!1;for(const _ of y){const S=new Date(_.trade.exit_date),k=ZZe(S),E=Math.floor(k.getTime()/1e3);E===m&&(v=!0);const T=x.get(E)??0;x.set(E,T+_.displayPnL)}if(v||d.push({time:m,value:f,isAnchor:!0}),x.size>0){const _=Array.from(x.keys()).sort((S,k)=>S-k);for(const S of _)f+=x.get(S)??0,d.push({time:S,value:f,isAnchor:!1})}}return d.sort((h,m)=>h.time-m.time)},est=(t,e,r,n,i)=>{const a=lN(t,i).filter(m=>m.status==="CLOSED"&&m.exit_date).map(m=>{const y=oN(m,n,i);return y==null?null:{trade:m,displayPnL:y}}).filter(m=>m!=null);if(a.length===0)return[];const o=mN(new Date(e),new Date(r),"day");if(o.length===0)return[];const c=new Map;let u=0;const d=a.sort((m,y)=>new Date(m.trade.exit_date).getTime()-new Date(y.trade.exit_date).getTime());for(const m of d){const y=new Date(m.trade.exit_date),x=sr(y,"yyyy-MM-dd");u+=m.displayPnL,c.set(x,{pnl:u})}const f=[];let h=0;for(const m of o){const y=sr(m.start,"yyyy-MM-dd"),x=c.get(y);x&&(h=x.pnl),f.push({time:m.timestamp,value:h,isAnchor:!0})}return f.sort((m,y)=>m.time-y.time)},Sv=(t,e="full")=>{const r=new Date(t*1e3);switch(e){case"date":return sr(r,"MMM d");case"time":return sr(r,"hh:mm a");case"short":return sr(r,"MMM d");case"full":default:return sr(r,"MMM d hh:mm a")}},uge={"1min":"1m","5min":"5m","15min":"15m","30min":"30m","60min":"1h","1D":"1d"},ps={entry:"#86EACF",exit:"#FDA4AF",candleUp:"#10B981",candleDown:"#EF4444",background:"#0C0D18",text:"#9CA3AF",grid:"#1A1B2E",border:"#374151"},Ol={min:6,max:22,step:2,default:12},dge=t=>t?.toUpperCase()==="BUY"?ps.entry:ps.exit,gN=t=>Object.keys(uge).includes(t),l0=(t,e,r=!0)=>{const n=typeof t=="number"?new Date(t*1e3):new Date(t);if(gN(e)){if(r)return Math.floor(n.getTime()/1e3);
4214const i=Ert(n,"America/New_York","yyyy-MM-dd HH:mm:ss"),s=new Date(i);return Math.floor(s.getTime()/1e3)}return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()}},Dp=t=>{if(typeof t=="string")return Math.floor(new Date(t).getTime()/1e3);if(typeof t=="number")return t;const e=t;return Math.floor(Date.UTC(e.year,e.month-1,e.day)/1e3)},tst=(t,e)=>{const r=Dp(t.time),n=Dp(e.time);return r-n},JV=t=>{if(typeof t=="string")return t;if(typeof t=="number")return t.toString();const e=t;return`${e.year}-${e.month.toString().padStart(2,"0")}-${e.day.toString().padStart(2,"0")}`},rst=(t,e)=>{if(!t.length)return[];const r=new Map;for(const n of t){const i=l0(n.timestamp,e,!0),s=JV(i);r.has(s)||r.set(s,{time:i,open:n.open,high:n.high,low:n.low,close:n.close})}return Array.from(r.values()).sort(tst)},tZ=(t,e)=>{if(!t.length)return[];const r=new Map;for(const n of t){const i=l0(n.timestamp,e,!0),s=JV(i);r.has(s)||r.set(s,{time:i,open:n.open,high:n.high,low:n.low,close:n.close,volume:n.volume})}return Array.from(r.values()).sort((n,i)=>{const s=Dp(n.time),a=Dp(i.time);return s-a})},nst=(t,e)=>{if(!t.length)return[];const r=new Map;for(const n of t){const i=l0(n.timestamp,e,!0),s=JV(i);if(!r.has(s)){const a=n.close>=n.open;r.set(s,{time:i,value:n.volume,color:a?"rgba(16, 185, 129, 0.35)":"rgba(239, 68, 68, 0.35)"})}}return Array.from(r.values()).sort((n,i)=>{const s=Dp(n.time),a=Dp(i.time);return s-a})},eU=(t,e)=>{if(!e||!e.length)return t;let r=0,n=e.length-1,i=0;for(;r<=n;){const s=r+n>>1;Dp(e[s].time)<=t?(i=s,r=s+1):n=s-1}return e[i].time},ist=(t,e,r)=>{if(!t.entryDate||t.entryPrice===void 0)return null;const n=l0(t.entryDate,e);return{time:gN(e)&&typeof n=="number"&&r&&r.length?eU(n,r):n,position:"inBar",color:ps.entry,shape:"circle",size:0,price:t.entryPrice}},sst=(t,e,r)=>{if(!t.exitDate||t.exitPrice===void 0)return null;const n=l0(t.exitDate,e);return{time:gN(e)&&typeof n=="number"&&r&&r.length?eU(n,r):n,position:"inBar",color:ps.exit,shape:"circle",size:0,price:t.exitPrice}},ast=(t,e,r)=>{if(!t.executionTime||t.price===void 0)return null;const n=l0(t.executionTime,e);return{time:gN(e)&&typeof n=="number"&&r&&r.length?eU(n,r):n,position:"inBar",color:dge(t.side),shape:"circle",size:0,price:t.price}},ost=t=>{const e=new Set;return t.filter(r=>{const n=JSON.stringify(r.time);return e.has(n)?!1:(e.add(n),!0)})},rZ=t=>typeof t=="number"?new Date(t*1e3).toLocaleTimeString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZone:"America/New_York"}):typeof t=="string"?t:new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{year:"2-digit",month:"short",day:"numeric",timeZone:"America/New_York"}),fge=t=>{try{const e=window.navigator.languages[0];return Intl.NumberFormat(e,{style:"currency",currency:"USD"}).format(t)}catch(e){return console.error("Error formatting chart price:",ks(e)),"N/A"}};var hge="Toggle",tU=b.forwardRef((t,e)=>
4214{const{pressed:r,defaultPressed:n,onPressedChange:i,...s}=t,[a,o]=Ao({prop:r,onChange:i,defaultProp:n??!1,caller:hge});return l.jsx(vt.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...s,ref:e,onClick:He(t.onClick,()=>{t.disabled||o(!a)})})});tU.displayName=hge;var pge=tU,Gf="ToggleGroup",[mge]=ma(Gf,[o0]),gge=o0(),rU=P.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const i=n;return l.jsx(lst,{...i,ref:e})}if(r==="multiple"){const i=n;return l.jsx(cst,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Gf}\``)});rU.displayName=Gf;var[yge,vge]=mge(Gf),lst=P.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a,o]=Ao({prop:r,defaultProp:n??"",onChange:i,caller:Gf});return l.jsx(yge,{scope:t.__scopeToggleGroup,type:"single",value:P.useMemo(()=>a?[a]:[],[a]),onItemActivate:o,onItemDeactivate:P.useCallback(()=>o(""),[o]),children:l.jsx(xge,{...s,ref:e})})}),cst=P.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a,o]=Ao({prop:r,defaultProp:n??[],onChange:i,caller:Gf}),c=P.useCallback(d=>o((f=[])=>[...f,d]),[o]),u=P.useCallback(d=>o((f=[])=>f.filter(h=>h!==d)),[o]);return l.jsx(yge,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:l.jsx(xge,{...s,ref:e})})});rU.displayName=Gf;var[ust,dst]=mge(Gf),xge=P.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:i=!0,orientation:s,dir:a,loop:o=!0,...c}=t,u=gge(r),d=a0(a),f={role:"group",dir:d,...c};return l.jsx(ust,{scope:r,rovingFocus:i,disabled:n,children:i?l.jsx($V,{asChild:!0,...u,orientation:s,dir:d,loop:o,children:l.jsx(vt.div,{...f,ref:e})}):l.jsx(vt.div,{...f,ref:e})})}),lC="ToggleGroupItem",bge=P.forwardRef((t,e)=>{const r=vge(lC,t.__scopeToggleGroup),n=dst(lC,t.__scopeToggleGroup),i=gge(t.__scopeToggleGroup),s=r.value.includes(t.value),a=n.disabled||t.disabled,o={...t,pressed:s,disabled:a},c=P.useRef(null);return n.rovingFocus?l.jsx(FV,{asChild:!0,...i,focusable:!a,active:s,ref:c,children:l.jsx(nZ,{...o,ref:e})}):l.jsx(nZ,{...o,ref:e})});bge.displayName=lC;var nZ=P.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...i}=t,s=vge(lC,r),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=s.type==="single"?a:void 0;return l.jsx(tU,{...o,...i,ref:e,onPressedChange:c=>{c?s.onItemActivate(n):s.onItemDeactivate(n)}})}),wge=rU,_ge=bge;const Sge=Rf("inline-flex items-center justify-center gap-2 rounded-xl text-sm font-light transition-colors hover:bg-app-button-bg hover:text-app-primary-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-app-border-color-accent disabled:pointer-events-none disabled:opacity-50  data-[state=on]:text-app-primary-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent data-[state=on]:bg-app-button-bg-active",outline:"border border-app-border-color bg-transparent shadow-xs hover:bg-app-button-bg hover:text-app-primary-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fst=b.forwardRef(({className:t,variant:e,size:r,...n},i)=>l.jsx(pge,{ref:i,className:ee(Sge({variant:e,size:r,className:t})),...n}));fst.displayName=pge.displayName;const kge=b.createContext({size:"default",variant:"default"}),Tge=b.forwardRef(({className:t,variant:e,size:r,children:n,...i},s)=>l.jsx(wge,{ref:s,className:ee("flex items-center justify-center gap-1 bg-app-button-bg rounded-xl",t),...i,children:l.jsx(kge.Provider,{value:{variant:e,size:r},children:n})}));Tge.displayName=wge.displayName;const h5=b.forwardRef(({className:t,children:e,variant:r,size:n,...i},s)=>{const a=b.useContext(kge);return l.jsx(_ge,{ref:s,className:ee(Sge({variant:a.variant||r,size:a.size||n}),t),...i,children:e})});h5.displayName=_ge.displayName;const ro={background:"#13141F",text:"#9CA3AF",gridLines:"#262730",border:"#414256",swings:{line:"#A497F6",topGradient:"#39355A",bottomGradient:"#13141F59"},closed:{line:"#4FD1C5",topGradient:"#2B5A5A80",bottomGradient:"#0F172A33"}},hst=({trades:t,height:e=400,timeRangeOption:r,dateRange:n,isLoading:i=!1,mode:s,currency:a})=>{const o=b.useRef(null),c=b.useRef(null),u=Qp("(min-width: 2048px)"),d=u?450:e,{selectedModes:f,setSelectedModes:h}
4214=Xit(),m=b.useMemo(()=>Jit(t,r,n.start,n.end,s,a),[t,r,n.start,n.end,s,a]),y=b.useMemo(()=>est(t,n.start,n.end,s,a),[t,n.start,n.end,s,a]),x=b.useMemo(()=>{const v=f.includes("intraday-swings"),_=f.includes("intraday-closed"),S=_&&v||_?"day":lge(r,n.start,n.end).interval,E=mN(new Date(n.start),new Date(n.end),S).map(T=>Math.floor(T.start.getTime()/1e3));return new Set(E)},[f,r,n.start,n.end]);return b.useEffect(()=>{if(!o.current)return;if(c.current){try{c.current.remove()}catch(N){console.warn("Chart cleanup warning:",ks(N))}c.current=null}const v=f.includes("intraday-swings"),_=f.includes("intraday-closed"),S=v&&m.length>0,k=_&&y.length>0;if(!S&&!k)return;const E=sge(o.current,{layout:{background:{type:Eb.Solid,color:ro.background},textColor:ro.text,fontSize:u?22:14},grid:{vertLines:{color:ro.gridLines},horzLines:{color:ro.gridLines}},rightPriceScale:{borderColor:ro.border,scaleMargins:{top:.15,bottom:.2}},localization:{priceFormatter:N=>a==="usd"?fge(N):fn(N),timeFormatter:N=>x.has(N)?Sv(N,"date"):Sv(N,"full")},crosshair:{horzLine:{labelBackgroundColor:"#9B7DFF"},vertLine:{labelBackgroundColor:"#9B7DFF"}},timeScale:{borderColor:ro.border,allowBoldLabels:!1,timeVisible:!0,tickMarkFormatter:N=>{const j=f.includes("intraday-closed"),M=f.includes("intraday-swings");return j&&!M||x.has(N)?Sv(N,"date"):Sv(N,"time")}},width:o.current.clientWidth,height:d});if(k){const N=E.addSeries(eZ,{lineColor:ro.closed.line,topColor:ro.closed.topGradient,bottomColor:ro.closed.bottomGradient,lineWidth:u?3:2,priceFormat:{type:"price",precision:2,minMove:.01}});N.setData(y),N.createPriceLine({price:0,color:"#9CA3AF",lineWidth:1,lineStyle:2,axisLabelVisible:!0})}if(S){const N=E.addSeries(eZ,{lineColor:ro.swings.line,topColor:ro.swings.topGradient,bottomColor:ro.swings.bottomGradient,lineWidth:u?3:2,priceFormat:{type:"price",precision:2,minMove:.01}});N.setData(m),N.createPriceLine({price:0,color:"#9CA3AF",lineWidth:1,lineStyle:2,axisLabelVisible:!1})}c.current=E,E.timeScale().fitContent();const T=()=>{if(o.current&&c.current)try{c.current.applyOptions({width:o.current.clientWidth})}catch(N){console.warn("Chart resize warning:",ks(N))}};return window.addEventListener("resize",T),()=>{if(window.removeEventListener("resize",T),c.current){try{c.current.remove()}catch(N){console.warn("Chart cleanup warning:",ks(N))}c.current=null}}},[m,y,e,u,d,f,r,n,x,a]),l.jsxs("div",{className:"bg-app-card border border-app-border-color-soft p-6 rounded-xl h-fit overflow-hidden 2k:p-10 2k:h-[600px]",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4 2k:mb-8",children:[l.jsx("h2",{className:"text-xl font-bold 2k:text-3xl",children:"P&L Over Time"}),l.jsxs(Tge,{type:"multiple",value:f,onValueChange:v=>h(v),className:"flex gap-2",children:[l.jsxs(h5,{variant:"outline",value:"intraday-swings",className:"border-none text-app-primary-foreground/80 hover:text-app-primary-foreground opacity-60 hover:opacity-80 transition-all duration-200 data-[state=on]:opacity-100 cursor-pointer","aria-label":"Intraday Swings View",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs bg-[#A497F6]"}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(_s,{className:"size-3.5!"}),"Swings"]})]}),l.jsxs(h5,{variant:"outline",value:"intraday-closed",className:"border-none text-app-primary-foreground/80 hover:text-app-primary-foreground opacity-60 hover:opacity-80 transition-all duration-200 data-[state=on]:opacity-100 cursor-pointer","aria-label":"Intraday Closed View",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs bg-[#4FD1C5]"}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Cu,{className:"size-3.5!"}),"Closed"]})]})]})]}),!i&&l.jsx("div",{ref:o}),i&&l.jsx("div",{className:"h-[400px] flex items-center justify-center bg-app-card 2k:h-[500px]",children:l.jsx(GV,{})}),!i&&!(f.includes("intraday-swings")&&m.length>0||f.includes("intraday-closed")&&y.length>0)&&l.jsx(yV,{title:"No data to show",description:"Try adjusting your date range or filters to see data. Or import trades.",icon:l.jsx(FE,{className:"size-12"}),className:"min-h-[400px]",actionText:"Import trades",actionLink:l.jsxs(At,{to:"/app/trade-entry",children:[l.jsx(n3,{className:"size-4 mr-1 group-hover:translate-x-0.5 transition-transform duration-300"}),"Import trades"]})})]})},pst=({trades:t,isLoading:e,hasTrades:r,onViewMore:n,onTradeClick:i,mode:s,currency:a})=>{const o=nC(0,a),c=t.map(u=>{const d=oN(u,s,a);return d==null?null:{trade:u,displayPnL:d}}).filter(u=>u!=null);return l.jsxs("div",{className:"bg-app-card p-6 rounded-xl border border-app-border-color-soft 2k:p-12",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4 2k:mb-6",children:[l.jsx("h2",{className:"text-xl font-bold 2k:text-3xl",children:"Recent Trades"}),r&&l.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 text-app-text-accent hover:text-app-text-accent/80 transition-colors group duration-300 ease-out text-sm 2k:text-xl",children:["View more",l.jsx(Jx,{size:14,className:"group-hover:translate-x-0.5 transition-transform duration-300 ease-out 2k:w-7 2k:h-7"})]})]}),e?l.jsx(GV,{}):l.jsx("div",{className:"space-y-4 2k:space-y-8",children:Array.from({length:5}).map((u,d)=>{const f=c[d]??null,h=f==null,m=f?f.displayPnL:0,y=h?"text-app-primary-foreground":m>0?"bg-app-positive-color-bg text-app-positive-color":m<0?"bg-app-negative-color-bg text-app-negative-color":"text-app-primary-foreground
4214/50";return l.jsxs("div",{onClick:f?()=>i(f.trade.id):void 0,className:ee("flex items-center justify-between p-2 rounded-lg transition-colors 2k:p-4",f?"hover:bg-app-button-bg cursor-pointer":"opacity-50 cursor-default"),children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium 2k:text-2xl 2k:mb-1",children:f?f.trade.symbol:"No trade"}),l.jsx("p",{className:"text-sm text-gray-400 2k:text-xl",children:f?tp(f.trade.entry_date):"No data"})]}),l.jsxs("div",{className:ee("font-medium flex items-center gap-1 text-left p-1.5 rounded-xl text-xs min-w-[50px] justify-end 2k:text-xl 2k:gap-3",y),children:[h?l.jsx(ju,{size:12,className:"2k:w-7 2k:h-7"}):m>0?l.jsx(_$,{size:12,className:"2k:w-7 2k:h-7"}):m<0?l.jsx(w$,{size:12,className:"2k:w-7 2k:h-7"}):l.jsx(ju,{size:12,className:"2k:w-7 2k:h-7"}),l.jsx("span",{className:"min-w-[50px] text-right",children:f?nC(m,a):o})]})]},f?f.trade.id:`placeholder-${d}`)})})]})},mst=tt`
4215  mutation CreateGoal(
4216    $userId: uuid!
4217    $targetAmount: numeric!
4218    $startDate: date!
4219  ) {
4220    insert_goal_one(
4221      object: {
4222        user_id: $userId
4223        target_amount: $targetAmount
4224        start_date: $startDate
4225        status: "active"
4226      }
4227    ) {
4228      id
4229      userId: user_id
4230      targetAmount: target_amount
4231      startDate: start_date
4232      endDate: end_date
4233      status
4234      createdAt: created_at
4235      updatedAt: updated_at
4236    }
4237  }
4238`,gst=tt`
4239  mutation UpdateGoalStatus(
4240    $goalId: uuid!
4241    $status: String!
4242    $endDate: date
4243  ) {
4244    update_goal_by_pk(
4245      pk_columns: { id: $goalId }
4246      _set: {
4247        status: $status
4248        end_date: $endDate
4249      }
4250    ) {
4251      id
4252      userId: user_id
4253      targetAmount: target_amount
4254      startDate: start_date
4255      endDate: end_date
4256      status
4257      createdAt: created_at
4258      updatedAt: updated_at
4259    }
4260  }
4261`,yst=tt`
4262  mutation DeleteGoal($goalId: uuid!) {
4263    delete_goal_by_pk(id: $goalId) {
4264      id
4265    }
4266  }
4267`,kv=tt`
4268  query GetActiveGoal($userId: uuid!) {
4269    goal(
4270      where: { user_id: { _eq: $userId }, status: { _eq: "active" } }
4271      limit: 1
4272    ) {
4273      id
4274      userId: user_id
4275      targetAmount: target_amount
4276      startDate: start_date
4277      endDate: end_date
4278      status
4279      createdAt: created_at
4280      updatedAt: updated_at
4281    }
4282  }
4283`,Tv=tt`
4284  query GetGoalsHistory($userId: uuid!) {
4285    goal(
4286      where: { user_id: { _eq: $userId } }
4287      order_by: { created_at: desc }
4288    ) {
4289      id
4290      userId: user_id
4291      targetAmount: target_amount
4292      startDate: start_date
4293      endDate: end_date
4294      status
4295      createdAt: created_at
4296      updatedAt: updated_at
4297    }
4298  }
4299`,vst=tt`
4300  query GetGoalTrades($userId: uuid!, $startDate: timestamptz!) {
4301    trade(
4302      where: {
4303        user_id: { _eq: $userId }
4304        is_active: { _eq: true }
4305        deleted_at: { _is_null: true }
4306        status: { _eq: "CLOSED" }
4307        exit_date: { _gte: $startDate }
4308      }
4309      order_by: { exit_date: asc }
4310    ) {
4311      id
4312      entryDate: entry_date
4313      exitDate: exit_date
4314      pnl
4315      netPnl: net_pnl
4316      commissionsFees: commissions_fees
4317      risk
4318      status
4319    }
4320  }
4321`,Cge=()=>{const{userHasura:t}=Gt(),e=t?.id,{data:r,loading:n,refetch:i}=ws(kv,{variables:{userId:e||""},skip:!e,fetchPolicy:"cache-and-network"}),s=r?.goal?.[0]||null,{data:a,loading:o,refetch:c}=ws(Tv,{variables:{userId:e||""},skip:!e,fetchPolicy:"cache-and-network"}),u=a?.goal||[],{data:d,loading:f,refetch:h}=ws(vst,{variables:{userId:e||"",startDate:s?Mu(s.startDate):""},skip:!e||!s,fetchPolicy:"network-only"}),m=d?.trade||[],y=b.useMemo(()=>{if(!s)return{cumulativePnL:0,progressPercent:0,isCompleted:!1,completionDate:null};let R=0,I=!1,B=null;for(const V of m){const $=V.netPnl??V.pnl??0;R+=$,R>=s.targetAmount&&!I&&(I=!0,B=V.exitDate?V.exitDate.split("T")[0]:s.startDate)}const F=Math.min(100,Math.max(0,R/s.targetAmount*100));return{cumulativePnL:R,progressPercent:F,isCompleted:I,completionDate:B}},[s,m]),[x,{loading:v}]=Zn(mst),[_,{loading:S}]=Zn(gst),[k,{loading:E}]=Zn(yst);return{activeGoal:s,trades:m,goalsHistory:u,...y,isLoading:n||s&&f||o,isMutating:v||S||E,createGoal:async(R,I)=>
4321{if(e)try{await x({variables:{userId:e,targetAmount:R,startDate:I},refetchQueries:[{query:kv,variables:{userId:e}},{query:Tv,variables:{userId:e}}]}),Ft.success("Goal started successfully!"),i()}catch(B){throw console.error("Failed to create goal:",B),Ft.error("Failed to start goal. Please try again."),B}},cancelActiveGoal:async()=>{if(s)try{await _({variables:{goalId:s.id,status:"cancelled"},refetchQueries:[{query:kv,variables:{userId:e}},{query:Tv,variables:{userId:e}}]}),Ft.success("Goal cancelled successfully."),i()}catch(R){throw console.error("Failed to cancel goal:",R),Ft.error("Failed to cancel goal. Please try again."),R}},completeActiveGoal:async R=>{if(!s)return;const I=R||new Date().toISOString().split("T")[0];try{await _({variables:{goalId:s.id,status:"completed",endDate:I},refetchQueries:[{query:kv,variables:{userId:e}},{query:Tv,variables:{userId:e}}]}),Ft.success("Congratulations! Goal marked as completed! 🏆"),i()}catch(B){throw console.error("Failed to complete goal:",B),Ft.error("Failed to complete goal. Please try again."),B}},deleteGoal:async R=>{if(e)try{await k({variables:{goalId:R},refetchQueries:[{query:kv,variables:{userId:e}},{query:Tv,variables:{userId:e}}]}),Ft.success("Goal deleted successfully."),i(),c()}catch(I){throw console.error("Failed to delete goal:",I),Ft.error("Failed to delete goal. Please try again."),I}},refetch:()=>{i(),c(),s&&h()}}},xst=({onConfigureClick:t})=>{const{activeGoal:e,cumulativePnL:r,progressPercent:n,isCompleted:i,completionDate:s,isLoading:a,isMutating:o,completeActiveGoal:c}=Cge();if(a)return l.jsx("div",{className:"w-full bg-app-button-bg/30 border border-app-border-color-soft rounded-2xl p-6 flex items-center justify-center min-h-[120px] backdrop-blur-md",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(gn,{size:"md"}),l.jsx("span",{className:"text-sm text-app-primary-foreground/60 font-light",children:"Loading trading goal data..."})]})});if(!e)return l.jsxs("div",{className:"w-full bg-linear-to-r from-emerald-500/10 via-teal-500/5 to-transparent border border-emerald-500/20 rounded-2xl p-6 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 backdrop-blur-md relative overflow-hidden group",children:[l.jsx("div",{className:"absolute top-0 right-0 p-8 opacity-5 -translate-y-2 translate-x-2 transition-transform duration-500 group-hover:scale-110",children:l.jsx(px,{size:120,className:"text-emerald-400"})}),l.jsxs("div",{className:"space-y-1 z-10",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Kc,{className:"text-emerald-400 size-5 animate-pulse"}),l.jsx("h3",{className:"font-semibold text-lg text-app-primary-foreground",children:"Track Your Profits"})]}),l.jsx("p",{className:"text-sm text-app-primary-foreground/70 font-light max-w-xl",children:"Set a profit goal (e.g., $10,000) and watch your progress bar fill up in real time as you close profitable trades."})]}),l.jsxs(ye,{onClick:t,className:"bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-6 py-2.5 rounded-xl border border-emerald-500/30 shadow-lg shadow-emerald-500/10 transition-all duration-300 hover:translate-y-[-1px] z-10 shrink-0",children:[l.jsx(px,{className:"size-4 mr-1.5"}),"Set Profit Goal"]})]});const u=r>0,d=r<0;return l.jsxs("div",{className:Pe("w-full rounded-2xl p-6 border backdrop-blur-md transition-all duration-500 relative overflow-hidden",i?"bg-linear-to-r from-emerald-500/10 via-emerald-500/5 to-app-button-bg/30 border-emerald-500/35 shadow-lg shadow-emerald-500/5":"bg-app-button-bg/40 border-app-border-color-soft"),children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1.5 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[i?l.jsx(zl,{className:"text-yellow-400 size-5.5 animate-bounce"}):l.jsx(px,{className:"text-emerald-400 size-5.5"}),l.jsx("span",{className:"font-semibold text-base text-app-primary-foreground",children:i?"Goal Reached! 🏆":"Active Profit Goal"}),l.jsx("span",{className:Pe("text-xs px-2.5 py-0.5 rounded-full border font-medium ml-2",i?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-
4321app-button-bg text-app-primary-foreground/60 border-app-border-color-soft"),children:i?"Completed":"In Progress"})]}),l.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[l.jsx("span",{className:Pe("text-2xl font-bold tracking-tight",u?"text-emerald-400":d?"text-red-400":"text-app-primary-foreground"),children:Ke(r)}),l.jsxs("span",{className:"text-app-primary-foreground/50 text-sm",children:["of ",Ke(e.targetAmount)," target"]}),l.jsxs("span",{className:"text-app-primary-foreground/40 text-xs ml-2 font-light",children:["(started ",e.startDate,")"]})]})]}),i&&l.jsxs(ye,{onClick:()=>c(s||void 0),disabled:o,className:"bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-6 py-2.5 rounded-xl border border-emerald-500/30 shadow-lg shadow-emerald-500/15 transition-all duration-300 hover:translate-y-[-1px] shrink-0",children:[o?l.jsx(gn,{size:"sm"}):l.jsx(zl,{className:"size-4 mr-1.5"}),"Complete & Archive Goal"]}),!i&&l.jsx("button",{onClick:t,className:"text-xs text-app-primary-foreground/60 hover:text-app-primary-foreground border border-app-border-color-soft bg-app-button-bg hover:bg-app-button-bg-hover transition-colors px-3 py-1.5 rounded-lg shrink-0 self-start md:self-center",children:"Adjust Goal"})]}),l.jsxs("div",{className:"mt-5 space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"text-app-primary-foreground/60",children:"Progress"}),l.jsxs("span",{className:"font-semibold text-app-primary-foreground",children:[n.toFixed(1),"%"]})]}),l.jsx("div",{className:"relative w-full h-3.5 bg-gray-900/60 rounded-full overflow-hidden border border-app-border-color-soft/80 shadow-inner",children:l.jsx("div",{className:Pe("absolute top-0 left-0 h-full rounded-full transition-all duration-700 ease-out shadow-xs",i?"bg-gradient-to-r from-emerald-500 via-teal-400 to-emerald-400 animate-shimmer":d?"bg-red-500/60":"bg-gradient-to-r from-emerald-600 to-emerald-400"),style:{width:`${n}%`}})})]})]})},bst=cf([Il("apply_all"),Il("future_only")]),Ege=li({initialRisk:Li({error:"Please enter a valid amount"}).positive("Enter a positive USD amount (e.g., 25 or 100.50)").transform(t=>Math.round(t*100)/100).nullable(),applyScope:bst.default("future_only").optional()}),jge=li({initialRisk:Ege.shape.initialRisk}),Nge=({defaultValue:t,className:e="",children:r})=>{const[n,i]=P.useState(t),s=P.useMemo(()=>({activeTab:n,setActiveTab:i}),[n]);return l.jsx(Pge.Provider,{value:s,children:l.jsx("div",{className:e,children:r})})},Pge=P.createContext(null);function Mge(){const t=P.useContext(Pge);if(!t)throw new Error("Tabs components must be used within a Tabs provider");return t}const Age=({className:t="",children:e})=>l.jsx("div",{className:t,children:e}),p5=({value:t,className:e="",children:r})=>{const{activeTab:n,setActiveTab:i}=Mge(),s=n===t;return l.jsx("button",{className:`${e} ${s?"bg-app-button-bg-active border border-app-border-color-accent text-app-primary-foreground rounded-xl":"text-gray-400 hover:text-gray-200"}`,onClick:()=>i(t),"data-state":s?"active":"inactive",type:"button",children:r})},m5=({value:t,className:e,children:r})=>{const{activeTab:n}
4321=Mge();return n!==t?null:e?l.jsx("div",{className:e,children:r}):l.jsx(l.Fragment,{children:r})},Dge=({open:t,onOpenChange:e,user:r})=>{const[n,{loading:i}]=Zn(PHe),[s,{loading:a}]=Zn(Lhe),{activeGoal:o,createGoal:c,cancelActiveGoal:u,completeActiveGoal:d,deleteGoal:f,cumulativePnL:h,progressPercent:m,isCompleted:y,completionDate:x,goalsHistory:v,isLoading:_,isMutating:S}=Cge(),[k,E]=b.useState(""),[T,N]=b.useState(new Date().toISOString().split("T")[0]),j=async F=>{if(F.preventDefault(),!k||!T)return;const V=Number(k);if(Number.isNaN(V)||V<=0){Ft.error("Please enter a positive target profit amount.");return}try{await c(V,T),E("")}catch{}},M=$o({resolver:xl(Ege),defaultValues:{initialRisk:r.initial_risk,applyScope:"future_only"}}),O=M.watch("initialRisk"),R=!M.formState.dirtyFields.initialRisk,I=F=>{F?M.reset({initialRisk:r.initial_risk,applyScope:"future_only"}):(E(""),N(new Date().toISOString().split("T")[0])),e(F)},B=async F=>{try{await n({variables:{userId:r.id,initialRisk:F.initialRisk},update:($,U)=>{const z=U.data?.update_user_by_pk?.initial_risk??F.initialRisk;$.modify({id:$.identify({__typename:"user",id:r.id}),fields:{initial_risk:()=>z}})}});const V={...r,initial_risk:F.initialRisk};Gt.getState().setUserHasura(V),F.applyScope==="apply_all"&&await s({variables:{userId:r.id,risk:F.initialRisk},update:($,U)=>{const z=U.data?.update_trade?.returning.map(W=>W.id)??[],L=F.initialRisk;z.forEach(W=>{$.modify({id:$.identify({__typename:"trade",id:W}),fields:{risk:()=>L}})})}}),Ft.success("Trades settings updated successfully"),I(!1)}catch(V){const $=jw(V);M.setError("initialRisk",{message:$})}};return l.jsx(Pj,{open:t,onOpenChange:I,children:l.jsxs(Xw,{className:"sm:max-w-[500px]",children:[l.jsxs(Mj,{className:"flex flex-row items-center gap-4",children:[l.jsx("div",{className:"bg-app-button-bg border border-app-border-color-soft rounded-xl p-2",children:l.jsx(fl,{strokeWidth:1.5,className:"size-6"})}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(Jw,{children:"Trades settings"}),l.jsx(Aj,{className:"max-w-xs",children:"Customize how your trade data is displayed, set default risk, or track a profit goal."})]})]}),l.jsx(tc,{decorative:!0,className:"border-dashed my-2"}),l.jsxs(Nge,{defaultValue:"risk",className:"w-full",children:[l.jsxs(Age,{className:"flex flex-row gap-2 bg-app-input-bg p-1 rounded-2xl border border-app-border-color mb-4",children:[l.jsx(p5,{value:"risk",className:"flex-1 py-2 text-sm font-medium transition-colors",children:"Risk settings"}),l.jsx(p5,{value:"goal",className:"flex-1 py-2 text-sm font-medium transition-colors",children:"Goal tracker"})]}),l.jsxs(m5,{value:"risk",children:[l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-app-button-bg border-none text-app-primary-foreground/90 [&>svg]:text-app-primary-foreground/90 mb-4",children:[l.jsx(Kc,{size:24,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1 ml-2 font-light max-w-sm leading-relaxed",children:[l.jsx("strong",{className:"font-semibold",children:"What is Risk?"})," ","Risk (R) is a normalized way to measure trade performance.",l.jsx("br",{}),"If you risk $100 and make $200, that's a +2R trade.",l.jsx("br",{}),"If you risk $50 and lose $25, that's a -0.5R trade.",l.jsx("br",{}),"This lets you compare trades regardless of position size."]})]}),l.jsx(tc,{decorative:!0,className:"my-2"}),l.jsx(tN,{...M,children:l.jsxs("form",{onSubmit:M.handleSubmit(B),className:"space-y-6 mt-2",children:[l.jsx(kb,{control:M.control,name:"initialRisk",render:({field:F})=>{const V=$=>{const{value:U}=$.target,z=Number.parseFloat(U);F.onChange(U===""||Number.isNaN(z)?null:z)};return l.jsxs(ry,{children:[l.jsx(ny,{children:"Default Initial Risk (USD)"}),l.jsxs("div",{className:"relative flex rounded-md w-full",children:[l.jsx("span",{className:"text-app-primary-foreground/70 pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-lg font-light",children:"$"}),l.jsx(n1,{children:l.jsx(Wr,{...F,value:F.value??"",disabled:i,onChange:V,inputMode:"decimal",placeholder:"0.00",type:"number",step:"0.01",hasIcon:!0,className:"-me-px rounded-e-none ps-6 w-full text-app-primary-foreground
4321/90"})}),l.jsx("span",{className:"bg-app-input-bg text-app-primary-foreground/70 -z-10 inline-flex items-center rounded-e-lg border border-app-border-color border-l-0 px-3 text-sm font-light",children:"USD"})]}),l.jsx(nN,{children:"Set a default risk amount for new trades. This will be automatically applied when importing trades without a specified risk amount. Existing trades remain unchanged."}),l.jsx(iN,{})]})}}),O!=null&&O>1e5&&l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-yellow-500/10 border-yellow-500/20 text-yellow-100 [&>svg]:text-yellow-400",children:[l.jsx(Wu,{size:20,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1.5 ml-1 font-light max-w-sm",children:[l.jsx("strong",{children:"High Risk Amount:"})," ",Ke(O)," ","is unusually high for a default risk amount. Please double-check this value before saving."]})]}),r.initial_risk==null&&l.jsx("div",{className:"space-y-3",children:l.jsx(kb,{control:M.control,name:"applyScope",render:({field:F})=>l.jsxs(ry,{children:[l.jsx(ny,{className:"max-w-xs leading-relaxed",children:"Would you like to apply this risk to all your previously imported trades?"}),l.jsxs(VV,{value:F.value,onValueChange:F.onChange,className:"grid gap-0",children:[l.jsxs("div",{className:Pe("flex items-start gap-3 rounded-xl border border-app-border-color rounded-b-none bg-app-input-bg px-4 py-3 text-sm",F.value==="apply_all"&&"border-app-border-color-accent bg-app-button-bg/70"),children:[l.jsx(tC,{value:"apply_all",id:"apply_all",className:"mt-0.5"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsx("label",{htmlFor:"apply_all",children:"Yes, apply to existing trades"}),l.jsx("p",{className:"text-app-primary-foreground/80 font-light max-w-md",children:"This will set the selected default risk on all your existing trades so R values are consistent across your history."})]})]}),l.jsxs("div",{className:Pe("flex items-start gap-3 rounded-xl border border-app-border-color rounded-t-none bg-app-input-bg px-4 py-3 text-sm",F.value==="future_only"&&"border-app-border-color-accent bg-app-button-bg/70"),children:[l.jsx(tC,{value:"future_only",id:"future_only",className:"mt-0.5"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsx("label",{htmlFor:"future_only",children:"No, only for future imported trades"}),l.jsx("p",{className:"text-app-primary-foreground/80 font-light max-w-md",children:"Your past trades will remain unchanged to preserve your original records; the default risk will be applied only to future imports."})]})]})]})]})})}),l.jsxs(_b,{children:[l.jsx(ye,{type:"button",variant:"outline",onClick:()=>I(!1),disabled:i,children:"Close"}),l.jsxs(ye,{type:"submit",disabled:i||R||a,children:[i?"Saving...":"Save",i?l.jsx(gn,{size:"sm"}):l.jsx(ei,{})]})]})]})})]}),l.jsx(m5,{value:"goal",className:"space-y-4",children:_?l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[l.jsx(gn,{size:"lg"}),l.jsx("span",{className:"text-sm text-app-primary-foreground/50",children:"Loading goal tracker..."})]}):l.jsxs(l.Fragment,{children:[o?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"bg-app-button-bg/50 border border-app-border-color rounded-2xl p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(px,{className:"text-emerald-400 size-5"}),l.jsx("span",{className:"font-semibold text-app-primary-foreground",children:"Active Goal"})]}),y?l.jsxs("span",{className:"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 text-xs px-2.5 py-0.5 rounded-full font-medium flex items-center gap-1",children:[l.jsx(zl,{size:12})," Reached!"]}):l.jsx("span",{className:"bg-app-button-bg text-app-primary-foreground/70 border border-app-border-color-soft text-xs px-2.5 py-0.5 rounded-full font-medium",children:"In Progress"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-app-primary-foreground/50",children:"Target Goal"}),l.jsx("p",{className:"text-sm font-bold text-app-primary-foreground mt-0.5",children:Ke(o.targetAmount)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-app-primary-foreground
4321/50",children:"Start Date"}),l.jsx("p",{className:"text-sm font-bold text-app-primary-foreground mt-0.5",children:o.startDate})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-app-primary-foreground/50",children:"Current Progress"}),l.jsx("p",{className:Pe("text-sm font-bold mt-0.5",h>0?"text-emerald-400":h<0?"text-red-400":"text-app-primary-foreground"),children:Ke(h)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-app-primary-foreground/50",children:"Percentage"}),l.jsxs("p",{className:"text-sm font-bold text-app-primary-foreground mt-0.5",children:[m.toFixed(1),"%"]})]})]}),l.jsx("div",{className:"space-y-1.5",children:l.jsx("div",{className:"relative w-full h-3 bg-gray-900 rounded-full overflow-hidden border border-app-border-color-soft",children:l.jsx("div",{className:Pe("absolute top-0 left-0 h-full rounded-full transition-all duration-500 ease-out",y?"bg-gradient-to-r from-emerald-500 to-teal-400":h<0?"bg-red-500":"bg-gradient-to-r from-emerald-600 to-emerald-400"),style:{width:`${m}%`}})})})]}),y&&l.jsxs(wo,{className:"bg-emerald-500/10 border-emerald-500/20 text-emerald-100 [&>svg]:text-emerald-400 rounded-2xl",children:[l.jsx(zl,{size:20,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1 ml-2 font-light max-w-sm leading-relaxed",children:[l.jsx("strong",{className:"font-semibold text-emerald-400",children:"Congratulations!"})," ","You have reached your goal of ",Ke(o.targetAmount),"! Click below to complete and archive this goal."]})]}),l.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[y&&l.jsxs(ye,{type:"button",disabled:S,onClick:()=>d(x||void 0),className:"w-full bg-emerald-600 hover:bg-emerald-500 text-white flex items-center justify-center gap-2 py-3 rounded-xl font-medium",children:[S?l.jsx(gn,{size:"sm"}):l.jsx(zl,{size:18}),"Complete & Archive Goal"]}),l.jsxs(ye,{type:"button",variant:"outline",disabled:S,onClick:u,className:"w-full border-red-500/20 text-red-400 hover:bg-red-500/10 hover:text-red-300 flex items-center justify-center gap-2 py-3 rounded-xl font-medium",children:[S?l.jsx(gn,{size:"sm"}):l.jsx(hl,{size:16}),"Cancel & Delete Goal"]})]})]}):l.jsxs("form",{onSubmit:j,className:"space-y-4 mt-2",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-sm font-medium text-app-primary-foreground/90",children:"Target Profit Goal (USD)"}),l.jsxs("div",{className:"relative flex rounded-md w-full",children:[l.jsx("span",{className:"text-app-primary-foreground/70 pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-lg font-light",children:"$"}),l.jsx(Wr,{value:k,onChange:F=>{const V=F.target.value;V!==""&&Number(V)<0||E(V===""?"":Number(V))},placeholder:"10000",type:"number",min:"0.01",step:"0.01",required:!0,hasIcon:!0,className:"ps-6 w-full text-app-primary-foreground/90"})]}),l.jsx("span",{className:"text-xs text-app-primary-foreground/50",children:"Enter the target profit amount you want to achieve."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-sm font-medium text-app-primary-foreground/90",children:"Goal Start Date"}),l.jsx(Wr,{value:T,onChange:F=>N(F.target.value),type:"date",required:!0,className:"w-full text-app-primary-foreground/90"}),l.jsx("span",{className:"text-xs text-app-primary-foreground/50",children:"Trades closed on or after this date will be tracked towards this goal."})]})]}),l.jsxs(_b,{className:"pt-2",children:[l.jsx(ye,{type:"button",variant:"outline",onClick:()=>I(!1),children:"Cancel"}),l.jsxs(ye,{type:"submit",disabled:S||!k||!T,className:"bg-emerald-600 hover:bg-emerald-500 text-white",children:[S?"Starting...":"Start Goal",S?l.jsx(gn,{size:"sm"}):l.jsx(px,{})]})]})]}),v?.filter(F=>F.status!=="active").length>0&&l.jsxs("div",{className:"space-y-3 mt-6 pt-4 border-t border-app-border-color-soft",children:[l.jsxs("h4",{className:"text-sm font-semibold text-app-primary-foreground flex items-center gap-1.5",children:[l.jsx(zl,{className:"text-yellow-400 size-4"})," Goal Achievement History"]}),l.jsx("div",{className:"space-y-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar",children:v.filter(F=>F.status!=="active").map(F=>l.jsxs("div",{className:Pe("p-3 rounded-xl border flex flex-col gap-1 text-xs transition-colors duration-200",F.status==="completed"?"bg-emerald-500/5 border-emerald-500/20 hover:bg-emerald-500/10 text-emerald-100/90":"bg-app-button-bg/30 border-app-border-color-soft hover:bg-app-button-bg/50 text-app-primary-foreground
4321/70"),children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"font-bold text-sm text-app-primary-foreground",children:Ke(F.targetAmount)}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:Pe("px-2 py-0.5 rounded-full text-[10px] font-medium border",F.status==="completed"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-gray-500/10 text-gray-400 border-gray-500/20"),children:F.status==="completed"?"Completed":"Cancelled"}),l.jsx("button",{type:"button",disabled:S,onClick:async V=>{V.stopPropagation(),confirm("Are you sure you want to delete this goal record?")&&await f(F.id)},className:"text-app-primary-foreground/45 hover:text-red-400 transition-colors p-1 rounded-md hover:bg-red-500/10 cursor-pointer",title:"Delete goal record",children:l.jsx(hl,{size:13})})]})]}),l.jsxs("div",{className:"flex justify-between items-center text-app-primary-foreground/50 text-[11px] font-light mt-1",children:[l.jsxs("span",{children:["Started: ",F.startDate]}),F.endDate?l.jsxs("span",{children:["Completed: ",F.endDate]}):l.jsxs("span",{children:["Updated: ",F.updatedAt?.split("T")[0]||""]})]})]},F.id))})]})]})})]})]})})};function wst(t,e,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:r}).format(e).split(/\s/g).slice(2).join(" ")}const _st={},ix={};function zh(t,e){try{const n=(_st[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return n in ix?ix[n]:iZ(n,n.split(":"))}catch{if(t in ix)return ix[t];const r=t?.match(Sst);return r?iZ(t,r.slice(1)):NaN}}const Sst=/([+-]\d\d):?(\d\d)?/;function iZ(t,e){const r=+(e[0]||0),n=+(e[1]||0),i=+(e[2]||0)/60;return ix[t]=r*60+n>0?r*60+n+i:r*60-n-i}class Gl extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(zh(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Oge(this),g5(this)):this.setTime(Date.now())}static tz(e,...r){return r.length?new Gl(...r,e):new Gl(Date.now(),e)}withTimeZone(e){return new Gl(+this,e)}getTimezoneOffset(){const e=-zh(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),g5(this),+this}[Symbol.for("constructDateFrom")](e){return new Gl(+new Date(e),this.timeZone)}}const sZ=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!sZ.test(t))return;const e=t.replace(sZ,"$1UTC");Gl.prototype[e]&&(t.startsWith("get")?Gl.prototype[t]=function(){return this.internal[e]()}:(Gl.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),kst(this),+this},Gl.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),g5(this),+this}))});function g5(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-zh(t.timeZone,t)*60))}function kst(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),Oge(t)}function Oge(t){const e=zh(t.timeZone,t),r=e>0?Math.floor(e):Math.ceil(e),n=new Date(+t);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+t).getTimezoneOffset(),s=-new Date(+n).getTimezoneOffset(),a=i-s,o=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&o&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=i-r;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const u=new Date(+t);u.setUTCSeconds(0);const d=i>0?u.getSeconds():(u.getSeconds()-60)%60,f=Math.round(-(zh(t.timeZone,t)*60))%60;(f||d)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+f+d));const h=zh(t.timeZone,t),m=h>0?Math.floor(h):Math.ceil(h),x=-new Date(+t).getTimezoneOffset()-m,v=m!==r,_=x-c;if(v&&_){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+_);const S=zh(t.timeZone,t),k=S>0?Math.floor(S):Math.ceil(S),E=m-k;E&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+E),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+E))}}class ds extends Gl{static tz(e,...r){return r.length?new ds(...r,e):new ds(Date.now(),e)}toISOString(){const[e,r,n]=this.tzComponents(),i=`${e}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()}
4321 ${this.toTimeString()}`}toDateString(){const[e,r,n,i]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${r} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[r,n,i]=this.tzComponents();return`${e} GMT${r}${n}${i} (${wst(this.timeZone,this)})`}toLocaleString(e,r){return Date.prototype.toLocaleString.call(this,e,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleDateString(e,r){return Date.prototype.toLocaleDateString.call(this,e,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleTimeString(e,r){return Date.prototype.toLocaleTimeString.call(this,e,{...r,timeZone:r?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),r=e>0?"-":"+",n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[r,n,i]}withTimeZone(e){return new ds(+this,e)}[Symbol.for("constructDateFrom")](e){return new ds(+new Date(e),this.timeZone)}}const aZ=5,Tst=4;function Cst(t,e){const r=e.startOfMonth(t),n=r.getDay()>0?r.getDay():7,i=e.addDays(t,-n+1),s=e.addDays(i,aZ*7-1);return e.getMonth(t)===e.getMonth(s)?aZ:Tst}function Rge(t,e){const r=e.startOfMonth(t),n=r.getDay();return n===1?r:n===0?e.addDays(r,-6):e.addDays(r,-1*(n-1))}function Est(t,e){const r=Rge(t,e),n=Cst(t,e);return e.addDays(r,n*7-1)}class Ua{constructor(e,r){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ds.tz(this.options.timeZone):new this.Date,this.newDate=(n,i,s)=>this.overrides?.newDate?this.overrides.newDate(n,i,s):this.options.timeZone?new ds(n,i,s,this.options.timeZone):new Date(n,i,s),this.addDays=(n,i)=>this.overrides?.addDays?this.overrides.addDays(n,i):$a(n,i),this.addMonths=(n,i)=>this.overrides?.addMonths?this.overrides.addMonths(n,i):Va(n,i),this.addWeeks=(n,i)=>this.overrides?.addWeeks?this.overrides.addWeeks(n,i):Xg(n,i),this.addYears=(n,i)=>this.overrides?.addYears?this.overrides.addYears(n,i):ml(n,i),this.differenceInCalendarDays=(n,i)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,i):Nf(n,i),this.differenceInCalendarMonths=(n,i)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,i):Jg(n,i),this.eachMonthOfInterval=n=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):rQe(n),this.endOfBroadcastWeek=n=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):Est(n,this),this.endOfISOWeek=n=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(n):iQe(n),this.endOfMonth=n=>this.overrides?.endOfMonth?this.overrides.endOfMonth(n):ga(n),this.endOfWeek=(n,i)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(n,i):$u(n,this.options),this.endOfYear=n=>this.overrides?.endOfYear?this.overrides.endOfYear(n):$j(n),this.format=(n,i,s)=>{const a=this.overrides?.format?this.overrides.format(n,i,this.options):sr(n,i,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=n=>this.overrides?.getISOWeek?this.overrides.getISOWeek(n):zj(n),this.getMonth=(n,i)=>this.overrides?.getMonth?this.overrides.getMonth(n,this.options):Qi(n,this.options),this.getYear=(n,i)=>this.overrides?.getYear?this.overrides.getYear(n,this.options):tr(n,this.options),this.getWeek=(n,i)=>this.overrides?.getWeek?this.overrides.getWeek(n,this.options):bV(n,this.options),this.isAfter=(n,i)=>this.overrides?.isAfter?this.overrides.isAfter(n,i):Fu(n,i),this.isBefore=(n,i)=>this.overrides?.isBefore?this.overrides.isBefore(n,i):ll(n,i),this.isDate=n=>this.overrides?.isDate?this.overrides.isDate(n):ic(n),this.isSameDay=(n,i)=>this.overrides?.isSameDay?this.overrides.isSameDay(n,i):Lj(n,i),this.isSameMonth=(n,i)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(n,i):Bj(n,i),this.isSameYear=(n,i)=>this.overrides?.isSameYear?this.overrides.isSameYear(n,i):SV(n,i),this.max=n=>this.overrides?.max?this.overrides.max(n):WF(n),this.min=n=>this.overrides?.min?this.overrides.min(n):HF(n),this.setMonth=(n,i)=>this.overrides?.setMonth?this.overrides.setMonth(n,i):fs(n,i),this.setYear=(n,i)=>this.overrides?.setYear?this.overrides.setYear(n,i):po(n,i),this.startOfBroadcastWeek=(n,i)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):Rge(n,this),this.startOfDay=n=>this.overrides?.startOfDay?this.overrides.startOfDay(n):Us(n),this.startOfISOWeek=n=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(n):Tp(n),this.startOfMonth=n=>this.overrides?.startOfMonth?this.overrides.startOfMonth(n):Gs(n),this.startOfWeek=(n,i)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(n,this.options):mi(n,this.options),this.startOfYear=n=>this.overrides?.startOfYear?this.overrides.startOfYear(n):Zu(n),this.options={locale:Fj,...e},this.overrides=r}getDigitMap(){const{numerals:e="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let i=0;i<10;i++)n[i.toString()]=r.format(i);return n}replaceDigits(e){const r=this.getDigitMap();return e.replace(/\d/g,n=>r[n]||n)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Ua.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:r,timeZone:n,numerals:i}=this.options,s=r?.code;if(s&&Ua.yearFirstLocales.has(s))try{return new Intl.DateTimeFormat(s,{month:"long",year:"numeric",timeZone:n,numberingSystem:i}).format(e)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}Ua.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const kc=new Ua;class Ige{constructor(e,r,n=kc){this.date=e,this.displayMonth=r,this.outside=!!(r&&!n.isSameMonth(e,r)),this.dateLib=n}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class jst{constructor(e,r){this.date=e,this.weeks=r}}class Nst{constructor(e,r){this.days=r,this.weekNumber=e}}function Pst(t){return P.createElement("button",{...t})}function Mst(t){return P.createElement("span",{...t})}function Ast(t){const{size:e=24,orientation:r="left",className:n}=t;return P.createElement("svg",{className:n,width:e,height:e,viewBox:"0 0 24 24"},r==="up"&&P.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&P.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&P.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&P.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Dst(t){const{day:e,modifiers:r,...n}=t;return P.createElement("td",{...n})}function Ost(t){const{day:e,modifiers:r,...n}=t,i=P.useRef(null);return P.useEffect(()=>{r.focused&&i.current?.focus()}
vendor: 26,737 bytes, line 4321
4321,[r.focused]),P.createElement("button",{ref:i,...n})}var kt;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(kt||(kt={}));var Tn;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(Tn||(Tn={}));var ul;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(ul||(ul={}));var Ca;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Ca||(Ca={}));function Rst(t){const{options:e,className:r,components:n,classNames:i,...s}=t,a=[i[kt.Dropdown],r].join(" "),o=e?.find(({value:c})=>c===s.value);return P.createElement("span",{"data-disabled":s.disabled,className:i[kt.DropdownRoot]},P.createElement(n.Select,{className:a,...s},e?.map(({value:c,label:u,disabled:d})=>P.createElement(n.Option,{key:c,value:c,disabled:d},u))),P.createElement("span",{className:i[kt.CaptionLabel],"aria-hidden":!0},o?.label,P.createElement(n.Chevron,{orientation:"down",size:18,className:i[kt.Chevron]})))}function Ist(t){return P.createElement("div",{...t})}function Lst(t){return P.createElement("div",{...t})}function $st(t){const{calendarMonth:e,displayIndex:r,...n}=t;return P.createElement("div",{...n},t.children)}function Fst(t){const{calendarMonth:e,displayIndex:r,...n}=t;return P.createElement("div",{...n})}function zst(t){return P.createElement("table",{...t})}function Bst(t){return P.createElement("div",{...t})}const Lge=b.createContext(void 0);function c1(){const t=b.useContext(Lge);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function Vst(t){const{components:e}=c1();return P.createElement(e.Dropdown,{...t})}function Ust(t){const{onPreviousClick:e,onNextClick:r,previousMonth:n,nextMonth:i,...s}=t,{components:a,classNames:o,labels:{labelPrevious:c,labelNext:u}}=c1(),d=b.useCallback(h=>{i&&r?.(h)},[i,r]),f=b.useCallback(h=>{n&&e?.(h)},[n,e]);return P.createElement("nav",{...s},P.createElement(a.PreviousMonthButton,{type:"button",className:o[kt.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},P.createElement(a.Chevron,{disabled:n?void 0:!0,className:o[kt.Chevron],orientation:"left"})),P.createElement(a.NextMonthButton,{type:"button",className:o[kt.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":u(i),onClick:d},P.createElement(a.Chevron,{disabled:i?void 0:!0,orientation:"right",className:o[kt.Chevron]})))}function Gst(t){const{components:e}=c1();return P.createElement(e.Button,{...t})}function Wst(t){return P.createElement("option",{...t})}function Hst(t){const{components:e}=c1();return P.createElement(e.Button,{...t})}function qst(t){const{rootRef:e,...r}=t;return P.createElement("div",{...r,ref:e})}function Yst(t){return P.createElement("select",{...t})}function Kst(t){const{week:e,...r}=t;return P.createElement("tr",{...r})}function Qst(t){return P.createElement("th",{...t})}function Zst(t){return P.createElement("thead",{"aria-hidden":!0},P.createElement("tr",{...t}))}function Xst(t){const{week:e,...r}=t;return P.createElement("th",{...r})}function Jst(t){return P.createElement("th",{...t})}function eat(t){return P.createElement("tbody",{...t})}function tat(t){const{components:e}=c1();return P.createElement(e.Dropdown,{...t})}const rat=Object.freeze(Object.defineProperty({__proto__:null,Button:Pst,CaptionLabel:Mst,Chevron:Ast,Day:Dst,DayButton:Ost,Dropdown:Rst,DropdownNav:Ist,Footer:Lst,Month:$st,MonthCaption:Fst,MonthGrid:zst,Months:Bst,MonthsDropdown:Vst,Nav:Ust,NextMonthButton:Gst,Option:Wst,PreviousMonthButton:Hst,Root:qst,Select:Yst,Week:Kst,WeekNumber:Xst,WeekNumberHeader:Jst,Weekday:Qst,Weekdays:Zst,Weeks:eat,YearsDropdown:tat},Symbol.toStringTag,{value:"Module"}));function iu(t,e,r=!1,n=kc){let{from:i,to:s}=t;const{differenceInCalendarDays:a,isSameDay:o}=n;return i&&s?(a(s,i)<0&&([i,s]=[s,i]),a(e,i)>=(r?1:0)&&a(s,e)>=(r?1:0)):!r&&s?o(s,e):!r&&i?o(i,e):!1}function $ge(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function nU(t){return!!(t&&typeof t=="object"&&"from"in t)}function Fge(t){return!!(t&&typeof t=="object"&&"after"in t)}function zge(t){return!!(t&&typeof t=="object"&&"before"in t)}function Bge(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Vge(t,e){return Array.isArray(t)&&t.every(e.isDate)}function su(t,e,r=kc){const n=Array.isArray(e)?e:[e],{isSameDay:i,differenceInCalendarDays:s,isAfter:a}=r;return n.some(o=>{if(typeof o=="boolean")return o;if(r.isDate(o))return i(t,o);if(Vge(o,r))return o.includes(t);if(nU(o))return iu(o,t,!1,r);if(Bge(o))return Array.isArray(o.dayOfWeek)?o.dayOfWeek.includes(t.getDay()):o.dayOfWeek===t.getDay();if($ge(o)){const c=s(o.before,t),u=s(o.after,t),d=c>0,f=u<0;return a(o.before,o.after)?f&&d:d||f}return Fge(o)?s(t,o.after)>0:zge(o)?s(o.before,t)>0:typeof o=="function"?o(t):!1})}function nat(t,e,r,n,i){const{disabled:s,hidden:a,modifiers:o,showOutsideDays:c,broadcastCalendar:u,today:d}=e,{isSameDay:f,isSameMonth:h,startOfMonth:m,isBefore:y,endOfMonth:x,isAfter:v}=i,_=r&&m(r),S=n&&x(n),k={[Tn.focused]:[],[Tn.outside]:[],[Tn.disabled]:[],[Tn.hidden]:[],[Tn.today]:[]},E={};for(const T of t){const{date:N,displayMonth:j}=T,M=!!(j&&!h(N,j)),O=!!(_&&y(N,_)),R=!!(S&&v(N,S)),I=!!(s&&su(N,s,i)),B=!!(a&&su(N,a,i))||O||R||!u&&!c&&M||u&&c===!1&&M,F=f(N,d??i.today());M&&k.outside.push(T),I&&k.disabled.push(T),B&&k.hidden.push(T),F&&k.today.push(T),o&&Object.keys(o).forEach(V=>{const $=o?.[V];$&&su(N,$,i)&&(E[V]?E[V].push(T):E[V]=[T])})}return T=>{const N={[Tn.focused]:!1,[Tn.disabled]:!1,[Tn.hidden]:!1,[Tn.outside]:!1,[Tn.today]:!1},j={};for(const M in k){const O=k[M];N[M]=O.some(R=>R===T)}for(const M in E)j[M]=E[M].some(O=>O===T);return{...N,...j}}}function iat(t,e,r={}){return Object.entries(t).filter(([,i])=>i===!0).reduce((i,[s])=>(r[s]?i.push(r[s]):e[Tn[s]]?i.push(e[Tn[s]]):e[ul[s]]&&i.push(e[ul[s]]),i),[e[kt.Day]])}function sat(t){return{...rat,...t}}function aat(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([r,n])=>{r.startsWith("data-")&&(e[r]=n)}),e}function iU(){const t={};for(const e in kt)t[kt[e]]=`rdp-${kt[e]}`;for(const e in Tn)t[Tn[e]]=`rdp-${Tn[e]}`;for(const e in ul)t[ul[e]]=`rdp-${ul[e]}`;for(const e in Ca)t[Ca[e]]=`rdp-${Ca[e]}`;return t}function Uge(t,e,r){return(r??new Ua(e)).formatMonthYear(t)}const oat=Uge;function lat(t,e,r){return(r??new Ua(e)).format(t,"d")}function cat(t,e=kc){return e.format(t,"LLLL")}function uat(t,e,r){return(r??new Ua(e)).format(t,"cccccc")}function dat(t,e=kc){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function fat(){return""}function Gge(t,e=kc){return e.format(t,"yyyy")}const hat=Gge,pat=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Uge,formatDay:lat,formatMonthCaption:oat,formatMonthDropdown:cat,formatWeekNumber:dat,formatWeekNumberHeader:fat,formatWeekdayName:uat,formatYearCaption:hat,formatYearDropdown:Gge},Symbol.toStringTag,{value:"Module"}));function mat(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...pat,...t}}function gat(t,e,r,n,i){const{startOfMonth:s,startOfYear:a,endOfYear:o,eachMonthOfInterval:c,getMonth:u}=i;return c({start:a(t),end:o(t)}).map(h=>{const m=n.formatMonthDropdown(h,i),y=u(h),x=e&&h<s(e)||r&&h>s(r)||!1;return{value:y,label:m,disabled:x}})}function yat(t,e={},r={}){let n={...e?.[kt.Day]};return Object.entries(t).filter(([,i])=>i===!0).forEach(([i])=>{n={...n,...r?.[i]}}),n}function vat(t,e,r){const n=t.today(),i=e?t.startOfISOWeek(n):t.startOfWeek(n),s=[];for(let a=0;a<7;a++){const o=t.addDays(i,a);s.push(o)}return s}function xat(t,e,r,n,i=!1){if(!t||!e)return;const{startOfYear:s,endOfYear:a,addYears:o,getYear:c,isBefore:u,isSameYear:d}=n,f=s(t),h=a(e),m=[];let y=f;for(;u(y,h)||d(y,h);)m.push(y),y=o(y,1);return i&&m.reverse(),m.map(x=>{const v=r.formatYearDropdown(x,n);return{value:c(x),label:v,disabled:!1}})}function Wge(t,e,r,n){let i=(n??new Ua(r)).format(t,"PPPP");return e.today&&(i=`Today, ${i}`),e.selected&&(i=`${i}, selected`),i}const bat=Wge;function Hge(t,e,r){return(r??new Ua(e)).formatMonthYear(t)}const wat=Hge;function _at(t,e,r,n){let i=(n??new Ua(r)).format(t,"PPPP");return e?.today&&(i=`Today, ${i}`),i}function Sat(t){return"Choose the Month"}function kat(){return""}function Tat(t){return"Go to the Next Month"}function Cat(t){return"Go to the Previous Month"}function Eat(t,e,r){return(r??new Ua(e)).format(t,"cccc")}function jat(t,e){return`Week ${t}`}function Nat(t){return"Week Number"}function Pat(t){return"Choose the Year"}const Mat=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:wat,labelDay:bat,labelDayButton:Wge,labelGrid:Hge,labelGridcell:_at,labelMonthDropdown:Sat,labelNav:kat,labelNext:Tat,labelPrevious:Cat,labelWeekNumber:jat,labelWeekNumberHeader:Nat,labelWeekday:Eat,labelYearDropdown:Pat},Symbol.toStringTag,{value:"Module"})),u1=t=>t instanceof HTMLElement?t:null,lD=t=>[...t.querySelectorAll("[data-animated-month]")??[]],Aat=t=>u1(t.querySelector("[data-animated-month]")),cD=t=>u1(t.querySelector("[data-animated-caption]")),uD=t=>u1(t.querySelector("[data-animated-weeks]")),Dat=t=>u1(t.querySelector("[data-animated-nav]")),Oat=t=>u1(t.querySelector("[data-animated-weekdays]"));function Rat(t,e,{classNames:r,months:n,focused:i,dateLib:s}){const a=b.useRef(null),o=b.useRef(n),c=b.useRef(!1);b.useLayoutEffect(()=>{const u=o.current;if(o.current=n,!e||!t.current||!(t.current instanceof HTMLElement)||n.length===0||u.length===0||n.length!==u.length)return;const d=s.isSameMonth(n[0].date,u[0].date),f=s.isAfter(n[0].date,u[0].date),h=f?r[Ca.caption_after_enter]:r[Ca.caption_before_enter],m=f?r[Ca.weeks_after_enter]:r[Ca.weeks_before_enter],y=a.current,x=t.current.cloneNode(!0);if(x instanceof HTMLElement?(lD(x).forEach(k=>{if(!(k instanceof HTMLElement))return;const E=Aat(k);E&&k.contains(E)&&k.removeChild(E);const T=cD(k);T&&T.classList.remove(h);const N=uD(k);N&&N.classList.remove(m)}),a.current=x):a.current=null,c.current||d||i)return;const v=y instanceof HTMLElement?lD(y):[],_=lD(t.current);if(_?.every(S=>S instanceof HTMLElement)&&v&&v.every(S=>S instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const S=Dat(t.current);S&&(S.style.zIndex="1"),_.forEach((k,E)=>{const T=v[E];if(!T)return;k.style.position="relative",k.style.overflow="hidden";const N=cD(k);N&&N.classList.add(h);const j=uD(k);j&&j.classList.add(m);const M=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),S&&(S.style.zIndex=""),N&&N.classList.remove(h),j&&j.classList.remove(m),k.style.position="",k.style.overflow="",k.contains(T)&&k.removeChild(T)};T.style.pointerEvents="none",T.style.position="absolute",T.style.overflow="hidden",T.setAttribute("aria-hidden","true");const O=Oat(T);O&&(O.style.opacity="0");const R=cD(T);R&&(R.classList.add(f?r[Ca.caption_before_exit]:r[Ca.caption_after_exit]),R.addEventListener("animationend",M));const I=uD(T);I&&I.classList.add(f?r[Ca.weeks_before_exit]:r[Ca.weeks_after_exit]),k.insertBefore(T,k.firstChild)})}})}function Iat(t,e,r,n){const i=t[0],s=t[t.length-1],{ISOWeek:a,fixedWeeks:o,broadcastCalendar:c}=r??{},{addDays:u,differenceInCalendarDays:d,differenceInCalendarMonths:f,endOfBroadcastWeek:h,endOfISOWeek:m,endOfMonth:y,endOfWeek:x,isAfter:v,startOfBroadcastWeek:_,startOfISOWeek:S,startOfWeek:k}=n,E=c?_(i,n):a?S(i):k(i),T=c?h(s):a?m(y(s)):x(y(s)),N=d(T,E),j=f(s,i)+1,M=[];for(let I=0;I<=N;I++){const B=u(E,I);if(e&&v(B,e))break;M.push(B)}const R=(c?35:42)*j;if(o&&M.length<R){const I=R-M.length;for(let B=0;B<I;B++){const F=u(M[M.length-1],1);M.push(F)}}return M}function Lat(t){const e=[];return t.reduce((r,n)=>{const i=n.weeks.reduce((s,a)=>s.concat(a.days.slice()),e.slice());return r.concat(i.slice())},e.slice())}function $at(t,e,r,n){const{numberOfMonths:i=1}=r,s=[];for(let a=0;a<i;a++){const o=n.addMonths(t,a);if(e&&o>e)break;s.push(o)}return s}function oZ(t,e,r,n){const{month:i,defaultMonth:s,today:a=n.today(),numberOfMonths:o=1}=t;let c=i||s||a;const{differenceInCalendarMonths:u,addMonths:d,startOfMonth:f}=n;if(r&&u(r,c)<o-1){const h=-1*(o-1);c=d(r,h)}return e&&u(c,e)<0&&(c=e),f(c)}function Fat(t,e,r,n){const{addDays:i,endOfBroadcastWeek:s,endOfISOWeek:a,endOfMonth:o,endOfWeek:c,getISOWeek:u,getWeek:d,startOfBroadcastWeek:f,startOfISOWeek:h,startOfWeek:m}=n,y=t.reduce((x,v)=>{const _=r.broadcastCalendar?f(v,n):r.ISOWeek?h(v):m(v),S=r.broadcastCalendar?s(v):r.ISOWeek?a(o(v)):c(o(v)),k=e.filter(j=>j>=_&&j<=S),E=r.broadcastCalendar?35:42;if(r.fixedWeeks&&k.length<E){const j=e.filter(M=>{const O=E-k.length;return M>S&&M<=i(S,O)});k.push(...j)}const T=k.reduce((j,M)=>{const O=r.ISOWeek?u(M):d(M),R=j.find(B=>B.weekNumber===O),I=new Ige(M,v,n);return R?R.days.push(I):j.push(new Nst(O,[I])),j},[]),N=new jst(v,T);return x.push(N),x},[]);return r.reverseMonths?y.reverse():y}function zat(t,e){let{startMonth:r,endMonth:n}=t;const{startOfYear:i,startOfDay:s,startOfMonth:a,endOfMonth:o,addYears:c,endOfYear:u,newDate:d,today:f}=e,{fromYear:h,toYear:m,fromMonth:y,toMonth:x}=t;!r&&y&&(r=y),!r&&h&&(r=e.newDate(h,0,1)),!n&&x&&(n=x),!n&&m&&(n=d(m,11,31));const v=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return r?r=a(r):h?r=d(h,0,1):!r&&v&&(r=i(c(t.today??f(),-100))),n?n=o(n):m?n=d(m,11,31):!n&&v&&(n=u(t.today??f())),[r&&s(r),n&&s(n)]}function Bat(t,e,r,n){if(r.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:s=1}=r,{startOfMonth:a,addMonths:o,differenceInCalendarMonths:c}=n,u=i?s:1,d=a(t);if(!e)return o(d,u);if(!(c(e,t)<s))return o(d,u)}function Vat(t,e,r,n){if(r.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:s}=r,{startOfMonth:a,addMonths:o,differenceInCalendarMonths:c}=n,u=i?s??1:1,d=a(t);if(!e)return o(d,-u);if(!(c(d,e)<=0))return o(d,-u)}function Uat(t){const e=[];return t.reduce((r,n)=>r.concat(n.weeks.slice()),e.slice())}function yN(t,e){const[r,n]=b.useState(t);return[e===void 0?r:e,n]}function Gat(t,e){const[r,n]=zat(t,e),{startOfMonth:i,endOfMonth:s}=e,a=oZ(t,r,n,e),[o,c]=yN(a,t.month?a:void 0);b.useEffect(()=>{const N=oZ(t,r,n,e);c(N)},[t.timeZone]);const u=$at(o,n,t,e),d=Iat(u,t.endMonth?s(t.endMonth):void 0,t,e),f=Fat(u,d,t,e),h=Uat(f),m=Lat(f),y=Vat(o,r,t,e),x=Bat(o,n,t,e),{disableNavigation:v,onMonthChange:_}=t,S=N=>h.some(j=>j.days.some(M=>M.isEqualTo(N))),k=N=>{if(v)return;let j=i(N);r&&j<i(r)&&(j=i(r)),n&&j>i(n)&&(j=i(n)),c(j),_?.(j)};return{months:f,weeks:h,days:m,navStart:r,navEnd:n,previousMonth:y,nextMonth:x,goToMonth:k,goToDay:N=>{S(N)||k(N.date)}}}var Dl;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Dl||(Dl={}));function lZ(t){return!t[Tn.disabled]&&!t[Tn.hidden]&&!t[Tn.outside]}function Wat(t,e,r,n){let i,s=-1;for(const a of t){const o=e(a);lZ(o)&&(o[Tn.focused]&&s<Dl.FocusedModifier?(i=a,s=Dl.FocusedModifier):n?.isEqualTo(a)&&s<Dl.LastFocused?(i=a,s=Dl.LastFocused):r(a.date)&&s<Dl.Selected?(i=a,s=Dl.Selected):o[Tn.today]&&s<Dl.Today&&(i=a,s=Dl.Today))}return i||(i=t.find(a=>lZ(e(a)))),i}function Hat(t,e,r,n,i,s,a){const{ISOWeek:o,broadcastCalendar:c}=s,{addDays:u,addMonths:d,addWeeks:f,addYears:h,endOfBroadcastWeek:m,endOfISOWeek:y,endOfWeek:x,max:v,min:_,startOfBroadcastWeek:S,startOfISOWeek:k,startOfWeek:E}=a;let N={day:u,week:f,month:d,year:h,startOfWeek:j=>c?S(j,a):o?k(j):E(j),endOfWeek:j=>c?m(j):o?y(j):x(j)}[t](r,e==="after"?1:-1);return e==="before"&&n?N=v([n,N]):e==="after"&&i&&(N=_([i,N])),N}function qge(t,e,r,n,i,s,a,o=0){if(o>365)return;const c=Hat(t,e,r.date,n,i,s,a),u=!!(s.disabled&&su(c,s.disabled,a)),d=!!(s.hidden&&su(c,s.hidden,a)),f=c,h=new Ige(c,f,a);return!u&&!d?h:qge(t,e,h,n,i,s,a,o+1)}function qat(t,e,r,n,i){const{autoFocus:s}=t,[a,o]=b.useState(),c=Wat(e.days,r,n||(()=>!1),a),[u,d]=b.useState(s?c:void 0);return{isFocusTarget:x=>!!c?.isEqualTo(x),setFocused:d,focused:u,blur:()=>{o(u),d(void 0)},moveFocus:(x,v)=>{if(!u)return;const _=qge(x,v,u,e.navStart,e.navEnd,t,i);_&&(e.goToDay(_),d(_))}}}function Yat(t,e){const{selected:r,required:n,onSelect:i}=t,[s,a]=yN(r,i?r:void 0),o=i?r:s,{isSameDay:c}=e,u=m=>o?.some(y=>c(y,m))??!1,{min:d,max:f}=t;return{selected:o,select:(m,y,x)=>{let v=[...o??[]];if(u(m)){if(o?.length===d||n&&o?.length===1)return;v=o?.filter(_=>!c(_,m))}else o?.length===f?v=[m]:v=[...v,m];return i||a(v),i?.(v,m,y,x),v},isSelected:u}}function Kat(t,e,r=0,n=0,i=!1,s=kc){const{from:a,to:o}=e||{},{isSameDay:c,isAfter:u,isBefore:d}=s;let f;if(!a&&!o)f={from:t,to:r>0?void 0:t};else if(a&&!o)c(a,t)?r===0?f={from:a,to:t}:i?f={from:a,to:void 0}:f=void 0:d(t,a)?f={from:t,to:a}:f={from:a,to:t};else if(a&&o)if(c(a,t)&&c(o,t))i?f={from:a,to:o}:f=void 0;else if(c(a,t))f={from:a,to:r>0?void 0:t};else if(c(o,t))f={from:t,to:r>0?void 0:t};else if(d(t,a))f={from:t,to:o};else if(u(t,a))f={from:a,to:t};else if(u(t,o))f={from:a,to:t};else throw new Error("Invalid range");if(f?.from&&f?.to){const h=s.differenceInCalendarDays(f.to,f.from);n>0&&h>n?f={from:t,to:void 0}:r>1&&h<r&&(f={from:t,to:void 0})}return f}function Qat(t,e,r=kc){const n=Array.isArray(e)?e:[e];let i=t.from;const s=r.differenceInCalendarDays(t.to,t.from),a=Math.min(s,6);for(let o=0;o<=a;o++){if(n.includes(i.getDay()))return!0;i=r.addDays(i,1)}return!1}function cZ(t,e,r=kc){return iu(t,e.from,!1,r)||iu(t,e.to,!1,r)||iu(e,t.from,!1,r)||iu(e,t.to,!1,r)}function Zat(t,e,r=kc){const n=Array.isArray(e)?e:[e];if(n.filter(o=>typeof o!="function").some(o=>typeof o=="boolean"?o:r.isDate(o)?iu(t,o,!1,r):Vge(o,r)?o.some(c=>iu(t,c,!1,r)):nU(o)?o.from&&o.to?cZ(t,{from:o.from,to:o.to},r):!1:Bge(o)?Qat(t,o.dayOfWeek,r):$ge(o)?r.isAfter(o.before,o.after)?cZ(t,{from:r.addDays(o.after,1),to:r.addDays(o.before,-1)},r):su(t.from,o,r)||su(t.to,o,r):Fge(o)||zge(o)?su(t.from,o,r)||su(t.to,o,r):!1))return!0;const a=n.filter(o=>typeof o=="function");if(a.length){let o=t.from;const c=r.differenceInCalendarDays(t.to,t.from);for(let u=0;u<=c;u++){if(a.some(d=>d(o)))return!0;o=r.addDays(o,1)}}return!1}function Xat(t,e){const{disabled:r,excludeDisabled:n,selected:i,required:s,onSelect:a}=t,[o,c]=yN(i,a?i:void 0),u=a?i:o;return{selected:u,select:(h,m,y)=>{const{min:x,max:v}=t,_=h?Kat(h,u,x,v,s,e):void 0;return n&&r&&_?.from&&_.to&&Zat({from:_.from,to:_.to},r,e)&&(_.from=h,_.to=void 0),a||c(_),a?.(_,h,m,y),_},isSelected:h=>u&&iu(u,h,!1,e)}}function Jat(t,e){const{selected:r,required:n,onSelect:i}=t,[s,a]=yN(r,i?r:void 0),o=i?r:s,{isSameDay:c}=e;return{selected:o,select:(f,h,m)=>{let y=f;return!n&&o&&o&&c(f,o)&&(y=void 0),i||a(y),i?.(y,f,h,m),y},isSelected:f=>o?c(o,f):!1}}function eot(t,e){const r=Jat(t,e),n=Yat(t,e),i=Xat(t,e);switch(t.mode){case"single":return r;case"multiple":return n;case"range":return i;default:return}}function tot(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new ds(e.today,e.timeZone)),e.month&&(e.month=new ds(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new ds(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new ds(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new ds(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new ds(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(xt=>new ds(xt,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new ds(e.selected.from,e.timeZone):void 0,to:e.selected.to?new ds(e.selected.to,e.timeZone):void 0}));const{components:r,formatters:n,labels:i,dateLib:s,locale:a,classNames:o}=b.useMemo(()=>{const xt={...Fj,...e.locale};return{dateLib:new Ua({locale:xt,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:sat(e.components),formatters:mat(e.formatters),labels:{...Mat,...e.labels},locale:xt,classNames:{...iU(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:c,mode:u,navLayout:d,numberOfMonths:f=1,onDayBlur:h,onDayClick:m,onDayFocus:y,onDayKeyDown:x,onDayMouseEnter:v,onDayMouseLeave:_,onNextClick:S,onPrevClick:k,showWeekNumber:E,styles:T}=e,{formatCaption:N,formatDay:j,formatMonthDropdown:M,formatWeekNumber:O,formatWeekNumberHeader:R,formatWeekdayName:I,formatYearDropdown:B}=n,F=Gat(e,s),{days:V,months:$,navStart:U,navEnd:z,previousMonth:L,nextMonth:W,goToMonth:K}=F,q=nat(V,e,U,z,s),{isSelected:H,select:Y,selected:J}=eot(e,s)??{},{blur:re,focused:me,isFocusTarget:oe,moveFocus:ge,setFocused:le}=qat(e,F,q,H??(()=>!1),s),{labelDayButton:Se,labelGridcell:Ce,labelGrid:he,labelMonthDropdown:Ct,labelNav:De,labelPrevious:It,labelNext:Yt,labelWeekday:Qt,labelWeekNumber:Qr,labelWeekNumberHeader:gr,labelYearDropdown:X}=i,ae=b.useMemo(()=>vat(s,e.ISOWeek),[s,e.ISOWeek]),de=u!==void 0||m!==void 0,Ee=b.useCallback(()=>{L&&(K(L),k?.(L))},[L,K,k]),Me=b.useCallback(()=>{W&&(K(W),S?.(W))},[K,W,S]),Te=b.useCallback((xt,$e)=>We=>{We.preventDefault(),We.stopPropagation(),le(xt),Y?.(xt.date,$e,We),m?.(xt.date,$e,We)},[Y,m,le]),Qe=b.useCallback((xt,$e)=>We=>{le(xt),y?.(xt.date,$e,We)},[y,le]),Nt=b.useCallback((xt,$e)=>We=>{re(),h?.(xt.date,$e,We)},[re,h]),jt=b.useCallback((xt,$e)=>We=>{const rt={ArrowLeft:[We.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[We.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[We.shiftKey?"year":"week","after"],ArrowUp:[We.shiftKey?"year":"week","before"],PageUp:[We.shiftKey?"year":"month","before"],PageDown:[We.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(rt[We.key]){We.preventDefault(),We.stopPropagation();const[bt,ut]=rt[We.key];ge(bt,ut)}x?.(xt.date,$e,We)},[ge,x,e.dir]),jr=b.useCallback((xt,$e)=>We=>{v?.(xt.date,$e,We)},[v]),Vr=b.useCallback((xt,$e)=>We=>{_?.(xt.date,$e,We)},[_]),Dr=b.useCallback(xt=>$e=>{const We=Number($e.target.value),rt=s.setMonth(s.startOfMonth(xt),We);K(rt)},[s,K]),$r=b.useCallback(xt=>$e=>{const We=Number($e.target.value),rt=s.setYear(s.startOfMonth(xt),We);K(rt)},[s,K]),{className:Ur,style:Ni}=b.useMemo(()=>({className:[o[kt.Root],e.className].filter(Boolean).join(" "),style:{...T?.[kt.Root],...e.style}}),[o,e.className,e.style,T]),zi=aat(e),Nn=b.useRef(null);Rat(Nn,!!e.animate,{classNames:o,months:$,focused:me,dateLib:s});const or={dayPickerProps:e,selected:J,select:Y,isSelected:H,months:$,nextMonth:W,previousMonth:L,goToMonth:K,getModifiers:q,components:r,classNames:o,styles:T,labels:i,formatters:n};return P.createElement(Lge.Provider,{value:or},P.createElement(r.Root,{rootRef:e.animate?Nn:void 0,className:Ur,style:Ni,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...zi},P.createElement(r.Months,{className:o[kt.Months],style:T?.[kt.Months]},!e.hideNavigation&&!d&&P.createElement(r.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[kt.Nav],style:T?.[kt.Nav],"aria-label":De(),onPreviousClick:Ee,onNextClick:Me,previousMonth:L,nextMonth:W}),$.map((xt,$e)=>P.createElement(r.Month,{"data-animated-month":e.animate?"true":void 0,className:o[kt.Month],style:T?.[kt.Month],key:$e,displayIndex:$e,calendarMonth:xt},d==="around"&&!e.hideNavigation&&$e===0&&P.createElement(r.PreviousMonthButton,{type:"button",className:o[kt.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":It(L),onClick:Ee,"data-animated-button":e.animate?"true":void 0},P.createElement(r.Chevron,{disabled:L?void 0:!0,className:o[kt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),P.createElement(r.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:o[kt.MonthCaption],style:T?.[kt.MonthCaption],calendarMonth:xt,displayIndex:$e},c?.startsWith("dropdown")?P.createElement(r.DropdownNav,{className:o[kt.Dropdowns],style:T?.[kt.Dropdowns]},(()=>{const We=c==="dropdown"||c==="dropdown-months"?P.createElement(r.MonthsDropdown,{key:"month",className:o[kt.MonthsDropdown],"aria-label":Ct(),classNames:o,components:r,disabled:!!e.disableNavigation,onChange:Dr(xt.date),options:gat(xt.date,U,z,n,s),style:T?.[kt.Dropdown],value:s.getMonth(xt.date)}):P.createElement("span",{key:"month"},M(xt.date,s)),rt=c==="dropdown"||c==="dropdown-years"?P.createElement(r.YearsDropdown,{key:"year",className:o[kt.YearsDropdown],"aria-label":X(s.options),classNames:o,components:r,disabled:!!e.disableNavigation,onChange:$r(xt.date),options:xat(U,z,n,s,!!e.reverseYears),style:T?.[kt.Dropdown],value:s.getYear(xt.date)}):P.createElement("span",{key:"year"},B(xt.date,s));return s.getMonthYearOrder()==="year-first"?[rt,We]:[We,rt]})(),P.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(xt.date,s.options,s))):P.createElement(r.CaptionLabel,{className:o[kt.CaptionLabel],role:"status","aria-live":"polite"},N(xt.date,s.options,s))),d==="around"&&!e.hideNavigation&&$e===f-1&&P.createElement(r.NextMonthButton,{type:"button",className:o[kt.NextMonthButton],tabIndex:W?void 0:-1,"aria-disabled":W?void 0:!0,"aria-label":Yt(W),onClick:Me,"data-animated-button":e.animate?"true":void 0},P.createElement(r.Chevron,{disabled:W?void 0:!0,className:o[kt.Chevron],orientation:e.dir==="rtl"?"left"
4321:"right"})),$e===f-1&&d==="after"&&!e.hideNavigation&&P.createElement(r.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[kt.Nav],style:T?.[kt.Nav],"aria-label":De(),onPreviousClick:Ee,onNextClick:Me,previousMonth:L,nextMonth:W}),P.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":he(xt.date,s.options,s)||void 0,className:o[kt.MonthGrid],style:T?.[kt.MonthGrid]},!e.hideWeekdays&&P.createElement(r.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:o[kt.Weekdays],style:T?.[kt.Weekdays]},E&&P.createElement(r.WeekNumberHeader,{"aria-label":gr(s.options),className:o[kt.WeekNumberHeader],style:T?.[kt.WeekNumberHeader],scope:"col"},R()),ae.map(We=>P.createElement(r.Weekday,{"aria-label":Qt(We,s.options,s),className:o[kt.Weekday],key:String(We),style:T?.[kt.Weekday],scope:"col"},I(We,s.options,s)))),P.createElement(r.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:o[kt.Weeks],style:T?.[kt.Weeks]},xt.weeks.map(We=>P.createElement(r.Week,{className:o[kt.Week],key:We.weekNumber,style:T?.[kt.Week],week:We},E&&P.createElement(r.WeekNumber,{week:We,style:T?.[kt.WeekNumber],"aria-label":Qr(We.weekNumber,{locale:a}),className:o[kt.WeekNumber],scope:"row",role:"rowheader"},O(We.weekNumber,s)),We.days.map(rt=>{const{date:bt}=rt,ut=q(rt);if(ut[Tn.focused]=!ut.hidden&&!!me?.isEqualTo(rt),ut[ul.selected]=H?.(bt)||ut.selected,nU(J)){const{from:Jt,to:pn}=J;ut[ul.range_start]=!!(Jt&&pn&&s.isSameDay(bt,Jt)),ut[ul.range_end]=!!(Jt&&pn&&s.isSameDay(bt,pn)),ut[ul.range_middle]=iu(J,bt,!0,s)}const it=yat(ut,T,e.modifiersStyles),Wt=iat(ut,o,e.modifiersClassNames),cr=!de&&!ut.hidden?Ce(bt,ut,s.options,s):void 0;return P.createElement(r.Day,{key:`${s.format(bt,"yyyy-MM-dd")}_${s.format(rt.displayMonth,"yyyy-MM")}`,day:rt,modifiers:ut,className:Wt.join(" "),style:it,role:"gridcell","aria-selected":ut.selected||void 0,"aria-label":cr,"data-day":s.format(bt,"yyyy-MM-dd"),"data-month":rt.outside?s.format(bt,"yyyy-MM"):void 0,"data-selected":ut.selected||void 0,"data-disabled":ut.disabled||void 0,"data-hidden":ut.hidden||void 0,"data-outside":rt.outside||void 0,"data-focused":ut.focused||void 0,"data-today":ut.today||void 0},!ut.hidden&&de?P.createElement(r.DayButton,{className:o[kt.DayButton],style:T?.[kt.DayButton],type:"button",day:rt,modifiers:ut,disabled:ut.disabled||void 0,tabIndex:oe(rt)?0:-1,"aria-label":Se(bt,ut,s.options,s),onClick:Te(rt,ut),onBlur:Nt(rt,ut),onFocus:Qe(rt,ut),onKeyDown:jt(rt,ut),onMouseEnter:jr(rt,ut),onMouseLeave:Vr(rt,ut)},j(bt,s.options,s)):!ut.hidden&&j(rt.date,s.options,s))})))))))),e.footer&&P.createElement(r.Footer,{className:o[kt.Footer],style:T?.[kt.Footer],role:"status","aria-live":"polite"},e.footer)))}function Yge({className:t,classNames:e,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:i="ghost",formatters:s,components:a,...o}){const c=iU();return l.jsx(tot,{showOutsideDays:r,className:ee("bg-app-card border border-app-border-color-soft rounded-2xl group/calendar p-4 pb-5 [--cell-size:3rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...s},classNames:{root:ee("w-fit min-w-[300px]",c.root),months:ee("relative flex flex-col gap-8 md:flex-row",c.months),month:ee("flex w-full flex-col gap-4 pt-2.5",c.month,"relative first-of-type:before:hidden before:absolute max-md:before:inset-x-2 max-md:before:h-px max-md:before:-top-4 md:before:inset-y-2 md:before:w-px before:bg-app-border-color-soft md:before:-left-4"),nav:ee("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:ee(z$({variant:i}),"!size-[--cell-size] text-app-primary-foreground/70 select-none p-1.5 aria-disabled:opacity-50 hover:bg-app-button-bg hover:text-app-primary-foreground z-20",c.button_previous),button_next:ee(z$({variant:i}
4321),"!size-[--cell-size] text-app-primary-foreground/70 select-none p-1.5 aria-disabled:opacity-50 hover:bg-app-button-bg hover:text-app-primary-foreground z-20",c.button_next),month_caption:ee("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:ee("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:ee("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-lg border",c.dropdown_root),dropdown:ee("bg-app-input-bg absolute inset-0 opacity-0",c.dropdown),caption_label:ee("select-none font-medium",n==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-lg pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:ee("flex",c.weekdays),weekday:ee("text-app-primary-foreground/60 flex-1 select-none rounded-lg text-[0.8rem] font-normal",c.weekday),week:ee("mt-2 flex w-full flex items-center h-[--cell-size]",c.week),week_number_header:ee("w-[--cell-size] select-none",c.week_number_header),week_number:ee("text-app-primary-foreground/60 select-none text-[0.8rem]",c.week_number),day:ee("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-lg [&:last-child[data-selected=true]_button]:rounded-r-lg",c.day),range_start:ee(c.range_start),range_middle:ee("rounded-none",c.range_middle),range_end:ee(c.range_end),today:ee("data-[selected=true]:bg-app-border-color-accent/0 bg-app-primary-foreground text-app-primary rounded-lg",c.today),outside:ee("text-app-primary-foreground/60 data-[today=true]:text-app-primary aria-selected:text-app-primary-foreground/60",c.outside),disabled:ee("text-app-primary-foreground/60 opacity-50",c.disabled),hidden:ee("invisible",c.hidden),...e},components:{Root:({className:u,rootRef:d,...f})=>l.jsx("div",{"data-slot":"calendar",ref:d,className:ee(u),...f}),Chevron:({className:u,orientation:d,...f})=>d==="left"?l.jsx(up,{className:ee("size-4",u),...f}):d==="right"?l.jsx(Sf,{className:ee("size-4",u),...f}):l.jsx(Eu,{className:ee("size-4",u),...f}),DayButton:rot,WeekNumber:({children:u,...d})=>l.jsx("td",{...d,children:l.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...a},...o})}function rot({className:t,day:e,modifiers:r,...n}){const i=iU(),s=b.useRef(null);return b.useEffect(()=>{r.focused&&s.current?.focus()},[r.focused]),l.jsx(ye,{ref:s,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:ee("data-[selected-single=true]:bg-app-button-bg-active data-[selected-single=true]:text-app-primary-foreground data-[range-middle=true]:bg-app-border-color-accent/15 data-[range-middle=true]:text-app-primary-foreground/90 data-[range-start=true]:bg-app-button-bg-active data-[range-start=true]:text-app-primary-foreground data-[range-end=true]:bg-app-button-bg-active data-[range-end=true]:text-app-primary-foreground group-data-[focused=true]/day:border-app-border-color-accent group-data-[focused=true]/day:ring-app-border-color-accent/70 flex aspect-square h-[--cell-size] w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-start=true]:rounded-l-lg data-[range-end=true]:rounded-r-lg data-[range-middle=true]:rounded-none data-[range-end=true]:rounded-l-none data-[range-start=true]:rounded-r-none group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] [&>span]:text-xs [&>span]:opacity-70 p-2 hover:bg-app-border-color-accent/20 hover:no-underline",r.range_start&&r.range_end&&"!rounded-lg",i.day,t),...n})}const vN=({label:t,...e})=>{const r=Qp("(max-width: 768px)"),n=r?"start":"end",{dateRange:i,setDateRangeWithPresetCheck:s}=s0();return l.jsxs("div",{className:"flex flex-col",...e,children:[t&&l.jsx("p",{className:"uppercase text-xs tracking-wider text-app-primary-foreground
4321/70 mb-2 2k:text-2xl 2k:mb-4",children:t}),l.jsxs(Bf,{children:[l.jsx(Vf,{asChild:!0,children:l.jsxs(ye,{variant:"outline","data-empty":!i,className:"data-[empty=true]:text-app-primary-foreground/50 min-w-fit w-fit sm:w-[350px] justify-start text-left font-normal data-[state=open]:border-app-border-color-accent hover:border-app-border-color-accent data-[state=open]:ring-3 data-[state=open]:ring-app-border-color-accent/40 bg-app-input-bg/50 h-9 border-dashed",children:[l.jsx(DPe,{}),Ime(i?.from,i?.to,r),i?.option!=="this_month"&&l.jsx("div",{className:"rounded-lg flex items-center justify-center bg-app-input-bg p-1 px-2 ml-auto",children:l.jsx("span",{className:"text-xs font-mono text-app-border-color-accent ",children:"1"})})]})}),l.jsx(Uf,{className:"w-auto p-0 border-none",align:n,children:l.jsx(Yge,{mode:"range",showOutsideDays:!1,defaultMonth:i?.from,selected:{from:i?.from,to:i?.to},onSelect:a=>s({from:a?.from,to:a?.to}),numberOfMonths:r?1:2})})]})]})};function y5(t){const e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60);if(n>0){const i=r%60;return`${n}:${i.toString().padStart(2,"0")} hr`}else if(r>0){const i=e%60;return`${r}:${i.toString().padStart(2,"0")} min`}else return`${e} sec`}const qn=.001;function uZ(t,e){return new Date(e).getTime()-new Date(t).getTime()}function sU(t,e="net",r="usd"){const i=lN(t,r).filter(Y=>Y.status?.toUpperCase()==="CLOSED"&&Y.exit_date!=null),s=i.map(Y=>{const J=$me(Y,e),re=oN(Y,e,r);return{trade:Y,basePnL:J,displayPnL:re??0}}),a=s.length,o=s.filter(Y=>Y.basePnL>qn),c=s.filter(Y=>Y.basePnL<-qn),u=s.filter(Y=>Math.abs(Y.basePnL)<=qn),d=s.reduce((Y,J)=>Y+J.displayPnL,0),f=a>0?o.length/a*100:0,h=o.reduce((Y,J)=>Y+J.displayPnL,0),m=o.length>0?h/o.length:0,y=c.reduce((Y,J)=>Y+Math.abs(J.displayPnL),0),x=c.length>0?y/c.length:0,v=o.reduce((Y,J)=>J.displayPnL>Y.value?{id:J.trade.id,value:J.displayPnL}:Y,{id:void 0,value:0}),_=c.reduce((Y,J)=>{const re=Math.abs(J.displayPnL);return re>Y.value?{id:J.trade.id,value:re}:Y},{id:void 0,value:0}),S=[...new Set(i.map(Y=>Y.entry_date.slice(0,10)))].length,k=S>0?d/S:0,E=i.reduce((Y,J)=>Y+J.position_size,0),T=S>0?E/S:0,j=i.filter(Y=>Y.entry_price!=null&&Y.exit_price!=null).reduce((Y,J)=>Y+J.position_size,0),M=j>0?d/(j/2):0,O=a>0?d/a:0,R=[...s].sort((Y,J)=>new Date(Y.trade.exit_date||"").getTime()-new Date(J.trade.exit_date||"").getTime());let I=0,B=0;R.forEach(Y=>{Y.basePnL>qn?(B++,I=Math.max(I,B)):B=0});let F=0,V=0;R.forEach(Y=>{Y.basePnL<-qn?(V++,F=Math.max(F,V)):V=0});const $=i.reduce((Y,J)=>Y+(J.comm||0),0),U=i.reduce((Y,J)=>Y+(J.fees||0),0),z=y>0?h/y:h>0?1/0:0,L=x>0?m/x:m>0?1/0:0,W=o.filter(Y=>Y.trade.exit_date!=null).map(Y=>uZ(Y.trade.entry_date,Y.trade.exit_date)),K=W.length>0?y5(W.reduce((Y,J)=>Y+J,0)/W.length):"-",q=c.filter(Y=>Y.trade.exit_date!=null).map(Y=>uZ(Y.trade.entry_date,Y.trade.exit_date)),H=q.length>0?y5(q.reduce((Y,J)=>Y+J,0)/q.length):"-";return{totalTrades:a,totalPnL:d,winRate:f,winningTrades:o.length,losingTrades:c.length,breakEvenTrades:u.length,averageWin:m,averageLoss:x,largestWin:v,largestLoss:_,averageDailyPnL:k,averageDailyVolume:T,averagePerSharePnL:M,averagePnLPerTrade:O,maxConsecutiveWins:I,maxConsecutiveLosses:F,profitFactor:z,averageWinHoldTime:K,averageLossHoldTime:H,totalFees:$+U,totalCommissions:$,totalMiscFees:U,riskRewardRatio:L}}const not=()=>{const{dateRange:t}=s0(),{viewSettings:e,updateViewSettings:r}=o1("mt:dashboard:viewPrefs"),n=Ws(),{userHasura:i}=Gt(),[s,a]=b.useState(!1),{trades:o,isLoading:c}=Ame({page:1,limit:999999999,dateRange:{start:t.from.toISOString(),end:t.to.toISOString()}}),u=b.useMemo(()=>lN(o,e.currency),[o,e.currency]),d=v=>{n(`/app/trades/${v}`)},f=()=>{const v=new URLSearchParams;v.set("start",t.from.toISOString()),v.set("end",t.to.toISOString()),v.set("timeRange",t.option),n(`/app/trades?${v.toString()}`)},h=()=>{const v=new URLSearchParams;v.set("start",t.from.toISOString()),v.set("end",t.to.toISOString()),v.set("timeRange",t.option),n(`/app/insights?${v.toString()}`)},m=b.useMemo(()=>sU(u,e.mode,e.currency),[u,e.mode,e.currency]),y=u.length>0,x=nC(m.totalPnL,e.currency);return l.jsxs("article",{className:"space-y-6 pt-4 pb-6",children:[l.jsxs("section",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-2 sm:gap-0 2k:mt-8",children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold 2k:text-5xl",children:"Trading Dashboard"}
4321),l.jsxs("p",{className:"text-app-primary-foreground/50 text-sm sm:text-base 2k:text-2xl",children:["Showing"," ",y?o.length:0," ","trades"]})]}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end w-full gap-4",children:[l.jsx(Vj,{label:"Time presets"}),l.jsx(vN,{label:"Analysis Period",className:"lg:ml-auto"}),l.jsx(a1,{mode:e.mode,currency:e.currency,setFilter:v=>r(()=>v)})]}),l.jsx(xst,{onConfigureClick:()=>a(!0)}),l.jsx(hst,{trades:u,isLoading:c,timeRangeOption:t.option,dateRange:{start:t.from.toISOString(),end:t.to.toISOString()},mode:e.mode,currency:e.currency}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 sm:gap-6 md:gap-8",children:[l.jsx(qd,{title:"Total P&L",value:x,icon:Yc,variant:m.totalPnL>0?"success":m.totalPnL<0?"danger":"neutral"}),l.jsx(qd,{title:"Win Rate",value:`${m.winRate.toFixed(1)}%`,icon:_s,variant:m.winRate>0?"success":"warning"}),l.jsx(qd,{title:"Winning Trades",value:m.winningTrades,icon:Is,variant:"success"}),l.jsx(qd,{title:"Losing Trades",value:m.losingTrades,icon:Is,variant:"danger"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4 sm:gap-6 md:gap-8",children:[l.jsx(Nrt,{stats:m,isLoading:c,hasTrades:y,onViewDetails:h,currency:e.currency}),l.jsx(pst,{trades:u,isLoading:c,hasTrades:y,onViewMore:f,onTradeClick:d,mode:e.mode,currency:e.currency})]}),i&&l.jsx(Dge,{open:s,onOpenChange:a,user:i})]})},iot=()=>l.jsxs("div",{className:"flex h-[calc(100vh-100px)] w-full flex-col items-center justify-center p-6 text-center animate-in fade-in duration-700",children:[l.jsxs("div",{className:"relative mb-6",children:[l.jsx("div",{className:"absolute inset-0 animate-pulse bg-emerald-500/20 blur-3xl rounded-full"}),l.jsx("div",{className:"relative bg-app-card border border-app-border-color p-6 rounded-2xl shadow-2xl",children:l.jsx(sf,{className:"size-16 text-emerald-500"})})]}),l.jsx("h1",{className:"text-4xl font-bold bg-gradient-to-br from-white to-gray-400 bg-clip-text text-transparent mb-4",children:"AI Edge"}),l.jsx("p",{className:"text-xl text-gray-400 max-w-md mx-auto leading-relaxed",children:"Advanced AI-powered trading insights and performance analysis coming soon."}),l.jsxs("div",{className:"mt-8 flex gap-2",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/40 animate-bounce [animation-delay:-0.3s]"}),l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/40 animate-bounce [animation-delay:-0.15s]"}),l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500/40 animate-bounce"})]})]}),sot=()=>l.jsxs("div",{className:"min-h-screen bg-app-primary flex items-center justify-center relative",children:[l.jsx(bpe,{}),l.jsxs("div",{className:"text-center max-w-lg mx-auto px-6",children:[l.jsxs("div",{className:"mb-8",children:[l.jsx("img",{src:"/illustration-error.png",alt:"Error illustration",className:"w-auto h-[340px] object-cover mx-auto mb-8"}),l.jsxs("h1",{className:"text-6xl font-medium mb-4",children:["Something"," ",l.jsx("span",{className:"text-app-border-color-accent rounded-md bg-app-border-color-accent/20 px-2 py-0.5 leading-none",children:"went wrong"})," ","here..."]})]}),l.jsxs("p",{className:"text-app-primary-foreground/90 font-light text-pretty mb-8 leading-relaxed",children:["Sorry, we're having some technical issues on our end. Please try again later. If the problem persists, please"," ",l.jsx(hs,{href:"/docs/contact-support",external:!0,children:"contact support."}),"."]}),l.jsx(ye,{asChild:!0,className:"w-fit mx-auto flex items-center justify-center gap-2",children:l.jsxs(At,{to:"/app/dashboard",children:[l.jsx(kw,{className:"size-4"}),"Dashboard"]})})]})]}),aot=(t,e)=>{switch(t){case"today":return"hour";case"this_week":return"day";case"this_month":return"day"}const r=Nf(new Date(e.end),new Date(e.start))+1;return r<=45?"day":r>45&&r<=90?"week":"month"},oot=(t,e,r,n,i)=>{const{start:s,end:a}=n,o=aot(i,n),c=(r==="r"?t.filter(v=>(v.risk??0)>0):t).filter(v=>v.status?.toUpperCase()==="CLOSED"&&v.exit_date).sort((v,_)=>new Date(v.exit_date).getTime()-new Date(_.exit_date).getTime()),u=new Date(`${s.split("T")[0]}T00:00:00`),d=new Date(`${a.split("T")[0]}T23:59:59.999`);if(!c.some(v=>{const _=new Date(v.exit_date);return _>=u&&_<=d}))return[];const h=mN(u,d,o);if(h.length===0)return[];const m=v=>e==="net"?v.net_pnl??v.pnl??0:v.pnl??0,y=[];let x=0;for(const v of h){const S=c.filter(T=>cge(T,v,o)).reduce((T,N)=>{const j=m(N),M=r==="r"&&N.risk&&N.risk>
vendor: 5,800 bytes, line 4321
43210?j/N.risk:j;return T+M},0);x+=S;const k=o==="hour"?KT(v.start):o==="day"?Us(v.start):o==="week"?mi(v.start,{weekStartsOn:1}):Gs(v.start),E=i==="today"?sr(k,"HH:mm"):o==="day"?sr(k,"MMM d"):o==="week"?`${sr(v.start,"MMM d")} - ${sr(v.end,"MMM d")}`:i==="year_to_date"?sr(k,"MMM"):sr(k,"MMM d");y.push({label:E,value:x})}return y};var dD,dZ;function va(){if(dZ)return dD;dZ=1;var t=Array.isArray;return dD=t,dD}var fD,fZ;function Kge(){if(fZ)return fD;fZ=1;var t=typeof N_=="object"&&N_&&N_.Object===Object&&N_;return fD=t,fD}var hD,hZ;function Tc(){if(hZ)return hD;hZ=1;var t=Kge(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return hD=r,hD}var pD,pZ;function d1(){if(pZ)return pD;pZ=1;var t=Tc(),e=t.Symbol;return pD=e,pD}var mD,mZ;function lot(){if(mZ)return mD;mZ=1;var t=d1(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function s(a){var o=r.call(a,i),c=a[i];try{a[i]=void 0;var u=!0}catch{}var d=n.call(a);return u&&(o?a[i]=c:delete a[i]),d}return mD=s,mD}var gD,gZ;function cot(){if(gZ)return gD;gZ=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return gD=r,gD}var yD,yZ;function ed(){if(yZ)return yD;yZ=1;var t=d1(),e=lot(),r=cot(),n="[object Null]",i="[object Undefined]",s=t?t.toStringTag:void 0;function a(o){return o==null?o===void 0?i:n:s&&s in Object(o)?e(o):r(o)}return yD=a,yD}var vD,vZ;function td(){if(vZ)return vD;vZ=1;function t(e){return e!=null&&typeof e=="object"}return vD=t,vD}var xD,xZ;function c0(){if(xZ)return xD;xZ=1;var t=ed(),e=td(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return xD=n,xD}var bD,bZ;function aU(){if(bZ)return bD;bZ=1;var t=va(),e=c0(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(s,a){if(t(s))return!1;var o=typeof s;return o=="number"||o=="symbol"||o=="boolean"||s==null||e(s)?!0:n.test(s)||!r.test(s)||a!=null&&s in Object(a)}return bD=i,bD}var wD,wZ;function Wf(){if(wZ)return wD;wZ=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return wD=t,wD}var _D,_Z;function oU(){if(_Z)return _D;_Z=1;var t=ed(),e=Wf(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function a(o){if(!e(o))return!1;var c=t(o);return c==n||c==i||c==r||c==s}return _D=a,_D}var SD,SZ;function uot(){if(SZ)return SD;SZ=1;var t=Tc(),e=t["__core-js_shared__"];return SD=e,SD}var kD,kZ;function dot(){if(kZ)return kD;kZ=1;var t=uot(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return kD=r,kD}var TD,TZ;function Qge(){if(TZ)return TD;TZ=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return TD=r,TD}var CD,CZ;function fot(){if(CZ)return CD;CZ=1;var t=oU(),e=dot(),r=Wf(),n=Qge(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,a=Function.prototype,o=Object.prototype,c=a.toString,u=o.hasOwnProperty,d=RegExp("^"+c.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||e(h))return!1;var m=t(h)?d:s;return m.test(n(h))}return CD=f,CD}var ED,EZ;function hot(){if(EZ)return ED;EZ=1;function t(e,r){return e?.[r]}return ED=t,ED}var jD,jZ;function Zp(){if(jZ)return jD;jZ=1;var t=fot(),e=hot();function r(n,i){var s=e(n,i);return t(s)?s:void 0}return jD=r,jD}var ND,NZ;function xN(){if(NZ)return ND;NZ=1;var t=Zp(),e=t(Object,"create");return ND=e,ND}var PD,PZ;function pot(){if(PZ)return PD;PZ=1;var t=xN();function e(){this.__data__=t?t(null):{},this.size=0}return PD=e,PD}var MD,MZ;function mot(){if(MZ)return MD;MZ=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return MD=t,MD}var AD,AZ;function got(){if(AZ)return AD;AZ=1;var t=xN(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(s){var a=this.__data__;if(t){var o=a[s];return o===e?void 0:o}return n.call(a,s)?a[s]:void 0}return AD=i,AD}var DD,DZ;function yot(){if(DZ)return DD;DZ=1;var t=xN(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var s=this.__data__;return t?s[i]!==void 0:r.call(s,i)}return DD=n,DD}var OD,OZ;function vot(){if(OZ)return OD;OZ=1;var t=xN(),e="__lodash_hash_undefined__";function r(n,i){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=t&&i===void 0?e:i,this}return OD=r,OD}var RD,RZ;function xot(){if(RZ)return RD;RZ=1;var t=pot(),e=mot(),r=got(),n=yot(),i=vot();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,RD=s,RD}var ID,IZ;function bot(){if(IZ)return ID;IZ=1;function t(){this.__data__=[],this.size=0}return ID=t,ID}var LD,LZ;function lU(){if(LZ)return LD;LZ=1;function t(e,r){return e===r||e!==e&&r!==r}return LD=t,LD}var $D,$Z;function bN(){if($Z)return $D;$Z=1;var t=lU();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return $D=e,$D}var FD,FZ;function wot(){if(FZ)return FD;FZ=1;var t=bN(),e=Array.prototype,r=e.splice;function n(i){var s=this.__data__,a=t(s,i);if(a<0)return!1;var o=s.length-1;return a==o?s.pop():r.call(s,a,1),--this.size,!0}return FD=n,FD}var zD,zZ;function _ot(){if(zZ)return zD;zZ=1;var t=bN();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return zD=e,zD}var BD,BZ;function Sot(){if(BZ)return BD;BZ=1;var t=bN();function e(r){return t(this.__data__,r)>-1}return BD=e,BD}var VD,VZ;function kot(){if(VZ)return VD;VZ=1;var t=bN();function e(r,n){var i=this.__data__,s=t(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return VD=e,VD}var UD,UZ;function wN(){if(UZ)return UD;UZ=1;
vendor: 10,101 bytes, lines 4321-4329
4321var t=bot(),e=wot(),r=_ot(),n=Sot(),i=kot();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,UD=s,UD}var GD,GZ;function cU(){if(GZ)return GD;GZ=1;var t=Zp(),e=Tc(),r=t(e,"Map");return GD=r,GD}var WD,WZ;function Tot(){if(WZ)return WD;WZ=1;var t=xot(),e=wN(),r=cU();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return WD=n,WD}var HD,HZ;function Cot(){if(HZ)return HD;HZ=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return HD=t,HD}var qD,qZ;function _N(){if(qZ)return qD;qZ=1;var t=Cot();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return qD=e,qD}var YD,YZ;function Eot(){if(YZ)return YD;YZ=1;var t=_N();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return YD=e,YD}var KD,KZ;function jot(){if(KZ)return KD;KZ=1;var t=_N();function e(r){return t(this,r).get(r)}return KD=e,KD}var QD,QZ;function Not(){if(QZ)return QD;QZ=1;var t=_N();function e(r){return t(this,r).has(r)}return QD=e,QD}var ZD,ZZ;function Pot(){if(ZZ)return ZD;ZZ=1;var t=_N();function e(r,n){var i=t(this,r),s=i.size;return i.set(r,n),this.size+=i.size==s?0:1,this}return ZD=e,ZD}var XD,XZ;function uU(){if(XZ)return XD;XZ=1;var t=Tot(),e=Eot(),r=jot(),n=Not(),i=Pot();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,XD=s,XD}var JD,JZ;function Zge(){if(JZ)return JD;JZ=1;var t=uU(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var a=arguments,o=i?i.apply(this,a):a[0],c=s.cache;if(c.has(o))return c.get(o);var u=n.apply(this,a);return s.cache=c.set(o,u)||c,u};return s.cache=new(r.Cache||t),s}return r.Cache=t,JD=r,JD}var eO,eX;function Mot(){if(eX)return eO;eX=1;var t=Zge(),e=500;function r(n){var i=t(n,function(a){return s.size===e&&s.clear(),a}),s=i.cache;return i}return eO=r,eO}var tO,tX;function Aot(){if(tX)return tO;tX=1;var t=Mot(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(a,o,c,u){s.push(c?u.replace(r,"$1"):o||a)}),s});return tO=n,tO}var rO,rX;function dU(){if(rX)return rO;rX=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=r(e[n],n,e);return s}return rO=t,rO}var nO,nX;function Dot(){if(nX)return nO;nX=1;var t=d1(),e=dU(),r=va(),n=c0(),i=t?t.prototype:void 0,s=i?i.toString:void 0;function a(o){if(typeof o=="string")return o;if(r(o))return e(o,a)+"";if(n(o))return s?s.call(o):"";var c=o+"";return c=="0"&&1/o==-1/0?"-0":c}return nO=a,nO}var iO,iX;function Xge(){if(iX)return iO;iX=1;var t=Dot();function e(r){return r==null?"":t(r)}return iO=e,iO}var sO,sX;function Jge(){if(sX)return sO;sX=1;var t=va(),e=aU(),r=Aot(),n=Xge();function i(s,a){return t(s)?s:e(s,a)?[s]:r(n(s))}return sO=i,sO}var aO,aX;function SN(){if(aX)return aO;aX=1;var t=c0();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return aO=e,aO}var oO,oX;function fU(){if(oX)return oO;oX=1;var t=Jge(),e=SN();function r(n,i){i=t(i,n);for(var s=0,a=i.length;n!=null&&s<a;)n=n[e(i[s++])];return s&&s==a?n:void 0}return oO=r,oO}var lO,lX;function eye(){if(lX)return lO;lX=1;var t=fU();function e(r,n,i){var s=r==null?void 0:t(r,n);return s===void 0?i:s}return lO=e,lO}var Oot=eye();const ko=Lr(Oot);var cO,cX;function Rot(){if(cX)return cO;cX=1;function t(e){return e==null}return cO=t,cO}var Iot=Rot();const Ut=Lr(Iot);var uO,uX;function Lot(){if(uX)return uO;uX=1;var t=ed(),e=va(),r=td(),n="[object String]";function i(s){return typeof s=="string"||!e(s)&&r(s)&&t(s)==n}return uO=i,uO}var $ot=Lot();const Op=Lr($ot);var Fot=oU();const qt=Lr(Fot);var zot=Wf();const u0=Lr(zot);var dO={exports:{}},Nr={};/**
4322 * @license React
4323 * react-is.production.min.js
4324 *
4325 * Copyright (c) Facebook, Inc. and its affiliates.
4326 *
4327 * This source code is licensed under the MIT license found in the
4328 * LICENSE file in the root directory of this source tree.
4329 */var dX;function Bot(){if(dX)return Nr;dX=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function x(v){if(typeof v=="object"&&v!==null){var _=v.$$typeof;switch(_){case t:switch(v=v.type,v){case r:case i:case n:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case o:case a:case c:case h:case f:case s:return v;default:return _}}case e:return _}}}return Nr.ContextConsumer=a,Nr.ContextProvider=s,Nr.Element=t,Nr.ForwardRef=c,Nr.Fragment=r,Nr.Lazy=h,Nr.Memo=f,Nr.Portal=e,Nr.Profiler=i,Nr.StrictMode=n,Nr.Suspense=u,Nr.SuspenseList=d,Nr.isAsyncMode=function(){return!1},Nr.isConcurrentMode=function(){return!1},Nr.isContextConsumer=function(v){return x(v)===a},Nr.isContextProvider=function(v){return x(v)===s},Nr.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===t},Nr.isForwardRef=function(v){return x(v)===c},Nr.isFragment=function(v){return x(v)===r},Nr.isLazy=function(v){return x(v)===h},Nr.isMemo=function(v){return x(v)===f},Nr.isPortal=function(v){return x(v)===e},Nr.isProfiler=function(v){return x(v)===i},Nr.isStrictMode=function(v){return x(v)===n},Nr.isSuspense=function(v){return x(v)===u},Nr.isSuspenseList=function(v){return x(v)===d},Nr.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===i||v===n||v===u||v===d||v===m||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===f||v.$$typeof===s||v.$$typeof===a||v.$$typeof===c||v.$$typeof===y||v.getModuleId!==void 0)},Nr.typeOf=x,Nr}var fX;function Vot(){return fX||(fX=1,dO.exports=Bot()),dO.exports}var Uot=Vot(),fO,hX;function tye(){if(hX)return fO;hX=1;var t=ed(),e=td(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return fO=n,fO}var hO,pX;function Got(){if(pX)return hO;pX=1;var t=tye();function e(r){return t(r)&&r!=+r}return hO=e,hO}var Wot=Got();const d0=Lr(Wot);var Hot=tye();const qot=Lr(Hot);var dl=function(e){return e===0?0:e>0?1:-1},Bh=function(e){return Op(e)&&e.indexOf("%")===e.length-1},Ge=function(e){return qot(e)&&!d0(e)},Yot=function(e){return Ut(e)},Ti=function(e){return Ge(e)||Op(e)},Kot=0,Xp=function(e){var r=++Kot;return"".concat(e||"").concat(r)},Rp=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ge(e)&&!Op(e))return n;var s;if(Bh(e)){var a=e.indexOf("%");s=r*parseFloat(e.slice(0,a))/100}else s=+e;return d0(s)&&(s=n),i&&s>r&&(s=r),s},Vd=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},Qot=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},i=0;i<r;i++)if(!n[e[i]])n[e[i]]=!0;else return!0;return!1},Yn=function(e,r){return Ge(e)&&Ge(r)?function(n){return e+n*(r-e)}:function(){return r}};function cC(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):ko(n,e))===r})}var Zot=function(e){if(!e||!e.length)return null;for(var r=e.length,n=0,i=0,s=0,a=0,o=1/0,c=-1/0,u=0,d=0,f=0;f<r;f++)u=e[f].cx||0,d=e[f].cy||0,n+=u,i+=d,s+=u*d,a+=u*u,o=Math.min(o,u),c=Math.max(c,u);var h=r*a!==n*n?(r*s-n*i)/(r*a-n*n):0;return{xmin:o,xmax:c,a:h,b:(i-h*n)/r}},Xot=function(e,r){return Ge(e)&&Ge(r)?e-r:Op(e)&&Op(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Eg(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function v5(t){"@babel/helpers - typeof";return v5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v5(t)}var Jot=["viewBox","children"],elt=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackgroun
4329d","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],mX=["points","pathLength"],pO={svg:Jot,polygon:mX,polyline:mX},hU=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],uC=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),!u0(n))return null;var i={};
vendor: 7,642 bytes, line 4329
4329return Object.keys(n).forEach(function(s){hU.includes(s)&&(i[s]=r||function(a){return n[s](n,a)})}),i},tlt=function(e,r,n){return function(i){return e(r,n,i),null}},jb=function(e,r,n){if(!u0(e)||v5(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(s){var a=e[s];hU.includes(s)&&typeof a=="function"&&(i||(i={}),i[s]=tlt(a,r,n))}),i},rlt=["children"],nlt=["children"];function gX(t,e){if(t==null)return{};var r=ilt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ilt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function x5(t){"@babel/helpers - typeof";return x5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x5(t)}var yX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},mu=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},vX=null,mO=null,pU=function t(e){if(e===vX&&Array.isArray(mO))return mO;var r=[];return b.Children.forEach(e,function(n){Ut(n)||(Uot.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),mO=r,vX=e,r};function ua(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return mu(i)}):n=[mu(e)],pU(t).forEach(function(i){var s=ko(i,"type.displayName")||ko(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function Ea(t,e){var r=ua(t,e);return r&&r[0]}var xX=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!Ge(n)||n<=0||!Ge(i)||i<=0)},slt=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],alt=function(e){return e&&e.type&&Op(e.type)&&slt.indexOf(e.type)>=0},rye=function(e){return e&&x5(e)==="object"&&"clipDot"in e},olt=function(e,r,n,i){var s,a=(s=pO?.[i])!==null&&s!==void 0?s:[];return r.startsWith("data-")||!qt(e)&&(i&&a.includes(r)||elt.includes(r))||n&&hU.includes(r)},Ht=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(b.isValidElement(e)&&(i=e.props),!u0(i))return null;var s={};return Object.keys(i).forEach(function(a){var o;olt((o=i)===null||o===void 0?void 0:o[a],a,r,n)&&(s[a]=i[a])}),s},b5=function t(e,r){if(e===r)return!0;var n=b.Children.count(e);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return bX(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var s=e[i],a=r[i];if(Array.isArray(s)||Array.isArray(a)){if(!t(s,a))return!1}else if(!bX(s,a))return!1}return!0},bX=function(e,r){if(Ut(e)&&Ut(r))return!0;if(!Ut(e)&&!Ut(r)){var n=e.props||{},i=n.children,s=gX(n,rlt),a=r.props||{},o=a.children,c=gX(a,nlt);return i&&o?Eg(s,c)&&b5(i,o):!i&&!o?Eg(s,c):!1}return!1},wX=function(e,r){var n=[],i={};return pU(e).forEach(function(s,a){if(alt(s))n.push(s);else if(s){var o=mu(s.type),c=r[o]||{},u=c.handler,d=c.once;if(u&&(!d||!i[o])){var f=u(s,o,a);n.push(f),i[o]=!0}}}),n},llt=function(e){var r=e&&e.type;return r&&yX[r]?yX[r]:null},clt=function(e,r){return pU(r).indexOf(e)},ult=["children","width","height","viewBox","className","style","title","desc"];function w5(){return w5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},w5.apply(this,arguments)}function dlt(t,e){if(t==null)return{};var r=flt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function flt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function _5(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,s=t.className,a=t.style,o=t.title,c=t.desc,u=dlt(t,ult),d=i||{width:r,height:n,x:0,y:0},f=Tt("recharts-surface",s);return P.createElement("svg",w5({},Ht(u,!0,"svg"),{className:f,width:r,height:n,style:a,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),P.createElement("title",null,o),P.createElement("desc",null,c),e)}var hlt=["children","className"];function S5(){return S5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},S5.apply(this,arguments)}function plt(t,e){if(t==null)return{};var r=mlt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function mlt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Cr=P.forwardRef(function(t,e){var r=t.children,n=t.className,i=plt(t,hlt),s=Tt("recharts-layer",n);return P.createElement("g",S5({className:s},Ht(i,!0),{ref:e}),r)}),gu=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]},gO,_X;function glt(){if(_X)return gO;_X=1;function t(e,r,n){var i=-1,s=e.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var a=Array(s);++i<s;)a[i]=e[i+r];return a}return gO=t,gO}var yO,SX;function ylt(){if(SX)return yO;SX=1;var t=glt();function e(r,n,i){var s=r.length;return i=i===void 0?s:i,!n&&i>=s?r:t(r,n,i)}return yO=e,yO}var vO,kX;function nye(){if(kX)return vO;kX=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,s="\\ufe0e\\ufe0f",a="\\u200d",o=RegExp("["+a+t+i+s+"]");function c(u){return o.test(u)}return vO=c,vO}var xO,TX;function vlt(){if(TX)return xO;TX=1;function t(e){return e.split("")}return xO=t,xO}var bO,CX;function xlt(){if(CX)return bO;CX=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,s="\\ufe0e\\ufe0f",a="["+t+"]",o="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+c+")",d="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",m="\\u200d",y=u+"?",x="["+s+"]?",v="(?:"+m+"(?:"+[d,f,h].join("|")+")"+x+y+")*",_=x+y+v,S="(?:"+[d+o+"?",o,f,h,a].join("|")+")",k=RegExp(c+"(?="+c+")|"+S+_,"g");function E(T){return T.match(k)||[]}return bO=E,bO}var wO,EX;
vendor: 3,651 bytes, line 4329
4329function blt(){if(EX)return wO;EX=1;var t=vlt(),e=nye(),r=xlt();function n(i){return e(i)?r(i):t(i)}return wO=n,wO}var _O,jX;function wlt(){if(jX)return _O;jX=1;var t=ylt(),e=nye(),r=blt(),n=Xge();function i(s){return function(a){a=n(a);var o=e(a)?r(a):void 0,c=o?o[0]:a.charAt(0),u=o?t(o,1).join(""):a.slice(1);return c[s]()+u}}return _O=i,_O}var SO,NX;function _lt(){if(NX)return SO;NX=1;var t=wlt(),e=t("toUpperCase");return SO=e,SO}var Slt=_lt();const kN=Lr(Slt);function Jr(t){return function(){return t}}const iye=Math.cos,dC=Math.sin,wl=Math.sqrt,fC=Math.PI,TN=2*fC,k5=Math.PI,T5=2*k5,Th=1e-6,klt=T5-Th;function sye(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function Tlt(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return sye;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class Clt{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?sye:Tlt(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,s,a){this._append`C${+e},${+r},${+n},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(e,r,n,i,s){if(e=+e,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=n-e,u=i-r,d=a-e,f=o-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(h>Th)if(!(Math.abs(f*c-u*d)>Th)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let m=n-a,y=i-o,x=c*c+u*u,v=m*m+y*y,_=Math.sqrt(x),S=Math.sqrt(h),k=s*Math.tan((k5-Math.acos((x+h-v)/(2*_*S)))/2),E=k/S,T=k/_;Math.abs(E-1)>Th&&this._append`L${e+E*d},${r+E*f}`,this._append`A${s},${s},0,0,${+(f*m>d*y)},${this._x1=e+T*c},${this._y1=r+T*u}`}}arc(e,r,n,i,s,a){if(e=+e,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),c=n*Math.sin(i),u=e+o,d=r+c,f=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Th||Math.abs(this._y1-d)>Th)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%T5+T5),h>klt?this._append`A${n},${n},0,1,${f},${e-o},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Th&&this._append`A${n},${n},0,${+(h>=k5)},${f},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function mU(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new Clt(e)}function gU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function aye(t){this._context=t}aye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function CN(t){return new aye(t)}function oye(t){return t[0]}function lye(t){return t[1]}function cye(t,e){var r=Jr(!0),n=null,i=CN,s=null,a=mU(o);t=typeof t=="function"?t:t===void 0?oye:Jr(t),e=typeof e=="function"?e:e===void 0?lye:Jr(e);function o(c){var u,d=(c=gU(c)).length,f,h=!1,m;
vendor: 10,832 bytes, line 4329
4329for(n==null&&(s=i(m=a())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+t(f,u,c),+e(f,u,c));if(m)return s=null,m+""||null}return o.x=function(c){return arguments.length?(t=typeof c=="function"?c:Jr(+c),o):t},o.y=function(c){return arguments.length?(e=typeof c=="function"?c:Jr(+c),o):e},o.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Jr(!!c),o):r},o.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),o):i},o.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),o):n},o}function CS(t,e,r){var n=null,i=Jr(!0),s=null,a=CN,o=null,c=mU(u);t=typeof t=="function"?t:t===void 0?oye:Jr(+t),e=typeof e=="function"?e:Jr(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?lye:Jr(+r);function u(f){var h,m,y,x=(f=gU(f)).length,v,_=!1,S,k=new Array(x),E=new Array(x);for(s==null&&(o=a(S=c())),h=0;h<=x;++h){if(!(h<x&&i(v=f[h],h,f))===_)if(_=!_)m=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),y=h-1;y>=m;--y)o.point(k[y],E[y]);o.lineEnd(),o.areaEnd()}_&&(k[h]=+t(v,h,f),E[h]=+e(v,h,f),o.point(n?+n(v,h,f):k[h],r?+r(v,h,f):E[h]))}if(S)return o=null,S+""||null}function d(){return cye().defined(i).curve(a).context(s)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:Jr(+f),n=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Jr(+f),u):t},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Jr(+f),u):n},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:Jr(+f),r=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Jr(+f),u):e},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Jr(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(r)},u.lineX1=function(){return d().x(n).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Jr(!!f),u):i},u.curve=function(f){return arguments.length?(a=f,s!=null&&(o=a(s)),u):a},u.context=function(f){return arguments.length?(f==null?s=o=null:o=a(s=f),u):s},u}class uye{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function Elt(t){return new uye(t,!0)}function jlt(t){return new uye(t,!1)}const yU={draw(t,e){const r=wl(e/fC);t.moveTo(r,0),t.arc(0,0,r,0,TN)}},Nlt={draw(t,e){const r=wl(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},dye=wl(1/3),Plt=dye*2,Mlt={draw(t,e){const r=wl(e/Plt),n=r*dye;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Alt={draw(t,e){const r=wl(e),n=-r/2;t.rect(n,n,r,r)}},Dlt=.8908130915292852,fye=dC(fC/10)/dC(7*fC/10),Olt=dC(TN/10)*fye,Rlt=-iye(TN/10)*fye,Ilt={draw(t,e){const r=wl(e*Dlt),n=Olt*r,i=Rlt*r;t.moveTo(0,-r),t.lineTo(n,i);for(let s=1;s<5;++s){const a=TN*s/5,o=iye(a),c=dC(a);t.lineTo(c*r,-o*r),t.lineTo(o*n-c*i,c*n+o*i)}t.closePath()}},kO=wl(3),Llt={draw(t,e){const r=-wl(e/(kO*3));t.moveTo(0,r*2),t.lineTo(-kO*r,-r),t.lineTo(kO*r,-r),t.closePath()}},no=-.5,io=wl(3)/2,C5=1/wl(12),$lt=(C5/2+1)*3,Flt={draw(t,e){const r=wl(e/$lt),n=r/2,i=r*C5,s=n,a=r*C5+r,o=-s,c=a;t.moveTo(n,i),t.lineTo(s,a),t.lineTo(o,c),t.lineTo(no*n-io*i,io*n+no*i),t.lineTo(no*s-io*a,io*s+no*a),t.lineTo(no*o-io*c,io*o+no*c),t.lineTo(no*n+io*i,no*i-io*n),t.lineTo(no*s+io*a,no*a-io*s),t.lineTo(no*o+io*c,no*c-io*o),t.closePath()}};function zlt(t,e){let r=null,n=mU(i);t=typeof t=="function"?t:Jr(t||yU),e=typeof e=="function"?e:Jr(e===void 0?64:+e);function i(){let s;if(r||(r=s=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Jr(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Jr(+s),i):e},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function hC(){}function pC(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function hye(t){this._context=t}hye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:pC(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:pC(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Blt(t){return new hye(t)}function pye(t){this._context=t}pye.prototype={areaStart:hC,areaEnd:hC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:pC(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Vlt(t){return new pye(t)}function mye(t){this._context=t}mye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:pC(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ult(t){return new mye(t)}function gye(t){this._context=t}gye.prototype={areaStart:hC,areaEnd:hC,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Glt(t){return new gye(t)}function PX(t){return t<0?-1:1}function MX(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),a=(r-t._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(PX(s)+PX(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function AX(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function TO(t,e,r){var n=t._x0,i=t._y0,s=t._x1,a=t._y1,o=(s-n)/3;t._context.bezierCurveTo(n+o,i+o*e,s-o,a-o*r,s,a)}function mC(t){this._context=t}mC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:TO(this,this._t0,AX(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,TO(this,AX(this,r=MX(this,t,e)),r);break;default:TO(this,this._t0,r=MX(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function yye(t){this._context=new vye(t)}(yye.prototype=Object.create(mC.prototype)).point=function(t,e){mC.prototype.point.call(this,e,t)};function vye(t){this._context=t}vye.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function Wlt(t){return new mC(t)}function Hlt(t){return new yye(t)}function xye(t){this._context=t}xye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=DX(t),i=DX(e),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],t[a],e[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function DX(t){var e,r=t.length-1,n,i=new Array(r),s=new Array(r),a=new Array(r);for(i[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,s[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/s[e-1],s[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/s[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/s[e];for(s[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)s[e]=2*t[e+1]-i[e+1];return[i,s]}function qlt(t){return new xye(t)}function EN(t,e){this._context=t,this._t=e}EN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;
vendor: 17,938 bytes, lines 4329-4332
4329default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Ylt(t){return new EN(t,.5)}function Klt(t){return new EN(t,0)}function Qlt(t){return new EN(t,1)}function ly(t,e){if((a=t.length)>1)for(var r=1,n,i,s=t[e[0]],a,o=s.length;r<a;++r)for(i=s,s=t[e[r]],n=0;n<o;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function E5(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Zlt(t,e){return t[e]}function Xlt(t){const e=[];return e.key=t,e}function Jlt(){var t=Jr([]),e=E5,r=ly,n=Zlt;function i(s){var a=Array.from(t.apply(this,arguments),Xlt),o,c=a.length,u=-1,d;for(const f of s)for(o=0,++u;o<c;++o)(a[o][u]=[0,+n(f,a[o].key,u,s)]).data=f;for(o=0,d=gU(e(a));o<c;++o)a[d[o]].index=o;return r(a,d),a}return i.keys=function(s){return arguments.length?(t=typeof s=="function"?s:Jr(Array.from(s)),i):t},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:Jr(+s),i):n},i.order=function(s){return arguments.length?(e=s==null?E5:typeof s=="function"?s:Jr(Array.from(s)),i):e},i.offset=function(s){return arguments.length?(r=s??ly,i):r},i}function ect(t,e){if((n=t.length)>0){for(var r,n,i=0,s=t[0].length,a;i<s;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}ly(t,e)}}function tct(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,s=n.length;r<s;++r){for(var a=0,o=0;a<i;++a)o+=t[a][r][1]||0;n[r][1]+=n[r][0]=-o/2}ly(t,e)}}function rct(t,e){if(!(!((a=t.length)>0)||!((s=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,s,a;n<s;++n){for(var o=0,c=0,u=0;o<a;++o){for(var d=t[e[o]],f=d[n][1]||0,h=d[n-1][1]||0,m=(f-h)/2,y=0;y<o;++y){var x=t[e[y]],v=x[n][1]||0,_=x[n-1][1]||0;m+=v-_}c+=f,u+=m*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,ly(t,e)}}function Nb(t){"@babel/helpers - typeof";return Nb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nb(t)}var nct=["type","size","sizeType"];function j5(){return j5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},j5.apply(this,arguments)}function OX(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function RX(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?OX(Object(r),!0).forEach(function(n){ict(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):OX(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ict(t,e,r){return e=sct(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sct(t){var e=act(t,"string");return Nb(e)=="symbol"?e:e+""}function act(t,e){if(Nb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Nb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oct(t,e){if(t==null)return{};var r=lct(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lct(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var bye={symbolCircle:yU,symbolCross:Nlt,symbolDiamond:Mlt,symbolSquare:Alt,symbolStar:Ilt,symbolTriangle:Llt,symbolWye:Flt},cct=Math.PI/180,uct=function(e){var r="symbol".concat(kN(e));return bye[r]||yU},dct=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*cct;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fct=function(e,r){bye["symbol".concat(kN(e))]=r},jN=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,s=i===void 0?64:i,a=e.sizeType,o=a===void 0?"area":a,c=oct(e,nct),u=RX(RX({},c),{},{type:n,size:s,sizeType:o}),d=function(){var v=uct(n),_=zlt().type(v).size(dct(s,o,n));return _()},f=u.className,h=u.cx,m=u.cy,y=Ht(u,!0);return h===+h&&m===+m&&s===+s?P.createElement("path",j5({},y,{className:Tt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:d()})):null};jN.registerSymbol=fct;function cy(t){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cy(t)}function N5(){return N5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N5.apply(this,arguments)}function IX(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IX(Object(r),!0).forEach(function(n){Pb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IX(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_ye(n.key),n)}}function gct(t,e,r){return e&&mct(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yct(t,e,r){return e=gC(e),vct(t,wye()?Reflect.construct(e,r||[],gC(t).constructor):e.apply(t,r))}function vct(t,e){if(e&&(cy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xct(t)}function xct(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wye=function(){return!!t})()}function gC(t){return gC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gC(t)}function bct(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&P5(t,e)}function P5(t,e){return P5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},P5(t,e)}function Pb(t,e,r){return e=_ye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ye(t){var e=wct(t,"string");return cy(e)=="symbol"?e:e+""}function wct(t,e){if(cy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var so=32,vU=(function(t){function e(){return pct(this,e),yct(this,e,arguments)}return bct(e,t),gct(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,s=so/2,a=so/6,o=so/3,c=n.inactive?i:n.color;if(n.type==="plainline")return P.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:s,x2:so,y2:s,className:"recharts-legend-icon"});if(n.type==="line")return P.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(o,`
4330            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(s,`
4331            H`).concat(so,"M").concat(2*o,",").concat(s,`
4332            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(s),className:"recharts-legend-icon"});if(n.type==="rect")return P.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(so/8,"h").concat(so,"v").concat(so*3/4,"h").concat(-so,"z"),className:"recharts-legend-icon"});if(P.isValidElement(n.legendIcon)){var u=hct({},n);return delete u.legendIcon,P.cloneElement(n.legendIcon,u)}return P.createElement(jN,{fill:c,cx:s,cy:s,size:so,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,s=i.payload,a=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:so,height:so},f={display:o==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(m,y){var x=m.formatter||c,v=Tt(Pb(Pb({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",m.inactive));if(m.type==="none")return null;var _=qt(m.value)?null:m.value;gu(!qt(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var S=m.inactive?u:m.color;return P.createElement("li",N5({className:v,style:f,key:"legend-item-".concat(y)},jb(n.props,m,y)),P.createElement(_5,{width:a,height:a,viewBox:d,style:h},n.renderIcon(m)),P.createElement("span",{className:"recharts-legend-item-text",style:{color:S}},x?x(_,m,y):_))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,a=n.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:s==="horizontal"?a:"left"};return P.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])})(b.PureComponent);Pb(vU,"displayName","Legend");Pb(vU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var CO,LX;function _ct(){if(LX)return CO;LX=1;var t=wN();function e(){this.__data__=new t,this.size=0}return CO=e,CO}var EO,$X;function Sct(){if($X)return EO;$X=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return EO=t,EO}var jO,FX;function kct(){if(FX)return jO;FX=1;function t(e){return this.__data__.get(e)}return jO=t,jO}var NO,zX;function Tct(){if(zX)return NO;zX=1;function t(e){return this.__data__.has(e)}return NO=t,NO}var PO,BX;function Cct(){if(BX)return PO;BX=1;var t=wN(),e=cU(),r=uU(),n=200;function i(s,a){var o=this.__data__;if(o instanceof t){var c=o.__data__;if(!e||c.length<n-1)return c.push([s,a]),this.size=++o.size,this;o=this.__data__=new r(c)}return o.set(s,a),this.size=o.size,this}return PO=i,PO}var MO,VX;function Sye(){if(VX)return MO;VX=1;var t=wN(),e=_ct(),r=Sct(),n=kct(),i=Tct(),s=Cct();function a(o){var c=this.__data__=new t(o);this.size=c.size}return a.prototype.clear=e,a.prototype.delete=r,a.prototype.get=n,a.prototype.has=i,a.prototype.set=s,MO=a,MO}var AO,UX;function Ect(){if(UX)return AO;UX=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return AO=e,AO}var DO,GX;function jct(){if(GX)return DO;GX=1;function t(e){return this.__data__.has(e)}return DO=t,DO}var OO,WX;function kye(){if(WX)return OO;WX=1;var t=uU(),e=Ect(),r=jct();function n(i){var s=-1,a=i==null?0:i.length;for(this.__data__=new t;++s<a;)this.add(i[s])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,OO=n,OO}var RO,HX;function Tye(){if(HX)return RO;HX=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return RO=t,RO}var IO,qX;function Cye(){if(qX)return IO;qX=1;function t(e,r){return e.has(r)}return IO=t,IO}var LO,YX;function Eye(){if(YX)return LO;YX=1;var t=kye(),e=Tye(),r=Cye(),n=1,i=2;function s(a,o,c,u,d,f){var h=c&n,m=a.length,y=o.length;if(m!=y&&!(h&&y>m))return!1;var x=f.get(a),v=f.get(o);if(x&&v)return x==o&&v==a;var _=-1,S=!0,k=c&i?new t:void 0;for(f.set(a,o),f.set(o,a);++_<m;){var E=a[_],T=o[_];if(u)var N=h?u(T,E,_,o,a,f):u(E,T,_,a,o,f);if(N!==void 0){if(N)continue;S=!1;break}if(k){if(!e(o,function(j,M){if(!r(k,M)&&(E===j||d(E,j,c,u,f)))return k.push(M)})){S=!1;break}}else if(!(E===T||d(E,T,c,u,f))){S=!1;break}}return f.delete(a),f.delete(o),S}return LO=s,LO}var $O,KX;function Nct(){if(KX)return $O;KX=1;var t=Tc(),e=t.Uint8Array;return $O=e,$O}var FO,QX;function Pct(){if(QX)return FO;QX=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,s){n[++r]=[s,i]}),n}return FO=t,FO}var zO,ZX;function xU(){if(ZX)return zO;ZX=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return zO=t,zO}var BO,XX;function Mct(){if(XX)return BO;XX=1;var t=d1(),e=Nct(),r=lU(),n=Eye(),i=Pct(),s=xU(),a=1,o=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",m="[object RegExp]",y="[object Set]",x="[object String]",v="[object Symbol]",_="[object ArrayBuffer]",S="[object DataView]",k=t?t.prototype:void 0,E=k?k.valueOf:void 0;function T(N,j,M,O,R,I,B){switch(M){case S:if(N.byteLength!=j.byteLength||N.byteOffset!=j.byteOffset)return!1;N=N.buffer,j=j.buffer;case _:return!(N.byteLength!=j.byteLength||!I(new e(N),new e(j)));case c:case u:case h:return r(+N,+j);case d:return N.name==j.name&&N.message==j.message;case m:case x:return N==j+"";case f:var F=i;case y:var V=O&a;if(F||(F=s),N.size!=j.size&&!V)return!1;var $=B.get(N);if($)return $==j;O|=o,B.set(N,j);var U=n(F(N),F(j),O,R,I,B);return B.delete(N),U;case v:if(E)return E.call(N)==E.call(j)}return!1}return BO=T,BO}var VO,JX;function jye(){if(JX)return VO;JX=1;function t(e,r){for(var n=-1,i=r.length,s=e.length;++n<i;)e[s+n]=r[n];return e}return VO=t,VO}var UO,eJ;function Act(){if(eJ)return UO;eJ=1;var t=jye(),e=va();function r(n,i,s){var a=i(n);return e(n)?a:t(a,s(n))}return UO=r,UO}var GO,tJ;function Dct(){if(tJ)return GO;tJ=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,s=0,a=[];++n<i;){var o=e[n];r(o,n,e)&&(a[s++]=o)}return a}return GO=t,GO}var WO,rJ;function Oct(){if(rJ)return WO;rJ=1;function t(){return[]}return WO=t,WO}var HO,nJ;function Rct(){if(nJ)return HO;nJ=1;var t=Dct(),e=Oct(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(a){return a==null?[]:(a=Object(a),t(i(a),function(o){return n.call(a,o)}))}:e;return HO=s,HO}var qO,iJ;function Ict(){if(iJ)return qO;iJ=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return qO=t,qO}var YO,sJ;function Lct(){if(sJ)return YO;sJ=1;var t=ed(),e=td(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return YO=n,YO}var KO,aJ;function bU(){if(aJ)return KO;aJ=1;var t=Lct(),e=td(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,s=t((function(){return arguments})())?t:function(a){return e(a)&&n.call(a,"callee")&&!i.call(a,"callee")};return KO=s,KO}var sx={exports:{}},QO,oJ;function $ct(){if(oJ)return QO;oJ=1;function t(){return!1}return QO=t,QO}sx.exports;var lJ;function Nye(){return lJ||(lJ=1,(function(t,e){var r=Tc(),n=$ct(),i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===i,o=a?r.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||n;t.exports=u})(sx,sx.exports)),sx.exports}var ZO,cJ;function wU(){if(cJ)return ZO;cJ=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var s=typeof n;return i=i??t,!!i&&(s=="number"||s!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return ZO=r,ZO}var XO,uJ;function _U(){if(uJ)return XO;uJ=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return XO=e,XO}var JO,dJ;function Fct(){if(dJ)return JO;dJ=1;var t=ed(),e=_U(),r=td(),n="[object Arguments]",i="[object Array]",s="[object Boolean]",a="[object Date]",o="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",m="[object Set]",y="[object String]",x="[object WeakMap]",v="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",T="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",M="[object Uint8ClampedArray]",O="[object Uint16Array]",R="[object Uint32Array]",I={};I[S]=I[k]=I[E]=I[T]=I[N]=I[j]=I[M]=I[O]=I[R]=!0,I[n]=I[i]=I[v]=I[s]=I[_]=I[a]=I[o]=I[c]=I[u]=I[d]=I[f]=I[h]=I[m]=I[y]=I[x]=!1;function B(F){return r(F)&&e(F.length)&&!!I[t(F)]}return JO=B,JO}var eR,fJ;function Pye(){if(fJ)return eR;fJ=1;function t(e){return function(r){return e(r)}}return eR=t,eR}var ax={exports:{}};ax.exports;var hJ;function zct(){return hJ||(hJ=1,(function(t,e){var r=Kge(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,a=s&&r.process,o=(function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}})();t.exports=o})(ax,ax.exports)),ax.exports}var tR,pJ;function Mye(){if(pJ)return tR;pJ=1;var t=Fct(),e=Pye(),r=zct(),n=r&&r.isTypedArray,i=n?e(n):t;return tR=i,tR}var rR,mJ;function Bct(){if(mJ)return rR;mJ=1;var t=Ict(),e=bU(),r=va(),n=Nye(),i=wU(),s=Mye(),a=Object.prototype,o=a.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&e(u),m=!f&&!h&&n(u),y=!f&&!h&&!m&&s(u),x=f||h||m||y,v=x?t(u.length,String):[],_=v.length;for(var S in u)(d||o.call(u,S))&&!(x&&(S=="length"||m&&(S=="offset"||S=="parent")||y&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||i(S,_)))&&v.push(S);return v}return rR=c,rR}var nR,gJ;function Vct(){if(gJ)return nR;gJ=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return nR=e,nR}var iR,yJ;
vendor: 4,342 bytes, line 4332
4332function Aye(){if(yJ)return iR;yJ=1;function t(e,r){return function(n){return e(r(n))}}return iR=t,iR}var sR,vJ;function Uct(){if(vJ)return sR;vJ=1;var t=Aye(),e=t(Object.keys,Object);return sR=e,sR}var aR,xJ;function Gct(){if(xJ)return aR;xJ=1;var t=Vct(),e=Uct(),r=Object.prototype,n=r.hasOwnProperty;function i(s){if(!t(s))return e(s);var a=[];for(var o in Object(s))n.call(s,o)&&o!="constructor"&&a.push(o);return a}return aR=i,aR}var oR,bJ;function f1(){if(bJ)return oR;bJ=1;var t=oU(),e=_U();function r(n){return n!=null&&e(n.length)&&!t(n)}return oR=r,oR}var lR,wJ;function NN(){if(wJ)return lR;wJ=1;var t=Bct(),e=Gct(),r=f1();function n(i){return r(i)?t(i):e(i)}return lR=n,lR}var cR,_J;function Wct(){if(_J)return cR;_J=1;var t=Act(),e=Rct(),r=NN();function n(i){return t(i,r,e)}return cR=n,cR}var uR,SJ;function Hct(){if(SJ)return uR;SJ=1;var t=Wct(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(s,a,o,c,u,d){var f=o&e,h=t(s),m=h.length,y=t(a),x=y.length;if(m!=x&&!f)return!1;for(var v=m;v--;){var _=h[v];if(!(f?_ in a:n.call(a,_)))return!1}var S=d.get(s),k=d.get(a);if(S&&k)return S==a&&k==s;var E=!0;d.set(s,a),d.set(a,s);for(var T=f;++v<m;){_=h[v];var N=s[_],j=a[_];if(c)var M=f?c(j,N,_,a,s,d):c(N,j,_,s,a,d);if(!(M===void 0?N===j||u(N,j,o,c,d):M)){E=!1;break}T||(T=_=="constructor")}if(E&&!T){var O=s.constructor,R=a.constructor;O!=R&&"constructor"in s&&"constructor"in a&&!(typeof O=="function"&&O instanceof O&&typeof R=="function"&&R instanceof R)&&(E=!1)}return d.delete(s),d.delete(a),E}return uR=i,uR}var dR,kJ;function qct(){if(kJ)return dR;kJ=1;var t=Zp(),e=Tc(),r=t(e,"DataView");return dR=r,dR}var fR,TJ;function Yct(){if(TJ)return fR;TJ=1;var t=Zp(),e=Tc(),r=t(e,"Promise");return fR=r,fR}var hR,CJ;function Dye(){if(CJ)return hR;CJ=1;var t=Zp(),e=Tc(),r=t(e,"Set");return hR=r,hR}var pR,EJ;function Kct(){if(EJ)return pR;EJ=1;var t=Zp(),e=Tc(),r=t(e,"WeakMap");return pR=r,pR}var mR,jJ;function Qct(){if(jJ)return mR;jJ=1;var t=qct(),e=cU(),r=Yct(),n=Dye(),i=Kct(),s=ed(),a=Qge(),o="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",m=a(t),y=a(e),x=a(r),v=a(n),_=a(i),S=s;return(t&&S(new t(new ArrayBuffer(1)))!=h||e&&S(new e)!=o||r&&S(r.resolve())!=u||n&&S(new n)!=d||i&&S(new i)!=f)&&(S=function(k){var E=s(k),T=E==c?k.constructor:void 0,N=T?a(T):"";if(N)switch(N){case m:return h;case y:return o;case x:return u;case v:return d;case _:return f}return E}),mR=S,mR}var gR,NJ;function Zct(){if(NJ)return gR;NJ=1;var t=Sye(),e=Eye(),r=Mct(),n=Hct(),i=Qct(),s=va(),a=Nye(),o=Mye(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,m=h.hasOwnProperty;function y(x,v,_,S,k,E){var T=s(x),N=s(v),j=T?d:i(x),M=N?d:i(v);j=j==u?f:j,M=M==u?f:M;var O=j==f,R=M==f,I=j==M;if(I&&a(x)){if(!a(v))return!1;T=!0,O=!1}if(I&&!O)return E||(E=new t),T||o(x)?e(x,v,_,S,k,E):r(x,v,j,_,S,k,E);if(!(_&c)){var B=O&&m.call(x,"__wrapped__"),F=R&&m.call(v,"__wrapped__");if(B||F){var V=B?x.value():x,$=F?v.value():v;return E||(E=new t),k(V,$,_,S,E)}}return I?(E||(E=new t),n(x,v,_,S,k,E)):!1}return gR=y,gR}var yR,PJ;function SU(){if(PJ)return yR;PJ=1;var t=Zct(),e=td();function r(n,i,s,a,o){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,s,a,r,o)}return yR=r,yR}var vR,MJ;function Xct(){if(MJ)return vR;MJ=1;var t=Sye(),e=SU(),r=1,n=2;function i(s,a,o,c){var u=o.length,d=u,f=!c;if(s==null)return!d;for(s=Object(s);u--;){var h=o[u];if(f&&h[2]?h[1]!==s[h[0]]:!(h[0]in s))return!1}for(;++u<d;){h=o[u];var m=h[0],y=s[m],x=h[1];if(f&&h[2]){if(y===void 0&&!(m in s))return!1}else{var v=new t;if(c)var _=c(y,x,m,s,a,v);if(!(_===void 0?e(x,y,r|n,c,v):_))return!1}}return!0}return vR=i,vR}var xR,AJ;function Oye(){if(AJ)return xR;AJ=1;var t=Wf();function e(r){return r===r&&!t(r)}return xR=e,xR}var bR,DJ;function Jct(){if(DJ)return bR;DJ=1;var t=Oye(),e=NN();function r(n){for(var i=e(n),s=i.length;s--;){var a=i[s],o=n[a];i[s]=[a,o,t(o)]}return i}return bR=r,bR}var wR,OJ;function Rye(){if(OJ)return wR;OJ=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return wR=t,wR}var _R,RJ;function eut(){if(RJ)return _R;RJ=1;var t=Xct(),e=Jct(),r=Rye();function n(i){var s=e(i);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(a){return a===i||t(a,i,s)}}return _R=n,_R}var SR,IJ;
vendor: 11,489 bytes, line 4332
4332function tut(){if(IJ)return SR;IJ=1;function t(e,r){return e!=null&&r in Object(e)}return SR=t,SR}var kR,LJ;function rut(){if(LJ)return kR;LJ=1;var t=Jge(),e=bU(),r=va(),n=wU(),i=_U(),s=SN();function a(o,c,u){c=t(c,o);for(var d=-1,f=c.length,h=!1;++d<f;){var m=s(c[d]);if(!(h=o!=null&&u(o,m)))break;o=o[m]}return h||++d!=f?h:(f=o==null?0:o.length,!!f&&i(f)&&n(m,f)&&(r(o)||e(o)))}return kR=a,kR}var TR,$J;function nut(){if($J)return TR;$J=1;var t=tut(),e=rut();function r(n,i){return n!=null&&e(n,i,t)}return TR=r,TR}var CR,FJ;function iut(){if(FJ)return CR;FJ=1;var t=SU(),e=eye(),r=nut(),n=aU(),i=Oye(),s=Rye(),a=SN(),o=1,c=2;function u(d,f){return n(d)&&i(f)?s(a(d),f):function(h){var m=e(h,d);return m===void 0&&m===f?r(h,d):t(f,m,o|c)}}return CR=u,CR}var ER,zJ;function f0(){if(zJ)return ER;zJ=1;function t(e){return e}return ER=t,ER}var jR,BJ;function sut(){if(BJ)return jR;BJ=1;function t(e){return function(r){return r?.[e]}}return jR=t,jR}var NR,VJ;function aut(){if(VJ)return NR;VJ=1;var t=fU();function e(r){return function(n){return t(n,r)}}return NR=e,NR}var PR,UJ;function out(){if(UJ)return PR;UJ=1;var t=sut(),e=aut(),r=aU(),n=SN();function i(s){return r(s)?t(n(s)):e(s)}return PR=i,PR}var MR,GJ;function Hf(){if(GJ)return MR;GJ=1;var t=eut(),e=iut(),r=f0(),n=va(),i=out();function s(a){return typeof a=="function"?a:a==null?r:typeof a=="object"?n(a)?e(a[0],a[1]):t(a):i(a)}return MR=s,MR}var AR,WJ;function Iye(){if(WJ)return AR;WJ=1;function t(e,r,n,i){for(var s=e.length,a=n+(i?1:-1);i?a--:++a<s;)if(r(e[a],a,e))return a;return-1}return AR=t,AR}var DR,HJ;function lut(){if(HJ)return DR;HJ=1;function t(e){return e!==e}return DR=t,DR}var OR,qJ;function cut(){if(qJ)return OR;qJ=1;function t(e,r,n){for(var i=n-1,s=e.length;++i<s;)if(e[i]===r)return i;return-1}return OR=t,OR}var RR,YJ;function uut(){if(YJ)return RR;YJ=1;var t=Iye(),e=lut(),r=cut();function n(i,s,a){return s===s?r(i,s,a):t(i,e,a)}return RR=n,RR}var IR,KJ;function dut(){if(KJ)return IR;KJ=1;var t=uut();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return IR=e,IR}var LR,QJ;function fut(){if(QJ)return LR;QJ=1;function t(e,r,n){for(var i=-1,s=e==null?0:e.length;++i<s;)if(n(r,e[i]))return!0;return!1}return LR=t,LR}var $R,ZJ;function hut(){if(ZJ)return $R;ZJ=1;function t(){}return $R=t,$R}var FR,XJ;function put(){if(XJ)return FR;XJ=1;var t=Dye(),e=hut(),r=xU(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(s){return new t(s)}:e;return FR=i,FR}var zR,JJ;function mut(){if(JJ)return zR;JJ=1;var t=kye(),e=dut(),r=fut(),n=Cye(),i=put(),s=xU(),a=200;function o(c,u,d){var f=-1,h=e,m=c.length,y=!0,x=[],v=x;if(d)y=!1,h=r;else if(m>=a){var _=u?null:i(c);if(_)return s(_);y=!1,h=n,v=new t}else v=u?[]:x;e:for(;++f<m;){var S=c[f],k=u?u(S):S;if(S=d||S!==0?S:0,y&&k===k){for(var E=v.length;E--;)if(v[E]===k)continue e;u&&v.push(k),x.push(S)}else h(v,k,d)||(v!==x&&v.push(k),x.push(S))}return x}return zR=o,zR}var BR,eee;function gut(){if(eee)return BR;eee=1;var t=Hf(),e=mut();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return BR=r,BR}var yut=gut();const tee=Lr(yut);function Lye(t,e,r){return e===!0?tee(t,r):qt(e)?tee(t,e):t}function uy(t){"@babel/helpers - typeof";return uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uy(t)}var vut=["ref"];function ree(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ree(Object(r),!0).forEach(function(n){PN(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ree(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fye(n.key),n)}}function but(t,e,r){return e&&nee(t.prototype,e),r&&nee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wut(t,e,r){return e=yC(e),_ut(t,$ye()?Reflect.construct(e,r||[],yC(t).constructor):e.apply(t,r))}function _ut(t,e){if(e&&(uy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sut(t)}function Sut(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $ye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($ye=function(){return!!t})()}function yC(t){return yC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yC(t)}function kut(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M5(t,e)}function M5(t,e){return M5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},M5(t,e)}function PN(t,e,r){return e=Fye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fye(t){var e=Tut(t,"string");return uy(e)=="symbol"?e:e+""}function Tut(t,e){if(uy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(uy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Cut(t,e){if(t==null)return{};var r=Eut(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Eut(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function jut(t){return t.value}function Nut(t,e){if(P.isValidElement(t))return P.cloneElement(t,e);if(typeof t=="function")return P.createElement(t,e);e.ref;var r=Cut(e,vut);return P.createElement(vU,r)}var iee=1,jg=(function(t){function e(){var r;xut(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=wut(this,e,[].concat(i)),PN(r,"lastBoundingBox",{width:-1,height:-1}),r}return kut(e,t),but(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>iee||Math.abs(i.height-this.lastBoundingBox.height)>iee)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Bc({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,a=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(a==="center"&&s==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=a==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(o==="middle"){var y=this.getBBoxSnapshot();h={top:((d||0)-y.height)/2}}else h=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Bc(Bc({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,a=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=Bc(Bc({position:"absolute",width:a||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return P.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},Nut(s,Bc(Bc({},this.props),{},{payload:Lye(d,u,jut)})))}}],[{key:"getWithHeight",value:function(n,i){var s=Bc(Bc({},this.defaultProps),n.props),a=s.layout;return a==="vertical"&&Ge(n.props.height)?{height:n.props.height}:a==="horizontal"?{width:n.props.width||i}:null}}])})(b.PureComponent);PN(jg,"displayName","Legend");PN(jg,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var VR,see;function Put(){if(see)return VR;see=1;var t=d1(),e=bU(),r=va(),n=t?t.isConcatSpreadable:void 0;function i(s){return r(s)||e(s)||!!(n&&s&&s[n])}return VR=i,VR}var UR,aee;function zye(){if(aee)return UR;aee=1;var t=jye(),e=Put();function r(n,i,s,a,o){var c=-1,u=n.length;for(s||(s=e),o||(o=[]);++c<u;){var d=n[c];i>0&&s(d)?i>1?r(d,i-1,s,a,o):t(o,d):a||(o[o.length]=d)}return o}return UR=r,UR}var GR,oee;function Mut(){if(oee)return GR;oee=1;function t(e){return function(r,n,i){for(var s=-1,a=Object(r),o=i(r),c=o.length;c--;){var u=o[e?c:++s];if(n(a[u],u,a)===!1)break}return r}}return GR=t,GR}var WR,lee;function Aut(){if(lee)return WR;lee=1;var t=Mut(),e=t();return WR=e,WR}var HR,cee;function Bye(){if(cee)return HR;cee=1;var t=Aut(),e=NN();function r(n,i){return n&&t(n,i,e)}return HR=r,HR}var qR,uee;function Dut(){if(uee)return qR;uee=1;var t=f1();function e(r,n){return function(i,s){if(i==null)return i;if(!t(i))return r(i,s);for(var a=i.length,o=n?a:-1,c=Object(i);(n?o--:++o<a)&&s(c[o],o,c)!==!1;);return i}}return qR=e,qR}var YR,dee;function kU(){if(dee)return YR;dee=1;var t=Bye(),e=Dut(),r=e(t);return YR=r,YR}var KR,fee;function Vye(){if(fee)return KR;fee=1;var t=kU(),e=f1();function r(n,i){var s=-1,a=e(n)?Array(n.length):[];return t(n,function(o,c,u){a[++s]=i(o,c,u)}),a}return KR=r,KR}var QR,hee;function Out(){if(hee)return QR;hee=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return QR=t,QR}var ZR,pee;function Rut(){if(pee)return ZR;pee=1;var t=c0();function e(r,n){if(r!==n){var i=r!==void 0,s=r===null,a=r===r,o=t(r),c=n!==void 0,u=n===null,d=n===n,f=t(n);if(!u&&!f&&!o&&r>n||o&&c&&d&&!u&&!f||s&&c&&d||!i&&d||!a)return 1;if(!s&&!o&&!f&&r<n||f&&i&&a&&!s&&!o||u&&i&&a||!c&&a||!d)return-1}return 0}return ZR=e,ZR}var XR,mee;function Iut(){if(mee)return XR;mee=1;var t=Rut();function e(r,n,i){for(var s=-1,a=r.criteria,o=n.criteria,c=a.length,u=i.length;++s<c;){var d=t(a[s],o[s]);if(d){if(s>=u)return d;var f=i[s];return d*(f=="desc"?-1:1)}}return r.index-n.index}return XR=e,XR}var JR,gee;function Lut(){if(gee)return JR;gee=1;var t=dU(),e=fU(),r=Hf(),n=Vye(),i=Out(),s=Pye(),a=Iut(),o=f0(),c=va();function u(d,f,h){f.length?f=t(f,function(x){return c(x)?function(v){return e(v,x.length===1?x[0]:x)}:x}):f=[o];var m=-1;f=t(f,s(r));var y=n(d,function(x,v,_){var S=t(f,function(k){return k(x)});return{criteria:S,index:++m,value:x}});return i(y,function(x,v){return a(x,v,h)})}return JR=u,JR}var eI,yee;
vendor: 1,330 bytes, line 4332
4332function $ut(){if(yee)return eI;yee=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return eI=t,eI}var tI,vee;function Fut(){if(vee)return tI;vee=1;var t=$ut(),e=Math.max;function r(n,i,s){return i=e(i===void 0?n.length-1:i,0),function(){for(var a=arguments,o=-1,c=e(a.length-i,0),u=Array(c);++o<c;)u[o]=a[i+o];o=-1;for(var d=Array(i+1);++o<i;)d[o]=a[o];return d[i]=s(u),t(n,this,d)}}return tI=r,tI}var rI,xee;function zut(){if(xee)return rI;xee=1;function t(e){return function(){return e}}return rI=t,rI}var nI,bee;function Uye(){if(bee)return nI;bee=1;var t=Zp(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return nI=e,nI}var iI,wee;function But(){if(wee)return iI;wee=1;var t=zut(),e=Uye(),r=f0(),n=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(s),writable:!0})}:r;return iI=n,iI}var sI,_ee;function Vut(){if(_ee)return sI;_ee=1;var t=800,e=16,r=Date.now;function n(i){var s=0,a=0;return function(){var o=r(),c=e-(o-a);if(a=o,c>0){if(++s>=t)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return sI=n,sI}var aI,See;function Uut(){if(See)return aI;See=1;var t=But(),e=Vut(),r=e(t);return aI=r,aI}var oI,kee;
vendor: 22,799 bytes, lines 4332-4337
4332function Gut(){if(kee)return oI;kee=1;var t=f0(),e=Fut(),r=Uut();function n(i,s){return r(e(i,s,t),i+"")}return oI=n,oI}var lI,Tee;function MN(){if(Tee)return lI;Tee=1;var t=lU(),e=f1(),r=wU(),n=Wf();function i(s,a,o){if(!n(o))return!1;var c=typeof a;return(c=="number"?e(o)&&r(a,o.length):c=="string"&&a in o)?t(o[a],s):!1}return lI=i,lI}var cI,Cee;function Wut(){if(Cee)return cI;Cee=1;var t=zye(),e=Lut(),r=Gut(),n=MN(),i=r(function(s,a){if(s==null)return[];var o=a.length;return o>1&&n(s,a[0],a[1])?a=[]:o>2&&n(a[0],a[1],a[2])&&(a=[a[0]]),e(s,t(a,1),[])});return cI=i,cI}var Hut=Wut();const TU=Lr(Hut);function Mb(t){"@babel/helpers - typeof";return Mb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mb(t)}function A5(){return A5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},A5.apply(this,arguments)}function qut(t,e){return Zut(t)||Qut(t,e)||Kut(t,e)||Yut()}function Yut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4333In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kut(t,e){if(t){if(typeof t=="string")return Eee(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Eee(t,e)}}function Eee(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Qut(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Zut(t){if(Array.isArray(t))return t}function jee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jee(Object(r),!0).forEach(function(n){Xut(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jee(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xut(t,e,r){return e=Jut(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jut(t){var e=edt(t,"string");return Mb(e)=="symbol"?e:e+""}function edt(t,e){if(Mb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Mb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tdt(t){return Array.isArray(t)&&Ti(t[0])&&Ti(t[1])?t.join(" ~ "):t}var rdt=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,s=i===void 0?{}:i,a=e.itemStyle,o=a===void 0?{}:a,c=e.labelStyle,u=c===void 0?{}:c,d=e.payload,f=e.formatter,h=e.itemSorter,m=e.wrapperClassName,y=e.labelClassName,x=e.label,v=e.labelFormatter,_=e.accessibilityLayer,S=_===void 0?!1:_,k=function(){if(d&&d.length){var B={padding:0,margin:0},F=(h?TU(d,h):d).map(function(V,$){if(V.type==="none")return null;var U=uI({display:"block",paddingTop:4,paddingBottom:4,color:V.color||"#000"},o),z=V.formatter||f||tdt,L=V.value,W=V.name,K=L,q=W;if(z&&K!=null&&q!=null){var H=z(L,W,V,$,d);if(Array.isArray(H)){var Y=qut(H,2);K=Y[0],q=Y[1]}else K=H}return P.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:U},Ti(q)?P.createElement("span",{className:"recharts-tooltip-item-name"},q):null,Ti(q)?P.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,P.createElement("span",{className:"recharts-tooltip-item-value"},K),P.createElement("span",{className:"recharts-tooltip-item-unit"},V.unit||""))});return P.createElement("ul",{className:"recharts-tooltip-item-list",style:B},F)}return null},E=uI({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),T=uI({margin:0},u),N=!Ut(x),j=N?x:"",M=Tt("recharts-default-tooltip",m),O=Tt("recharts-tooltip-label",y);N&&v&&d!==void 0&&d!==null&&(j=v(x,d));var R=S?{role:"status","aria-live":"assertive"}:{};return P.createElement("div",A5({className:M,style:E},R),P.createElement("p",{className:O,style:T},P.isValidElement(j)?j:"".concat(j)),k())};function Ab(t){"@babel/helpers - typeof";return Ab=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ab(t)}function ES(t,e,r){return e=ndt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ndt(t){var e=idt(t,"string");return Ab(e)=="symbol"?e:e+""}function idt(t,e){if(Ab(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ab(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Cv="recharts-tooltip-wrapper",sdt={visibility:"hidden"};function adt(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return Tt(Cv,ES(ES(ES(ES({},"".concat(Cv,"-right"),Ge(r)&&e&&Ge(e.x)&&r>=e.x),"".concat(Cv,"-left"),Ge(r)&&e&&Ge(e.x)&&r<e.x),"".concat(Cv,"-bottom"),Ge(n)&&e&&Ge(e.y)&&n>=e.y),"".concat(Cv,"-top"),Ge(n)&&e&&Ge(e.y)&&n<e.y))}function Nee(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,s=t.position,a=t.reverseDirection,o=t.tooltipDimension,c=t.viewBox,u=t.viewBoxDimension;if(s&&Ge(s[n]))return s[n];var d=r[n]-o-i,f=r[n]+i;if(e[n])return a[n]?d:f;if(a[n]){var h=d,m=c[n];return h<m?Math.max(f,c[n]):Math.max(d,c[n])}var y=f+o,x=c[n]+u;return y>x?Math.max(d,c[n]):Math.max(f,c[n])}function odt(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function ldt(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,s=t.reverseDirection,a=t.tooltipBox,o=t.useTranslate3d,c=t.viewBox,u,d,f;return a.height>0&&a.width>0&&r?(d=Nee({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:a.width,viewBox:c,viewBoxDimension:c.width}),f=Nee({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:a.height,viewBox:c,viewBoxDimension:c.height}),u=odt({translateX:d,translateY:f,useTranslate3d:o})):u=sdt,{cssProperties:u,cssClasses:adt({translateX:d,translateY:f,coordinate:r})}}function dy(t){"@babel/helpers - typeof";return dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dy(t)}function Pee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mee(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pee(Object(r),!0).forEach(function(n){O5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pee(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cdt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function udt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wye(n.key),n)}}function ddt(t,e,r){return e&&udt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function fdt(t,e,r){return e=vC(e),hdt(t,Gye()?Reflect.construct(e,r||[],vC(t).constructor):e.apply(t,r))}function hdt(t,e){if(e&&(dy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pdt(t)}function pdt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gye=function(){return!!t})()}function vC(t){return vC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vC(t)}function mdt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D5(t,e)}function D5(t,e){return D5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},D5(t,e)}function O5(t,e,r){return e=Wye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wye(t){var e=gdt(t,"string");return dy(e)=="symbol"?e:e+""}function gdt(t,e){if(dy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Aee=1,ydt=(function(t){function e(){var r;cdt(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=fdt(this,e,[].concat(i)),O5(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),O5(r,"handleKeyDown",function(a){if(a.key==="Escape"){var o,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return mdt(e,t),ddt(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>Aee||Math.abs(n.height-this.state.lastBoundingBox.height)>Aee)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,m=i.offset,y=i.position,x=i.reverseDirection,v=i.useTranslate3d,_=i.viewBox,S=i.wrapperStyle,k=ldt({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:m,position:y,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:_}),E=k.cssClasses,T=k.cssProperties,N=Mee(Mee({transition:h&&s?"transform ".concat(o,"ms ").concat(c):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},S);return P.createElement("div",{tabIndex:-1,className:E,style:N,ref:function(M){n.wrapperNode=M}},u)}}])})(b.PureComponent),vdt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},qf={isSsr:vdt()};function fy(t){"@babel/helpers - typeof";return fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fy(t)}function Dee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Oee(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dee(Object(r),!0).forEach(function(n){CU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dee(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xdt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bdt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qye(n.key),n)}}function wdt(t,e,r){return e&&bdt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _dt(t,e,r){return e=xC(e),Sdt(t,Hye()?Reflect.construct(e,r||[],xC(t).constructor):e.apply(t,r))}function Sdt(t,e){if(e&&(fy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kdt(t)}function kdt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Hye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hye=function(){return!!t})()}function xC(t){return xC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xC(t)}function Tdt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R5(t,e)}function R5(t,e){return R5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},R5(t,e)}function CU(t,e,r){return e=qye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qye(t){var e=Cdt(t,"string");return fy(e)=="symbol"?e:e+""}function Cdt(t,e){if(fy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Edt(t){return t.dataKey}function jdt(t,e){return P.isValidElement(t)?P.cloneElement(t,e):typeof t=="function"?P.createElement(t,e):P.createElement(rdt,e)}var Rl=(function(t){function e(){return xdt(this,e),_dt(this,e,arguments)}return Tdt(e,t),wdt(e,[{key:"render",value:function(){var n=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,m=i.offset,y=i.payload,x=i.payloadUniqBy,v=i.position,_=i.reverseDirection,S=i.useTranslate3d,k=i.viewBox,E=i.wrapperStyle,T=y??[];f&&T.length&&(T=Lye(y.filter(function(j){return j.value!=null&&(j.hide!==!0||n.props.includeHidden)}),x,Edt));var N=T.length>0;return P.createElement(ydt,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:N,offset:m,position:v,reverseDirection:_,useTranslate3d:S,viewBox:k,wrapperStyle:E},jdt(u,Oee(Oee({},this.props),{},{payload:T})))}}])})(b.PureComponent);CU(Rl,"displayName","Tooltip");CU(Rl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!qf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var dI,Ree;function Ndt(){if(Ree)return dI;Ree=1;var t=Tc(),e=function(){return t.Date.now()};return dI=e,dI}var fI,Iee;function Pdt(){if(Iee)return fI;Iee=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return fI=e,fI}var hI,Lee;function Mdt(){if(Lee)return hI;Lee=1;var t=Pdt(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return hI=r,hI}var pI,$ee;function Yye(){if($ee)return pI;$ee=1;var t=Mdt(),e=Wf(),r=c0(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=e(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=t(u);var f=s.test(u);return f||a.test(u)?o(u.slice(2),f?2:8):i.test(u)?n:+u}return pI=c,pI}var mI,Fee;function Adt(){if(Fee)return mI;Fee=1;var t=Wf(),e=Ndt(),r=Yye(),n="Expected a function",i=Math.max,s=Math.min;function a(o,c,u){var d,f,h,m,y,x,v=0,_=!1,S=!1,k=!0;if(typeof o!="function")throw new TypeError(n);c=r(c)||0,t(u)&&(_=!!u.leading,S="maxWait"in u,h=S?i(r(u.maxWait)||0,c):h,k="trailing"in u?!!u.trailing:k);function E(F){var V=d,$=f;return d=f=void 0,v=F,m=o.apply($,V),m}function T(F){return v=F,y=setTimeout(M,c),_?E(F):m}function N(F){var V=F-x,$=F-v,U=c-V;return S?s(U,h-$):U}function j(F){var V=F-x,$=F-v;return x===void 0||V>=c||V<0||S&&$>=h}function M(){var F=e();if(j(F))return O(F);y=setTimeout(M,N(F))}function O(F){return y=void 0,k&&d?E(F):(d=f=void 0,m)}function R(){y!==void 0&&clearTimeout(y),v=0,d=x=f=y=void 0}function I(){return y===void 0?m:O(e())}function B(){var F=e(),V=j(F);if(d=arguments,f=this,x=F,V){if(y===void 0)return T(x);if(S)return clearTimeout(y),y=setTimeout(M,c),E(x)}return y===void 0&&(y=setTimeout(M,c)),m}return B.cancel=R,B.flush=I,B}return mI=a,mI}var gI,zee;function Ddt(){if(zee)return gI;zee=1;var t=Adt(),e=Wf(),r="Expected a function";function n(i,s,a){var o=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return e(a)&&(o="leading"in a?!!a.leading:o,c="trailing"in a?!!a.trailing:c),t(i,s,{leading:o,maxWait:s,trailing:c})}return gI=n,gI}var Odt=Ddt();const Kye=Lr(Odt);function Db(t){"@babel/helpers - typeof";return Db=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Db(t)}function Bee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function jS(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Bee(Object(r),!0).forEach(function(n){Rdt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bee(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rdt(t,e,r){return e=Idt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Idt(t){var e=Ldt(t,"string");return Db(e)=="symbol"?e:e+""}function Ldt(t,e){if(Db(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Db(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $dt(t,e){return Vdt(t)||Bdt(t,e)||zdt(t,e)||Fdt()}function Fdt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4334In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zdt(t,e){if(t){if(typeof t=="string")return Vee(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vee(t,e)}}function Vee(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bdt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Vdt(t){if(Array.isArray(t))return t}var Udt=b.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,i=n===void 0?{width:-1,height:-1}:n,s=t.width,a=s===void 0?"100%":s,o=t.height,c=o===void 0?"100%":o,u=t.minWidth,d=u===void 0?0:u,f=t.minHeight,h=t.maxHeight,m=t.children,y=t.debounce,x=y===void 0?0:y,v=t.id,_=t.className,S=t.onResize,k=t.style,E=k===void 0?{}:k,T=b.useRef(null),N=b.useRef();N.current=S,b.useImperativeHandle(e,function(){return Object.defineProperty(T.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),T.current},configurable:!0})});var j=b.useState({containerWidth:i.width,containerHeight:i.height}),M=$dt(j,2),O=M[0],R=M[1],I=b.useCallback(function(F,V){R(function($){var U=Math.round(F),z=Math.round(V);return $.containerWidth===U&&$.containerHeight===z?$:{containerWidth:U,containerHeight:z}})},[]);b.useEffect(function(){var F=function(W){var K,q=W[0].contentRect,H=q.width,Y=q.height;I(H,Y),(K=N.current)===null||K===void 0||K.call(N,H,Y)};x>0&&(F=Kye(F,x,{trailing:!0,leading:!1}));var V=new ResizeObserver(F),$=T.current.getBoundingClientRect(),U=$.width,z=$.height;return I(U,z),V.observe(T.current),function(){V.disconnect()}},[I,x]);var B=b.useMemo(function(){var F=O.containerWidth,V=O.containerHeight;if(F<0||V<0)return null;gu(Bh(a)||Bh(c),`The width(%s) and height(%s) are both fixed numbers,
4335       maybe you don't need to use a ResponsiveContainer.`,a,c),gu(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=Bh(a)?F:a,U=Bh(c)?V:c;r&&r>0&&($?U=$/r:U&&($=U*r),h&&U>h&&(U=h)),gu($>0||U>0,`The width(%s) and height(%s) of chart should be greater than 0,
4336       please check the style of container, or the props width(%s) and height(%s),
4337       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
4338       height and width.`,$,U,a,c,d,f,r);var z=!Array.isArray(m)&&mu(m.type).endsWith("Chart");return P.Children.map(m,function(L){return P.isValidElement(L)?b.cloneElement(L,jS({width:$,height:U},z?{style:jS({height:"100%",width:"100%",maxHeight:U,maxWidth:$},L.props.style)}:{})):L})},[r,m,c,h,f,d,O,a]);return P.createElement("div",{id:v?"".concat(v):void 0,className:Tt("recharts-responsive-container",_),style:jS(jS({},E),{},{width:a,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:T},B)}),mf=function(e){return null};mf.displayName="Cell";function Ob(t){"@babel/helpers - typeof";return Ob=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ob(t)}function Uee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function I5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uee(Object(r),!0).forEach(function(n){Gdt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uee(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Gdt(t,e,r){return e=Wdt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wdt(t){var e=Hdt(t,"string");return Ob(e)=="symbol"?e:e+""}function Hdt(t,e){if(Ob(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ob(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $m={widthCache:{},cacheCount:0},qdt=2e3,Ydt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Gee="recharts_measurement_span";function Kdt(t){var e=I5({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Rx=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||qf.isSsr)return{width:0,height:0};var n=Kdt(r),i=JSON.stringify({text:e,copyStyle:n});if($m.widthCache[i])return $m.widthCache[i];try{var s=document.getElementById(Gee);s||(s=document.createElement("span"),s.setAttribute("id",Gee),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var a=I5(I5({},Ydt),n);Object.assign(s.style,a),s.textContent="".concat(e);var o=s.getBoundingClientRect(),c={width:o.width,height:o.height};return $m.widthCache[i]=c,++$m.cacheCount>qdt&&($m.cacheCount=0,$m.widthCache={}),c}catch{return{width:0,height:0}}},Qdt=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Rb(t){"@babel/helpers - typeof";return Rb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rb(t)}function bC(t,e){return eft(t)||Jdt(t,e)||Xdt(t,e)||Zdt()}function Zdt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4339In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xdt(t,e){if(t){if(typeof t=="string")return Wee(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wee(t,e)}}function Wee(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jdt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}
vendor: 4,793 bytes, lines 4339-4340
4339finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function eft(t){if(Array.isArray(t))return t}function tft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nft(n.key),n)}}function rft(t,e,r){return e&&Hee(t.prototype,e),r&&Hee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nft(t){var e=ift(t,"string");return Rb(e)=="symbol"?e:e+""}function ift(t,e){if(Rb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Rb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var qee=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Yee=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sft=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,aft=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Qye={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},oft=Object.keys(Qye),ug="NaN";function lft(t,e){return t*Qye[e]}var NS=(function(){function t(e,r){tft(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!sft.test(r)&&(this.num=NaN,this.unit=""),oft.includes(r)&&(this.num=lft(e,r),this.unit="px")}return rft(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=aft.exec(r))!==null&&n!==void 0?n:[],s=bC(i,3),a=s[1],o=s[2];return new t(parseFloat(a),o??"")}}])})();function Zye(t){if(t.includes(ug))return ug;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=qee.exec(e))!==null&&r!==void 0?r:[],i=bC(n,4),s=i[1],a=i[2],o=i[3],c=NS.parse(s??""),u=NS.parse(o??""),d=a==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return ug;e=e.replace(qee,d.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,h=(f=Yee.exec(e))!==null&&f!==void 0?f:[],m=bC(h,4),y=m[1],x=m[2],v=m[3],_=NS.parse(y??""),S=NS.parse(v??""),k=x==="+"?_.add(S):_.subtract(S);if(k.isNaN())return ug;e=e.replace(Yee,k.toString())}return e}var Kee=/\(([^()]*)\)/;function cft(t){for(var e=t;e.includes("(");){var r=Kee.exec(e),n=bC(r,2),i=n[1];e=e.replace(Kee,Zye(i))}return e}function uft(t){var e=t.replace(/\s+/g,"");return e=cft(e),e=Zye(e),e}function dft(t){try{return uft(t)}catch{return ug}}function yI(t){var e=dft(t.slice(5,-1));return e===ug?"":e}var fft=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],hft=["dx","dy","angle","className","breakAll"];function L5(){return L5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},L5.apply(this,arguments)}function Qee(t,e){if(t==null)return{};var r=pft(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function pft(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Zee(t,e){return vft(t)||yft(t,e)||gft(t,e)||mft()}function mft(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4340In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gft(t,e){if(t){if(typeof t=="string")return Xee(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xee(t,e)}}function Xee(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yft(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}
4340finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function vft(t){if(Array.isArray(t))return t}var Xye=/[ \f\n\r\t\v\u2028\u2029]+/,Jye=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var s=[];Ut(r)||(n?s=r.toString().split(""):s=r.toString().split(Xye));var a=s.map(function(c){return{word:c,width:Rx(c,i).width}}),o=n?0:Rx(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}},xft=function(e,r,n,i,s){var a=e.maxLines,o=e.children,c=e.style,u=e.breakAll,d=Ge(a),f=o,h=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(U,z){var L=z.word,W=z.width,K=U[U.length-1];if(K&&(i==null||s||K.width+W+n<Number(i)))K.words.push(L),K.width+=W+n;else{var q={words:[L],width:W};U.push(q)}return U},[])},m=h(r),y=function($){return $.reduce(function(U,z){return U.width>z.width?U:z})};if(!d)return m;for(var x="…",v=function($){var U=f.slice(0,$),z=Jye({breakAll:u,style:c,children:U+x}).wordsWithComputedWidth,L=h(z),W=L.length>a||y(L).width>Number(i);return[W,L]},_=0,S=f.length-1,k=0,E;_<=S&&k<=f.length-1;){var T=Math.floor((_+S)/2),N=T-1,j=v(N),M=Zee(j,2),O=M[0],R=M[1],I=v(T),B=Zee(I,1),F=B[0];if(!O&&!F&&(_=T+1),O&&F&&(S=T-1),!O&&F){E=R;break}k++}return E||m},Jee=function(e){var r=Ut(e)?[]:e.toString().split(Xye);return[{words:r}]},bft=function(e){var r=e.width,n=e.scaleToFit,i=e.children,s=e.style,a=e.breakAll,o=e.maxLines;if((r||n)&&!qf.isSsr){var c,u,d=Jye({breakAll:a,children:i,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return Jee(i);return xft({breakAll:a,children:i,maxLines:o,style:s},c,u,r,n)}return Jee(i)},ete="#808080",wC=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,s=i===void 0?0:i,a=e.lineHeight,o=a===void 0?"1em":a,c=e.capHeight,u=c===void 0?"0.71em":c,d=e.scaleToFit,f=d===void 0?!1:d,h=e.textAnchor,m=h===void 0?"start":h,y=e.verticalAnchor,x=y===void 0?"end":y,v=e.fill,_=v===void 0?ete:v,S=Qee(e,fft),k=b.useMemo(function(){return bft({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:f,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,f,S.style,S.width]),E=S.dx,T=S.dy,N=S.angle,j=S.className,M=S.breakAll,O=Qee(S,hft);if(!Ti(n)||!Ti(s))return null;var R=n+(Ge(E)?E:0),I=s+(Ge(T)?T:0),B;switch(x){case"start":B=yI("calc(".concat(u,")"));break;case"middle":B=yI("calc(".concat((k.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:B=yI("calc(".concat(k.length-1," * -").concat(o,")"));break}var F=[];if(f){var V=k[0].width,$=S.width;F.push("scale(".concat((Ge($)?$/V:1)/V,")"))}return N&&F.push("rotate(".concat(N,", ").concat(R,", ").concat(I,")")),F.length&&(O.transform=F.join(" ")),P.createElement("text",L5({},Ht(O,!0),{x:R,y:I,className:Tt("recharts-text",j),textAnchor:m,fill:_.includes("url")?ete:_}),k.map(function(U,z){var L=U.words.join(M?"":" ");return P.createElement("tspan",{x:R,dy:z===0?B:o,key:"".concat(L,"-").concat(z)},L)}))};function gf(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wft(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function EU(t){let e,r,n;t.length!==2?(e=gf,r=(o,c)=>gf(t(o),c),n=(o,c)=>t(o)-c):(e=t===gf||t===wft?t:_ft,r=t,n=t);function i(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const f=u+d>>>1;r(o[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(o,c,u=0,d=o.length){if(u<d){if(e(c,c)!==0)return d;do{const f=u+d>>>1;r(o[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function a(o,c,u=0,d=o.length){const f=i(o,c,u,d-1);return f>u&&n(o[f-1],c)>-n(o[f],c)?f-1:f}return{left:i,center:a,right:s}}function _ft(){return 0}function e0e(t){return t===null?NaN:+t}function*Sft(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const kft=EU(gf),h1=kft.right;EU(e0e).center;class tte extends Map{constructor(e,r=Eft){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(rte(this,e))}has(e){return super.has(rte(this,e))}set(e,r){return super.set(Tft(this,e),r)}delete(e){return super.delete(Cft(this,e))}}function rte({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Tft({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Cft({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Eft(t){return t!==null&&typeof t=="object"?t.valueOf():t}function jft(t=gf){if(t===gf)return t0e;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function t0e(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const Nft=Math.sqrt(50),Pft=Math.sqrt(10),Mft=Math.sqrt(2);function _C(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),a=s>=Nft?10:s>=Pft?5:s>=Mft?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(t*u),c=Math.round(e*u),o/u<t&&++o,c/u>e&&--c,u=-u):(u=Math.pow(10,i)*a,o=Math.round(t/u),c=Math.round(e/u),o*u<t&&++o,c*u>e&&--c),c<o&&.5<=r&&r<2?_C(t,e,r*2):[o,c,u]}function $5(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,s,a]=n?_C(e,t,r):_C(t,e,r);
4340if(!(s>=i))return[];const o=s-i+1,c=new Array(o);if(n)if(a<0)for(let u=0;u<o;++u)c[u]=(s-u)/-a;else for(let u=0;u<o;++u)c[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)c[u]=(i+u)/-a;else for(let u=0;u<o;++u)c[u]=(i+u)*a;return c}function F5(t,e,r){return e=+e,t=+t,r=+r,_C(t,e,r)[2]}function z5(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?F5(e,t,r):F5(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function nte(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function ite(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function r0e(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=i===void 0?t0e:jft(i);n>r;){if(n-r>600){const c=n-r+1,u=e-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(e-u*f/c+h)),y=Math.min(n,Math.floor(e+(c-u)*f/c+h));r0e(t,e,m,y,i)}const s=t[e];let a=r,o=n;for(Ev(t,r,e),i(t[n],s)>0&&Ev(t,r,n);a<o;){for(Ev(t,a,o),++a,--o;i(t[a],s)<0;)++a;for(;i(t[o],s)>0;)--o}i(t[r],s)===0?Ev(t,r,o):(++o,Ev(t,o,n)),o<=e&&(r=o+1),e<=o&&(n=o-1)}return t}function Ev(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Aft(t,e,r){if(t=Float64Array.from(Sft(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return ite(t);if(e>=1)return nte(t);var n,i=(n-1)*e,s=Math.floor(i),a=nte(r0e(t,s).subarray(0,s+1)),o=ite(t.subarray(s+1));return a+(o-a)*(i-s)}}function Dft(t,e,r=e0e){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,s=Math.floor(i),a=+r(t[s],s,t),o=+r(t[s+1],s+1,t);return a+(o-a)*(i-s)}}function Oft(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,s=new Array(i);++n<i;)s[n]=t+n*r;return s}function Vo(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function rd(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const B5=Symbol("implicit");function jU(){var t=new tte,e=[],r=[],n=B5;function i(s){let a=t.get(s);if(a===void 0){if(n!==B5)return n;t.set(s,a=e.push(s)-1)}return r[a%r.length]}return i.domain=function(s){if(!arguments.length)return e.slice();e=[],t=new tte;for(const a of s)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return jU(e,r).unknown(n)},Vo.apply(i,arguments),i}function Ib(){var t=jU().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,s,a,o=!1,c=0,u=0,d=.5;delete t.unknown;function f(){var h=e().length,m=i<n,y=m?i:n,x=m?n:i;s=(x-y)/Math.max(1,h-c+u*2),o&&(s=Math.floor(s)),y+=(x-y-s*(h-c))*d,a=s*(1-c),o&&(y=Math.round(y),a=Math.round(a));var v=Oft(h).map(function(_){return y+s*_});return r(m?v.reverse():v)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([n,i]=h,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(h){return[n,i]=h,n=+n,i=+i,o=!0,f()},t.bandwidth=function(){return a},t.step=function(){return s},t.round=function(h){return arguments.length?(o=!!h,f()):o},t.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},t.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},t.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},t.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},t.copy=function(){return Ib(e(),[n,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Vo.apply(f(),arguments)}function n0e(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return n0e(e())},t}function Ix(){return n0e(Ib.apply(null,arguments).paddingInner(1))}function NU(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function i0e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function p1(){}var Lb=.7,SC=1/Lb,Ng="\\s*([+-]?\\d+)\\s*",$b="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rft=/^#([0-9a-f]{3,8})$/,Ift=new RegExp(`^rgb\\(${Ng},${Ng},${Ng}\\)$`),Lft=new RegExp(`^rgb\\(${sc},${sc},${sc}\\)$`),$ft=new RegExp(`^rgba\\(${Ng},${Ng},${Ng},${$b}\\)$`),Fft=new RegExp(`^rgba\\(${sc},${sc},${sc},${$b}\\)$`),zft=new RegExp(`^hsl\\(${$b},${sc},${sc}\\)$`),Bft=new RegExp(`^hsla\\(${$b},${sc},${sc},${$b}\\)$`),ste={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};NU(p1,Fb,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ate,formatHex:ate,formatHex8:Vft,formatHsl:Uft,formatRgb:ote,toString:ote});function ate(){return this.rgb().formatHex()}function Vft(){return this.rgb().formatHex8()}function Uft(){return s0e(this).formatHsl()}function ote(){return this.rgb().formatRgb()}function Fb(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Rft.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?lte(e):r===3?new aa(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?PS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?PS(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ift.exec(t))?new aa(e[1],e[2],e[3],1):(e=Lft.exec(t))?new aa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=$ft.exec(t))?PS(e[1],e[2],e[3],e[4]):(e=Fft.exec(t))?PS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=zft.exec(t))?dte(e[1],e[2]/100,e[3]/100,1):(e=Bft.exec(t))?dte(e[1],e[2]/100,e[3]/100,e[4]):ste.hasOwnProperty(t)?lte(ste[t]):t==="transparent"?new aa(NaN,NaN,NaN,0):null}function lte(t){return new aa(t>>16&255,t>>8&255,t&255,1)}function PS(t,e,r,n){return n<=0&&(t=e=r=NaN),new aa(t,e,r,n)}function Gft(t){return t instanceof p1||(t=Fb(t)),t?(t=t.rgb(),new aa(t.r,t.g,t.b,t.opacity)):new aa}function V5(t,e,r,n){return arguments.length===1?Gft(t):new aa(t,e,r,n??1)}function aa(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}NU(aa,V5,i0e(p1,{brighter(t){return t=t==null?SC:Math.pow(SC,t),new aa(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Lb:Math.pow(Lb,t),new aa(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new aa(np(this.r),np(this.g),np(this.b),kC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cte,formatHex:cte,formatHex8:Wft,formatRgb:ute,toString:ute}));function cte(){return`#${Vh(this.r)}${Vh(this.g)}${Vh(this.b)}`}function Wft(){return`#${Vh(this.r)}${Vh(this.g)}${Vh(this.b)}${Vh((isNaN(this.opacity)?1:this.opacity)*255)}`}function ute(){const t=kC(this.opacity);return`${t===1?"rgb(":"rgba("}${np(this.r)}, ${np(this.g)}, ${np(this.b)}${t===1?")":`, ${t})`}`}function kC(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function np(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vh(t){return t=np(t),(t<16?"0":"")+t.toString(16)}function dte(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new sl(t,e,r,n)}function s0e(t){if(t instanceof sl)return new sl(t.h,t.s,t.l,t.opacity);if(t instanceof p1||(t=Fb(t)),!t)return new sl;if(t instanceof sl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),a=NaN,o=s-i,c=(s+i)/2;return o?(e===s?a=(r-n)/o+(r<n)*6:r===s?a=(n-e)/o+2:a=(e-r)/o+4,o/=c<.5?s+i:2-s-i,a*=60):o=c>0&&c<1?0:a,new sl(a,o,c,t.opacity)}function Hft(t,e,r,n){return arguments.length===1?s0e(t):new sl(t,e,r,n??1)}function sl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}NU(sl,Hft,i0e(p1,{brighter(t){return t=t==null?SC:Math.pow(SC,t),new sl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Lb:Math.pow(Lb,t),new sl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new aa(vI(t>=240?t-240:t+120,i,n),vI(t,i,n),vI(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new sl(fte(this.h),MS(this.s),MS(this.l),kC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=kC(this.opacity);return`${t===1?"hsl(":"hsla("}${fte(this.h)}, ${MS(this.s)*100}%, ${MS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fte(t){return t=(t||0)%360,t<0?t+360:t}
vendor: 11,416 bytes, line 4340
4340function MS(t){return Math.max(0,Math.min(1,t||0))}function vI(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const PU=t=>()=>t;function qft(t,e){return function(r){return t+r*e}}function Yft(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Kft(t){return(t=+t)==1?a0e:function(e,r){return r-e?Yft(e,r,t):PU(isNaN(e)?r:e)}}function a0e(t,e){var r=e-t;return r?qft(t,r):PU(isNaN(t)?e:t)}const hte=(function t(e){var r=Kft(e);function n(i,s){var a=r((i=V5(i)).r,(s=V5(s)).r),o=r(i.g,s.g),c=r(i.b,s.b),u=a0e(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return n.gamma=t,n})(1);function Qft(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=t[i]*(1-s)+e[i]*s;return n}}function Zft(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Xft(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),s=new Array(r),a;for(a=0;a<n;++a)i[a]=h0(t[a],e[a]);for(;a<r;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=i[a](o);return s}}function Jft(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function TC(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function eht(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=h0(t[i],e[i]):n[i]=e[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var U5=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xI=new RegExp(U5.source,"g");function tht(t){return function(){return t}}function rht(t){return function(e){return t(e)+""}}function nht(t,e){var r=U5.lastIndex=xI.lastIndex=0,n,i,s,a=-1,o=[],c=[];for(t=t+"",e=e+"";(n=U5.exec(t))&&(i=xI.exec(e));)(s=i.index)>r&&(s=e.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:TC(n,i)})),r=xI.lastIndex;return r<e.length&&(s=e.slice(r),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?rht(c[0].x):tht(e):(e=c.length,function(u){for(var d=0,f;d<e;++d)o[(f=c[d]).i]=f.x(u);return o.join("")})}function h0(t,e){var r=typeof e,n;return e==null||r==="boolean"?PU(e):(r==="number"?TC:r==="string"?(n=Fb(e))?(e=n,hte):nht:e instanceof Fb?hte:e instanceof Date?Jft:Zft(e)?Qft:Array.isArray(e)?Xft:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?eht:TC)(t,e)}function MU(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function iht(t,e){e===void 0&&(e=t,t=h0);for(var r=0,n=e.length-1,i=e[0],s=new Array(n<0?0:n);r<n;)s[r]=t(i,i=e[++r]);return function(a){var o=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return s[o](a-o)}}function sht(t){return function(){return t}}function CC(t){return+t}var pte=[0,1];function Fs(t){return t}function G5(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:sht(isNaN(e)?NaN:.5)}function aht(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function oht(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i<n?(n=G5(i,n),s=r(a,s)):(n=G5(n,i),s=r(s,a)),function(o){return s(n(o))}}function lht(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),s=new Array(n),a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)i[a]=G5(t[a],t[a+1]),s[a]=r(e[a],e[a+1]);return function(o){var c=h1(t,o,1,n)-1;return s[c](i[c](o))}}function m1(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function AN(){var t=pte,e=pte,r=h0,n,i,s,a=Fs,o,c,u;function d(){var h=Math.min(t.length,e.length);return a!==Fs&&(a=aht(t[0],t[h-1])),o=h>2?lht:oht,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=o(t.map(n),e,r)))(n(a(h)))}return f.invert=function(h){return a(i((u||(u=o(e,t.map(n),TC)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,CC),d()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),r=MU,d()},f.clamp=function(h){return arguments.length?(a=h?!0:Fs,d()):a!==Fs},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,m){return n=h,i=m,d()}}function AU(){return AN()(Fs,Fs)}function cht(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function EC(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function hy(t){return t=EC(Math.abs(t)),t?t[1]:NaN}function uht(t,e){return function(r,n){for(var i=r.length,s=[],a=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>n&&(o=Math.max(1,n-c)),s.push(r.substring(i-=o,i+o)),!((c+=o+1)>n));)o=t[a=(a+1)%t.length];return s.reverse().join(e)}}function dht(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var fht=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zb(t){if(!(e=fht.exec(t)))throw new Error("invalid format: "+t);var e;return new DU({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}zb.prototype=DU.prototype;function DU(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}DU.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function hht(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var o0e;function pht(t,e){var r=EC(t,e);if(!r)return t+"";var n=r[0],i=r[1],s=i-(o0e=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+EC(t,Math.max(0,e+s-1))[0]}function mte(t,e){var r=EC(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const gte={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:cht,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>mte(t*100,e),r:mte,s:pht,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function yte(t){return t}var vte=Array.prototype.map,xte=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mht(t){var e=t.grouping===void 0||t.thousands===void 0?yte:uht(vte.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?yte:dht(vte.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(f){f=zb(f);var h=f.fill,m=f.align,y=f.sign,x=f.symbol,v=f.zero,_=f.width,S=f.comma,k=f.precision,E=f.trim,T=f.type;T==="n"?(S=!0,T="g"):gte[T]||(k===void 0&&(k=12),E=!0,T="g"),(v||h==="0"&&m==="=")&&(v=!0,h="0",m="=");var N=x==="$"?r:x==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",j=x==="$"?n:/[%p]/.test(T)?a:"",M=gte[T],O=/[defgprs%]/.test(T);k=k===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function R(I){var B=N,F=j,V,$,U;if(T==="c")F=M(I)+F,I="";else{I=+I;var z=I<0||1/I<0;if(I=isNaN(I)?c:M(Math.abs(I),k),E&&(I=hht(I)),z&&+I==0&&y!=="+"&&(z=!1),B=(z?y==="("?y:o:y==="-"||y==="("?"":y)+B,F=(T==="s"?xte[8+o0e/3]:"")+F+(z&&y==="("?")":""),O){for(V=-1,$=I.length;++V<$;)if(U=I.charCodeAt(V),48>U||U>57){F=(U===46?i+I.slice(V+1):I.slice(V))+F,I=I.slice(0,V);break}}}S&&!v&&(I=e(I,1/0));var L=B.length+I.length+F.length,W=L<_?new Array(_-L+1).join(h):"";switch(S&&v&&(I=e(W+I,W.length?_-F.length:1/0),W=""),m){case"<":I=B+I+F+W;break;case"=":I=B+W+I+F;break;case"^":I=W.slice(0,L=W.length>>1)+B+I+F+W.slice(L);break;default:I=W+B+I+F;break}return s(I)}return R.toString=function(){return f+""},R}function d(f,h){var m=u((f=zb(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(hy(h)/3)))*3,x=Math.pow(10,-y),v=xte[8+y/3];return function(_){return m(x*_)+v}}return{format:u,formatPrefix:d}}var AS,OU,l0e;ght({thousands:",",grouping:[3],currency:["$",""]});function ght(t){return AS=mht(t),OU=AS.format,l0e=AS.formatPrefix,AS}function yht(t){return Math.max(0,-hy(Math.abs(t)))}function vht(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hy(e)/3)))*3-hy(Math.abs(t)))}function xht(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,hy(e)-hy(t))+1}function c0e(t,e,r,n){var i=z5(t,e,r),s;switch(n=zb(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=vht(i,a))&&(n.precision=s),l0e(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=xht(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=yht(i))&&(n.precision=s-(n.type==="%")*2);break}}return OU(n)}function Yf(t){var e=t.domain;return t.ticks=function(r){var n=e();return $5(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return c0e(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,s=n.length-1,a=n[i],o=n[s],c,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=F5(a,o,r),u===c)return n[i]=a,n[s]=o,e(n);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;c=u}return t},t}function jC(){var t=AU();return t.copy=function(){return m1(t,jC())},Vo.apply(t,arguments),Yf(t)}function u0e(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,CC),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return u0e(t).unknown(e)},t=arguments.length?Array.from(t,CC):[0,1],Yf(r)}function d0e(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],s=t[n],a;return s<i&&(a=r,r=n,n=a,a=i,i=s,s=a),t[r]=e.floor(i),t[n]=e.ceil(s),t}function bte(t){return Math.log(t)}function wte(t){return Math.exp(t)}function bht(t){return-Math.log(-t)}function wht(t){return-Math.exp(-t)}function _ht(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Sht(t){return t===10?_ht:t===Math.E?Math.exp:e=>Math.pow(t,e)}function kht(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function _te(t){return(e,r)=>-t(-e,r)}function RU(t){const e=t(bte,wte),r=e.domain;let n=10,i,s;function a(){return i=kht(n),s=Sht(n),r()[0]<0?(i=_te(i),s=_te(s),t(bht,wht)):t(bte,wte),e}return e.base=function(o){return arguments.length?(n=+o,a()):n},e.domain=function(o){return arguments.length?(r(o),a()):r()},e.ticks=o=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=i(u),m=i(d),y,x;const v=o==null?10:+o;let _=[];
vendor: 4,919 bytes, line 4340
4340if(!(n%1)&&m-h<v){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(y=1;y<n;++y)if(x=h<0?y/s(-h):y*s(h),!(x<u)){if(x>d)break;_.push(x)}}else for(;h<=m;++h)for(y=n-1;y>=1;--y)if(x=h>0?y/s(-h):y*s(h),!(x<u)){if(x>d)break;_.push(x)}_.length*2<v&&(_=$5(u,d,v))}else _=$5(h,m,Math.min(m-h,v)).map(s);return f?_.reverse():_},e.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=zb(c)).precision==null&&(c.trim=!0),c=OU(c)),o===1/0)return c;const u=Math.max(1,n*o/e.ticks().length);return d=>{let f=d/s(Math.round(i(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},e.nice=()=>r(d0e(r(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),e}function f0e(){const t=RU(AN()).domain([1,10]);return t.copy=()=>m1(t,f0e()).base(t.base()),Vo.apply(t,arguments),t}function Ste(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function kte(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function IU(t){var e=1,r=t(Ste(e),kte(e));return r.constant=function(n){return arguments.length?t(Ste(e=+n),kte(e)):e},Yf(r)}function h0e(){var t=IU(AN());return t.copy=function(){return m1(t,h0e()).constant(t.constant())},Vo.apply(t,arguments)}function Tte(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Tht(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Cht(t){return t<0?-t*t:t*t}function LU(t){var e=t(Fs,Fs),r=1;function n(){return r===1?t(Fs,Fs):r===.5?t(Tht,Cht):t(Tte(r),Tte(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Yf(e)}function $U(){var t=LU(AN());return t.copy=function(){return m1(t,$U()).exponent(t.exponent())},Vo.apply(t,arguments),t}function Eht(){return $U.apply(null,arguments).exponent(.5)}function Cte(t){return Math.sign(t)*t*t}function jht(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function p0e(){var t=AU(),e=[0,1],r=!1,n;function i(s){var a=jht(t(s));return isNaN(a)?n:r?Math.round(a):a}return i.invert=function(s){return t.invert(Cte(s))},i.domain=function(s){return arguments.length?(t.domain(s),i):t.domain()},i.range=function(s){return arguments.length?(t.range((e=Array.from(s,CC)).map(Cte)),i):e.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(t.clamp(s),i):t.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return p0e(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Vo.apply(i,arguments),Yf(i)}function m0e(){var t=[],e=[],r=[],n;function i(){var a=0,o=Math.max(1,e.length);for(r=new Array(o-1);++a<o;)r[a-1]=Dft(t,a/o);return s}function s(a){return a==null||isNaN(a=+a)?n:e[h1(r,a)]}return s.invertExtent=function(a){var o=e.indexOf(a);return o<0?[NaN,NaN]:[o>0?r[o-1]:t[0],o<r.length?r[o]:t[t.length-1]]},s.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let o of a)o!=null&&!isNaN(o=+o)&&t.push(o);return t.sort(gf),i()},s.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return m0e().domain(t).range(e).unknown(n)},Vo.apply(s,arguments)}function g0e(){var t=0,e=1,r=1,n=[.5],i=[0,1],s;function a(c){return c!=null&&c<=c?i[h1(n,c,0,r)]:s}function o(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*e-(c-r)*t)/(r+1);return a}return a.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,o()):[t,e]},a.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,o()):i.slice()},a.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[t,n[0]]:u>=r?[n[r-1],e]:[n[u-1],n[u]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return n.slice()},a.copy=function(){return g0e().domain([t,e]).range(i).unknown(s)},Vo.apply(Yf(a),arguments)}function y0e(){var t=[.5],e=[0,1],r,n=1;function i(s){return s!=null&&s<=s?e[h1(t,s,0,n)]:r}return i.domain=function(s){return arguments.length?(t=Array.from(s),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(s){return arguments.length?(e=Array.from(s),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(s){var a=e.indexOf(s);return[t[a-1],t[a]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return y0e().domain(t).range(e).unknown(r)},Vo.apply(i,arguments)}const bI=new Date,wI=new Date;function ji(t,e,r,n){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const c=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let u;do c.push(u=new Date(+s)),e(s,o),t(s);while(u<s&&s<a);return c},i.filter=s=>ji(a=>
vendor: 5,260 bytes, line 4340
4340{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;e(a,-1),!s(a););else for(;--o>=0;)for(;e(a,1),!s(a););}),r&&(i.count=(s,a)=>(bI.setTime(+s),wI.setTime(+a),t(bI),t(wI),Math.floor(r(bI,wI))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?a=>n(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const NC=ji(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);NC.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ji(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):NC);NC.range;const au=1e3,bo=au*60,ou=bo*60,Bu=ou*24,FU=Bu*7,Ete=Bu*30,_I=Bu*365,Uh=ji(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*au)},(t,e)=>(e-t)/au,t=>t.getUTCSeconds());Uh.range;const zU=ji(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*au)},(t,e)=>{t.setTime(+t+e*bo)},(t,e)=>(e-t)/bo,t=>t.getMinutes());zU.range;const BU=ji(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*bo)},(t,e)=>(e-t)/bo,t=>t.getUTCMinutes());BU.range;const VU=ji(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*au-t.getMinutes()*bo)},(t,e)=>{t.setTime(+t+e*ou)},(t,e)=>(e-t)/ou,t=>t.getHours());VU.range;const UU=ji(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*ou)},(t,e)=>(e-t)/ou,t=>t.getUTCHours());UU.range;const g1=ji(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*bo)/Bu,t=>t.getDate()-1);g1.range;const DN=ji(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Bu,t=>t.getUTCDate()-1);DN.range;const v0e=ji(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Bu,t=>Math.floor(t/Bu));v0e.range;function Jp(t){return ji(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*bo)/FU)}const ON=Jp(0),PC=Jp(1),Nht=Jp(2),Pht=Jp(3),py=Jp(4),Mht=Jp(5),Aht=Jp(6);ON.range;PC.range;Nht.range;Pht.range;py.range;Mht.range;Aht.range;function em(t){return ji(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/FU)}const RN=em(0),MC=em(1),Dht=em(2),Oht=em(3),my=em(4),Rht=em(5),Iht=em(6);RN.range;MC.range;Dht.range;Oht.range;my.range;Rht.range;Iht.range;const GU=ji(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());GU.range;const WU=ji(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());WU.range;const Vu=ji(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Vu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ji(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Vu.range;const Uu=ji(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Uu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ji(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Uu.range;function x0e(t,e,r,n,i,s){const a=[[Uh,1,au],[Uh,5,5*au],[Uh,15,15*au],[Uh,30,30*au],[s,1,bo],[s,5,5*bo],[s,15,15*bo],[s,30,30*bo],[i,1,ou],[i,3,3*ou],[i,6,6*ou],[i,12,12*ou],[n,1,Bu],[n,2,2*Bu],[r,1,FU],[e,1,Ete],[e,3,3*Ete],[t,1,_I]];function o(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),y=m?m.range(u,+d+1):[];return h?y.reverse():y}function c(u,d,f){const h=Math.abs(d-u)/f,m=EU(([,,v])=>v).right(a,h);if(m===a.length)return t.every(z5(u/_I,d/_I,f));if(m===0)return NC.every(Math.max(z5(u,d,f),1));const[y,x]=a[h/a[m-1][2]<a[m][2]/h?m-1:m];return y.every(x)}return[o,c]}const[Lht,$ht]=x0e(Uu,WU,RN,v0e,UU,BU),[Fht,zht]=x0e(Vu,GU,ON,g1,VU,zU);function SI(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function kI(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function jv(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function Bht(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,s=t.days,a=t.shortDays,o=t.months,c=t.shortMonths,u=Nv(i),d=Pv(i),f=Nv(s),h=Pv(s),m=Nv(a),y=Pv(a),x=Nv(o),v=Pv(o),_=Nv(c),S=Pv(c),k={a:z,A:L,b:W,B:K,c:null,d:Dte,e:Dte,f:upt,g:bpt,G:_pt,H:opt,I:lpt,j:cpt,L:b0e,m:dpt,M:fpt,p:q,q:H,Q:Ite,s:Lte,S:hpt,u:ppt,U:mpt,V:gpt,w:ypt,W:vpt,x:null,X:null,y:xpt,Y:wpt,Z:Spt,"%":Rte},E={a:Y,A:J,b:re,B:me,c:null,d:Ote,e:Ote,f:Ept,g:Lpt,G:Fpt,H:kpt,I:Tpt,j:Cpt,L:_0e,m:jpt,M:Npt,p:oe,q:ge,Q:Ite,s:Lte,S:Ppt,u:Mpt,U:Apt,V:Dpt,w:Opt,W:Rpt,x:null,X:null,y:Ipt,Y:$pt,Z:zpt,"%":Rte},T={a:R,A:I,b:B,B:F,c:V,d:Mte,e:Mte,f:npt,g:Pte,G:Nte,H:Ate,I:Ate,j:Jht,L:rpt,m:Xht,M:ept,p:O,q:Zht,Q:spt,s:apt,S:tpt,u:Hht,U:qht,V:Yht,w:Wht,W:Kht,x:$,X:U,y:Pte,Y:Nte,Z:Qht,"%":ipt};
vendor: 7,335 bytes, line 4340
4340k.x=N(r,k),k.X=N(n,k),k.c=N(e,k),E.x=N(r,E),E.X=N(n,E),E.c=N(e,E);function N(le,Se){return function(Ce){var he=[],Ct=-1,De=0,It=le.length,Yt,Qt,Qr;for(Ce instanceof Date||(Ce=new Date(+Ce));++Ct<It;)le.charCodeAt(Ct)===37&&(he.push(le.slice(De,Ct)),(Qt=jte[Yt=le.charAt(++Ct)])!=null?Yt=le.charAt(++Ct):Qt=Yt==="e"?" ":"0",(Qr=Se[Yt])&&(Yt=Qr(Ce,Qt)),he.push(Yt),De=Ct+1);return he.push(le.slice(De,Ct)),he.join("")}}function j(le,Se){return function(Ce){var he=jv(1900,void 0,1),Ct=M(he,le,Ce+="",0),De,It;if(Ct!=Ce.length)return null;if("Q"in he)return new Date(he.Q);if("s"in he)return new Date(he.s*1e3+("L"in he?he.L:0));if(Se&&!("Z"in he)&&(he.Z=0),"p"in he&&(he.H=he.H%12+he.p*12),he.m===void 0&&(he.m="q"in he?he.q:0),"V"in he){if(he.V<1||he.V>53)return null;"w"in he||(he.w=1),"Z"in he?(De=kI(jv(he.y,0,1)),It=De.getUTCDay(),De=It>4||It===0?MC.ceil(De):MC(De),De=DN.offset(De,(he.V-1)*7),he.y=De.getUTCFullYear(),he.m=De.getUTCMonth(),he.d=De.getUTCDate()+(he.w+6)%7):(De=SI(jv(he.y,0,1)),It=De.getDay(),De=It>4||It===0?PC.ceil(De):PC(De),De=g1.offset(De,(he.V-1)*7),he.y=De.getFullYear(),he.m=De.getMonth(),he.d=De.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),It="Z"in he?kI(jv(he.y,0,1)).getUTCDay():SI(jv(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(It+5)%7:he.w+he.U*7-(It+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,kI(he)):SI(he)}}function M(le,Se,Ce,he){for(var Ct=0,De=Se.length,It=Ce.length,Yt,Qt;Ct<De;){if(he>=It)return-1;if(Yt=Se.charCodeAt(Ct++),Yt===37){if(Yt=Se.charAt(Ct++),Qt=T[Yt in jte?Se.charAt(Ct++):Yt],!Qt||(he=Qt(le,Ce,he))<0)return-1}else if(Yt!=Ce.charCodeAt(he++))return-1}return he}function O(le,Se,Ce){var he=u.exec(Se.slice(Ce));return he?(le.p=d.get(he[0].toLowerCase()),Ce+he[0].length):-1}function R(le,Se,Ce){var he=m.exec(Se.slice(Ce));return he?(le.w=y.get(he[0].toLowerCase()),Ce+he[0].length):-1}function I(le,Se,Ce){var he=f.exec(Se.slice(Ce));return he?(le.w=h.get(he[0].toLowerCase()),Ce+he[0].length):-1}function B(le,Se,Ce){var he=_.exec(Se.slice(Ce));return he?(le.m=S.get(he[0].toLowerCase()),Ce+he[0].length):-1}function F(le,Se,Ce){var he=x.exec(Se.slice(Ce));return he?(le.m=v.get(he[0].toLowerCase()),Ce+he[0].length):-1}function V(le,Se,Ce){return M(le,e,Se,Ce)}function $(le,Se,Ce){return M(le,r,Se,Ce)}function U(le,Se,Ce){return M(le,n,Se,Ce)}function z(le){return a[le.getDay()]}function L(le){return s[le.getDay()]}function W(le){return c[le.getMonth()]}function K(le){return o[le.getMonth()]}function q(le){return i[+(le.getHours()>=12)]}function H(le){return 1+~~(le.getMonth()/3)}function Y(le){return a[le.getUTCDay()]}function J(le){return s[le.getUTCDay()]}function re(le){return c[le.getUTCMonth()]}function me(le){return o[le.getUTCMonth()]}function oe(le){return i[+(le.getUTCHours()>=12)]}function ge(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var Se=N(le+="",k);return Se.toString=function(){return le},Se},parse:function(le){var Se=j(le+="",!1);return Se.toString=function(){return le},Se},utcFormat:function(le){var Se=N(le+="",E);return Se.toString=function(){return le},Se},utcParse:function(le){var Se=j(le+="",!0);return Se.toString=function(){return le},Se}}}var jte={"-":"",_:" ",0:"0"},Fi=/^\s*\d+/,Vht=/^%/,Uht=/[\\^$*+?|[\]().{}]/g;function kr(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(e)+i:i)}function Ght(t){return t.replace(Uht,"\\$&")}function Nv(t){return new RegExp("^(?:"+t.map(Ght).join("|")+")","i")}function Pv(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function Wht(t,e,r){var n=Fi.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Hht(t,e,r){var n=Fi.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function qht(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Yht(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Kht(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Nte(t,e,r){var n=Fi.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Pte(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Qht(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Zht(t,e,r){var n=Fi.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Xht(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Mte(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Jht(t,e,r){var n=Fi.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ate(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ept(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function tpt(t,e,r){var n=Fi.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function rpt(t,e,r){var n=Fi.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function npt(t,e,r){var n=Fi.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ipt(t,e,r){var n=Vht.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function spt(t,e,r){var n=Fi.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function apt(t,e,r){var n=Fi.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Dte(t,e){return kr(t.getDate(),e,2)}function opt(t,e){return kr(t.getHours(),e,2)}function lpt(t,e){return kr(t.getHours()%12||12,e,2)}function cpt(t,e){return kr(1+g1.count(Vu(t),t),e,3)}function b0e(t,e){return kr(t.getMilliseconds(),e,3)}function upt(t,e){return b0e(t,e)+"000"}function dpt(t,e){return kr(t.getMonth()+1,e,2)}function fpt(t,e){return kr(t.getMinutes(),e,2)}function hpt(t,e){return kr(t.getSeconds(),e,2)}function ppt(t){var e=t.getDay();return e===0?7:e}function mpt(t,e){return kr(ON.count(Vu(t)-1,t),e,2)}function w0e(t){var e=t.getDay();return e>=4||e===0?py(t):py.ceil(t)}function gpt(t,e){return t=w0e(t),kr(py.count(Vu(t),t)+(Vu(t).getDay()===4),e,2)}function ypt(t){return t.getDay()}function vpt(t,e){return kr(PC.count(Vu(t)-1,t),e,2)}function xpt(t,e){return kr(t.getFullYear()%100,e,2)}function bpt(t,e){return t=w0e(t),kr(t.getFullYear()%100,e,2)}function wpt(t,e){return kr(t.getFullYear()%1e4,e,4)}function _pt(t,e){var r=t.getDay();return t=r>=4||r===0?py(t):py.ceil(t),kr(t.getFullYear()%1e4,e,4)}function Spt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+kr(e/60|0,"0",2)+kr(e%60,"0",2)}function Ote(t,e){return kr(t.getUTCDate(),e,2)}function kpt(t,e){return kr(t.getUTCHours(),e,2)}function Tpt(t,e){return kr(t.getUTCHours()%12||12,e,2)}function Cpt(t,e){return kr(1+DN.count(Uu(t),t),e,3)}function _0e(t,e){return kr(t.getUTCMilliseconds(),e,3)}function Ept(t,e){return _0e(t,e)+"000"}function jpt(t,e){return kr(t.getUTCMonth()+1,e,2)}function Npt(t,e){return kr(t.getUTCMinutes(),e,2)}function Ppt(t,e){return kr(t.getUTCSeconds(),e,2)}function Mpt(t){var e=t.getUTCDay();return e===0?7:e}function Apt(t,e){return kr(RN.count(Uu(t)-1,t),e,2)}function S0e(t){var e=t.getUTCDay();return e>=4||e===0?my(t):my.ceil(t)}function Dpt(t,e){return t=S0e(t),kr(my.count(Uu(t),t)+(Uu(t).getUTCDay()===4),e,2)}function Opt(t){return t.getUTCDay()}
4340function Rpt(t,e){return kr(MC.count(Uu(t)-1,t),e,2)}function Ipt(t,e){return kr(t.getUTCFullYear()%100,e,2)}function Lpt(t,e){return t=S0e(t),kr(t.getUTCFullYear()%100,e,2)}function $pt(t,e){return kr(t.getUTCFullYear()%1e4,e,4)}function Fpt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?my(t):my.ceil(t),kr(t.getUTCFullYear()%1e4,e,4)}function zpt(){return"+0000"}function Rte(){return"%"}function Ite(t){return+t}function Lte(t){return Math.floor(+t/1e3)}var Fm,k0e,T0e;Bpt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Bpt(t){return Fm=Bht(t),k0e=Fm.format,Fm.parse,T0e=Fm.utcFormat,Fm.utcParse,Fm}function Vpt(t){return new Date(t)}function Upt(t){return t instanceof Date?+t:+new Date(+t)}function HU(t,e,r,n,i,s,a,o,c,u){var d=AU(),f=d.invert,h=d.domain,m=u(".%L"),y=u(":%S"),x=u("%I:%M"),v=u("%I %p"),_=u("%a %d"),S=u("%b %d"),k=u("%B"),E=u("%Y");function T(N){return(c(N)<N?m:o(N)<N?y:a(N)<N?x:s(N)<N?v:n(N)<N?i(N)<N?_:S:r(N)<N?k:E)(N)}return d.invert=function(N){return new Date(f(N))},d.domain=function(N){return arguments.length?h(Array.from(N,Upt)):h().map(Vpt)},d.ticks=function(N){var j=h();return t(j[0],j[j.length-1],N??10)},d.tickFormat=function(N,j){return j==null?T:u(j)},d.nice=function(N){var j=h();return(!N||typeof N.range!="function")&&(N=e(j[0],j[j.length-1],N??10)),N?h(d0e(j,N)):d},d.copy=function(){return m1(d,HU(t,e,r,n,i,s,a,o,c,u))},d}function Gpt(){return Vo.apply(HU(Fht,zht,Vu,GU,ON,g1,VU,zU,Uh,k0e).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Wpt(){return Vo.apply(HU(Lht,$ht,Uu,WU,RN,DN,UU,BU,Uh,T0e).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function IN(){var t=0,e=1,r,n,i,s,a=Fs,o=!1,c;function u(f){return f==null||isNaN(f=+f)?c:a(i===0?.5:(f=(s(f)-r)*i,o?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,r=s(t=+t),n=s(e=+e),i=r===n?0:1/(n-r),u):[t,e]},u.clamp=function(f){return arguments.length?(o=!!f,u):o},u.interpolator=function(f){return arguments.length?(a=f,u):a};function d(f){return function(h){var m,y;return arguments.length?([m,y]=h,a=f(m,y),u):[a(0),a(1)]}}return u.range=d(h0),u.rangeRound=d(MU),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),u}}function Kf(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function C0e(){var t=Yf(IN()(Fs));return t.copy=function(){return Kf(t,C0e())},rd.apply(t,arguments)}function E0e(){var t=RU(IN()).domain([1,10]);return t.copy=function(){return Kf(t,E0e()).base(t.base())},rd.apply(t,arguments)}function j0e(){var t=IU(IN());return t.copy=function(){return Kf(t,j0e()).constant(t.constant())},rd.apply(t,arguments)}function qU(){var t=LU(IN());return t.copy=function(){return Kf(t,qU()).exponent(t.exponent())},rd.apply(t,arguments)}function Hpt(){return qU.apply(null,arguments).exponent(.5)}function N0e(){var t=[],e=Fs;function r(n){if(n!=null&&!isNaN(n=+n))return e((h1(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let i of n)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(gf),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,i)=>e(i/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>Aft(t,s/n))},r.copy=function(){return N0e(e).domain(t)},rd.apply(r,arguments)}function LN(){var t=0,e=.5,r=1,n=1,i,s,a,o,c,u=Fs,d,f=!1,h;function m(x){return isNaN(x=+x)?h:(x=.5+((x=+d(x))-s)*(n*x<n*s?o:c),u(f?Math.max(0,Math.min(1,x)):x))}m.domain=function(x){return arguments.length?([t,e,r]=x,i=d(t=+t),s=d(e=+e),a=d(r=+r),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),n=s<i?-1:1,m):[t,e,r]},m.clamp=function(x){return arguments.length?(f=!!x,m):f},m.interpolator=function(x){return arguments.length?(u=x,m):u};function y(x){return function(v){var _,S,k;return arguments.length?([_,S,k]=v,u=iht(x,[_,S,k]),m):[u(0),u(.5),u(1)]}}return m.range=y(h0),m.rangeRound=y(MU),m.unknown=function(x){return arguments.length?(h=x,m):h},function(x){return d=x,i=x(t),s=x(e),a=x(r),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),n=s<i?-1:1,m}}function P0e(){var t=Yf(LN()(Fs));return t.copy=function(){return Kf(t,P0e())},rd.apply(t,arguments)}function M0e(){var t=RU(LN()).domain([.1,1,10]);return t.copy=function(){return Kf(t,M0e()).base(t.base())},rd.apply(t,arguments)}function A0e(){var t=IU(LN());return t.copy=function(){return Kf(t,A0e()).constant(t.constant())},rd.apply(t,arguments)}function YU(){var t=LU(LN());return t.copy=function(){return Kf(t,YU()).exponent(t.exponent())},rd.apply(t,arguments)}function qpt(){return YU.apply(null,arguments).exponent(.5)}const $te=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ib,scaleDiverging:P0e,scaleDivergingLog:M0e,scaleDivergingPow:YU,scaleDivergingSqrt:qpt,scaleDivergingSymlog:A0e,scaleIdentity:u0e,scaleImplicit:B5,scaleLinear:jC,scaleLog:f0e,scaleOrdinal:jU,scalePoint:Ix,scalePow:$U,scaleQuantile:m0e,scaleQuantize:g0e,scaleRadial:p0e,scaleSequential:C0e,scaleSequentialLog:E0e,scaleSequentialPow:qU,scaleSequentialQuantile:N0e,scaleSequentialSqrt:Hpt,scaleSequentialSymlog:j0e,scaleSqrt:Eht,scaleSymlog:h0e,scaleThreshold:y0e,scaleTime:Gpt,scaleUtc:Wpt,tickFormat:c0e},Symbol.toStringTag,{value:"Module"}));var TI,Fte;function D0e(){if(Fte)return TI;Fte=1;var t=c0();function e(r,n,i){for(var s=-1,a=r.length;++s<a;){var o=r[s],c=n(o);if(c!=null&&(u===void 0?c===c&&!t(c):i(c,u)))var u=c,d=o}return d}return TI=e,TI}var CI,zte;function Ypt(){if(zte)return CI;zte=1;function t(e,r){return e>r}return CI=t,CI}var EI,Bte;function Kpt(){if(Bte)return EI;Bte=1;var t=D0e(),e=Ypt(),r=f0();function n(i){return i&&i.length?t(i,r,e):void 0}return EI=n,EI}var Qpt=Kpt();const Kd=Lr(Qpt);
vendor: 67,698 bytes, lines 4340-4366
4340var jI,Vte;function Zpt(){if(Vte)return jI;Vte=1;function t(e,r){return e<r}return jI=t,jI}var NI,Ute;function Xpt(){if(Ute)return NI;Ute=1;var t=D0e(),e=Zpt(),r=f0();function n(i){return i&&i.length?t(i,r,e):void 0}return NI=n,NI}var Jpt=Xpt();const $N=Lr(Jpt);var PI,Gte;function emt(){if(Gte)return PI;Gte=1;var t=dU(),e=Hf(),r=Vye(),n=va();function i(s,a){var o=n(s)?t:r;return o(s,e(a,3))}return PI=i,PI}var MI,Wte;function tmt(){if(Wte)return MI;Wte=1;var t=zye(),e=emt();function r(n,i){return t(e(n,i),1)}return MI=r,MI}var rmt=tmt();const nmt=Lr(rmt);var AI,Hte;function imt(){if(Hte)return AI;Hte=1;var t=SU();function e(r,n){return t(r,n)}return AI=e,AI}var smt=imt();const Ip=Lr(smt);var p0=1e9,amt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},QU,yn=!0,Oo="[DecimalError] ",ip=Oo+"Invalid argument: ",KU=Oo+"Exponent out of range: ",m0=Math.floor,Ch=Math.pow,omt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Da,Ri=1e7,ln=7,O0e=9007199254740991,AC=m0(O0e/ln),ot={};ot.absoluteValue=ot.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};ot.comparedTo=ot.cmp=function(t){var e,r,n,i,s=this;if(t=new s.constructor(t),s.s!==t.s)return s.s||-t.s;if(s.e!==t.e)return s.e>t.e^s.s<0?1:-1;for(n=s.d.length,i=t.d.length,e=0,r=n<i?n:i;e<r;++e)if(s.d[e]!==t.d[e])return s.d[e]>t.d[e]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};ot.decimalPlaces=ot.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*ln;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};ot.dividedBy=ot.div=function(t){return yu(this,new this.constructor(t))};ot.dividedToIntegerBy=ot.idiv=function(t){var e=this,r=e.constructor;return Kr(yu(e,new r(t),0,1),r.precision)};ot.equals=ot.eq=function(t){return!this.cmp(t)};ot.exponent=function(){return hi(this)};ot.greaterThan=ot.gt=function(t){return this.cmp(t)>0};ot.greaterThanOrEqualTo=ot.gte=function(t){return this.cmp(t)>=0};ot.isInteger=ot.isint=function(){return this.e>this.d.length-2};ot.isNegative=ot.isneg=function(){return this.s<0};ot.isPositive=ot.ispos=function(){return this.s>0};ot.isZero=function(){return this.s===0};ot.lessThan=ot.lt=function(t){return this.cmp(t)<0};ot.lessThanOrEqualTo=ot.lte=function(t){return this.cmp(t)<1};ot.logarithm=ot.log=function(t){var e,r=this,n=r.constructor,i=n.precision,s=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Da))throw Error(Oo+"NaN");if(r.s<1)throw Error(Oo+(r.s?"NaN":"-Infinity"));return r.eq(Da)?new n(0):(yn=!1,e=yu(Bb(r,s),Bb(t,s),s),yn=!0,Kr(e,i))};ot.minus=ot.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?L0e(e,t):R0e(e,(t.s=-t.s,t))};ot.modulo=ot.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Oo+"NaN");return r.s?(yn=!1,e=yu(r,t,0,1).times(t),yn=!0,r.minus(e)):Kr(new n(r),i)};ot.naturalExponential=ot.exp=function(){return I0e(this)};ot.naturalLogarithm=ot.ln=function(){return Bb(this)};ot.negated=ot.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};ot.plus=ot.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?R0e(e,t):L0e(e,(t.s=-t.s,t))};ot.precision=ot.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(ip+t);if(e=hi(i)+1,n=i.d.length-1,r=n*ln+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};ot.squareRoot=ot.sqrt=function(){var t,e,r,n,i,s,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Oo+"NaN")}for(t=hi(o),yn=!1,i=Math.sqrt(+o),i==0||i==1/0?(e=Wl(o.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=m0((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new c(e)):n=new c(i.toString()),r=c.precision,i=a=r+3;;)if(s=n,n=s.plus(yu(o,s,a+2)).times(.5),Wl(s.d).slice(0,a)===(e=Wl(n.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Kr(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(e!="9999")break;a+=4}return yn=!0,Kr(n,r)};ot.times=ot.mul=function(t){var e,r,n,i,s,a,o,c,u,d=this,f=d.constructor,h=d.d,m=(t=new f(t)).d;if(!d.s||!t.s)return new f(0);for(t.s*=d.s,r=d.e+t.e,c=h.length,u=m.length,c<u&&(s=h,h=m,m=s,a=c,c=u,u=a),s=[],a=c+u,n=a;n--;)s.push(0);for(n=u;--n>=0;){for(e=0,i=c+n;i>n;)o=s[i]+m[n]*h[i-n-1]+e,s[i--]=o%Ri|0,e=o/Ri|0;s[i]=(s[i]+e)%Ri|0}for(;!s[--a];)s.pop();return e?++r:s.shift(),t.d=s,t.e=r,yn?Kr(t,f.precision):t};ot.toDecimalPlaces=ot.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(mc(t,0,p0),e===void 0?e=n.rounding:mc(e,0,8),Kr(r,t+hi(r)+1,e))};ot.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Lp(n,!0):(mc(t,0,p0),e===void 0?e=i.rounding:mc(e,0,8),n=Kr(new i(n),t+1,e),r=Lp(n,!0,t+1)),r};ot.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?Lp(i):(mc(t,0,p0),e===void 0?e=s.rounding:mc(e,0,8),n=Kr(new s(i),t+hi(i)+1,e),r=Lp(n.abs(),!1,t+hi(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ot.toInteger=ot.toint=function(){var t=this,e=t.constructor;return Kr(new e(t),hi(t)+1,e.rounding)};ot.toNumber=function(){return+this};ot.toPower=ot.pow=function(t){var e,r,n,i,s,a,o=this,c=o.constructor,u=12,d=+(t=new c(t));if(!t.s)return new c(Da);if(o=new c(o),!o.s){if(t.s<1)throw Error(Oo+"Infinity");return o}if(o.eq(Da))return o;if(n=c.precision,t.eq(Da))return Kr(o,n);if(e=t.e,r=t.d.length-1,a=e>=r,s=o.s,a){if((r=d<0?-d:d)<=O0e){for(i=new c(Da),e=Math.ceil(n/ln+4),yn=!1;r%2&&(i=i.times(o),Yte(i.d,e)),r=m0(r/2),r!==0;)o=o.times(o),Yte(o.d,e);return yn=!0,t.s<0?new c(Da).div(i):Kr(i,n)}}else if(s<0)throw Error(Oo+"NaN");return s=s<0&&t.d[Math.max(e,r)]&1?-1:1,o.s=1,yn=!1,i=t.times(Bb(o,n+u)),yn=!0,i=I0e(i),i.s=s,i};ot.toPrecision=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?(r=hi(i),n=Lp(i,r<=s.toExpNeg||r>=s.toExpPos)):(mc(t,1,p0),e===void 0?e=s.rounding:mc(e,0,8),i=Kr(new s(i),t,e),r=hi(i),n=Lp(i,t<=r||r<=s.toExpNeg,t)),n};ot.toSignificantDigits=ot.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(mc(t,1,p0),e===void 0?e=n.rounding:mc(e,0,8)),Kr(new n(r),t,e)};ot.toString=ot.valueOf=ot.val=ot.toJSON=ot[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=hi(t),r=t.constructor;return Lp(t,e<=r.toExpNeg||e>=r.toExpPos)};function R0e(t,e){var r,n,i,s,a,o,c,u,d=t.constructor,f=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),yn?Kr(e,f):e;if(c=t.d,u=e.d,a=t.e,i=e.e,c=c.slice(),s=a-i,s){for(s<0?(n=c,s=-s,o=u.length):(n=u,i=a,o=c.length),a=Math.ceil(f/ln),o=a>o?a+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=c.length,s=u.length,o-s<0&&(s=o,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/Ri|0,c[s]%=Ri;for(r&&(c.unshift(r),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=i,yn?Kr(e,f):e}function mc(t,e,r){if(t!==~~t||t<e||t>r)throw Error(ip+t)}function Wl(t){var e,r,n,i=t.length-1,s="",a=t[0];if(i>0){for(s+=a,e=1;e<i;e++)n=t[e]+"",r=ln-n.length,r&&(s+=Od(r)),s+=n;a=t[e],n=a+"",r=ln-n.length,r&&(s+=Od(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var yu=(function(){function t(n,i){var s,a=0,o=n.length;for(n=n.slice();o--;)s=n[o]*i+a,n[o]=s%Ri|0,a=s/Ri|0;return a&&n.unshift(a),n}function e(n,i,s,a){var o,c;if(s!=a)c=s>a?1:-1;else for(o=c=0;o<s;o++)if(n[o]!=i[o]){c=n[o]>i[o]?1:-1;break}return c}function r(n,i,s){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*Ri+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a){var o,c,u,d,f,h,m,y,x,v,_,S,k,E,T,N,j,M,O=n.constructor,R=n.s==i.s?1:-1,I=n.d,B=i.d;if(!n.s)return new O(n);if(!i.s)throw Error(Oo+"Division by zero");for(c=n.e-i.e,j=B.length,T=I.length,m=new O(R),y=m.d=[],u=0;B[u]==(I[u]||0);)++u;if(B[u]>(I[u]||0)&&--c,s==null?S=s=O.precision:a?S=s+(hi(n)-hi(i))+1:S=s,S<0)return new O(0);if(S=S/ln+2|0,u=0,j==1)for(d=0,B=B[0],S++;(u<T||d)&&S--;u++)k=d*Ri+(I[u]||0),y[u]=k/B|0,d=k%B|0;else{for(d=Ri/(B[0]+1)|0,d>1&&(B=t(B,d),I=t(I,d),j=B.length,T=I.length),E=j,x=I.slice(0,j),v=x.length;v<j;)x[v++]=0;M=B.slice(),M.unshift(0),N=B[0],B[1]>=Ri/2&&++N;do d=0,o=e(B,x,j,v),o<0?(_=x[0],j!=v&&(_=_*Ri+(x[1]||0)),d=_/N|0,d>1?(d>=Ri&&(d=Ri-1),f=t(B,d),h=f.length,v=x.length,o=e(f,x,h,v),o==1&&(d--,r(f,j<h?M:B,h))):(d==0&&(o=d=1),f=B.slice()),h=f.length,h<v&&f.unshift(0),r(x,f,v),o==-1&&(v=x.length,o=e(B,x,j,v),o<1&&(d++,r(x,j<v?M:B,v))),v=x.length):o===0&&(d++,x=[0]),y[u++]=d,o&&x[0]?x[v++]=I[E]||0:(x=[I[E]],v=1);while((E++<T||x[0]!==void 0)&&S--)}return y[0]||y.shift(),m.e=c,Kr(m,a?s+hi(m)+1:s)}})();function I0e(t,e){var r,n,i,s,a,o,c=0,u=0,d=t.constructor,f=d.precision;if(hi(t)>16)throw Error(KU+hi(t));if(!t.s)return new d(Da);for(yn=!1,o=f,a=new d(.03125);t.abs().gte(.1);)t=t.times(a),u+=5;for(n=Math.log(Ch(2,u))/Math.LN10*2+5|0,o+=n,r=i=s=new d(Da),d.precision=o;;){if(i=Kr(i.times(t),o),r=r.times(++c),a=s.plus(yu(i,r,o)),Wl(a.d).slice(0,o)===Wl(s.d).slice(0,o)){for(;u--;)s=Kr(s.times(s),o);return d.precision=f,e==null?(yn=!0,Kr(s,f)):s}s=a}}function hi(t){for(var e=t.e*ln,r=t.d[0];r>=10;r/=10)e++;return e}function DI(t,e,r){if(e>t.LN10.sd())throw yn=!0,r&&(t.precision=r),Error(Oo+"LN10 precision limit exceeded");return Kr(new t(t.LN10),e)}function Od(t){for(var e="";t--;)e+="0";return e}function Bb(t,e){var r,n,i,s,a,o,c,u,d,f=1,h=10,m=t,y=m.d,x=m.constructor,v=x.precision;if(m.s<1)throw Error(Oo+(m.s?"NaN":"-Infinity"));if(m.eq(Da))return new x(0);if(e==null?(yn=!1,u=v):u=e,m.eq(10))return e==null&&(yn=!0),DI(x,u);if(u+=h,x.precision=u,r=Wl(y),n=r.charAt(0),s=hi(m),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=Wl(m.d),n=r.charAt(0),f++;s=hi(m),n>1?(m=new x("0."+r),s++):m=new x(n+"."+r.slice(1))}else return c=DI(x,u+2,v).times(s+""),m=Bb(new x(n+"."+r.slice(1)),u-h).plus(c),x.precision=v,e==null?(yn=!0,Kr(m,v)):m;for(o=a=m=yu(m.minus(Da),m.plus(Da),u),d=Kr(m.times(m),u),i=3;;){if(a=Kr(a.times(d),u),c=o.plus(yu(a,new x(i),u)),Wl(c.d).slice(0,u)===Wl(o.d).slice(0,u))return o=o.times(2),s!==0&&(o=o.plus(DI(x,u+2,v).times(s+""))),o=yu(o,new x(f),u),x.precision=v,e==null?(yn=!0,Kr(o,v)):o;o=c,i+=2}}function qte(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=m0(r/ln),t.d=[],n=(r+1)%ln,r<0&&(n+=ln),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=ln;n<i;)t.d.push(+e.slice(n,n+=ln));e=e.slice(n),n=ln-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),yn&&(t.e>AC||t.e<-AC))throw Error(KU+r)}else t.s=0,t.e=0,t.d=[0];return t}function Kr(t,e,r){var n,i,s,a,o,c,u,d,f=t.d;for(a=1,s=f[0];s>=10;s/=10)a++;if(n=e-a,n<0)n+=ln,i=e,u=f[d=0];else{if(d=Math.ceil((n+1)/ln),s=f.length,d>=s)return t;for(u=s=f[d],a=1;s>=10;s/=10)a++;n%=ln,i=n-ln+a}if(r!==void 0&&(s=Ch(10,a-i-1),o=u/s%10|0,c=e<0||f[d+1]!==void 0||u%s,c=r<4?(o||c)&&(r==0||r==(t.s<0?3:2)):o>5||o==5&&(r==4||c||r==6&&(n>0?i>0?u/Ch(10,a-i):0:f[d-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return c?(s=hi(t),f.length=1,e=e-s-1,f[0]=Ch(10,(ln-e%ln)%ln),t.e=m0(-e/ln)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=d,s=1,d--):(f.length=d+1,s=Ch(10,ln-n),f[d]=i>0?(u/Ch(10,a-i)%Ch(10,i)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==Ri&&(f[0]=1,++t.e);break}else{if(f[d]+=s,f[d]!=Ri)break;f[d--]=0,s=1}for(n=f.length;f[--n]===0;)f.pop();if(yn&&(t.e>AC||t.e<-AC))throw Error(KU+hi(t));return t}function L0e(t,e){var r,n,i,s,a,o,c,u,d,f,h=t.constructor,m=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),yn?Kr(e,m):e;if(c=t.d,f=e.d,n=e.e,u=t.e,c=c.slice(),a=u-n,a){for(d=a<0,d?(r=c,a=-a,o=f.length):(r=f,n=u,o=c.length),i=Math.max(Math.ceil(m/ln),o)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=c.length,o=f.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}a=0}for(d&&(r=c,c=f,f=r,e.s=-e.s),o=c.length,i=f.length-o;i>0;--i)c[o++]=0;for(i=f.length;i>a;){if(c[--i]<f[i]){for(s=i;s&&c[--s]===0;)c[s]=Ri-1;--c[s],c[i]+=Ri}c[i]-=f[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=n,yn?Kr(e,m):e):new h(0)}function Lp(t,e,r){var n,i=hi(t),s=Wl(t.d),a=s.length;return e?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Od(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Od(-i-1)+s,r&&(n=r-a)>0&&(s+=Od(n))):i>=a?(s+=Od(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Od(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Od(n))),t.s<0?"-"+s:s}function Yte(t,e){if(t.length>e)return t.length=e,!0}function $0e(t){var e,r,n;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(ip+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return qte(a,s.toString())}else if(typeof s!="string")throw Error(ip+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,omt.test(s))qte(a,s);else throw Error(ip+s)}if(i.prototype=ot,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=$0e,i.config=i.set=lmt,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function lmt(t){if(!t||typeof t!="object")throw Error(Oo+"Object expected");var e,r,n,i=["precision",1,p0,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((n=t[r=i[e]])!==void 0)if(m0(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(ip+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ip+r+": "+n);return this}var QU=$0e(amt);Da=new QU(1);const zr=QU;function cmt(t){return hmt(t)||fmt(t)||dmt(t)||umt()}function umt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4341In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dmt(t,e){if(t){if(typeof t=="string")return W5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W5(t,e)}}function fmt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function hmt(t){if(Array.isArray(t))return W5(t)}function W5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var pmt=function(e){return e},F0e={},z0e=function(e){return e===F0e},Kte=function(e){return function r(){return arguments.length===0||arguments.length===1&&z0e(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},mmt=function t(e,r){return e===1?r:Kte(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var a=i.filter(function(o){return o!==F0e}).length;return a>=e?r.apply(void 0,i):t(e-a,Kte(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var d=i.map(function(f){return z0e(f)?c.shift():f});return r.apply(void 0,cmt(d).concat(c))}))})},FN=function(e){return mmt(e.length,e)},H5=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},gmt=FN(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),ymt=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return pmt;var i=r.reverse(),s=i[0],a=i.slice(1);return function(){return a.reduce(function(o,c){return c(o)},s.apply(void 0,arguments))}},q5=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},B0e=function(e){var r=null,n=null;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r&&s.every(function(o,c){return o===r[c]})||(r=s,n=e.apply(void 0,s)),n}};function vmt(t){var e;return t===0?e=1:e=Math.floor(new zr(t).abs().log(10).toNumber())+1,e}function xmt(t,e,r){for(var n=new zr(t),i=0,s=[];n.lt(e)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}var bmt=FN(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),wmt=FN(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),_mt=FN(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const zN={rangeStep:xmt,getDigitCount:vmt,interpolateNumber:bmt,uninterpolateNumber:wmt,uninterpolateTruncation:_mt};function Y5(t){return Tmt(t)||kmt(t)||V0e(t)||Smt()}function Smt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4342In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kmt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Tmt(t){if(Array.isArray(t))return K5(t)}function Vb(t,e){return jmt(t)||Emt(t,e)||V0e(t,e)||Cmt()}function Cmt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4343In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V0e(t,e){if(t){if(typeof t=="string")return K5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K5(t,e)}}function K5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Emt(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,s=void 0;try{for(var a=t[Symbol.iterator](),o;!(n=(o=a.next()).done)&&(r.push(o.value),!(e&&r.length===e));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw s}}return r}}function jmt(t){if(Array.isArray(t))return t}function U0e(t){var e=Vb(t,2),r=e[0],n=e[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function G0e(t,e,r){if(t.lte(0))return new zr(0);var n=zN.getDigitCount(t.toNumber()),i=new zr(10).pow(n),s=t.div(i),a=n!==1?.05:.1,o=new zr(Math.ceil(s.div(a).toNumber())).add(r).mul(a),c=o.mul(i);return e?c:new zr(Math.ceil(c))}function Nmt(t,e,r){var n=1,i=new zr(t);if(!i.isint()&&r){var s=Math.abs(t);s<1?(n=new zr(10).pow(zN.getDigitCount(t)-1),i=new zr(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new zr(Math.floor(t)))}else t===0?i=new zr(Math.floor((e-1)/2)):r||(i=new zr(Math.floor(t)));var a=Math.floor((e-1)/2),o=ymt(gmt(function(c){return i.add(new zr(c-a).mul(n)).toNumber()}),H5);return o(0,e)}function W0e(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new zr(0),tickMin:new zr(0),tickMax:new zr(0)};var s=G0e(new zr(e).sub(t).div(r-1),n,i),a;t<=0&&e>=0?a=new zr(0):(a=new zr(t).add(e).div(2),a=a.sub(new zr(a).mod(s)));var o=Math.ceil(a.sub(t).div(s).toNumber()),c=Math.ceil(new zr(e).sub(a).div(s).toNumber()),u=o+c+1;return u>r?W0e(t,e,r,n,i+1):(u<r&&(c=e>0?c+(r-u):c,o=e>0?o:o+(r-u)),{step:s,tickMin:a.sub(new zr(o).mul(s)),tickMax:a.add(new zr(c).mul(s))})}function Pmt(t){var e=Vb(t,2),r=e[0],n=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),o=U0e([r,n]),c=Vb(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Y5(H5(0,i-1).map(function(){return 1/0}))):[].concat(Y5(H5(0,i-1).map(function(){return-1/0})),[d]);return r>n?q5(f):f}if(u===d)return Nmt(u,i,s);var h=W0e(u,d,a,s),m=h.step,y=h.tickMin,x=h.tickMax,v=zN.rangeStep(y,x.add(new zr(.1).mul(m)),m);return r>n?q5(v):v}function Mmt(t,e){var r=Vb(t,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=U0e([n,i]),o=Vb(a,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var d=Math.max(e,2),f=G0e(new zr(u).sub(c).div(d-1),s,0),h=[].concat(Y5(zN.rangeStep(new zr(c),new zr(u).sub(new zr(.99).mul(f)),f)),[u]);return n>i?q5(h):h}var Amt=B0e(Pmt),Dmt=B0e(Mmt),Omt="Invariant failed";function $p(t,e){throw new Error(Omt)}var Rmt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function gy(t){"@babel/helpers - typeof";return gy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gy(t)}function DC(){return DC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},DC.apply(this,arguments)}function Imt(t,e){return zmt(t)||Fmt(t,e)||$mt(t,e)||Lmt()}function Lmt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4344In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $mt(t,e){if(t){if(typeof t=="string")return Qte(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qte(t,e)}}function Qte(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fmt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function zmt(t){if(Array.isArray(t))return t}function Bmt(t,e){if(t==null)return{};var r=Vmt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Vmt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Umt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gmt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Y0e(n.key),n)}}function Wmt(t,e,r){return e&&Gmt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hmt(t,e,r){return e=OC(e),qmt(t,H0e()?Reflect.construct(e,r||[],OC(t).constructor):e.apply(t,r))}function qmt(t,e){if(e&&(gy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ymt(t)}function Ymt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H0e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H0e=function(){return!!t})()}function OC(t){return OC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},OC(t)}function Kmt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Q5(t,e)}function Q5(t,e){return Q5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Q5(t,e)}function q0e(t,e,r){return e=Y0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y0e(t){var e=Qmt(t,"string");return gy(e)=="symbol"?e:e+""}function Qmt(t,e){if(gy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var g0=(function(t){function e(){return Umt(this,e),Hmt(this,e,arguments)}return Kmt(e,t),Wmt(e,[{key:"render",value:function(){var n=this.props,i=n.offset,s=n.layout,a=n.width,o=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Bmt(n,Rmt),m=Ht(h,!1);this.props.direction==="x"&&d.type!=="number"&&$p();var y=c.map(function(x){var v=u(x,o),_=v.x,S=v.y,k=v.value,E=v.errorVal;if(!E)return null;var T=[],N,j;if(Array.isArray(E)){var M=Imt(E,2);N=M[0],j=M[1]}else N=j=E;if(s==="vertical"){var O=d.scale,R=S+i,I=R+a,B=R-a,F=O(k-N),V=O(k+j);T.push({x1:V,y1:I,x2:V,y2:B}),T.push({x1:F,y1:R,x2:V,y2:R}),T.push({x1:F,y1:I,x2:F,y2:B})}else if(s==="horizontal"){var $=f.scale,U=_+i,z=U-a,L=U+a,W=$(k-N),K=$(k+j);T.push({x1:z,y1:K,x2:L,y2:K}),T.push({x1:U,y1:W,x2:U,y2:K}),T.push({x1:z,y1:W,x2:L,y2:W})}return P.createElement(Cr,DC({className:"recharts-errorBar",key:"bar-".concat(T.map(function(q){return"".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))},m),T.map(function(q){return P.createElement("line",DC({},q,{key:"line-".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))}))});return P.createElement(Cr,{className:"recharts-errorBars"},y)}}])})(P.Component);q0e(g0,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});q0e(g0,"displayName","ErrorBar");function Ub(t){"@babel/helpers - typeof";return Ub=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ub(t)}function Zte(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zte(Object(r),!0).forEach(function(n){Zmt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zte(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zmt(t,e,r){return e=Xmt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xmt(t){var e=Jmt(t,"string");return Ub(e)=="symbol"?e:e+""}function Jmt(t,e){if(Ub(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ub(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var K0e=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,s=e.legendContent,a=Ea(r,jg);if(!a)return null;var o=jg.defaultProps,c=o!==void 0?gh(gh({},o),a.props):{},u;return a.props&&a.props.payload?u=a.props&&a.props.payload:s==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,m=f.props,y=m.sectors||m.data||[];return d.concat(y.map(function(x){return{type:a.props.iconType||h.props.legendType,value:x.name,color:x.fill,payload:x}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,m=h!==void 0?gh(gh({},h),f.props):{},y=m.dataKey,x=m.name,v=m.legendType,_=m.hide;return{inactive:_,dataKey:y,type:c.iconType||v||"square",color:ZU(f),value:x||y,payload:m}}),gh(gh(gh({},c),jg.getWithHeight(a,i)),{},{payload:u,item:a})};function Gb(t){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gb(t)}function Xte(t){return ngt(t)||rgt(t)||tgt(t)||egt()}function egt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4345In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tgt(t,e){if(t){if(typeof t=="string")return Z5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z5(t,e)}}function rgt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ngt(t){if(Array.isArray(t))return Z5(t)}function Z5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jte(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jte(Object(r),!0).forEach(function(n){Pg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jte(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pg(t,e,r){return e=igt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function igt(t){var e=sgt(t,"string");return Gb(e)=="symbol"?e:e+""}function sgt(t,e){if(Gb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ei(t,e,r){return Ut(t)||Ut(e)?r:Ti(e)?ko(t,e,r):qt(e)?e(t):r}function Lx(t,e,r,n){var i=nmt(t,function(o){return Ei(o,e)});if(r==="number"){var s=i.filter(function(o){return Ge(o)||parseFloat(o)});return s.length?[$N(s),Kd(s)]:[1/0,-1/0]}var a=n?i.filter(function(o){return!Ut(o)}):i;return a.map(function(o){return Ti(o)||o instanceof Date?o:""})}var agt=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,a=-1,o=(r=n?.length)!==null&&r!==void 0?r:0;if(o<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,f=i[u].coordinate,h=u>=o-1?i[0].coordinate:i[u+1].coordinate,m=void 0;if(dl(f-d)!==dl(h-f)){var y=[];if(dl(h-f)===dl(c[1]-c[0])){m=h;var x=f+c[1]-c[0];y[0]=Math.min(x,(x+d)/2),y[1]=Math.max(x,(x+d)/2)}else{m=d;var v=h+c[1]-c[0];y[0]=Math.min(f,(v+f)/2),y[1]=Math.max(f,(v+f)/2)}var _=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(e>_[0]&&e<=_[1]||e>=y[0]&&e<=y[1]){a=i[u].index;break}}else{var S=Math.min(d,h),k=Math.max(d,h);if(e>(S+f)/2&&e<=(k+f)/2){a=i[u].index;break}}}else for(var E=0;E<o;E++)if(E===0&&e<=(n[E].coordinate+n[E+1].coordinate)/2||E>0&&E<o-1&&e>(n[E].coordinate+n[E-1].coordinate)/2&&e<=(n[E].coordinate+n[E+1].coordinate)/2||E===o-1&&e>(n[E].coordinate+n[E-1].coordinate)/2){a=n[E].index;break}return a},ZU=function(e){var r,n=e,i=n.type.displayName,s=(r=e.type)!==null&&r!==void 0&&r.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,a=s.stroke,o=s.fill,c;switch(i){case"Line":c=a;break;case"Area":case"Radar":c=a&&a!=="none"?a:o;break;default:c=o;break}return c},ogt=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var a={},o=Object.keys(s),c=0,u=o.length;c<u;c++)for(var d=s[o[c]].stackGroups,f=Object.keys(d),h=0,m=f.length;h<m;h++){var y=d[f[h]],x=y.items,v=y.cateAxisId,_=x.filter(function(j){return mu(j.type).indexOf("Bar")>=0});if(_&&_.length){var S=_[0].type.defaultProps,k=S!==void 0?In(In({},S),_[0].props):_[0].props,E=k.barSize,T=k[v];a[T]||(a[T]=[]);var N=Ut(E)?r:E;a[T].push({item:_[0],stackList:_.slice(1),barSize:Ut(N)?void 0:Rp(N,n,0)})}}return a},lgt=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,s=e.sizeList,a=s===void 0?[]:s,o=e.maxBarSize,c=a.length;if(c<1)return null;var u=Rp(r,i,0,!0),d,f=[];if(a[0].barSize===+a[0].barSize){var h=!1,m=i/c,y=a.reduce(function(E,T){return E+T.barSize||0},0);y+=(c-1)*u,y>=i&&(y-=(c-1)*u,u=0),y>=i&&m>0&&(h=!0,m*=.9,y=c*m);var x=(i-y)/2>>0,v={offset:x-u,size:0};d=a.reduce(function(E,T){var N={item:T.item,position:{offset:v.offset+v.size+u,size:h?m:T.barSize}},j=[].concat(Xte(E),[N]);return v=j[j.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(M){j.push({item:M,position:v})}),j},f)}else{var _=Rp(n,i,0,!0);i-2*_-(c-1)*u<=0&&(u=0);var S=(i-2*_-(c-1)*u)/c;S>1&&(S>>=0);var k=o===+o?Math.min(S,o):S;d=a.reduce(function(E,T,N){var j=[].concat(Xte(E),[{item:T.item,position:{offset:_+(S+u)*N+(S-k)/2,size:k}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(M){j.push({item:M,position:j[j.length-1].position})}),j},f)}return d},cgt=function(e,r,n,i){var s=n.children,a=n.width,o=n.margin,c=a-(o.left||0)-(o.right||0),u=K0e({children:s,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,m=u.align,y=u.verticalAlign,x=u.layout;if((x==="vertical"||x==="horizontal"&&y==="middle")&&m!=="center"&&Ge(e[m]))return In(In({},e),{},Pg({},m,e[m]+(f||0)));if((x==="horizontal"||x==="vertical"&&m==="center")&&y!=="middle"&&Ge(e[y]))return In(In({},e),{},Pg({},y,e[y]+(h||0)))}return e},ugt=function(e,r,n){return Ut(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Q0e=function(e,r,n,i,s){var a=r.props.children,o=ua(a,g0).filter(function(u){return ugt(i,s,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var f=Ei(d,n);if(Ut(f))return u;var h=Array.isArray(f)?[$N(f),Kd(f)]:[f,f],m=c.reduce(function(y,x){var v=Ei(d,x,0),_=h[0]-Math.abs(Array.isArray(v)?v[0]:v),S=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(_,y[0]),Math.max(S,y[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},dgt=function(e,r,n,i,s){var a=r.map(function(o){return Q0e(e,o,n,s,i)}).filter(function(o){return!Ut(o)});return a&&a.length?a.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},Z0e=function(e,r,n,i,s){var a=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&Q0e(e,c,u,i)||Lx(e,u,n,s)});if(n==="number")return a.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return a.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)o[u[d]]||(o[u[d]]=!0,c.push(u[d]));return c},[])},X0e=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},J0e=function(e,r,n,i){if(i)return e.map(function(c){return c.coordinate});var s,a,o=e.map(function(c){return c.coordinate===r&&(s=!0),c.coordinate===n&&(a=!0),c.coordinate});return s||o.push(r),a||o.push(n),o},lu=function(e,r,n){if(!e)return null;var i=e.scale,s=e.duplicateDomain,a=e.type,o=e.range,c=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&a==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=e.axisType==="angleAxis"&&o?.length>=2?dl(o[0]-o[1])*2*u:u,r&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!d0(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:s?s[f]:f,index:h,offset:u}})},OI=new WeakMap,DS=function(e,r){if(typeof r!="function")return e;OI.has(e)||OI.set(e,new WeakMap);var n=OI.get(e);if(n.has(r))return n.get(r);var i=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},fgt=function(e,r,n){var i=e.scale,s=e.type,a=e.layout,o=e.axisType;if(i==="auto")return a==="radial"&&o==="radiusAxis"?{scale:Ib(),realScaleType:"band"}:a==="radial"&&o==="angleAxis"?{scale:jC(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Ix(),realScaleType:"point"}:s==="category"?{scale:Ib(),realScaleType:"band"}:{scale:jC(),realScaleType:"linear"};if(Op(i)){var c="scale".concat(kN(i));return{scale:($te[c]||Ix)(),realScaleType:$te[c]?c:"point"}}return qt(i)?{scale:i}:{scale:Ix(),realScaleType:"point"}},ere=1e-4,hgt=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,i=e.range(),s=Math.min(i[0],i[1])-ere,a=Math.max(i[0],i[1])+ere,o=e(r[0]),c=e(r[n-1]);(o<s||o>a||c<s||c>a)&&e.domain([r[0],r[n-1]])}},pgt=function(e,r){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].item===r)return e[n].position;return null},mgt=function(e,r){if(!r||r.length!==2||!Ge(r[0])||!Ge(r[1]))return e;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),s=[e[0],e[1]];return(!Ge(e[0])||e[0]<n)&&(s[0]=n),(!Ge(e[1])||e[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<n&&(s[1]=n),s},ggt=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var s=0,a=0,o=0;o<r;++o){var c=d0(e[o][n][1])?e[o][n][0]:e[o][n][1];c>=0?(e[o][n][0]=s,e[o][n][1]=s+c,s=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+c,a=e[o][n][1])}},ygt=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var s=0,a=0;a<r;++a){var o=d0(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=s,e[a][n][1]=s+o,s=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}},vgt={sign:ggt,expand:ect,none:ly,silhouette:tct,wiggle:rct,positive:ygt},xgt=function(e,r,n){var i=r.map(function(o){return o.props.dataKey}),s=vgt[n],a=Jlt().keys(i).value(function(o,c){return+Ei(o,c,0)}).order(E5).offset(s);return a(e)},bgt=function(e,r,n,i,s,a){if(!e)return null;var o=a?r.reverse():r,c={},u=o.reduce(function(f,h){var m,y=(m=h.type)!==null&&m!==void 0&&m.defaultProps?In(In({},h.type.defaultProps),h.props):h.props,x=y.stackId,v=y.hide;if(v)return f;var _=y[n],S=f[_]||{hasStack:!1,stackGroups:{}};if(Ti(x)){var k=S.stackGroups[x]||{numericAxisId:n,cateAxisId:i,items:[]};k.items.push(h),S.hasStack=!0,S.stackGroups[x]=k}else S.stackGroups[Xp("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return In(In({},f),{},Pg({},_,S))},c),d={};return Object.keys(u).reduce(function(f,h){var m=u[h];if(m.hasStack){var y={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(x,v){var _=m.stackGroups[v];return In(In({},x),{},Pg({},v,{numericAxisId:n,cateAxisId:i,items:_.items,stackedData:xgt(e,_.items,s)}))},y)}return In(In({},f),{},Pg({},h,m))},d)},wgt=function(e,r){var n=r.realScaleType,i=r.type,s=r.tickCount,a=r.originalDomain,o=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=Amt(u,s,o);return e.domain([$N(d),Kd(d)]),{niceTicks:d}}if(s&&i==="number"){var f=e.domain(),h=Dmt(f,s,o);return{niceTicks:h}}return null};function yy(t){var e=t.axis,r=t.ticks,n=t.bandSize,i=t.entry,s=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var o=cC(r,"value",i[e.dataKey]);if(o)return o.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=Ei(i,Ut(a)?e.dataKey:a);return Ut(c)?null:e.scale(c)}var tre=function(e){var r=e.axis,n=e.ticks,i=e.offset,s=e.bandSize,a=e.entry,o=e.index;if(r.type==="category")return n[o]?n[o].coordinate+i:null;var c=Ei(a,r.dataKey,r.domain[o]);return Ut(c)?null:r.scale(c)-s/2+i},_gt=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},Sgt=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,s=i.stackId;if(Ti(s)){var a=r[s];if(a){var o=a.items.indexOf(e);return o>=0?a.stackedData[o]:null}}return null},kgt=function(e){return e.reduce(function(r,n){return[$N(n.concat([r[0]]).filter(Ge)),Kd(n.concat([r[1]]).filter(Ge))]},[1/0,-1/0])},eve=function(e,r,n){return Object.keys(e).reduce(function(i,s){var a=e[s],o=a.stackedData,c=o.reduce(function(u,d){var f=kgt(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},rre=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,nre=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,X5=function(e,r,n){if(qt(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(Ge(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(rre.test(e[0])){var s=+rre.exec(e[0])[1];i[0]=r[0]-s}else qt(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(Ge(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(nre.test(e[1])){var a=+nre.exec(e[1])[1];i[1]=r[1]+a}else qt(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},RC=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!n||i>0)return i}if(e&&r&&r.length>=2){for(var s=TU(r,function(f){return f.coordinate}),a=1/0,o=1,c=s.length;o<c;o++){var u=s[o],d=s[o-1];a=Math.min((u.coordinate||0)-(d.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},ire=function(e,r,n){return!e||!e.length||Ip(e,ko(n,"type.defaultProps.domain"))?r:e},tve=function(e,r){var n=e.type.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,i=n.dataKey,s=n.name,a=n.unit,o=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return In(In({},Ht(e,!1)),{},{dataKey:i,unit:a,formatter:o,name:s||i,color:ZU(e),value:Ei(r,i),type:c,payload:r,chartType:u,hide:d})};function Wb(t){"@babel/helpers - typeof";return Wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wb(t)}function sre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function are(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sre(Object(r),!0).forEach(function(n){Tgt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tgt(t,e,r){return e=Cgt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cgt(t){var e=Egt(t,"string");return Wb(e)=="symbol"?e:e+""}function Egt(t,e){if(Wb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Wb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var IC=Math.PI/180,jgt=function(e){return e*180/Math.PI},Xi=function(e,r,n,i){return{x:e+Math.cos(-IC*i)*n,y:r+Math.sin(-IC*i)*n}},Ngt=function(e,r){var n=e.x,i=e.y,s=r.x,a=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-a,2))},Pgt=function(e,r){var n=e.x,i=e.y,s=r.cx,a=r.cy,o=Ngt({x:n,y:i},{x:s,y:a});if(o<=0)return{radius:o};var c=(n-s)/o,u=Math.acos(c);return i>a&&(u=2*Math.PI-u),{radius:o,angle:jgt(u),angleInRadian:u}},Mgt=function(e){var r=e.startAngle,n=e.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),a=Math.min(i,s);return{startAngle:r-a*360,endAngle:n-a*360}},Agt=function(e,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),a=Math.floor(i/360),o=Math.min(s,a);return e+o*360},ore=function(e,r){var n=e.x,i=e.y,s=Pgt({x:n,y:i},r),a=s.radius,o=s.angle,c=r.innerRadius,u=r.outerRadius;if(a<c||a>u)return!1;if(a===0)return!0;var d=Mgt(r),f=d.startAngle,h=d.endAngle,m=o,y;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;y=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;y=m>=h&&m<=f}return y?are(are({},r),{},{radius:a,angle:Agt(m,r)}):null};function Hb(t){"@babel/helpers - typeof";return Hb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hb(t)}var Dgt=["offset"];function Ogt(t){return $gt(t)||Lgt(t)||Igt(t)||Rgt()}function Rgt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4346In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Igt(t,e){if(t){if(typeof t=="string")return J5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J5(t,e)}}function Lgt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $gt(t){if(Array.isArray(t))return J5(t)}function J5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fgt(t,e){if(t==null)return{};var r=zgt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function zgt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function lre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lre(Object(r),!0).forEach(function(n){Bgt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bgt(t,e,r){return e=Vgt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vgt(t){var e=Ugt(t,"string");return Hb(e)=="symbol"?e:e+""}function Ugt(t,e){if(Hb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qb(){return qb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},qb.apply(this,arguments)}var Ggt=function(e){var r=e.value,n=e.formatter,i=Ut(e.children)?r:e.children;return qt(n)?n(i):i},Wgt=function(e,r){var n=dl(r-e),i=Math.min(Math.abs(r-e),360);return n*i},Hgt=function(e,r,n){var i=e.position,s=e.viewBox,a=e.offset,o=e.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,y=c.endAngle,x=c.clockWise,v=(f+h)/2,_=Wgt(m,y),S=_>=0?1:-1,k,E;i==="insideStart"?(k=m+S*a,E=x):i==="insideEnd"?(k=y-S*a,E=!x):i==="end"&&(k=y+S*a,E=x),E=_<=0?E:!E;var T=Xi(u,d,v,k),N=Xi(u,d,v,k+(E?1:-1)*359),j="M".concat(T.x,",").concat(T.y,`
4347    A`).concat(v,",").concat(v,",0,1,").concat(E?0:1,`,
4348    `).concat(N.x,",").concat(N.y),M=Ut(e.id)?Xp("recharts-radial-line-"):e.id;return P.createElement("text",qb({},n,{dominantBaseline:"central",className:Tt("recharts-radial-bar-label",o)}),P.createElement("defs",null,P.createElement("path",{id:M,d:j})),P.createElement("textPath",{xlinkHref:"#".concat(M)},r))},qgt=function(e){var r=e.viewBox,n=e.offset,i=e.position,s=r,a=s.cx,o=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(i==="outside"){var m=Xi(a,o,u+n,h),y=m.x,x=m.y;return{x:y,y:x,textAnchor:y>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,_=Xi(a,o,v,h),S=_.x,k=_.y;return{x:S,y:k,textAnchor:"middle",verticalAnchor:"middle"}},Ygt=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,s=e.position,a=r,o=a.x,c=a.y,u=a.width,d=a.height,f=d>=0?1:-1,h=f*i,m=f>0?"end":"start",y=f>0?"start":"end",x=u>=0?1:-1,v=x*i,_=x>0?"end":"start",S=x>0?"start":"end";if(s==="top"){var k={x:o+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:m};return bi(bi({},k),n?{height:Math.max(c-n.y,0),width:u}:{})}if(s==="bottom"){var E={x:o+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:y};return bi(bi({},E),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(s==="left"){var T={x:o-v,y:c+d/2,textAnchor:_,verticalAnchor:"middle"};return bi(bi({},T),n?{width:Math.max(T.x-n.x,0),height:d}:{})}if(s==="right"){var N={x:o+u+v,y:c+d/2,textAnchor:S,verticalAnchor:"middle"};return bi(bi({},N),n?{width:Math.max(n.x+n.width-N.x,0),height:d}:{})}var j=n?{width:u,height:d}:{};return s==="insideLeft"?bi({x:o+v,y:c+d/2,textAnchor:S,verticalAnchor:"middle"},j):s==="insideRight"?bi({x:o+u-v,y:c+d/2,textAnchor:_,verticalAnchor:"middle"},j):s==="insideTop"?bi({x:o+u/2,y:c+h,textAnchor:"middle",verticalAnchor:y},j):s==="insideBottom"?bi({x:o+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:m},j):s==="insideTopLeft"?bi({x:o+v,y:c+h,textAnchor:S,verticalAnchor:y},j):s==="insideTopRight"?bi({x:o+u-v,y:c+h,textAnchor:_,verticalAnchor:y},j):s==="insideBottomLeft"?bi({x:o+v,y:c+d-h,textAnchor:S,verticalAnchor:m},j):s==="insideBottomRight"?bi({x:o+u-v,y:c+d-h,textAnchor:_,verticalAnchor:m},j):u0(s)&&(Ge(s.x)||Bh(s.x))&&(Ge(s.y)||Bh(s.y))?bi({x:o+Rp(s.x,u),y:c+Rp(s.y,d),textAnchor:"end",verticalAnchor:"end"},j):bi({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},j)},Kgt=function(e){return"cx"in e&&Ge(e.cx)};function ms(t){var e=t.offset,r=e===void 0?5:e,n=Fgt(t,Dgt),i=bi({offset:r},n),s=i.viewBox,a=i.position,o=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!s||Ut(o)&&Ut(c)&&!b.isValidElement(u)&&!qt(u))return null;if(b.isValidElement(u))return b.cloneElement(u,i);var m;if(qt(u)){if(m=b.createElement(u,i),b.isValidElement(m))return m}else m=Ggt(i);var y=Kgt(s),x=Ht(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return Hgt(i,m,x);var v=y?qgt(i):Ygt(i);return P.createElement(wC,qb({className:Tt("recharts-label",f)},x,v,{breakAll:h}),m)}ms.displayName="Label";var rve=function(e){var r=e.cx,n=e.cy,i=e.angle,s=e.startAngle,a=e.endAngle,o=e.r,c=e.radius,u=e.innerRadius,d=e.outerRadius,f=e.x,h=e.y,m=e.top,y=e.left,x=e.width,v=e.height,_=e.clockWise,S=e.labelViewBox;if(S)return S;if(Ge(x)&&Ge(v)){if(Ge(f)&&Ge(h))return{x:f,y:h,width:x,height:v};if(Ge(m)&&Ge(y))return{x:m,y,width:x,height:v}}return Ge(f)&&Ge(h)?{x:f,y:h,width:0,height:0}:Ge(r)&&Ge(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:_}:e.viewBox?e.viewBox:{}},Qgt=function(e,r){return e?e===!0?P.createElement(ms,{key:"label-implicit",viewBox:r}):Ti(e)?P.createElement(ms,{key:"label-implicit",viewBox:r,value:e}):b.isValidElement(e)?e.type===ms?b.cloneElement(e,{key:"label-implicit",viewBox:r}):P.createElement(ms,{key:"label-implicit",content:e,viewBox:r}):qt(e)?P.createElement(ms,{key:"label-implicit",content:e,viewBox:r}):u0(e)?P.createElement(ms,qb({viewBox:r},e,{key:"label-implicit"})):null:null},Zgt=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,s=rve(e),a=ua(i,ms).map(function(c,u){return b.cloneElement(c,{viewBox:r||s,key:"label-".concat(u)})});if(!n)return a;var o=Qgt(e.label,r||s);return[o].concat(Ogt(a))};ms.parseViewBox=rve;ms.renderCallByParent=Zgt;var RI,cre;function Xgt(){if(cre)return RI;cre=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return RI=t,RI}var Jgt=Xgt();const eyt=Lr(Jgt);function Yb(t){"@babel/helpers - typeof";return Yb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yb(t)}var tyt=["valueAccessor"],ryt=["data","dataKey","clockWise","id","textBreakAll"];function nyt(t){return oyt(t)||ayt(t)||syt(t)||iyt()}function iyt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4349In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function syt(t,e){if(t){if(typeof t=="string")return ez(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ez(t,e)}}function ayt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function oyt(t){if(Array.isArray(t))return ez(t)}function ez(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function LC(){return LC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},LC.apply(this,arguments)}function ure(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dre(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ure(Object(r),!0).forEach(function(n){lyt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ure(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lyt(t,e,r){return e=cyt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cyt(t){var e=uyt(t,"string");return Yb(e)=="symbol"?e:e+""}function uyt(t,e){if(Yb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Yb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fre(t,e){if(t==null)return{};var r=dyt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function dyt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var fyt=function(e){return Array.isArray(e.value)?eyt(e.value):e.value};function ac(t){var e=t.valueAccessor,r=e===void 0?fyt:e,n=fre(t,tyt),i=n.data,s=n.dataKey,a=n.clockWise,o=n.id,c=n.textBreakAll,u=fre(n,ryt);return!i||!i.length?null:P.createElement(Cr,{className:"recharts-label-list"},i.map(function(d,f){var h=Ut(s)?r(d,f):Ei(d&&d.payload,s),m=Ut(o)?{}:{id:"".concat(o,"-").concat(f)};return P.createElement(ms,LC({},Ht(d,!0),u,m,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:ms.parseViewBox(Ut(a)?d:dre(dre({},d),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}ac.displayName="LabelList";function hyt(t,e){return t?t===!0?P.createElement(ac,{key:"labelList-implicit",data:e}):P.isValidElement(t)||qt(t)?P.createElement(ac,{key:"labelList-implicit",data:e,content:t}):u0(t)?P.createElement(ac,LC({data:e},t,{key:"labelList-implicit"})):null:null}function pyt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,i=ua(n,ac).map(function(a,o){return b.cloneElement(a,{data:e,key:"labelList-".concat(o)})});if(!r)return i;var s=hyt(t.label,e);return[s].concat(nyt(i))}ac.renderCallByParent=pyt;function Kb(t){"@babel/helpers - typeof";return Kb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kb(t)}function tz(){return tz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},tz.apply(this,arguments)}function hre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pre(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hre(Object(r),!0).forEach(function(n){myt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function myt(t,e,r){return e=gyt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gyt(t){var e=yyt(t,"string");return Kb(e)=="symbol"?e:e+""}function yyt(t,e){if(Kb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Kb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vyt=function(e,r){var n=dl(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},OS=function(e){var r=e.cx,n=e.cy,i=e.radius,s=e.angle,a=e.sign,o=e.isExternal,c=e.cornerRadius,u=e.cornerIsExternal,d=c*(o?1:-1)+i,f=Math.asin(c/d)/IC,h=u?s:s+a*f,m=Xi(r,n,d,h),y=Xi(r,n,i,h),x=u?s-a*f:s,v=Xi(r,n,d*Math.cos(f*IC),x);return{center:m,circleTangency:y,lineTangency:v,theta:f}},nve=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,s=e.outerRadius,a=e.startAngle,o=e.endAngle,c=vyt(a,o),u=a+c,d=Xi(r,n,s,a),f=Xi(r,n,s,u),h="M ".concat(d.x,",").concat(d.y,`
4350    A `).concat(s,",").concat(s,`,0,
4351    `).concat(+(Math.abs(c)>180),",").concat(+(a>u),`,
4352    `).concat(f.x,",").concat(f.y,`
4353  `);if(i>0){var m=Xi(r,n,i,a),y=Xi(r,n,i,u);h+="L ".concat(y.x,",").concat(y.y,`
4354            A `).concat(i,",").concat(i,`,0,
4355            `).concat(+(Math.abs(c)>180),",").concat(+(a<=u),`,
4356            `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},xyt=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,s=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,c=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,f=dl(d-u),h=OS({cx:r,cy:n,radius:s,angle:u,sign:f,cornerRadius:a,cornerIsExternal:c}),m=h.circleTangency,y=h.lineTangency,x=h.theta,v=OS({cx:r,cy:n,radius:s,angle:d,sign:-f,cornerRadius:a,cornerIsExternal:c}),_=v.circleTangency,S=v.lineTangency,k=v.theta,E=c?Math.abs(u-d):Math.abs(u-d)-x-k;if(E<0)return o?"M ".concat(y.x,",").concat(y.y,`
4357        a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
4358        a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
4359      `):nve({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var T="M ".concat(y.x,",").concat(y.y,`
4360    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
4361    A`).concat(s,",").concat(s,",0,").concat(+(E>180),",").concat(+(f<0),",").concat(_.x,",").concat(_.y,`
4362    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(S.x,",").concat(S.y,`
4363  `);if(i>0){var N=OS({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),j=N.circleTangency,M=N.lineTangency,O=N.theta,R=OS({cx:r,cy:n,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),I=R.circleTangency,B=R.lineTangency,F=R.theta,V=c?Math.abs(u-d):Math.abs(u-d)-O-F;if(V<0&&a===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(B.x,",").concat(B.y,`
4364      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
4365      A`).concat(i,",").concat(i,",0,").concat(+(V>180),",").concat(+(f>0),",").concat(j.x,",").concat(j.y,`
4366      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},byt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ive=function(e){var r=pre(pre({},byt),e),n=r.cx,i=r.cy,s=r.innerRadius,a=r.outerRadius,o=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(a<s||d===f)return null;var m=Tt("recharts-sector",h),y=a-s,x=Rp(o,y,0,!0),v;return x>0&&Math.abs(d-f)<360?v=xyt({cx:n,cy:i,innerRadius:s,outerRadius:a,cornerRadius:Math.min(x,y/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=nve({cx:n,cy:i,innerRadius:s,outerRadius:a,startAngle:d,endAngle:f}),P.createElement("path",tz({},Ht(r,!0),{className:m,d:v,role:"img"}))};function Qb(t){"@babel/helpers - typeof";return Qb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qb(t)}function rz(){return rz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rz.apply(this,arguments)}function mre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gre(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mre(Object(r),!0).forEach(function(n){wyt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wyt(t,e,r){return e=_yt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _yt(t){var e=Syt(t,"string");return Qb(e)=="symbol"?e:e+""}function Syt(t,e){if(Qb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yre={curveBasisClosed:Vlt,curveBasisOpen:Ult,curveBasis:Blt,curveBumpX:Elt,curveBumpY:jlt,curveLinearClosed:Glt,curveLinear:CN,curveMonotoneX:Wlt,curveMonotoneY:Hlt,curveNatural:qlt,curveStep:Ylt,curveStepAfter:Qlt,curveStepBefore:Klt},RS=function(e){return e.x===+e.x&&e.y===+e.y},Mv=function(e){return e.x},Av=function(e){return e.y},kyt=function(e,r){if(qt(e))return e;var n="curve".concat(kN(e));return(n==="curveMonotone"||n==="curveBump")&&r?yre["".concat(n).concat(r==="vertical"?"Y":"X")]:yre[n]||CN},Tyt=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,s=i===void 0?[]:i,a=e.baseLine,o=e.layout,c=e.connectNulls,u=c===void 0?!1:c,d=kyt(n,o),f=u?s.filter(function(x){return RS(x)}):s,h;if(Array.isArray(a)){var m=u?a.filter(function(x){return RS(x)}):a,y=f.map(function(x,v){return gre(gre({},x),{},{base:m[v]})});return o==="vertical"?h=CS().y(Av).x1(Mv).x0(function(x){return x.base.x}):h=CS().x(Mv).y1(Av).y0(function(x){return x.base.y}),h.defined(RS).curve(d),h(y)}return o==="vertical"&&Ge(a)?h=CS().y(Av).x1(Mv).x0(a):Ge(a)?h=CS().x(Mv).y1(Av).y0(a):h=cye().x(Mv).y(Av),h.defined(RS).curve(d),h(f)},sp=function(e){var r=e.className,n=e.points,i=e.path,s=e.pathRef;if((!n||!n.length)&&!i)return null;var a=n&&n.length?Tyt(e):i;return b.createElement("path",rz({},Ht(e,!1),uC(e),{className:Tt("recharts-curve",r),d:a,ref:s}))},II={exports:{}},LI,vre;function Cyt(){if(vre)return LI;vre=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return LI=t,LI}var $I,xre;function Eyt(){if(xre)return $I;xre=1;var t=Cyt();function e(){}function r(){}return r.resetWarningCache=e,$I=function(){function n(a,o,c,u,d,f){if(f!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return s.PropTypes=s,s},$I}var bre;function jyt(){return bre||(bre=1,II.exports=Eyt()()),II.exports}var Nyt=jyt();const Pr=Lr(Nyt);var Pyt=Object.getOwnPropertyNames,Myt=Object.getOwnPropertySymbols,Ayt=Object.prototype.hasOwnProperty;function wre(t,e){return function(n,i,s){return t(n,i,s)&&e(n,i,s)}}function IS(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);var s=i.cache,a=s.get(r),o=s.get(n);if(a&&o)return a===n&&o===r;s.set(r,n),s.set(n,r);var c=t(r,n,i);return s.delete(r),s.delete(n),c}}function _re(t){return Pyt(t).concat(Myt(t))}var Dyt=Object.hasOwn||(function(t,e){return Ayt.call(t,e)});function tm(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var Oyt="__v",Ryt="__o",Iyt="_owner",Sre=Object.getOwnPropertyDescriptor,kre=Object.keys;function Lyt(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function $yt(t,e){return tm(t.getTime(),e.getTime())}function Fyt(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function zyt(t,e){return t===e}function Tre(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),s=t.entries(),a,o,c=0;(a=s.next())&&!a.done;){for(var u=e.entries(),d=!1,f=0;(o=u.next())&&!o.done;){if(i[f]){f++;continue}var h=a.value,m=o.value;if(r.equals(h[0],m[0],c,f,t,e,r)&&r.equals(h[1],m[1],h[0],m[0],t,e,r)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}var Byt=tm;function Vyt(t,e,r){var n=kre(t),i=n.length;if(kre(e).length!==i)return!1;for(;i-- >0;)if(!sve(t,e,r,n[i]))return!1;return!0}function Dv(t,e,r){var n=_re(t),i=n.length;if(_re(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=n[i],!sve(t,e,r,s)||(a=Sre(t,s),o=Sre(e,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function Uyt(t,e){return tm(t.valueOf(),e.valueOf())}function Gyt(t,e){return t.source===e.source&&t.flags===e.flags}function Cre(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var c=e.values(),u=!1,d=0;(o=c.next())&&!o.done;){if(!i[d]&&r.equals(a.value,o.value,a.value,o.value,t,e,r)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Wyt(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function Hyt(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function sve(t,e,r,n){return(n===Iyt||n===Ryt||n===Oyt)&&(t.$$typeof||e.$$typeof)?!0:Dyt(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var qyt="[object Arguments]",Yyt="[object Boolean]",Kyt="[object Date]",Qyt="[object Error]",Zyt="[object Map]",Xyt="[object Number]",Jyt="[object Object]",e0t="[object RegExp]",t0t="[object Set]",r0t="[object String]",n0t="[object URL]",i0t=Array.isArray,Ere=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,jre=Object.assign,s0t=Object.prototype.toString.call.bind(Object.prototype.toString);function a0t(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,d=t.areSetsEqual,f=t.areTypedArraysEqual,h=t.areUrlsEqual;return function(y,x,v){if(y===x)return!0;
4366if(y==null||x==null)return!1;var _=typeof y;if(_!==typeof x)return!1;if(_!=="object")return _==="number"?a(y,x,v):_==="function"?i(y,x,v):!1;var S=y.constructor;if(S!==x.constructor)return!1;if(S===Object)return o(y,x,v);if(i0t(y))return e(y,x,v);if(Ere!=null&&Ere(y))return f(y,x,v);if(S===Date)return r(y,x,v);if(S===RegExp)return u(y,x,v);if(S===Map)return s(y,x,v);if(S===Set)return d(y,x,v);var k=s0t(y);return k===Kyt?r(y,x,v):k===e0t?u(y,x,v):k===Zyt?s(y,x,v):k===t0t?d(y,x,v):k===Jyt?typeof y.then!="function"&&typeof x.then!="function"&&o(y,x,v):k===n0t?h(y,x,v):k===Qyt?n(y,x,v):k===qyt?o(y,x,v):k===Yyt||k===Xyt||k===r0t?c(y,x,v):!1}}function o0t(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?Dv:Lyt,areDatesEqual:$yt,areErrorsEqual:Fyt,areFunctionsEqual:zyt,areMapsEqual:n?wre(Tre,Dv):Tre,areNumbersEqual:Byt,areObjectsEqual:n?Dv:Vyt,arePrimitiveWrappersEqual:Uyt,areRegExpsEqual:Gyt,areSetsEqual:n?wre(Cre,Dv):Cre,areTypedArraysEqual:n?Dv:Wyt,areUrlsEqual:Hyt};if(r&&(i=jre({},i,r(i))),e){var s=IS(i.areArraysEqual),a=IS(i.areMapsEqual),o=IS(i.areObjectsEqual),c=IS(i.areSetsEqual);i=jre({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return i}function l0t(t){return function(e,r,n,i,s,a,o){return t(e,r,o)}}function c0t(t){var e=t.circular,r=t.comparator,n=t.createState,i=t.equals,s=t.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?e?new WeakMap:void 0:f,m=d.meta;return r(c,u,{cache:h,equals:i,meta:m,strict:s})};if(e)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return r(c,u,a)}}var u0t=Qf();Qf({strict:!0});Qf({circular:!0});Qf({circular:!0,strict:!0});Qf({createInternalComparator:function(){return tm}});Qf({strict:!0,createInternalComparator:function(){return tm}});Qf({circular:!0,createInternalComparator:function(){return tm}});Qf({circular:!0,createInternalComparator:function(){return tm},strict:!0});function Qf(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=o0t(t),c=a0t(o),u=n?n(c):l0t(c);return c0t({circular:r,comparator:c,createState:i,equals:u,strict:a})}function d0t(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function Nre(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>e?(t(s),r=-1):d0t(i)};requestAnimationFrame(n)}function nz(t){"@babel/helpers - typeof";return nz=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nz(t)}function f0t(t){return g0t(t)||m0t(t)||p0t(t)||h0t()}function h0t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4367In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p0t(t,e){if(t){if(typeof t=="string")return Pre(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pre(t,e)}}function Pre(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m0t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function g0t(t){if(Array.isArray(t))return t}function y0t(){var t={},e=function(){return null},r=!1,n=function i(s){if(!r){if(Array.isArray(s)){if(!s.length)return;var a=s,o=f0t(a),c=o[0],u=o.slice(1);if(typeof c=="number"){Nre(i.bind(null,u),c);return}i(c),Nre(i.bind(null,u));return}nz(s)==="object"&&(t=s,e(t)),typeof s=="function"&&s()}};return{stop:function(){r=!0},start:function(s){r=!1,n(s)},subscribe:function(s){return e=s,function(){e=function(){return null}}}}}function Zb(t){"@babel/helpers - typeof";return Zb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zb(t)}function Mre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Are(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
vendor: 184,658 bytes, lines 4367-4389
4367e%2?Mre(Object(r),!0).forEach(function(n){ave(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ave(t,e,r){return e=v0t(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v0t(t){var e=x0t(t,"string");return Zb(e)==="symbol"?e:String(e)}function x0t(t,e){if(Zb(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zb(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var b0t=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(s){return i.includes(s)})})},w0t=function(e){return e},_0t=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},$x=function(e,r){return Object.keys(r).reduce(function(n,i){return Are(Are({},n),{},ave({},i,e(i,r[i])))},{})},Dre=function(e,r,n){return e.map(function(i){return"".concat(_0t(i)," ").concat(r,"ms ").concat(n)}).join(",")};function S0t(t,e){return C0t(t)||T0t(t,e)||ove(t,e)||k0t()}function k0t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4368In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T0t(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function C0t(t){if(Array.isArray(t))return t}function E0t(t){return P0t(t)||N0t(t)||ove(t)||j0t()}function j0t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4369In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ove(t,e){if(t){if(typeof t=="string")return iz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iz(t,e)}}function N0t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function P0t(t){if(Array.isArray(t))return iz(t)}function iz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var $C=1e-4,lve=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},cve=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},Ore=function(e,r){return function(n){var i=lve(e,r);return cve(i,n)}},M0t=function(e,r){return function(n){var i=lve(e,r),s=[].concat(E0t(i.map(function(a,o){return a*o}).slice(1)),[0]);return cve(s,n)}},Rre=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],s=r[1],a=r[2],o=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,s=0,a=1,o=1;break;case"ease":i=.25,s=.1,a=.25,o=1;break;case"ease-in":i=.42,s=0,a=1,o=1;break;case"ease-out":i=.42,s=0,a=.58,o=1;break;case"ease-in-out":i=0,s=0,a=.58,o=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),d=S0t(u,4);i=d[0],s=d[1],a=d[2],o=d[3]}}}var f=Ore(i,a),h=Ore(s,o),m=M0t(i,a),y=function(_){return _>1?1:_<0?0:_},x=function(_){for(var S=_>1?1:_,k=S,E=0;E<8;++E){var T=f(k)-S,N=m(k);if(Math.abs(T-S)<$C||N<$C)return h(k);k=y(k-T/N)}return h(k)};return x.isStepper=!1,x},A0t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,i=e.damping,s=i===void 0?8:i,a=e.dt,o=a===void 0?17:a,c=function(d,f,h){var m=-(d-f)*n,y=h*s,x=h+(m-y)*o/1e3,v=h*o/1e3+d;return Math.abs(v-f)<$C&&Math.abs(x)<$C?[f,0]:[v,x]};return c.isStepper=!0,c.dt=o,c},D0t=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Rre(i);case"spring":return A0t();default:if(i.split("(")[0]==="cubic-bezier")return Rre(i)}return typeof i=="function"?i:null};function Xb(t){"@babel/helpers - typeof";return Xb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xb(t)}function Ire(t){return I0t(t)||R0t(t)||uve(t)||O0t()}function O0t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4370In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R0t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function I0t(t){if(Array.isArray(t))return az(t)}function Lre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Lre(Object(r),!0).forEach(function(n){sz(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sz(t,e,r){return e=L0t(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L0t(t){var e=$0t(t,"string");return Xb(e)==="symbol"?e:String(e)}function $0t(t,e){if(Xb(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xb(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F0t(t,e){return V0t(t)||B0t(t,e)||uve(t,e)||z0t()}function z0t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4371In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uve(t,e){if(t){if(typeof t=="string")return az(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return az(t,e)}}function az(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function B0t(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function V0t(t){if(Array.isArray(t))return t}var FC=function(e,r,n){return e+(r-e)*n},oz=function(e){var r=e.from,n=e.to;return r!==n},U0t=function t(e,r,n){var i=$x(function(s,a){if(oz(a)){var o=e(a.from,a.to,a.velocity),c=F0t(o,2),u=c[0],d=c[1];return Hi(Hi({},a),{},{from:u,velocity:d})}return a},r);return n<1?$x(function(s,a){return oz(a)?Hi(Hi({},a),{},{velocity:FC(a.velocity,i[s].velocity,n),from:FC(a.from,i[s].from,n)}):a},r):t(e,i,n-1)};const G0t=(function(t,e,r,n,i){var s=b0t(t,e),a=s.reduce(function(v,_){return Hi(Hi({},v),{},sz({},_,[t[_],e[_]]))},{}),o=s.reduce(function(v,_){return Hi(Hi({},v),{},sz({},_,{from:t[_],velocity:0,to:e[_]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return $x(function(_,S){return S.from},o)},m=function(){return!Object.values(o).filter(oz).length},y=function(_){u||(u=_);var S=_-u,k=S/r.dt;o=U0t(r,o,k),i(Hi(Hi(Hi({},t),e),h())),u=_,m()||(c=requestAnimationFrame(f))},x=function(_){d||(d=_);var S=(_-d)/n,k=$x(function(T,N){return FC.apply(void 0,Ire(N).concat([r(S)]))},a);if(i(Hi(Hi(Hi({},t),e),k)),S<1)c=requestAnimationFrame(f);else{var E=$x(function(T,N){return FC.apply(void 0,Ire(N).concat([r(1)]))},a);i(Hi(Hi(Hi({},t),e),E))}};return f=r.isStepper?y:x,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}});function vy(t){"@babel/helpers - typeof";return vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vy(t)}var W0t=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function H0t(t,e){if(t==null)return{};var r=q0t(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function q0t(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function FI(t){return Z0t(t)||Q0t(t)||K0t(t)||Y0t()}function Y0t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4372In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K0t(t,e){if(t){if(typeof t=="string")return lz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lz(t,e)}}function Q0t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Z0t(t){if(Array.isArray(t))return lz(t)}function lz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$re(Object(r),!0).forEach(function(n){ox(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$re(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ox(t,e,r){return e=dve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X0t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J0t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dve(n.key),n)}}function evt(t,e,r){return e&&J0t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dve(t){var e=tvt(t,"string");return vy(e)==="symbol"?e:String(e)}function tvt(t,e){if(vy(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vy(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rvt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cz(t,e)}function cz(t,e){return cz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cz(t,e)}function nvt(t){var e=ivt();return function(){var n=zC(t),i;if(e){var s=zC(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return uz(this,i)}}function uz(t,e){if(e&&(vy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dz(t)}function dz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ivt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zC(t){return zC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zC(t)}var vl=(function(t){rvt(r,t);var e=nvt(r);function r(n,i){var s;X0t(this,r),s=e.call(this,n,i);var a=s.props,o=a.isActive,c=a.attributeName,u=a.from,d=a.to,f=a.steps,h=a.children,m=a.duration;if(s.handleStyleChange=s.handleStyleChange.bind(dz(s)),s.changeStyle=s.changeStyle.bind(dz(s)),!o||m<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),uz(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},uz(s);s.state={style:c?ox({},c,u):u}}else s.state={style:{}};return s}return evt(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,a=i.canBegin;this.mounted=!0,!(!s||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,a=s.isActive,o=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(o){if(!a){var m={style:c?ox({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(m);return}if(!(u0t(i.to,d)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=y||u?f:i.to;if(this.state&&h){var v={style:c?ox({},c,x):x};(c&&h[c]!==x||!c&&h!==x)&&this.setState(v)}this.runAnimation(Zo(Zo({},this.props),{},{from:x,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,a=i.from,o=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,m=G0t(a,o,D0t(u),c,this.changeStyle),y=function(){s.stopJSAnimation=m()};this.manager.start([h,d,y,c,f])}},{key:"runStepAnimation",value:function(i){var s=this,a=i.steps,o=i.begin,c=i.onAnimationStart,u=a[0],d=u.style,f=u.duration,h=f===void 0?0:f,m=function(x,v,_){if(_===0)return x;var S=v.duration,k=v.easing,E=k===void 0?"ease":k,T=v.style,N=v.properties,j=v.onAnimationEnd,M=_>0?a[_-1]:v,O=N||Object.keys(T);if(typeof E=="function"||E==="spring")return[].concat(FI(x),[s.runJSAnimation.bind(s,{from:M.style,to:T,duration:S,easing:E}),S]);var R=Dre(O,S,E),I=Zo(Zo(Zo({},M.style),T),{},{transition:R});return[].concat(FI(x),[I,S,j]).filter(w0t)};return this.manager.start([c].concat(FI(a.reduce(m,[d,Math.max(h,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=y0t());var s=i.begin,a=i.duration,o=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,m=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var x=o?ox({},o,c):c,v=Dre(Object.keys(x),a,u);y.start([d,s,Zo(Zo({},x),{},{transition:v}),a,f])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=H0t(i,W0t),u=b.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!o||u===0||a<=0)return s;var f=function(m){var y=m.props,x=y.style,v=x===void 0?{}:x,_=y.className,S=b.cloneElement(m,Zo(Zo({},c),{},{style:Zo(Zo({},v),d),className:_}));return S};return u===1?f(b.Children.only(s)):P.createElement("div",null,b.Children.map(s,function(h){return f(h)}))}}]),r})(b.PureComponent);vl.displayName="Animate";vl.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vl.propTypes={from:Pr.oneOfType([Pr.object,Pr.string]),to:Pr.oneOfType([Pr.object,Pr.string]),attributeName:Pr.string,duration:Pr.number,begin:Pr.number,easing:Pr.oneOfType([Pr.string,Pr.func]),steps:Pr.arrayOf(Pr.shape({duration:Pr.number.isRequired,style:Pr.object.isRequired,easing:Pr.oneOfType([Pr.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Pr.func]),properties:Pr.arrayOf("string"),onAnimationEnd:Pr.func})),children:Pr.oneOfType([Pr.node,Pr.func]),isActive:Pr.bool,canBegin:Pr.bool,onAnimationEnd:Pr.func,shouldReAnimate:Pr.bool,onAnimationStart:Pr.func,onAnimationReStart:Pr.func};function Jb(t){"@babel/helpers - typeof";return Jb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jb(t)}function BC(){return BC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},BC.apply(this,arguments)}function svt(t,e){return cvt(t)||lvt(t,e)||ovt(t,e)||avt()}function avt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4373In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ovt(t,e){if(t){if(typeof t=="string")return Fre(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fre(t,e)}}function Fre(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lvt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function cvt(t){if(Array.isArray(t))return t}function zre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bre(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zre(Object(r),!0).forEach(function(n){uvt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uvt(t,e,r){return e=dvt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dvt(t){var e=fvt(t,"string");return Jb(e)=="symbol"?e:e+""}function fvt(t,e){if(Jb(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jb(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Vre=function(e,r,n,i,s){var a=Math.min(Math.abs(n)/2,Math.abs(i)/2),o=i>=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,d;if(a>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,m=4;h<m;h++)f[h]=s[h]>a?a:s[h];d="M".concat(e,",").concat(r+o*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(e+c*f[0],",").concat(r)),d+="L ".concat(e+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
4374        `).concat(e+n,",").concat(r+o*f[1])),d+="L ".concat(e+n,",").concat(r+i-o*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
4375        `).concat(e+n-c*f[2],",").concat(r+i)),d+="L ".concat(e+c*f[3],",").concat(r+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
4376        `).concat(e,",").concat(r+i-o*f[3])),d+="Z"}else if(a>0&&s===+s&&s>0){var y=Math.min(a,s);d="M ".concat(e,",").concat(r+o*y,`
4377            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+c*y,",").concat(r,`
4378            L `).concat(e+n-c*y,",").concat(r,`
4379            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n,",").concat(r+o*y,`
4380            L `).concat(e+n,",").concat(r+i-o*y,`
4381            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n-c*y,",").concat(r+i,`
4382            L `).concat(e+c*y,",").concat(r+i,`
4383            A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e,",").concat(r+i-o*y," Z")}else d="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},hvt=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,s=r.x,a=r.y,o=r.width,c=r.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(s,s+o),d=Math.max(s,s+o),f=Math.min(a,a+c),h=Math.max(a,a+c);return n>=u&&n<=d&&i>=f&&i<=h}return!1},pvt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},XU=function(e){var r=Bre(Bre({},pvt),e),n=b.useRef(),i=b.useState(-1),s=svt(i,2),a=s[0],o=s[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var E=n.current.getTotalLength();E&&o(E)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,m=r.className,y=r.animationEasing,x=r.animationDuration,v=r.animationBegin,_=r.isAnimationActive,S=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var k=Tt("recharts-rectangle",m);return S?P.createElement(vl,{canBegin:a>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:x,animationEasing:y,isActive:S},function(E){var T=E.width,N=E.height,j=E.x,M=E.y;return P.createElement(vl,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:x,isActive:_,easing:y},P.createElement("path",BC({},Ht(r,!0),{className:k,d:Vre(j,M,T,N,h),ref:n})))}):P.createElement("path",BC({},Ht(r,!0),{className:k,d:Vre(c,u,d,f,h)}))};function fz(){return fz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fz.apply(this,arguments)}var BN=function(e){var r=e.cx,n=e.cy,i=e.r,s=e.className,a=Tt("recharts-dot",s);return r===+r&&n===+n&&i===+i?b.createElement("circle",fz({},Ht(e,!1),uC(e),{className:a,cx:r,cy:n,r:i})):null};function ew(t){"@babel/helpers - typeof";return ew=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ew(t)}var mvt=["x","y","top","left","width","height","className"];function hz(){return hz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hz.apply(this,arguments)}function Ure(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gvt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ure(Object(r),!0).forEach(function(n){yvt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ure(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yvt(t,e,r){return e=vvt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vvt(t){var e=xvt(t,"string");return ew(e)=="symbol"?e:e+""}function xvt(t,e){if(ew(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ew(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bvt(t,e){if(t==null)return{};var r=wvt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function wvt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var _vt=function(e,r,n,i,s,a){return"M".concat(e,",").concat(s,"v").concat(i,"M").concat(a,",").concat(r,"h").concat(n)},Svt=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,s=i===void 0?0:i,a=e.top,o=a===void 0?0:a,c=e.left,u=c===void 0?0:c,d=e.width,f=d===void 0?0:d,h=e.height,m=h===void 0?0:h,y=e.className,x=bvt(e,mvt),v=gvt({x:n,y:s,top:o,left:u,width:f,height:m},x);return!Ge(n)||!Ge(s)||!Ge(f)||!Ge(m)||!Ge(o)||!Ge(u)?null:P.createElement("path",hz({},Ht(v,!0),{className:Tt("recharts-cross",y),d:_vt(n,s,f,m,o,u)}))},zI,Gre;function kvt(){if(Gre)return zI;Gre=1;var t=Aye(),e=t(Object.getPrototypeOf,Object);return zI=e,zI}var BI,Wre;function Tvt(){if(Wre)return BI;Wre=1;var t=ed(),e=kvt(),r=td(),n="[object Object]",i=Function.prototype,s=Object.prototype,a=i.toString,o=s.hasOwnProperty,c=a.call(Object);function u(d){if(!r(d)||t(d)!=n)return!1;var f=e(d);if(f===null)return!0;var h=o.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&a.call(h)==c}return BI=u,BI}var Cvt=Tvt();const Evt=Lr(Cvt);var VI,Hre;function jvt(){if(Hre)return VI;Hre=1;var t=ed(),e=td(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return VI=n,VI}var Nvt=jvt();const Pvt=Lr(Nvt);function tw(t){"@babel/helpers - typeof";return tw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tw(t)}function VC(){return VC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},VC.apply(this,arguments)}function Mvt(t,e){return Rvt(t)||Ovt(t,e)||Dvt(t,e)||Avt()}function Avt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4384In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dvt(t,e){if(t){if(typeof t=="string")return qre(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qre(t,e)}}function qre(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ovt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Rvt(t){if(Array.isArray(t))return t}function Yre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kre(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yre(Object(r),!0).forEach(function(n){Ivt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ivt(t,e,r){return e=Lvt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lvt(t){var e=$vt(t,"string");return tw(e)=="symbol"?e:e+""}function $vt(t,e){if(tw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qre=function(e,r,n,i,s){var a=n-i,o;return o="M ".concat(e,",").concat(r),o+="L ".concat(e+n,",").concat(r),o+="L ".concat(e+n-a/2,",").concat(r+s),o+="L ".concat(e+n-a/2-i,",").concat(r+s),o+="L ".concat(e,",").concat(r," Z"),o},Fvt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zvt=function(e){var r=Kre(Kre({},Fvt),e),n=b.useRef(),i=b.useState(-1),s=Mvt(i,2),a=s[0],o=s[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var k=n.current.getTotalLength();k&&o(k)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,m=r.className,y=r.animationEasing,x=r.animationDuration,v=r.animationBegin,_=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var S=Tt("recharts-trapezoid",m);return _?P.createElement(vl,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:x,animationEasing:y,isActive:_},function(k){var E=k.upperWidth,T=k.lowerWidth,N=k.height,j=k.x,M=k.y;return P.createElement(vl,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:x,easing:y},P.createElement("path",VC({},Ht(r,!0),{className:S,d:Qre(j,M,E,T,N),ref:n})))}):P.createElement("g",null,P.createElement("path",VC({},Ht(r,!0),{className:S,d:Qre(c,u,d,f,h)})))},Bvt=["option","shapeType","propTransformer","activeClassName","isActive"];function rw(t){"@babel/helpers - typeof";return rw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rw(t)}function Vvt(t,e){if(t==null)return{};var r=Uvt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Uvt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Zre(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zre(Object(r),!0).forEach(function(n){Gvt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zre(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Gvt(t,e,r){return e=Wvt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wvt(t){var e=Hvt(t,"string");return rw(e)=="symbol"?e:e+""}function Hvt(t,e){if(rw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qvt(t,e){return UC(UC({},e),t)}function Yvt(t,e){return t==="symbols"}function Xre(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return P.createElement(XU,r);case"trapezoid":return P.createElement(zvt,r);case"sector":return P.createElement(ive,r);case"symbols":if(Yvt(e))return P.createElement(jN,r);break;default:return null}}function Kvt(t){return b.isValidElement(t)?t.props:t}function pz(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?qvt:n,s=t.activeClassName,a=s===void 0?"recharts-active-shape":s,o=t.isActive,c=Vvt(t,Bvt),u;if(b.isValidElement(e))u=b.cloneElement(e,UC(UC({},c),Kvt(e)));else if(qt(e))u=e(c);else if(Evt(e)&&!Pvt(e)){var d=i(e,c);u=P.createElement(Xre,{shapeType:r,elementProps:d})}else{var f=c;u=P.createElement(Xre,{shapeType:r,elementProps:f})}return o?P.createElement(Cr,{className:a},u):u}function VN(t,e){return e!=null&&"trapezoids"in t.props}function UN(t,e){return e!=null&&"sectors"in t.props}function nw(t,e){return e!=null&&"points"in t.props}function Qvt(t,e){var r,n,i=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,s=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return i&&s}function Zvt(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function Xvt(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function Jvt(t,e){var r;return VN(t,e)?r=Qvt:UN(t,e)?r=Zvt:nw(t,e)&&(r=Xvt),r}function ext(t,e){var r;return VN(t,e)?r="trapezoids":UN(t,e)?r="sectors":nw(t,e)&&(r="points"),r}function txt(t,e){if(VN(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(UN(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return nw(t,e)?e.payload:{}}function rxt(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=ext(r,e),s=txt(r,e),a=n.filter(function(c,u){var d=Ip(s,c),f=r.props[i].filter(function(y){var x=Jvt(r,e);return x(y,e)}),h=r.props[i].indexOf(f[f.length-1]),m=u===h;return d&&m}),o=n.indexOf(a[a.length-1]);return o}var UI,Jre;function nxt(){if(Jre)return UI;Jre=1;var t=Math.ceil,e=Math.max;function r(n,i,s,a){for(var o=-1,c=e(t((i-n)/(s||1)),0),u=Array(c);c--;)u[a?c:++o]=n,n+=s;return u}return UI=r,UI}var GI,ene;function fve(){if(ene)return GI;ene=1;var t=Yye(),e=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var s=i<0?-1:1;return s*r}return i===i?i:0}return GI=n,GI}var WI,tne;function ixt(){if(tne)return WI;tne=1;var t=nxt(),e=MN(),r=fve();function n(i){return function(s,a,o){return o&&typeof o!="number"&&e(s,a,o)&&(a=o=void 0),s=r(s),a===void 0?(a=s,s=0):a=r(a),o=o===void 0?s<a?1:-1:r(o),t(s,a,o,i)}}return WI=n,WI}var HI,rne;function sxt(){if(rne)return HI;rne=1;var t=ixt(),e=t();return HI=e,HI}var axt=sxt();const GC=Lr(axt);function iw(t){"@babel/helpers - typeof";return iw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iw(t)}function nne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ine(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nne(Object(r),!0).forEach(function(n){hve(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hve(t,e,r){return e=oxt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oxt(t){var e=lxt(t,"string");return iw(e)=="symbol"?e:e+""}function lxt(t,e){if(iw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(iw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var cxt=["Webkit","Moz","O","ms"],uxt=function(e,r){var n=e.replace(/(\w)/,function(s){return s.toUpperCase()}),i=cxt.reduce(function(s,a){return ine(ine({},s),{},hve({},a+n,r))},{});return i[e]=r,i};function xy(t){"@babel/helpers - typeof";return xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xy(t)}function WC(){return WC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WC.apply(this,arguments)}function sne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sne(Object(r),!0).forEach(function(n){Ta(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dxt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ane(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mve(n.key),n)}}function fxt(t,e,r){return e&&ane(t.prototype,e),r&&ane(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function hxt(t,e,r){return e=HC(e),pxt(t,pve()?Reflect.construct(e,r||[],HC(t).constructor):e.apply(t,r))}function pxt(t,e){if(e&&(xy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mxt(t)}function mxt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pve=function(){return!!t})()}function HC(t){return HC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},HC(t)}function gxt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mz(t,e)}function mz(t,e){return mz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mz(t,e)}function Ta(t,e,r){return e=mve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mve(t){var e=yxt(t,"string");return xy(e)=="symbol"?e:e+""}function yxt(t,e){if(xy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var vxt=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,s=e.x,a=e.width,o=e.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Ix().domain(GC(0,c)).range([s,s+a-o]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:d}},one=function(e){return e.changedTouches&&!!e.changedTouches.length},by=(function(t){function e(r){var n;return dxt(this,e),n=hxt(this,e,[r]),Ta(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Ta(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Ta(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,a=i.onDragEnd,o=i.startIndex;a?.({endIndex:s,startIndex:o})}),n.detachDragEndListener()}),Ta(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ta(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ta(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ta(n,"handleSlideDragStart",function(i){var s=one(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return gxt(e,t),fxt(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,a=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,f=Math.min(i,s),h=Math.max(i,s),m=e.getIndexInRange(a,f),y=e.getIndexInRange(a,h);return{startIndex:m-m%c,endIndex:y===d?d:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,a=i.tickFormatter,o=i.dataKey,c=Ei(s[n],o,n);return qt(a)?a(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,s=i.slideMoveStartX,a=i.startX,o=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,y=c.onChange,x=n.pageX-s;x>0?x=Math.min(x,u+d-f-o,u+d-f-a):x<0&&(x=Math.max(x,u-a,u-o));var v=this.getIndex({startX:a+x,endX:o+x});(v.startIndex!==h||v.endIndex!==m)&&y&&y(v),this.setState({startX:a+x,endX:o+x,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=one(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,a=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[a],d=this.props,f=d.x,h=d.width,m=d.travellerWidth,y=d.onChange,x=d.gap,v=d.data,_={startX:this.state.startX,endX:this.state.endX},S=n.pageX-s;S>0?S=Math.min(S,f+h-m-u):S<0&&(S=Math.max(S,f-u)),_[a]=u+S;var k=this.getIndex(_),E=k.startIndex,T=k.endIndex,N=function(){var M=v.length-1;return a==="startX"&&(o>c?E%x===0:T%x===0)||o<c&&T===M||a==="endX"&&(o>c?T%x===0:E%x===0)||o>c&&T===M};this.setState(Ta(Ta({},a,u+S),"brushMoveStartX",n.pageX),function(){y&&N()&&y(k)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,a=this.state,o=a.scaleValues,c=a.startX,u=a.endX,d=this.state[i],f=o.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=o.length)){var m=o[h];i==="startX"&&m>=u||i==="endX"&&m<=c||this.setState(Ta({},i,m),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.fill,u=n.stroke;return P.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:a,height:o})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.data,u=n.children,d=n.padding,f=b.Children.only(u);return f?P.cloneElement(f,{x:i,y:s,width:a,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,a,o=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,y=c.data,x=c.startIndex,v=c.endIndex,_=Math.max(n,this.props.x),S=qI(qI({},Ht(this.props,!1)),{},{x:_,y:u,width:d,height:f}),k=m||"Min value: ".concat((s=y[x])===null||s===void 0?void 0:s.name,", Max value: ").concat((a=y[v])===null||a===void 0?void 0:a.name);return P.createElement(Cr,{tabIndex:0,role:"slider","aria-label":k,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),o.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(h,S))}},{key:"renderSlide",value:function(n,i){var s=this.props,a=s.y,o=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return P.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:a,width:f,height:o})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,a=n.y,o=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,m=5,y={pointerEvents:"none",fill:u};return P.createElement(Cr,{className:"recharts-brush-texts"},P.createElement(wC,WC({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:a+o/2},y),this.getTextOfTick(i)),P.createElement(wC,WC({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:a+o/2},y),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,a=n.children,o=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,m=h.startX,y=h.endX,x=h.isTextActive,v=h.isSlideMoving,_=h.isTravellerMoving,S=h.isTravellerFocused;if(!i||!i.length||!Ge(o)||!Ge(c)||!Ge(u)||!Ge(d)||u<=0||d<=0)return null;var k=Tt("recharts-brush",s),E=P.Children.count(a)===1,T=uxt("userSelect","none");return P.createElement(Cr,{className:k,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(m,y),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(y,"endX"),(x||v||_||S||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,a=n.width,o=n.height,c=n.stroke,u=Math.floor(s+o/2)-1;return P.createElement(P.Fragment,null,P.createElement("rect",{x:i,y:s,width:a,height:o,fill:c,stroke:"none"}),P.createElement("line",{x1:i+1,y1:u,x2:i+a-1,y2:u,fill:"none",stroke:"#fff"}),P.createElement("line",{x1:i+1,y1:u+2,x2:i+a-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return P.isValidElement(n)?s=P.cloneElement(n,i):qt(n)?s=n(i):s=e.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,a=n.width,o=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return qI({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a},s&&s.length?vxt({data:s,width:a,x:o,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+a-c]);var h=i.scale.domain().map(function(m){return i.scale(m)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,a=0,o=s-1;o-a>1;){var c=Math.floor((a+o)/2);n[c]>i?o=c:a=c}return i>=n[o]?o:a}}])})(b.PureComponent);Ta(by,"displayName","Brush");Ta(by,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var YI,lne;function xxt(){if(lne)return YI;lne=1;var t=kU();function e(r,n){var i;return t(r,function(s,a,o){return i=n(s,a,o),!i}),!!i}return YI=e,YI}var KI,cne;function bxt(){if(cne)return KI;cne=1;var t=Tye(),e=Hf(),r=xxt(),n=va(),i=MN();function s(a,o,c){var u=n(a)?t:r;return c&&i(a,o,c)&&(o=void 0),u(a,e(o,3))}return KI=s,KI}var wxt=bxt();const _xt=Lr(wxt);var oc=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},QI,une;function Sxt(){if(une)return QI;une=1;var t=Uye();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return QI=e,QI}var ZI,dne;function kxt(){if(dne)return ZI;dne=1;var t=Sxt(),e=Bye(),r=Hf();function n(i,s){var a={};return s=r(s,3),e(i,function(o,c,u){t(a,c,s(o,c,u))}),a}return ZI=n,ZI}var Txt=kxt();const Cxt=Lr(Txt);var XI,fne;function Ext(){if(fne)return XI;fne=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(!r(e[n],n,e))return!1;return!0}return XI=t,XI}var JI,hne;function jxt(){if(hne)return JI;hne=1;var t=kU();function e(r,n){var i=!0;return t(r,function(s,a,o){return i=!!n(s,a,o),i}),i}return JI=e,JI}var eL,pne;function Nxt(){if(pne)return eL;pne=1;var t=Ext(),e=jxt(),r=Hf(),n=va(),i=MN();function s(a,o,c){var u=n(a)?t:e;return c&&i(a,o,c)&&(o=void 0),u(a,r(o,3))}return eL=s,eL}var Pxt=Nxt();const gve=Lr(Pxt);var Mxt=["x","y"];function sw(t){"@babel/helpers - typeof";return sw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sw(t)}function gz(){return gz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gz.apply(this,arguments)}function mne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ov(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mne(Object(r),!0).forEach(function(n){Axt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Axt(t,e,r){return e=Dxt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dxt(t){var e=Oxt(t,"string");return sw(e)=="symbol"?e:e+""}function Oxt(t,e){if(sw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rxt(t,e){if(t==null)return{};var r=Ixt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ixt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Lxt(t,e){var r=t.x,n=t.y,i=Rxt(t,Mxt),s="".concat(r),a=parseInt(s,10),o="".concat(n),c=parseInt(o,10),u="".concat(e.height||i.height),d=parseInt(u,10),f="".concat(e.width||i.width),h=parseInt(f,10);return Ov(Ov(Ov(Ov(Ov({},e),i),a?{x:a}:{}),c?{y:c}:{}),{},{height:d,width:h,name:e.name,radius:e.radius})}function gne(t){return P.createElement(pz,gz({shapeType:"rectangle",propTransformer:Lxt,activeClassName:"recharts-active-bar"},t))}var $xt=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof e=="number")return e;var s=Ge(n)||Yot(n);return s?e(n,i):(s||$p(),r)}},Fxt=["value","background"],yve;function wy(t){"@babel/helpers - typeof";return wy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wy(t)}function zxt(t,e){if(t==null)return{};var r=Bxt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Bxt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function qC(){return qC=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},qC.apply(this,arguments)}function yne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ii(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yne(Object(r),!0).forEach(function(n){Qd(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Vxt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xve(n.key),n)}}function Uxt(t,e,r){return e&&vne(t.prototype,e),r&&vne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Gxt(t,e,r){return e=YC(e),Wxt(t,vve()?Reflect.construct(e,r||[],YC(t).constructor):e.apply(t,r))}function Wxt(t,e){if(e&&(wy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hxt(t)}function Hxt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vve=function(){return!!t})()}function YC(t){return YC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},YC(t)}function qxt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yz(t,e)}function yz(t,e){return yz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yz(t,e)}function Qd(t,e,r){return e=xve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xve(t){var e=Yxt(t,"string");return wy(e)=="symbol"?e:e+""}function Yxt(t,e){if(wy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var To=(function(t){function e(){var r;Vxt(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Gxt(this,e,[].concat(i)),Qd(r,"state",{isAnimationFinished:!1}),Qd(r,"id",Xp("recharts-bar-")),Qd(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),a&&a()}),Qd(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),a&&a()}),r}return qxt(e,t),Uxt(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,s=this.props,a=s.shape,o=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Ht(this.props,!1);return n&&n.map(function(f,h){var m=h===c,y=m?u:a,x=ii(ii(ii({},d),f),{},{isActive:m,option:y,index:h,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return P.createElement(Cr,qC({className:"recharts-bar-rectangle"},jb(i.props,f,h),{key:"rectangle-".concat(f?.x,"-").concat(f?.y,"-").concat(f?.value,"-").concat(h)}),P.createElement(gne,x))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,s=i.data,a=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return P.createElement(vl,{begin:c,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var y=m.t,x=s.map(function(v,_){var S=h&&h[_];if(S){var k=Yn(S.x,v.x),E=Yn(S.y,v.y),T=Yn(S.width,v.width),N=Yn(S.height,v.height);return ii(ii({},v),{},{x:k(y),y:E(y),width:T(y),height:N(y)})}if(a==="horizontal"){var j=Yn(0,v.height),M=j(y);return ii(ii({},v),{},{y:v.y+v.height-M,height:M})}var O=Yn(0,v.width),R=O(y);return ii(ii({},v),{},{width:R})});return P.createElement(Cr,null,n.renderRectanglesStatically(x))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,s=n.isAnimationActive,a=this.state.prevData;return s&&i&&i.length&&(!a||!Ip(a,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,s=i.data,a=i.dataKey,o=i.activeIndex,c=Ht(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,h=zxt(u,Fxt);if(!f)return null;var m=ii(ii(ii(ii(ii({},h),{},{fill:"#eee"},f),c),jb(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:a,index:d,className:"recharts-bar-background-rectangle"});return P.createElement(gne,qC({key:"background-bar-".concat(d),option:n.props.background,isActive:d===o},m))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.data,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=ua(d,g0);if(!f)return null;var h=u==="vertical"?a[0].height/2:a[0].width/2,m=function(v,_){var S=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:S,errorVal:Ei(v,_)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return P.createElement(Cr,y,f.map(function(x){return P.cloneElement(x,{key:"error-bar-".concat(i,"-").concat(x.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.data,a=n.className,o=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,m=n.isAnimationActive,y=n.background,x=n.id;if(i||!s||!s.length)return null;var v=this.state.isAnimationFinished,_=Tt("recharts-bar",a),S=o&&o.allowDataOverflow,k=c&&c.allowDataOverflow,E=S||k,T=Ut(x)?this.id:x;return P.createElement(Cr,{className:_},S||k?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(T)},P.createElement("rect",{x:S?u:u-f/2,y:k?d:d-h/2,width:S?f:f*2,height:k?h:h*2}))):null,P.createElement(Cr,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(T,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,T),(!m||v)&&ac.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])})(b.PureComponent);yve=To;Qd(To,"displayName","Bar");Qd(To,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!qf.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Qd(To,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,s=t.xAxis,a=t.yAxis,o=t.xAxisTicks,c=t.yAxisTicks,u=t.stackedData,d=t.dataStartIndex,f=t.displayedData,h=t.offset,m=pgt(n,r);if(!m)return null;var y=e.layout,x=r.type.defaultProps,v=x!==void 0?ii(ii({},x),r.props):r.props,_=v.dataKey,S=v.children,k=v.minPointSize,E=y==="horizontal"?a:s,T=u?E.scale.domain():null,N=_gt({numericAxis:E}),j=ua(S,mf),M=f.map(function(O,R){var I,B,F,V,$,U;u?I=mgt(u[d+R],T):(I=Ei(O,_),Array.isArray(I)||(I=[N,I]));var z=$xt(k,yve.defaultProps.minPointSize)(I[1],R);if(y==="horizontal"){var L,W=[a.scale(I[0]),a.scale(I[1])],K=W[0],q=W[1];B=tre({axis:s,ticks:o,bandSize:i,offset:m.offset,entry:O,index:R}),F=(L=q??K)!==null&&L!==void 0?L:void 0,V=m.size;var H=K-q;if($=Number.isNaN(H)?0:H,U={x:B,y:a.y,width:V,height:a.height},Math.abs(z)>0&&Math.abs($)<Math.abs(z)){var Y=dl($||z)*(Math.abs(z)-Math.abs($));F-=Y,$+=Y}}else{var J=[s.scale(I[0]),s.scale(I[1])],re=J[0],me=J[1];if(B=re,F=tre({axis:a,ticks:c,bandSize:i,offset:m.offset,entry:O,index:R}),V=me-re,$=m.size,U={x:s.x,y:F,width:s.width,height:$},Math.abs(z)>0&&Math.abs(V)<Math.abs(z)){var oe=dl(V||z)*(Math.abs(z)-Math.abs(V));V+=oe}}return ii(ii(ii({},O),{},{x:B,y:F,width:V,height:$,value:u?I:I[1],payload:O,background:U},j&&j[R]&&j[R].props),{},{tooltipPayload:[tve(r,O)],tooltipPosition:{x:B+V/2,y:F+$/2}})});return ii({data:M,layout:y},h)});function aw(t){"@babel/helpers - typeof";return aw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aw(t)}function Kxt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bve(n.key),n)}}function Qxt(t,e,r){return e&&xne(t.prototype,e),r&&xne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function el(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bne(Object(r),!0).forEach(function(n){GN(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function GN(t,e,r){return e=bve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bve(t){var e=Zxt(t,"string");return aw(e)=="symbol"?e:e+""}function Zxt(t,e){if(aw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(aw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var JU=function(e,r,n,i,s){var a=e.width,o=e.height,c=e.layout,u=e.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},h=!!Ea(u,To);return d.reduce(function(m,y){var x=r[y],v=x.orientation,_=x.domain,S=x.padding,k=S===void 0?{}:S,E=x.mirror,T=x.reversed,N="".concat(v).concat(E?"Mirror":""),j,M,O,R,I;if(x.type==="number"&&(x.padding==="gap"||x.padding==="no-gap")){var B=_[1]-_[0],F=1/0,V=x.categoricalDomain.sort(Xot);if(V.forEach(function(J,re){re>0&&(F=Math.min((J||0)-(V[re-1]||0),F))}),Number.isFinite(F)){var $=F/B,U=x.layout==="vertical"?n.height:n.width;if(x.padding==="gap"&&(j=$*U/2),x.padding==="no-gap"){var z=Rp(e.barCategoryGap,$*U),L=$*U/2;j=L-z-(L-z)/U*z}}}i==="xAxis"?M=[n.left+(k.left||0)+(j||0),n.left+n.width-(k.right||0)-(j||0)]:i==="yAxis"?M=c==="horizontal"?[n.top+n.height-(k.bottom||0),n.top+(k.top||0)]:[n.top+(k.top||0)+(j||0),n.top+n.height-(k.bottom||0)-(j||0)]:M=x.range,T&&(M=[M[1],M[0]]);var W=fgt(x,s,h),K=W.scale,q=W.realScaleType;K.domain(_).range(M),hgt(K);var H=wgt(K,el(el({},x),{},{realScaleType:q}));i==="xAxis"?(I=v==="top"&&!E||v==="bottom"&&E,O=n.left,R=f[N]-I*x.height):i==="yAxis"&&(I=v==="left"&&!E||v==="right"&&E,O=f[N]-I*x.width,R=n.top);var Y=el(el(el({},x),H),{},{realScaleType:q,x:O,y:R,scale:K,width:i==="xAxis"?n.width:x.width,height:i==="yAxis"?n.height:x.height});return Y.bandSize=RC(Y,H),!x.hide&&i==="xAxis"?f[N]+=(I?-1:1)*Y.height:x.hide||(f[N]+=(I?-1:1)*Y.width),el(el({},m),{},GN({},y,Y))},{})},wve=function(e,r){var n=e.x,i=e.y,s=r.x,a=r.y;return{x:Math.min(n,s),y:Math.min(i,a),width:Math.abs(s-n),height:Math.abs(a-i)}},Xxt=function(e){var r=e.x1,n=e.y1,i=e.x2,s=e.y2;return wve({x:r,y:n},{x:i,y:s})},_ve=(function(){function t(e){Kxt(this,t),this.scale=e}return Qxt(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+a}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(r)+o}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new t(r)}}])})();GN(_ve,"EPS",1e-4);var e6=function(e){var r=Object.keys(e).reduce(function(n,i){return el(el({},n),{},GN({},i,_ve.create(e[i])))},{});return el(el({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,o=s.position;return Cxt(i,function(c,u){return r[u].apply(c,{bandAware:a,position:o})})},isInRange:function(i){return gve(i,function(s,a){return r[a].isInRange(s)})}})};function Jxt(t){return(t%180+180)%180}var ebt=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Jxt(i),a=s*Math.PI/180,o=Math.atan(n/r),c=a>o&&a<Math.PI-o?n/Math.sin(a):r/Math.cos(a);return Math.abs(c)},tL,wne;function tbt(){if(wne)return tL;wne=1;var t=Hf(),e=f1(),r=NN();function n(i){return function(s,a,o){var c=Object(s);if(!e(s)){var u=t(a,3);s=r(s),a=function(f){return u(c[f],f,c)}}var d=i(s,a,o);return d>-1?c[u?s[d]:d]:void 0}}return tL=n,tL}var rL,_ne;function rbt(){if(_ne)return rL;_ne=1;var t=fve();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return rL=e,rL}var nL,Sne;function nbt(){if(Sne)return nL;Sne=1;var t=Iye(),e=Hf(),r=rbt(),n=Math.max;function i(s,a,o){var c=s==null?0:s.length;if(!c)return-1;var u=o==null?0:r(o);return u<0&&(u=n(c+u,0)),t(s,e(a,3),u)}return nL=i,nL}var iL,kne;function ibt(){if(kne)return iL;kne=1;var t=tbt(),e=nbt(),r=t(e);return iL=r,iL}var sbt=ibt();const abt=Lr(sbt);var obt=Zge();const lbt=Lr(obt);var cbt=lbt(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),t6=b.createContext(void 0),r6=b.createContext(void 0),Sve=b.createContext(void 0),kve=b.createContext({}),Tve=b.createContext(void 0),Cve=b.createContext(0),Eve=b.createContext(0),Tne=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,a=e.clipPathId,o=e.children,c=e.width,u=e.height,d=cbt(s);return P.createElement(t6.Provider,{value:n},P.createElement(r6.Provider,{value:i},P.createElement(kve.Provider,{value:s},P.createElement(Sve.Provider,{value:d},P.createElement(Tve.Provider,{value:a},P.createElement(Cve.Provider,{value:u},P.createElement(Eve.Provider,{value:c},o)))))))},ubt=function(){return b.useContext(Tve)},jve=function(e){var r=b.useContext(t6);r==null&&$p();var n=r[e];return n==null&&$p(),n},dbt=function(){var e=b.useContext(t6);return Vd(e)},fbt=function(){var e=b.useContext(r6),r=abt(e,function(n){return gve(n.domain,Number.isFinite)});return r||Vd(e)},Nve=function(e){var r=b.useContext(r6);r==null&&$p();var n=r[e];return n==null&&$p(),n},hbt=function(){var e=b.useContext(Sve);return e},pbt=function(){return b.useContext(kve)},n6=function(){return b.useContext(Eve)},i6=function(){return b.useContext(Cve)};function _y(t){"@babel/helpers - typeof";return _y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_y(t)}function mbt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gbt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mve(n.key),n)}}function ybt(t,e,r){return e&&gbt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function vbt(t,e,r){return e=KC(e),xbt(t,Pve()?Reflect.construct(e,r||[],KC(t).constructor):e.apply(t,r))}function xbt(t,e){if(e&&(_y(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bbt(t)}function bbt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pve=function(){return!!t})()}function KC(t){return KC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},KC(t)}function wbt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vz(t,e)}function vz(t,e){return vz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},vz(t,e)}function Cne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ene(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cne(Object(r),!0).forEach(function(n){s6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function s6(t,e,r){return e=Mve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mve(t){var e=_bt(t,"string");return _y(e)=="symbol"?e:e+""}function _bt(t,e){if(_y(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Sbt(t,e){return Ebt(t)||Cbt(t,e)||Tbt(t,e)||kbt()}function kbt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4385In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tbt(t,e){if(t){if(typeof t=="string")return jne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jne(t,e)}}function jne(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Cbt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Ebt(t){if(Array.isArray(t))return t}function xz(){return xz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},xz.apply(this,arguments)}var jbt=function(e,r){var n;return P.isValidElement(e)?n=P.cloneElement(e,r):qt(e)?n=e(r):n=P.createElement("line",xz({},r,{className:"recharts-reference-line-line"})),n},Nbt=function(e,r,n,i,s,a,o,c,u){var d=s.x,f=s.y,h=s.width,m=s.height;if(n){var y=u.y,x=e.y.apply(y,{position:a});if(oc(u,"discard")&&!e.y.isInRange(x))return null;var v=[{x:d+h,y:x},{x:d,y:x}];return c==="left"?v.reverse():v}if(r){var _=u.x,S=e.x.apply(_,{position:a});if(oc(u,"discard")&&!e.x.isInRange(S))return null;var k=[{x:S,y:f+m},{x:S,y:f}];return o==="top"?k.reverse():k}if(i){var E=u.segment,T=E.map(function(N){return e.apply(N,{position:a})});return oc(u,"discard")&&_xt(T,function(N){return!e.isInRange(N)})?null:T}return null};function Pbt(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,s=t.yAxisId,a=t.shape,o=t.className,c=t.alwaysShow,u=ubt(),d=jve(i),f=Nve(s),h=hbt();if(!u||!h)return null;gu(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=e6({x:d.scale,y:f.scale}),y=Ti(e),x=Ti(r),v=n&&n.length===2,_=Nbt(m,y,x,v,h,t.position,d.orientation,f.orientation,t);if(!_)return null;var S=Sbt(_,2),k=S[0],E=k.x,T=k.y,N=S[1],j=N.x,M=N.y,O=oc(t,"hidden")?"url(#".concat(u,")"):void 0,R=Ene(Ene({clipPath:O},Ht(t,!0)),{},{x1:E,y1:T,x2:j,y2:M});return P.createElement(Cr,{className:Tt("recharts-reference-line",o)},jbt(a,R),ms.renderCallByParent(t,Xxt({x1:E,y1:T,x2:j,y2:M})))}var WN=(function(t){function e(){return mbt(this,e),vbt(this,e,arguments)}return wbt(e,t),ybt(e,[{key:"render",value:function(){return P.createElement(Pbt,this.props)}}])})(P.Component);s6(WN,"displayName","ReferenceLine");s6(WN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function bz(){return bz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},bz.apply(this,arguments)}function Sy(t){"@babel/helpers - typeof";return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sy(t)}function Nne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pne(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nne(Object(r),!0).forEach(function(n){HN(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Mbt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Abt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dve(n.key),n)}}function Dbt(t,e,r){return e&&Abt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Obt(t,e,r){return e=QC(e),Rbt(t,Ave()?Reflect.construct(e,r||[],QC(t).constructor):e.apply(t,r))}function Rbt(t,e){if(e&&(Sy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ibt(t)}function Ibt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ave(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ave=function(){return!!t})()}function QC(t){return QC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},QC(t)}function Lbt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wz(t,e)}function wz(t,e){return wz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},wz(t,e)}function HN(t,e,r){return e=Dve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dve(t){var e=$bt(t,"string");return Sy(e)=="symbol"?e:e+""}function $bt(t,e){if(Sy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Sy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Fbt=function(e){var r=e.x,n=e.y,i=e.xAxis,s=e.yAxis,a=e6({x:i.scale,y:s.scale}),o=a.apply({x:r,y:n},{bandAware:!0});return oc(e,"discard")&&!a.isInRange(o)?null:o},qN=(function(t){function e(){return Mbt(this,e),Obt(this,e,arguments)}return Lbt(e,t),Dbt(e,[{key:"render",value:function(){var n=this.props,i=n.x,s=n.y,a=n.r,o=n.alwaysShow,c=n.clipPathId,u=Ti(i),d=Ti(s);if(gu(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Fbt(this.props);if(!f)return null;var h=f.x,m=f.y,y=this.props,x=y.shape,v=y.className,_=oc(this.props,"hidden")?"url(#".concat(c,")"):void 0,S=Pne(Pne({clipPath:_},Ht(this.props,!0)),{},{cx:h,cy:m});return P.createElement(Cr,{className:Tt("recharts-reference-dot",v)},e.renderDot(x,S),ms.renderCallByParent(this.props,{x:h-a,y:m-a,width:2*a,height:2*a}))}}])})(P.Component);HN(qN,"displayName","ReferenceDot");HN(qN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});HN(qN,"renderDot",function(t,e){var r;return P.isValidElement(t)?r=P.cloneElement(t,e):qt(t)?r=t(e):r=P.createElement(BN,bz({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function _z(){return _z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_z.apply(this,arguments)}function ky(t){"@babel/helpers - typeof";return ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ky(t)}function Mne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ane(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mne(Object(r),!0).forEach(function(n){YN(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zbt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bbt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rve(n.key),n)}}function Vbt(t,e,r){return e&&Bbt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ubt(t,e,r){return e=ZC(e),Gbt(t,Ove()?Reflect.construct(e,r||[],ZC(t).constructor):e.apply(t,r))}function Gbt(t,e){if(e&&(ky(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wbt(t)}function Wbt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ove(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ove=function(){return!!t})()}function ZC(t){return ZC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ZC(t)}function Hbt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sz(t,e)}function Sz(t,e){return Sz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sz(t,e)}function YN(t,e,r){return e=Rve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rve(t){var e=qbt(t,"string");return ky(e)=="symbol"?e:e+""}function qbt(t,e){if(ky(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ky(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ybt=function(e,r,n,i,s){var a=s.x1,o=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var h=e6({x:d.scale,y:f.scale}),m={x:e?h.x.apply(a,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},y={x:r?h.x.apply(o,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return oc(s,"discard")&&(!h.isInRange(m)||!h.isInRange(y))?null:wve(m,y)},KN=(function(t){function e(){return zbt(this,e),Ubt(this,e,arguments)}return Hbt(e,t),Vbt(e,[{key:"render",value:function(){var n=this.props,i=n.x1,s=n.x2,a=n.y1,o=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;gu(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ti(i),h=Ti(s),m=Ti(a),y=Ti(o),x=this.props.shape;if(!f&&!h&&!m&&!y&&!x)return null;var v=Ybt(f,h,m,y,this.props);if(!v&&!x)return null;var _=oc(this.props,"hidden")?"url(#".concat(d,")"):void 0;return P.createElement(Cr,{className:Tt("recharts-reference-area",c)},e.renderRect(x,Ane(Ane({clipPath:_},Ht(this.props,!0)),v)),ms.renderCallByParent(this.props,v))}}])})(P.Component);YN(KN,"displayName","ReferenceArea");YN(KN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});YN(KN,"renderRect",function(t,e){var r;return P.isValidElement(t)?r=P.cloneElement(t,e):qt(t)?r=t(e):r=P.createElement(XU,_z({},e,{className:"recharts-reference-area-rect"})),r});function Ive(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],i=0;i<t.length;i+=e)n.push(t[i]);return n}function Kbt(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return ebt(n,r)}function Qbt(t,e,r){var n=r==="width",i=t.x,s=t.y,a=t.width,o=t.height;return e===1?{start:n?i:s,end:n?i+a:s+o}:{start:n?i+a:s+o,end:n?i:s}}function XC(t,e,r,n,i){if(t*e<t*n||t*e>t*i)return!1;var s=r();return t*(e-t*s/2-n)>=0&&t*(e+t*s/2-i)<=0}function Zbt(t,e){return Ive(t,e+1)}function Xbt(t,e,r,n,i){for(var s=(n||[]).slice(),a=e.start,o=e.end,c=0,u=1,d=a,f=function(){var y=n?.[c];if(y===void 0)return{v:Ive(n,u)};var x=c,v,_=function(){return v===void 0&&(v=r(y,x)),v},S=y.coordinate,k=c===0||XC(t,S,_,d,o);k||(c=0,d=a,u+=1),k&&(d=S+t*(_()/2+i),c+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function ow(t){"@babel/helpers - typeof";return ow=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ow(t)}function Dne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function us(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dne(Object(r),!0).forEach(function(n){Jbt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jbt(t,e,r){return e=ewt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ewt(t){var e=twt(t,"string");return ow(e)=="symbol"?e:e+""}function twt(t,e){if(ow(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ow(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rwt(t,e,r,n,i){for(var s=(n||[]).slice(),a=s.length,o=e.start,c=e.end,u=function(h){var m=s[h],y,x=function(){return y===void 0&&(y=r(m,h)),y};if(h===a-1){var v=t*(m.coordinate+t*x()/2-c);s[h]=m=us(us({},m),{},{tickCoord:v>0?m.coordinate-v*t:m.coordinate})}else s[h]=m=us(us({},m),{},{tickCoord:m.coordinate});var _=XC(t,m.tickCoord,x,o,c);_&&(c=m.tickCoord-t*(x()/2+i),s[h]=us(us({},m),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return s}function nwt(t,e,r,n,i,s){var a=(n||[]).slice(),o=a.length,c=e.start,u=e.end;if(s){var d=n[o-1],f=r(d,o-1),h=t*(d.coordinate+t*f/2-u);a[o-1]=d=us(us({},d),{},{tickCoord:h>0?d.coordinate-h*t:d.coordinate});var m=XC(t,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-t*(f/2+i),a[o-1]=us(us({},d),{},{isShow:!0}))}for(var y=s?o-1:o,x=function(S){var k=a[S],E,T=function(){return E===void 0&&(E=r(k,S)),E};if(S===0){var N=t*(k.coordinate-t*T()/2-c);a[S]=k=us(us({},k),{},{tickCoord:N<0?k.coordinate-N*t:k.coordinate})}else a[S]=k=us(us({},k),{},{tickCoord:k.coordinate});var j=XC(t,k.tickCoord,T,c,u);j&&(c=k.tickCoord+t*(T()/2+i),a[S]=us(us({},k),{},{isShow:!0}))},v=0;v<y;v++)x(v);return a}function a6(t,e,r){var n=t.tick,i=t.ticks,s=t.viewBox,a=t.minTickGap,o=t.orientation,c=t.interval,u=t.tickFormatter,d=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(Ge(c)||qf.isSsr)return Zbt(i,typeof c=="number"&&Ge(c)?c:0);var h=[],m=o==="top"||o==="bottom"?"width":"height",y=d&&m==="width"?Rx(d,{fontSize:e,letterSpacing:r}):{width:0,height:0},x=function(k,E){var T=qt(u)?u(k.value,E):k.value;return m==="width"?Kbt(Rx(T,{fontSize:e,letterSpacing:r}),y,f):Rx(T,{fontSize:e,letterSpacing:r})[m]},v=i.length>=2?dl(i[1].coordinate-i[0].coordinate):1,_=Qbt(s,v,m);return c==="equidistantPreserveStart"?Xbt(v,_,x,i,a):(c==="preserveStart"||c==="preserveStartEnd"?h=nwt(v,_,x,i,a,c==="preserveStartEnd"):h=rwt(v,_,x,i,a),h.filter(function(S){return S.isShow}))}var iwt=["viewBox"],swt=["viewBox"],awt=["ticks"];function Ty(t){"@babel/helpers - typeof";return Ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ty(t)}function dg(){return dg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},dg.apply(this,arguments)}function One(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?One(Object(r),!0).forEach(function(n){o6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):One(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sL(t,e){if(t==null)return{};var r=owt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function owt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function lwt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$ve(n.key),n)}}function cwt(t,e,r){return e&&Rne(t.prototype,e),r&&Rne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function uwt(t,e,r){return e=JC(e),dwt(t,Lve()?Reflect.construct(e,r||[],JC(t).constructor):e.apply(t,r))}function dwt(t,e){if(e&&(Ty(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fwt(t)}function fwt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Lve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lve=function(){return!!t})()}function JC(t){return JC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},JC(t)}function hwt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kz(t,e)}function kz(t,e){return kz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kz(t,e)}function o6(t,e,r){return e=$ve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ve(t){var e=pwt(t,"string");return Ty(e)=="symbol"?e:e+""}function pwt(t,e){if(Ty(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ty(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var y0=(function(t){function e(r){var n;return lwt(this,e),n=uwt(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return hwt(e,t),cwt(e,[{key:"shouldComponentUpdate",value:function(n,i){var s=n.viewBox,a=sL(n,iwt),o=this.props,c=o.viewBox,u=sL(o,swt);return!Eg(s,c)||!Eg(a,u)||!Eg(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.x,a=i.y,o=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,m,y,x,v,_,S,k=f?-1:1,E=n.tickSize||d,T=Ge(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":m=y=n.coordinate,v=a+ +!f*c,x=v-k*E,S=x-k*h,_=T;break;case"left":x=v=n.coordinate,y=s+ +!f*o,m=y-k*E,_=m-k*h,S=T;break;case"right":x=v=n.coordinate,y=s+ +f*o,m=y+k*E,_=m+k*h,S=T;break;default:m=y=n.coordinate,v=a+ +f*c,x=v+k*E,S=x+k*h,_=T;break}return{line:{x1:m,y1:x,x2:y,y2:v},tick:{x:_,y:S}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,a;switch(i){case"left":a=s?"start":"end";break;case"right":a=s?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,a="end";switch(i){case"left":case"right":a="middle";break;case"top":a=s?"start":"end";break;default:a=s?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,s=n.y,a=n.width,o=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=xi(xi(xi({},Ht(this.props,!1)),Ht(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=xi(xi({},f),{},{x1:i,y1:s+h*o,x2:i+a,y2:s+h*o})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=xi(xi({},f),{},{x1:i+m*a,y1:s,x2:i+m*a,y2:s+o})}return P.createElement("line",dg({},f,{className:Tt("recharts-cartesian-axis-line",ko(d,"className"))}))}},{key:"renderTicks",value:function(n,i,s){var a=this,o=this.props,c=o.tickLine,u=o.stroke,d=o.tick,f=o.tickFormatter,h=o.unit,m=a6(xi(xi({},this.props),{},{ticks:n}),i,s),y=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),v=Ht(this.props,!1),_=Ht(d,!1),S=xi(xi({},v),{},{fill:"none"},Ht(c,!1)),k=m.map(function(E,T){var N=a.getTickLineCoord(E),j=N.line,M=N.tick,O=xi(xi(xi(xi({textAnchor:y,verticalAnchor:x},v),{},{stroke:"none",fill:u},_),M),{},{index:T,payload:E,visibleTicksCount:m.length,tickFormatter:f});return P.createElement(Cr,dg({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},jb(a.props,E,T)),c&&P.createElement("line",dg({},S,j,{className:Tt("recharts-cartesian-axis-tick-line",ko(c,"className"))})),d&&e.renderTickItem(d,O,"".concat(qt(f)?f(E.value,T):E.value).concat(h||"")))});return P.createElement("g",{className:"recharts-cartesian-axis-ticks"},k)}},{key:"render",value:function(){var n=this,i=this.props,s=i.axisLine,a=i.width,o=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,m=sL(f,awt),y=h;return qt(c)&&(y=h&&h.length>0?c(this.props):c(m)),a<=0||o<=0||!y||!y.length?null:P.createElement(Cr,{className:Tt("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},s&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),ms.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var a,o=Tt(i.className,"recharts-cartesian-axis-tick-value");return P.isValidElement(n)?a=P.cloneElement(n,xi(xi({},i),{},{className:o})):qt(n)?a=n(xi(xi({},i),{},{className:o})):a=P.createElement(wC,dg({},i,{className:"recharts-cartesian-axis-tick-value"}),s),a}}])})(b.Component);o6(y0,"displayName","CartesianAxis");o6(y0,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var mwt=["x1","y1","x2","y2","key"],gwt=["offset"];function Fp(t){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fp(t)}function Ine(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ine(Object(r),!0).forEach(function(n){ywt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ine(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ywt(t,e,r){return e=vwt(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vwt(t){var e=xwt(t,"string");return Fp(e)=="symbol"?e:e+""}function xwt(t,e){if(Fp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Fp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gh(){return Gh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Gh.apply(this,arguments)}function Lne(t,e){if(t==null)return{};var r=bwt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function bwt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var wwt=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,i=e.x,s=e.y,a=e.width,o=e.height,c=e.ry;return P.createElement("rect",{x:i,y:s,ry:c,width:a,height:o,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Fve(t,e){var r;if(P.isValidElement(t))r=P.cloneElement(t,e);else if(qt(t))r=t(e);else{var n=e.x1,i=e.y1,s=e.x2,a=e.y2,o=e.key,c=Lne(e,mwt),u=Ht(c,!1);u.offset;var d=Lne(u,gwt);r=P.createElement("line",Gh({},d,{x1:n,y1:i,x2:s,y2:a,fill:"none",key:o}))}return r}function _wt(t){var e=t.x,r=t.width,n=t.horizontal,i=n===void 0?!0:n,s=t.horizontalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=gs(gs({},t),{},{x1:e,y1:o,x2:e+r,y2:o,key:"line-".concat(c),index:c});return Fve(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function Swt(t){var e=t.y,r=t.height,n=t.vertical,i=n===void 0?!0:n,s=t.verticalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=gs(gs({},t),{},{x1:o,y1:e,x2:o,y2:e+r,key:"line-".concat(c),index:c});return Fve(i,u)});return P.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function kwt(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,s=t.width,a=t.height,o=t.horizontalPoints,c=t.horizontal,u=c===void 0?!0:c;if(!u||!e||!e.length)return null;var d=o.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var y=!d[m+1],x=y?i+a-h:d[m+1]-h;if(x<=0)return null;var v=m%e.length;return P.createElement("rect",{key:"react-".concat(m),y:h,x:n,height:x,width:s,stroke:"none",fill:e[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Twt(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,s=t.x,a=t.y,o=t.width,c=t.height,u=t.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,m){return h-m});s!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var y=!d[m+1],x=y?s+o-h:d[m+1]-h;if(x<=0)return null;var v=m%n.length;return P.createElement("rect",{key:"react-".concat(m),x:h,y:a,width:x,height:c,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Cwt=function(e,r){var n=e.xAxis,i=e.width,s=e.height,a=e.offset;return J0e(a6(gs(gs(gs({},y0.defaultProps),n),{},{ticks:lu(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.left,a.left+a.width,r)},Ewt=function(e,r){var n=e.yAxis,i=e.width,s=e.height,a=e.offset;return J0e(a6(gs(gs(gs({},y0.defaultProps),n),{},{ticks:lu(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.top,a.top+a.height,r)},zm={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function v0(t){var e,r,n,i,s,a,o=n6(),c=i6(),u=pbt(),d=gs(gs({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:zm.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:zm.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:zm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:zm.horizontalFill,vertical:(s=t.vertical)!==null&&s!==void 0?s:zm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:zm.verticalFill,x:Ge(t.x)?t.x:u.left,y:Ge(t.y)?t.y:u.top,width:Ge(t.width)?t.width:u.width,height:Ge(t.height)?t.height:u.height}),f=d.x,h=d.y,m=d.width,y=d.height,x=d.syncWithTicks,v=d.horizontalValues,_=d.verticalValues,S=dbt(),k=fbt();if(!Ge(m)||m<=0||!Ge(y)||y<=0||!Ge(f)||f!==+f||!Ge(h)||h!==+h)return null;var E=d.verticalCoordinatesGenerator||Cwt,T=d.horizontalCoordinatesGenerator||Ewt,N=d.horizontalPoints,j=d.verticalPoints;if((!N||!N.length)&&qt(T)){var M=v&&v.length,O=T({yAxis:k?gs(gs({},k),{},{ticks:M?v:k.ticks}):void 0,width:o,height:c,offset:u},M?!0:x);gu(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Fp(O),"]")),Array.isArray(O)&&(N=O)}if((!j||!j.length)&&qt(E)){var R=_&&_.length,I=E({xAxis:S?gs(gs({},S),{},{ticks:R?_:S.ticks}):void 0,width:o,height:c,offset:u},R?!0:x);gu(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Fp(I),"]")),Array.isArray(I)&&(j=I)}return P.createElement("g",{className:"recharts-cartesian-grid"},P.createElement(wwt,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),P.createElement(_wt,Gh({},d,{offset:u,horizontalPoints:N,xAxis:S,yAxis:k})),P.createElement(Swt,Gh({},d,{offset:u,verticalPoints:j,xAxis:S,yAxis:k})),P.createElement(kwt,Gh({},d,{horizontalPoints:N})),P.createElement(Twt,Gh({},d,{verticalPoints:j})))}v0.displayName="CartesianGrid";var jwt=["type","layout","connectNulls","ref"],Nwt=["key"];function Cy(t){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cy(t)}function $ne(t,e){if(t==null)return{};var r=Pwt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Pwt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Fx(){return Fx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Fx.apply(this,arguments)}function Fne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ka(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fne(Object(r),!0).forEach(function(n){tl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bm(t){return Owt(t)||Dwt(t)||Awt(t)||Mwt()}function Mwt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4386In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Awt(t,e){if(t){if(typeof t=="string")return Tz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tz(t,e)}}function Dwt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Owt(t){if(Array.isArray(t))return Tz(t)}function Tz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rwt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bve(n.key),n)}}function Iwt(t,e,r){return e&&zne(t.prototype,e),r&&zne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lwt(t,e,r){return e=eE(e),$wt(t,zve()?Reflect.construct(e,r||[],eE(t).constructor):e.apply(t,r))}function $wt(t,e){if(e&&(Cy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fwt(t)}function Fwt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zve=function(){return!!t})()}function eE(t){return eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eE(t)}function zwt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cz(t,e)}function Cz(t,e){return Cz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Cz(t,e)}function tl(t,e,r){return e=Bve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bve(t){var e=Bwt(t,"string");return Cy(e)=="symbol"?e:e+""}function Bwt(t,e){if(Cy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Cy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gc=(function(t){function e(){var r;Rwt(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Lwt(this,e,[].concat(i)),tl(r,"state",{isAnimationFinished:!0,totalLength:0}),tl(r,"generateSimpleStrokeDasharray",function(a,o){return"".concat(o,"px ").concat(a-o,"px")}),tl(r,"getStrokeDasharray",function(a,o,c){var u=c.reduce(function(_,S){return _+S});if(!u)return r.generateSimpleStrokeDasharray(o,a);for(var d=Math.floor(a/u),f=a%u,h=o-a,m=[],y=0,x=0;y<c.length;x+=c[y],++y)if(x+c[y]>f){m=[].concat(Bm(c.slice(0,y)),[f-x]);break}var v=m.length%2===0?[0,h]:[h];return[].concat(Bm(e.repeat(c,d)),Bm(m),v).map(function(_){return"".concat(_,"px")}).join(", ")}),tl(r,"id",Xp("recharts-line-")),tl(r,"pathRef",function(a){r.mainCurve=a}),tl(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),tl(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return zwt(e,t),Iwt(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=ua(d,g0);if(!f)return null;var h=function(x,v){return{x:x.x,y:x.y,value:x.value,errorVal:Ei(x.payload,v)}},m={clipPath:n?"url(#clipPath-".concat(i,")"):null};return P.createElement(Cr,m,f.map(function(y){return P.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,s){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,d=o.dataKey,f=Ht(this.props,!1),h=Ht(c,!0),m=u.map(function(x,v){var _=ka(ka(ka({key:"dot-".concat(v),r:3},f),h),{},{index:v,cx:x.x,cy:x.y,value:x.value,dataKey:d,payload:x.payload,points:u});return e.renderDotItem(c,_)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return P.createElement(Cr,Fx({className:"recharts-line-dots",key:"dots"},y),m)}},{key:"renderCurveStatically",value:function(n,i,s,a){var o=this.props,c=o.type,u=o.layout,d=o.connectNulls;o.ref;var f=$ne(o,jwt),h=ka(ka(ka({},Ht(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:n},a),{},{type:c,layout:u,connectNulls:d});return P.createElement(sp,Fx({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var s=this,a=this.props,o=a.points,c=a.strokeDasharray,u=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,m=a.animationId,y=a.animateNewValues,x=a.width,v=a.height,_=this.state,S=_.prevPoints,k=_.totalLength;return P.createElement(vl,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var T=E.t;if(S){var N=S.length/o.length,j=o.map(function(B,F){var V=Math.floor(F*N);if(S[V]){var $=S[V],U=Yn($.x,B.x),z=Yn($.y,B.y);return ka(ka({},B),{},{x:U(T),y:z(T)})}if(y){var L=Yn(x*2,B.x),W=Yn(v/2,B.y);return ka(ka({},B),{},{x:L(T),y:W(T)})}return ka(ka({},B),{},{x:B.x,y:B.y})});return s.renderCurveStatically(j,n,i)}var M=Yn(0,k),O=M(T),R;if(c){var I="".concat(c).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});R=s.getStrokeDasharray(O,k,I)}else R=s.generateSimpleStrokeDasharray(k,O);return s.renderCurveStatically(o,n,i,{strokeDasharray:R})})}},{key:"renderCurve",value:function(n,i){var s=this.props,a=s.points,o=s.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return o&&a&&a.length&&(!u&&d>0||!Ip(u,a))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(a,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,a=i.dot,o=i.points,c=i.className,u=i.xAxis,d=i.yAxis,f=i.top,h=i.left,m=i.width,y=i.height,x=i.isAnimationActive,v=i.id;if(s||!o||!o.length)return null;var _=this.state.isAnimationFinished,S=o.length===1,k=Tt("recharts-line",c),E=u&&u.allowDataOverflow,T=d&&d.allowDataOverflow,N=E||T,j=Ut(v)?this.id:v,M=(n=Ht(a,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},O=M.r,R=O===void 0?3:O,I=M.strokeWidth,B=I===void 0?2:I,F=rye(a)?a:{},V=F.clipDot,$=V===void 0?!0:V,U=R*2+B;return P.createElement(Cr,{className:k},E||T?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(j)},P.createElement("rect",{x:E?h:h-m/2,y:T?f:f-y/2,width:E?m:m*2,height:T?y:y*2})),!$&&P.createElement("clipPath",{id:"clipPath-dots-".concat(j)},P.createElement("rect",{x:h-U/2,y:f-U/2,width:m+U,height:y+U}))):null,!S&&this.renderCurve(N,j),this.renderErrorBar(N,j),(S||a)&&this.renderDots(N,$,j),(!x||_)&&ac.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var s=n.length%2!==0?[].concat(Bm(n),[0]):n,a=[],o=0;o<i;++o)a=[].concat(Bm(a),Bm(s));return a}},{key:"renderDotItem",value:function(n,i){var s;if(P.isValidElement(n))s=P.cloneElement(n,i);else if(qt(n))s=n(i);else{var a=i.key,o=$ne(i,Nwt),c=Tt("recharts-line-dot",typeof n!="boolean"?n.className:"");s=P.createElement(BN,Fx({key:a},o,{className:c}))}return s}}])})(b.PureComponent);tl(gc,"displayName","Line");tl(gc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!qf.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});tl(gc,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,s=t.yAxisTicks,a=t.dataKey,o=t.bandSize,c=t.displayedData,u=t.offset,d=e.layout,f=c.map(function(h,m){var y=Ei(h,a);return d==="horizontal"?{x:yy({axis:r,ticks:i,bandSize:o,entry:h,index:m}),y:Ut(y)?null:n.scale(y),value:y,payload:h}:{x:Ut(y)?null:r.scale(y),y:yy({axis:n,ticks:s,bandSize:o,entry:h,index:m}),value:y,payload:h}});return ka({points:f,layout:d},u)});var Vwt=["layout","type","stroke","connectNulls","isRange","ref"],Uwt=["key"],Vve;function Ey(t){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ey(t)}function Uve(t,e){if(t==null)return{};var r=Gwt(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Gwt(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Wh(){return Wh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Wh.apply(this,arguments)}function Bne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Md(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Bne(Object(r),!0).forEach(function(n){Hl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Wwt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wve(n.key),n)}}function Hwt(t,e,r){return e&&Vne(t.prototype,e),r&&Vne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qwt(t,e,r){return e=tE(e),Ywt(t,Gve()?Reflect.construct(e,r||[],tE(t).constructor):e.apply(t,r))}function Ywt(t,e){if(e&&(Ey(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kwt(t)}function Kwt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gve=function(){return!!t})()}function tE(t){return tE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tE(t)}function Qwt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ez(t,e)}function Ez(t,e){return Ez=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ez(t,e)}function Hl(t,e,r){return e=Wve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wve(t){var e=Zwt(t,"string");return Ey(e)=="symbol"?e:e+""}function Zwt(t,e){if(Ey(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ey(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Gu=(function(t){function e(){var r;Wwt(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=qwt(this,e,[].concat(i)),Hl(r,"state",{isAnimationFinished:!0}),Hl(r,"id",Xp("recharts-area-")),Hl(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),qt(a)&&a()}),Hl(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),qt(a)&&a()}),r}return Qwt(e,t),Hwt(e,[{key:"renderDots",value:function(n,i,s){var a=this.props.isAnimationActive,o=this.state.isAnimationFinished;if(a&&!o)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=Ht(this.props,!1),m=Ht(u,!0),y=d.map(function(v,_){var S=Md(Md(Md({key:"dot-".concat(_),r:3},h),m),{},{index:_,cx:v.x,cy:v.y,dataKey:f,value:v.value,payload:v.payload,points:d});return e.renderDotItem(u,S)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return P.createElement(Cr,Wh({className:"recharts-area-dots"},x),y)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,s=i.baseLine,a=i.points,o=i.strokeWidth,c=a[0].x,u=a[a.length-1].x,d=n*Math.abs(c-u),f=Kd(a.map(function(h){return h.y||0}));return Ge(s)&&typeof s=="number"?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(Kd(s.map(function(h){return h.y||0})),f)),Ge(f)?P.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(o?parseInt("".concat(o),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,s=i.baseLine,a=i.points,o=i.strokeWidth,c=a[0].y,u=a[a.length-1].y,d=n*Math.abs(c-u),f=Kd(a.map(function(h){return h.x||0}));return Ge(s)&&typeof s=="number"?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(Kd(s.map(function(h){return h.x||0})),f)),Ge(f)?P.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(o?parseInt("".concat(o),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,s,a){var o=this.props,c=o.layout,u=o.type,d=o.stroke,f=o.connectNulls,h=o.isRange;o.ref;var m=Uve(o,Vwt);return P.createElement(Cr,{clipPath:s?"url(#clipPath-".concat(a,")"):null},P.createElement(sp,Wh({},Ht(m,!0),{points:n,connectNulls:f,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&P.createElement(sp,Wh({},Ht(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&h&&P.createElement(sp,Wh({},Ht(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var s=this,a=this.props,o=a.points,c=a.baseLine,u=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,m=a.animationId,y=this.state,x=y.prevPoints,v=y.prevBaseLine;return P.createElement(vl,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var S=_.t;if(x){var k=x.length/o.length,E=o.map(function(M,O){var R=Math.floor(O*k);if(x[R]){var I=x[R],B=Yn(I.x,M.x),F=Yn(I.y,M.y);return Md(Md({},M),{},{x:B(S),y:F(S)})}return M}),T;if(Ge(c)&&typeof c=="number"){var N=Yn(v,c);T=N(S)}else if(Ut(c)||d0(c)){var j=Yn(v,0);T=j(S)}else T=c.map(function(M,O){var R=Math.floor(O*k);if(v[R]){var I=v[R],B=Yn(I.x,M.x),F=Yn(I.y,M.y);return Md(Md({},M),{},{x:B(S),y:F(S)})}return M});return s.renderAreaStatically(E,T,n,i)}return P.createElement(Cr,null,P.createElement("defs",null,P.createElement("clipPath",{id:"animationClipPath-".concat(i)},s.renderClipRect(S))),P.createElement(Cr,{clipPath:"url(#animationClipPath-".concat(i,")")},s.renderAreaStatically(o,c,n,i)))})}},{key:"renderArea",value:function(n,i){var s=this.props,a=s.points,o=s.baseLine,c=s.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&a&&a.length&&(!d&&h>0||!Ip(d,a)||!Ip(f,o))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(a,o,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,a=i.dot,o=i.points,c=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,m=i.width,y=i.height,x=i.isAnimationActive,v=i.id;if(s||!o||!o.length)return null;var _=this.state.isAnimationFinished,S=o.length===1,k=Tt("recharts-area",c),E=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,N=E||T,j=Ut(v)?this.id:v,M=(n=Ht(a,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},O=M.r,R=O===void 0?3:O,I=M.strokeWidth,B=I===void 0?2:I,F=rye(a)?a:{},V=F.clipDot,$=V===void 0?!0:V,U=R*2+B;return P.createElement(Cr,{className:k},E||T?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(j)},P.createElement("rect",{x:E?d:d-m/2,y:T?u:u-y/2,width:E?m:m*2,height:T?y:y*2})),!$&&P.createElement("clipPath",{id:"clipPath-dots-".concat(j)},P.createElement("rect",{x:d-U/2,y:u-U/2,width:m+U,height:y+U}))):null,S?null:this.renderArea(N,j),(a||S)&&this.renderDots(N,$,j),(!x||_)&&ac.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})(b.PureComponent);Vve=Gu;Hl(Gu,"displayName","Area");Hl(Gu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!qf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Hl(Gu,"getBaseValue",function(t,e,r,n){var i=t.layout,s=t.baseValue,a=e.props.baseValue,o=a??s;if(Ge(o)&&typeof o=="number")return o;var c=i==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return o==="dataMin"?f:o==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]});Hl(Gu,"getComposedData",function(t){var e=t.props,r=t.item,n=t.xAxis,i=t.yAxis,s=t.xAxisTicks,a=t.yAxisTicks,o=t.bandSize,c=t.dataKey,u=t.stackedData,d=t.dataStartIndex,f=t.displayedData,h=t.offset,m=e.layout,y=u&&u.length,x=Vve.getBaseValue(e,r,n,i),v=m==="horizontal",_=!1,S=f.map(function(E,T){var N;y?N=u[d+T]:(N=Ei(E,c),Array.isArray(N)?_=!0:N=[x,N]);var j=N[1]==null||y&&Ei(E,c)==null;return v?{x:yy({axis:n,ticks:s,bandSize:o,entry:E,index:T}),y:j?null:i.scale(N[1]),value:N,payload:E}:{x:j?null:n.scale(N[1]),y:yy({axis:i,ticks:a,bandSize:o,entry:E,index:T}),value:N,payload:E}}),k;return y||_?k=S.map(function(E){var T=Array.isArray(E.value)?E.value[0]:null;return v?{x:E.x,y:T!=null&&E.y!=null?i.scale(T):null}:{x:T!=null?n.scale(T):null,y:E.y}}):k=v?i.scale(x):n.scale(x),Md({points:S,baseLine:k,layout:m,isRange:_},h)});Hl(Gu,"renderDotItem",function(t,e){var r;if(P.isValidElement(t))r=P.cloneElement(t,e);else if(qt(t))r=t(e);else{var n=Tt("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,s=Uve(e,Uwt);r=P.createElement(BN,Wh({},s,{key:i,className:n}))}return r});function jy(t){"@babel/helpers - typeof";return jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jy(t)}function Xwt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jwt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yve(n.key),n)}}function e1t(t,e,r){return e&&Jwt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function t1t(t,e,r){return e=rE(e),r1t(t,Hve()?Reflect.construct(e,r||[],rE(t).constructor):e.apply(t,r))}function r1t(t,e){if(e&&(jy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n1t(t)}function n1t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Hve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hve=function(){return!!t})()}function rE(t){return rE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rE(t)}function i1t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jz(t,e)}function jz(t,e){return jz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},jz(t,e)}function qve(t,e,r){return e=Yve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yve(t){var e=s1t(t,"string");return jy(e)=="symbol"?e:e+""}function s1t(t,e){if(jy(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(jy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var QN=(function(t){function e(){return Xwt(this,e),t1t(this,e,arguments)}return i1t(e,t),e1t(e,[{key:"render",value:function(){return null}}])})(b.Component);qve(QN,"displayName","ZAxis");qve(QN,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var a1t=["option","isActive"];function zx(){return zx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},zx.apply(this,arguments)}function o1t(t,e){if(t==null)return{};var r=l1t(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function l1t(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function c1t(t){var e=t.option,r=t.isActive,n=o1t(t,a1t);return typeof e=="string"?b.createElement(pz,zx({option:b.createElement(jN,zx({type:e},n)),isActive:r,shapeType:"symbols"},n)):b.createElement(pz,zx({option:e,isActive:r,shapeType:"symbols"},n))}function Ny(t){"@babel/helpers - typeof";return Ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ny(t)}function Bx(){return Bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Bx.apply(this,arguments)}function Une(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function co(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Une(Object(r),!0).forEach(function(n){Zd(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Une(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function u1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qve(n.key),n)}}function d1t(t,e,r){return e&&Gne(t.prototype,e),r&&Gne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f1t(t,e,r){return e=nE(e),h1t(t,Kve()?Reflect.construct(e,r||[],nE(t).constructor):e.apply(t,r))}function h1t(t,e){if(e&&(Ny(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p1t(t)}function p1t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kve=function(){return!!t})()}function nE(t){return nE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nE(t)}function m1t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nz(t,e)}function Nz(t,e){return Nz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nz(t,e)}function Zd(t,e,r){return e=Qve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qve(t){var e=g1t(t,"string");return Ny(e)=="symbol"?e:e+""}function g1t(t,e){if(Ny(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ny(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ZN=(function(t){function e(){var r;u1t(this,e);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=f1t(this,e,[].concat(i)),Zd(r,"state",{isAnimationFinished:!1}),Zd(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0})}),Zd(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1})}),Zd(r,"id",Xp("recharts-scatter-")),r}return m1t(e,t),d1t(e,[{key:"renderSymbolsStatically",value:function(n){var i=this,s=this.props,a=s.shape,o=s.activeShape,c=s.activeIndex,u=Ht(this.props,!1);return n.map(function(d,f){var h=c===f,m=h?o:a,y=co(co({},u),d);return P.createElement(Cr,Bx({className:"recharts-scatter-symbol",key:"symbol-".concat(d?.cx,"-").concat(d?.cy,"-").concat(d?.size,"-").concat(f)},jb(i.props,d,f),{role:"img"}),P.createElement(c1t,Bx({option:m,isActive:h,key:"symbol-".concat(f)},y)))})}},{key:"renderSymbolsWithAnimation",value:function(){var n=this,i=this.props,s=i.points,a=i.isAnimationActive,o=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state.prevPoints;return P.createElement(vl,{begin:o,duration:c,isActive:a,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var m=h.t,y=s.map(function(x,v){var _=f&&f[v];if(_){var S=Yn(_.cx,x.cx),k=Yn(_.cy,x.cy),E=Yn(_.size,x.size);return co(co({},x),{},{cx:S(m),cy:k(m),size:E(m)})}var T=Yn(0,x.size);return co(co({},x),{},{size:T(m)})});return P.createElement(Cr,null,n.renderSymbolsStatically(y))})}},{key:"renderSymbols",value:function(){var n=this.props,i=n.points,s=n.isAnimationActive,a=this.state.prevPoints;return s&&i&&i.length&&(!a||!Ip(a,i))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(i)}},{key:"renderErrorBar",value:function(){var n=this.props.isAnimationActive;if(n&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.points,a=i.xAxis,o=i.yAxis,c=i.children,u=ua(c,g0);return u?u.map(function(d,f){var h=d.props,m=h.direction,y=h.dataKey;return P.cloneElement(d,{key:"".concat(m,"-").concat(y,"-").concat(s[f]),data:s,xAxis:a,yAxis:o,layout:m==="x"?"vertical":"horizontal",dataPointFormatter:function(v,_){return{x:v.cx,y:v.cy,value:m==="x"?+v.node.x:+v.node.y,errorVal:Ei(v,_)}}})}):null}},{key:"renderLine",value:function(){var n=this.props,i=n.points,s=n.line,a=n.lineType,o=n.lineJointType,c=Ht(this.props,!1),u=Ht(s,!1),d,f;if(a==="joint")d=i.map(function(k){return{x:k.cx,y:k.cy}});else if(a==="fitting"){var h=Zot(i),m=h.xmin,y=h.xmax,x=h.a,v=h.b,_=function(E){return x*E+v};d=[{x:m,y:_(m)},{x:y,y:_(y)}]}var S=co(co(co({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return P.isValidElement(s)?f=P.cloneElement(s,S):qt(s)?f=s(S):f=P.createElement(sp,Bx({},S,{type:o})),P.createElement(Cr,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.points,a=n.line,o=n.className,c=n.xAxis,u=n.yAxis,d=n.left,f=n.top,h=n.width,m=n.height,y=n.id,x=n.isAnimationActive;if(i||!s||!s.length)return null;var v=this.state.isAnimationFinished,_=Tt("recharts-scatter",o),S=c&&c.allowDataOverflow,k=u&&u.allowDataOverflow,E=S||k,T=Ut(y)?this.id:y;return P.createElement(Cr,{className:_,clipPath:E?"url(#clipPath-".concat(T,")"):null},S||k?P.createElement("defs",null,P.createElement("clipPath",{id:"clipPath-".concat(T)},P.createElement("rect",{x:S?d:d-h/2,y:k?f:f-m/2,width:S?h:h*2,height:k?m:m*2}))):null,a&&this.renderLine(),this.renderErrorBar(),P.createElement(Cr,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!x||v)&&ac.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}}])})(b.PureComponent);Zd(ZN,"displayName","Scatter");Zd(ZN,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!qf.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});Zd(ZN,"getComposedData",function(t){var e=t.xAxis,r=t.yAxis,n=t.zAxis,i=t.item,s=t.displayedData,a=t.xAxisTicks,o=t.yAxisTicks,c=t.offset,u=i.props.tooltipType,d=ua(i.props.children,mf),f=Ut(e.dataKey)?i.props.dataKey:e.dataKey,h=Ut(r.dataKey)?i.props.dataKey:r.dataKey,m=n&&n.dataKey,y=n?n.range:QN.defaultProps.range,x=y&&y[0],v=e.scale.bandwidth?e.scale.bandwidth():0,_=r.scale.bandwidth?r.scale.bandwidth():0,S=s.map(function(k,E){var T=Ei(k,f),N=Ei(k,h),j=!Ut(m)&&Ei(k,m)||"-",M=[{name:Ut(e.dataKey)?i.props.name:e.name||e.dataKey,unit:e.unit||"",value:T,payload:k,dataKey:f,type:u},{name:Ut(r.dataKey)?i.props.name:r.name||r.dataKey,unit:r.unit||"",value:N,payload:k,dataKey:h,type:u}];j!=="-"&&M.push({name:n.name||n.dataKey,unit:n.unit||"",value:j,payload:k,dataKey:m,type:u});var O=yy({axis:e,ticks:a,bandSize:v,entry:k,index:E,dataKey:f}),R=yy({axis:r,ticks:o,bandSize:_,entry:k,index:E,dataKey:h}),I=j!=="-"?n.scale(j):x,B=Math.sqrt(Math.max(I,0)/Math.PI);return co(co({},k),{},{cx:O,cy:R,x:O-B,y:R-B,xAxis:e,yAxis:r,zAxis:n,width:2*B,height:2*B,size:I,node:{x:T,y:N,z:j},tooltipPayload:M,tooltipPosition:{x:O,y:R},payload:k},d&&d[E]&&d[E].props)});return co({points:S},c)});function Py(t){"@babel/helpers - typeof";return Py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Py(t)}function y1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v1t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jve(n.key),n)}}function x1t(t,e,r){return e&&v1t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function b1t(t,e,r){return e=iE(e),w1t(t,Zve()?Reflect.construct(e,r||[],iE(t).constructor):e.apply(t,r))}function w1t(t,e){if(e&&(Py(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _1t(t)}function _1t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zve=function(){return!!t})()}function iE(t){return iE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},iE(t)}function S1t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pz(t,e)}function Pz(t,e){return Pz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Pz(t,e)}function Xve(t,e,r){return e=Jve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jve(t){var e=k1t(t,"string");return Py(e)=="symbol"?e:e+""}function k1t(t,e){if(Py(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Py(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Mz(){return Mz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Mz.apply(this,arguments)}function T1t(t){var e=t.xAxisId,r=n6(),n=i6(),i=jve(e);return i==null?null:b.createElement(y0,Mz({},i,{className:Tt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(a){return lu(a,!0)}}))}var Cc=(function(t){function e(){return y1t(this,e),b1t(this,e,arguments)}return S1t(e,t),x1t(e,[{key:"render",value:function(){return b.createElement(T1t,this.props)}}])})(b.Component);Xve(Cc,"displayName","XAxis");Xve(Cc,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function My(t){"@babel/helpers - typeof";return My=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},My(t)}function C1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E1t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rxe(n.key),n)}}function j1t(t,e,r){return e&&E1t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function N1t(t,e,r){return e=sE(e),P1t(t,exe()?Reflect.construct(e,r||[],sE(t).constructor):e.apply(t,r))}function P1t(t,e){if(e&&(My(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M1t(t)}function M1t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function exe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(exe=function(){return!!t})()}function sE(t){return sE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sE(t)}function A1t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Az(t,e)}function Az(t,e){return Az=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Az(t,e)}function txe(t,e,r){return e=rxe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rxe(t){var e=D1t(t,"string");return My(e)=="symbol"?e:e+""}function D1t(t,e){if(My(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(My(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Dz(){return Dz=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Dz.apply(this,arguments)}var O1t=function(e){var r=e.yAxisId,n=n6(),i=i6(),s=Nve(r);return s==null?null:b.createElement(y0,Dz({},s,{className:Tt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(o){return lu(o,!0)}}))},Co=(function(t){function e(){return C1t(this,e),N1t(this,e,arguments)}return A1t(e,t),j1t(e,[{key:"render",value:function(){return b.createElement(O1t,this.props)}}])})(b.Component);txe(Co,"displayName","YAxis");txe(Co,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function Wne(t){return $1t(t)||L1t(t)||I1t(t)||R1t()}function R1t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4387In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I1t(t,e){if(t){if(typeof t=="string")return Oz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oz(t,e)}}function L1t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $1t(t){if(Array.isArray(t))return Oz(t)}function Oz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Rz=function(e,r,n,i,s){var a=ua(e,WN),o=ua(e,qN),c=[].concat(Wne(a),Wne(o)),u=ua(e,KN),d="".concat(i,"Id"),f=i[0],h=r;if(c.length&&(h=c.reduce(function(x,v){if(v.props[d]===n&&oc(v.props,"extendDomain")&&Ge(v.props[f])){var _=v.props[f];return[Math.min(x[0],_),Math.max(x[1],_)]}return x},h)),u.length){var m="".concat(f,"1"),y="".concat(f,"2");h=u.reduce(function(x,v){if(v.props[d]===n&&oc(v.props,"extendDomain")&&Ge(v.props[m])&&Ge(v.props[y])){var _=v.props[m],S=v.props[y];return[Math.min(x[0],_,S),Math.max(x[1],_,S)]}return x},h)}return s&&s.length&&(h=s.reduce(function(x,v){return Ge(v)?[Math.min(x[0],v),Math.max(x[1],v)]:x},h)),h},aL={exports:{}},Hne;function F1t(){return Hne||(Hne=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,f||c,h),y=r?r+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)e.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,y=new Array(m);h<m;h++)y[h]=f[h].fn;return y},o.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,d,f,h,m,y){var x=r?r+u:u;if(!this._events[x])return!1;var v=this._events[x],_=arguments.length,S,k;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),_){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,m),!0;case 6:return v.fn.call(v.context,d,f,h,m,y),!0}for(k=1,S=new Array(_-1);k<_;k++)S[k-1]=arguments[k];v.fn.apply(v.context,S)}else{var E=v.length,T;for(k=0;k<E;k++)switch(v[k].once&&this.removeListener(u,v[k].fn,void 0,!0),_){case 1:v[k].fn.call(v[k].context);break;case 2:v[k].fn.call(v[k].context,d);break;case 3:v[k].fn.call(v[k].context,d,f);break;case 4:v[k].fn.call(v[k].context,d,f,h);break;default:if(!S)for(T=1,S=new Array(_-1);T<_;T++)S[T-1]=arguments[T];v[k].fn.apply(v[k].context,S)}}return!0},o.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},o.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},o.prototype.removeListener=function(u,d,f,h){var m=r?r+u:u;if(!this._events[m])return this;if(!d)return a(this,m),this;var y=this._events[m];if(y.fn)y.fn===d&&(!h||y.once)&&(!f||y.context===f)&&a(this,m);else{for(var x=0,v=[],_=y.length;x<_;x++)(y[x].fn!==d||h&&!y[x].once||f&&y[x].context!==f)&&v.push(y[x]);v.length?this._events[m]=v.length===1?v[0]:v:a(this,m)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&a(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(aL)),aL.exports}var z1t=F1t();const B1t=Lr(z1t);var oL=new B1t,lL="recharts.syncMouseEvents";function lw(t){"@babel/helpers - typeof";return lw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lw(t)}function V1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U1t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nxe(n.key),n)}}function G1t(t,e,r){return e&&U1t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function cL(t,e,r){return e=nxe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nxe(t){var e=W1t(t,"string");return lw(e)=="symbol"?e:e+""}function W1t(t,e){if(lw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var H1t=(function(){function t(){V1t(this,t),cL(this,"activeIndex",0),cL(this,"coordinateList",[]),cL(this,"layout","horizontal")}return G1t(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,s=i===void 0?null:i,a=r.container,o=a===void 0?null:a,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(n=s??this.coordinateList)!==null&&n!==void 0?n:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,a=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=s+c+u,h=a+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])})();function q1t(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t?.[0],i=t?.[1];if(n&&i&&Ge(n)&&Ge(i))return!0}return!1}function Y1t(t,e,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-i,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function ixe(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,s=t.endAngle,a=Xi(e,r,n,i),o=Xi(e,r,n,s);return{points:[a,o],cx:e,cy:r,radius:n,startAngle:i,endAngle:s}}function K1t(t,e,r){var n,i,s,a;if(t==="horizontal")n=e.x,s=n,i=r.top,a=r.top+r.height;else if(t==="vertical")i=e.y,a=i,n=r.left,s=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var o=e.cx,c=e.cy,u=e.innerRadius,d=e.outerRadius,f=e.angle,h=Xi(o,c,u,f),m=Xi(o,c,d,f);n=h.x,i=h.y,s=m.x,a=m.y}else return ixe(e);return[{x:n,y:i},{x:s,y:a}]}function cw(t){"@babel/helpers - typeof";return cw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cw(t)}function qne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function LS(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qne(Object(r),!0).forEach(function(n){Q1t(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Q1t(t,e,r){return e=Z1t(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z1t(t){var e=X1t(t,"string");return cw(e)=="symbol"?e:e+""}function X1t(t,e){if(cw(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cw(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function J1t(t){var e,r,n=t.element,i=t.tooltipEventType,s=t.isActive,a=t.activeCoordinate,o=t.activePayload,c=t.offset,u=t.activeTooltipIndex,d=t.tooltipAxisBandSize,f=t.layout,h=t.chartName,m=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!s||!a||h!=="ScatterChart"&&i!=="axis")return null;var y,x=sp;if(h==="ScatterChart")y=a,x=Svt;else if(h==="BarChart")y=Y1t(f,a,c,d),x=XU;else if(f==="radial"){var v=ixe(a),_=v.cx,S=v.cy,k=v.radius,E=v.startAngle,T=v.endAngle;y={cx:_,cy:S,startAngle:E,endAngle:T,innerRadius:k,outerRadius:k},x=ive}else y={points:K1t(f,a,c)},x=sp;var N=LS(LS(LS(LS({stroke:"#ccc",pointerEvents:"none"},c),y),Ht(m,!1)),{},{payload:o,payloadIndex:u,className:Tt("recharts-tooltip-cursor",m.className)});return b.isValidElement(m)?b.cloneElement(m,N):b.createElement(x,N)}var e_t=["item"],t_t=["children","className","width","height","style","compact","title","desc"];function Ay(t){"@babel/helpers - typeof";return Ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ay(t)}function fg(){return fg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fg.apply(this,arguments)}function Yne(t,e){return i_t(t)||n_t(t,e)||axe(t,e)||r_t()}function r_t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4388In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n_t(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,u=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function i_t(t){if(Array.isArray(t))return t}function Kne(t,e){if(t==null)return{};var r=s_t(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function s_t(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function a_t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o_t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oxe(n.key),n)}}function l_t(t,e,r){return e&&o_t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c_t(t,e,r){return e=aE(e),u_t(t,sxe()?Reflect.construct(e,r||[],aE(t).constructor):e.apply(t,r))}function u_t(t,e){if(e&&(Ay(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d_t(t)}function d_t(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sxe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sxe=function(){return!!t})()}function aE(t){return aE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},aE(t)}function f_t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Iz(t,e)}function Iz(t,e){return Iz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Iz(t,e)}function Dy(t){return m_t(t)||p_t(t)||axe(t)||h_t()}function h_t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4389In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function axe(t,e){if(t){if(typeof t=="string")return Lz(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lz(t,e)}}function p_t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function m_t(t){if(Array.isArray(t))return Lz(t)}function Lz(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Qne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qne(Object(r),!0).forEach(function(n){Dt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Dt(t,e,r){return e=oxe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oxe(t){var e=g_t(t,"string");return Ay(e)=="symbol"?e:e+""}function g_t(t,e){if(Ay(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ay(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var y_t={xAxis:["bottom","top"],yAxis:["left","right"]},v_t={width:"100%",height:"100%"},lxe={x:0,y:0};function $S(t){return t}var x_t=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},b_t=function(e,r,n,i){var s=r.find(function(d){return d&&d.index===n});if(s){if(e==="horizontal")return{x:s.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:s.coordinate};if(e==="centric"){var a=s.coordinate,o=i.radius;return xe(xe(xe({},i),Xi(i.cx,i.cy,o,a)),{},{angle:a,radius:o})}var c=s.coordinate,u=i.angle;return xe(xe(xe({},i),Xi(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return lxe},XN=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,s=r.dataEndIndex,a=(n??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(Dy(o),Dy(u)):o},[]);return a.length>0?a:e&&e.length&&Ge(i)&&Ge(s)?e.slice(i,s+1):[]};function cxe(t){return t==="number"?[0,"auto"]:void 0}var $z=function(e,r,n,i){var s=e.graphicalItems,a=e.tooltipAxis,o=XN(r,e);return n<0||!s||!s.length||n>=o.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var h;if(a.dataKey&&!a.allowDuplicatedCategory){var m=f===void 0?o:f;h=cC(m,a.dataKey,i)}else h=f&&f[n]||o[n];return h?[].concat(Dy(c),[tve(u,h)]):c},[])},Zne=function(e,r,n,i){var s=i||{x:e.chartX,y:e.chartY},a=x_t(s,n),o=e.orderedTooltipTicks,c=e.tooltipAxis,u=e.tooltipTicks,d=agt(a,o,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=$z(e,r,d,f),m=b_t(n,o,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},w_t=function(e,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,a=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,f=e.children,h=e.stackOffset,m=X0e(d,s);return n.reduce(function(y,x){var v,_=x.type.defaultProps!==void 0?xe(xe({},x.type.defaultProps),x.props):x.props,S=_.type,k=_.dataKey,E=_.allowDataOverflow,T=_.allowDuplicatedCategory,N=_.scale,j=_.ticks,M=_.includeHidden,O=_[a];if(y[O])return y;var R=XN(e.data,{graphicalItems:i.filter(function(H){var Y,J=a in H.props?H.props[a]:(Y=H.type.defaultProps)===null||Y===void 0?void 0:Y[a];return J===O}),dataStartIndex:c,dataEndIndex:u}),I=R.length,B,F,V;q1t(_.domain,E,S)&&(B=X5(_.domain,null,E),m&&(S==="number"||N!=="auto")&&(V=Lx(R,k,"category")));var $=cxe(S);if(!B||B.length===0){var U,z=(U=_.domain)!==null&&U!==void 0?U:$;if(k){if(B=Lx(R,k,S),S==="category"&&m){var L=Qot(B);T&&L?(F=B,B=GC(0,I)):T||(B=ire(z,B,x).reduce(function(H,Y){return H.indexOf(Y)>=0?H:[].concat(Dy(H),[Y])},[]))}else if(S==="category")T?B=B.filter(function(H){return H!==""&&!Ut(H)}):B=ire(z,B,x).reduce(function(H,Y){return H.indexOf(Y)>=0||Y===""||Ut(Y)?H:[].concat(Dy(H),[Y])},[]);else if(S==="number"){var W=dgt(R,i.filter(function(H){var Y,J,re=a in H.props?H.props[a]:(Y=H.type.defaultProps)===null||Y===void 0?void 0:Y[a],me="hide"in H.props?H.props.hide:(J=H.type.defaultProps)===null||J===void 0?void 0:J.hide;return re===O&&(M||!me)}),k,s,d);W&&(B=W)}m&&(S==="number"||N!=="auto")&&(V=Lx(R,k,"category"))}else m?B=GC(0,I):o&&o[O]&&o[O].hasStack&&S==="number"?B=h==="expand"?[0,1]:eve(o[O].stackGroups,c,u):B=Z0e(R,i.filter(function(H){var Y=a in H.props?H.props[a]:H.type.defaultProps[a],J="hide"in H.props?H.props.hide:H.type.defaultProps.hide;return Y===O&&(M||!J)}),S,d,!0);if(S==="number")B=Rz(f,B,O,s,j),z&&(B=X5(z,B,E));else if(S==="category"&&z){var K=z,q=B.every(function(H){return K.indexOf(H)>=0});q&&(B=K)}}return xe(xe({},y),{},Dt({},O,xe(xe({},_),{},{axisType:s,domain:B,categoricalDomain:V,duplicateDomain:F,originalDomain:(v=_.domain)!==null&&v!==void 0?v:$,isCategorical:m,layout:d})))},{})},__t=function(e,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,a=r.axisIdKey,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,f=e.children,h=XN(e.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),m=h.length,y=X0e(d,s),x=-1;return n.reduce(function(v,_){var S=_.type.defaultProps!==void 0?xe(xe({},_.type.defaultProps),_.props):_.props,k=S[a],E=cxe("number");if(!v[k]){x++;var T;return y?T=GC(0,m):o&&o[k]&&o[k].hasStack?(T=eve(o[k].stackGroups,c,u),T=Rz(f,T,k,s)):(T=X5(E,Z0e(h,n.filter(function(N){var j,M,O=a in N.props?N.props[a]:(j=N.type.defaultProps)===null||j===void 0?void 0:j[a],R="hide"in N.props?N.props.hide:(M=N.type.defaultProps)===null||M===void 0?void 0:M.hide;return O===k&&!R}),"number",d),i.defaultProps.allowDataOverflow),T=Rz(f,T,k,s)),xe(xe({},v),{},Dt({},k,xe(xe({axisType:s},i.defaultProps),{},{hide:!0,orientation:ko(y_t,"".concat(s,".").concat(x%2),null),domain:T,originalDomain:E,isCategorical:y,layout:d})))}return v},{})},S_t=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,a=r.graphicalItems,o=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.children,f="".concat(i,"Id"),h=ua(d,s),m={};return h&&h.length?m=w_t(e,{axes:h,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):a&&a.length&&(m=__t(e,{Axis:s,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),m},k_t=function(e){var r=Vd(e),n=lu(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:TU(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:RC(r,n)}},Xne=function(e){var r=e.children,n=e.defaultShowTooltip,i=Ea(r,by),s=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},T_t=function(e){return!e||!e.length?!1:e.some(function(r){var n=mu(r&&r.type);return n&&n.indexOf("Bar")>=0})},Jne=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},C_t=function(e,r){var n=e.props,i=e.graphicalItems,s=e.xAxisMap,a=s===void 0?{}:s,o=e.yAxisMap,c=o===void 0?{}:o,u=n.width,d=n.height,f=n.children,h=n.margin||{},m=Ea(f,by),y=Ea(f,jg),x=Object.keys(c).reduce(function(T,N){var j=c[N],M=j.orientation;return!j.mirror&&!j.hide?xe(xe({},T),{},Dt({},M,T[M]+j.width)):T},{left:h.left||0,right:h.right||0}),v=Object.keys(a).reduce(function(T,N){var j=a[N],M=j.orientation;return!j.mirror&&!j.hide?xe(xe({},T),{},Dt({},M,ko(T,"".concat(M))+j.height)):T},{top:h.top||0,bottom:h.bottom||0}),_=xe(xe({},v),x),S=_.bottom;m&&(_.bottom+=m.props.height||by.defaultProps.height),y&&r&&(_=cgt(_,i,n,r));var k=u-_.left-_.right,E=d-_.top-_.bottom;return xe(xe({brushBottom:S},_),{},{width:Math.max(k,0),height:Math.max(E,0)})},E_t=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},l6=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,s=i===void 0?"axis":i,a=e.validateTooltipEventTypes,o=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,h=function(_,S){var k=S.graphicalItems,E=S.stackGroups,T=S.offset,N=S.updateId,j=S.dataStartIndex,M=S.dataEndIndex,O=_.barSize,R=_.layout,I=_.barGap,B=_.barCategoryGap,F=_.maxBarSize,V=Jne(R),$=V.numericAxisName,U=V.cateAxisName,z=T_t(k),L=[];return k.forEach(function(W,K){var q=XN(_.data,{graphicalItems:[W],dataStartIndex:j,dataEndIndex:M}),H=W.type.defaultProps!==void 0?xe(xe({},W.type.defaultProps),W.props):W.props,Y=H.dataKey,J=H.maxBarSize,re=H["".concat($,"Id")],me=H["".concat(U,"Id")],oe={},ge=c.reduce(function(ae,de){var Ee=S["".concat(de.axisType,"Map")],Me=H["".concat(de.axisType,"Id")];Ee&&Ee[Me]||de.axisType==="zAxis"||$p();var Te=Ee[Me];return xe(xe({},ae),{},Dt(Dt({},de.axisType,Te),"".concat(de.axisType,"Ticks"),lu(Te)))},oe),le=ge[U],Se=ge["".concat(U,"Ticks")],Ce=E&&E[re]&&E[re].hasStack&&Sgt(W,E[re].stackGroups),he=mu(W.type).indexOf("Bar")>=0,Ct=RC(le,Se),De=[],It=z&&ogt({barSize:O,stackGroups:E,totalSize:E_t(ge,U)});if(he){var Yt,Qt,Qr=Ut(J)?F:J,gr=(Yt=(Qt=RC(le,Se,!0))!==null&&Qt!==void 0?Qt:Qr)!==null&&Yt!==void 0?Yt:0;De=lgt({barGap:I,barCategoryGap:B,bandSize:gr!==Ct?gr:Ct,sizeList:It[me],maxBarSize:Qr}),gr!==Ct&&(De=De.map(function(ae){return xe(xe({},ae),{},{position:xe(xe({},ae.position),{},{offset:ae.position.offset-gr/2})})}))}var X=W&&W.type&&W.type.getComposedData;X&&L.push({props:xe(xe({},X(xe(xe({},ge),{},{displayedData:q,props:_,dataKey:Y,item:W,bandSize:Ct,barPosition:De,offset:T,stackedData:Ce,layout:R,dataStartIndex:j,dataEndIndex:M}))),{},Dt(Dt(Dt({key:W.key||"item-".concat(K)},$,ge[$]),U,ge[U]),"animationId",N)),childIndex:clt(W,_.children),item:W})}),L},m=function(_,S){var k=_.props,E=_.dataStartIndex,T=_.dataEndIndex,N=_.updateId;if(!xX({props:k}))return null;var j=k.children,M=k.layout,O=k.stackOffset,R=k.data,I=k.reverseStackOrder,B=Jne(M),F=B.numericAxisName,V=B.cateAxisName,$=ua(j,n),U=bgt(R,$,"".concat(F,"Id"),"".concat(V,"Id"),O,I),z=c.reduce(function(H,Y){var J="".concat(Y.axisType,"Map");return xe(xe({},H),{},Dt({},J,S_t(k,xe(xe({},Y),{},{graphicalItems:$,stackGroups:Y.axisType===F&&U,dataStartIndex:E,dataEndIndex:T}))))},{}),L=C_t(xe(xe({},z),{},{props:k,graphicalItems:$}),S?.legendBBox);Object.keys(z).forEach(function(H){z[H]=d(k,z[H],L,H.replace("Map",""),r)});var W=z["".concat(V,"Map")],K=k_t(W),q=h(k,xe(xe({},z),{},{dataStartIndex:E,dataEndIndex:T,updateId:N,graphicalItems:$,stackGroups:U,offset:L}));return xe(xe({formattedGraphicalItems:q,graphicalItems:$,offset:L,stackGroups:U},K),z)},y=(function(v){function _(S){var k,E,T;return a_t(this,_),T=c_t(this,_,[S]),Dt(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Dt(T,"accessibilityManager",new H1t),Dt(T,"handleLegendBBoxUpdate",function(N){if(N){var j=T.state,M=j.dataStartIndex,O=j.dataEndIndex,R=j.updateId;T.setState(xe({legendBBox:N},m({props:T.props,dataStartIndex:M,dataEndIndex:O,updateId:R},xe(xe({},T.state),{},{legendBBox:N}))))}}),Dt(T,"handleReceiveSyncEvent",function(N,j,M){if(T.props.syncId===N){if(M===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(j)}}),Dt(T,"handleBrushChange",function(N){var j=N.startIndex,M=N.endIndex;if(j!==T.state.dataStartIndex||M!==T.state.dataEndIndex){var O=T.state.updateId;T.setState(function(){return xe({dataStartIndex:j,dataEndIndex:M},m({props:T.props,dataStartIndex:j,dataEndIndex:M,updateId:O},T.state))}),T.triggerSyncEvent({dataStartIndex:j,dataEndIndex:M})}}),Dt(T,"handleMouseEnter",function(N){var j=T.getMouseInfo(N);if(j){var M=xe(xe({},j),{},{isTooltipActive:!0});T.setState(M),T.triggerSyncEvent(M);var O=T.props.onMouseEnter;qt(O)&&O(M,N)}}),Dt(T,"triggeredAfterMouseMove",function(N){var j=T.getMouseInfo(N),M=j?xe(xe({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(M),T.triggerSyncEvent(M);var O=T.props.onMouseMove;qt(O)&&O(M,N)}),Dt(T,"handleItemMouseEnter",function(N){T.setState(function(){return{isTooltipActive:!0,activeItem:N,activePayload:N.tooltipPayload,activeCoordinate:N.tooltipPosition||{x:N.cx,y:N.cy}}})}),Dt(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),Dt(T,"handleMouseMove",function(N){N.persist(),T.throttleTriggeredAfterMouseMove(N)}),Dt(T,"handleMouseLeave",function(N){T.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};T.setState(j),T.triggerSyncEvent(j);var M=T.props.onMouseLeave;qt(M)&&M(j,N)}),Dt(T,"handleOuterEvent",function(N){var j=llt(N),M=ko(T.props,"".concat(j));if(j&&qt(M)){var O,R;/.*touch.*/i.test(j)?R=T.getMouseInfo(N.changedTouches[0]):R=T.getMouseInfo(N),M((O=R)!==null&&O!==void 0?O:{},N)}}),Dt(T,"handleClick",function(N){var j=T.getMouseInfo(N);if(j){var M=xe(xe({},j),{},{isTooltipActive:!0});T.setState(M),T.triggerSyncEvent(M);var O=T.props.onClick;qt(O)&&O(M,N)}}),Dt(T,"handleMouseDown",function(N){var j=T.props.onMouseDown;if(qt(j)){var M=T.getMouseInfo(N);j(M,N)}}),Dt(T,"handleMouseUp",function(N){var j=T.props.onMouseUp;if(qt(j)){var M=T.getMouseInfo(N);j(M,N)}}),Dt(T,"handleTouchMove",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(N.changedTouches[0])}),Dt(T,"handleTouchStart",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&T.handleMouseDown(N.changedTouches[0])}),Dt(T,"handleTouchEnd",function(N){N.changedTouches!=null&&N.changedTouches.length>0&&T.handleMouseUp(N.changedTouches[0])}),Dt(T,"handleDoubleClick",function(N){var j=T.props.onDoubleClick;if(qt(j)){var M=T.getMouseInfo(N);j(M,N)}}),Dt(T,"handleContextMenu",function(N){var j=T.props.onContextMenu;if(qt(j)){var M=T.getMouseInfo(N);j(M,N)}}),Dt(T,"triggerSyncEvent",function(N){T.props.syncId!==void 0&&oL.emit(lL,T.props.syncId,N,T.eventEmitterSymbol)}),Dt(T,"applySyncEvent",function(N){var j=T.props,M=j.layout,O=j.syncMethod,R=T.state.updateId,I=N.dataStartIndex,B=N.dataEndIndex;if(N.dataStartIndex!==void 0||N.dataEndIndex!==void 0)T.setState(xe({dataStartIndex:I,dataEndIndex:B},m({props:T.props,dataStartIndex:I,dataEndIndex:B,updateId:R},T.state)));else if(N.activeTooltipIndex!==void 0){var F=N.chartX,V=N.chartY,$=N.activeTooltipIndex,U=T.state,z=U.offset,L=U.tooltipTicks;if(!z)return;if(typeof O=="function")$=O(L,N);else if(O==="value"){$=-1;for(var W=0;W<L.length;W++)if(L[W].value===N.activeLabel){$=W;break}}var K=xe(xe({},z),{},{x:z.left,y:z.top}),q=Math.min(F,K.x+K.width),H=Math.min(V,K.y+K.height),Y=L[$]&&L[$].value,J=$z(T.state,T.props.data,$),re=L[$]?{x:M==="horizontal"?L[$].coordinate:q,y:M==="horizontal"?H:L[$].coordinate}:lxe;T.setState(xe(xe({},N),{},{activeLabel:Y,activeCoordinate:re,activePayload:J,activeTooltipIndex:$}))}else T.setState(N)}),Dt(T,"renderCursor",function(N){var j,M=T.state,O=M.isTooltipActive,R=M.activeCoordinate,I=M.activePayload,B=M.offset,F=M.activeTooltipIndex,V=M.tooltipAxisBandSize,$=T.getTooltipEventType(),U=(j=N.props.active)!==null&&j!==void 0?j:O,z=T.props.layout,L=N.key||"_recharts-cursor";return P.createElement(J1t,{key:L,activeCoordinate:R,activePayload:I,activeTooltipIndex:F,chartName:r,element:N,isActive:U,layout:z,offset:B,tooltipAxisBandSize:V,tooltipEventType:$})}),Dt(T,"renderPolarAxis",function(N,j,M){var O=ko(N,"type.axisType"),R=ko(T.state,"".concat(O,"Map")),I=N.type.defaultProps,B=I!==void 0?xe(xe({},I),N.props):N.props,F=R&&R[B["".concat(O,"Id")]];return b.cloneElement(N,xe(xe({},F),{},{className:Tt(O,F.className),key:N.key||"".concat(j,"-").concat(M),ticks:lu(F,!0)}))}),Dt(T,"renderPolarGrid",function(N){var j=N.props,M=j.radialLines,O=j.polarAngles,R=j.polarRadius,I=T.state,B=I.radiusAxisMap,F=I.angleAxisMap,V=Vd(B),$=Vd(F),U=$.cx,z=$.cy,L=$.innerRadius,W=$.outerRadius;return b.cloneElement(N,{polarAngles:Array.isArray(O)?O:lu($,!0).map(function(K){return K.coordinate}),polarRadius:Array.isArray(R)?R:lu(V,!0).map(function(K){return K.coordinate}),cx:U,cy:z,innerRadius:L,outerRadius:W,key:N.key||"polar-grid",radialLines:M})}),Dt(T,"renderLegend",function(){var N=T.state.formattedGraphicalItems,j=T.props,M=j.children,O=j.width,R=j.height,I=T.props.margin||{},B=O-(I.left||0)-(I.right||0),F=K0e({children:M,formattedGraphicalItems:N,legendWidth:B,legendContent:u});if(!F)return null;var V=F.item,$=Kne(F,e_t);return b.cloneElement(V,xe(xe({},$),{},{chartWidth:O,chartHeight:R,margin:I,onBBoxUpdate:T.handleLegendBBoxUpdate}))}),Dt(T,"renderTooltip",function(){var N,j=T.props,M=j.children,O=j.accessibilityLayer,R=Ea(M,Rl);if(!R)return null;var I=T.state,B=I.isTooltipActive,F=I.activeCoordinate,V=I.activePayload,$=I.activeLabel,U=I.offset,z=(N=R.props.active)!==null&&N!==void 0?N:B;return b.cloneElement(R,{viewBox:xe(xe({},U),{},{x:U.left,y:U.top}),active:z,label:$,payload:z?V:[],coordinate:F,accessibilityLayer:O})}),Dt(T,"renderBrush",function(N){var j=T.props,M=j.margin,O=j.data,R=T.state,I=R.offset,B=R.dataStartIndex,F=R.dataEndIndex,V=R.updateId;return b.cloneElement(N,{key:N.key||"_recharts-brush",onChange:DS(T.handleBrushChange,N.props.onChange),data:O,x:Ge(N.props.x)?N.props.x:I.left,y:Ge(N.props.y)?N.props.y:I.top+I.height+I.brushBottom-(M.bottom||0),width:Ge(N.props.width)?N.props.width:I.width,startIndex:B,endIndex:F,updateId:"brush-".concat(V)})}),Dt(T,"renderReferenceElement",function(N,j,M){if(!N)return null;var O=T,R=O.clipPathId,I=T.state,B=I.xAxisMap,F=I.yAxisMap,V=I.offset,$=N.type.defaultProps||{},U=N.props,z=U.xAxisId,L=z===void 0?$.xAxisId:z,W=U.yAxisId,K=W===void 0?$.yAxisId:W;return b.cloneElement(N,{key:N.key||"".concat(j,"-").concat(M),xAxis:B[L],yAxis:F[K],viewBox:{x:V.left,y:V.top,width:V.width,height:V.height},clipPathId:R})}),Dt(T,"renderActivePoints",function(N){var j=N.item,M=N.activePoint,O=N.basePoint,R=N.childIndex,I=N.isRange,B=[],F=j.props.key,V=j.item.type.defaultProps!==void 0?xe(xe({},j.item.type.defaultProps),j.item.props):j.item.props,$=V.activeDot,U=V.dataKey,z=xe(xe({index:R,dataKey:U,cx:M.x,cy:M.y,r:4,fill:ZU(j.item),strokeWidth:2,stroke:"#fff",payload:M.payload,value:M.value},Ht($,!1)),uC($));return B.push(_.renderActiveDot($,z,"".concat(F,"-activePoint-").concat(R))),O?B.push(_.renderActiveDot($,xe(xe({},z),{},{cx:O.x,cy:O.y}),"".concat(F,"-basePoint-").concat(R))):I&&B.push(null),B}),Dt(T,"renderGraphicChild",function(N,j,M){var O=T.filterFormatItem(N,j,M);if(!O)return null;var R=T.getTooltipEventType(),I=T.state,B=I.isTooltipActive,F=I.tooltipAxis,V=I.activeTooltipIndex,$=I.activeLabel,U=T.props.children,z=Ea(U,Rl),L=O.props,W=L.points,K=L.isRange,q=L.baseLine,H=O.item.type.defaultProps!==void 0?xe(xe({},O.item.type.defaultProps),O.item.props):O.item.props,Y=H.activeDot,J=H.hide,re=H.activeBar,me=H.activeShape,oe=!!(!J&&B&&z&&(Y||re||me)),ge={};R!=="axis"&&z&&z.props.trigger==="click"?ge={onClick:DS(T.handleItemMouseEnter,N.props.onClick)}:R!=="axis"&&(ge={onMouseLeave:DS(T.handleItemMouseLeave,N.props.onMouseLeave),onMouseEnter:DS(T.handleItemMouseEnter,N.props.onMouseEnter)});var le=b.cloneElement(N,xe(xe({},O.props),ge));function Se(de){return typeof F.dataKey=="function"?F.dataKey(de.payload):null}if(oe)if(V>=0){var Ce,he;if(F.dataKey&&!F.allowDuplicatedCategory){var Ct=typeof F.dataKey=="function"?Se:"payload.".concat(F.dataKey.toString());Ce=cC(W,Ct,$),he=K&&q&&cC(q,Ct,$)}else Ce=W?.[V],he=K&&q&&q[V];if(me||re){var De=N.props.activeIndex!==void 0?N.props.activeIndex:V;return[b.cloneElement(N,xe(xe(xe({},O.props),ge),{},{activeIndex:De})),null,null]}if(!Ut(Ce))return[le].concat(Dy(T.renderActivePoints({item:O,activePoint:Ce,basePoint:he,childIndex:V,isRange:K})))}else{var It,Yt=(It=T.getItemByXY(T.state.activeCoordinate))!==null&&It!==void 0?It:{graphicalItem:le},Qt=Yt.graphicalItem,Qr=Qt.item,gr=Qr===void 0?N:Qr,X=Qt.childIndex,ae=xe(xe(xe({},O.props),ge),{},{activeIndex:X});return[b.cloneElement(gr,ae),null,null]}return K?[le,null,null]:[le,null]}),Dt(T,"renderCustomized",function(N,j,M){return b.cloneElement(N,xe(xe({key:"recharts-customized-".concat(M)},T.props),T.state))}),Dt(T,"renderMap",{CartesianGrid:{handler:$S,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:$S},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:$S},YAxis:{handler:$S},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((k=S.id)!==null&&k!==void 0?k:Xp("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=Kye(T.triggeredAfterMouseMove,(E=S.throttleDelay)!==null&&E!==void 0?E:1e3/60),T.state={},T}return f_t(_,v),l_t(_,[{key:"componentDidMount",value:function(){var k,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var k=this.props,E=k.children,T=k.data,N=k.height,j=k.layout,M=Ea(E,Rl);if(M){var O=M.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,I=$z(this.state,T,O,R),B=this.state.tooltipTicks[O].coordinate,F=(this.state.offset.top+N)/2,V=j==="horizontal",$=V?{x:B,y:F}:{y:B,x:F},U=this.state.formattedGraphicalItems.find(function(L){var W=L.item;return W.type.name==="Scatter"});U&&($=xe(xe({},$),U.props.points[O].tooltipPosition),I=U.props.points[O].tooltipPayload);var z={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:R,activePayload:I,activeCoordinate:$};this.setState(z),this.renderCursor(M),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(k,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==k.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==k.margin){var T,N;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0}})}return null}},{key:"componentDidUpdate",value:function(k){b5([Ea(k.children,Rl)],[Ea(this.props.children,Rl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var k=Ea(this.props.children,Rl);if(k&&typeof k.props.shared=="boolean"){var E=k.props.shared?"axis":"item";return o.indexOf(E)>=0?E:s}return s}},{key:"getMouseInfo",value:function(k){if(!this.container)return null;var E=this.container,T=E.getBoundingClientRect(),N=Qdt(T),j={chartX:Math.round(k.pageX-N.left),chartY:Math.round(k.pageY-N.top)},M=T.width/E.offsetWidth||1,O=this.inRange(j.chartX,j.chartY,M);if(!O)return null;var R=this.state,I=R.xAxisMap,B=R.yAxisMap,F=this.getTooltipEventType(),V=Zne(this.state,this.props.data,this.props.layout,O);if(F!=="axis"&&I&&B){var $=Vd(I).scale,U=Vd(B).scale,z=$&&$.invert?$.invert(j.chartX):null,L=U&&U.invert?U.invert(j.chartY):null;return xe(xe({},j),{},{xValue:z,yValue:L},V)}return V?xe(xe({},j),V):null}},{key:"inRange",value:function(k,E){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=this.props.layout,j=k/T,M=E/T;if(N==="horizontal"||N==="vertical"){var O=this.state.offset,R=j>=O.left&&j<=O.left+O.width&&M>=O.top&&M<=O.top+O.height;return R?{x:j,y:M}:null}var I=this.state,B=I.angleAxisMap,F=I.radiusAxisMap;if(B&&F){var V=Vd(B);return ore({x:j,y:M},V)}return null}},{key:"parseEventsOfWrapper",value:function(){var k=this.props.children,E=this.getTooltipEventType(),T=Ea(k,Rl),N={};T&&E==="axis"&&(T.props.trigger==="click"?N={onClick:this.handleClick}:N={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=uC(this.props,this.handleOuterEvent);return xe(xe({},j),N)}},{key:"addListener",value:function(){oL.on(lL,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){oL.removeListener(lL,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(k,E,T){for(var N=this.state.formattedGraphicalItems,j=0,M=N.length;j<M;j++){var O=N[j];if(O.item===k||O.props.key===k.key||E===mu(O.item.type)&&T===O.childIndex)return O}return null}},{key:"renderClipPath",value:function(){var k=this.clipPathId,E=this.state.offset,T=E.left,N=E.top,j=E.height,M=E.width;return P.createElement("defs",null,P.createElement("clipPath",{id:k},P.createElement("rect",{x:T,y:N,height:j,width:M})))}},{key:"getXScales",value:function(){var k=this.state.xAxisMap;return k?Object.entries(k).reduce(function(E,T){var N=Yne(T,2),j=N[0],M=N[1];return xe(xe({},E),{},Dt({},j,M.scale))},{}):null}},{key:"getYScales",value:function(){var k=this.state.yAxisMap;return k?Object.entries(k).reduce(function(E,T){var N=Yne(T,2),j=N[0],M=N[1];return xe(xe({},E),{},Dt({},j,M.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(k){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[k])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(k){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[k])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(k){var E=this.state,T=E.formattedGraphicalItems,N=E.activeItem;if(T&&T.length)for(var j=0,M=T.length;j<M;j++){var O=T[j],R=O.props,I=O.item,B=I.type.defaultProps!==void 0?xe(xe({},I.type.defaultProps),I.props):I.props,F=mu(I.type);if(F==="Bar"){var V=(R.data||[]).find(function(L){return hvt(k,L)});if(V)return{graphicalItem:O,payload:V}}else if(F==="RadialBar"){var $=(R.data||[]).find(function(L){return ore(k,L)});if($)return{graphicalItem:O,payload:$}}else if(VN(O,N)||UN(O,N)||nw(O,N)){var U=rxt({graphicalItem:O,activeTooltipItem:N,itemData:B.data}),z=B.activeIndex===void 0?U:B.activeIndex;return{graphicalItem:xe(xe({},O),{},{childIndex:z}),payload:nw(O,N)?B.data[U]:O.props.data[U]}}}return null}},{key:"render",value:function(){var k=this;if(!xX(this))return null;var E=this.props,T=E.children,N=E.className,j=E.width,M=E.height,O=E.style,R=E.compact,I=E.title,B=E.desc,F=Kne(E,t_t),V=Ht(F,!1);if(R)return P.createElement(Tne,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement(_5,fg({},V,{width:j,height:M,title:I,desc:B}),this.renderClipPath(),wX(T,this.renderMap)));if(this.props.accessibilityLayer){var $,U;V.tabIndex=($=this.props.tabIndex)!==null&&$!==void 0?$:0,V.role=(U=this.props.role)!==null&&U!==void 0?U:"application",V.onKeyDown=function(L){k.accessibilityManager.keyboardEvent(L)},V.onFocus=function(){k.accessibilityManager.focus()}}var z=this.parseEventsOfWrapper();return P.createElement(Tne,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},P.createElement("div",fg({className:Tt("recharts-wrapper",N),style:xe({position:"relative",cursor:"default",width:j,height:M},O)},z,{ref:function(W){k.container=W}}),P.createElement(_5,fg({},V,{width:j,height:M,title:I,desc:B,style:v_t}),this.renderClipPath(),wX(T,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(b.Component);Dt(y,"displayName",r),Dt(y,"defaultProps",xe({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Dt(y,"getDerivedStateFromProps",function(v,_){var S=v.dataKey,k=v.data,E=v.children,T=v.width,N=v.height,j=v.layout,M=v.stackOffset,O=v.margin,R=_.dataStartIndex,I=_.dataEndIndex;if(_.updateId===void 0){var B=Xne(v);return xe(xe(xe({},B),{},{updateId:0},m(xe(xe({props:v},B),{},{updateId:0}),_)),{},{prevDataKey:S,prevData:k,prevWidth:T,prevHeight:N,prevLayout:j,prevStackOffset:M,prevMargin:O,prevChildren:E})}if(S!==_.prevDataKey||k!==_.prevData||T!==_.prevWidth||N!==_.prevHeight||j!==_.prevLayout||M!==_.prevStackOffset||!Eg(O,_.prevMargin)){var F=Xne(v),V={chartX:_.chartX,chartY:_.chartY,isTooltipActive:_.isTooltipActive},$=xe(xe({},Zne(_,k,j)),{},{updateId:_.updateId+1}),U=xe(xe(xe({},F),V),$);return xe(xe(xe({},U),m(xe({props:v},U),_)),{},{prevDataKey:S,prevData:k,prevWidth:T,prevHeight:N,prevLayout:j,prevStackOffset:M,prevMargin:O,prevChildren:E})}if(!b5(E,_.prevChildren)){var z,L,W,K,q=Ea(E,by),H=q&&(z=(L=q.props)===null||L===void 0?void 0:L.startIndex)!==null&&z!==void 0?z:R,Y=q&&(W=(K=q.props)===null||K===void 0?void 0:K.endIndex)!==null&&W!==void 0?W:I,J=H!==R||Y!==I,re=!Ut(k),me=re&&!J?_.updateId:_.updateId+1;return xe(xe({updateId:me},m(xe(xe({props:v},_),{},{updateId:me,dataStartIndex:H,dataEndIndex:Y}),_)),{},{prevChildren:E,dataStartIndex:H,dataEndIndex:Y})}return null}),Dt(y,"renderActiveDot",function(v,_,S){var k;return b.isValidElement(v)?k=b.cloneElement(v,_):qt(v)?k=v(_):k=P.createElement(BN,_),P.createElement(Cr,{className:"recharts-active-dot",key:S},k)});var x=b.forwardRef(function(_,S){return P.createElement(y,fg({},_,{ref:S}))});return x.displayName=y.displayName,x},j_t=l6({chartName:"LineChart",GraphicalChild:gc,axisComponents:[{axisType:"xAxis",AxisComp:Cc},{axisType:"yAxis",AxisComp:Co}],formatAxisMap:JU}),N_t=l6({chartName:"BarChart",GraphicalChild:To,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Cc},{axisType:"yAxis",AxisComp:Co}],formatAxisMap:JU}
4389),oE=l6({chartName:"ComposedChart",GraphicalChild:[gc,Gu,To,ZN],axisComponents:[{axisType:"xAxis",AxisComp:Cc},{axisType:"yAxis",AxisComp:Co},{axisType:"zAxis",AxisComp:QN}],formatAxisMap:JU});const P_t={light:"",dark:".dark"},uxe=b.createContext(null);function M_t(){const t=b.useContext(uxe);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}function Oy({id:t,className:e,children:r,config:n,...i}){const s=b.useId(),a=`chart-${t||s.replace(/:/g,"")}`;return l.jsx(uxe.Provider,{value:{config:n},children:l.jsxs("div",{"data-slot":"chart","data-chart":a,className:Pe("[&_.recharts-cartesian-axis-tick_text]:fill-app-primary-foreground/60 [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-app-border-color-soft [&_.recharts-curve.recharts-tooltip-cursor]:stroke-app-border-color-accent [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-red-600 [&_.recharts-radial-bar-background-sector]:fill-red-600 [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-app-border-color-accent/10 [&_.recharts-reference-line_[stroke='#ccc']]:stroke-red-600 flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",e),...i,children:[l.jsx(A_t,{id:a,config:n}),l.jsx(Udt,{children:r})]})})}const A_t=({id:t,config:e})=>{const r=Object.entries(e).filter(([,n])=>n.theme||n.color);return r.length?l.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(P_t).map(([n,i])=>`
4390              ${i} [data-chart=${t}] {
4391              ${r.map(([s,a])=>{const o=a.theme?.[n]||a.color;return o?`  --color-${s}: ${o};`:null}).join(`
4392`)}
4393              }
4394              `).join(`
4395`)}}):null},y1=Rl;function JN({active:t,payload:e,className:r,indicator:n="dot",hideLabel:i=!1,hideIndicator:s=!1,label:a,labelFormatter:o,labelClassName:c,formatter:u,color:d,nameKey:f,labelKey:h}){const{config:m}=M_t(),y=b.useMemo(()=>{if(i||!e?.length)return null;const[v]=e,_=`${h||v?.dataKey||v?.name||"value"}`,S=eie(m,v,_),k=!h&&typeof a=="string"?m[a]?.label||a:S?.label;return o?l.jsx("div",{className:Pe("font-medium",c),children:o(k,e)}):k?l.jsx("div",{className:Pe("font-medium",c),children:k}):null},[a,o,e,i,c,m,h]);if(!t||!e?.length)return null;const x=e.length===1&&n!=="dot";return l.jsxs("div",{className:Pe("border-app-border-color-soft bg-app-primary grid min-w-32 items-start gap-1.5 rounded-lg border px-3 py-2 text-xs shadow-xl",r),children:[x?null:y,l.jsx("div",{className:"grid gap-1.5",children:e.map((v,_)=>{const S=`${f||v.name||v.dataKey||"value"}`,k=eie(m,v,S),E=d||v.payload.fill||v.color;return l.jsx("div",{className:Pe("[&>svg]:text-app-primary-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",n==="dot"&&"items-center"),children:u&&v?.value!==void 0&&v.name?u(v.value,v.name,v,_,v.payload):l.jsxs(l.Fragment,{children:[k?.icon?l.jsx(k.icon,{}):!s&&l.jsx("div",{className:Pe("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":n==="dot","w-1":n==="line","w-0 border-[1.5px] border-dashed bg-transparent":n==="dashed","my-0.5":x&&n==="dashed"}),style:{backgroundColor:E,borderColor:E}}),l.jsxs("div",{className:Pe("flex flex-1 justify-between leading-none",x?"items-end":"items-center"),children:[l.jsxs("div",{className:"grid gap-1.5",children:[x?y:null,l.jsx("span",{className:"text-app-primary-foreground",children:k?.label||v.name})]}),v.value&&l.jsx("span",{className:"text-foreground font-mono font-medium tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}function eie(t,e,r){if(typeof e!="object"||e===null)return;const n="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let i=r;return r in e&&typeof e[r]=="string"?i=e[r]:n&&r in n&&typeof n[r]=="string"&&(i=n[r]),i in t?t[i]:t[r]}const D_t={value:{label:"Value",color:"hsl(var(--chart-1))"},value2:{label:"Value 2",color:"hsl(var(--chart-3))"}},O_t=({data:t,title:e,legends:r,axisLabels:n,valueFormatter:i=u=>Ke(u,2),compactYAxis:s=!1,currency:a="usd",lineLabels:o={line1:"Line 1",line2:"Line 2"},lineColors:c={line1:"hsl(var(--chart-1))",line2:"hsl(var(--chart-3))"}})=>{const u=t,d=Qp("(min-width: 2048px)"),f=t.some(m=>m.value2!==void 0&&m.value2!==null),h={line1:r?.[0]?.label||o.line1,line2:r?.[1]?.label||o.line2};return l.jsxs("div",{className:"gap-2 flex flex-col w-full items-center justify-center",children:[e&&l.jsx("h3",{className:"text-xl font-medium text-app-primary-foreground 2k:text-3xl",children:e}),l.jsx(Oy,{config:D_t,className:"w-full h-[430px] aspect-auto",children:l.jsxs(j_t,{accessibilityLayer:!0,data:u,margin:{top:25,right:d?30:16,left:d?120:24},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"line1Gradient",x1:"0",y1:"0",x2:"1",y2:"0",children:[l.jsx("stop",{offset:"0%",stopColor:c.line1,stopOpacity:.8}),l.jsx("stop",{offset:"100%",stopColor:c.line1,stopOpacity:.3})]}),l.jsxs("linearGradient",{id:"line2Gradient",x1:"0",y1:"0",x2:"1",y2:"0",children:[l.jsx("stop",{offset:"0%",stopColor:c.line2,stopOpacity:.8}),l.jsx("stop",{offset:"100%",stopColor:c.line2,stopOpacity:.3})]})]}),l.jsx(v0,{strokeDasharray:"4 4"}
4395),l.jsx(Cc,{dataKey:"label",tickLine:!0,tickMargin:15,axisLine:!0,angle:-20,textAnchor:"end",height:d?120:80,tick:{fontSize:d?22:14,fill:"#F8FAFB"},label:{value:n?.x||void 0,position:"insideBottom",offset:-10,textAnchor:"middle",fontSize:d?22:14,fill:"#F8FAFB"}}),l.jsx(Co,{dataKey:"value",tickLine:!0,tickMargin:15,axisLine:!0,tickFormatter:m=>s&&a==="usd"?r1(m,2):i(m),tick:{fontSize:d?22:14,fill:"#F8FAFB"},label:{value:n?.y||void 0,angle:-90,position:"insideLeft",textAnchor:"middle",fontSize:d?22:14,fill:"#F8FAFB",...d?{dx:-100}:{dx:-40}}}),l.jsx(y1,{content:l.jsx(JN,{hideIndicator:!0,className:"bg-app-primary/95 backdrop-blur-xs rounded-lg",formatter:(m,y)=>{const x=Number(m),v=y==="value2",_=v?c.line2:c.line1,S=v?h.line2:h.line1;return l.jsxs("div",{className:"flex min-w-[130px] items-center text-sm gap-3 2k:text-2xl 2k:min-w-[220px]",children:[l.jsx("div",{className:"w-2 h-4 rounded-xs shrink-0 2k:w-4 2k:h-6",style:{backgroundColor:_}}),l.jsx("span",{className:"text-muted-foreground",children:S}),l.jsx("div",{className:"text-foreground font-mono font-medium tabular-nums ml-auto",children:i(x)})]})},labelFormatter:(m,y)=>{const x=y?.[0]?.payload?.metadata,v=x?.formattedDate??x?.date;return l.jsx("div",{className:"text-foreground text-sm font-medium pb-1 font-mono 2k:text-2xl",children:v||y?.[0]?.payload?.label})}}),cursor:{opacity:.1}}),l.jsx(gc,{type:"linear",dataKey:"value",stroke:c.line1,strokeWidth:3,dot:!1,activeDot:{r:d?10:6,fill:c.line1,stroke:"hsl(var(--background))",strokeWidth:2}}),f&&l.jsx(gc,{type:"monotone",dataKey:"value2",stroke:c.line2,strokeWidth:3,strokeDasharray:"8 4",dot:{fill:c.line2,strokeWidth:2,r:d?8:4},activeDot:{r:d?10:6,fill:c.line2,stroke:"hsl(var(--background))",strokeWidth:2}})]})}),r&&r.length>0&&l.jsx("div",{className:"flex flex-wrap items-center gap-4",children:r.map((m,y)=>l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md min-w-[85px] justify-center",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs 2k:w-4 2k:h-6",style:{backgroundColor:m.color}}),l.jsx("div",{className:"text-sm text-app-primary-foreground/70 2k:text-2xl",children:m.label})]},y))})]})},yc=({children:t,hasData:e,title:r,className:n,containerClassName:i,action:s})=>{const{proPlan:a,shouldShowProBanner:o,isLoading:c}=Hs(),u=o();return l.jsx("div",{className:ee("space-y-6",i),children:l.jsxs("div",{className:ee("bg-app-card/50 border border-app-border-color-soft p-4 rounded-2xl min-h-[400px] relative flex flex-col",n),children:[(r||s)&&l.jsxs("div",{className:"flex items-center justify-between gap-4 mt-2 mb-3 h-8",children:[r&&l.jsxs("div",{className:"flex items-center gap-4 roun
4395ded-lg bg-app-input-bg px-2.5 py-1.5 w-fit",children:[l.jsx("h2",{className:"text-xs text-pretty md:text-sm text-app-primary-foreground/90 uppercase tracking-wider",children:r}),l.jsx(Oj,{className:"hidden md:flex"})]}),s&&s]}),e?l.jsxs(l.Fragment,{children:[t,u&&a&&!c&&l.jsx(eN,{plan:a,className:"backdrop-blur-xs bg-app-card/35"})]}):l.jsx(tpe,{})]})})},R_t=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1,dateRange:i,timeRangeOption:s})=>{const a=b.useMemo(()=>oot(t,e,r,i,s),[t,e,r,i,s]);if(n)return l.jsx(_c,{title:"Account Equity",loadingText:"Loading equity data..."});const o=a.length>0;return l.jsx(yc,{hasData:o,title:"Account Equity",children:l.jsx(O_t,{data:a,valueFormatter:c=>r==="r"?fn(c,2):Ke(c,2),compactYAxis:r==="usd",currency:r,lineColors:{line1:"hsl(var(--border-color-accent))"},legends:[{label:r==="r"?"Equity (R)":"Equity (USD)",color:"hsl(var(--border-color-accent))"}]})})},I_t=(t,e="net",r="usd")=>{const n=a=>e==="net"?a.net_pnl??a.pnl??0:a.pnl??0,s=(r==="r"?t.filter(a=>(a.risk??0)>0):t).filter(a=>a.status?.toUpperCase()==="CLOSED").reduce((a,o)=>{const c=n(o),u=r==="r"&&o.risk&&o.risk>0?c/o.risk:c;return a[o.symbol]=(a[o.symbol]??0)+u,a},{});return Object.entries(s).sort(([,a],[,o])=>Math.abs(o)-Math.abs(a)).slice(0,10).map(([a,o])=>({label:a,value:o}))},L_t=(t,e="net",r="usd")=>{const n=(r==="r"?t.filter(a=>(a.risk??0)>0):t).filter(a=>a.status?.toUpperCase()==="CLOSED"),i=a=>e==="net"?a.net_pnl??a.pnl??0:a.pnl??0,s=n.reduce((a,o)=>{const c=i(o),u=r==="r"&&o.risk&&o.risk>0?c/o.risk:c;return u>0?a.profit+=u:u<0&&(a.loss+=u),a},{profit:0,loss:0});return[{label:"Profit",value:s.profit},{label:"Loss",value:s.loss}]},$_t=(t,e="net",r="usd")=>{const n=(r==="r"?t.filter(a=>(a.risk??0)>0):t).filter(a=>a.status?.toUpperCase()==="CLOSED"),i=a=>e==="net"?a.net_pnl??a.pnl??0:a.pnl??0,s=n.reduce((a,o)=>{const c=i(o),u=r==="r"&&o.risk&&o.risk>0?c/o.risk:c,d=o.position_type?.toUpperCase();return d==="LONG"?a.long+=u:d==="SHORT"&&(a.short+=u),a},{long:0,short:0});return[{label:"Long",value:s.long},{label:"Short",value:s.short}]},F_t=(t,e="net",r="usd",n)=>{const i=["A","B","C","D","F"],s=(r==="r"?t.filter(u=>(u.risk??0)>0):t).filter(u=>u.status?.toUpperCase()==="CLOSED"),a=u=>e==="net"?u.net_pnl??u.pnl??0:u.pnl??0,o=u=>{const d=u.entryDate||u.entry_date;return d?new Date(d).toISOString().split("T")[0]:null},c={A:{pnl:0,trades:0,wins:0},B:{pnl:0,trades:0,wins:0},C:{pnl:0,trades:0,wins:0},D:{pnl:0,trades:0,wins:0},F:{pnl:0,trades:0,wins:0}};return s.forEach(u=>{const d=o(u);if(!d)return;const f=n.get(d);if(!f?.grade)return;const h=a(u),m=r==="r"&&u.risk&&u.risk>0?h/u.risk:h;c[f.grade].pnl+=m,c[f.grade].trades+=1,h>0&&(c[f.grade].wins+=1)}),{labels:i,pnl:i.map(u=>c[u].pnl),winRate:i.map(u=>c[u].trades>0?c[u].wins/c[u].trades*100:0)}},z_t=(t,e="net",r="usd",n,i={energy:4,sleepQuality:4,sleepHours:7})=>{const s=i.energy,a=i.sleepQuality,o=i.sleepHours,c=(r==="r"?t.filter(m=>(m.risk??0)>0):t).filter(m=>m.status?.toUpperCase()==="CLOSED"),u=m=>e==="net"?m.net_pnl??m.pnl??0:m.pnl??0,d=m=>{const y=m.entryDate||m.entry_date;return y?new Date(y).toISOString().split("T")[0]:null},f={energyHigh:{pnl:0,trades:0,wins:0},energyLow:{pnl:0,trades:0,wins:0},sleepQualityHigh:{pnl:0,trades:0,wins:0},sleepQualityLow:{pnl:0,trades:0,wins:0},sleepHoursGood:{pnl:0,trades:0,wins:0},sleepHoursPoor:{pnl:0,trades:0,wins:0}};c.forEach(m=>{const y=d(m);if(!y)return;const x=n.get(y);if(!x)return;const v=u(m),_=r==="r"&&m.risk&&m.risk>0?v/m.risk:v,S=v>0;if(x.energyLevel!==null){const k=x.energyLevel>=s?"energyHigh":"energyLow";f[k].pnl+=_,f[k].trades+=1,S&&(f[k].wins+=1)}if(x.sleepQuality!==null){const k=x.sleepQuality>=a?"sleepQualityHigh":"sleepQualityLow";f[k].pnl+=_,f[k].trades+=1,S&&(f[k].wins+=1)}if(x.sleepHours!==null){const k=x.sleepHours>=o?"sleepHoursGood":"sleepHoursPoor";f[k].pnl+=_,f[k].trades+=1,S&&(f[k].wins+=1)}});const h=m=>m.trades>0?m.wins/m.trades*100:0;return{data:[{label:"Good",energy:f.energyHigh.pnl,sleepQuality:f.sleepQualityHigh.pnl,sleepHours:f.sleepHoursGood.pnl,energyWinRate:h(f.energyHigh),sleepQualityWinRate:h(f.sleepQualityHigh),sleepHoursWinRate:h(f.sleepHoursGood)},{label:"Poor",energy:f.energyLow.pnl,sleepQuality:f.sleepQualityLow.pnl,sleepHours:f.sleepHoursPoor.pnl,energyWinRate:h(f.energyLow),sleepQualityWinRate:h(f.sleepQualityLow),sleepHoursWinRate:h(f.sleepHoursPoor)}]}};function Fz(t,[e,r]){return Math.min(r,Math.max(e,t))}function B_t(t,e){return b.useReducer((r,n)=>e[r][n]??r,t)}var c6="ScrollArea",[dxe]=ma(c6),[V_t,Uo]=dxe(c6),fxe=b.forwardRef((t,e)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:s=600,...a}=t,[o,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(null),[m,y]=b.useState(null),[x,v]=b.useState(null),[_,S]=b.useState(0),[k,E]=b.useState(0),[T,N]=b.useState(!1),[j,M]=b.useState(!1),O=Kt(e,I=>
vendor: 8,584 bytes, line 4395
4395c(I)),R=a0(i);return l.jsx(V_t,{scope:r,type:n,dir:R,scrollHideDelay:s,scrollArea:o,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:T,onScrollbarXEnabledChange:N,scrollbarY:x,onScrollbarYChange:v,scrollbarYEnabled:j,onScrollbarYEnabledChange:M,onCornerWidthChange:S,onCornerHeightChange:E,children:l.jsx(vt.div,{dir:R,...a,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":k+"px",...t.style}})})});fxe.displayName=c6;var hxe="ScrollAreaViewport",pxe=b.forwardRef((t,e)=>{const{__scopeScrollArea:r,children:n,nonce:i,...s}=t,a=Uo(hxe,r),o=b.useRef(null),c=Kt(e,o,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),l.jsx(vt.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});pxe.displayName=hxe;var Ec="ScrollAreaScrollbar",u6=b.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=Uo(Ec,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=t.orientation==="horizontal";return b.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?l.jsx(U_t,{...n,ref:e,forceMount:r}):i.type==="scroll"?l.jsx(G_t,{...n,ref:e,forceMount:r}):i.type==="auto"?l.jsx(mxe,{...n,ref:e,forceMount:r}):i.type==="always"?l.jsx(d6,{...n,ref:e}):null});u6.displayName=Ec;var U_t=b.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=Uo(Ec,t.__scopeScrollArea),[s,a]=b.useState(!1);return b.useEffect(()=>{const o=i.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),l.jsx($i,{present:r||s,children:l.jsx(mxe,{"data-state":s?"visible":"hidden",...n,ref:e})})}),G_t=b.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=Uo(Ec,t.__scopeScrollArea),s=t.orientation==="horizontal",a=tP(()=>c("SCROLL_END"),100),[o,c]=B_t("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,c]),b.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),a()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,s,c,a]),l.jsx($i,{present:r||o!=="hidden",children:l.jsx(d6,{"data-state":o==="hidden"?"hidden":"visible",...n,ref:e,onPointerEnter:He(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:He(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),mxe=b.forwardRef((t,e)=>{const r=Uo(Ec,t.__scopeScrollArea),{forceMount:n,...i}=t,[s,a]=b.useState(!1),o=t.orientation==="horizontal",c=tP(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(o?u:d)}},10);return Ry(r.viewport,c),Ry(r.content,c),l.jsx($i,{present:n||s,children:l.jsx(d6,{"data-state":s?"visible":"hidden",...i,ref:e})})}),d6=b.forwardRef((t,e)=>{const{orientation:r="vertical",...n}=t,i=Uo(Ec,t.__scopeScrollArea),s=b.useRef(null),a=b.useRef(0),[o,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=bxe(o.viewport,o.content),d={...n,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function f(h,m){return Q_t(h,a.current,o,m)}return r==="horizontal"?l.jsx(W_t,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollLeft,m=tie(h,o,i.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):r==="vertical"?l.jsx(H_t,{...d,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollTop,m=tie(h,o);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),W_t=b.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...i}=t,s=Uo(Ec,t.__scopeScrollArea),[a,o]=b.useState(),c=b.useRef(null),u=Kt(e,c,s.onScrollbarXChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(yxe,{"data-orientation":"horizontal",...i,ref:u,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":eP(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;t.onWheelScroll(h),_xe(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:cE(a.paddingLeft),paddingEnd:cE(a.paddingRight)}})}})}),H_t=b.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...i}=t,s=Uo(Ec,t.__scopeScrollArea),[a,o]=b.useState(),c=b.useRef(null),u=Kt(e,c,s.onScrollbarYChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(yxe,{"data-orientation":"vertical",...i,ref:u,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":eP(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;t.onWheelScroll(h),_xe(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:cE(a.paddingTop),paddingEnd:cE(a.paddingBottom)}})}})}),[q_t,gxe]=dxe(Ec),yxe=b.forwardRef((t,e)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=t,m=Uo(Ec,r),[y,x]=b.useState(null),v=Kt(e,O=>x(O)),_=b.useRef(null),S=b.useRef(""),k=m.viewport,E=n.content-n.viewport,T=Ki(d),N=Ki(c),j=tP(f,10);function M(O){if(_.current){const R=O.clientX-_.current.left,I=O.clientY-_.current.top;u({x:R,y:I})}}return b.useEffect(()=>{const O=R=>{const I=R.target;y?.contains(I)&&T(R,E)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[k,y,E,T]),b.useEffect(N,[n,N]),Ry(y,j),Ry(m.content,j),l.jsx(q_t,{scope:r,scrollbar:y,hasThumb:i,onThumbChange:Ki(s),onThumbPointerUp:Ki(a),onThumbPositionChange:N,onThumbPointerDown:Ki(o),children:l.jsx(vt.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:He(t.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),_.current=y.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),M(O))}),onPointerMove:He(t.onPointerMove,M),onPointerUp:He(t.onPointerUp,O=>{const R=O.target;R.hasPointerCapture(O.pointerId)&&R.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=S.current,m.viewport&&(m.viewport.style.scrollBehavior=""),_.current=null})})})}),lE="ScrollAreaThumb",vxe=b.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=gxe(lE,t.__scopeScrollArea);return l.jsx($i,{present:r||i.hasThumb,children:l.jsx(Y_t,{ref:e,...n})})}),Y_t=b.forwardRef((t,e)=>{const{__scopeScrollArea:r,style:n,...i}=t,s=Uo(lE,r),a=gxe(lE,r),{onThumbPositionChange:o}=a,c=Kt(e,f=>a.onThumbChange(f)),u=b.useRef(void 0),d=tP(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const f=s.viewport;if(f){const h=()=>
4395{if(d(),!u.current){const m=Z_t(f,o);u.current=m,o()}};return o(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,d,o]),l.jsx(vt.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:He(t.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),y=f.clientX-m.left,x=f.clientY-m.top;a.onThumbPointerDown({x:y,y:x})}),onPointerUp:He(t.onPointerUp,a.onThumbPointerUp)})});vxe.displayName=lE;var f6="ScrollAreaCorner",xxe=b.forwardRef((t,e)=>{const r=Uo(f6,t.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?l.jsx(K_t,{...t,ref:e}):null});xxe.displayName=f6;var K_t=b.forwardRef((t,e)=>{const{__scopeScrollArea:r,...n}=t,i=Uo(f6,r),[s,a]=b.useState(0),[o,c]=b.useState(0),u=!!(s&&o);return Ry(i.scrollbarX,()=>{const d=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(d),c(d)}),Ry(i.scrollbarY,()=>{const d=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(d),a(d)}),u?l.jsx(vt.div,{...n,ref:e,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function cE(t){return t?parseInt(t,10):0}function bxe(t,e){const r=t/e;return isNaN(r)?0:r}function eP(t){const e=bxe(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=(t.scrollbar.size-r)*e;return Math.max(n,18)}function Q_t(t,e,r,n="ltr"){const i=eP(r),s=i/2,a=e||s,o=i-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-o,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return wxe([c,u],f)(t)}function tie(t,e,r="ltr"){const n=eP(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,a=e.content-e.viewport,o=s-n,c=r==="ltr"?[0,a]:[a*-1,0],u=Fz(t,c);return wxe([0,a],[0,o])(u)}function wxe(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function _xe(t,e){return t>0&&t<e}var Z_t=(t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},n=0;return(function i(){const s={left:t.scrollLeft,top:t.scrollTop},a=r.left!==s.left,o=r.top!==s.top;(a||o)&&e(),r=s,n=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(n)};function tP(t,e){const r=Ki(t),n=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),b.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,e)},[r,e])}function Ry(t,e){const r=Ki(e);rs(()=>{let n=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(t),()=>{window.cancelAnimationFrame(n),i.unobserve(t)}}},[t,r])}var Sxe=fxe,X_t=pxe,J_t=xxe;const h6=b.forwardRef(({className:t,orientation:e="vertical",...r},n)=>l.jsx(u6,{ref:n,forceMount:!0,orientation:e,className:ee("flex touch-none select-none transition-[opacity,transform] duration-200 ease-out will-change-[opacity,transform]","data-[state=hidden]:pointer-events-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px] data-[state=hidden]:translate-x-1 data-[state=visible]:translate-x-0",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px] data-[state=hidden]:translate-y-1 data-[state=visible]:translate-y-0","data-[state=hidden]:opacity-0 data-[state=visible]:opacity-100",t),...r,children:l.jsx(vxe,{className:"relative flex-1 rounded-full bg-app-border-color-accent/30"})}));h6.displayName=u6.displayName;const kxe=b.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(Sxe,{ref:n,className:ee("relative overflow-hidden",t),type:"scroll",...r,children:[l.jsx(X_t,{className:"h-full w-full rounded-[inherit]",children:e}),l.jsx(h6,{}),l.jsx(J_t,{})]}));kxe.displayName=Sxe.displayName;const Txe=t=>{const e=t.current;return e?e.hasAttribute("data-radix-scroll-area-viewport")?e:e.querySelector("[data-radix-scroll-area-viewport]"):null},eSt=({scrollElementRef:t,enabled:e=!0})=>{const[r,n]=b.useState(!1),i=b.useRef(0),s=b.useRef(0),a=b.useRef(!1),o=b.useCallback(()=>Txe(t),[t]),c=b.useCallback(h=>{if(!e||a.current||h.button!==0&&h.button!==void 0)return;const m=h.target;if(m.closest("button")||m.closest("a")||m.closest("[role='button']")||m.closest("input")||m.closest("select")||m.closest("textarea"))return;const y=o();if(y&&!(y.scrollWidth<=y.clientWidth)){h.preventDefault(),i.current=y.scrollLeft,s.current=h.clientX,a.current=!0;try{h.currentTarget.setPointerCapture(h.pointerId)}catch{}n(!0)}},[e,o]),u=b.useCallback(h=>{if(!e||!a.current)return;const m=o();if(!m)return;h.preventDefault();const y=h.clientX-s.current,x=i.current-y,v=m.scrollWidth-m.clientWidth,_=Math.max(0,Math.min(x,v));m.scrollLeft=_},[e,o]),d=b.useCallback(h=>{if(a.current){a.current=!1;try{h.currentTarget.releasePointerCapture(h.pointerId)}catch{}n(!1)}},[]),f=b.useCallback(()=>{a.current&&(a.current=!1,n(!1))},[]);return b.useEffect(()=>()=>{a.current=!1,n(!1)},[]),{isDragging:r,onPointerDown:c,onPointerMove:u,onPointerUp:d,onLostPointerCapture:f}},rie={pnl:{label:"P&L",color:"hsl(var(--chart-1))"},winRate:{label:"Win Rate",color:"hsl(var(--chart-3))"}},uL="#a38bff",uE=({data:t,title:e,legends:r,currency:n="usd"})=>{const i=b.useMemo(()=>t.labels.map((M,O)=>({priceRange:M,pnl:t.pnl[O],winRate:t.winRate[O]})),[t.labels,t.pnl,t.winRate]),s=Qp("(min-width: 2048px)"),c=Math.max(860,i.length*86),u=s?170:126,d=b.useRef(null),[f,h]=b.useState(!0),[m,y]=b.useState(!1),{isDragging:x,onPointerDown:v,onPointerMove:_,onPointerUp:S,onLostPointerCapture:k}=eSt({scrollElementRef:d,enabled:!0}),E=b.useCallback(()=>Txe(d),[]),T=b.useCallback(()=>{const M=E();if(!M)return;const O=M.scrollLeft,R=M.scrollWidth,I=M.clientWidth,B=O+I>=R-20;y(B);const F=R>I;h(F)},[E]),N=M=>{T()},j=b.useCallback(()=>{const M=E();if(!M)return;const O=M.scrollWidth,R=M.clientWidth,I=m?0:O-R;M.scrollTo({left:I,behavior:"smooth"})},[m,E]);return b.useEffect(()=>{T()},[i,T]),b.useEffect(()=>{const M=E();if(!M)return;const O=M.style.touchAction,R=M.style.cursor,I=M.style.userSelect;return M.style.touchAction="pan-x",M.style.cursor=x?"grabbing":"grab",M.style.userSelect=x?"none":"",()=>{M.style.touchAction=O,M.style.cursor=R,M.style.userSelect=I}},[E,x]),l.jsxs("div",{className:"gap-2 flex flex-col w-full items-center justify-center",children:[e&&l.jsx("h3",{className:"text-xl font-medium text-app-primary-foreground 2k:text-3xl",children:e}),l.jsxs("div",{className:"flex w-full items-stretch px-3 relative",children:[l.jsx("div",{className:"relative min-h-[200px] h-[430px] shrink-0",children:l.jsx(Oy,{config:rie,style:{width:u},className:"min-h-[200px] h-[430px] aspect-auto",children:l.jsx(oE,{data:i,margin:{top:25,left:0,right:0,bottom:s?120:80},children:l.jsx(Co,{yAxisId:"left",dataKey:"pnl",tickLine:!0,tickMargin:10,axisLine
4395:!0,width:u-(s?54:42),tickFormatter:M=>n==="r"?fn(M,2):r1(M,2),tick:{fontSize:s?22:14,fill:"#F8FAFB"}})})})}),l.jsxs(kxe,{ref:d,type:"always",className:"w-full -ms-[43px]",onScrollCapture:N,children:[l.jsx("div",{onPointerDown:v,onPointerMove:_,onPointerUp:S,onLostPointerCapture:k,className:"h-full",children:l.jsx(Oy,{config:rie,style:{minWidth:c},className:"h-[430px] aspect-auto",children:l.jsxs(oE,{accessibilityLayer:!0,data:i,margin:{top:25,left:0,right:s?16:8},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"positiveGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:"hsl(var(--positive-color))",stopOpacity:.8}),l.jsx("stop",{offset:"100%",stopColor:"hsl(var(--positive-color))",stopOpacity:.3})]}),l.jsxs("linearGradient",{id:"negativeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-2))",stopOpacity:.3}),l.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-2))",stopOpacity:.8})]})]}),l.jsx(v0,{strokeDasharray:"4 4"}),l.jsx(Cc,{dataKey:"priceRange",tickLine:!0,tickMargin:15,axisLine:!0,angle:-25,textAnchor:"end",height:s?120:80,tick:{fontSize:s?22:14,fill:"#F8FAFB"}}),l.jsx(Co,{yAxisId:"left",dataKey:"pnl",hide:!0}),l.jsx(Co,{yAxisId:"right",orientation:"right",dataKey:"winRate",tickLine:!1,tickMargin:15,axisLine:!1,tickFormatter:M=>`${M}%`,tick:{fontSize:s?22:14,fill:"#F8FAFB"}}),l.jsx(y1,{content:l.jsx(JN,{hideIndicator:!0,className:"bg-app-primary/95 backdrop-blur-xs border rounded-lg p-2 2k:p-5",formatter:(M,O)=>{const R=Number(M)>0;let I=uL,B="Win Rate",F=`${Number(M).toFixed(1)}%`;return O==="pnl"&&(I=R?"hsl(var(--positive-color))":"hsl(var(--chart-2))",B="P&L",F=n==="r"?fn(Number(M)):Ke(Number(M))),l.jsxs("div",{className:"flex min-w-[130px] items-center text-sm gap-3 2k:text-2xl 2k:min-w-[220px]",children:[l.jsx("div",{className:"w-2 h-4 rounded-xs shrink-0",style:{backgroundColor:I}}),l.jsx("span",{className:"text-muted-foreground",children:B}),l.jsx("div",{className:"text-foreground font-mono font-medium tabular-nums ml-auto",children:F})]})},labelFormatter:M=>l.jsx("div",{className:"text-foreground text-sm font-medium pb-1 font-mono 2k:text-2xl",children:M})}),cursor:{opacity:.1}}),l.jsx(To,{yAxisId:"left",dataKey:"pnl",radius:[4,4,0,0],maxBarSize:50,children:i.map(M=>l.jsx(mf,{fill:M.pnl>0?"url(#positiveGradient)":"url(#negativeGradient)",stroke:M.pnl>0?"hsl(var(--positive-color))":"hsl(var(--chart-2))",strokeWidth:2,strokeDasharray:"4 4"},M.priceRange))}),l.jsx(gc,{yAxisId:"right",type:"monotone",dataKey:"winRate",stroke:"none",strokeWidth:3,dot:{fill:uL,strokeWidth:2,r:3},activeDot:{r:5,fill:uL,stroke:"hsl(var(--background))",strokeWidth:2}})]})})}),l.jsx(h6,{orientation:"horizontal"})]}),l.jsx(Ss,{children:f&&l.jsx(ct.button,{type:"button",initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.3,ease:"easeInOut"},className:"absolute right-8 top-1/2 -translate-y-1/2 z-10 cursor-pointer p-1.5 focus-visible:outline-none rounded-xl focus-visible:border-app-border-color-accent focus-visible:border focus-visible:ring-app-border-color-accent/50 focus-visible:ring-[2px] focus-visible:ring-offset-0",onClick:j,role:"button","aria-label":m?"Scroll to beginning":"Scroll to end",tabIndex:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),j())},children:l.jsx(ct.div,{animate:{x:m?[0,-8,0]:[0,8,0]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:l.jsx(hoe,{className:ee("size-5 text-app-border-color-accent/60 hover:text-app-border-color-accent transition-all duration-700 ease-out",m?"-rotate-90":"rotate-90")})})})})]}),r&&r.length>0&&l.jsx("div",{className:"flex flex-wrap items-center gap-4",children:r.map((M,O)=>{const R=O+M.label;return l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md min-w-[85px] justify-center",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs 2k:w-4 2k:h-6",style:{backgroundColor:M.color}}
4395),l.jsx("div",{className:"text-sm text-app-primary-foreground/70 2k:text-2xl",children:M.label})]},R)})})]})},tSt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1,dailyGradeMap:i})=>{const s=b.useMemo(()=>F_t(t,e,r,i),[t,e,r,i]),a=b.useMemo(()=>s?s.pnl.some(o=>o!==0)||s.winRate.some(o=>o!==0):!1,[s]);return n?l.jsx(_c,{title:"PnL by Grade",loadingText:"Loading grade analysis..."}):l.jsx(yc,{hasData:a,title:"PnL by Grade",children:l.jsx(uE,{data:s,currency:r,legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"},{label:"Win Rate",color:"#a38bff"}]})})},rSt={value:{label:"Value",color:"hsl(var(--chart-1))"}},rP=({data:t,title:e,legends:r,axisLabels:n,valueFormatter:i,currency:s="usd",compactYAxis:a=!1,colorScheme:o="default"})=>{const c=t,u=window.innerWidth>=2048,d=i??(f=>s==="r"?fn(f,2):Ke(f,2));return l.jsxs("div",{className:"gap-2 flex flex-col w-full items-center justify-center",children:[e&&l.jsx("h3",{className:"text-xl font-medium text-app-primary-foreground 2k:text-3xl",children:e}),l.jsx(Oy,{config:rSt,className:"w-full h-[430px] aspect-auto",children:l.jsxs(N_t,{accessibilityLayer:!0,data:c,margin:{top:25,left:u?64:24,right:u?24:16},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"defaultGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-1))",stopOpacity:.8}),l.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-1))",stopOpacity:.3})]}),l.jsxs("linearGradient",{id:"positiveGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:"hsl(var(--positive-color))",stopOpacity:.8}),l.jsx("stop",{offset:"100%",stopColor:"hsl(var(--positive-color))",stopOpacity:.3})]}),l.jsxs("linearGradient",{id:"negativeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-2))",stopOpacity:.3}),l.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-2))",stopOpacity:.8})]})]}),l.jsx(v0,{strokeDasharray:"4 4"}),l.jsx(Cc,{dataKey:"label",tickLine:!0,tickMargin:15,axisLine:!0,angle:-35,textAnchor:"end",height:u?120:80,tick:{fontSize:u?22:14,fill:"#F8FAFB"}}),l.jsx(Co,{dataKey:"value",tickLine:!0,tickMargin:15,axisLine:!0,tickFormatter:f=>a&&s==="usd"?r1(f,2):d(f),tick:{fontSize:u?22:14,fill:"#F8FAFB"}}),l.jsx(y1,{content:l.jsx(JN,{hideIndicator:!0,className:"bg-app-primary/95 backdrop-blur-xs  rounded-lg",formatter:f=>{const h=Number(f);let m="hsl(var(--chart-1))";return o==="pnl"&&(m=h>0?"hsl(var(--positive-color))":"hsl(var(--chart-2))"),l.jsxs("div",{className:"flex min-w-[130px] items-center text-sm gap-3 2k:text-2xl 2k:min-w-[220px]",children:[l.jsx("div",{className:"w-2 h-4 rounded-xs shrink-0",style:{backgroundColor:m}}),l.jsx("span",{className:"text-muted-foreground",children:n?.y||"Value"}),l.jsx("div",{className:"text-foreground font-mono font-medium tabular-nums ml-auto",children:d(h)})]})},labelFormatter:f=>l.jsx("div",{className:"text-foreground text-sm font-medium pb-1 font-mono 2k:text-2xl",children:f})}),cursor:{opacity:.1}}),l.jsx(To,{dataKey:"value",radius:[4,4,0,0],maxBarSize:50,children:c.map(f=>{let h="url(#defaultGradient)",m="hsl(var(--chart-1))";if(o==="pnl"){const y=f.value>0;h=y?"url(#positiveGradient)":"url(#negativeGradient)",m=y?"hsl(var(--positive-color))":"hsl(var(--chart-2))"}return l.jsx(mf,{fill:h,stroke:m,strokeWidth:2,strokeDasharray:"4 4"},f.label)})})]})}),r&&r.length>0&&l.jsx("div",{className:"flex flex-wrap items-center gap-4",children:r.map((f,h)=>{const m=h+f.label;return l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md min-w-[85px] justify-center",children:[l.jsx("div",{"aria-hidden":"true",className:"w-2 h-4 shrink-0 rounded-xs 2k:w-4 2k:h-6",style:{backgroundColor:f.color}}),l.jsx("div",{className:"text-sm text-app-primary-foreground/70 2k:text-2xl",children:f.label})]},m)})})]})},nSt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1})=>{const i=b.useMemo(()=>$_t(t,e,r),[t,e,r]),s=b.useMemo(()=>!i||!Array.isArray(i)?!1:i.some(a=>typeof a.value=="number"&&a.value!==0),[i]);return n?l.jsx(_c,{title:"Long vs Short PnL",loadingText:"Loading position analysis..."}):l.jsx(yc,{hasData:s,title:"Long vs Short PnL",children:l.jsx(rP,{data:i,currency:r,compactYAxis:r==="usd",axisLabels:{x:"Position type",y:"P&L"},colorScheme:"pnl",legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"}]})})};var iSt=[" ","Enter","ArrowUp","ArrowDown"],sSt=[" ","Enter"],zp="Select",[nP,iP,aSt]=LV(zp),[x0]=ma(zp,[aSt,$f]),sP=$f(),[oSt,Zf]=x0(zp),[lSt,cSt]=x0(zp),Cxe=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:y}=t,x=sP(e),[v,_]=b.useState(null),[S,k]=b.useState(null),[E,T]=b.useState(!1),N=a0(u),[j,M]=Ao({prop:n,defaultProp:i??!1,onChange:s,caller:zp}),[O,R]=Ao({prop:a,defaultProp:o,onChange:c,caller:zp}),I=b.useRef(null),B=v?y||!!v.closest("form"):!0,[F,V]=b.useState(new Set),$=Array.from(F).map(U=>U.props.value).join(";");return l.jsx(Tj,{...x,children:l.jsxs(oSt,{required:m,scope:e,trigger:v,onTriggerChange:_,valueNode:S,onValueNodeChange:k,valueNodeHasChildren:E,onValueNodeHasChildrenChange:T,contentId:ts(),value:O,onValueChange:R,open:j,onOpenChange:M,dir:N,triggerPointerDownPosRef:I,disabled:h,children:[l.jsx(nP.Provider,{scope:e,children:l.jsx(lSt,{scope:t.__scopeSelect,onNativeOptionAdd:b.useCallback(U=>{V(z=>new Set(z).add(U))},[]),onNativeOptionRemove:b.useCallback(U=>{V(z=>{const L=new Set(z);return L.delete(U),L})},[]),children:r})}),B?l.jsxs(Yxe,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:U=>R(U.target.value),disabled:h,form:y,children:[O===void 0?l.jsx("option",{value:""}):null,Array.from(F)]},$):null]})})};Cxe.displayName=zp;var Exe="SelectTrigger",jxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=sP(r),a=Zf(Exe,r),o=a.disabled||n,c=Kt(e,a.onTriggerChange),u=iP(r),d=b.useRef("touch"),[f,h,m]=Qxe(x=>{const v=u().filter(k=>!k.disabled),_=v.find(k=>k.value===a.value),S=Zxe(v,x,_);S!==void 0&&a.onValueChange(S.value)}),y=x=>{o||(a.onOpenChange(!0),m()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return l.jsx(Qw,{asChild:!0,...s,children:l.jsx(vt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Kxe(a.value)?"":void 0,...i,ref:c,onClick:He(i.onClick,x=>
vendor: 14,933 bytes, line 4395
4395{x.currentTarget.focus(),d.current!=="mouse"&&y(x)}),onPointerDown:He(i.onPointerDown,x=>{d.current=x.pointerType;const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(y(x),x.preventDefault())}),onKeyDown:He(i.onKeyDown,x=>{const v=f.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&h(x.key),!(v&&x.key===" ")&&iSt.includes(x.key)&&(y(),x.preventDefault())})})})});jxe.displayName=Exe;var Nxe="SelectValue",Pxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:a="",...o}=t,c=Zf(Nxe,r),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,f=Kt(e,c.onValueNodeChange);return rs(()=>{u(d)},[u,d]),l.jsx(vt.span,{...o,ref:f,style:{pointerEvents:"none"},children:Kxe(c.value)?l.jsx(l.Fragment,{children:a}):s})});Pxe.displayName=Nxe;var uSt="SelectIcon",Mxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return l.jsx(vt.span,{"aria-hidden":!0,...i,ref:e,children:n||"▼"})});Mxe.displayName=uSt;var dSt="SelectPortal",Axe=t=>l.jsx(e0,{asChild:!0,...t});Axe.displayName=dSt;var Bp="SelectContent",Dxe=b.forwardRef((t,e)=>{const r=Zf(Bp,t.__scopeSelect),[n,i]=b.useState();if(rs(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?bc.createPortal(l.jsx(Oxe,{scope:t.__scopeSelect,children:l.jsx(nP.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),s):null}return l.jsx(Rxe,{...t,ref:e})});Dxe.displayName=Bp;var Jo=10,[Oxe,Xf]=x0(Bp),fSt="SelectContentImpl",hSt=kf("SelectContent.RemoveScroll"),Rxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:v,..._}=t,S=Zf(Bp,r),[k,E]=b.useState(null),[T,N]=b.useState(null),j=Kt(e,oe=>E(oe)),[M,O]=b.useState(null),[R,I]=b.useState(null),B=iP(r),[F,V]=b.useState(!1),$=b.useRef(!1);b.useEffect(()=>{if(k)return pj(k)},[k]),fj();const U=b.useCallback(oe=>{const[ge,...le]=B().map(he=>he.ref.current),[Se]=le.slice(-1),Ce=document.activeElement;for(const he of oe)if(he===Ce||(he?.scrollIntoView({block:"nearest"}),he===ge&&T&&(T.scrollTop=0),he===Se&&T&&(T.scrollTop=T.scrollHeight),he?.focus(),document.activeElement!==Ce))return},[B,T]),z=b.useCallback(()=>U([M,k]),[U,M,k]);b.useEffect(()=>{F&&z()},[F,z]);const{onOpenChange:L,triggerPointerDownPosRef:W}=S;b.useEffect(()=>{if(k){let oe={x:0,y:0};const ge=Se=>{oe={x:Math.abs(Math.round(Se.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(Se.pageY)-(W.current?.y??0))}},le=Se=>{oe.x<=10&&oe.y<=10?Se.preventDefault():k.contains(Se.target)||L(!1),document.removeEventListener("pointermove",ge),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",le,{capture:!0})}}},[k,L,W]),b.useEffect(()=>{const oe=()=>L(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[L]);const[K,q]=Qxe(oe=>{const ge=B().filter(Ce=>!Ce.disabled),le=ge.find(Ce=>Ce.ref.current===document.activeElement),Se=Zxe(ge,oe,le);Se&&setTimeout(()=>Se.ref.current.focus())}),H=b.useCallback((oe,ge,le)=>{const Se=!$.current&&!le;(S.value!==void 0&&S.value===ge||Se)&&(O(oe),Se&&($.current=!0))},[S.value]),Y=b.useCallback(()=>k?.focus(),[k]),J=b.useCallback((oe,ge,le)=>{const Se=!$.current&&!le;(S.value!==void 0&&S.value===ge||Se)&&I(oe)},[S.value]),re=n==="popper"?zz:Ixe,me=re===zz?{side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:v}:{};return l.jsx(Oxe,{scope:r,content:k,viewport:T,onViewportChange:N,itemRefCallback:H,selectedItem:M,onItemLeave:Y,itemTextRefCallback:J,focusSelectedItem:z,selectedItemText:R,position:n,isPositioned:F,searchRef:K,children:l.jsx(Yw,{as:hSt,allowPinchZoom:!0,children:l.jsx(qw,{asChild:!0,trapped:S.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:He(i,oe=>{S.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:l.jsx(Jy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:l.jsx(re,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:oe=>oe.preventDefault(),..._,...me,onPlaced:()=>V(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:He(_.onKeyDown,oe=>{const ge=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!ge&&oe.key.length===1&&q(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let Se=B().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const Ce=oe.target,he=Se.indexOf(Ce);Se=Se.slice(he+1)}setTimeout(()=>U(Se)),oe.preventDefault()}})})})})})})});Rxe.displayName=fSt;var pSt="SelectItemAlignedPosition",Ixe=b.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Zf(Bp,r),a=Xf(Bp,r),[o,c]=b.useState(null),[u,d]=b.useState(null),f=Kt(e,j=>d(j)),h=iP(r),m=b.useRef(!1),y=b.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:_,focusSelectedItem:S}=a,k=b.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&x&&v&&_){const j=s.trigger.getBoundingClientRect(),M=u.getBoundingClientRect(),O=s.valueNode.getBoundingClientRect(),R=_.getBoundingClientRect();if(s.dir!=="rtl"){const Ce=R.left-M.left,he=O.left-Ce,Ct=j.left-he,De=j.width+Ct,It=Math.max(De,M.width),Yt=window.innerWidth-Jo,Qt=Fz(he,[Jo,Math.max(Jo,Yt-It)]);o.style.minWidth=De+"px",o.style.left=Qt+"px"}else{const Ce=M.right-R.right,he=window.innerWidth-O.right-Ce,Ct=window.innerWidth-j.right-he,De=j.width+Ct,It=Math.max(De,M.width),Yt=window.innerWidth-Jo,Qt=Fz(he,[Jo,Math.max(Jo,Yt-It)]);o.style.minWidth=De+"px",o.style.right=Qt+"px"}const I=h(),B=window.innerHeight-Jo*2,F=x.scrollHeight,V=window.getComputedStyle(u),$=parseInt(V.borderTopWidth,10),U=parseInt(V.paddingTop,10),z=parseInt(V.borderBottomWidth,10),L=parseInt(V.paddingBottom,10),W=$+U+F+L+z,K=Math.min(v.offsetHeight*5,W),q=window.getComputedStyle(x),H=parseInt(q.paddingTop,10),Y=parseInt(q.paddingBottom,10),J=j.top+j.height/2-Jo,re=B-J,me=v.offsetHeight/2,oe=v.offsetTop+me,ge=$+U+oe,le=W-ge;if(ge<=J){const Ce=I.length>0&&v===I[I.length-1].ref.current;o.style.bottom="0px";const he=u.clientHeight-x.offsetTop-x.offsetHeight,Ct=Math.max(re,me+(Ce?Y:0)+he+z),De=ge+Ct;o.style.height=De+"px"}else{const Ce=I.length>0&&v===I[0].ref.current;o.style.top="0px";const Ct=Math.max(J,$+x.offsetTop+(Ce?H:0)+me)+le;o.style.height=Ct+"px",x.scrollTop=ge-J+x.offsetTop}o.style.margin=`${Jo}px 0`,o.style.minHeight=K+"px",o.style.maxHeight=B+"px",n?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,o,u,x,v,_,s.dir,n]);rs(()=>k(),[k]);const[E,T]=b.useState();rs(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const N=b.useCallback(j=>{j&&y.current===!0&&(k(),S?.(),y.current=!1)},[k,S]);return l.jsx(gSt,{scope:r,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:l.jsx(vt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ixe.displayName=pSt;var mSt="SelectPopperPosition",zz=b.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Jo,...s}=t,a=sP(r);return l.jsx(Cj,{...a,...s,ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});zz.displayName=mSt;var[gSt,p6]=x0(Bp,{}),Bz="SelectViewport",Lxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...i}=t,s=Xf(Bz,r),a=p6(Bz,r),o=Kt(e,s.onViewportChange),c=b.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),l.jsx(nP.Slot,{scope:r,children:l.jsx(vt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:He(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const y=window.innerHeight-Jo*2,x=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),_=Math.max(x,v);if(_<y){const S=_+m,k=Math.min(y,S),E=S-k;f.style.height=k+"px",f.style.bottom==="0px"&&(d.scrollTop=E>0?E:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Lxe.displayName=Bz;var $xe="SelectGroup",[ySt,vSt]=x0($xe),xSt=b.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ts();return l.jsx(ySt,{scope:r,id:i,children:l.jsx(vt.div,{role:"group","aria-labelledby":i,...n,ref:e})})});xSt.displayName=$xe;var Fxe="SelectLabel",bSt=b.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=vSt(Fxe,r);return l.jsx(vt.div,{id:i.id,...n,ref:e})});bSt.displayName=Fxe;var dE="SelectItem",[wSt,zxe]=x0(dE),Bxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...a}=t,o=Zf(dE,r),c=Xf(dE,r),u=o.value===n,[d,f]=b.useState(s??""),[h,m]=b.useState(!1),y=Kt(e,S=>c.itemRefCallback?.(S,n,i)),x=ts(),v=b.useRef("touch"),_=()=>{i||(o.onValueChange(n),o.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(wSt,{scope:r,value:n,disabled:i,textId:x,isSelected:u,onItemTextChange:b.useCallback(S=>{f(k=>k||(S?.textContent??"").trim())},[]),children:l.jsx(nP.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:l.jsx(vt.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:He(a.onFocus,()=>m(!0)),onBlur:He(a.onBlur,()=>m(!1)),onClick:He(a.onClick,()=>{v.current!=="mouse"&&_()}),onPointerUp:He(a.onPointerUp,()=>{v.current==="mouse"&&_()}),onPointerDown:He(a.onPointerDown,S=>{v.current=S.pointerType}),onPointerMove:He(a.onPointerMove,S=>{v.current=S.pointerType,i?c.onItemLeave?.():v.current==="mouse"&&S.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(a.onPointerLeave,S=>{S.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:He(a.onKeyDown,S=>{c.searchRef?.current!==""&&S.key===" "||(sSt.includes(S.key)&&_(),S.key===" "&&S.preventDefault())})})})})});Bxe.displayName=dE;var lx="SelectItemText",Vxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,a=Zf(lx,r),o=Xf(lx,r),c=zxe(lx,r),u=cSt(lx,r),[d,f]=b.useState(null),h=Kt(e,_=>f(_),c.onItemTextChange,_=>o.itemTextRefCallback?.(_,c.value,c.disabled)),m=d?.textContent,y=b.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return rs(()=>(x(y),()=>v(y)),[x,v,y]),l.jsxs(l.Fragment,{children:[l.jsx(vt.span,{id:c.textId,...s,ref:h}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?bc.createPortal(s.children,a.valueNode):null]})});Vxe.displayName=lx;var Uxe="SelectItemIndicator",Gxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return zxe(Uxe,r).isSelected?l.jsx(vt.span,{"aria-hidden":!0,...n,ref:e}):null});Gxe.displayName=Uxe;var Vz="SelectScrollUpButton",Wxe=b.forwardRef((t,e)=>{const r=Xf(Vz,t.__scopeSelect),n=p6(Vz,t.__scopeSelect),[i,s]=b.useState(!1),a=Kt(e,n.onScrollButtonChange);return rs(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=c.scrollTop>0;s(u)};const c=r.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),i?l.jsx(qxe,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=r;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});Wxe.displayName=Vz;var Uz="SelectScrollDownButton",Hxe=b.forwardRef((t,e)=>{const r=Xf(Uz,t.__scopeSelect),n=p6(Uz,t.__scopeSelect),[i,s]=b.useState(!1),a=Kt(e,n.onScrollButtonChange);return rs(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=r.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),i?l.jsx(qxe,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=r;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});Hxe.displayName=Uz;var qxe=b.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=t,s=Xf("SelectScrollButton",r),a=b.useRef(null),o=iP(r),c=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),rs(()=>{o().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[o]),l.jsx(vt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:He(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:He(i.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:He(i.onPointerLeave,()=>{c()})})}),_St="SelectSeparator",SSt=b.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return l.jsx(vt.div,{"aria-hidden":!0,...n,ref:e})});SSt.displayName=_St;var Gz="SelectArrow",kSt=b.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=sP(r),s=Zf(Gz,r),a=Xf(Gz,r);return s.open&&a.position==="popper"?l.jsx(Ej,{...i,...n,ref:e}):null});kSt.displayName=Gz;var TSt="SelectBubbleInput",Yxe=b.forwardRef(({__scopeSelect:t,value:e,...r},n)=>{const i=b.useRef(null),s=Kt(n,i),a=zV(e);return b.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&d){const f=new Event("change",{bubbles:!0});d.call(o,e),o.dispatchEvent(f)}},[a,e]),l.jsx(vt.select,{...r,style:{...bhe,...r.style},ref:s,defaultValue:e})});Yxe.displayName=TSt;function Kxe(t){return t===""||t===void 0}function Qxe(t){const e=Ki(t),r=b.useRef(""),n=b.useRef(0),i=b.useCallback(a=>
4395{const o=r.current+a;e(o),(function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(o)},[e]),s=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function Zxe(t,e,r){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let a=CSt(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function CSt(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var ESt=Cxe,jSt=jxe,NSt=Pxe,PSt=Mxe,MSt=Axe,ASt=Dxe,DSt=Lxe,OSt=Bxe,RSt=Vxe,ISt=Gxe,LSt=Wxe,$St=Hxe;function vu({...t}){return l.jsx(ESt,{"data-slot":"select",...t})}function xu({...t}){return l.jsx(NSt,{"data-slot":"select-value",...t})}function bu({className:t,size:e="default",children:r,...n}){return l.jsxs(jSt,{"data-slot":"select-trigger","data-size":e,className:ee("border border-app-border-color rounded-lg bg-app-input-bg data-[placeholder]:text-app-primary-foreground/70 [&_svg:not([class*='text-'])]:text-app-primary-foreground focus-visible:border-app-border-color-accent focus-visible:ring-app-border-color-accent/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:bg-app-input-bg/30 dark:hover:bg-app-input-bg/50 flex w-fit items-center justify-between gap-2 px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow,border] duration-200 outline-none focus-visible:ring-[1px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10.5 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer hover:border-app-border-color-accent data-[state=open]:border-app-border-color-accent group",t),...n,children:[r,l.jsx(PSt,{asChild:!0,children:l.jsx(Eu,{className:"size-4 transition-all duration-200 group-hover:text-app-border-color-accent group-data-[state=open]:rotate-180 group-data-[state=open]:text-app-border-color-accent"})})]})}function wu({className:t,children:e,position:r="popper",...n}){return l.jsx(MSt,{children:l.jsxs(ASt,{"data-slot":"select-content",className:ee("border border-app-border-color-soft rounded-xl bg-app-input-bg text-app-primary-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 duration-200 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[l.jsx(FSt,{}),l.jsx(DSt,{className:ee("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),l.jsx(zSt,{})]})})}function lc({className:t,children:e,...r}){return l.jsxs(OSt,{"data-slot":"select-item",className:ee("focus:bg-app-button-bg focus:text-app-primary-foreground [&_svg:not([class*='text-'])]:text-app-primary-foreground/70 relative flex w-full items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-pointer",t),...r,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(ISt,{children:l.jsx(ei,{className:"size-4 text-app-primary-foreground"})})}),l.jsx(RSt,{children:e})]})}function FSt({className:t,...e}){return l.jsx(LSt,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(J4,{className:"size-4"})})}function zSt({className:t,...e}){return l.jsx($St,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(Eu,{className:"size-4"})})}const Rv="#22d3ee",Iv="#a78bfa",Lv="#fbbf24",dL="hsl(var(--positive-color))",fL="hsl(var(--chart-2))",BSt=[{value:"3",label:"≥3"},{value:"4",label:"≥4"},{value:"5",label:"=5"}],VSt=[{value:"3",label:"≥3"},{value:"4",label:"≥4"},{value:"5",label:"=5"}],USt=[{value:"5",label:"≥5h"},{value:"6",label:"≥6h"},{value:"7",label:"≥7h"},{value:"8",label:"≥8h"}],GSt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1,dailyGradeMap:i})=>{const{userHasura:s}=Gt(),a=s?.physical_state_config||Wi,o=b.useMemo(()=>({energy:{label:a.energy_level?.name||"Energy",color:"#22d3ee"},sleepQuality:{label:a.sleep_quality?.name||"Sleep Quality",color:"#a78bfa"},sleepHours:{label:a.sleep_hours?.name||"Sleep Hours",color:"#fbbf24"}}),[a]),[c,u]=b.useState("4"),[d,f]=b.useState("4"),[h,m]=b.useState("7"),y=b.useMemo(()=>({energy:Number(c),sleepQuality:Number(d),sleepHours:Number(h)}),[c,d,h]),{data:x}=b.useMemo(()=>z_t(t,e,r,i,y),[t,e,r,i,y]),v=b.useMemo(()=>!x||x.length===0?!1:x.some(S=>S.energy!==0||S.sleepQuality!==0||S.sleepHours!==0),[x]);if(n)return l.jsx(_c,{title:"Physical State Performance",loadingText:"Loading physical state analysis..."});const _=S=>r==="r"?fn(S):Ke(S);return l.jsx(yc,{hasData:v,title:"Physical State Performance",action:l.jsxs(Bf,{children:[l.jsxs(Vf,{className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-app-input-bg hover:bg-app-input-bg/80 transition-colors border border-app-border-color-soft",children:[l.jsx(a3,{className:"size-4"}),l.jsx("span",{children:"Thresholds"})]}),l.jsx(Uf,{align:"end",className:"w-64",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("h4",{className:"font-medium text-sm",children:"Good/Poor Thresholds"}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-3 rounded-sm",style:{backgroundColor:Rv}}),l.jsx("span",{className:"text-sm",children:a.energy_level?.name||"Energy"})]}),l.jsxs(vu,{value:c,onValueChange:u,children:[l.jsx(bu,{size:"sm",className:"w-20",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:BSt.map(S=>l.jsx(lc,{value:S.value,children:S.label},S.value))})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-3 rounded-sm",style:{backgroundColor:Iv}}),l.jsx("span",{className:"text-sm",children:a.sleep_quality?.name||"Sleep Quality"})]}),l.jsxs(vu,{value:d,onValueChange:f,children:[l.jsx(bu,{size:"sm",className:"w-20",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:VSt.map(S=>l.jsx(lc,{value:S.value,children:S.label},S.value))})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-3 rounded-sm",style:{backgroundColor:Lv}}),l.jsx("span",{className:"text-sm",children:a.sleep_hours?.name||"Sleep Hours"})]}),l.jsxs(vu,{value:h,onValueChange:m,children:[l.jsx(bu,{size:"sm",className:"w-20",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:USt.map(S=>l.jsx(lc,{value:S.value,children:S.label},S.value))})]})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Good = at or above threshold",l.jsx("br",{}),"Poor = below threshold"]})]})})]}),children:l.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[l.jsx(Oy,{config:o,className:"min-h-[200px] h-[430px] w-full",children:l.jsxs(oE,{data:x,margin:{top:25,right:20,bottom:20,left
4395:0},barCategoryGap:"25%",children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"energyGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:Rv,stopOpacity:.9}),l.jsx("stop",{offset:"100%",stopColor:Rv,stopOpacity:.4})]}),l.jsxs("linearGradient",{id:"sleepQualityGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:Iv,stopOpacity:.9}),l.jsx("stop",{offset:"100%",stopColor:Iv,stopOpacity:.4})]}),l.jsxs("linearGradient",{id:"sleepHoursGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:Lv,stopOpacity:.9}),l.jsx("stop",{offset:"100%",stopColor:Lv,stopOpacity:.4})]})]}),l.jsx(v0,{strokeDasharray:"4 4",vertical:!1}),l.jsx(Cc,{dataKey:"label",tickLine:!1,axisLine:!0,tick:{fontSize:14,fill:"#F8FAFB"}}),l.jsx(Co,{tickLine:!1,axisLine:!1,tickFormatter:S=>r==="r"?fn(S,2):r1(S,2),tick:{fontSize:14,fill:"#F8FAFB"}}),l.jsx(y1,{content:l.jsx(JN,{hideIndicator:!0,className:"bg-app-primary/95 backdrop-blur-xs border rounded-lg p-3",formatter:(S,k)=>{const E=k==="energy"?Rv:k==="sleepQuality"?Iv:Lv,T=k==="energy"?a.energy_level?.name||"Energy":k==="sleepQuality"?a.sleep_quality?.name||"Sleep Quality":a.sleep_hours?.name||"Sleep Hours";return l.jsxs("div",{className:"flex min-w-[140px] items-center text-sm gap-3",children:[l.jsx("div",{className:"w-3 h-3 rounded-sm shrink-0",style:{backgroundColor:E}}),l.jsx("span",{className:"text-muted-foreground",children:T}),l.jsx("div",{className:"text-foreground font-mono font-medium tabular-nums ml-auto",children:_(Number(S))})]})},labelFormatter:S=>l.jsxs("div",{className:"text-foreground text-sm font-medium pb-1",children:[S," Conditions"]})}),cursor:{opacity:.1}}),l.jsx(To,{dataKey:"energy",fill:"url(#energyGradient)",radius:[4,4,0,0],maxBarSize:80,children:x.map(S=>l.jsx(mf,{stroke:S.energy>=0?dL:fL,strokeWidth:2},S.label))}),l.jsx(To,{dataKey:"sleepQuality",fill:"url(#sleepQualityGradient)",radius:[4,4,0,0],maxBarSize:70,children:x.map(S=>l.jsx(mf,{stroke:S.sleepQuality>=0?dL:fL,strokeWidth:2},S.label))}),l.jsx(To,{dataKey:"sleepHours",fill:"url(#sleepHoursGradient)",radius:[4,4,0,0],maxBarSize:60,children:x.map(S=>l.jsx(mf,{stroke:S.sleepHours>=0?dL:fL,strokeWidth:2},S.label))})]})}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md",children:[l.jsx("div",{className:"w-3 h-4 rounded-sm",style:{backgroundColor:Rv}}),l.jsx("span",{className:"text-sm text-app-primary-foreground/70",children:a.energy_level?.name||"Energy"})]}),l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md",children:[l.jsx("div",{className:"w-3 h-4 rounded-sm",style:{backgroundColor:Iv}}),l.jsx("span",{className:"text-sm text-app-primary-foreground/70",children:a.sleep_quality?.name||"Sleep Quality"})]}),l.jsxs("div",{className:"flex items-center gap-2 bg-app-input-bg p-2 rounded-md",children:[l.jsx("div",{className:"w-3 h-4 rounded-sm",style:{backgroundColor:Lv}}),l.jsx("span",{className:"text-sm text-app-primary-foreground/70",children:a.sleep_hours?.name||"Sleep Hours"})]})]})]})})},WSt=(t,e)=>{const r=[];return t.forEach(n=>{if(!(!n.exit_date||n.pnl==null)&&n.exit_price!=null){const i=typeof n.exit_price=="string"?Number.parseFloat(n.exit_price.replace(/[^0-9.-]+/g,"")):n.exit_price;Number.isNaN(i)||r.push(i)}}),r},HSt=t=>t.length===0?{min:0,max:0}:{min:Math.min(...t),max:Math.max(...t)},qSt=(t,e)=>{const r=WSt(t);return HSt(r)},YSt=(t,e,r)=>{const n=e-t,s=n/8,a=[2,5,10,25,50,100,250,500,1e3,2500,5e3,1e4],o=a.filter(d=>{const f=Math.ceil(n/d);return f>=4&&f<=12}),c=o.length>0?o:a.filter(d=>Math.abs(d-s)===Math.min(...a.map(f=>Math.abs(f-s))));return(c.includes(1)?c:[1,...c]).sort((d,f)=>{{if(d===1)return-1;if(f===1)return 1}return Math.abs(d-s)-Math.abs(f-s)}).slice(0,4).map(d=>({value:d.toString(),label:Ke(d,0)}))},KSt=t=>t==="r"?[{value:"1",label:"1R"},{value:"2",label:"2R"},{value:"5",label:"5R"},{value:"10",label:"10R"}]:[{value:"5",label:"$5"},{value:"10",label:"$10"},{value:"50",label:"$50"},{value:"100",label:"$100"}],QSt=(t,e)=>t.min===t.max?KSt(e):YSt(t.min,t.max),FS=(t,e,r)=>t===-1/0?r==="r"?`< (${e}R)`:`<$${e}`:e===null?r==="r"?`> ${t}R`:`>$${t}`:`$${t}-${e}`,ZSt=(t,e,r)=>{const{currency:n,step:i,minBars:s}=r,a=[],o=Number((Math.floor(t/i)*i).toFixed(4)),c=Number((Math.ceil(e/i)*i).toFixed(4));t<o&&a.push({range:FS(-1/0,o,n),min:-1/0,max:o,totalPnL:0,trades:0,winningTrades:0});for(let u=o;u<c;u+=i){const d=Number((u+i).toFixed(4)),f=Number(u.toFixed(4));a.push({range:FS(f,d,n),min:f,max:d,totalPnL:0,trades:0,winningTrades:0})}if(e>=c){const u=Number(c.toFixed(4));a.push({range:FS(u,null,n),min:u,max:null,totalPnL:0,trades:0,winningTrades:0})}for(;a.length<s;){const u=a[a.length-1],d=Number((u.max??u.min+i).toFixed(4)),f=Number((d+i).toFixed(4));a.push({range:FS(d,f,n),min:d,max:f,totalPnL:0,trades:0,winningTrades:0})}return a},XSt=(t,e)=>t.find(r=>r.max==null?e>=r.min:(r.min===-1/0||e>=r.min)&&e<r.max);
4395function JSt(t,e){if(t.length===0)return[];const{currency:r,mode:n,stepUsd:i=5,minBars:s=8,dataRange:a}=e;if(a.min===a.max)return[];const o=i,c=ZSt(a.min,a.max,{currency:"usd",step:o,minBars:s});return t.filter(d=>!d.exit_date||d.pnl==null||d.exit_price==null?!1:r==="r"?(d.risk??0)>0:!0).forEach(d=>{const f=d.pnl,h=d.net_pnl,m=n==="net"?h??f:f,y=typeof d.exit_price=="string"?Number(Number.parseFloat(d.exit_price.replace(/[^0-9.-]+/g,"")).toFixed(4)):Number(d.exit_price.toFixed(4));if(Number.isNaN(y))return;const x=XSt(c,y);if(x){const v=r==="r"&&d.risk&&d.risk>0?m/d.risk:m;x.totalPnL+=Number(v.toFixed(4)),x.trades++,m>0&&x.winningTrades++}}),c}function ekt(t,e){const r=JSt(t,e),n=r.map(a=>a.range),i=r.map(a=>a.totalPnL),s=r.map(a=>a.trades>0?a.winningTrades/a.trades*100:0);return{labels:n,pnl:i,winRate:s}}const tkt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1})=>{const[i,s]=b.useState("5"),a=b.useMemo(()=>qSt(t),[t,e]),o=b.useMemo(()=>QSt(a,"usd"),[a]),c=b.useMemo(()=>o.length===0||o.some(h=>h.value===i)?i:o[0].value,[i,o]),u=b.useMemo(()=>ekt(t,{currency:r,mode:e,stepUsd:Number(c),minBars:5,dataRange:a}),[t,e,r,c,a]),d=u.labels.length>0,f=s;return n?l.jsx(_c,{title:"Performance by Price Range",loadingText:"Loading performance by price range analysis..."}):l.jsx(yc,{hasData:d,title:"Performance by Price Range",action:l.jsxs(vu,{value:c,onValueChange:f,children:[l.jsx(bu,{size:"sm",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:o.map(h=>l.jsx(lc,{value:h.value,children:h.label},h.value))})]}),children:l.jsx(uE,{data:u,currency:r,legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"},{label:"Win Rate",color:"#a38bff"}]})})},rkt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1})=>{const i=b.useMemo(()=>I_t(t,e,r),[t,e,r]),s=b.useMemo(()=>t.length>0&&i.length>0,[t.length,i.length]);return n?l.jsx(_c,{title:"Top 10 Symbols by Absolute PNL",loadingText:"Loading symbol analysis..."}):l.jsx(yc,{hasData:s,title:"Symbol Analysis",children:l.jsx(rP,{data:i,currency:r,compactYAxis:r==="usd",colorScheme:"pnl",axisLabels:{y:"P&L"},legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"}]})})};function Xxe(t,e="net",r="usd"){const n=r==="r"?t.filter(c=>(c.risk??0)>0):t,i=c=>e==="net"?c.net_pnl??c.pnl??0:c.pnl??0;let s=9,a=16;n.forEach(c=>{if(!c.exit_date||c.pnl==null)return;const d=jp(new Date(c.entry_date),"America/New_York").getHours();d<s&&(s=d),d>a&&(a=d)});const o=[];for(let c=s;c<=a;c++)for(const u of[0,30]){if(c===16&&u===30&&a===16)break;o.push({hour:c,minute:u,totalPnL:0,trades:0,winningTrades:0})}return n.forEach(c=>{if(!c.exit_date||c.pnl==null)return;const u=jp(new Date(c.entry_date),"America/New_York"),d=u.getHours(),f=u.getMinutes(),h=o.find(m=>m.hour===d&&(f<30?m.minute===0:m.minute===30));if(h){const m=i(c),y=r==="r"&&c.risk&&c.risk>0?m/c.risk:m;h.totalPnL+=y,h.trades++,y>0&&h.winningTrades++}}),o}function nkt(t,e="net",r="usd"){const i=["Mon","Tue","Wed","Thu","Fri"].map(o=>({day:o,totalPnL:0,trades:0,winningTrades:0})),s=r==="r"?t.filter(o=>(o.risk??0)>0):t,a=o=>e==="net"?o.net_pnl??o.pnl??0:o.pnl??0;return s.forEach(o=>{if(!o.exit_date||o.pnl==null)return;const d=(new Date(o.entry_date).getDay()+6)%7;if(d>=0&&d<5){const f=a(o),h=r==="r"&&o.risk&&o.risk>0?f/o.risk:f;i[d].totalPnL+=h,i[d].trades++,h>0&&i[d].winningTrades++}}),i}const ikt=[{label:"1 hour",value:60},{label:"45 min",value:45},{label:"30 min",value:30},{label:"15 min",value:15}],skt=({value:t,onChange:e})=>l.jsxs(vu,{value:String(t),onValueChange:r=>e(Number(r)),children:[l.jsx(bu,{size:"sm",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:ikt.map(r=>l.jsx(lc,{value:String(r.value),children:r.label},r.value))})]}),akt=({trades:t,mode:e="net",currency:r="usd"})=>{const[n,i]=b.useState(30),s=Xxe(t,e,r),a=s.map(y=>({label:`${y.hour.toString().padStart(2,"0")}:${y.minute.toString().padStart(2,"0")}`,pnl:y.totalPnL,trades:y.trades,winRate:y.trades>0?y.winningTrades/y.trades*100:0})),o=s.length>0?`${s[0].hour.toString().padStart(2,"0")}:${s[0].minute.toString().padStart(2,"0")}`:"09:00",c=s.length>0?`${s[s.length-1].hour.toString().padStart(2,"0")}:${s[s.length-1].minute.toString().padStart(2,"0")}`:"16:00",u=hDe(o,c,n,a),d=nkt(t,e,r),f={labels:d.map(y=>y.day),pnl:d.map(y=>y.totalPnL),trades:d.map(y=>y.trades),winRate:d.map(y=>y.trades>0?y.winningTrades/y.trades*100:0)},h=s.some(y=>y.trades>0),m=d.some(y=>y.trades>0);return l.jsxs(l.Fragment,{children:[l.jsx(yc,{hasData:h,title:"Time Distribution Analysis",action:l.jsx(skt,{value:n,onChange:i}),children:l.jsx(uE,{data:u,currency:r,legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"},{label:"Win Rate",color:"#a38bff"}]})}),l.jsx(yc,{hasData:m,className:"flex",title:"Performance by Day of Week",children:l.jsx(uE,{data:f,currency:r,legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"},{label:"Win Rate",color:"#a38bff"}]})})]})},cx=t=>{if(!Number.isFinite(t))return"0";const e=Math.abs(t);return e>=1e6?`${Math.round(t/1e4)/100}M`:e>=1e3?`${Math.round(t/10)/100}k`:`${Math.round(t)}`},zS=(t,e)=>t===-1/0?`<${cx(e??0)}`:e==null?`>${cx(t)}`:`${cx(t)}-${cx(e)}`,okt=t=>{const e=[];for(const r of t){if(r.status!=="CLOSED")continue;const n=r.position_size??0;n>0&&Number.isFinite(n)&&e.push(n)}return e},lkt=t=>t.length===0?{min:0,max:0}:{min:Math.min(...t),max:Math.max(...t)},ckt=t=>lkt(okt(t)),ukt=()=>[{value:"10000",label:"10k"},{value:"50000",label:"50k"},{value:"100000",label:"100k"},{value:"250000",label:"250k"}],dkt=t=>{const{min:e,max:r}=t;if(e===r)return ukt();const n=r-e,s=n/8,a=[100,500,1e3,2500,5e3,1e4,25e3,5e4,1e5,25e4,5e5,1e6,25e5,5e6,1e7,25e6,5e7],o=a.filter(u=>{const d=Math.ceil(n/u);return d>=4&&d<=12});return(o.length>0?o:a).sort((u,d)=>Math.abs(u-s)-Math.abs(d-s)).slice(0,4).map(u=>({value:String(u),label:cx(u)}))},fkt=(t,e,r)=>{const{step:n,minBars:i}=r,s=[],a=Math.floor(t/n)*n,o=Math.ceil(e/n)*n;t<a&&s.push({range:zS(-1/0,a),min:-1/0,max:a,totalPnL:0,trades:0,winningTrades:0});for(let c=a;c<o;c+=n){const u=c,d=c+n;s.push({range:zS(u,d),min:u,max:d,totalPnL:0,trades:0,winningTrades:0})}for(e>=o&&s.push({range:zS(o,null),min:o,max:null,totalPnL:0,trades:0,winningTrades:0});s.length<i;){const c=s[s.length-1],u=c.max??c.min+n,d=u+n;s.push({range:zS(u,d),min:u,max:d,totalPnL:0,trades:0,winningTrades:0})}return s},hkt=(t,e)=>t.find(r=>r.max==null?e>=r.min:(r.min===-1/0||e>=r.min)&&e<r.max),pkt=(t,e)=>{if(t.length===0)return[];const{step:r,minBars:n=6,mode:i,currency:s}=e,a=e.dataRange;if(a.min===a.max)return[];const o=fkt(a.min,a.max,{step:r,minBars:n}),c=t.filter(d=>!(d.status!=="CLOSED"||(d.position_size??0)<=0||s==="r"&&!(d.risk&&d.risk>0))),u=d=>i==="net"?d.net_pnl??d.pnl??0:d.pnl??0;for(const d of c){const f=d.position_size??0,h=hkt(o,f);if(!h)continue;const m=u(d),y=s==="r"&&d.risk&&d.risk>0?m/d.risk:m;h.totalPnL+=y,h.trades+=1,m>0&&(h.winningTrades+=1)}return o.map(d=>({label:d.range,value:d.totalPnL}
4395))},mkt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1})=>{const[i,s]=b.useState("50000"),a=b.useMemo(()=>ckt(t),[t]),o=b.useMemo(()=>dkt(a),[a]),c=b.useMemo(()=>o.length===0||o.some(f=>f.value===i)?i:o[0].value,[i,o]),u=b.useMemo(()=>pkt(t,{step:Number(c),mode:e,currency:r,dataRange:a}),[t,c,e,r,a]),d=u.some(f=>f.value!==0);return n?l.jsx(_c,{title:"Performance by Trade Volume Range",loadingText:"Loading volume analysis..."}):l.jsx(yc,{hasData:d,title:"Volume Range Analysis",action:l.jsxs(vu,{value:c,onValueChange:s,children:[l.jsx(bu,{size:"sm",children:l.jsx(xu,{})}),l.jsx(wu,{align:"end",children:o.map(f=>l.jsx(lc,{value:f.value,children:f.label},f.value))})]}),children:l.jsx(rP,{data:u,currency:r,compactYAxis:r==="usd",colorScheme:"pnl",axisLabels:{y:"P&L"},legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"}]})})},gkt=({trades:t,mode:e="net",currency:r="usd",isLoading:n=!1})=>{const i=b.useMemo(()=>L_t(t,e,r),[t,e,r]),s=b.useMemo(()=>!i||!Array.isArray(i)?!1:i.some(a=>typeof a.value=="number"&&a.value!==0),[i]);return n?l.jsx(_c,{title:"Win vs Loss Comparison",loadingText:"Loading win/loss analysis..."}):l.jsx(yc,{hasData:s,title:"Win vs Loss Comparison",children:l.jsx(rP,{data:i,currency:r,compactYAxis:r==="usd",axisLabels:{x:"Result type"},colorScheme:"pnl",legends:[{label:"Profit",color:"hsl(var(--positive-color))"},{label:"Loss",color:"hsl(var(--chart-2))"}]})})},nie={green:"text-green-400",red:"text-red-400",white:"text-white"},Sn=({label:t,value:e,icon:r,variant:n="white"})=>l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("span",{className:"text-sm text-gray-400 2k:text-2xl",children:t}),l.jsxs("span",{className:Pe("flex items-center gap-2 font-semibold 2k:text-2xl",nie[n]),children:[e,r&&l.jsx("span",{className:"bg-white/5 rounded-full p-1.5",children:l.jsx(r,{size:16,className:Pe(nie[n],"2k:w-6 2k:h-6 2k:ml-1")})})]})]}),Cd=({title:t,children:e,className:r=""})=>l.jsx("section",{className:Pe("bg-app-card/70 border border-app-border-color-soft rounded-xl p-5 sm:p-6 h-full",r),children:l.jsxs("div",{className:"flex flex-col h-full gap-4",children:[t&&l.jsx("h3",{className:"text-base font-semibold text-white mb-2 2k:text-2xl 2k:mb-4",children:t}),l.jsx("div",{className:"flex flex-col justify-center h-full gap-2.5 2k:gap-4",children:e})]})}),ykt=({stats:t,currency:e="usd",mode:r="net"})=>{const n=(i,s=2)=>e==="r"?fn(i,s):Ke(i,s);return l.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-3",children:[l.jsxs("div",{className:"grid gap-6 xl:col-span-2",children:[l.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[l.jsxs(Cd,{title:"Total Metrics",className:"min-h-[120px]",children:[l.jsx(Sn,{label:"Total P&L",value:n(t.totalPnL),icon:Yc,variant:t.totalPnL>0?"green":t.totalPnL<0?"red":"white"}),l.jsx(Sn,{label:"Win Rate",value:`${Dd(t.winRate)}%`,icon:_s,variant:"green"}),r==="net"&&l.jsx(Sn,{label:"Total Commissions & Fees",value:Ke(t.totalFees),icon:E2})]}),l.jsxs(Cd,{title:"Average Metrics",className:"min-h-[120px]",children:[l.jsx(Sn,{label:"Average Daily Gain/Loss",value:n(t.averageDailyPnL),icon:Cu,variant:t.averageDailyPnL>0?"green":"red"}),l.jsx(Sn,{label:"Average Trade Gain/Loss",value:n(t.averagePnLPerTrade),icon:_f,variant:t.averagePnLPerTrade>0?"green":"red"}),l.jsx(Sn,{label:"Average Per-share Gain/Loss",value:n(t.averagePerSharePnL,4),icon:lMe,variant:t.averagePerSharePnL>0?"green":"red"})]})]}),l.jsx(Cd,{title:"Win Metrics",children:l.jsxs("div",{className:"grid sm:grid-cols-2 gap-16",children:[l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsx(Sn,{label:"Winning Trades",value:t.winningTrades,icon:Is,variant:"green"}),l.jsx(Sn,{label:"Max Consecutive Wins",value:Dd(t.maxConsecutiveWins),icon:eb,variant:"green"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsx(Sn,{label:"Largest Win",value:t.largestWin.id?l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs(At,{to:`/app/trades/${t.largestWin.id}`,className:"group inline-flex items-center gap-2 cursor-pointer",children:[l.jsx("span",{children:n(Math.abs(t.largestWin.value))}),l.jsx(Cs,{className:"size-3.5 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-all duration-300 shrink-0 text-app-primary-foreground
4395/70 self-start"})]})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs",children:"View trade details"})})]}):l.jsx("span",{children:n(Math.abs(t.largestWin.value))}),icon:E$,variant:"green"}),l.jsx(Sn,{label:"Average Win Amount",value:n(t.averageWin),icon:E$,variant:"green"})]})]})}),l.jsx(Cd,{title:"Loss Metrics",children:l.jsxs("div",{className:"grid sm:grid-cols-2 gap-16",children:[l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsx(Sn,{label:"Losing Trades",value:t.losingTrades,icon:Is,variant:"red"}),l.jsx(Sn,{label:"Max Consecutive Losses",value:Dd(t.maxConsecutiveLosses),icon:eb,variant:"red"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsx(Sn,{label:"Largest Loss",value:t.largestLoss.id?l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsxs(At,{to:`/app/trades/${t.largestLoss.id}`,className:"group inline-flex items-center gap-2 cursor-pointer",children:[l.jsx("span",{children:n(Math.abs(t.largestLoss.value))}),l.jsx(Cs,{className:"size-3.5 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-all duration-300 shrink-0 text-app-primary-foreground/70 self-start"})]})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs",children:"View trade details"})})]}):l.jsx("span",{children:n(Math.abs(t.largestLoss.value))}),icon:C$,variant:"red"}),l.jsx(Sn,{label:"Average Loss Amount",value:n(t.averageLoss),icon:C$,variant:"red"})]})]})})]}),l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsxs(Cd,{title:"Trades Overview",children:[l.jsx(Sn,{label:"Total Trades",value:t.totalTrades,icon:hk}),l.jsx(Sn,{label:"Scratch Trades",value:t.breakEvenTrades,icon:hk}),l.jsx(Sn,{label:"Average Daily Volume",value:Dd(t.averageDailyVolume,0),icon:hk})]}),l.jsxs(Cd,{title:"Volume & Cost Metrics",children:[l.jsx(Sn,{label:"Profit Factor",value:Dd(t.profitFactor),icon:b$,variant:"green"}),l.jsx(Sn,{label:"Risk/Reward Ratio",value:Dd(t.riskRewardRatio),icon:b$,variant:"green"})]}),l.jsxs(Cd,{title:"Time Metrics",children:[l.jsx(Sn,{label:"Avg Win Hold Time",value:t.averageWinHoldTime,icon:j$,variant:"green"}),l.jsx(Sn,{label:"Avg Loss Hold Time",value:t.averageLossHoldTime,icon:j$,variant:"red"})]})]}),r==="net"&&l.jsxs(Cd,{title:"Commission & Fees Breakdown",className:"min-h-[120px]",children:[l.jsx(Sn,{label:"Total Commissions",value:Ke(t.totalCommissions),icon:E2,variant:"white"}),l.jsx(Sn,{label:"Total Fees",value:Ke(t.totalMiscFees),icon:E2,variant:"white"})]})]})},vkt=t=>{if(t.dateRange)return t.dateRange;if(t.currentDate)return{start:sr(Gs(t.currentDate),"yyyy-MM-dd"),end:sr(ga(t.currentDate),"yyyy-MM-dd")};throw new Error("Either currentDate or dateRange must be provided")},xkt=({currentDate:t,dateRange:e,enabled:r=!0})=>{const{userHasura:n}=Gt(),{start:i,end:s}=b.useMemo(()=>vkt({currentDate:t,dateRange:e}),[t,e]),a=b.useMemo(()=>n?.id?{userId:n.id,startDate:Mu(i),endDate:Mu(s,!0)}:null,[n?.id,i,s]),{data:o,loading:c,error:u,refetch:d}
4395=da(iYe,{variables:a,skip:!a||!r,fetchPolicy:"cache-first",notifyOnNetworkStatusChange:!0,returnPartialData:!0}),f=o?.trade??[];return{trades:f,total:f.length,isLoading:c,error:u,refetch:d}},bkt=[{__typename:"trade",id:"penny-1",user_id:"dummy-user",symbol:"PENNY1",entry_price:.25,exit_price:.28,position_size:1e3,commissions_fees:2.5,entry_date:"2025-01-13T09:00:00+00:00",exit_date:"2025-01-13T09:30:00+00:00",pnl:30,net_pnl:27.5,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T09:00:00+00:00"},{__typename:"trade",id:"penny-2",user_id:"dummy-user",symbol:"PENNY2",entry_price:.75,exit_price:.72,position_size:800,commissions_fees:2,entry_date:"2025-01-13T09:30:00+00:00",exit_date:"2025-01-13T10:00:00+00:00",pnl:-24,net_pnl:-26,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T09:30:00+00:00"},{__typename:"trade",id:"penny-3",user_id:"dummy-user",symbol:"PENNY3",entry_price:.5,exit_price:.55,position_size:1200,commissions_fees:3,entry_date:"2025-01-13T10:00:00+00:00",exit_date:"2025-01-13T10:30:00+00:00",pnl:60,net_pnl:57,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T10:00:00+00:00"}
4395,{__typename:"trade",id:"low-1",user_id:"dummy-user",symbol:"LOW1",entry_price:1.25,exit_price:1.35,position_size:500,commissions_fees:2,entry_date:"2025-01-13T10:30:00+00:00",exit_date:"2025-01-13T11:00:00+00:00",pnl:50,net_pnl:48,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T10:30:00+00:00"},{__typename:"trade",id:"low-2",user_id:"dummy-user",symbol:"LOW2",entry_price:1.75,exit_price:1.68,position_size:400,commissions_fees:1.75,entry_date:"2025-01-13T11:00:00+00:00",exit_date:"2025-01-13T11:30:00+00:00",pnl:-28,net_pnl:-29.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T11:00:00+00:00"},{__typename:"trade",id:"low-3",user_id:"dummy-user",symbol:"LOW3",entry_price:1.5,exit_price:1.62,position_size:600,commissions_fees:2.25,entry_date:"2025-01-13T11:30:00+00:00",exit_date:"2025-01-13T12:00:00+00:00",pnl:72,net_pnl:69.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-13T11:30:00+00:00"},{__typename:"trade",id:"mid-low-1",user_id:"dummy-user",symbol:"MIDLOW1",entry_price:2.25,exit_price:2.4,position_size:300,commissions_fees:1.5,entry_date:"2025-01-14T12:00:00+00:00",exit_date:"2025-01-14T12:30:00+00:00",pnl:45,net_pnl:43.5,status:"CLOSED",position_type:"LONG",created_at:"2025-01-14T12:00:00+00:00"}
4395,{__typename:"trade",id:"mid-low-2",user_id:"dummy-user",symbol:"MIDLOW2",entry_price:2.75,exit_price:2.65,position_size:250,commissions_fees:1.25,entry_date:"2025-01-14T12:30:00+00:00",exit_date:"2025-01-14T13:00:00+00:00",pnl:-25,net_pnl:-26.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-14T12:30:00+00:00"},{__typename:"trade",id:"mid-low-3",user_id:"dummy-user",symbol:"MIDLOW3",entry_price:2.5,exit_price:2.68,position_size:350,commissions_fees:1.75,entry_date:"2025-01-14T13:00:00+00:00",exit_date:"2025-01-14T13:30:00+00:00",pnl:63,net_pnl:61.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-14T13:00:00+00:00"},{__typename:"trade",id:"mid-1",user_id:"dummy-user",symbol:"MID1",entry_price:3.25,exit_price:3.45,position_size:200,commissions_fees:1.25,entry_date:"2025-01-15T13:30:00+00:00",exit_date:"2025-01-15T14:00:00+00:00",pnl:40,net_pnl:38.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-15T13:30:00+00:00"},{__typename:"trade",id:"mid-2",user_id:"dummy-user",symbol:"MID2",entry_price:3.75,exit_price:3.62,position_size:180,commissions_fees:1,entry_date:"2025-01-15T14:00:00+00:00",exit_date:"2025-01-15T14:30:00+00:00",pnl:-23.4,net_pnl:-24.4,status:"CLOSED",position_type:"LONG",created_at:"2025-01-15T14:00:00+00:00"}
4395,{__typename:"trade",id:"mid-3",user_id:"dummy-user",symbol:"MID3",entry_price:3.5,exit_price:3.72,position_size:220,commissions_fees:1.5,entry_date:"2025-01-15T14:30:00+00:00",exit_date:"2025-01-15T15:00:00+00:00",pnl:48.4,net_pnl:46.9,status:"CLOSED",position_type:"LONG",created_at:"2025-01-15T14:30:00+00:00"},{__typename:"trade",id:"mid-high-1",user_id:"dummy-user",symbol:"MIDHIGH1",entry_price:4.25,exit_price:4.5,position_size:150,commissions_fees:1,entry_date:"2025-01-16T15:00:00+00:00",exit_date:"2025-01-16T15:30:00+00:00",pnl:37.5,net_pnl:36.5,status:"CLOSED",position_type:"LONG",created_at:"2025-01-16T15:00:00+00:00"},{__typename:"trade",id:"mid-high-2",user_id:"dummy-user",symbol:"MIDHIGH2",entry_price:4.75,exit_price:4.58,position_size:120,commissions_fees:.75,entry_date:"2025-01-16T15:30:00+00:00",exit_date:"2025-01-16T16:00:00+00:00",pnl:-20.4,net_pnl:-21.15,status:"CLOSED",position_type:"LONG",created_at:"2025-01-16T15:30:00+00:00"},{__typename:"trade",id:"mid-high-3",user_id:"dummy-user",symbol:"MIDHIGH3",entry_price:4.5,exit_price:4.78,position_size:160,commissions_fees:1.25,entry_date:"2025-01-17T09:00:00+00:00",exit_date:"2025-01-17T09:30:00+00:00",pnl:44.8,net_pnl:43.55,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T09:00:00+00:00"},{__typename:"trade",id:"high-low-1",user_id:"dummy-user",symbol
4395:"HIGHLOW1",entry_price:5.25,exit_price:5.55,position_size:100,commissions_fees:.75,entry_date:"2025-01-17T09:30:00+00:00",exit_date:"2025-01-17T10:00:00+00:00",pnl:30,net_pnl:29.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T09:30:00+00:00"},{__typename:"trade",id:"high-low-2",user_id:"dummy-user",symbol:"HIGHLOW2",entry_price:5.75,exit_price:5.52,position_size:80,commissions_fees:.5,entry_date:"2025-01-17T10:00:00+00:00",exit_date:"2025-01-17T10:30:00+00:00",pnl:-18.4,net_pnl:-18.9,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T10:00:00+00:00"},{__typename:"trade",id:"high-low-3",user_id:"dummy-user",symbol:"HIGHLOW3",entry_price:5.5,exit_price:5.85,position_size:110,commissions_fees:.75,entry_date:"2025-01-17T10:30:00+00:00",exit_date:"2025-01-17T11:00:00+00:00",pnl:38.5,net_pnl:37.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T10:30:00+00:00"},{__typename:"trade",id:"high-mid-1",user_id:"dummy-user",symbol:"HIGHMID1",entry_price:6.25,exit_price:6.6,position_size:75,commissions_fees:.5,entry_date:"2025-01-17T11:00:00+00:00",exit_date:"2025-01-17T11:30:00+00:00",pnl:26.25,net_pnl:25.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T11:00:00+00:00"},{__typename:"trade",id:"high-mid-2",user_id:"dummy-user",symbol
4395:"HIGHMID2",entry_price:6.75,exit_price:6.48,position_size:60,commissions_fees:.5,entry_date:"2025-01-17T11:30:00+00:00",exit_date:"2025-01-17T12:00:00+00:00",pnl:-16.2,net_pnl:-16.7,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T11:30:00+00:00"},{__typename:"trade",id:"high-mid-3",user_id:"dummy-user",symbol:"HIGHMID3",entry_price:6.5,exit_price:6.92,position_size:85,commissions_fees:.75,entry_date:"2025-01-17T12:00:00+00:00",exit_date:"2025-01-17T12:30:00+00:00",pnl:35.7,net_pnl:34.95,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T12:00:00+00:00"},{__typename:"trade",id:"high-1",user_id:"dummy-user",symbol:"HIGH1",entry_price:7.25,exit_price:7.65,position_size:50,commissions_fees:.5,entry_date:"2025-01-17T12:30:00+00:00",exit_date:"2025-01-17T13:00:00+00:00",pnl:20,net_pnl:19.5,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T12:30:00+00:00"},{__typename:"trade",id:"high-2",user_id:"dummy-user",symbol:"HIGH2",entry_price:7.75,exit_price:7.44,position_size:40,commissions_fees:.5,entry_date:"2025-01-17T13:00:00+00:00",exit_date:"2025-01-17T13:30:00+00:00",pnl:-12.4,net_pnl:-12.9,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T13:00:00+00:00"}
4395,{__typename:"trade",id:"high-3",user_id:"dummy-user",symbol:"HIGH3",entry_price:7.5,exit_price:7.98,position_size:55,commissions_fees:.75,entry_date:"2025-01-17T13:30:00+00:00",exit_date:"2025-01-17T14:00:00+00:00",pnl:26.4,net_pnl:25.65,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T13:30:00+00:00"},{__typename:"trade",id:"high-plus-1",user_id:"dummy-user",symbol:"HIGHPLUS1",entry_price:8.25,exit_price:8.7,position_size:35,commissions_fees:.5,entry_date:"2025-01-17T14:00:00+00:00",exit_date:"2025-01-17T14:30:00+00:00",pnl:15.75,net_pnl:15.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T14:00:00+00:00"},{__typename:"trade",id:"high-plus-2",user_id:"dummy-user",symbol:"HIGHPLUS2",entry_price:8.75,exit_price:8.4,position_size:30,commissions_fees:.5,entry_date:"2025-01-17T14:30:00+00:00",exit_date:"2025-01-17T15:00:00+00:00",pnl:-10.5,net_pnl:-11,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T14:30:00+00:00"},{__typename:"trade",id:"high-plus-3",user_id:"dummy-user",symbol:"HIGHPLUS3",entry_price:8.5,exit_price:9.04,position_size:40,commissions_fees:.75,entry_date:"2025-01-17T15:00:00+00:00",exit_date:"2025-01-17T15:30:00+00:00",pnl:21.6,net_pnl:20.85,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T15:00:00+00:00"},{__typename:"trade",id:"near-ten-1",user_id:"dummy-user",symbol
4395:"NEARTEN1",entry_price:9.25,exit_price:9.75,position_size:25,commissions_fees:.5,entry_date:"2025-01-17T15:30:00+00:00",exit_date:"2025-01-17T16:00:00+00:00",pnl:12.5,net_pnl:12,status:"CLOSED",position_type:"LONG",created_at:"2025-01-17T15:30:00+00:00"},{__typename:"trade",id:"near-ten-2",user_id:"dummy-user",symbol:"NEARTEN2",entry_price:9.75,exit_price:9.36,position_size:20,commissions_fees:.5,entry_date:"2025-01-20T09:00:00+00:00",exit_date:"2025-01-20T09:30:00+00:00",pnl:-7.8,net_pnl:-8.3,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T09:00:00+00:00"},{__typename:"trade",id:"near-ten-3",user_id:"dummy-user",symbol:"NEARTEN3",entry_price:9.5,exit_price:10.1,position_size:28,commissions_fees:.75,entry_date:"2025-01-20T09:30:00+00:00",exit_date:"2025-01-20T10:00:00+00:00",pnl:16.8,net_pnl:16.05,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T09:30:00+00:00"},{__typename:"trade",id:"ten-twenty-1",user_id:"dummy-user",symbol:"TENTWENTY1",entry_price:12.5,exit_price:13.25,position_size:15,commissions_fees:.5,entry_date:"2025-01-20T10:00:00+00:00",exit_date:"2025-01-20T10:30:00+00:00",pnl:11.25,net_pnl:10.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T10:00:00+00:00"},{__typename:"trade",id:"ten-twenty-2",user_id:"dummy-user",symbol
4395:"TENTWENTY2",entry_price:17.75,exit_price:17.04,position_size:12,commissions_fees:.5,entry_date:"2025-01-20T10:30:00+00:00",exit_date:"2025-01-20T11:00:00+00:00",pnl:-8.52,net_pnl:-9.02,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T10:30:00+00:00"},{__typename:"trade",id:"ten-twenty-3",user_id:"dummy-user",symbol:"TENTWENTY3",entry_price:15.25,exit_price:16.2,position_size:18,commissions_fees:.75,entry_date:"2025-01-20T11:00:00+00:00",exit_date:"2025-01-20T11:30:00+00:00",pnl:17.1,net_pnl:16.35,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T11:00:00+00:00"},{__typename:"trade",id:"hundred-1",user_id:"dummy-user",symbol:"HUNDRED1",entry_price:125.5,exit_price:133.25,position_size:8,commissions_fees:1,entry_date:"2025-01-20T11:30:00+00:00",exit_date:"2025-01-20T12:00:00+00:00",pnl:62,net_pnl:61,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T11:30:00+00:00"},{__typename:"trade",id:"hundred-2",user_id:"dummy-user",symbol:"HUNDRED2",entry_price:175.75,exit_price:168.72,position_size:6,commissions_fees:.75,entry_date:"2025-01-20T12:00:00+00:00",exit_date:"2025-01-20T12:30:00+00:00",pnl:-42.18,net_pnl:-42.93,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T12:00:00+00:00"}
4395,{__typename:"trade",id:"hundred-3",user_id:"dummy-user",symbol:"HUNDRED3",entry_price:150.25,exit_price:159.8,position_size:10,commissions_fees:1.25,entry_date:"2025-01-20T12:30:00+00:00",exit_date:"2025-01-20T13:00:00+00:00",pnl:95.5,net_pnl:94.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T12:30:00+00:00"},{__typename:"trade",id:"five-hundred-1",user_id:"dummy-user",symbol:"FIVEHUNDRED1",entry_price:625.5,exit_price:665.25,position_size:3,commissions_fees:1,entry_date:"2025-01-20T13:00:00+00:00",exit_date:"2025-01-20T13:30:00+00:00",pnl:119.25,net_pnl:118.25,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T13:00:00+00:00"},{__typename:"trade",id:"five-hundred-2",user_id:"dummy-user",symbol:"FIVEHUNDRED2",entry_price:875.75,exit_price:831.96,position_size:2,commissions_fees:.75,entry_date:"2025-01-20T13:30:00+00:00",exit_date:"2025-01-20T14:00:00+00:00",pnl:-87.58,net_pnl:-88.33,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T13:30:00+00:00"},{__typename:"trade",id:"five-hundred-3",user_id:"dummy-user",symbol
4395:"FIVEHUNDRED3",entry_price:750.25,exit_price:798,position_size:4,commissions_fees:1.5,entry_date:"2025-01-20T14:00:00+00:00",exit_date:"2025-01-20T14:30:00+00:00",pnl:191,net_pnl:189.5,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T14:00:00+00:00"},{__typename:"trade",id:"thousand-1",user_id:"dummy-user",symbol:"THOUSAND1",entry_price:1250.5,exit_price:1330.25,position_size:1,commissions_fees:1,entry_date:"2025-01-20T14:30:00+00:00",exit_date:"2025-01-20T15:00:00+00:00",pnl:79.75,net_pnl:78.75,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T14:30:00+00:00"},{__typename:"trade",id:"thousand-2",user_id:"dummy-user",symbol:"THOUSAND2",entry_price:1875.75,exit_price:1781.96,position_size:1,commissions_fees:1,entry_date:"2025-01-20T15:00:00+00:00",exit_date:"2025-01-20T15:30:00+00:00",pnl:-93.79,net_pnl:-94.79,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T15:00:00+00:00"},{__typename:"trade",id:"thousand-3",user_id:"dummy-user",symbol:"THOUSAND3",entry_price:1500.25,exit_price:1596,position_size:2,commissions_fees:1.5,entry_date:"2025-01-20T15:30:00+00:00",exit_date:"2025-01-20T16:00:00+00:00",pnl:191.5,net_pnl:190,status:"CLOSED",position_type:"LONG",created_at:"2025-01-20T15:30:00+00:00"}],wkt=()=>{const{dateRange:t}=s0(),{userHasura:e}=Gt(),{viewSettings:r,updateViewSettings:n}=o1("mt:insights:viewPrefs"),{trades:i,isLoading:s}=xkt({dateRange:{start:t.from.toISOString(),end:t.to.toISOString()},enabled:!0}),{data:a}=ws(UV,{variables:{userId:e?.id??"",startDate:t.from.toISOString().split("T")[0],endDate:t.to.toISOString().split("T")[0]},skip:!e?.id,fetchPolicy:"cache-first"}),o=b.useMemo(()=>{const x=new Map;return a?.daily_grade?.forEach(v=>{x.set(v.tradeDay,{grade:v.grade,sleepHours:v.sleepHours,energyLevel:v.energyLevel,sleepQuality:v.sleepQuality})}),x},[a]),{shouldShowProBanner:c}=Hs(),u=c(),d=b.useMemo(()=>u?bkt:i,[u,i]),f=b.useMemo(()=>sU(i,r.mode,r.currency),[i,r.mode,r.currency]),h=x=>{n(()=>x)},m={trades:d,mode:r.mode,currency:r.currency,isLoading:s,dateRange:{start:t.from.toISOString(),end:t.to.toISOString()},timeRangeOption:t.option},y=[{key:"price-range-chart",Component:tkt},{key:"symbol-analysis-chart",Component:rkt},{key:"time-distribution-chart",Component:akt},{key:"volume-range-chart",Component:mkt},{key:"win-loss-chart",Component:gkt},{key:"equity-curve-chart",Component:R_t},{key:"long-short-chart",Component:nSt}];return l.jsxs("article",{className:"space-y-6 mb-8 2k:mt-8",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-2 sm:gap-0 mt-4",children:[l.jsx("h1",{className:"text-3xl font-bold 2k:text-5xl",children:"Trading Insights"}),l.jsxs("p",{className:"text-gray-400 2k:text-xl",children:["Analyzing"," ",i.length," ","trades"]})]}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end w-full gap-4",children:[l.jsx(Vj,{label:"Time presets"}),l.jsx(vN,{label:"Analysis Period",className:"lg:ml-auto"}),l.jsx(a1,{mode:r.mode,currency:r.currency,setFilter:h})]}),l.jsx(ykt,{stats:f,currency:r.currency,mode:r.mode}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-8",children:[y.map(({key:x,Component:v})=>l.jsx(v,{...m},x)),l.jsx(tSt,{...m,dailyGradeMap:o},"grade-pnl-chart"),l.jsx(GSt,{...m,dailyGradeMap:o},"physical-state-pnl-chart")]})]})},_kt=()=>l.jsxs("div",{className:"min-h-screen bg-app-primary text-app-primary-foreground",children:[l.jsx("div",{className:"absolute inset-0 bg-linear-to-br from-app-primary via-app-primary to-app-card opacity-50"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(120,119,198,0.1),transparent_50%)]"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_70%_80%,rgba(120,119,198,0.05),transparent_50%)]"}),l.jsx("div",{className:"relative flex flex-col items-center justify-center min-h-screen px-6",children:l.jsxs("div",{className:"text-center max-w-lg mx-auto",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 bg-red-500/20 rounded-full blur-xl scale-150"}),l.jsx("div",{className:"relative bg-app-card border border-app-border-color-soft rounded-full p-6 shadow-2xl",children:l.jsx(Tw,{size:48,className:"text-red-500",strokeWidth:1.5})})]})}),l.jsx("h1",{className:"text-4xl font-bold mb-4 bg-linear-to-r from-app-primary-foreground to-app-text-accent bg-clip-text text-transparent",children:"Payment Cancelled"}
4395),l.jsx("p",{className:"text-lg text-app-primary-foreground/70 mb-8 leading-relaxed",children:"Your payment was cancelled and no charges were made. You can try again anytime or explore our free features."}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[l.jsx(ye,{variant:"default",size:"lg",className:"w-full sm:w-auto group",asChild:!0,children:l.jsxs(At,{to:"/app/profile",children:[l.jsx(BPe,{size:18}),"Try Again"]})}),l.jsx(ye,{variant:"outline",size:"lg",className:"w-full sm:w-auto group",asChild:!0,children:l.jsxs(At,{to:"/app/dashboard",children:[l.jsx(kw,{size:18}),"Dashboard"]})})]}),l.jsxs("div",{className:"mt-12 p-6 bg-app-card/50 border border-app-border-color-soft rounded-xl backdrop-blur-xs",children:[l.jsx("p",{className:"text-sm text-app-primary-foreground/60 mb-2",children:l.jsx("strong",{children:"Need help?"})}),l.jsx("p",{className:"text-sm text-app-primary-foreground/60",children:"If you encountered any issues during checkout, please contact our support team. You can still use all free features while you decide."})]})]})})]}),Skt=()=>l.jsxs("div",{className:"min-h-screen bg-app-primary text-app-primary-foreground",children:[l.jsx("div",{className:"absolute inset-0 bg-linear-to-br from-app-primary via-app-primary to-app-card opacity-50"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(120,119,198,0.1),transparent_50%)]"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_70%_80%,rgba(120,119,198,0.05),transparent_50%)]"}),l.jsx("div",{className:"relative flex flex-col items-center justify-center min-h-screen px-6",children:l.jsxs("div",{className:"text-center max-w-lg mx-auto",children:[l.jsx("div",{className:"flex justify-center mb-8",children:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 bg-green-500/20 rounded-full blur-xl scale-150"}),l.jsx("div",{className:"relative bg-app-card border border-app-border-color-soft rounded-full p-6 shadow-2xl",children:l.jsx(X4,{size:48,className:"text-green-500",strokeWidth:1.5})})]})}),l.jsx("h1",{className:"text-4xl font-bold mb-4 bg-linear-to-r from-app-primary-foreground to-app-text-accent bg-clip-text text-transparent",children:"Payment Successful!"}),l.jsx("p",{className:"text-lg text-app-primary-foreground/70 mb-8 leading-relaxed",children:"Thank you for your purchase! Your subscription has been activated and you now have access to all premium features."}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[l.jsx(ye,{variant:"default",size:"lg",className:"w-full sm:w-auto group",asChild:!0,children:l.jsxs(At,{to:"/app/dashboard",children:[l.jsx(kw,{size:18}),"Go to Dashboard",l.jsx(Jx,{size:18,className:"group-hover:translate-x-1 transition-transform duration-300"})]})}),l.jsx(ye,{variant:"outline",size:"lg",className:"w-full sm:w-auto",asChild:!0,children:l.jsx(At,{to:"/app/profile",children:"View Profile"})})]}),l.jsxs("div",{className:"mt-12 p-6 bg-app-card/50 border border-app-border-color-soft rounded-xl backdrop-blur-xs",children:[l.jsx("p",{className:"text-sm text-app-primary-foreground/60 mb-2",children:l.jsx("strong",{children:"What's next?"})}),l.jsx("p",{className:"text-sm text-app-primary-foreground/60",children:"You'll receive a confirmation email shortly. Your subscription is now active and you can start exploring all the premium features."})]})]})})]});function kkt({isActive:t=!0}){return t?{label:"Current Plan",className:"bg-white text-gray-900 px-2.5 py-1 rounded-md text-xs shadow-sm mx-1 border border-gray-200"}:t?null:{label:"Coming Soon",className:"bg-app-card text-app-primary-foreground/80 px-2.5 py-1 rounded-md text-xs border border-app-border-color mx-1"}}const Jxe=({plan:t,badge:e})=>{const r=t.name.toLowerCase().includes("pro")||t.name.toLowerCase().includes("premium")?l.jsx(zE,{className:"w-5 h-5 text-app-border-color-accent 2k:size-10"}):l.jsx(BE,{className:"w-5 h-5 text-app-border-color-accent 2k:size-10"});return l.jsxs("div",{className:"mb-2",children:[l.jsxs("div",{className:"mb-8 flex items-center gap-2 mt-2",children:[l.jsxs("div",{className:ee("w-11 h-11 rounded-lg flex items-center justify-center relative bg-app-input-bg"),children:[l.jsx("div",{className:"text-app-border-color-accent",children:r}),!t.isActive&&l.jsx("div",{className:"absolute inset-0 bg-app-input-bg/80 rounded-lg flex items-center justify-center",children:l.jsx(xs,{className:"w-5 h-5 text-app-border-color-accent"})})]}),e&&l.jsx("div",{className:e.className,children:e.label})]}),l.jsxs("div",{className:"mb-6 text-start",children:[l.jsx("h3",{className:"text-2xl font-bold text-app-primary-foreground mb-2 2k:text-4xl 2k:mb-4",children:t.name}
4395),l.jsx("p",{className:"text-app-primary-foreground/60 text-base leading-relaxed 2k:text-xl",children:t.description})]})]})},ebe=({price:t,interval:e,plan:r})=>{const n=vVe(r);return l.jsxs("div",{className:"mb-8 flex md:flex-row flex-col items-start md:items-end gap-4 md:gap-2 justify-start min-h-[50px]",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"text-5xl font-bold text-app-primary-foreground 2k:text-6xl",children:l.jsx(gV,{value:t,plugins:[dV],format:{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:2},willChange:!0})}),l.jsx("span",{className:"text-app-primary-foreground/60 text-lg font-medium mb-1 2k:text-2xl",children:`/ ${e}`})]}),n&&l.jsx("div",{className:"bg-linear-to-r from-app-border-color-accent to-app-border-color-accent/30 text-app-primary-foreground px-2.5 py-2 rounded-xl text-xs font-medium md:my-auto md:ml-4 2k:text-xl 2k:px-6 2k:py-3",children:n.label})]})},Wz=({features:t,title:e})=>l.jsxs("div",{className:"flex-1 mb-6",children:[l.jsx("p",{className:"text-app-primary-foreground font-semibold mb-4 text-start text-lg 2k:text-3xl 2k:mb-6",children:e}),l.jsx("ul",{className:"space-y-3",children:t&&t.length>0?t.map((r,n)=>l.jsxs("li",{className:"flex items-start gap-3 justify-start",children:[l.jsx(ei,{className:"w-5 h-5 text-app-border-color-accent mt-0.5 shrink-0 2k:size-7"}),l.jsx("span",{className:"text-app-primary-foreground/70 text-sm text-left 2k:text-xl",children:r})]},n)):l.jsx("li",{className:"text-sm text-gray-400 italic text-center 2k:text-xl",children:"No features listed"})})]}),tbe=({isProcessing:t,plan:e,handleManageSubscription:r,isUpgradeButton:n=!1})=>{const i=a=>t?"Processing...":n?`Upgrade to ${a}`:"Manage subscription",s=()=>n?"default":"ghost";return l.jsxs(ye,{onClick:()=>r?.(),disabled:t||!e.isActive&&!n,className:ee("w-full max-w-xs",!n&&"text-app-primary-foreground/70 hover:text-app-primary-foreground hover:bg-app-input-bg/50 border border-app-border-color/50 no-underline!","2k:text-2xl"),variant:s(),children:[t&&l.jsx(gn,{size:"sm"}),i(e.name),!n&&l.jsx(Cs,{className:"size-4"})]})},Tkt=({nextPlan:t,interval:e,isProcessing:r,error:n,handleUpgradeClick:i})=>l.jsxs(l.Fragment,{children:[l.jsx(Jxe,{plan:t}),l.jsx(ebe,{price:t.prices[e]?.price??0,interval:e,plan:t}),l.jsx(Wz,{features:t.features||[],title:"Upgrade benefits"}),n&&l.jsx("div",{className:"text-red-500 text-sm mb-4 text-center",children:n}),l.jsx("div",{className:"mt-auto flex justify-start pt-4",children:l.jsx(tbe,{isProcessing:r,plan:t,handleManageSubscription:i,isUpgradeButton:!0})})]}),Ckt=({currentPlan:t,plans:e,interval:r})=>{const{isProcessing:n,price:i,error:s,handleManageSubscription:a}=Jpe({currentPlan:t,interval:r}),{shouldShowUpgradeColumn:o,nextPlan:c}=Jet({currentPlan:t,plans:e}),u=kkt({isActive:t.isActive}),d=b.useCallback(()=>{a()},[a]),f=b.useCallback(()=>{c&&a(c)},[a,c]);return l.jsxs("div",{className:"relative rounded-2xl bg-app-card/50 border p-14 pb-8 w-full flex flex-col h-full transition-shadow duration-200 border-app-button-bg-active shadow-xl z-10 shadow-app-button-bg-active/30 overflow-hidden",children:[l.jsx(Zy,{className:"opacity-75"}),l.jsxs("div",{className:ee("flex md:flex-row flex-col justify-start md:justify-between items-center gap-12",o&&"gap-16"),children:[l.jsxs("div",{className:ee("flex-1 max-w-lg 2k:max-w-2xl",o&&"max-w-md"),children:[l.jsx(Jxe,{plan:t,badge:u}),l.jsx(ebe,{price:i??0,interval:r,plan:t}),o&&l.jsx(Wz,{features:t.features||[],title:"Current features"})]}),o&&c&&l.jsx("div",{className:"w-full md:w-px rounded-full md:h-[500px] h-px bg-linear-to-b from-app-border-color to-app-border-color/10 z-10"}),l.jsx("div",{className:ee("flex-1 flex flex-col",o&&"max-w-lg"),children:o&&c?l.jsx(Tkt,{nextPlan:c,interval:r,isProcessing:n,error:s||void 0,handleUpgradeClick:f}):l.jsxs(l.Fragment,{children:[l.jsx(Wz,{features:t.features||[],title:"This plan includes"}),s&&l.jsx("div",{className:"text-red-500 text-sm mb-4 text-center",children:s}),l.jsxs("div",{className:"mt-auto flex flex-col justify-center pt-4 gap-4",children:[l.jsx(tbe,{isProcessing:n,plan:t,handleManageSubscription:d}),l.jsxs("div",{className:"flex flex-col gap-2 w-fit",children:[l.jsxs("p",{className:"text-app-primary-foreground
4395/90 font-light text-xs 2k:text-lg",children:["Looking to"," ",l.jsx("span",{className:"font-medium italic",children:"cancel your subscription?"})]}),l.jsxs(At,{to:"/docs/cancel-subscription",className:"text-app-primary-foreground/70 hover:text-app-primary-foreground duration-300 transition-colors  font-light italic text-xs flex items-center gap-2 group 2k:text-lg",children:[l.jsx(ZPe,{className:"size-3 group-hover:translate-x-0.5 transition-transform duration-300 -rotate-45 2k:size-4"}),"How to cancel subscription"]})]})]})]})})]})]})},Ekt=({plans:t,interval:e,userCurrentPlan:r})=>l.jsx(Ckt,{currentPlan:r,interval:e,plans:t}),jkt=()=>l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(gn,{size:"lg"}),l.jsx("p",{className:"text-gray-400 mt-4 2k:text-xl",children:"Loading plan details..."})]}),Nkt=({error:t})=>l.jsx("div",{className:"flex flex-col items-center justify-center py-12",children:l.jsxs("div",{className:"text-red-500 text-center",children:[l.jsx("p",{className:"text-lg font-semibold mb-2",children:"Error loading plan details"}),l.jsx("p",{className:"text-sm",children:t})]})});function Pkt(t){const{data:e,loading:r,error:n,refetch:i}=ws($w,{variables:{email:t},skip:!t,fetchPolicy:"cache-first"});return{userProfile:e?.user?.[0]??null,loading:r,error:n,refetch:i}}const Mkt=li({firstName:Mr().min(1,"First name is required").max(50,"First name must be less than 50 characters"),lastName:Mr().min(1,"Last name is required").max(50,"Last name must be less than 50 characters"),username:Mr().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters").regex(/^\w+$/,"Username can only contain letters, numbers, and underscores"),email:ST("Please enter a valid email address"),birth_date:xWe().optional(),currentPassword:Mr().optional()}),Akt=li({currentPassword:Mr().optional(),newPassword:Mr().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number"),confirmNewPassword:Mr().optional()}),Dkt=({isNewPassword:t,isGoogleOnly:e,userProfile:r})=>{const n=jKe(),{register:i,handleSubmit:s,reset:a,setError:o,formState:{errors:c,isSubmitting:u}}=$o({resolver:xl(Akt),defaultValues:{currentPassword:"",newPassword:"",confirmNewPassword:""}}),d=async f=>{if(ar.currentUser){if(f.newPassword!==f.confirmNewPassword){o("confirmNewPassword",{message:"New password and confirm new password must match"});return}try{if(t){const m=Ou.credential(ar.currentUser.email,f.newPassword);await UFe(ar.currentUser,m),Ft.success("Password set successfully!"),a(),n();return}const h=Ou.credential(ar.currentUser.email||r.email,f.currentPassword);await sue(ar.currentUser,h),await oue(ar.currentUser,f.newPassword),Ft.success("Password changed successfully"),a(),n()}catch(h){o("root",{message:qy(h)})}}};return l.jsxs("form",{onSubmit:s(d),className:"space-y-4",children:[c.root&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2",children:[l.jsx(Ts,{size:16}),l.jsx("span",{children:c.root.message})]}),!e&&!t&&l.jsx(tn,{label:"Current Password",icon:xs,error:c.currentPassword?.message,children:l.jsx(Wr,{...i("currentPassword",{required:"Current password is required"}),type:"password",hasIcon:!0,placeholder:"Enter your current password"})}),l.jsx(tn,{label:"New Password",icon:xs,error:c.newPassword?.message,children:l.jsx(Wr,{...i("newPassword",{required:"New password is required",minLength:{value:6,message:"Minimum 6 characters"}}),type:"password",hasIcon:!0,placeholder:"Enter new password"})}),l.jsx(tn,{label:"Confirm New Password",icon:xs,error:c.confirmNewPassword?.message,children:l.jsx(Wr,{...i("confirmNewPassword",{required:"Please confirm new password"}),type:"password",hasIcon:!0,placeholder:"Confirm new password"})}),l.jsxs("div",{className:"flex justify-end gap-4 pt-4",children:[l.jsxs(ye,{type:"button",variant:"secondary",onClick:n,children:[l.jsx(pi,{size:16})," ","Cancel"]}),l.jsxs(ye,{type:"submit",disabled:u,children:[u?l.jsx(No,{className:"animate-spin"}):l.jsx(ei,{size:16}),"Save"]})]})]})};function Okt(){const[t,{loading:e,error:r}]=Zn(hfe);return{updateUser:t,loading:e,error:r}}function Rkt(){const[t,{loading:e,error:r}]=Zn(NHe);return{updateUserPhoto:t,loading:e,error:r}}const Ikt=({userProfile:t,canEditProfile:e,afterSubmit:r})=>{const{isUploading:n,isEditing:i,isSettingPassword:s}
4395=qp(yl(x=>({isUploading:x.mode==="uploading",isEditing:x.mode==="editing",isSettingPassword:x.mode==="settingPassword"}))),{startUploading:a,finishUploading:o,startEditing:c,finishEditing:u}=kKe(),d=b.useRef(null),{updateUserPhoto:f}=Rkt(),h=t?.profile_photo_url??ar.currentUser?.photoURL??null,m=()=>d.current?.click(),y=async x=>{const v=x.target.files?.[0];if(!(!v||!t)){a();try{const _=v.name.split(".").pop(),S=`avatars/${t.id}/${Date.now()}.${_}`,k=sVe(bde,S);await nVe(k,v);const E=await iVe(k);await f({variables:{userId:t.id,profilePhotoUrl:E,updatedAt:new Date().toISOString()}}),r()}catch(_){Ft.error(qy(_))}finally{o()}}};return l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:m,className:"relative w-24 h-24 rounded-full overflow-hidden bg-gray-800 hover:opacity-90 2k:w-32 2k:h-32",children:[h?l.jsx("img",{src:h,alt:"Avatar",className:"w-full h-full object-cover"}):l.jsx("div",{className:"flex items-center justify-center w-full h-full",children:l.jsx(af,{className:"w-12 h-12 text-gray-400"})}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 hover:opacity-100",children:l.jsx(RPe,{className:"w-6 h-6 text-white 2k:w-12 2k:h-12"})})]}),l.jsx("input",{ref:d,type:"file",accept:"image/*",className:"hidden",onChange:y}),n&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 rounded-full",children:l.jsx("div",{className:"animate-spin h-6 w-6 border-b-2 border-white rounded-full"})})]}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("h2",{className:"text-2xl font-bold mb-1 2k:text-4xl",children:[t?.first_name||"Your",t?.last_name?` ${t.last_name}`:""]}),l.jsxs("p",{className:"text-gray-400 2k:text-xl",children:["@",t?.username||"username"]})]}),!s&&l.jsx(ye,{onClick:i?u:c,disabled:!e,className:"2k:text-2xl 2k:px-4 2k:py-8",children:i?"Cancel":"Edit Profile"})]})};var Lkt=typeof document<"u",$kt=function(){},fE=Lkt?b.useLayoutEffect:$kt;const Fkt={...xf},zkt=Fkt.useInsertionEffect,Bkt=zkt||(t=>t());function Vkt(t){const e=b.useRef(()=>{});return Bkt(()=>{e.current=t}),b.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.current==null?void 0:e.current(...n)},[])}const Ukt={...xf};let iie=!1,Gkt=0;const sie=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Gkt++;function Wkt(){const[t,e]=b.useState(()=>iie?sie():void 0);return fE(()=>{t==null&&e(sie())},[]),b.useEffect(()=>{iie=!0},[]),t}const Hkt=Ukt.useId,rbe=Hkt||Wkt,qkt=b.forwardRef(function(e,r){const{context:{placement:n,elements:{floating:i},middlewareData:{arrow:s,shift:a}},width:o=14,height:c=7,tipRadius:u=0,strokeWidth:d=0,staticOffset:f,stroke:h,d:m,style:{transform:y,...x}={},...v}=e,_=rbe(),[S,k]=b.useState(!1);if(fE(()=>{if(!i)return;Do(i).direction==="rtl"&&k(!0)},[i]),!i)return null;const[E,T]=n.split("-"),N=E==="top"||E==="bottom";let j=f;(N&&a!=null&&a.x||!N&&a!=null&&a.y)&&(j=null);const M=d*2,O=M/2,R=o/2*(u/-8+1),I=c/2*u/4,B=!!m,F=j&&T==="end"?"bottom":"top";let V=j&&T==="end"?"right":"left";j&&S&&(V=T==="end"?"left":"right");const $=s?.x!=null?j||s.x:"",U=s?.y!=null?j||s.y:"",z=m||"M0,0"+(" H"+o)+(" L"+(o-R)+","+(c-I))+(" Q"+o/2+","+c+" "+R+","+(c-I))+" Z",L={top:B?"rotate(180deg)":"",left:B?"rotate(90deg)":"rotate(-90deg)",bottom:B?"":"rotate(180deg)",right:B?"rotate(-90deg)":"rotate(90deg)"}[E];return l.jsxs("svg",{...v,"aria-hidden":!0,ref:r,width:B?o:o+M,height:o,viewBox:"0 0 "+o+" "+(c>o?c:o),style:{position:"absolute",pointerEvents:"none",[V]:$,[F]:U,[E]:N||B?"100%":"calc(100% - "+M/2+"px)",transform:[L,y].filter(W=>!!W).join(" "),...x},children:[M>0&&l.jsx("path",{clipPath:"url(#"+_+")",fill:"none",stroke:h,strokeWidth:M+(m?0:1),d:z}),l.jsx("path",{stroke:M&&!m?v.fill:"none",d:z}),l.jsx("clipPath",{id:_,children:l.jsx("rect",{x:-O,y:O*(B?-1:1),width:o+M,height:o})})]})});function Ykt(){const t=new Map;return{emit(e,r){var n;(n=t.get(e))==null||n.forEach(i=>i(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var n;(n=t.get(e))==null||n.delete(r)}}}const Kkt=b.createContext(null),Qkt=b.createContext(null),Zkt=()=>{var t;return((t=b.useContext(Kkt))==null?void 0:t.id)||null},Xkt=()=>b.useContext(Qkt);function Jkt(t){const{open:e=!1,onOpenChange:r,elements:n}=t,i=rbe(),s=b.useRef({}),[a]=b.useState(()=>Ykt()),o=Zkt()!=null,[c,u]=b.useState(n.reference),d=Vkt((m,y,x)=>{s.current.openEvent=m?y:void 0,a.emit("openchange",{open:m,event:y,reason:x,nested:o}),r?.(m,y,x)}),f=b.useMemo(()=>({setPositionReference:u}),[]),h=b.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return b.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f}),[e,d,h,a,i,f])}function eTt(t){t===void 0&&(t={});const{nodeId:e}=t,r=Jkt({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||r,i=n.elements,[s,a]=b.useState(null),[o,c]=b.useState(null),d=i?.domReference||s,f=b.useRef(null),h=Xkt();fE(()=>{d&&(f.current=d)},[d]);const m=ahe({...t,elements:{...i,...o&&{reference:o}}}),y=b.useCallback(k=>{const E=$s(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;c(E),m.refs.setReference(E)},[m.refs]),x=b.useCallback(k=>{($s(k)||k===null)&&(f.current=k,a(k)),($s(m.refs.reference.current)||m.refs.reference.current===null||k!==null&&!$s(k))&&m.refs.setReference(k)},[m.refs]),v=b.useMemo(()=>({...m.refs,setReference:x,setPositionReference:y,domReference:f}),[m.refs,x,y]),_=b.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),S=b.useMemo(()=>({...m,...n,refs:v,elements:_,nodeId:e}),[m,v,_,e,n]);return fE(()=>{n.dataRef.current.floatingContext=S;const k=h?.nodesRef.current.find(E=>E.id===e);k&&(k.context=S)}),b.useMemo(()=>({...m,context:S,refs:v,elements:_}),[m,v,_,S])}/*!
4396  react-datepicker v8.7.0
4397  https://github.com/Hacker0x01/react-datepicker
4398  Released under the MIT License.
4399*/var Hz=function(e,r){return Hz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},Hz(e,r)};function is(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hz(t,e);function r(){this.constructor=t}
4399t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var pr=function(){return pr=Object.assign||function(r){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},pr.apply(this,arguments)};function ql(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}var tTt=function(t){var e=t.showTimeSelectOnly,r=e===void 0?!1:e,n=t.showTime,i=n===void 0?!1:n,s=t.className,a=t.children,o=r?"Choose Time":"Choose Date".concat(i?" and Time":"");return P.createElement("div",{className:s,role:"dialog","aria-label":o,"aria-modal":"true"},a)},rTt=function(t,e){var r=b.useRef(null),n=b.useRef(t);n.current=t;var i=b.useCallback(function(s){var a,o=s.composed&&s.composedPath&&s.composedPath().find(function(c){return c instanceof Node})||s.target;r.current&&!r.current.contains(o)&&(e&&o instanceof HTMLElement&&o.classList.contains(e)||(a=n.current)===null||a===void 0||a.call(n,s))},[e]);return b.useEffect(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),r},aP=function(t){var e=t.children,r=t.onClickOutside,n=t.className,i=t.containerRef,s=t.style,a=t.ignoreClass,o=rTt(r,a);return P.createElement("div",{className:n,style:s,ref:function(c){o.current=c,i&&(i.current=c)}},e)},Ze;(function(t){t.ArrowUp="ArrowUp",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.PageUp="PageUp",t.PageDown="PageDown",t.Home="Home",t.End="End",t.Enter="Enter",t.Space=" ",t.Tab="Tab",t.Escape="Escape",t.Backspace="Backspace",t.X="x"})(Ze||(Ze={}));function nbe(){var t=typeof window<"u"?window:globalThis;return t}var v1=12;function Ar(t){if(t==null)return new Date;var e=typeof t=="string"?tXe(t):st(t);return oP(e)?e:new Date}function hL(t,e,r,n,i){i===void 0&&(i=Ar());for(var s=Iy(r)||Iy(m6()),a=Array.isArray(e)?e:[e],o=0,c=a;o<c.length;o++){var u=c[o],d=qZe(t,u,i,{locale:s,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});
4399if(oP(d)&&(!n||t===hn(d,u,r)))return d}return null}function oP(t,e){return WT(t)&&!ll(t,new Date("1/1/1800"))}function hn(t,e,r){if(r==="en")return sr(t,e,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var n=r?Iy(r):void 0;return r&&!n&&console.warn('A locale object was not found for the provided string ["'.concat(r,'"].')),n=n||Iy(m6()),sr(t,e,{locale:n,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function fo(t,e){var r=e.dateFormat,n=e.locale,i=Array.isArray(r)&&r.length>0?r[0]:r;return t&&hn(t,i,n)||""}var ibe=" - ";function nTt(t,e,r){if(!t&&!e)return"";var n=t?fo(t,r):"",i=e?fo(e,r):"",s=r.rangeSeparator||ibe;return"".concat(n).concat(s).concat(i)}function iTt(t,e){if(!t?.length)return"";var r=t[0]?fo(t[0],e):"";if(t.length===1)return r;if(t.length===2&&t[1]){var n=fo(t[1],e);return"".concat(r,", ").concat(n)}var i=t.length-1;return"".concat(r," (+").concat(i,")")}function pL(t,e){var r=e.hour,n=r===void 0?0:r,i=e.minute,s=i===void 0?0:i,a=e.second,o=a===void 0?0:a;return Ak(Dk(Ok(t,o),s),n)}function sTt(t){return zj(t)}function aTt(t,e){return hn(t,"ddd",e)}function Ik(t){return Us(t)}function yf(t,e,r){var n=Iy(e||m6());return mi(t,{locale:n,weekStartsOn:r})}function _u(t){return Gs(t)}function ux(t){return Zu(t)}function aie(t){return qF(t)}function oie(){return Us(Ar())}function lie(t){return Zi(t)}function oTt(t){return $u(t)}function lTt(t){return ga(t)}function Ll(t,e){return t&&e?SV(t,e):!t&&!e}function Ds(t,e){return t&&e?Bj(t,e):!t&&!e}function hE(t,e){return t&&e?XZe(t,e):!t&&!e}function hr(t,e){return t&&e?Lj(t,e):!t&&!e}function Hh(t,e){return t&&e?XQe(t,e):!t&&!e}function Eh(t,e,r){var n,i=Us(e),s=Zi(r);try{n=Sb(t,{start:i,end:s})}catch{n=!1}return n}function m6(){var t=nbe();return t.__localeId__}function Iy(t){if(typeof t=="string"){var e=nbe();return e.__localeData__?e.__localeData__[t]:void 0}else return t}function cTt(t,e,r){return e(hn(t,"EEEE",r))}function uTt(t,e){return hn(t,"EEEEEE",e)}function dTt(t,e){return hn(t,"EEE",e)}function g6(t,e){return hn(fs(Ar(),t),"LLLL",e)}function sbe(t,e){return hn(fs(Ar(),t),"LLL",e)}function fTt(t,e){return hn(Hm(Ar(),t),"QQQ",e)}function go(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.maxDate,s=r.excludeDates,a=r.excludeDateIntervals,o=r.includeDates,c=r.includeDateIntervals,u=r.filterDate;return x1(t,{minDate:n,maxDate:i})||s&&s.some(function(d){return d instanceof Date?hr(t,d):hr(t,d.date)})||a&&a.some(function(d){var f=d.start,h=d.end;return Sb(t,{start:f,end:h})})||o&&!o.some(function(d){return hr(t,d)})||c&&!c.some(function(d){var f=d.start,h=d.end;return Sb(t,{start:f,end:h})})||u&&!u(Ar(t))||!1}function y6(t,e){var r=e===void 0?{}:e,n=r.excludeDates,i=r.excludeDateIntervals;return i&&i.length>0?i.some(function(s){var a=s.start,o=s.end;return Sb(t,{start:a,end:o})}):n&&n.some(function(s){var a;return s instanceof Date?hr(t,s):hr(t,(a=s.date)!==null&&a!==void 0?a:new Date)})||!1}function abe(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.maxDate,s=r.excludeDates,a=r.includeDates,o=r.filterDate;return x1(t,{minDate:n?Gs(n):void 0,maxDate:i?ga(i):void 0})||s?.some(function(c){return Ds(t,c instanceof Date?c:c.date)})||a&&!a.some(function(c){return Ds(t,c)})||o&&!o(Ar(t))||!1}function BS(t,e,r,n){var i=tr(t),s=Qi(t),a=tr(e),o=Qi(e),c=tr(n);return i===a&&i===c?s<=r&&r<=o:i<a?c===i&&s<=r||c===a&&o>=r||c<a&&c>i:!1}function hTt(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.maxDate,s=r.excludeDates,a=r.includeDates;return x1(t,{minDate:n,maxDate:i})||s&&s.some(function(o){return Ds(o instanceof Date?o:o.date,t)})||a&&!a.some(function(o){return Ds(o,t)})||!1}function VS(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.maxDate,s=r.excludeDates,a=r.includeDates,o=r.filterDate;return x1(t,{minDate:n,maxDate:i})||s?.some(function(c){return hE(t,c instanceof Date?c:c.date)})||a&&!a.some(function(c){return hE(t,c)})||o&&!o(Ar(t))||!1}function US(t,e,r){if(!e||!r||!WT(e)||!WT(r))return!1;var n=tr(e),i=tr(r);return n<=t&&i>=t}function Lk(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.maxDate,s=r.excludeDates,a=r.includeDates,o=r.filterDate,c=new Date(t,0,1);return x1(c,{minDate:n?Zu(n):void 0,maxDate:i?$j(i):void 0})||s?.some(function(u){return Ll(c,u instanceof Date?u:u.date)})||a&&!a.some(function(u){return Ll(c,u)})||o&&!o(Ar(c))||!1}function GS(t,e,r,n){var i=tr(t),s=Jh(t),a=tr(e),o=Jh(e),c=tr(n);return i===a&&i===c?s<=r&&r<=o:i<a?c===i&&s<=r||c===a&&o>=r||c<a&&c>i:!1}function x1(t,e){var r,n=e===void 0?{}:e,i=n.minDate,s=n.maxDate;return(r=i&&Nf(t,i)<0||s&&Nf(t,s)>0)!==null&&r!==void 0?r:!1}function cie(t,e){return e.some(function(r){return du(r)===du(t)&&fu(r)===fu(t)&&hf(r)===
4399hf(t)})}function uie(t,e){var r=e===void 0?{}:e,n=r.excludeTimes,i=r.includeTimes,s=r.filterTime;return n&&cie(t,n)||i&&!cie(t,i)||s&&!s(t)||!1}function die(t,e){var r=e.minTime,n=e.maxTime;if(!r||!n)throw new Error("Both minTime and maxTime props required");var i=Ar();i=Ak(i,du(t)),i=Dk(i,fu(t)),i=Ok(i,hf(t));var s=Ar();s=Ak(s,du(r)),s=Dk(s,fu(r)),s=Ok(s,hf(r));var a=Ar();a=Ak(a,du(n)),a=Dk(a,fu(n)),a=Ok(a,hf(n));var o;try{o=!Sb(i,{start:s,end:a})}catch{o=!1}return o}function fie(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.includeDates,s=ep(t,1);return n&&Jg(n,s)>0||i&&i.every(function(a){return Jg(a,s)>0})||!1}function hie(t,e){var r=e===void 0?{}:e,n=r.maxDate,i=r.includeDates,s=Va(t,1);return n&&Jg(s,n)>0||i&&i.every(function(a){return Jg(s,a)>0})||!1}function pTt(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.includeDates,s=Zu(t),a=ype(s);return n&&HT(n,a)>0||i&&i.every(function(o){return HT(o,a)>0})||!1}function mTt(t,e){var r=e===void 0?{}:e,n=r.maxDate,i=r.includeDates,s=$j(t),a=vV(s,1);return n&&HT(a,n)>0||i&&i.every(function(o){return HT(a,o)>0})||!1}function pie(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.includeDates,s=ey(t,1);return n&&qT(n,s)>0||i&&i.every(function(a){return qT(a,s)>0})||!1}function gTt(t,e){var r=e===void 0?{}:e,n=r.minDate,i=r.yearItemNumber,s=i===void 0?v1:i,a=ux(ey(t,s)),o=cu(a,s).endPeriod,c=n&&tr(n);return c&&c>o||!1}function mie(t,e){var r=e===void 0?{}:e,n=r.maxDate,i=r.includeDates,s=ml(t,1);return n&&qT(s,n)>0||i&&i.every(function(a){return qT(s,a)>0})||!1}function yTt(t,e){var r=e===void 0?{}:e,n=r.maxDate,i=r.yearItemNumber,s=i===void 0?v1:i,a=ml(t,s),o=cu(a,s).startPeriod,c=n&&tr(n);return c&&c<o||!1}function obe(t){var e=t.minDate,r=t.includeDates;if(r&&e){var n=r.filter(function(i){return Nf(i,e)>=0});return HF(n)}else return r?HF(r):e}function lbe(t){var e=t.maxDate,r=t.includeDates;if(r&&e){var n=r.filter(function(i){return Nf(i,e)<=0});return WF(n)}else return r?WF(r):e}function gie(t,e){var r;t===void 0&&(t=[]),e===void 0&&(e="react-datepicker__day--highlighted");for(var n=new Map,i=0,s=t.length;i<s;i++){var a=t[i];if(ic(a)){var o=hn(a,"MM.dd.yyyy"),c=n.get(o)||[];c.includes(e)||(c.push(e),n.set(o,c))}else if(typeof a=="object"){var u=Object.keys(a),d=(r=u[0])!==null&&r!==void 0?r:"",f=a[d];if(typeof d=="string"&&Array.isArray(f))for(var h=0,m=f.length;h<m;h++){var y=f[h];if(y){var o=hn(y,"MM.dd.yyyy"),c=n.get(o)||[];c.includes(d)||(c.push(d),n.set(o,c))}}}}return n}function vTt(t,e){return t.length!==e.length?!1:t.every(function(r,n){return r===e[n]})}function xTt(t,e){t===void 0&&(t=[]),e===void 0&&(e="react-datepicker__day--holidays");var r=new Map;return t.forEach(function(n){var i=n.date,s=n.holidayName;if(ic(i)){var a=hn(i,"MM.dd.yyyy"),o=r.get(a)||{className:"",holidayNames:[]};if(!("className"in o&&o.className===e&&vTt(o.holidayNames,[s]))){o.className=e;var c=o.holidayNames;o.holidayNames=c?ql(ql([],c,!0),[s],!1):[s],r.set(a,o)}}}),r}function bTt(t,e,r,n,i){for(var s=i.length,a=[],o=0;o<s;o++){var c=t,u=i[o];u&&(c=ipe(c,du(u)),c=GF(c,fu(u)),c=ZKe(c,hf(u)));var d=GF(t,(r+1)*n);Fu(c,e)&&ll(c,d)&&u!=null&&a.push(u)}return a}function yie(t){return t<10?"0".concat(t):"".concat(t)}function cu(t,e){e===void 0&&(e=v1);var r=Math.ceil(tr(t)/e)*e,n=r-(e-1);return{startPeriod:n,endPeriod:r}}function wTt(t){var e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate(),24);return Math.round((+r-+e)/36e5)}function vie(t){var e=t.getSeconds(),r=t.getMilliseconds();return st(t.getTime()-e*1e3-r)}function _Tt(t,e){return vie(t).getTime()===vie(e).getTime()}function xie(t){if(!ic(t))throw new Error("Invalid date");var e=new Date(t);return e.setHours(0,0,0,0),e}function mL(t,e){if(!ic(t)||!ic(e))throw new Error("Invalid date received");var r=xie(t),n=xie(e);return ll(r,n)}function cbe(t){return t.key===Ze.Space}var STt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.inputRef=P.createRef(),n.onTimeChange=function(i){var s,a;n.setState({time:i});var o=n.props.date,c=o instanceof Date&&!isNaN(+o),u=c?o:new Date;if(i?.includes(":")){var d=i.split(":"),f=d[0],h=d[1];u.setHours(Number(f)),u.setMinutes(Number(h))}(a=(s=n.props).onChange)===null||a===void 0||a.call(s,u)},n.renderTimeInput=function(){var i=n.state.time,s=n.props,a=s.date,o=s.timeString,c=s.customTimeInput;return c?b.cloneElement(c,{date:a,value:i,onChange:n.onTimeChange}):P.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:n.inputRef,onClick:function(){var u;(u=n.inputRef.current)===null||u===void 0||u.focus()},required:!0,value:i,onChange:function(u){n.onTimeChange(u.target.value||o)}})}
4399,n.state={time:n.props.timeString},n}return e.getDerivedStateFromProps=function(r,n){return r.timeString!==n.time?{time:r.timeString}:null},e.prototype.render=function(){return P.createElement("div",{className:"react-datepicker__input-time-container"},P.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),P.createElement("div",{className:"react-datepicker-time__input-container"},P.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},e})(b.Component),kTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.dayEl=b.createRef(),r.handleClick=function(n){!r.isDisabled()&&r.props.onClick&&r.props.onClick(n)},r.handleMouseEnter=function(n){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(n)},r.handleOnKeyDown=function(n){var i,s,a=n.key;a===Ze.Space&&(n.preventDefault(),n.key=Ze.Enter),(s=(i=r.props).handleOnKeyDown)===null||s===void 0||s.call(i,n)},r.isSameDay=function(n){return hr(r.props.day,n)},r.isKeyboardSelected=function(){var n;if(r.props.disabledKeyboardNavigation)return!1;var i=r.props.selectsMultiple?(n=r.props.selectedDates)===null||n===void 0?void 0:n.some(function(a){return r.isSameDayOrWeek(a)}):r.isSameDayOrWeek(r.props.selected),s=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!i&&r.isSameDayOrWeek(r.props.preSelection)&&!s},r.isDisabled=function(n){return n===void 0&&(n=r.props.day),go(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(){return y6(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return hr(r.props.day,yf(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(n){return r.props.showWeekPicker&&hr(n,yf(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(n){return r.isSameDay(n)||r.isSameWeek(n)},r.getHighLightedClass=function(){var n=r.props,i=n.day,s=n.highlightDates;if(!s)return!1;var a=hn(i,"MM.dd.yyyy");return s.get(a)},r.getHolidaysClass=function(){var n,i=r.props,s=i.day,a=i.holidays;if(!a)return[void 0];var o=hn(s,"MM.dd.yyyy");return a.has(o)?[(n=a.get(o))===null||n===void 0?void 0:n.className]:[void 0]},r.isInRange=function(){var n=r.props,i=n.day,s=n.startDate,a=n.endDate;return!s||!a?!1:Eh(i,s,a)},r.isInSelectingRange=function(){var n,i=r.props,s=i.day,a=i.selectsStart,o=i.selectsEnd,c=i.selectsRange,u=i.selectsDisabledDaysInRange,d=i.startDate,f=i.swapRange,h=i.endDate,m=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;if(!(a||o||c)||!m||!u&&r.isDisabled())return!1;if(a&&h&&(ll(m,h)||Hh(m,h)))return Eh(s,m,h);if(o&&d&&(Fu(m,d)||Hh(m,d)))return Eh(s,d,m);if(c&&d&&!h){if(Hh(m,d)||Fu(m,d))return Eh(s,d,m);if(f&&ll(m,d))return Eh(s,m,d)}return!1},r.isSelectingRangeStart=function(){var n;if(!r.isInSelectingRange())return!1;var i=r.props,s=i.day,a=i.startDate,o=i.selectsStart,c=i.swapRange,u=i.selectsRange,d=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;return o?hr(s,d):u&&c&&a&&d?hr(s,ll(d,a)?d:a):hr(s,a)},r.isSelectingRangeEnd=function(){var n;if(!r.isInSelectingRange())return!1;var i=r.props,s=i.day,a=i.endDate,o=i.selectsEnd,c=i.selectsRange,u=i.swapRange,d=i.startDate,f=(n=r.props.selectingDate)!==null&&n!==void 0?n:r.props.preSelection;return o?hr(s,f):c&&u&&d&&f?hr(s,ll(f,d)?d:f):c?hr(s,f):hr(s,a)},r.isRangeStart=function(){var n=r.props,i=n.day,s=n.startDate,a=n.endDate;return!s||!a?!1:hr(s,i)},r.isRangeEnd=function(){var n=r.props,i=n.day,s=n.startDate,a=n.endDate;return!s||!a?!1:hr(a,i)},r.isWeekend=function(){var n=Mk(r.props.day);return n===0||n===6},r.isAfterMonth=function(){return r.props.month!==void 0&&(r.props.month+1)%12===Qi(r.props.day)},r.isBeforeMonth=function(){return r.props.month!==void 0&&(Qi(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(Ar())},r.isSelected=function(){var n;return r.props.selectsMultiple?(n=r.props.selectedDates)===null||n===void 0?void 0:n.some(function(i){return r.isSameDayOrWeek(i)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(n){var i=r.props.dayClassName?r.props.dayClassName(n):void 0;return Tt("react-datepicker__day",i,"react-datepicker__day--"+aTt(r.props.day),{"react-datepicker__day--disabled":r.
4399isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var n=r.props,i=n.day,s=n.ariaLabelPrefixWhenEnabled,a=s===void 0?"Choose":s,o=n.ariaLabelPrefixWhenDisabled,c=o===void 0?"Not available":o,u=r.isDisabled()||r.isExcluded()?c:a;return"".concat(u," ").concat(hn(i,"PPPP",r.props.locale))},r.getTitle=function(){var n=r.props,i=n.day,s=n.holidays,a=s===void 0?new Map:s,o=n.excludeDates,c=hn(i,"MM.dd.yyyy"),u=[];return a.has(c)&&u.push.apply(u,a.get(c).holidayNames),r.isExcluded()&&u.push(o?.filter(function(d){return d instanceof Date?hr(d,i):hr(d?.date,i)}).map(function(d){if(!(d instanceof Date))return d?.message})),u.join(", ")},r.getTabIndex=function(){var n=r.props.selected,i=r.props.preSelection,s=!(r.props.showWeekPicker&&(r.props.showWeekNumber||!r.isStartOfWeek()))&&(r.isKeyboardSelected()||r.isSameDay(n)&&hr(i,n))?0:-1;return s},r.handleFocusDay=function(){var n;r.shouldFocusDay()&&((n=r.dayEl.current)===null||n===void 0||n.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(NK(r.props.day),r.props.day):NK(r.props.day)},r.render=function(){return P.createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"gridcell",title:r.getTitle(),"aria-disabled":r.
4399isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),r.getTitle()!==""&&P.createElement("span",{className:"overlay"},r.getTitle()))},r}return e.prototype.componentDidMount=function(){this.handleFocusDay()},e.prototype.componentDidUpdate=function(){this.handleFocusDay()},e.prototype.shouldFocusDay=function(){var r=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(r=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(r=!1),this.isDayActiveElement()&&(r=!0),this.isDuplicateDay()&&(r=!1)),r},e.prototype.isDayActiveElement=function(){var r,n,i;return((n=(r=this.props.containerRef)===null||r===void 0?void 0:r.current)===null||n===void 0?void 0:n.contains(document.activeElement))&&((i=document.activeElement)===null||i===void 0?void 0:i.classList.contains("react-datepicker__day"))},e.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},e})(b.Component),TTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.weekNumberEl=b.createRef(),r.handleClick=function(n){r.props.onClick&&r.props.onClick(n)},r.handleOnKeyDown=function(n){var i,s,a=n.key;a===Ze.Space&&(n.preventDefault(),n.key=Ze.Enter),(s=(i=r.props).handleOnKeyDown)===null||s===void 0||s.call(i,n)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!hr(r.props.date,r.props.selected)&&hr(r.props.date,r.props.preSelection)},r.getTabIndex=function(){return r.props.showWeekPicker&&r.props.showWeekNumber&&(r.isKeyboardSelected()||hr(r.props.date,r.props.selected)&&hr(r.props.preSelection,r.props.selected))?0:-1},r.handleFocusWeekNumber=function(n){var i=!1;r.getTabIndex()===0&&!n?.isInputFocused&&hr(r.props.date,r.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(i=!0),r.props.inline&&!r.props.shouldFocusDayInline&&(i=!1),r.props.containerRef&&r.props.containerRef.current&&r.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(i=!0)),i&&r.weekNumberEl.current&&r.weekNumberEl.current.focus({preventScroll:!0})},r}return Object.defineProperty(e,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},e.prototype.componentDidUpdate=function(r){this.handleFocusWeekNumber(r)},e.prototype.render=function(){var r=this.props,n=r.weekNumber,i=r.isWeekDisabled,s=r.ariaLabelPrefix,a=s===void 0?e.defaultProps.ariaLabelPrefix:s,o=r.onClick,c={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!o&&!i,"react-datepicker__week-number--selected":!!o&&hr(this.props.date,this.props.selected)};return P.createElement("div",{ref:this.weekNumberEl,className:Tt(c),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},n)},e})(b.Component),CTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.isDisabled=function(n){return go(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(n,i){r.props.onDayClick&&r.props.onDayClick(n,i)},r.handleDayMouseEnter=function(n){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(n)},r.handleWeekClick=function(n,i,s){for(var a,o,c,u=new Date(n),d=0;d<7;d++){var f=new Date(n);f.setDate(f.getDate()+d);var h=!r.isDisabled(f);if(h){u=f;break}}typeof r.props.onWeekSelect=="function"&&r.props.onWeekSelect(u,i,s),r.props.showWeekPicker&&r.handleDayClick(u,s),((a=r.props.shouldCloseOnSelect)!==null&&a!==void 0?a:e.defaultProps.shouldCloseOnSelect)&&((c=(o=r.props).setOpen)===null||c===void 0||c.c
4399all(o,!1))},r.formatWeekNumber=function(n){return r.props.formatWeekNumber?r.props.formatWeekNumber(n):sTt(n)},r.isWeekDisabled=function(){for(var n=r.startOfWeek(),i=$a(n,6),s=new Date(n);s<=i;){if(!r.isDisabled(s))return!1;s=$a(s,1)}return!0},r.renderDays=function(){var n=r.startOfWeek(),i=[],s=r.formatWeekNumber(n);if(r.props.showWeekNumber){var a=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,n,s):void 0;i.push(P.createElement(TTt,pr({key:"W"},e.defaultProps,r.props,{weekNumber:s,isWeekDisabled:r.isWeekDisabled(),date:n,onClick:a})))}return i.concat([0,1,2,3,4,5,6].map(function(o){var c=$a(n,o);return P.createElement(kTt,pr({},e.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:c.valueOf(),day:c,onClick:r.handleDayClick.bind(r,c),onMouseEnter:r.handleDayMouseEnter.bind(r,c)}))}))},r.startOfWeek=function(){return yf(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!hr(r.startOfWeek(),r.props.selected)&&hr(r.startOfWeek(),r.props.preSelection)},r}return Object.defineProperty(e,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),e.prototype.render=function(){var r={"react-datepicker__week":!0,"react-datepicker__week--selected":hr(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},n=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return P.createElement("div",{className:Tt(r,n),role:"row"},this.renderDays())},e})(b.Component),$v,ETt=6,Mg={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},gL=($v={},$v[Mg.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},$v[Mg.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},$v[Mg.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},$v),WS=1;function bie(t,e){return t?Mg.FOUR_COLUMNS:e?Mg.TWO_COLUMNS:Mg.THREE_COLUMNS}var jTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.MONTH_REFS=ql([],Array(12),!0).map(function(){return b.createRef()}),r.QUARTER_REFS=ql([],Array(4),!0).map(function(){return b.createRef()}),r.isDisabled=function(n){return go(n,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(n){return y6(n,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(n,i){var s,a;
4399(a=(s=r.props).onDayClick)===null||a===void 0||a.call(s,n,i,r.props.orderInDisplay)},r.handleDayMouseEnter=function(n){var i,s;(s=(i=r.props).onDayMouseEnter)===null||s===void 0||s.call(i,n)},r.handleMouseLeave=function(){var n,i;(i=(n=r.props).onMouseLeave)===null||i===void 0||i.call(n)},r.isRangeStartMonth=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate;return!a||!o?!1:Ds(fs(s,n),a)},r.isRangeStartQuarter=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate;return!a||!o?!1:hE(Hm(s,n),a)},r.isRangeEndMonth=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate;return!a||!o?!1:Ds(fs(s,n),o)},r.isRangeEndQuarter=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate;return!a||!o?!1:hE(Hm(s,n),o)},r.isInSelectingRangeMonth=function(n){var i,s=r.props,a=s.day,o=s.selectsStart,c=s.selectsEnd,u=s.selectsRange,d=s.startDate,f=s.endDate,h=(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection;return!(o||c||u)||!h?!1:o&&f?BS(h,f,n,a):c&&d||u&&d&&!f?BS(d,h,n,a):!1},r.isSelectingMonthRangeStart=function(n){var i;if(!r.isInSelectingRangeMonth(n))return!1;var s=r.props,a=s.day,o=s.startDate,c=s.selectsStart,u=fs(a,n),d=(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection;return c?Ds(u,d):Ds(u,o)},r.isSelectingMonthRangeEnd=function(n){var i;if(!r.isInSelectingRangeMonth(n))return!1;var s=r.props,a=s.day,o=s.endDate,c=s.selectsEnd,u=s.selectsRange,d=fs(a,n),f=(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection;return c||u?Ds(d,f):Ds(d,o)},r.isInSelectingRangeQuarter=function(n){var i,s=r.props,a=s.day,o=s.selectsStart,c=s.selectsEnd,u=s.selectsRange,d=s.startDate,f=s.endDate,h=(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection;return!(o||c||u)||!h?!1:o&&f?GS(h,f,n,a):c&&d||u&&d&&!f?GS(d,h,n,a):!1},r.isWeekInMonth=function(n){var i=r.props.day,s=$a(n,6);return Ds(n,i)||Ds(s,i)},r.isCurrentMonth=function(n,i){return tr(n)===tr(Ar())&&i===Qi(Ar())},r.isCurrentQuarter=function(n,i){return tr(n)===tr(Ar())&&i===Jh(Ar())},r.isSelectedMonth=function(n,i,s){return Qi(s)===i&&tr(n)===tr(s)},r.isSelectMonthInList=function(n,i,s){return s.some(function(a){return r.isSelectedMonth(n,i,a)})},r.isSelectedQuarter=function(n,i,s){return Jh(n)===i&&tr(n)===tr(s)},r.isMonthSelected=function(){var n=r.props,i=n.day,s=n.selected,a=n.selectedDates,o=n.selectsMultiple,c=Qi(i);return o?a?.some(function(u){return r.isSelectedMonth(i,c,u)}):!!s&&r.isSelectedMonth(i,c,s)},r.renderWeeks=function(){for(var n=[],i=r.props.fixedHeight,s=0,a=!1,o=yf(_u(r.props.day),r.props.locale,r.props.calendarStartDay),c=function(y){return r.props.showWeekPicker?yf(y,r.props.locale,r.props.calendarStartDay):r.props.preSelection},u=function(y){return r.props.showWeekPicker?yf(y,r.props.locale,r.props.calendarStartDay):r.props.selected},d=r.props.selected?u(r.props.selected):void 0,f=r.props.preSelection?c(r.props.preSelection):void 0;n.push(P.createElement(CTt,pr({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:s,day:o,month:Qi(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:d,preSelection:f,showWeekNumber:r.props.showWeekNumbers}))),!a;){s++,o=Xg(o,1);var h=i&&s>=ETt,m=!i&&!r.isWeekInMonth(o);if(h||m)if(r.props.peekNextMonth)a=!0;else break}return n},r.onMonthClick=function(n,i){var s=r.isMonthDisabledForLabelDate(i),a=s.isDisabled,o=s.labelDate;a||r.handleDayClick(_u(o),n)},r.onMonthMouseEnter=function(n){var i=r.isMonthDisabledForLabelDate(n),s=i.isDisabled,a=i.labelDate;s||r.handleDayMouseEnter(_u(a))},r.handleMonthNavigation=function(n,i){var s,a,o,c;(a=(s=r.props).setPreSelection)===null||a===void 0||a.call(s,i),(c=(o=r.MONTH_REFS[n])===null||o===void 0?void 0:o.current)===null||c===void 0||c.focus()},r.handleKeyboardNavigation=function(n,i,s){var a,o=r.props,c=o.selected,u=o.preSelection,d=o.setPreSelection,f=o.minDate,h=o.maxDate,m=o.showFourColumnMonthYearPicker,y=o.showTwoColumnMonthYearPicker;if(u){var x=bie(m,y),v=r.getVerticalOffset(x),_=(a=gL[x])===null||a===void 0?void 0:a.grid,S=function(j,M,O){var R,I,B=M,F=O;switch(j){case Ze.ArrowRight:B=Va(M,WS),F=O===11?0:O+WS;break;case Ze.ArrowLeft:B=ep(M,WS),F=O===0?11:O-WS;break;case Ze.ArrowUp:B=ep(M,v),F=!((R=_?.[0])===null||R===void 0)&&R.includes(O)?O+12-v:O-v;break;case Ze.ArrowDown:B=Va(M,v),F=!((I=_?.[_.length-1])===null||I===void 0)&&I.includes(O)?O-12+v:O+v;break}return{newCalculatedDate:B,newCalculatedMonth:F}},k=function(j,M,O){for(var R=40,I=j,B=!1,F=0,V=S(I,M,O),$=V.newCalculatedDate,U=V.newCalculatedMonth;!B;){if(F>=R){$=M,U=O;break}if(f&&$<f){I=Ze.ArrowRight;var z=S(I,$,U);
4399$=z.newCalculatedDate,U=z.newCalculatedMonth}if(h&&$>h){I=Ze.ArrowLeft;var z=S(I,$,U);$=z.newCalculatedDate,U=z.newCalculatedMonth}if(hTt($,r.props)){var z=S(I,$,U);$=z.newCalculatedDate,U=z.newCalculatedMonth}else B=!0;F++}return{newCalculatedDate:$,newCalculatedMonth:U}};if(i===Ze.Enter){r.isMonthDisabled(s)||(r.onMonthClick(n,s),d?.(c));return}var E=k(i,u,s),T=E.newCalculatedDate,N=E.newCalculatedMonth;switch(i){case Ze.ArrowRight:case Ze.ArrowLeft:case Ze.ArrowUp:case Ze.ArrowDown:r.handleMonthNavigation(N,T);break}}},r.getVerticalOffset=function(n){var i,s;return(s=(i=gL[n])===null||i===void 0?void 0:i.verticalNavigationOffset)!==null&&s!==void 0?s:0},r.onMonthKeyDown=function(n,i){var s=r.props,a=s.disabledKeyboardNavigation,o=s.handleOnMonthKeyDown,c=n.key;c!==Ze.Tab&&n.preventDefault(),a||r.handleKeyboardNavigation(n,c,i),o&&o(n)},r.onQuarterClick=function(n,i){var s=Hm(r.props.day,i);VS(s,r.props)||r.handleDayClick(aie(s),n)},r.onQuarterMouseEnter=function(n){var i=Hm(r.props.day,n);VS(i,r.props)||r.handleDayMouseEnter(aie(i))},r.handleQuarterNavigation=function(n,i){var s,a,o,c;r.isDisabled(i)||r.isExcluded(i)||((a=(s=r.props).setPreSelection)===null||a===void 0||a.call(s,i),(c=(o=r.QUARTER_REFS[n-1])===null||o===void 0?void 0:o.current)===null||c===void 0||c.focus())},r.onQuarterKeyDown=function(n,i){var s,a,o=n.key;if(!r.props.disabledKeyboardNavigation)switch(o){case Ze.Enter:r.onQuarterClick(n,i),(a=(s=r.props).setPreSelection)===null||a===void 0||a.call(s,r.props.selected);break;case Ze.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(i===4?1:i+1,vV(r.props.preSelection,1));break;case Ze.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(i===1?4:i-1,ype(r.props.preSelection));break}},r.isMonthDisabledForLabelDate=function(n){var i,s=r.props,a=s.day,o=s.minDate,c=s.maxDate,u=s.excludeDates,d=s.includeDates,f=fs(a,n);return{isDisabled:(i=(o||c||u||d)&&abe(f,r.props))!==null&&i!==void 0?i:!1,labelDate:f}},r.isMonthDisabled=function(n){var i=r.isMonthDisabledForLabelDate(n).isDisabled;return i},r.getMonthClassNames=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate,c=i.preSelection,u=i.monthClassName,d=u?u(fs(s,n)):void 0,f=r.getSelection();return Tt("react-datepicker__month-text","react-datepicker__month-".concat(n),d,{"react-datepicker__month-text--disabled":r.
4399isMonthDisabled(n),"react-datepicker__month-text--selected":f?r.isSelectMonthInList(s,n,f):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&c&&r.isSelectedMonth(s,n,c)&&!r.isMonthSelected()&&!r.isMonthDisabled(n),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(n),"react-datepicker__month-text--in-range":a&&o?BS(a,o,n,s):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(n),"react-datepicker__month-text--range-end":r.isRangeEndMonth(n),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(n),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(n),"react-datepicker__month-text--today":r.isCurrentMonth(s,n)})},r.getTabIndex=function(n){if(r.props.preSelection==null)return"-1";var i=Qi(r.props.preSelection),s=r.isMonthDisabledForLabelDate(i).isDisabled,a=n===i&&!(s||r.props.disabledKeyboardNavigation)?"0":"-1";return a},r.getQuarterTabIndex=function(n){if(r.props.preSelection==null)return"-1";var i=Jh(r.props.preSelection),s=VS(r.props.day,r.props),a=n===i&&!(s||r.props.disabledKeyboardNavigation)?"0":"-1";return a},r.getAriaLabel=function(n){var i=r.props,s=i.chooseDayAriaLabelPrefix,a=s===void 0?"Choose":s,o=i.disabledDayAriaLabelPrefix,c=o===void 0?"Not available":o,u=i.day,d=i.locale,f=fs(u,n),h=r.isDisabled(f)||r.isExcluded(f)?c:a;return"".concat(h," ").concat(hn(f,"MMMM yyyy",d))},r.getQuarterClassNames=function(n){var i=r.props,s=i.day,a=i.startDate,o=i.endDate,c=i.selected,u=i.minDate,d=i.maxDate,f=i.excludeDates,h=i.includeDates,m=i.filterDate,y=i.preSelection,x=i.disabledKeyboardNavigation,v=(u||d||f||h||m)&&VS(Hm(s,n),r.props);return Tt("react-datepicker__quarter-text","react-datepicker__quarter-".concat(n),{"react-datepicker__quarter-text--disabled":v,"react-datepicker__quarter-text--selected":c?r.isSelectedQuarter(s,n,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!x&&y&&r.isSelectedQuarter(s,n,y)&&!v,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(n),"react-datepicker__quarter-text--in-range":a&&o?GS(a,o,n,s):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(n),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(n),"react-datepicker__quarter-text--today":r.
4399isCurrentQuarter(s,n)})},r.getMonthContent=function(n){var i=r.props,s=i.showFullMonthYearPicker,a=i.renderMonthContent,o=i.locale,c=i.day,u=sbe(n,o),d=g6(n,o);return a?a(n,u,d,c):s?d:u},r.getQuarterContent=function(n){var i,s=r.props,a=s.renderQuarterContent,o=s.locale,c=fTt(n,o);return(i=a?.(n,c))!==null&&i!==void 0?i:c},r.renderMonths=function(){var n,i=r.props,s=i.showTwoColumnMonthYearPicker,a=i.showFourColumnMonthYearPicker,o=i.day,c=i.selected,u=(n=gL[bie(a,s)])===null||n===void 0?void 0:n.grid;return u?.map(function(d,f){return P.createElement("div",{className:"react-datepicker__month-wrapper",key:f},d.map(function(h,m){return P.createElement("div",{ref:r.MONTH_REFS[h],key:m,onClick:function(y){r.onMonthClick(y,h)},onKeyDown:function(y){cbe(y)&&(y.preventDefault(),y.key=Ze.Enter),r.onMonthKeyDown(y,h)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(h)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(h)}:void 0,tabIndex:Number(r.getTabIndex(h)),className:r.getMonthClassNames(h),"aria-disabled":r.
vendor: 11,423 bytes, line 4399
4399isMonthDisabled(h),role:"option","aria-label":r.getAriaLabel(h),"aria-current":r.isCurrentMonth(o,h)?"date":void 0,"aria-selected":c?r.isSelectedMonth(o,h,c):void 0},r.getMonthContent(h))}))})},r.renderQuarters=function(){var n=r.props,i=n.day,s=n.selected,a=[1,2,3,4];return P.createElement("div",{className:"react-datepicker__quarter-wrapper"},a.map(function(o,c){return P.createElement("div",{key:c,ref:r.QUARTER_REFS[c],role:"option",onClick:function(u){r.onQuarterClick(u,o)},onKeyDown:function(u){r.onQuarterKeyDown(u,o)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(o)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(o)}:void 0,className:r.getQuarterClassNames(o),"aria-selected":s?r.isSelectedQuarter(i,o,s):void 0,tabIndex:Number(r.getQuarterTabIndex(o)),"aria-current":r.isCurrentQuarter(i,o)?"date":void 0},r.getQuarterContent(o))}))},r.getClassNames=function(){var n=r.props,i=n.selectingDate,s=n.selectsStart,a=n.selectsEnd,o=n.showMonthYearPicker,c=n.showQuarterYearPicker,u=n.showWeekPicker;return Tt("react-datepicker__month",{"react-datepicker__month--selecting-range":i&&(s||a)},{"react-datepicker__monthPicker":o},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":u})},r}return e.prototype.getSelection=function(){var r=this.props,n=r.selected,i=r.selectedDates,s=r.selectsMultiple;if(s)return i;if(n)return[n]},e.prototype.render=function(){var r=this.props,n=r.showMonthYearPicker,i=r.showQuarterYearPicker,s=r.day,a=r.ariaLabelPrefix,o=a===void 0?"Month ":a,c=o?o.trim()+" ":"",u=n||i;return u?P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(hn(s,"MMMM, yyyy",this.props.locale)),role:"listbox"},n?this.renderMonths():this.renderQuarters()):P.createElement("div",{role:"table"},this.props.dayNamesHeader&&P.createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(hn(s,"MMMM, yyyy",this.props.locale)),role:"rowgroup"},this.renderWeeks()))},e})(b.Component),NTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.monthOptionButtonsRef={},r.isSelectedMonth=function(n){return r.props.month===n},r.handleOptionKeyDown=function(n,i){var s;switch(i.key){case"Enter":i.preventDefault(),r.onChange(n);break;case"Escape":i.preventDefault(),r.props.onCancel();break;case"ArrowUp":case"ArrowDown":{i.preventDefault();var a=(n+(i.key==="ArrowUp"?-1:1)+r.props.monthNames.length)%r.props.monthNames.length;(s=r.monthOptionButtonsRef[a])===null||s===void 0||s.focus();break}}},r.renderOptions=function(){return r.monthOptionButtonsRef={},r.props.monthNames.map(function(n,i){return P.createElement("div",{ref:function(s){r.monthOptionButtonsRef[i]=s,r.isSelectedMonth(i)&&s?.focus()},role:"button",tabIndex:0,className:r.isSelectedMonth(i)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:n,onClick:r.onChange.bind(r,i),onKeyDown:r.handleOptionKeyDown.bind(r,i),"aria-selected":r.isSelectedMonth(i)?"true":void 0},r.isSelectedMonth(i)?P.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",n)})},r.onChange=function(n){return r.props.onChange(n)},r.handleClickOutside=function(){return r.props.onCancel()},r}return e.prototype.render=function(){return P.createElement(aP,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},e})(b.Component),PTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(n){return n.map(function(i,s){return P.createElement("option",{key:i,value:s},i)})},r.renderSelectMode=function(n){return P.createElement("select",{value:r.props.month,className:"react-datepicker__month-select",onChange:function(i){return r.onChange(parseInt(i.target.value))}},r.renderSelectOptions(n))},r.renderReadView=function(n,i){return P.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:r.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},i[r.props.month]))},r.renderDropdown=function(n){return P.createElement(NTt,pr({key:"dropdown"},r.props,{monthNames:n,onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(n){var i=r.state.dropdownVisible,s=[r.renderReadView(!i,n)];return i&&s.unshift(r.renderDropdown(n)),s},r.onChange=function(n){r.toggleDropdown(),n!==r.props.month&&r.props.onChange(n)},r.toggleDropdown=function(){return r.setState({dropdownVisible:!r.state.dropdownVisible})},r}return e.prototype.render=function(){var r=this,n=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(s){return sbe(s,r.props.locale)}:function(s){return g6(s,r.props.locale)}),i;switch(this.props.dropdownMode){case"scroll":i=this.renderScrollMode(n);break;case"select":i=this.renderSelectMode(n);break}return P.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},i)},e})(b.Component);function MTt(t,e){for(var r=[],n=_u(t),i=_u(e);!Fu(n,i);)r.push(Ar(n)),n=Va(n,1);return r}var ATt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.renderOptions=function(){return n.state.monthYearsList.map(function(i){var s=QF(i),a=Ll(n.props.date,i)&&Ds(n.props.date,i);return P.createElement("div",{className:a?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:s,onClick:n.onChange.bind(n,s),"aria-selected":a?"true":void 0},a?P.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",hn(i,n.props.dateFormat,n.props.locale))})},n.onChange=function(i){return n.props.onChange(i)},n.handleClickOutside=function(){n.props.onCancel()},n.state={monthYearsList:MTt(n.props.minDate,n.props.maxDate)},n}return e.prototype.render=function(){var r=Tt({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return P.createElement(aP,{className:r,onClickOutside:this.handleClickOutside},this.renderOptions())},e})(b.Component),DTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(){for(var n=_u(r.props.minDate),i=_u(r.props.maxDate),s=[];!Fu(n,i);){var a=QF(n);s.push(P.createElement("option",{key:a,value:a},hn(n,r.props.dateFormat,r.props.locale))),n=Va(n,1)}return s},r.onSelectChange=function(n){r.onChange(parseInt(n.target.value))},r.renderSelectMode=function(){return P.createElement("select",{value:QF(_u(r.props.date)),className:"react-datepicker__month-year-select",onChange:r.onSelectChange},r.renderSelectOptions())},r.renderReadView=function(n){var i=hn(r.props.date,r.props.dateFormat,r.props.locale);return P.createElement("div",{key:"read",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:r.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},i))},r.renderDropdown=function(){return P.createElement(ATt,pr({key:"dropdown"},r.props,{onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(){var n=r.state.dropdownVisible,i=[r.renderReadView(!n)];return n&&i.unshift(r.renderDropdown()),i},r.onChange=function(n){r.toggleDropdown();var i=Ar(n);Ll(r.props.date,i)&&Ds(r.props.date,i)||r.props.onChange(i)},r.toggleDropdown=function(){return r.setState({dropdownVisible:!r.state.dropdownVisible})},r}return e.prototype.render=function(){var r;switch(this.props.dropdownMode){case"scroll":r=this.renderScrollMode();break;case"select":r=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},r)},e})(b.Component),OTt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var n,i,s;r.list&&(r.list.scrollTop=(s=r.centerLi&&e.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-((i=(n=r.header)===null||n===void 0?void 0:n.clientHeight)!==null&&i!==void 0?i:0):r.list.clientHeight,r.centerLi))!==null&&s!==void 0?s:0)})},r.handleClick=function(n){var i,s;(r.props.minTime||r.props.maxTime)&&die(n,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&uie(n,r.props)||(s=(i=r.props).onChange)===null||s===void 0||s.call(i,n)},r.isSelectedTime=function(n){return r.props.selected&&_Tt(r.props.selected,n)},r.isDisabledTime=function(n){return(r.props.minTime||r.props.maxTime)&&die(n,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&uie(n,r.props)},r.liClasses=function(n){var i,s=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(n):void 0];return r.isSelectedTime(n)&&s.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(n)&&s.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(du(n)*3600+fu(n)*60+hf(n))%(((i=r.props.intervals)!==null&&i!==void 0?i:e.defaultProps.intervals)*60)!==0&&s.push("react-datepicker__time-list-item--injected"),s.join(" ")},r.handleOnKeyDown=function(n,i){var s,a;n.key===Ze.Space&&(n.preventDefault(),n.key=Ze.Enter),(n.key===Ze.ArrowUp||n.key===Ze.ArrowLeft)&&n.target instanceof HTMLElement&&n.target.previousSibling&&(n.preventDefault(),n.target.previousSibling instanceof HTMLElement&&n.target.previousSibling.focus()),(n.key===Ze.ArrowDown||n.key===Ze.ArrowRight)&&n.target instanceof HTMLElement&&n.target.nextSibling&&(n.preventDefault(),n.target.nextSibling instanceof HTMLElement&&n.target.nextSibling.focus()),n.key===Ze.Enter&&r.handleClick(i),(a=(s=r.props).handleOnKeyDown)===null||a===void 0||a.call(s,n)},r.renderTimes=function(){for(var n,i=[],s=typeof r.props.format=="string"?r.props.format:"p",a=(n=r.props.intervals)!==null&&n!==void 0?n:e.defaultProps.intervals,o=r.props.selected||r.props.openToDate||Ar(),c=Ik(o),u=r.props.injectTimes&&r.props.injectTimes.sort(function(v,_){return v.getTime()-_.getTime()}),d=60*wTt(o),f=d/a,h=0;h<f;h++){var m=GF(c,h*a);if(i.push(m),u){var y=bTt(c,m,h,a,u);i=i.concat(y)}}var x=i.reduce(function(v,_){return _.getTime()<=o.getTime()?_:v},i[0]);return i.map(function(v){return P.createElement("li",{key:v.valueOf(),onClick:r.handleClick.bind(r,v),className:r.liClasses(v),ref:function(_){v===x&&(r.centerLi=_)},onKeyDown:function(_){r.handleOnKeyDown(_,v)},tabIndex:v===x?0:-1,role:"option","aria-selected":r.isSelectedTime(v)?"true":void 0,"aria-disabled":r.
4399isDisabledTime(v)?"true":void 0},hn(v,s,r.props.locale))})},r.renderTimeCaption=function(){return r.props.showTimeCaption===!1?P.createElement(P.Fragment,null):P.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(n){r.header=n}},P.createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return Object.defineProperty(e,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},e.prototype.componentWillUnmount=function(){var r;(r=this.resizeObserver)===null||r===void 0||r.disconnect()},e.prototype.observeDatePickerHeightChanges=function(){var r=this,n=this.props.monthRef;this.updateContainerHeight(),n&&(this.resizeObserver=new ResizeObserver(function(){r.updateContainerHeight()}),this.resizeObserver.observe(n))},e.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},e.prototype.render=function(){var r=this,n,i=this.state.height;return P.createElement("div",{className:"react-datepicker__time-container ".concat(((n=this.props.todayButton)!==null&&n!==void 0?n:e.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),P.createElement("div",{className:"react-datepicker__time"},P.createElement("div",{className:"react-datepicker__time-box"},P.createElement("ul",{className:"react-datepicker__time-list",ref:function(s){r.list=s},style:i?{height:i}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},e.calcCenterPosition=function(r,n){return n.offsetTop-(r/2-n.clientHeight/2)},e})(b.Component),wie=3,RTt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.YEAR_REFS=ql([],Array(n.props.yearItemNumber),!0).map(function(){return b.createRef()}),n.isDisabled=function(i){return go(i,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.isExcluded=function(i){return y6(i,{excludeDates:n.props.excludeDates})},n.selectingDate=function(){var i;return(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection},n.updateFocusOnPaginate=function(i){var s=function(){var a,o;(o=(a=n.YEAR_REFS[i])===null||a===void 0?void 0:a.current)===null||o===void 0||o.focus()};window.requestAnimationFrame(s)},n.handleYearClick=function(i,s){n.props.onDayClick&&n.props.onDayClick(i,s)},n.handleYearNavigation=function(i,s){var a,o,c,u,d=n.props,f=d.date,h=d.yearItemNumber;if(!(f===void 0||h===void 0)){var m=cu(f,h).startPeriod;n.isDisabled(s)||n.isExcluded(s)||((o=(a=n.props).setPreSelection)===null||o===void 0||o.call(a,s),i-m<0?n.updateFocusOnPaginate(h-(m-i)):i-m>=h?n.updateFocusOnPaginate(Math.abs(h-(i-m))):(u=(c=n.YEAR_REFS[i-m])===null||c===void 0?void 0:c.current)===null||u===void 0||u.focus())}},n.isSameDay=function(i,s){return hr(i,s)},n.isCurrentYear=function(i){return i===tr(Ar())},n.isRangeStart=function(i){return n.props.startDate&&n.props.endDate&&Ll(po(Ar(),i),n.props.startDate)},n.isRangeEnd=function(i){return n.props.startDate&&n.props.endDate&&Ll(po(Ar(),i),n.props.endDate)},n.isInRange=function(i){return US(i,n.props.startDate,n.props.endDate)},n.isInSelectingRange=function(i){var s=n.props,a=s.selectsStart,o=s.selectsEnd,c=s.selectsRange,u=s.startDate,d=s.endDate;return!(a||o||c)||!n.selectingDate()?!1:a&&d?US(i,n.selectingDate(),d):o&&u||c&&u&&!d?US(i,u,n.selectingDate()):!1},n.isSelectingRangeStart=function(i){var s;if(!n.isInSelectingRange(i))return!1;var a=n.props,o=a.startDate,c=a.selectsStart,u=po(Ar(),i);return c?Ll(u,(s=n.selectingDate())!==null&&s!==void 0?s:null):Ll(u,o??null)},n.isSelectingRangeEnd=function(i){var s;if(!n.isInSelectingRange(i))return!1;var a=n.props,o=a.endDate,c=a.selectsEnd,u=a.selectsRange,d=po(Ar(),i);return c||u?Ll(d,(s=n.selectingDate())!==null&&s!==void 0?s:null):Ll(d,o??null)},n.isKeyboardSelected=function(i){if(!(n.props.disabledKeyboardNavigation||n.props.date===void 0||n.props.preSelection==null)){var s=n.props,a=s.minDate,o=s.maxDate,c=s.excludeDates,u=s.includeDates,d=s.filterDate,f=s.selected,h=ux(po(n.props.date,i)),m=(a||o||c||u||d)&&Lk(i,n.props),y=!!f&&hr(h,ux(f)),x=hr(h,ux(n.props.preSelection));return!n.props.inline&&!y&&x&&!m}},n.isSelectedYear=function(i){var s=n.props,a=s.selectsMultiple,o=s.selected,c=s.selectedDates;return a?c?.some(function(u){return i===tr(u)}):!!o&&i===tr(o)},n.onYearClick=function(i,s){var a=n.props.date;a!==void 0&&n.handleYearClick(ux(po(a,s)),i)},n.onYearKeyDown=function(i,s){var a,o,c=i.key,u=n.props,d=u.date,f=u.yearItemNumber,h=u.handleOnKeyDown;if(c!==Ze.Tab&&i.preventDefault(),!n.props.disabledKeyboardNavigation)switch(c){case Ze.Enter:if(n.props.selected==null)break;n.onYearClick(i,s),(o=(a=n.props).setPreSelection)===null||o===void 0||o.call(a,n.props.selected);break;case Ze.ArrowRight:if(n.props.preSelection==null)break;n.handleYearNavigation(s+1,ml(n.props.preSelection,1));break;case Ze.ArrowLeft:if(n.props.preSelection==null)break;n.handleYearNavigation(s-1,ey(n.props.preSelection,1));break;case Ze.ArrowUp:{if(d===void 0||f===void 0||n.props.preSelection==null)break;var m=cu(d,f).startPeriod,y=wie,x=s-y;
4399if(x<m){var v=f%y;s>=m&&s<m+v?y=v:y+=v,x=s-y}n.handleYearNavigation(x,ey(n.props.preSelection,y));break}case Ze.ArrowDown:{if(d===void 0||f===void 0||n.props.preSelection==null)break;var _=cu(d,f).endPeriod,y=wie,x=s+y;if(x>_){var v=f%y;s<=_&&s>_-v?y=v:y+=v,x=s+y}n.handleYearNavigation(x,ml(n.props.preSelection,y));break}}h&&h(i)},n.getYearClassNames=function(i){var s=n.props,a=s.date,o=s.minDate,c=s.maxDate,u=s.excludeDates,d=s.includeDates,f=s.filterDate,h=s.yearClassName;return Tt("react-datepicker__year-text","react-datepicker__year-".concat(i),a?h?.(po(a,i)):void 0,{"react-datepicker__year-text--selected":n.isSelectedYear(i),"react-datepicker__year-text--disabled":(o||c||u||d||f)&&Lk(i,n.props),"react-datepicker__year-text--keyboard-selected":n.isKeyboardSelected(i),"react-datepicker__year-text--range-start":n.isRangeStart(i),"react-datepicker__year-text--range-end":n.isRangeEnd(i),"react-datepicker__year-text--in-range":n.isInRange(i),"react-datepicker__year-text--in-selecting-range":n.isInSelectingRange(i),"react-datepicker__year-text--selecting-range-start":n.isSelectingRangeStart(i),"react-datepicker__year-text--selecting-range-end":n.isSelectingRangeEnd(i),"react-datepicker__year-text--today":n.isCurrentYear(i)})},n.getYearTabIndex=function(i){if(n.props.disabledKeyboardNavigation||n.props.preSelection==null)return"-1";var s=tr(n.props.preSelection),a=Lk(i,n.props);return i===s&&!a?"0":"-1"},n.getYearContent=function(i){return n.props.renderYearContent?n.props.renderYearContent(i):i},n}return e.prototype.render=function(){var r=this,n=[],i=this.props,s=i.date,a=i.yearItemNumber,o=i.onYearMouseEnter,c=i.onYearMouseLeave;if(s===void 0)return null;for(var u=cu(s,a),d=u.startPeriod,f=u.endPeriod,h=function(x){n.push(P.createElement("div",{ref:m.YEAR_REFS[x-d],onClick:function(v){r.onYearClick(v,x)},onKeyDown:function(v){cbe(v)&&(v.preventDefault(),v.key=Ze.Enter),r.onYearKeyDown(v,x)},tabIndex:Number(m.getYearTabIndex(x)),className:m.getYearClassNames(x),onMouseEnter:m.props.usePointerEvent?void 0:function(v){return o(v,x)},onPointerEnter:m.props.usePointerEvent?function(v){return o(v,x)}:void 0,onMouseLeave:m.props.usePointerEvent?void 0:function(v){return c(v,x)},onPointerLeave:m.props.usePointerEvent?function(v){return c(v,x)}:void 0,key:x,"aria-current":m.isCurrentYear(x)?"date":void 0},m.getYearContent(x)))},m=this,y=d;y<=f;y++)h(y);return P.createElement("div",{className:"react-datepicker__year"},P.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},n))},e})(b.Component);function ITt(t,e,r,n){for(var i=[],s=0;s<2*e+1;s++){var a=t+e-s,o=!0;r&&(o=tr(r)<=a),n&&o&&(o=tr(n)>=a),o&&i.push(a)}return i}var LTt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;n.yearOptionButtonsRef={},n.handleOptionKeyDown=function(o,c){var u;switch(c.key){case"Enter":c.preventDefault(),n.onChange(o);break;case"Escape":c.preventDefault(),n.props.onCancel();break;case"ArrowUp":case"ArrowDown":{c.preventDefault();var d=o+(c.key==="ArrowUp"?1:-1);n.yearOptionButtonsRef[d]&&((u=n.yearOptionButtonsRef[d])===null||u===void 0||u.focus());break}}},n.renderOptions=function(){n.yearOptionButtonsRef={};var o=n.props.year,c=n.state.yearsList.map(function(f){return P.createElement("div",{ref:function(h){n.yearOptionButtonsRef[f]=h,f===o&&h?.focus()},role:"button",tabIndex:0,className:o===f?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:f,onClick:n.onChange.bind(n,f),onKeyDown:n.handleOptionKeyDown.bind(n,f),"aria-selected":o===f?"true":void 0},o===f?P.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",f)}),u=n.props.minDate?tr(n.props.minDate):null,d=n.props.maxDate?tr(n.props.maxDate):null;return(!d||!n.state.yearsList.find(function(f){return f===d}))&&c.unshift(P.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:n.incrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!u||!n.state.yearsList.find(function(f){return f===u}))&&c.push(P.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:n.decrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},n.onChange=function(o){n.props.onChange(o)},n.handleClickOutside=function(){n.props.onCancel()},n.shiftYears=function(o){var c=n.state.yearsList.map(function(u){return u+o});n.setState({yearsList:c})},n.incrementYears=function(){return n.shiftYears(1)},n.decrementYears=function(){return n.shiftYears(-1)};var i=r.yearDropdownItemNumber,s=r.scrollableYearDropdown,a=i||(s?10:5);return n.state={yearsList:ITt(n.props.year,a,n.props.minDate,n.props.maxDate)},n.dropdownRef=b.createRef(),n}return e.prototype.componentDidMount=function(){var r=this.dropdownRef.current;if(r){var n=r.children?Array.from(r.children):null,i=n?n.find(function(s){return s.ariaSelected}):null;r.scrollTop=i&&i instanceof HTMLElement?i.offsetTop+(i.clientHeight-r.clientHeight)/2:(r.scrollHeight-r.clientHeight)/2}},e.prototype.render=function(){var r=Tt({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return P.createElement(aP,{className:r,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},e})(b.Component),$Tt=(function(t){is(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={dropdownVisible:!1},r.renderSelectOptions=function(){for(var n=r.props.minDate?tr(r.props.minDate):1900,i=r.props.maxDate?tr(r.props.maxDate):2100,s=[],a=n;a<=i;a++)s.push(P.createElement("option",{key:a,value:a},a));return s},r.onSelectChange=function(n){r.onChange(parseInt(n.target.value))},r.renderSelectMode=function(){return P.createElement("select",{value:r.props.year,className:"react-datepicker__year-select",onChange:r.onSelectChange},r.renderSelectOptions())},r.renderReadView=function(n){return P.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:r.toggleDropdown},P.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},r.props.year))},r.renderDropdown=function(){return P.createElement(LTt,pr({key:"dropdown"},r.props,{onChange:r.onChange,onCancel:r.toggleDropdown}))},r.renderScrollMode=function(){var n=r.state.dropdownVisible,i=[r.renderReadView(!n)];return n&&i.unshift(r.renderDropdown()),i},r.onChange=function(n){r.toggleDropdown(),n!==r.props.year&&r.props.onChange(n)},r.toggleDropdown=function(n){r.setState({dropdownVisible:!r.state.dropdownVisible},function(){r.props.adjustDateOnChange&&r.handleYearChange(r.props.date,n)})},r.handleYearChange=function(n,i){var s;(s=r.onSelect)===null||s===void 0||s.call(r,n,i),r.setOpen()},r.onSelect=function(n,i){var s,a;(a=(s=r.props).onSelect)===null||a===void 0||a.call(s,n,i)},r.setOpen=function(){var n,i;(i=(n=r.props).setOpen)===null||i===void 0||i.call(n,!0)},r}return e.prototype.render=function(){var r;switch(this.props.dropdownMode){case"scroll":r=this.renderScrollMode();break;case"select":r=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},r)},e})(b.Component),FTt=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],ube="react-datepicker-ignore-onclickoutside",zTt=function(t){var e=(t.className||"").split(/\s+/);return FTt.some(function(r){return e.indexOf(r)>=0})},BTt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.monthContainer=void 0,n.handleClickOutside=function(i){n.props.onClickOutside(i)},n.setClickOutsideRef=function(){return n.containerRef.current},n.handleDropdownFocus=function(i){var s,a;zTt(i.target)&&((a=(s=n.props).onDropdownFocus)===null||a===void 0||a.call(s,i))},n.getDateInView=function(){var i=n.props,s=i.preSelection,a=i.selected,o=i.openToDate,c=obe(n.props),u=lbe(n.props),d=Ar(),f=o||a||s;return f||(c&&ll(d,c)?c:u&&Fu(d,u)?u:d)},n.increaseMonth=function(){n.setState(function(i){var s=i.date;return{date:Va(s,1)}},function(){return n.handleMonthChange(n.state.date)})},n.decreaseMonth=function(){n.setState(function(i){var s=i.date;return{date:ep(s,1)}},function(){return n.handleMonthChange(n.state.date)})},n.handleDayClick=function(i,s,a){n.props.onSelect(i,s,a),n.props.setPreSelection&&n.props.setPreSelection(i)},n.handleDayMouseEnter=function(i){n.setState({selectingDate:i}),n.props.onDayMouseEnter&&n.props.onDayMouseEnter(i)},n.handleMonthMouseLeave=function(){n.setState({selectingDate:void 0}),n.props.onMonthMouseLeave&&n.props.onMonthMouseLeave()},n.handleYearMouseEnter=function(i,s){n.setState({selectingDate:po(Ar(),s)}),n.props.onYearMouseEnter&&n.props.onYearMouseEnter(i,s)},n.handleYearMouseLeave=function(i,s){n.props.onYearMouseLeave&&n.props.onYearMouseLeave(i,s)},n.handleYearChange=function(i){var s,a,o,c;(a=(s=n.props).onYearChange)===null||a===void 0||a.call(s,i),n.setState({isRenderAriaLiveMessage:!0}),n.props.adjustDateOnChange&&(n.props.onSelect(i),(c=(o=n.props).setOpen)===null||c===void 0||c.c
4399all(o,!0)),n.props.setPreSelection&&n.props.setPreSelection(i)},n.getEnabledPreSelectionDateForMonth=function(i){if(!go(i,n.props))return i;for(var s=_u(i),a=lTt(i),o=ape(a,s),c=null,u=0;u<=o;u++){var d=$a(s,u);if(!go(d,n.props)){c=d;break}}return c},n.handleMonthChange=function(i){var s,a,o,c=(s=n.getEnabledPreSelectionDateForMonth(i))!==null&&s!==void 0?s:i;n.handleCustomMonthChange(c),n.props.adjustDateOnChange&&(n.props.onSelect(c),(o=(a=n.props).setOpen)===null||o===void 0||o.call(a,!0)),n.props.setPreSelection&&n.props.setPreSelection(c)},n.handleCustomMonthChange=function(i){var s,a;(a=(s=n.props).onMonthChange)===null||a===void 0||a.call(s,i),n.setState({isRenderAriaLiveMessage:!0})},n.handleMonthYearChange=function(i){n.handleYearChange(i),n.handleMonthChange(i)},n.changeYear=function(i){n.setState(function(s){var a=s.date;return{date:po(a,Number(i))}},function(){return n.handleYearChange(n.state.date)})},n.changeMonth=function(i){n.setState(function(s){var a=s.date;return{date:fs(a,Number(i))}},function(){return n.handleMonthChange(n.state.date)})},n.changeMonthYear=function(i){n.setState(function(s){var a=s.date;return{date:po(fs(a,Qi(i)),tr(i))}},function(){return n.handleMonthYearChange(n.state.date)})},n.header=function(i){i===void 0&&(i=n.state.date);var s=yf(i,n.props.locale,n.props.calendarStartDay),a=[];return n.props.showWeekNumbers&&a.push(P.createElement("div",{key:"W",className:"react-datepicker__day-name",role:"columnheader"},P.createElement("span",{className:"react-datepicker__sr-only"},"Week number"),P.createElement("span",{"aria-hidden":"true"},n.props.weekLabel||"#"))),a.concat([0,1,2,3,4,5,6].map(function(o){var c=$a(s,o),u=n.formatWeekday(c,n.props.locale),d=n.props.weekDayClassName?n.props.weekDayClassName(c):void 0;return P.createElement("div",{key:o,role:"columnheader",className:Tt("react-datepicker__day-name",d)},P.createElement("span",{className:"react-datepicker__sr-only"},hn(c,"EEEE",n.props.locale)),P.createElement("span",{"aria-hidden":"true"},u))}))},n.formatWeekday=function(i,s){return n.props.formatWeekDay?cTt(i,n.props.formatWeekDay,s):n.props.useWeekdaysShort?dTt(i,s):uTt(i,s)},n.decreaseYear=function(){n.setState(function(i){var s,a=i.date;return{date:ey(a,n.props.showYearPicker?(s=n.props.yearItemNumber)!==null&&s!==void 0?s:e.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.clearSelectingDate=function(){n.setState({selectingDate:void 0})},n.renderPreviousButton=function(){var i,s,a;if(!n.props.renderCustomHeader){var o=(i=n.props.monthsShown)!==null&&i!==void 0?i:e.defaultProps.monthsShown,c=n.props.showPreviousMonths?o-1:0,u=(s=n.props.monthSelectedIn)!==null&&s!==void 0?s:c,d=ep(n.state.date,u),f;switch(!0){case n.props.showMonthYearPicker:f=pie(n.state.date,n.props);break;case n.props.showYearPicker:f=gTt(n.state.date,n.props);break;case n.props.showQuarterYearPicker:f=pTt(n.state.date,n.props);break;default:f=fie(d,n.props);break}if(!(!((a=n.props.forceShowMonthNavigation)!==null&&a!==void 0?a:e.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&f||n.props.showTimeSelectOnly)){var h=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],m=["react-datepicker__navigation","react-datepicker__navigation--previous"],y=n.decreaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(y=n.decreaseYear),f&&n.props.showDisabledMonthNavigation&&(m.push("react-datepicker__navigation--previous--disabled"),y=void 0);var x=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,v=n.props,_=v.previousMonthButtonLabel,S=_===void 0?e.defaultProps.previousMonthButtonLabel:_,k=v.previousYearButtonLabel,E=k===void 0?e.defaultProps.previousYearButtonLabel:k,T=n.props,N=T.previousMonthAriaLabel,j=N===void 0?typeof S=="string"?S:"Previous Month":N,M=T.previousYearAriaLabel,O=M===void 0?typeof E=="string"?E:"Previous Year":M;return P.createElement("button",{type:"button",className:m.join(" "),onClick:y,onKeyDown:n.props.handleOnKeyDown,"aria-label":x?O:j},P.createElement("span",{className:h.join(" ")},x?E:S))}}},n.increaseYear=function(){n.setState(function(i){var s,a=i.date;return{date:ml(a,n.props.showYearPicker?(s=n.props.yearItemNumber)!==null&&s!==void 0?s:e.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.renderNextButton=function(){var i;if(!n.props.renderCustomHeader){var s;switch(!0){case n.props.showMonthYearPicker:s=mie(n.state.date,n.props);break;case n.props.showYearPicker:s=yTt(n.state.date,n.props);break;case n.props.showQuarterYearPicker:s=mTt(n.state.date,n.props);break;default:s=hie(n.state.date,n.props);break}if(!(!((i=n.props.forceShowMonthNavigation)!==null&&i!==void 0?i:e.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&s||n.props.showTimeSelectOnly)){var a=["react-datepicker__navigation","react-datepicker__navigation--next"],o=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];n.props.showTimeSelect&&a.push("react-datepicker__navigation--next--with-time"),n.props.todayButton&&a.push("react-datepicker__navigation--next--with-today-button");var c=n.increaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(c=n.increaseYear),s&&n.props.showDisabledMonthNavigation&&(a.push("react-datepicker__navigation--next--disabled"),c=void 0);var u=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,d=n.props,f=d.nextMonthButtonLabel,h=f===void 0?e.defaultProps.nextMonthButtonLabel:f,m=d.nextYearButtonLabel,y=m===void 0?e.defaultProps.nextYearButtonLabel:m,x=n.props,v=x.nextMonthAriaLabel,_=v===void 0?typeof h=="string"?h:"Next Month":v,S=x.nextYearAriaLabel,k=S===void 0?typeof y=="string"?y:"Next Year":S;return P.createElement("button",{type:"button",className:a.join(" "),onClick:c,onKeyDown:n.props.handleOnKeyDown,"aria-label":u?k:_},P.createElement("span",{className:o.join(" ")},u?y:h))}}},n.renderCurrentMonth=function(i){i===void 0&&(i=n.state.date);var s=["react-datepicker__current-month"];return n.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),n.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),n.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),P.createElement("h2",{className:s.join(" ")},hn(i,n.props.dateFormat,n.props.locale))},n.renderYearDropdown=function(i){if(i===void 0&&(i=!1),!(!n.props.showYearDropdown||i))return P.createElement($Tt,pr({},e.defaultProps,n.props,{date:n.state.date,onChange:n.changeYear,year:tr(n.state.date)}))},n.renderMonthDropdown=function(i){if(i===void 0&&(i=!1),!(!n.props.showMonthDropdown||i))return P.createElement(PTt,pr({},e.defaultProps,n.props,{month:Qi(n.state.date),onChange:n.changeMonth}))},n.renderMonthYearDropdown=function(i){if(i===void 0&&(i=!1),!(!n.props.showMonthYearDropdown||i))return P.createElement(DTt,pr({},e.defaultProps,n.props,{date:n.state.date,onChange:n.changeMonthYear}))},n.handleTodayButtonClick=function(i){n.props.onSelect(oie(),i),n.props.setPreSelection&&n.props.setPreSelection(oie())},n.renderTodayButton=function(){if(!(!n.props.todayButton||n.props.showTimeSelectOnly))return P.createElement("div",{className:"react-datepicker__today-button",onClick:n.handleTodayButtonClick},n.props.todayButton)},n.renderDayNamesHeader=function(i){return P.createElement("div",{className:"react-datepicker__day-names",role:"row"},n.header(i))},n.renderDefaultHeader=function(i){var s=i.monthDate,a=i.i;return P.createElement("div",{className:"react-datepicker__header ".concat(n.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},n.renderCurrentMonth(s),P.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(n.props.dropdownMode),onFocus:n.handleDropdownFocus},n.renderMonthDropdown(a!==0),n.renderMonthYearDropdown(a!==0),n.renderYearDropdown(a!==0)))},n.renderCustomHeader=function(i){var s,a,o=i.monthDate,c=i.i;if(n.props.showTimeSelect&&!n.state.monthContainer||n.props.showTimeSelectOnly)return null;var u=n.props,d=u.showYearPicker,f=u.yearItemNumber,h;if(d){var m=cu(o,f),y=m.startPeriod,x=m.endPeriod;h={startYear:y,endYear:x}}var v=fie(n.state.date,n.props),_=hie(n.state.date,n.props),S=pie(n.state.date,n.props),k=mie(n.state.date,n.props);return P.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:n.props.onDropdownFocus},(a=(s=n.props).renderCustomHeader)===null||a===void 0?void 0:a.call(s,pr(pr(pr({},n.state),d&&{visibleYearsRange:h}
4399),{customHeaderCount:c,monthDate:o,changeMonth:n.changeMonth,changeYear:n.changeYear,decreaseMonth:n.decreaseMonth,increaseMonth:n.increaseMonth,decreaseYear:n.decreaseYear,increaseYear:n.increaseYear,prevMonthButtonDisabled:v,nextMonthButtonDisabled:_,prevYearButtonDisabled:S,nextYearButtonDisabled:k})))},n.renderYearHeader=function(i){var s=i.monthDate,a=n.props,o=a.showYearPicker,c=a.yearItemNumber,u=c===void 0?e.defaultProps.yearItemNumber:c,d=cu(s,u),f=d.startPeriod,h=d.endPeriod;return P.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},o?"".concat(f," - ").concat(h):tr(s))},n.renderHeader=function(i){var s=i.monthDate,a=i.i,o=a===void 0?0:a,c={monthDate:s,i:o};switch(!0){case n.props.renderCustomHeader!==void 0:return n.renderCustomHeader(c);case(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker):return n.renderYearHeader(c);default:return n.renderDefaultHeader(c)}},n.renderMonths=function(){var i,s;if(!(n.props.showTimeSelectOnly||n.props.showYearPicker)){for(var a=[],o=(i=n.props.monthsShown)!==null&&i!==void 0?i:e.defaultProps.monthsShown,c=n.props.showPreviousMonths?o-1:0,u=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?ml(n.state.date,c):ep(n.state.date,c),d=(s=n.props.monthSelectedIn)!==null&&s!==void 0?s:c,f=0;f<o;++f){var h=f-d+c,m=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?ml(u,h):Va(u,h),y="month-".concat(f),x=f<o-1,v=f>0;a.push(P.createElement("div",{key:y,ref:function(_){n.monthContainer=_??void 0},className:"react-datepicker__month-container"},n.renderHeader({monthDate:m,i:f}),P.createElement(jTt,pr({},e.defaultProps,n.props,{containerRef:n.containerRef,ariaLabelPrefix:n.props.monthAriaLabelPrefix,day:m,onDayClick:n.handleDayClick,handleOnKeyDown:n.props.handleOnDayKeyDown,handleOnMonthKeyDown:n.props.handleOnKeyDown,onDayMouseEnter:n.handleDayMouseEnter,onMouseLeave:n.handleMonthMouseLeave,orderInDisplay:f,selectingDate:n.state.selectingDate,monthShowsDuplicateDaysEnd:x,monthShowsDuplicateDaysStart:v,dayNamesHeader:n.renderDayNamesHeader(m)}))))}return a}},n.renderYears=function(){if(!n.props.showTimeSelectOnly&&n.props.showYearPicker)return P.createElement("div",{className:"react-datepicker__year--container"},n.renderHeader({monthDate:n.state.date}),P.createElement(RTt,pr({},e.defaultProps,n.props,{selectingDate:n.state.selectingDate,date:n.state.date,onDayClick:n.handleDayClick,clearSelectingDate:n.clearSelectingDate,onYearMouseEnter:n.handleYearMouseEnter,onYearMouseLeave:n.handleYearMouseLeave})))},n.renderTimeSection=function(){if(n.props.showTimeSelect&&(n.state.monthContainer||n.props.showTimeSelectOnly))return P.createElement(OTt,pr({},e.defaultProps,n.props,{onChange:n.props.onTimeChange,format:n.props.timeFormat,intervals:n.props.timeIntervals,monthRef:n.state.monthContainer}))},n.renderInputTimeSection=function(){var i=n.props.selected?new Date(n.props.selected):void 0,s=i&&oP(i)&&!!n.props.selected,a=s?"".concat(yie(i.getHours()),":").concat(yie(i.getMinutes())):"";if(n.props.showTimeInput)return P.createElement(STt,pr({},e.defaultProps,n.props,{date:i,timeString:a,onChange:n.props.onTimeChange}))},n.renderAriaLiveRegion=function(){var i,s=cu(n.state.date,(i=n.props.yearItemNumber)!==null&&i!==void 0?i:e.defaultProps.yearItemNumber),a=s.startPeriod,o=s.endPeriod,c;return n.props.showYearPicker?c="".concat(a," - ").concat(o):n.props.showMonthYearPicker||n.props.showQuarterYearPicker?c=tr(n.state.date):c="".concat(g6(Qi(n.state.date),n.props.locale)," ").concat(tr(n.state.date)),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},n.state.isRenderAriaLiveMessage&&c)},n.renderChildren=function(){if(n.props.children)return P.createElement("div",{className:"react-datepicker__children-container"},n.props.children)},n.containerRef=b.createRef(),n.state={date:n.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},n}return Object.defineProperty(e,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:ube,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:v1}}
4399,enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){var r=this;this.props.showTimeSelect&&(this.assignMonthContainer=(function(){r.setState({monthContainer:r.monthContainer})})())},e.prototype.componentDidUpdate=function(r){var n=this;if(this.props.preSelection&&(!hr(this.props.preSelection,r.preSelection)||this.props.monthSelectedIn!==r.monthSelectedIn)){var i=!Ds(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return i&&n.handleCustomMonthChange(n.state.date)})}else this.props.openToDate&&!hr(this.props.openToDate,r.openToDate)&&this.setState({date:this.props.openToDate})},e.prototype.render=function(){var r=this.props.container||tTt;return P.createElement(aP,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},P.createElement("div",{style:{display:"contents"},ref:this.containerRef},P.createElement(r,{className:Tt("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},e})(b.Component),VTt=function(t){var e=t.icon,r=t.className,n=r===void 0?"":r,i=t.onClick,s="react-datepicker__calendar-icon";if(typeof e=="string")return P.createElement("i",{className:"".concat(s," ").concat(e," ").concat(n),"aria-hidden":"true",onClick:i});if(P.isValidElement(e)){var a=e;return P.cloneElement(a,{className:"".concat(a.props.className||""," ").concat(s," ").concat(n),onClick:function(o){typeof a.props.onClick=="function"&&a.props.onClick(o),typeof i=="function"&&i(o)}})}return P.createElement("svg",{className:"".concat(s," ").concat(n),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},P.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},dbe=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return e.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},e.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},e.prototype.render=function(){return VE.createPortal(this.props.children,this.el)},e})(b.Component),UTt="[tabindex], a, button, input, select, textarea",GTt=function(t){return(t instanceof HTMLAnchorElement||!t.disabled)&&t.tabIndex!==-1},fbe=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.getTabChildren=function(){var i;return Array.prototype.slice.call((i=n.tabLoopRef.current)===null||i===void 0?void 0:i.querySelectorAll(UTt),1,-1).filter(GTt)},n.handleFocusStart=function(){var i=n.getTabChildren();i&&i.length>1&&i[i.length-1].focus()},n.handleFocusEnd=function(){var i=n.getTabChildren();i&&i.length>1&&i[0].focus()},n.tabLoopRef=b.createRef(),n}return e.prototype.render=function(){var r;return((r=this.props.enableTabLoop)!==null&&r!==void 0?r:e.defaultProps.enableTabLoop)?P.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},P.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,P.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},e.defaultProps={enableTabLoop:!0},e})(b.Component);function WTt(t){function e(r){var n,i=typeof r.hidePopper=="boolean"?r.hidePopper:!0,s=b.useRef(null),a=eTt(pr({open:!i,whileElementsMounted:ihe,placement:r.popperPlacement,middleware:ql([lhe({padding:15}),ohe(10),che({element:s})],(n=r.popperModifiers)!==null&&n!==void 0?n:[],!0)},r.popperProps)),o=pr(pr({},r),{hidePopper:i,popperProps:pr(pr({},a),{arrowRef:s})});return P.createElement(t,pr({},o))}return e.displayName="withFloating(".concat(t.displayName||t.name||"Component",")"),e}var HTt=function(t){var e=t.className,r=t.wrapperClassName,n=t.hidePopper,i=n===void 0?!0:n,s=t.popperComponent,a=t.targetComponent,o=t.enableTabLoop,c=t.popperOnKeyDown,u=t.portalId,d=t.portalHost,f=t.popperProps,h=t.showArrow,m=void 0;if(!i){var y=Tt("react-datepicker-popper",e);m=P.createElement(fbe,{enableTabLoop:o},P.createElement("div",{ref:f.refs.setFloating,style:f.floatingStyles,className:y,"data-placement":f.placement,onKeyDown:c},s,h&&P.createElement(qkt,{ref:f.arrowRef,context:f.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}t.popperContainer&&(m=b.createElement(t.popperContainer,{},m)),u&&!i&&(m=P.createElement(dbe,{portalId:u,portalHost:d},m));var x=Tt("react-datepicker-wrapper",r);return P.createElement(P.Fragment,null,P.createElement("div",{ref:f.refs.setReference,className:x},a),m)},qTt=WTt(HTt);function YTt(t,e){return t&&e?Qi(t)!==Qi(e)||tr(t)!==tr(e):t!==e}var yL="Date input not valid.",KTt=(function(t){is(e,t);function e(r){var n=t.call(this,r)||this;return n.calendar=null,n.input=null,n.getPreSelection=function(){return n.props.openToDate?n.props.openToDate:n.props.selectsEnd&&n.props.startDate?n.props.startDate:n.props.selectsStart&&n.props.endDate?n.props.endDate:Ar()},n.modifyHolidays=function(){var i;return(i=n.props.holidays)===null||i===void 0?void 0:i.reduce(function(s,a){var o=new Date(a.date);return oP(o)?ql(ql([],s,!0),[pr(pr({},a),{date:o})],!1):s},[])},n.calcInitialState=function(){var i,s=n.getPreSelection(),a=obe(n.props),o=lbe(n.props),c=a&&ll(s,Ik(a))?a:o&&Fu(s,lie(o))?o:s;return{open:n.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(i=n.props.selectsRange?n.props.startDate:n.props.selected)!==null&&i!==void 0?i:c,highlightDates:gie(n.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},n.getInputValue=function(){var i,s=n.props,a=s.locale,o=s.startDate,c=s.endDate,u=s.rangeSeparator,d=s.selected,f=s.selectedDates,h=s.selectsMultiple,m=s.selectsRange,y=s.value,x=(i=n.props.dateFormat)!==null&&i!==void 0?i:e.defaultProps.dateFormat,v=n.state.inputValue;return typeof y=="string"?y:typeof v=="string"?v:m?nTt(o,c,{dateFormat:x,locale:a,rangeSeparator:u}):h?iTt(f??[],{dateFormat:x,locale:a}):fo(d,{dateFormat:x,locale:a})},n.resetHiddenStatus=function(){n.setState(pr(pr({},n.state),{wasHidden:!1}))},n.setHiddenStatus=function(){n.setState(pr(pr({},n.state),{wasHidden:!0}))},n.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&n.setHiddenStatus()},n.clearPreventFocusTimeout=function(){n.preventFocusTimeout&&clearTimeout(n.preventFocusTimeout)},n.setFocus=function(){var i,s;(s=(i=n.input)===null||i===void 0?void 0:i.focus)===null||s===void 0||s.call(i,{preventScroll:!0})},n.setBlur=function(){var i,s;(s=(i=n.input)===null||i===void 0?void 0:i.blur)===null||s===void 0||s.call(i),n.cancelFocusInput()},n.deferBlur=function(){requestAnimationFrame(function(){n.setBlur()})},n.setOpen=function(i,s){s===void 0&&(s=!1),n.setState({open:i,preSelection:i&&n.state.open?n.state.preSelection:n.calcInitialState().preSelection,lastPreSelectChange:vL},function(){i||n.setState(function(a){return{focused:s?a.focused:!1}},function(){!s&&n.deferBlur(),n.setState({inputValue:null})})})},n.inputOk=function(){return ic(n.state.preSelection)},n.isCalendarOpen=function(){return n.props.open===void 0?n.state.open&&!n.props.disabled&&!n.props.readOnly:n.props.open},n.handleFocus=function(i){var s,a,o=n.state.wasHidden,c=o?n.state.open:!0;o&&n.resetHiddenStatus(),n.state.preventFocus||((a=(s=n.props).onFocus)===null||a===void 0||a.call(s,i),c&&!n.props.preventOpenOnFocus&&!n.props.readOnly&&n.setOpen(!0)),n.setState({focused:!0})},n.sendFocusBackToInput=function(){n.preventFocusTimeout&&n.clearPreventFocusTimeout(),n.setState({preventFocus:!0},function(){n.preventFocusTimeout=setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})})}
4399,n.cancelFocusInput=function(){clearTimeout(n.inputFocusTimeout),n.inputFocusTimeout=void 0},n.deferFocusInput=function(){n.cancelFocusInput(),n.inputFocusTimeout=setTimeout(function(){return n.setFocus()},1)},n.handleDropdownFocus=function(){n.cancelFocusInput()},n.resetInputValue=function(){n.setState(pr(pr({},n.state),{inputValue:null}))},n.handleBlur=function(i){var s,a;(!n.state.open||n.props.withPortal||n.props.showTimeInput)&&((a=(s=n.props).onBlur)===null||a===void 0||a.call(s,i)),n.resetInputValue(),n.state.open&&n.props.open===!1&&n.setOpen(!1),n.setState({focused:!1})},n.handleCalendarClickOutside=function(i){var s,a;n.props.inline||n.setOpen(!1),(a=(s=n.props).onClickOutside)===null||a===void 0||a.call(s,i),n.props.withPortal&&i.preventDefault()},n.handleChange=function(){for(var i,s,a,o,c,u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];var f=u[0];if(!(n.props.onChangeRaw&&(n.props.onChangeRaw.apply(n,u),!f||typeof f.isDefaultPrevented!="function"||f.isDefaultPrevented()))){n.setState({inputValue:f?.target instanceof HTMLInputElement?f.target.value:null,lastPreSelectChange:QTt});var h=n.props,m=h.selectsRange,y=h.startDate,x=h.endDate,v=(i=n.props.dateFormat)!==null&&i!==void 0?i:e.defaultProps.dateFormat,_=(s=n.props.strictParsing)!==null&&s!==void 0?s:e.defaultProps.strictParsing,S=f?.target instanceof HTMLInputElement?f.target.value:"";if(m){var k=n.props.rangeSeparator,E=k.trim(),T=S.split(v.includes(E)?k:E,2).map(function(F){return F.trim()}),N=T[0],j=T[1],M=hL(N??"",v,n.props.locale,_),O=M?hL(j??"",v,n.props.locale,_):null,R=y?.getTime()!==M?.getTime(),I=x?.getTime()!==O?.getTime();if(!R&&!I||M&&go(M,n.props)||O&&go(O,n.props))return;(o=(a=n.props).onChange)===null||o===void 0||o.call(a,[M,O],f)}else{var B=hL(S,v,n.props.locale,_,(c=n.props.selected)!==null&&c!==void 0?c:void 0);(B||!S)&&n.setSelected(B,f,!0)}}},n.handleSelect=function(i,s,a){if(!n.props.readOnly){var o=n.props,c=o.selectsRange,u=o.startDate,d=o.endDate,f=o.swapRange,h=!c||u&&!d&&(f||!mL(i,u));n.props.shouldCloseOnSelect&&!n.props.showTimeSelect&&h&&n.sendFocusBackToInput(),n.props.onChangeRaw&&n.props.onChangeRaw(s),n.setSelected(i,s,!1,a),n.props.showDateSelect&&n.setState({isRenderAriaLiveMessage:!0}),!n.props.shouldCloseOnSelect||n.props.showTimeSelect?n.setPreSelection(i):h&&n.setOpen(!1)}},n.setSelected=function(i,s,a,o){var c,u,d=i;if(n.props.showYearPicker){if(d!==null&&Lk(tr(d),n.props))return}else if(n.props.showMonthYearPicker){if(d!==null&&abe(d,n.props))return}else if(d!==null&&go(d,n.props))return;var f=n.props,h=f.onChange,m=f.selectsRange,y=f.startDate,x=f.endDate,v=f.selectsMultiple,_=f.selectedDates,S=f.minTime,k=f.swapRange;if(!Hh(n.props.selected,d)||n.props.allowSameDay||m||v)if(d!==null&&(n.props.selected&&(!a||!n.props.showTimeSelect&&!n.props.showTimeSelectOnly&&!n.props.showTimeInput)&&(d=pL(d,{hour:du(n.props.selected),minute:fu(n.props.selected),second:hf(n.props.selected)})),!a&&(n.props.showTimeSelect||n.props.showTimeSelectOnly)&&S&&(d=pL(d,{hour:S.getHours(),minute:S.getMinutes(),second:S.getSeconds()})),n.props.inline||n.setState({preSelection:d}),n.props.focusSelectedMonth||n.setState({monthSelectedIn:o})),m){var E=!y&&!x,T=y&&!x,N=!y&&!!x,j=y&&x;E?h?.([d,null],s):T?d===null?h?.([null,null],s):mL(d,y)?h?.(k?[d,y]:[d,null],s):h?.([y,d],s):N&&(d&&mL(d,x)?h?.([d,x],s):h?.([d,null],s)),j&&h?.([d,null],s)}else if(v){if(d!==null)if(!_?.length)h?.([d],s);else{var M=_.some(function(R){return hr(R,d)});if(M){var O=_.filter(function(R){return!hr(R,d)});h?.(O,s)}else h?.(ql(ql([],_,!0),[d],!1),s)}}else h?.(d,s);a||((u=(c=n.props).onSelect)===null||u===void 0||u.call(c,d,s),n.setState({inputValue:null}))},n.setPreSelection=function(i){if(!n.props.readOnly){var s=ic(n.props.minDate),a=ic(n.props.maxDate),o=!0;if(i){var c=Ik(i);if(s&&a)o=Eh(i,n.props.minDate,n.props.maxDate);else if(s){var u=Ik(n.props.minDate);o=Fu(i,u)||Hh(c,u)}else if(a){var d=lie(n.props.maxDate);o=ll(i,d)||Hh(c,d)}}o&&n.setState({preSelection:i})}},n.toggleCalendar=function(){n.setOpen(!n.state.open)},n.handleTimeChange=function(i){var s,a;if(!(n.props.selectsRange||n.props.selectsMultiple)){var o=n.props.selected?n.props.selected:n.getPreSelection(),c=n.props.selected?i:pL(o,{hour:du(i),minute:fu(i)});n.setState({preSelection:c}),(a=(s=n.props).onChange)===null||a===void 0||a.call(s,c),n.props.shouldCloseOnSelect&&!n.props.showTimeInput&&(n.sendFocusBackToInput(),n.setOpen(!1)),n.props.showTimeInput&&n.setOpen(!0),(n.props.showTimeSelectOnly||n.props.showTimeSelect)&&n.setState({isRenderAriaLiveMessage:!0}),n.setState({inputValue:null})}},n.onInputClick=function(){var i,s;!n.props.disabled&&!n.props.readOnly&&n.setOpen(!0),(s=(i=n.props).onInputClick)===null||s===void 0||s.call(i)},n.onInputKeyDown=function(i){var s,a,o,c,u,d;(a=(s=n.props).onKeyDown)===null||a===void 0||a.call(s,i);var f=i.key;if(!n.state.open&&!n.props.inline&&!n.props.preventOpenOnFocus){(f===Ze.ArrowDown||f===Ze.ArrowUp||f===Ze.Enter)&&((o=n.onInputClick)===null||o===void 0||o.call(n));return}if(n.state.open){if(f===Ze.ArrowDown||f===Ze.ArrowUp){i.preventDefault();var h=n.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":n.props.showWeekPicker&&n.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':n.props.showFullMonthYearPicker||n.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',m=((c=n.calendar)===null||c===void 0?void 0:c.containerRef.current)instanceof Element&&n.calendar.containerRef.current.querySelector(h);m instanceof HTMLElement&&m.focus({preventScroll:!0});return}var y=Ar(n.state.preSelection);f===Ze.Enter?(i.preventDefault(),i.target.blur(),n.inputOk()&&n.state.lastPreSelectChange===vL?(n.handleSelect(y,i),!n.props.shouldCloseOnSelect&&n.setPreSelection(y)):n.setOpen(!1)):f===Ze.Escape?(i.preventDefault(),i.target.blur(),n.sendFocusBackToInput(),n.setOpen(!1)):f===Ze.Tab&&n.setOpen(!1),n.inputOk()||(d=(u=n.props).onInputError)===null||d===void 0||d.call(u,{code:1,msg:yL})}}
4399,n.onPortalKeyDown=function(i){var s=i.key;s===Ze.Escape&&(i.preventDefault(),n.setState({preventFocus:!0},function(){n.setOpen(!1),setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})}))},n.onDayKeyDown=function(i){var s,a,o,c,u,d,f=n.props,h=f.minDate,m=f.maxDate,y=f.disabledKeyboardNavigation,x=f.showWeekPicker,v=f.shouldCloseOnSelect,_=f.locale,S=f.calendarStartDay,k=f.adjustDateOnChange,E=f.inline;if((a=(s=n.props).onKeyDown)===null||a===void 0||a.call(s,i),!y){var T=i.key,N=i.shiftKey,j=Ar(n.state.preSelection),M=function($,U){var z=U;switch($){case Ze.ArrowRight:z=x?Xg(U,1):$a(U,1);break;case Ze.ArrowLeft:z=x?PK(U):eXe(U);break;case Ze.ArrowUp:z=PK(U);break;case Ze.ArrowDown:z=Xg(U,1);break;case Ze.PageUp:z=N?ey(U,1):ep(U,1);break;case Ze.PageDown:z=N?ml(U,1):Va(U,1);break;case Ze.Home:z=yf(U,_,S);break;case Ze.End:z=oTt(U);break}return z},O=function($,U){for(var z=40,L=$,W=!1,K=0,q=M($,U);!W;){if(K>=z){q=U;break}h&&q<h&&(L=Ze.ArrowRight,q=go(h,n.props)?M(L,q):h),m&&q>m&&(L=Ze.ArrowLeft,q=go(m,n.props)?M(L,q):m),go(q,n.props)?((L===Ze.PageUp||L===Ze.Home)&&(L=Ze.ArrowRight),(L===Ze.PageDown||L===Ze.End)&&(L=Ze.ArrowLeft),q=M(L,q)):W=!0,K++}return q};if(T===Ze.Enter){i.preventDefault(),n.handleSelect(j,i),!v&&n.setPreSelection(j);return}else if(T===Ze.Escape){i.preventDefault(),n.setOpen(!1),n.inputOk()||(c=(o=n.props).onInputError)===null||c===void 0||c.call(o,{code:1,msg:yL});return}var R=null;switch(T){case Ze.ArrowLeft:case Ze.ArrowRight:case Ze.ArrowUp:case Ze.ArrowDown:case Ze.PageUp:case Ze.PageDown:case Ze.Home:case Ze.End:R=O(T,j);break}if(!R){(d=(u=n.props).onInputError)===null||d===void 0||d.call(u,{code:1,msg:yL});return}if(i.preventDefault(),n.setState({lastPreSelectChange:vL}),k&&n.setSelected(R),n.setPreSelection(R),E){var I=Qi(j),B=Qi(R),F=tr(j),V=tr(R);I!==B||F!==V?n.setState({shouldFocusDayInline:!0}):n.setState({shouldFocusDayInline:!1})}}},n.onPopperKeyDown=function(i){var s=i.key;s===Ze.Escape&&(i.preventDefault(),n.sendFocusBackToInput(),n.setOpen(!1))},n.onClearClick=function(i){i&&i.preventDefault&&i.preventDefault(),n.sendFocusBackToInput();var s=n.props,a=s.selectsRange,o=s.onChange;o?.(a?[null,null]:null,i),n.setState({inputValue:null})},n.clear=function(){n.onClearClick()},n.onScroll=function(i){typeof n.props.closeOnScroll=="boolean"&&n.props.closeOnScroll?(i.target===document||i.target===document.documentElement||i.target===document.body)&&n.setOpen(!1):typeof n.props.closeOnScroll=="function"&&n.props.closeOnScroll(i)&&n.setOpen(!1)},n.renderCalendar=function(){var i,s;return!n.props.inline&&!n.isCalendarOpen()?null:P.createElement(BTt,pr({showMonthYearDropdown:void 0,ref:function(a){n.calendar=a}},n.props,n.state,{setOpen:n.setOpen,dateFormat:(i=n.props.dateFormatCalendar)!==null&&i!==void 0?i:e.defaultProps.dateFormatCalendar,onSelect:n.handleSelect,onClickOutside:n.handleCalendarClickOutside,holidays:xTt(n.modifyHolidays()),outsideClickIgnoreClass:n.props.outsideClickIgnoreClass,onDropdownFocus:n.handleDropdownFocus,onTimeChange:n.handleTimeChange,className:n.props.calendarClassName,container:n.props.calendarContainer,handleOnKeyDown:n.props.onKeyDown,handleOnDayKeyDown:n.onDayKeyDown,setPreSelection:n.setPreSelection,dropdownMode:(s=n.props.dropdownMode)!==null&&s!==void 0?s:e.defaultProps.dropdownMode}),n.props.children)},n.renderAriaLiveRegion=function(){var i,s=n.props.locale,a=(i=n.props.dateFormat)!==null&&i!==void 0?i:e.defaultProps.dateFormat,o=n.props.showTimeInput||n.props.showTimeSelect,c=o?"PPPPp":"PPPP",u;return n.props.selectsRange?u="Selected start date: ".concat(fo(n.props.startDate,{dateFormat:c,locale:s}),". ").concat(n.props.endDate?"End date: "+fo(n.props.endDate,{dateFormat:c,locale:s}):""):n.props.showTimeSelectOnly?u="Selected time: ".concat(fo(n.props.selected,{dateFormat:a,locale:s})):n.props.showYearPicker?u="Selected year: ".concat(fo(n.props.selected,{dateFormat:"yyyy",locale:s})):n.props.showMonthYearPicker?u="Selected month: ".concat(fo(n.props.selected,{dateFormat:"MMMM yyyy",locale:s})):n.props.showQuarterYearPicker?u="Selected quarter: ".concat(fo(n.props.selected,{dateFormat:"yyyy, QQQ",locale:s})):u="Selected date: ".concat(fo(n.props.selected,{dateFormat:c,locale:s})),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-l
4399ive"},u)},n.renderDateInput=function(){var i,s,a=Tt(n.props.className,(i={},i[n.props.outsideClickIgnoreClass||e.defaultProps.outsideClickIgnoreClass]=n.state.open,i)),o=n.props.customInput||P.createElement("input",{type:"text"}),c=n.props.customInputRef||"ref";return b.cloneElement(o,(s={},s[c]=function(u){n.input=u},s.value=n.getInputValue(),s.onBlur=n.handleBlur,s.onChange=n.handleChange,s.onClick=n.onInputClick,s.onFocus=n.handleFocus,s.onKeyDown=n.onInputKeyDown,s.id=n.props.id,s.name=n.props.name,s.form=n.props.form,s.autoFocus=n.props.autoFocus,s.placeholder=n.props.placeholderText,s.disabled=n.props.disabled,s.autoComplete=n.props.autoComplete,s.className=Tt(o.props.className,a),s.title=n.props.title,s.readOnly=n.props.readOnly,s.required=n.props.required,s.tabIndex=n.props.tabIndex,s["aria-describedby"]=n.props.ariaDescribedBy,s["aria-invalid"]=n.props.ariaInvalid,s["aria-labelledby"]=n.props.ariaLabelledBy,s["aria-required"]=n.props.ariaRequired,s))},n.renderClearButton=function(){var i=n.props,s=i.isClearable,a=i.disabled,o=i.selected,c=i.startDate,u=i.endDate,d=i.clearButtonTitle,f=i.clearButtonClassName,h=f===void 0?"":f,m=i.ariaLabelClose,y=m===void 0?"Close":m,x=i.selectedDates,v=i.readOnly;return s&&!v&&(o!=null||c!=null||u!=null||x?.length)?P.createElement("button",{type:"button",className:Tt("react-datepicker__close-icon",h,{"react-datepicker__close-icon--disabled":a}),disabled:a,"aria-label":y,onClick:n.onClearClick,title:d,tabIndex:-1}):null},n.state=n.calcInitialState(),n.preventFocusTimeout=void 0,n}return Object.defineProperty(e,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:ube,readOnly:!1,rangeSeparator:ibe,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:v1,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},e.prototype.componentDidUpdate=function(r,n){var i,s,a,o;r.inline&&YTt(r.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&r.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),r.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:gie(this.props.highlightDates)}),!n.focused&&!Hh(r.selected,this.props.selected)&&this.setState({inputValue:null}),n.open!==this.state.open&&(n.open===!1&&this.state.open===!0&&((s=(i=this.props).onCalendarOpen)===null||s===void 0||s.call(i)),n.open===!0&&this.state.open===!1&&((o=(a=this.props).onCalendarClose)===null||o===void 0||o.call(a)))},e.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},e.prototype.renderInputContainer=function(){var r=this.props,n=r.showIcon,i=r.icon,s=r.calendarIconClassname,a=r.calendarIconClassName,o=r.toggleCalendarOnIconClick,c=this.state.open;return s&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),P.createElement("div",{className:"react-datepicker__input-container".concat(n?" react-datepicker__view-calendar-icon":"")},n&&P.createElement(VTt,pr({icon:i,className:Tt(a,!a&&s,c&&"react-datepicker-ignore-onclickoutside")},o?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())}
4399,e.prototype.render=function(){var r=this.renderCalendar();if(this.props.inline)return r;if(this.props.withPortal){var n=this.state.open?P.createElement(fbe,{enableTabLoop:this.props.enableTabLoop},P.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},r)):null;return this.state.open&&this.props.portalId&&(n=P.createElement(dbe,pr({portalId:this.props.portalId},this.props),n)),P.createElement("div",null,this.renderInputContainer(),n)}return P.createElement(qTt,pr({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:r,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},e})(b.Component),QTt="input",vL="navigate";const ZTt=({selected:t,onChange:e,withTime:r=!1,containerClassName:n,minDate:i,maxDate:s,variant:a="default"})=>{const o=a==="birthdate"?t??new Date(2e3,0,1):void 0;return l.jsx("div",{className:Pe("absolute z-50 mt-2",n),children:l.jsx(KTt,{selected:t??null,onChange:e,inline:!0,calendarClassName:Pe("custom-calendar",a==="birthdate"&&"birthdate-calendar"),showTimeSelect:r,dateFormat:r?"Pp":"dd-MM-yyyy",timeFormat:"HH:mm",...a==="birthdate"?{showMonthYearDropdown:!0,dropdownMode:"scroll",minDate:new Date(1920,0,1),maxDate:new Date(2013,12,31),openToDate:o}:{minDate:i,maxDate:s}})})},pE=({selected:t,onSelect:e,placeholder:r="Pick a date",disabled:n=!1,readOnly:i=!1,className:s,ariaLabel:a,open:o,onOpenChange:c,minDate:u,maxDate:d,variant:f="default"})=>{const[h,m]=b.useState(!1),y=o??h,x=c??m,v=S=>{e(S),x(!1)},_=S=>S?f==="birthdate"?fDe(S):dDe(S):r;return l.jsxs(Bf,{open:y,onOpenChange:x,children:[l.jsx(Vf,{asChild:!0,children:l.jsxs("button",{type:"button",disabled:n,className:Pe("flex items-center gap-2","group border-app-border-color border rounded-lg bg-app-button-bg text-gray-400","w-full justify-between px-2 sm:px-3 py-2 h-10 sm:h-12 font-normal text-left text-xs sm:text-sm","focus:outline-hidden","ring-1 ring-transparent transition-all duration-300 ease-in-out","2k:text-2xl 2k:h-20",n||i?["bg-app-input-bg","border border-app-border-color rounded-lg","ring-0"]:["bg-app-button-bg","border border-app-border-color","ring-1 ring-transparent","hover:ring-1 hover:ring-app-border-color-accent"],s),"aria-label":a||r,children:[l.jsx(Cu,{size:i?20:16,className:Pe("text-gray-100 shrink-0","2k:w-7 2k:h-7 2k:mr-1",i&&"text-gray-400"),"aria-hidden":"true"}),l.jsx("span",{className:"truncate flex-1 text-left text-gray-100 ml-1",children:_(t??null)}),!n&&l.jsx(Eu,{size:16,className:Pe("text-gray-100 shrink-0 transition-all duration-300","group-hover:text-app-border-color-accent",y&&"rotate-180",n&&"group-hover:text-gray-400"),"aria-hidden":"true"})]})}),l.jsx(Uf,{className:Pe("max-sm:w-[min(90vw,20rem)] max-sm:border-none max-sm:p-0","w-auto sm:w-[20rem]","border-none p-0"),side:"bottom",align:"start",sideOffset:8,collisionPadding:16,children:l.jsx(ZTt,{selected:t??null,onChange:v,minDate:u,maxDate:d,variant:f})})]})},XTt=li({currentEmail:ST("Current email must be a valid email address").trim(),newEmail:ST("New email must be a valid email address").trim(),username:Mr({error:"Username is required"}).trim().min(1,"Username must not be empty")}).refine(t=>t.currentEmail!==t.newEmail,{path:["newEmail"],message:"New email must be different from current email"}),JTt=SWe("success",[li({success:Il(!0),message:Mr(),data:li({email:ST("Email must be a valid email address"),username:Mr().min(1,"Username must not be empty")})}),li({success:Il(!1),message:Mr(),error:li({code:Mr(),message:Mr(),details:cf([Mr(),Uw(Mr())]).optional()})})]),eCt={CURRENT_EMAIL_NOT_FOUND:"Unable to update email. Please verify your current email and try again.",CURRENT_EMAIL_LOOKUP_FAILED:"Unable to update email. Please try again later.",CURRENT_EMAIL_UID_MISMATCH:"Unable to update email. Please verify your current email and try again.",NEW_EMAIL_EXISTS:"This email is already in use. Please choose a different email.",NEW_EMAIL_LOOKUP_FAILED:"Unable to update email. Please try again later.",NEW_EMAIL_INVALID:"Invalid email format. Please check and try again.",NEW_EMAIL_CONFLICT:"This email is already in use. Please choose a different email.",FIREBASE_EMAIL_UPDATE_FAILED:"Unable to update email. Please try again later.",EMAIL_UPDATE_ROLLBACK_FAILED:"Unable to update email. Please contact support.",GRAPHQL_EMAIL_UPDATE_FAILED:"Unable to update email. Please try again later.",GRAPHQL_EMAIL_NOT_FOUND:"Unable to update email. Please try again later."};function _ie(t){return eCt[t]||"Unable to update email. Please try again later."}async function tCt(t,e,r){try{const n=XTt.parse({currentEmail:t,newEmail:e,username:r}),s=`${Ww()}/users/update-email`,a=await Hw(),c=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...a},body:JSON.stringify(n)})).json(),u=JTt.safeParse(c);if(!u.success)throw new Error(_ie("UNKNOWN"));if(!u.data.success)throw new Error(_ie(u.data.error.code))}catch(n){const i=n instanceof Error?n.message:"Unable to update email. Please try again later.";throw new Error(i)}}function rCt({isOpen:t,onCancel:e,onConfirm:r,currentEmail:n,newEmail:i,isLoading:s}){return l.jsxs(AV,{isOpen:t,onClose:e,title:"Confirm e-mail change",icon:l.jsx(Wu,{className:"w-5 h-5 text-yellow-400 2k:size-7"}),maxWidth:"max-w-xl 2k:max-w-3xl",hideDefaultFooter:!0,disableClose:s,children:[l.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-600/30 rounded-md p-4 text-sm text-yellow-100 mb-4 2k:text-xl 2k:my-8",children:["After changing your email, you will be"," ",l.jsx("strong",{children:"logged out"})," ","and must sign in again using your"," ",l.jsx("strong",{children:"new email"}),"."]}),l.jsxs("p",{className:"text-sm text-white mb-6 leading-relaxed break-words whitespace-normal 2k:text-xl",children:["Are you sure you want to change your e-mail"," ",l.jsx("strong",{className:"break-all",children:n})," ","to"," ",l.jsx("strong",{className:"break-all",children:i}),"?"]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(ye,{variant:"secondary",className:"flex-1 2k:text-2xl",onClick:e,disabled:s,children:"Cancel"}),l.jsxs(ye,{className:"flex-1 2k:text-2xl",onClick:r,disabled:s,children:[s?l.jsx(No,{className:"animate-spin mr-2",size:16}
4399):null,s?"Processing...":"Confirm"]})]})]})}const nCt=({userProfile:t,canEditProfile:e,afterSubmit:r})=>{const n=CKe(),[i,s]=b.useState(!1),[a,o]=b.useState(null),[c,u]=b.useState(!1),{updateUser:d}=Okt(),{register:f,handleSubmit:h,reset:m,setError:y,watch:x,setValue:v,formState:{errors:_,isSubmitting:S}}=$o({resolver:xl(Mkt),defaultValues:{firstName:"",lastName:"",username:"",email:"",birth_date:void 0,currentPassword:""},values:{firstName:t?.first_name||"",lastName:t?.last_name||"",username:t?.username||"",email:t?.email||ar.currentUser?.email||"",birth_date:t?.birth_date?new Date(t.birth_date):void 0}}),k=x("birth_date"),E=x("email"),T=ar.currentUser,N=T?.emailVerified,j=T?.providerData.some(B=>B.providerId==="password"),M=j&&N,O=async B=>{const F=ar.currentUser;if(!t||!F)return;const V=t.email,U=B.email.trim()!==V,z=B.username.trim();if(z!==t.username){const W=await Ug(DT(z));if(!W.ok){console.error("Error checking username availability"),y("username",{type:"manual",message:"Unable to verify username availability. Please try again."});return}if(W.data){y("username",{type:"manual",message:"This username is already taken."});return}}if(!U){await d({variables:{userId:t.id,input:{first_name:B.firstName,last_name:B.lastName,username:z,birth_date:B.birth_date?B.birth_date.toISOString().split("T")[0]:null}}}),Ft.success("Profile updated successfully!"),r(),n();return}if(!B.currentPassword?.trim()){y("currentPassword",{type:"manual",message:"Current password is required before changing your email."});return}o(B),s(!0)},R=async()=>{if(!a||!ar.currentUser)return;u(!0);const B=ar.currentUser,F=a.email.trim(),V=t.email,$=a.username.trim();if($!==t.username){const z=await Ug(DT($));if(!z.ok){console.error("Error checking username availability"),y("username",{type:"manual",message:"Unable to verify username availability. Please try again."});return}if(z.data){y("username",{type:"manual",message:"This username is already taken."});return}}try{if(!a.currentPassword?.trim()){y("currentPassword",{type:"manual",message:"Current password is required."});return}try{const z=Ou.credential(V,a.currentPassword);await sue(B,z)}catch{y("currentPassword",{type:"manual",message:"Invalid credentials."});return}B.providerData.some(z=>z.providerId==="google.com")&&await BFe(B,"google.com"),await tCt(V,F,$),await d({variables:{userId:t.id,input:{first_name:a.firstName,last_name:a.lastName,username:$,birth_date:a.birth_date?a.birth_date.toISOString().split("T")[0]:null}}}),Ft.success("Profile updated successfully. Please sign in again with your new credentials."),await dF(ar),r(),n()}catch(z){console.error("Profile form submit error"),y("root",{message:jw(z)})}finally{o(null),s(!1),u(!1)}},I=()=>{m(),n()};return l.jsxs(l.Fragment,{children:[l.jsxs("form",{onSubmit:h(O),className:"space-y-4",children:[_.root&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2 2k:p-6 2k:text-2xl",children:[l.jsx(Ts,{size:16,className:"2k:size-7"}),l.jsx("span",{className:"2k:text-2xl",children:_.root.message})]}),l.jsx(tn,{label:"First Name",icon:af,error:_.firstName?.message,children:l.jsx(Wr,{...f("firstName",{required:"First name is required"}),hasIcon:!0,disabled:!e,placeholder:"Enter your first name",className:""})}),l.jsx(tn,{label:"Last Name",icon:af,error:_.lastName?.message,children:l.jsx(Wr,{...f("lastName",{required:"Last name is required"}),hasIcon:!0,disabled:!e,placeholder:"Enter your last name"})}),l.jsx(tn,{label:"Username",icon:af,error:_.username?.message,children:l.jsx(Wr,{...f("username",{required:"Username is required",pattern:{value:/^[\w-]+$/,message:"Only letters, numbers, _ and -"}}),hasIcon:!0,disabled:!e,placeholder:"Enter your username"})}),l.jsx(tn,{label:"Email",icon:fp,error:_.email?.message,children:l.jsxs(ui,{delayDuration:200,children:[l.jsx(di,{asChild:!0,children:l.jsx("div",{className:"w-full",children:l.jsx(Wr,{...f("email",{required:"Email is required",pattern:{value:/^[\w.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}}),type:"email",hasIcon:!0,disabled:!e||!M,placeholder:"Enter your email address"})})}),!M&&l.jsx(fi,{side:"top",align:"start",children:"You must set a password and verify your email to change it."})]})}),j&&E!==t.email&&l.jsx(tn,{label:"Current Password",icon:xs,error:_.currentPassword?.message,children:l.jsx(Wr,{...f("currentPassword",{required:"Current password is required to change email."}),type:"password",hasIcon:!0,placeholder:"Enter current password (required for email changes)"})}),l.jsx(tn,{label:"Birth Date",error:_.birth_date?.message,children:l.jsx(pE,{selected:k,onSelect:B=>{v("birth_date",B||void 0)},placeholder:"Select your birth date",disabled:!e,variant:"birthdate",readOnly:!0})}),l.jsxs("div",{className:"flex justify-end gap-4 pt-4",children:[l.jsxs(ye,{type:"button",variant:"secondary",className:"2k:text-2xl 2k:py-8",onClick:I,children:[l.jsx(pi,{size:16,className:"2k:size-6"})," ","Cancel"]}),l.jsxs(ye,{type:"submit",className:"2k:text-2xl 2k:py-8",disabled:S||!e,children:[S?l.jsx(No,{className:"animate-spin",size:16}):l.jsx(ei,{size:16,className:"2k:size-6"}),"Save Changes"]})]})]}),l.jsx(rCt,{isOpen:i,onCancel:()=>{s(!1),o(null)},onConfirm:R,currentEmail:t.email,newEmail:a?.email??"",isLoading:c})]})},iCt=({userProfile:t})=>l.jsxs("div",{className:"space-y-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-200 mb-4 2k:text-3xl",children:"Personal Information"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm text-gray-400 mb-1 block 2k:text-2xl",children:"First Name"}),l.jsx("p",{className:"text-white text-base 2k:text-2xl",children:t?.first_name||"Not set"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm text-gray-400 mb-1 block 2k:text-2xl",children:"Last Name"}),l.jsx("p",{className:"text-white text-base 2k:text-2xl",children:t?.last_name||"Not set"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm text-gray-400 mb-1 block 2k:text-2xl",children:"Email address"}),l.jsx("p",{className:"text-white text-base 2k:text-2xl",children:t?.email||"Not set"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm text-gray-400 mb-1 block 2k:text-2xl",children:"Username"}),l.jsx("p",{className:"text-white text-base 2k:text-2xl",children:t?.username||"Not set"})]}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("label",{className:"text-sm text-gray-400 mb-1 block 2k:text-2xl",children:"Birth Date"}),l.jsx("p",{className:"text-white text-base 2k:text-2xl",children:t?.birth_date?new Date(t.birth_date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"Not set"})]})]})]}),sCt=({user:t})=>{const{isEditing:e,isSettingPassword:r}=qp(yl(d=>({isEditing:d.mode==="editing",isSettingPassword:d.mode==="settingPassword"}))),n=EKe(),i=ar.currentUser?.providerData.length===1&&ar.currentUser?.providerData[0]?.providerId==="google.com",s=t?.email||ar.currentUser?.email||"",{userProfile:a,refetch:o}=Pkt(s),{hasPermission:c}=Fw(),u=c("PROFILE","UPDATE");return a?l.jsxs("section",{className:"w-full bg-app-card/50 border border-app-border-color-soft p-6 rounded-xl space-y-6",children:[l.jsx(Ikt,{userProfile:a,canEditProfile:u,afterSubmit:()=>o()}),r?l.jsx(Dkt,{isNewPassword:i,isGoogleOnly:i,userProfile:a}):e?l.jsx(nCt,{userProfile:a,canEditProfile:u,afterSubmit:()=>o(),isGoogleOnly:i}):l.jsx(iCt,{userProfile:a}),l.jsx("div",{className:"pt-6 border-t border-gray-800",children:!r&&l.jsxs("div",{className:"space-y-1",children:[l.jsxs(ye,{onClick:n,variant:"destructive",className:"2k:text-2xl 2k:py-8 2k:px-6",children:[l.jsx(xs,{size:12,className:"2k:size-5"}),i?"Set Password":"Change Password"]}),i&&l.jsx("p",{className:"text-xs text-gray-300 pt-5",children:"*Login with username and password won't work until a password is configured."})]})})]}):l.jsx("div",{className:"w-full mx-auto min-h-screen bg-app-input-bg p-6 rounded-xl",children:l.jsx("div",{className:"flex items-center justify-center h-64 text-gray-400",children:l.jsx("p",{children:"No profile data found"})})})},aCt=()=>{const{user:t,userHasura:e}=Gt(),{plans:r,isLoading:n,error:i,userCurrentPlan:s,userSubscription:a}=Hs(),[o,c]=b.useState(!1),u=a?.status==="past_due";return!t||!e?l.jsx(IE,{to:"/login",replace:!0}):l.jsxs("article",{className:"max-w-xl sm:max-w-7xl mx-auto py-8 2k:max-w-[70vw]",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-8",children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold 2k:text-5xl",children:"Profile Settings"}),l.jsxs(At,{to:"/docs",className:"flex items-center justify-center font-light gap-2 px-3 py-1.5 text-app-primary-foreground
4399/80 hover:text-app-primary-foreground duration-300 transition-colors text-sm group 2k:text-2xl  ",children:["Help",l.jsx(r3,{size:14,className:"group-hover:-translate-y-0.5 transition-transform duration-300 2k:w-5 2k:h-5"})]})]}),i&&l.jsxs("div",{className:"bg-red-500/10 border border-red-500 text-red-500 rounded-lg p-3 text-sm flex items-center gap-2",children:[l.jsx(Ts,{size:16}),l.jsx("span",{children:i})]}),l.jsx("div",{className:"space-y-4 pb-8 max-w-xl sm:max-w-7xl mx-auto py-4 2k:max-w-full",children:t&&l.jsx(sCt,{user:t})}),l.jsxs("div",{className:"flex flex-row justify-between items-start max-w-xl sm:max-w-7xl mx-auto 2k:max-w-[70vw]",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold 2k:text-3xl",children:"Trades settings"}),l.jsx("p",{className:"text-app-primary-foreground/70 2k:text-2xl 2k:pb-8",children:"Configure how trade metrics are displayed"})]}),l.jsxs(ye,{onClick:()=>c(!0),variant:"outline",children:[l.jsx(fl,{}),"Configure Trades settings"]})]}),l.jsx(tc,{className:"my-8"}),l.jsxs("div",{className:"space-y-2 max-w-xl sm:max-w-7xl mx-auto pb-8 2k:max-w-[70vw]",children:[l.jsx("h2",{className:"text-xl font-semibold 2k:text-3xl",children:"Current plan"}),l.jsx("p",{className:"text-gray-400 2k:text-2xl 2k:pb-8",children:"View your current billing plan details"}),a&&u&&l.jsxs(wo,{variant:"destructive",className:"w-fit mb-8!",children:[l.jsx(Ts,{size:16,className:"2k:size-7"}),l.jsx(Dw,{children:"Payment method failed"}),l.jsx(_o,{children:"Your payment method failed. Please update your payment information to continue your subscription."})]}),l.jsx("div",{className:"mt-8 relative",children:n||!s?l.jsx(jkt,{}):i?l.jsx(Nkt,{error:i}):l.jsx(Ekt,{plans:r,userCurrentPlan:s,interval:"month"})})]}),l.jsx(Dge,{open:o,onOpenChange:c,user:e})]})},oCt=(t,e)=>{const r=[];if(e<=10)for(let n=1;n<=e;n++)r.push(n);else{r.push(1),t>4&&r.push("...");for(let n=Math.max(2,t-4);n<=Math.min(e-1,t+4);n++)r.push(n);t<e-3&&r.push("..."),r.push(e)}return r},lCt=({currentPage:t,totalPages:e,onPageChange:r,className:n})=>{const i=oCt(t,e),s="size-11 flex items-center justify-center rounded-lg 2k:text-2xl transition-all duration-150 ease-out focus:outline-hidden focus:ring-1 focus:ring-app-border-color-accent";return l.jsxs("div",{className:ee("flex justify-center items-center gap-2 py-6",n),children:[l.jsx("button",{className:ee(s,"bg-app-button-bg text-app-primary-foreground hover:bg-app-button-bg-active disabled:opacity-50"),disabled:t===1,onClick:()=>r(t-1),"aria-label":"Previous page",children:l.jsx(up,{className:"size-4"})}),i.map((a,o)=>{const c=typeof a=="number"?`page-${a}`:`ellipsis-${o}`;return typeof a=="number"?l.jsx("button",{className:ee(s,a===t?"bg-app-button-bg-active text-app-primary-foreground border border-app-border-color-accent":"bg-app-button-bg text-app-primary-foreground hover:bg-app-button-bg-active"),onClick:()=>r(a),"aria-current":a===t?"page":void 0,children:a},c):l.jsx("span",{className:ee(s,"text-gray-400 select-none cursor-default"),"aria-hidden":"true",children:a},c)}),l.jsx("button",{className:ee(s,"bg-app-button-bg text-app-primary-foreground hover:bg-app-button-bg-active disabled:opacity-50"),disabled:t===e,onClick:()=>r(t+1),"aria-label":"Next page",children:l.jsx(Sf,{className:"size-4"})})]})},cCt=[{value:15,label:"15"},{value:25,label:"25"},{value:50,label:"50"},{value:100,label:"100"}],v6=({page:t,perPage:e,totalItems:r,onPageChange:n,onPerPageChange:i,pageSizeOptions:s=cCt,className:a})=>{const o=Math.max(1,Math.ceil(r/Math.max(1,e))),c=Math.min(Math.max(1,t),o),u=r===0?0:(c-1)*e+1,d=Math.min(r,c*e);return l.jsxs("div",{className:ee("flex flex-col sm:flex-row items-center justify-left gap-4 mt-6",a),children:[l.jsxs("div",{className:"flex items-center gap-4 w-fit",children:[l.jsxs("div",{className:"text-sm font-light text-app-primary-foreground/70",children:["Showing"," ",l.jsxs("span",{className:"font-medium text-app-primary-foreground",children:[u,"-",d]})," ","of"," ",l.jsx("span",{className:"font-medium text-app-primary-foreground",children:r})," ","entries"]}),l.jsxs(vu,{value:e.toString(),onValueChange:f=>{const h=Number(f);i(h),n(1)},children:[l.jsx(bu,{className:"min-w-20 w-fit py-2 rounded-lg h-10 text-sm px-3",children:l.jsx(xu,{placeholder:"Select rows per page"})}),l.jsx(wu,{align:"start",children:s.map(f=>l.jsx(lc,{value:f.value.toString(),children:f.label},f.value))})]})]}),l.jsx(lCt,{currentPage:c,totalPages:o,onPageChange:n,className:"py-0"})]})},uCt=({})=>l.jsx("div",{className:"flex items-center justify-between",children:l.jsx("h1",{className:"text-3xl font-bold text-app-primary-foreground",children:"Recap"})}),dCt=(t,e=.2)=>t*(1+e),fCt=(t,e)=>t/e,hCt=(t,e={})=>{const{yAxisScale:r=1,paddingPercentage:n=.2}=e;if(t.length===0)return[-1,1];const{min:i,max:s}=t.reduce((u,d)=>({min:d<u.min?d:u.min,max:d>u.max?d:u.max}),{min:1/0,max:-1/0}),a=Math.max(Math.abs(i),Math.abs(s)),o=dCt(a,n),c=fCt(o,r);return[-c,c]},pCt=t=>t.length===0?[]:t.reduce((e,r,n)=>{const i=r.value>=0;e.push({label:r.label,value:r.value,metadata:r.metadata,positiveValue:i?r.value:null,negativeValue:i?null:r.value});const s=t[n+1];return s&&s.value>=0!==i&&e.push({label:r.label,value:0,metadata:void 0,positiveValue:0,negativeValue:0}),e},[]),mCt=t=>{const{min:e,max:r}=t.reduce((n,i)=>{const s=(c,u)=>c==null?u:{min:c<u.min?c:u.min,max:c>u.max?c:u.max},a=s(i.positiveValue,n);return s(i.negativeValue,a)},{min:1/0,max:-1/0});return e===1/0||r===-1/0?[null,null]:[e,r]},gCt=(t,e)=>{const[r,n]=mCt(t);return hCt(r===null||n===null?[]:[r,n],{yAxisScale:e})},Sie=(t,e)=>!e||t.includes(0)?t:[...t,0].sort((n,i)=>n-i),hbe=t=>{const e=[1,2,2.5,5],r=a=>10**a,n=Math.floor(Math.log10(t)),i=t/r(n);return(e.find(a=>i<=a)??10)*r(n)},pbe=(t,e)=>{const r=Math.ceil(e/t)*t,n=[];for(let i=-r;i<=r+1e-9;i+=t)n.push(Math.round(i*100)/100);return n},mbe=(t,e,r)=>{if(pbe(t,e).length<=r)return t;const i=t*1.999,s=hbe(i);return mbe(s,e,r)},yCt=(t,e)=>{const r=Math.floor((e-1)/2),n=t/r,i=hbe(Math.max(n,Number.EPSILON)),s=mbe(i,t,e);return pbe(s,t)},vCt=(t,e={})=>{const{forceZero:n=!0}=e,[i,s]=t;if(!isFinite(i)||!isFinite(s)||i===s)return Sie([i||-1,0,s||1],n);const a=Math.max(Math.abs(i),Math.abs(s)),o=yCt(a,8);return Sie(o,n)},xCt={value:{label:"PnL",color:"hsl(var(--chart-1))"}},bCt=({active:t,payload:e,label:r,valueFormatter:n})=>{const i=n??(d=>Ke(d,2));if(!t||!e||e.length===0)return null;const s=e[0].payload,a=Number(s?.value);if(Number.isNaN(a))return null;const o=a>=qn,c=a<=-qn,u=o?_s:c?Kl:ju;return l.jsxs("div",{className:"bg-app-primary/95 backdrop-blur-xs rounded-lg p-3 border border-app-border-color-soft",children:[l.jsx("div",{className:"text-sm font-medium pb-1 font-mono 2k:text-2xl",children:r}),l.jsxs("div",{className:"flex min-w-[130px] items-center text-sm gap-3 2k:text-2xl 2k:min-w-[220px]",children:[l.jsx("div",{className:Pe("w-2 h-4 rounded-xs shrink-0 2k:w-4 2k:h-6",o?"bg-green-400":c?"bg-red-400":"bg-gray-100")}),l.jsx("span",{className:"text-muted-foreground",children:"PnL"}),l.jsxs("div",{className:Pe("font-mono flex items-center gap-2 font-medium tabular-nums ml-auto",o?"text-green-400":c?"text-red-400":"text-gray-100"),children:[l.jsx(u,{className:"size-3"}),i(a)]})]})]})},gbe=({data:t,valueFormatter:e,positiveColor:r="#4ade80",negativeColor:n="#f87171",zeroLineColor:i="#f87171",yAxisScale:s=1,
4399compactYAxis:a=!0})=>{const o=Qp("(min-width: 2048px)"),c=e??(h=>Ke(h,2)),u=b.useMemo(()=>pCt(t),[t]),d=b.useMemo(()=>gCt(u,s),[u,s]),f=b.useMemo(()=>vCt(d),[d]);return u.length===0?l.jsx("div",{className:"h-[300px] flex items-center justify-center bg-app-card 2k:h-[500px]",children:l.jsx(gn,{})}):l.jsxs("div",{className:"gap-2 flex flex-col w-full items-center justify-center h-fit relative",children:[l.jsx("div",{className:"h-6 w-fit object-cover object-center absolute top-9 pointer-events-none right-11 opacity-70",children:l.jsx("span",{className:"text-sm",children:"@MorEdge"})}),l.jsx(Oy,{config:xCt,className:"w-full min-h-[300px] h-fit",children:l.jsxs(oE,{accessibilityLayer:!0,data:u,margin:{top:20,right:o?30:16,left:o?120:16},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"positiveGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:r,stopOpacity:.4}),l.jsx("stop",{offset:"25%",stopColor:r,stopOpacity:.25}),l.jsx("stop",{offset:"50%",stopColor:r,stopOpacity:.15}),l.jsx("stop",{offset:"75%",stopColor:r,stopOpacity:.08})]}),l.jsxs("linearGradient",{id:"negativeGradient",x1:"0",y1:"1",x2:"0",y2:"0",children:[l.jsx("stop",{offset:"0%",stopColor:n,stopOpacity:.4}),l.jsx("stop",{offset:"25%",stopColor:n,stopOpacity:.25}),l.jsx("stop",{offset:"50%",stopColor:n,stopOpacity:.15}),l.jsx("stop",{offset:"75%",stopColor:n,stopOpacity:.08})]})]}),l.jsx(v0,{strokeDasharray:"4 4"}),l.jsx(Cc,{dataKey:"label",tickLine:!0,tickMargin:15,axisLine:!0,angle:-35,textAnchor:"end",height:o?120:80,tick:{fontSize:o?16:12,fill:"#F8FAFB"}}),l.jsx(Co,{dataKey:"value",tickLine:!0,tickMargin:15,axisLine:!0,tickFormatter:h=>a?r1(h,2):c(h),tick:{fontSize:o?16:12,fill:"#F8FAFB"},domain:d,ticks:f}),l.jsx(y1,{content:h=>l.jsx(bCt,{...h,valueFormatter:e}),cursor:{opacity:.1}}),l.jsx(Gu,{type:"linear",isAnimationActive:!1,dataKey:"positiveValue",fill:"url(#positiveGradient)",stroke:"none",connectNulls:!0}),l.jsx(Gu,{type:"linear",isAnimationActive:!1,dataKey:"negativeValue",fill:"url(#negativeGradient)",stroke:"none",connectNulls:!1}),l.jsx(WN,{y:0,stroke:i,strokeWidth:2,strokeLinecap:"round",strokeDasharray:"7 7",strokeOpacity:.5}),l.jsx(gc,{type:"linear",isAnimationActive:!1,dataKey:"positiveValue",stroke:r,strokeWidth:2,dot:!1,connectNulls:!1,activeDot:{r:o?10:6,fill:r,stroke:"hsl(var(--background))",strokeWidth:2}}),l.jsx(gc,{type:"linear",isAnimationActive:!1,dataKey:"negativeValue",stroke:n,strokeWidth:2,dot:!1,connectNulls:!1,activeDot:{r:o?10:6,fill:n,stroke:"hsl(var(--background))",strokeWidth:2}})]})})]})},wCt=(t,e)=>{try{const r=new Date(t),n=new Date(e),i=jp(r,"America/New_York"),s=jp(n,"America/New_York");return i.toDateString()===s.toDateString()?Ra(i,"h:mm:ss a",{timeZone:"America/New_York"}):i.getMonth()===s.getMonth()&&i.getFullYear()===s.getFullYear()?Ra(i,"MMM d h:mm a",{timeZone:"America/New_York"}):Ra(i,"MMM d, yyyy h:mm a",{timeZone:"America/New_York"})}catch(r){return console.error("Error formatting execution time:",ks(r)),"Invalid Time"}},uw=t=>{try{if(/^\d{4}-\d{2}-\d{2}$/.test(t)){const[i,s,a]=t.split("-").map(Number),o=new Date(i,s-1,a);return Ra(o,"EEE dd MMM, yyyy")}const r=new Date(t),n=jp(r,"America/New_York");return Ra(n,"EEE dd MMM, yyyy",{timeZone:"America/New_York"})}catch(e){return console.error("Error formatting execution date:",ks(e)),"Invalid Date"}},mE=t=>typeof t=="number"?t:t?Number.parseFloat(t.replace(/[^0-9.-]+/g,"")):0,_Ct=t=>{const e=t.filter(i=>!!i.exitDate);if(e.length===0)return{closedTrades:[],allTrades:[]};const r=e.slice().sort((i,s)=>new Date(i.exitDate).getTime()-new Date(s.exitDate).getTime()),n=t.filter(i=>!!i.entryDate);return n.length===0?{closedTrades:[],allTrades:[]}:{closedTrades:r,allTrades:n}},SCt=(t,e,r=3,n=10)=>
4399{if(t.length===0||e.length===0)return[];const i=t.reduce((m,y)=>{const x=new Date(y.entryDate).getTime();return x<m?x:m},new Date(t[0].entryDate).getTime()),s=new Date(i),a=s.getMinutes(),o=Math.floor(a/r)*r;s.setMinutes(o,0,0);const c=new Date(s);c.setMinutes(c.getMinutes()-n);const u=e.reduce((m,y)=>{const x=new Date(y.exitDate).getTime();return x>m?x:m},new Date(e[0].exitDate).getTime()),d=new Date(u);d.setMinutes(d.getMinutes()+n);const f=[],h=new Date(c);for(;h.getTime()<=d.getTime();)f.push(new Date(h)),h.setMinutes(h.getMinutes()+r);return f},kCt=(t,e)=>{const r=(i,s)=>s.reduce((a,o)=>{const c=Math.abs(i.getTime()-o.getTime()),u=Math.abs(i.getTime()-a.getTime());return c<u?o:a}),n=new Map;return t.forEach(i=>{const s=new Date(i.exitDate),o=r(s,e).toISOString();n.has(o)||n.set(o,[]),n.get(o).push(i)}),n},b1=(t,e,r="usd")=>{const n=Number(e==="net"?t.netPnl??t.pnl??0:t.pnl??0);if(Number.isNaN(n))return 0;if(r==="r"){const i=Number(t.risk??0);return i>0?n/i:0}return n},TCt=(t,e,r,n="usd")=>t.reduce((i,s,a)=>{const o=s.toISOString(),u=(e.get(o)||[]).reduce((m,y)=>m+b1(y,r,n),0),f=(a>0?i[a-1].value:0)+u,h=Ra(s,"HH:mm",{timeZone:"America/New_York"});return i.push({label:h,value:f,metadata:{date:h,formattedDate:h}}),i},[]),CCt=(t,e,r="usd")=>t.map(n=>{const i=n.entryDate?Ra(new Date(n.entryDate),"hh:mm:ss a",{timeZone:"America/New_York"}):"-",s=b1(n,e,r);return{id:n.id,time:i,side:(n.positionType||"").toUpperCase(),volume:Number(n.positionSize??0),entryPrice:n.entryPrice??0,exitPrice:n.exitPrice??0,fees:Number(n.commissionsFees??0),pnl:s,symbol:n.symbol,risk:n.risk}}),ECt=(t,e,r="usd",n={})=>!t||t.length===0?[]:t.map(i=>{const s=i.tradeDay,a=r==="r"?i.trades.reduce((d,f)=>d+b1(f,e,"r"),0):e==="net"?i.totalNetPnl:i.totalPnl,o=i.trades.reduce((u,d)=>{const f=Number(e==="net"?d.netPnl||0:d.pnl||0);return f>=qn?u.winners+=1:f<=-qn?u.losers+=1:u.scratch+=1,u},{winners:0,losers:0,scratch:0}),c=i.trades.map(u=>({...u,entryPrice:Number(String(u.entryPrice??0).replace(/[^0-9.-]+/g,"")),exitPrice:Number(String(u.exitPrice??0).replace(/[^0-9.-]+/g,""))}));return{date:s,trades:c,totals:{...o,tradeCount:i.tradeCount,selectedPnL:a},dailyGrade:n[i.tradeDay]||null}}),jCt=(t,e,r="usd")=>{const n=new Map;for(const i of t){const s=i.symbol,a=b1(i,e,r),o=n.get(s)||{pnl:0,trades:0};n.set(s,{pnl:o.pnl+a,trades:o.trades+1})}return Array.from(n.entries()).map(([i,s])=>({symbol:i,realizedPnL:s.pnl,trades:s.trades}))},NCt=t=>t.reduce((e,r)=>({totalRealizedPnL:e.totalRealizedPnL+r.realizedPnL,totalTrades:e.totalTrades+r.trades}),{totalRealizedPnL:0,totalTrades:0}),ybe=(t,e,r=3,n=10,i="usd")=>{const{closedTrades:s,allTrades:a}=_Ct(t);if(s.length===0)return[];const o=SCt(a,s,r,n),c=kCt(s,o);return TCt(o,c,e,i)},PCt=(t,e,r="usd")=>t.reduce((n,i)=>{const s=b1(i,e,r);return{totalVolume:n.totalVolume+Number(i.positionSize??0),totalFees:n.totalFees+Number(i.commissionsFees??0),totalPnL:n.totalPnL+s,totalEntryPrice:n.totalEntryPrice+Number(i.entryPrice??0),totalExitPrice:n.totalExitPrice+Number(i.exitPrice??0),tradeCount:n.tradeCount+1}},{totalVolume:0,totalFees:0,totalPnL:0,totalEntryPrice:0,totalExitPrice:0,tradeCount:0}),MCt=(t,e,r="usd")=>{const n=PCt(t,e,r);return{...n,avgEntryPrice:n.tradeCount>0?n.totalEntryPrice/n.tradeCount:0,avgExitPrice:n.tradeCount>0?n.totalExitPrice/n.tradeCount:0}},gE=t=>t>qn?{icon:_s,colorClass:"text-green-400"}:t<-qn?{icon:Kl,colorClass:"text-red-400"}:{icon:ju,colorClass:"text-gray-400"},ACt=t=>{if(!t)return{error:"Date string is undefined",formattedDate:null};try{const e=new Date(t);if(Number.isNaN(e.getTime()))return{error:"Invalid date format",formattedDate:null};const r=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),i=String(e.getUTCDate()).padStart(2,"0");return{formattedDate:`${r}-${n}-${i}`,error:null}}catch(e){return{error:`Error formatting date: ${e}`,formattedDate:null}}},hg=({label:t,value:e,icon:r,colorClass:n})=>l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx("span",{className:"text-xs tracking-wider text-nowrap uppercase text-app-primary-foreground/60",children:t}),l.jsxs("span",{className:ee("text-base flex items-center justify-center gap-2",n),children:[l.jsx(r,{className:ee("size-4",n)}),e]})]}),b0={cell:"px-6 py-4 whitespace-nowrap text-sm text-app-primary-foreground",header:"px-6 py-3 whitespace-nowrap text-left text-xs text-app-primary-foreground
4399/70 uppercase tracking-wider font-normal bg-app-input-bg border-app-border-color-soft",summaryCell:"px-6 pt-4",badge:"px-1.5 py-1 font-light tracking-wider text-xs rounded-lg border",symbolBadge:"px-2.5 py-2 text-xs rounded-lg bg-app-input-bg text-app-primary-foreground border border-app-border-color-soft",summaryLabel:"ml-1 align-middle px-1.5 py-0.5 rounded-sm text-app-primary-foreground border border-app-border-color-soft text-[10px] uppercase tracking-wider"},Dn=({children:t,compact:e=!1,className:r,...n})=>l.jsx("td",{className:ee(b0.cell,e&&"px-4 tabular-nums",r),...n,children:t}),On=({children:t,className:e,compact:r=!1,...n})=>l.jsx("td",{className:ee(b0.summaryCell,r&&"px-4",e),...n,children:t}),DCt=({side:t})=>{const e=t==="BUY";return l.jsx("span",{className:ee(b0.badge,e?"bg-app-positive-color-bg/70 text-app-positive-color border-app-positive-color/50":"bg-app-negative-color-bg/70 text-app-negative-color border-app-negative-color/50"),children:t})},OCt=({quantity:t,side:e})=>{const r=e==="BUY";return l.jsxs("span",{className:ee("text-sm",r?"text-green-300":"text-red-400"),children:[r?"+":"-",t.toLocaleString()]})},Xd=({value:t,label:e,icon:r})=>{const n=r||null;return l.jsxs("div",{className:"flex items-center gap-1",children:[n&&l.jsx(n,{className:"size-4 text-app-primary-foreground/70"}),l.jsx("span",{className:"text-sm text-app-primary-foreground/80",children:t}),e&&l.jsx("span",{className:b0.summaryLabel,children:e})]})},Rn=({children:t,className:e,compact:r=!1,rounded:n="none",borders:i="none",width:s="w-auto",...a})=>{const o={left:"rounded-l-lg",right:"rounded-r-lg",none:""},c={left:"border-l border-t border-b",right:"border-t border-b border-r",none:"border-t border-b"};return l.jsx("th",{className:ee("p-0!",s),...a,children:l.jsx("div",{className:ee(b0.header,o[n],c[i],e,r&&"px-4 py-2"),children:t})})},x6=({symbol:t})=>l.jsx("span",{className:b0.symbolBadge,children:t}),$k=({icon:t,children:e,...r})=>{const n=t;return l.jsxs("div",{className:"flex items-center gap-2",...r,children:[l.jsx(n,{className:"size-4 text-app-primary-foreground/70"}),l.jsx("span",{className:"text-sm text-app-primary-foreground",children:e})]})},vbe=({trades:t,mode:e,currency:r="usd",tradeCount:n="show",date:i,className:s,...a})=>{const o=Ws(),c=f=>{i&&o(`/app/recap/${i}/symbol/${f}`)},u=b.useMemo(()=>jCt(t,e,r),[t,e,r]),d=b.useMemo(()=>NCt(u),[u]);return l.jsxs("div",{className:ee("bg-app-card/70 rounded-2xl p-6 h-full",s),...a,children:[l.jsxs("h4",{className:"text-sm uppercase tracking-wider mb-4 flex items-center gap-2 text-app-primary-foreground/80",children:["Symbol summary",l.jsxs("span",{className:"text-xs text-app-primary-foreground/70",children:["(",u.length,")"]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full",children:[l.jsx("thead",{className:"bg-app-input-bg",children:l.jsxs("tr",{children:[l.jsx(Rn,{compact:!0,rounded:"left",borders:"left",children:"Symbol"}),l.jsx(Rn,{compact:!0,rounded:n==="hide"?"right":void 0,borders:n==="hide"?"right":void 0,children:"Realized PnL"}),n!=="hide"&&l.jsx(Rn,{compact:!0,rounded:"right",borders:"right",children:"Trades"})]})}),l.jsxs("tbody",{className:"divide-y divide-app-border-color-soft",children:[u.map(f=>l.jsxs("tr",{className:"hover:bg-app-input-bg/50 cursor-pointer duration-150 transition-colors",onClick:()=>c(f.symbol),children:[l.jsx(Dn,{compact:!0,children:l.jsx(x6,{symbol:f.symbol})}),l.jsx(Dn,{compact:!0,children:l.jsx("div",{className:"flex items-center gap-2",children:(()=>{const{icon:h,colorClass:m}=gE(f.realizedPnL);return l.jsxs(l.Fragment,{children:[h&&l.jsx(h,{className:ee("size-4",m)}),l.jsx("span",{className:ee("text-sm",m),children:r==="r"?fn(f.realizedPnL):Ke(f.realizedPnL)})]})})()})}),n!=="hide"&&l.jsx(Dn,{compact:!0,children:l.jsx($k,{icon:dp,children:f.trades})})]},f.symbol)),l.jsxs("tr",{className:"border-t-2 border-app-border-color-soft",children:[l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80 uppercase tracking-wider",children:"Total"}),l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground
4399/80",children:l.jsx("div",{className:"flex items-center gap-2",children:(()=>{const{icon:f,colorClass:h}=gE(d.totalRealizedPnL);return l.jsxs(l.Fragment,{children:[f&&l.jsx(f,{className:ee("size-4",h)}),l.jsx("span",{className:ee("text-sm",h),children:r==="r"?fn(d.totalRealizedPnL):Ke(d.totalRealizedPnL)})]})})()})}),n!=="hide"&&l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80",children:l.jsx(Xd,{icon:dp,value:d.totalTrades})})]})]})]})})]})},RCt=t=>{const{day:e,mode:r,currency:n="usd",tradeCount:i="show"}=t,{date:s,trades:a,totals:o}=e,c=b.useMemo(()=>ybe(a,r,5,10,n),[a,r,n]);return l.jsx(At,{prefetch:"intent",to:`/app/recap/${s}`,className:"w-full group cursor-pointer",children:l.jsxs("article",{className:"bg-app-card/50 rounded-xl p-5 h-full transition-all duration-200 hover:bg-app-card/70 border border-transparent hover:border-app-border-color-soft flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex flex-row gap-4",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"text-lg group-hover:text-app-primary-foreground/90 leading-tight text-nowrap",children:uw(s)}),i!=="hide"&&l.jsxs("span",{className:"text-xs uppercase text-app-primary-foreground",children:[e.totals.tradeCount," ",l.jsx("span",{className:"text-app-primary-foreground/70",children:"trade(s)"})]})]}),l.jsx(tc,{orientation:"vertical",className:"h-8! w-px bg-app-border-color-soft"}),l.jsx(hg,{label:"Daily P&L",value:n==="r"?fn(o.selectedPnL):Ke(o.selectedPnL),icon:o.selectedPnL>=0?_s:Kl,colorClass:o.selectedPnL>=0?"text-green-400":"text-red-400"}),e.dailyGrade&&l.jsxs(l.Fragment,{children:[l.jsx(tc,{orientation:"vertical",className:"h-8! w-px bg-app-border-color-soft"}),l.jsx(hg,{label:"Grade",value:e.dailyGrade,icon:HPe,colorClass:["A","B"].includes(e.dailyGrade)?"text-green-400":["C"].includes(e.dailyGrade)?"text-yellow-400":"text-red-400"})]})]}),l.jsxs("div",{className:"flex justify-center items-center gap-2",children:[l.jsx("span",{className:ee("opacity-0 translate-x-2 group-hover:opacity-100 group-hover:translate-x-0","transition-all duration-300","text-xs text-app-primary-foreground/60 pb-1"),children:"View details"}),l.jsx(Cs,{className:"size-4 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-transform duration-300 shrink-0"})]})]}),l.jsxs("div",{className:ee("grid grid-cols-1 gap-4 h-fit items-start justify-center","lg:grid-cols-3"),children:[l.jsx("div",{className:"col-span-2",children:c.length>0?l.jsx(gbe,{data:c,valueFormatter:n==="r"?u=>fn(u):void 0,compactYAxis:n!=="r"}):l.jsx(_c,{title:"Intraday realized P&L",loadingText:"Loading intraday data..."})}),l.jsx("div",{className:"w-full flex-1 pt-4",children:l.jsx(vbe,{trades:a,mode:r,currency:n,tradeCount:i,date:s,className:"p-4 bg-app-card/50"})})]})]})})},ICt=P.memo(RCt),LCt=()=>l.jsxs("article",{className:"bg-app-card/50 rounded-xl p-6 h-full border border-transparent flex flex-col gap-4 min-h-[380px]",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex flex-row gap-4",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx(Le,{className:"h-5 w-28 mb-2"}),l.jsx(Le,{className:"h-3 w-20"})]}),l.jsx("div",{className:"w-px h-8 bg-app-border-color-soft"}),l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx(Le,{className:"h-3 w-16 mb-2"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-4 rounded-sm"}),l.jsx(Le,{className:"h-4 w-16"})]})]})]}),l.jsx("div",{className:"flex justify-center items-center gap-2",children:l.jsx(Le,{className:"h-3 w-14"})})]}),l.jsxs("div",{className:"grid grid-cols-1 gap-4 h-full items-start justify-center lg:grid-cols-3",children:[l.jsx("div",{className:"bg-app-card/30 rounded-xl border border-dashed border-app-border-color-soft p-4 h-full col-span-2",children:l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsx("div",{className:"w-full h-32 relative",children:l.jsx("div",{className:"absolute inset-0",children:l.jsx(Le,{className:"h-px w-full",style:{clipPath:"pol
4399ygon(0% 80%, 20% 60%, 40% 40%, 60% 30%, 80% 50%, 100% 70%)"}})})})})}),l.jsx("div",{className:"p-4 bg-app-card/50 rounded-xl w-full flex-1 h-full",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(Le,{className:"h-4 w-32 mb-3"}),Array.from({length:8}).map((t,e)=>l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx(Le,{className:"h-3 w-8"}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Le,{className:"h-3 w-12"})}),l.jsx("div",{className:"flex items-center gap-1",children:l.jsx(Le,{className:"h-3 w-6"})})]},e))]})})]})]}),$Ct=({isLoading:t,days:e,mode:r,currency:n="usd",tradeCount:i="show",className:s})=>t?l.jsx("div",{role:"list","aria-busy":"true",className:ee("grid grid-cols-1 gap-4 sm:gap-6",s),children:Array.from({length:3}).map((a,o)=>l.jsx(LCt,{},o))}):e.length===0?l.jsx("div",{"aria-live":"polite",children:l.jsx(yV,{title:"No recap entries found",description:"Try adjusting your date range or filters to see recap entries. Or import trades.",icon:l.jsx(FE,{className:"size-10"}),actionText:"Import trades",actionLink:l.jsxs(At,{to:"/app/trade-entry",children:[l.jsx(n3,{className:"size-4 mr-1 group-hover:translate-x-0.5 transition-transform duration-300"}),"Import trades"]})})}):l.jsx("div",{role:"list",className:ee("grid grid-cols-1 gap-4 sm:gap-6",s),children:e.map(a=>l.jsx("div",{role:"listitem",children:l.jsx(ICt,{day:a,mode:r,currency:n,tradeCount:i})},a.date))}),FCt=(t,e)=>{try{if(typeof window>"u"||!("sessionStorage"in window))return e;const r=window.sessionStorage.getItem(t),n=r!=null?Number.parseInt(r,10):Number.NaN;return Number.isFinite(n)&&n>0?n:e}catch{return e}},xbe=t=>{const{defaultPageSize:e=10,storageKey:r}=t,[n,i]=ys("perPage",Zg.withDefault(FCt(r,e))),s=c=>{i(c),sessionStorage.setItem(r,String(c))},[a,o]=ys("page",Zg.withDefault(1));return{perPage:n,setPerPage:s,page:a,setPage:o}},zCt=({dateRange:t,limit:e=10,offset:r=0,enabled:n=!0,fetchPolicy:i})=>{const{userHasura:s}=Gt(),{data:a,loading:o,error:c}=da(sYe,{variables:{userId:s?.id,limit:e,offset:r,startDate:t.start,endDate:t.end},skip:!n||!s?.id,fetchPolicy:i}),{data:u,loading:d,error:f}=da(aYe,{variables:{userId:s?.id,startDate:t.start,endDate:t.end},skip:!n||!s?.id});return{dailyRecapEntries:a?.dailyRecapSummary||[],totalCount:u?.dailyRecapSummaryAggregate?.aggregate?.count||0,isLoading:o||d,error:(c||f)??void 0}},bbe=({dateRange:t,mode:e,currency:r="usd",page:n=1,perPage:i=10,fetchPolicy:s})=>{const a=(n-1)*i,{dailyRecapEntries:o,totalCount:c,isLoading:u}=zCt({dateRange:{start:t.start,end:t.end},limit:i,offset:a,enabled:!0,fetchPolicy:s}),{userHasura:d}=Gt(),{data:f}=da(UV,{variables:{userId:d?.id||"",startDate:t.start,endDate:t.end},skip:!d?.id}),h=b.useMemo(()=>f?.daily_grade?f.daily_grade.reduce((y,x)=>(y[x.tradeDay]=x.grade,y),{}):{},[f]);return{allDailyGroups:b.useMemo(()=>ECt(o,e,r,h),[o,e,r,h]),totalCount:c,isLoading:u}},kie=[{value:3,label:"3"},{value:6,label:"6"},{value:9,label:"9"},{value:12,label:"12"},{value:15,label:"15"}],BCt=()=>{const{dateRange:t}=s0(),{viewSettings:e,updateViewSettings:r}=o1("mt:recap:viewPrefs"),{page:n,perPage:i,setPage:s,setPerPage:a}=xbe({defaultPageSize:kie[0].value,storageKey:"recap-days-per-page"}),{allDailyGroups:o,totalCount:c,isLoading:u}=bbe({dateRange:{start:t.from.toISOString(),end:t.to.toISOString()},mode:e.mode,currency:e.currency,page:n,perPage:i}),d=o.length>0;return l.jsxs("article",{className:"space-y-6 min-h-screen mb-8 2k:mt-8 h-full",children:[l.jsx(uCt,{}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end w-full gap-4",children:[l.jsx(Vj,{label:"Time presets"}),l.jsx(vN,{label:"Analysis Period",className:"lg:ml-auto"}),l.jsx(a1,{mode:e.mode,currency:e.currency,tradeCount:e.tradeCount,setFilter:f=>r(()=>f)})]}),l.jsx($Ct,{isLoading:u,days:o,mode:e.mode,currency:e.currency,tradeCount:e.tradeCount}),d&&l.jsx(v6,{page:n,perPage:i,totalItems:c,onPageChange:s,onPerPageChange:a,pageSizeOptions:kie})]})},VCt=tt`
4400  mutation UpsertDailyGrade(
4401    $userId: uuid!
4402    $tradeDay: date!
4403    $grade: String
4404    $notes: String
4405    $sleepQuality: smallint
4406    $sleepHours: numeric
4407    $energyLevel: smallint
4408    $goal: String
4409    $reminders: jsonb
4410    $segments: jsonb
4411    $learned: String
4412    $changes: String
4413    $overview: String
4414    $easiestMoneyTradeId: uuid
4415    $easiestMoneyNotes: String
4416  ) {
4417    insert_daily_grade_one(
4418      object: {
4419        user_id: $userId
4420        trade_day: $tradeDay
4421        grade: $grade
4422        notes: $notes
4423        sleep_quality: $sleepQuality
4424        sleep_hours: $sleepHours
4425        energy_level: $energyLevel
4426        goal: $goal
4427        reminders: $reminders
4428        segments: $segments
4429        learned: $learned
4430        changes: $changes
4431        overview: $overview
4432        easiest_money_trade_id: $easiestMoneyTradeId
4433        easiest_money_notes: $easiestMoneyNotes
4434      }
4435      on_conflict: {
4436        constraint: unique_user_trade_day
4437        update_columns: [
4438          grade
4439          notes
4440          sleep_quality
4441          sleep_hours
4442          energy_level
4443          goal
4444          reminders
4445          segments
4446          learned
4447          changes
4448          overview
4449          easiest_money_trade_id
4450          easiest_money_notes
4451        ]
4452      }
4453    ) {
4454      id
4455      tradeDay: trade_day
4456      grade
4457      notes
4458      sleepQuality: sleep_quality
4459      sleepHours: sleep_hours
4460      energyLevel: energy_level
4461      goal
4462      reminders
4463      segments
4464      learned
4465      changes
4466      overview
4467      easiestMoneyTradeId: easiest_money_trade_id
4468      easiestMoneyNotes: easiest_money_notes
4469      updatedAt: updated_at
4470    }
4471  }
4472`,UCt=tt`
4473  mutation DeleteDailyGrade($gradeId: uuid!) {
4474    delete_daily_grade_by_pk(id: $gradeId) {
4475      id
4476    }
4477  }
4478`,GCt=t=>{const{userHasura:e}=Gt(),[r,n]=b.useState(!1),{data:i,loading:s,refetch:a}=ws(qtt,{variables:{userId:e?.id||"",tradeDay:t},skip:!e?.id}),o=i?.daily_grade?.[0]||null,[c,{loading:u}]=Zn(VCt,{update(v){v.evict({fieldName:"daily_grade"}),v.gc()}}),[d,{loading:f}]=Zn(UCt,{update(v){v.evict({fieldName:"daily_grade"}),v.gc()}});return{existingGrade:o,loadingGrade:s,editingGrade:r,setEditingGrade:n,handleEditGrade:()=>{n(!0)},handleSaveGrade:async v=>
4478{if(!e?.id)return;const _={userId:e.id,tradeDay:t,grade:v.grade,notes:v.notes||null,sleepQuality:v.sleepQuality??null,sleepHours:v.sleepHours??null,energyLevel:v.energyLevel??null,goal:v.goal||null,reminders:v.reminders||[],segments:v.segments||null,learned:v.learned||null,changes:v.changes||null,overview:v.overview||null,easiestMoneyTradeId:v.easiestMoneyTradeId||null,easiestMoneyNotes:v.easiestMoneyNotes||null};try{await c({variables:_}),n(!1),Ft.success("Daily grade saved successfully!")}catch(S){console.error("Error saving daily grade:",S),Ft.error("Failed to save daily grade. Please try again.")}},handleCancelGrade:()=>{n(!1)},handleDeleteGrade:async()=>{if(o?.id)try{await d({variables:{gradeId:o.id}}),Ft.success("Daily grade deleted successfully!")}catch(v){console.error("Error deleting daily grade:",v),Ft.error("Failed to delete daily grade. Please try again.")}},upsertLoading:u,deleteLoading:f,refetch:a}},wbe=(t,e)=>Math.max(1,Math.ceil(t/Math.max(1,e))),WCt=(t,e,r)=>{const n=(e-1)*r,i=n+r;return t.slice(n,i)},HCt=(t,e,r)=>{const n=wbe(t,r),i=Math.min(Math.max(1,e),n),s=t===0?0:(i-1)*r+1,a=Math.min(t,i*r);return{totalPages:n,currentPage:i,firstIndex:s,lastIndex:a,totalItems:t,perPage:r,hasItems:t>0,hasMultiplePages:n>1}},qCt=(t,e,r)=>{const n=Math.max(1,e),i=wbe(r,n);return{page:Math.min(Math.max(1,t),i),perPage:n}},_be=(t,e)=>{const{...r}=e,{page:n,perPage:i,setPage:s,setPerPage:a}=xbe(r),o=b.useMemo(()=>{const d=t.length,{page:f,perPage:h}=qCt(n,i,d);return HCt(d,f,h)},[t.length,n,i]),c=b.useMemo(()=>t.length===0?[]:WCt(t,o.currentPage,o.perPage),[t,o.currentPage,o.perPage]),u=b.useMemo(()=>o.hasMultiplePages,[o.hasMultiplePages]);return{page:n,perPage:i,setPage:s,setPerPage:a,currentPageItems:c,paginationInfo:o,shouldShowPagination:u}},xL={A:"bg-emerald-500/10 text-emerald-400 border-emerald-500/30",B:"bg-blue-500/10 text-blue-400 border-blue-500/30",C:"bg-amber-500/10 text-amber-400 border-amber-500/30",D:"bg-orange-500/10 text-orange-400 border-orange-500/30",F:"bg-rose-500/10 text-rose-400 border-rose-500/30"},YCt={A:"shadow-[0_0_20px_rgba(16,185,129,0.15)] border-emerald-500/50",B:"shadow-[0_0_20px_rgba(59,130,246,0.15)] border-blue-500/50",C:"shadow-[0_0_20px_rgba(245,158,11,0.15)] border-amber-500/50",D:"shadow-[0_0_20px_rgba(249,115,22,0.15)] border-orange-500/50",F:"shadow-[0_0_20px_rgba(239,68,68,0.15)] border-rose-500/50"},bL=["A","B","C","D","F"],wL=(t,e)=>{const[r,n]=t.split(":");let i=Number.parseInt(r,10),s=Number.parseInt(n,10);Number.isNaN(i)&&(i=9),Number.isNaN(s)&&(s=30),s+=e,s>=60&&(i+=Math.floor(s/60),s=s%60),i=i%24;const a=o=>o.toString().padStart(2,"0");return`${a(i)}:${a(s)}`},Tie=({existingGrade:t,trades:e,onSave:r,onCancel:n,onDelete:i,isSaving:s=!1,isDeleting:a=!1,mode:o,currency:c="usd",editing:u,setEditing:d,tradeDay:f})=>{const{userHasura:h}=Gt(),m=h?.physical_state_config||Wi,{proPlan:y,shouldShowProBanner:x,isInitialized:v}=Hs(),_=v&&x(),{data:S}=da(Ytt,{variables:{userId:h?.id||"",currentDate:f},skip:!h?.id||!f||!u}),k=S?.daily_grade?.[0],[E,T]=b.useState(1),[N,j]=b.useState(null),[M,O]=b.useState(""),[R,I]=b.useState(3),[B,F]=b.useState(7),[V,$]=b.useState(3),[U,z]=b.useState(""),[L,W]=b.useState([]),[K,q]=b.useState(""),[H,Y]=b.useState(["FOMO","Discipline","Sizing"]),[J,re]=b.useState([{segment:"09:30 - 10:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:00 - 10:30",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:30 - 11:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""}]),[me,oe]=b.useState(!1),[ge,le]=b.useState(H),[Se,Ce]=b.useState(!1),[he,Ct]=b.useState(!1),[De,It]=b.useState(!1);b.useEffect(()=>{le(H)},[H,me]);const[Yt,Qt]=b.useState(""),[Qr,gr]=b.useState(!1),[X,ae]=b.useState("09:30"),[de,Ee]=b.useState("10:00"),[Me,Te]=b.useState(null),[Qe,Nt]=b.useState(""),[jt,jr]=b.useState(""),[Vr,Dr]=b.useState(""),[$r,Ur]=b.useState(null),[Ni,zi]=b.useState("");b.useEffect(()=>{if(t){j(t.grade||null),O(t.notes||""),I(t.sleepQuality||3),F(t.sleepHours!=null?Number(t.sleepHours):7),$(t.energyLevel||3),z(t.goal||""),W(t.reminders||[]);const se=t.segments;if(se&&se.customColumns){Y(se.customColumns);const be=[...se.items||[]].sort((ve,Re)=>{const Oe=ve.segment.split(" - ")[0]||"",lt=Re.segment.split(" - ")[0]||"";return Oe.localeCompare(lt)});re(be)}else Y(["FOMO","Discipline","Sizing"]),re([{segment:"09:30 - 10:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:00 - 10:30",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:30 - 11:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""}]);Nt(t.learned||""),jr(t.changes||""),Dr(t.overview||""),Ur(t.easiestMoneyTradeId||null),zi(t.easiestMoneyNotes||"")}else j(null),O(""),I(3),F(7),$(3),z(""),W([]),Y(["FOMO","Discipline","Sizing"]),re([{segment:"09:30 - 10:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:00 - 10:30",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""},{segment:"10:30 - 11:00",overall:"-",customValues:{FOMO:"-",Discipline:"-",Sizing:"-"},comments:""}]),Nt(""),jr(""),Dr(""),Ur(null),zi(""),Ct(!1)},[t,u]),b.useEffect(()=>{if(!t&&k&&!he){const se=k.segments;if(se&&se.customColumns&&se.items&&se.items.length>0){Y(se.customColumns);const be=se.items.map(ve=>{const Re={};return se.customColumns.forEach(Oe=>{Re[Oe]="-"}),{segment:ve.segment,overall:"-",customValues:Re,comments:""}});re(be),Ct(!0)}}},[k,t,he]),b.useEffect(()=>{if(Qr){if(Te(null),J.length>0){const be=J[J.length-1].segment.split(" - ");if(be.length===2){ae(be[1]),Ee(wL(be[1],30));return}}ae("09:30"),Ee("10:00")}},[Qr,J]);const Nn=P.useMemo(()=>{let se=0,be=0;return e.forEach(ve=>{const Re=o==="net"?ve.netPnl:ve.pnl;se+=Re,ve.risk&&ve.risk>0&&(be+=Re/ve.risk)}),{pnl:se,rMultiple:be,hasTrades:e.length>0}},[e,o]),or=P.useMemo(()=>$r&&e.find(se=>se.id===$r)||null,[$r,e]),xt=P.useMemo(()=>or?o==="net"?or.netPnl:or.pnl:0,[or,o]),$e=P.useMemo(()=>{const be=[...e].sort((ve,Re)=>{const Oe=o==="net"?ve.netPnl:ve.pnl;return(o==="net"?Re.netPnl:Re.pnl)-Oe}).map(ve=>{const Re=new Date(ve.entryDate).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"America/Ne
4478w_York"}),Oe=o==="net"?ve.netPnl:ve.pnl,lt=c==="r"&&ve.risk&&ve.risk>0?fn(Oe/ve.risk):Ke(Oe);return{value:ve.id,label:`${Re} - ${ve.symbol} [${ve.positionType}] (${lt})`,searchText:`${ve.symbol} ${ve.positionType}`}});return be.unshift({value:"none",label:"No trade selected"}),be},[e,o,c]),We=()=>{k&&(k.goal&&z(k.goal),k.reminders&&k.reminders.length>0&&W([...k.reminders]))},rt=()=>{K.trim()&&(W([...L,K.trim()]),q(""))},bt=se=>{W(L.filter((be,ve)=>ve!==se))},ut=se=>{ae(se),Ee(wL(se,30)),Te(null)},it=se=>{const be=wL(X,se);Ee(be),Te(null)},Wt=()=>{if(!X||!de){Te("Please select both start and end times.");return}if(X>=de){Te("End time must be after start time.");return}const se=`${X} - ${de}`;if(J.some(Oe=>Oe.segment===se)){Te("This time segment already exists.");return}const be={};H.forEach(Oe=>{be[Oe]="-"});const ve={segment:se,overall:"-",customValues:be,comments:""},Re=[...J,ve].sort((Oe,lt)=>{const er=Oe.segment.split(" - ")[0]||"",nn=lt.segment.split(" - ")[0]||"";return er.localeCompare(nn)});re(Re),gr(!1),Te(null)},cr=se=>{re(J.filter((be,ve)=>ve!==se))},Jt=(se,be,ve)=>{const Re=[...J];Re[se]={...Re[se],[be]:ve},re(Re)},pn=(se,be,ve)=>{const Re=[...J],Oe={...Re[se]};Oe.customValues={...Oe.customValues,[be]:ve},Re[se]=Oe,re(Re)},yr=()=>{if(!Yt.trim()||H.length>=3)return;const se=Yt.trim(),be=[...H,se];Y(be);const ve=J.map(Re=>({...Re,customValues:{...Re.customValues,[se]:"-"}}));re(ve),Qt("")},Q=se=>{const be=H.filter(Re=>Re!==se);Y(be);const ve=J.map(Re=>{const Oe={...Re.customValues};return delete Oe[se],{...Re,customValues:Oe}});re(ve)},ie=(se,be)=>{const ve=[...ge];ve[se]=be,le(ve)},ue=se=>{const be=ge[se]?.trim(),ve=H[se];if(!be){const lt=[...ge];lt[se]=ve,le(lt);return}if(be===ve)return;if(H.includes(be)){Ft.error("Column name must be unique.");const lt=[...ge];lt[se]=ve,le(lt);return}const Re=[...H];Re[se]=be,Y(Re);const Oe=J.map(lt=>{const er={...lt.customValues};return ve in er?(er[be]=er[ve],delete er[ve]):er[be]="-",{...lt,customValues:er}});re(Oe)},je=async()=>{if(!N){Ft.error("A Final Day Grade is required to save. Taking you to the grading step."),T(5);return}await r({grade:N,notes:M.trim()||null,sleepQuality:R,sleepHours:B,energyLevel:V,goal:U.trim()||null,reminders:L,segments:{customColumns:H,items:J},learned:Qe.trim()||null,changes:jt.trim()||null,overview:Vr.trim()||null,easiestMoneyTradeId:$r==="none"?null:$r,easiestMoneyNotes:Ni.trim()||null}),d(!1)},Ue=()=>{T(se=>Math.min(se+1,5))},Xe=()=>{T(se=>Math.max(se-1,1))},mt=()=>{T(1),d(!0)};if(_)return l.jsxs("div",{className:"relative min-h-[400px] bg-app-card/60 backdrop-blur-md rounded-2xl border border-app-border-color p-6 shadow-xl overflow-hidden flex flex-col justify-between",children:[l.jsxs("div",{className:"opacity-15 pointer-events-none filter blur-xs w-full space-y-6 select-none",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-app-border-color-soft pb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-app-button-bg text-app-text-accent rounded-xl",children:l.jsx(eb,{size:20})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold uppercase tracking-wider text-app-primary-foreground/70",children:"Daily Study Card"}),l.jsx("p",{className:"text-xs text-app-primary-foreground/50",children:"Performance Review & Lessons Learned"})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right",children:[l.jsx("span",{className:"text-xs text-app-primary-foreground/50 uppercase block",children:"Result"}),l.jsx("span",{className:"text-sm font-semibold text-app-positive-color",children:"+$350.00"})]}),l.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-xl font-extrabold text-xl border shrink-0 bg-emerald-500/10 text-emerald-400 border-emerald-500/30",children:"A"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-text-accent flex items-center gap-1.5",children:[l.jsx(zl,{size:14})," ","Goal"]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"h-4 bg-app-primary-foreground
4478/10 rounded w-11/12"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-2/3"})]})]}),l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-text-accent flex items-center gap-1.5",children:[l.jsx(N2,{size:14})," ","Reminders / Aphorisms"]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-full"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-4/5"})]})]})]}),l.jsxs("div",{className:"bg-app-button-bg/15 border border-app-border-color-soft rounded-xl p-4 space-y-3",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/80 flex items-center gap-1.5",children:[l.jsx(Is,{size:14})," ","Execution Quality by Timeblocks"]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-app-border-color-soft/50",children:[l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-24"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-12"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-12"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-1/3"})]}),l.jsxs("div",{className:"flex justify-between items-center py-2",children:[l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-24"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-12"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-12"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-1/3"})]})]})]}),l.jsxs("div",{className:"bg-gradient-to-r from-emerald-500/5 to-teal-500/5 border border-emerald-500/20 rounded-xl p-5 space-y-3",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-400 flex items-center gap-1.5",children:[l.jsx(Kc,{size:14})," ","Easiest Money Trade Spotlight"]}),l.jsxs("div",{className:"flex justify-between items-center bg-app-card/80 border border-app-border-color-soft p-4 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-app-button-bg border border-app-border-color h-8 w-16"}),l.jsx("div",{className:"h-4 bg-app-primary-foreground/10 rounded w-32"})]}),l.jsx("div",{className:"h-6 bg-app-primary-foreground/10 rounded w-20"})]})]})]}),y&&l.jsx(eN,{plan:y,className:"backdrop-blur-xs bg-transparent rounded-xl"})]});if(!u){if(!t)return l.jsxs("div",{className:"relative group overflow-hidden bg-gradient-to-br from-app-card/80 to-app-card/40 backdrop-blur-md rounded-2xl border border-app-border-color p-8 text-center space-y-6 shadow-2xl transition-all duration-300 hover:border-app-border-color-accent/50",children:[l.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10 group-hover:opacity-20 transition-opacity duration-500",children:l.jsx(Kc,{className:"size-32 text-app-text-accent"})}),l.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[l.jsx("div",{className:"inline-flex p-3 rounded-full bg-app-button-bg text-app-text-accent animate-pulse",children:l.jsx(sf,{size:32})}),l.jsx("h3",{className:"text-xl font-bold text-app-primary-foreground tracking-tight",children:"Unlock Daily Study Card"}),l.jsx("p",{className:"text-sm text-app-primary-foreground/70 leading-relaxed",children:"Recapping your trading day builds emotional discipline and identifies clean setups. Run a guided review to grade execution segments, tag your easiest money trade, and lock in daily lessons."}),l.jsx(ye,{variant:"default",onClick:mt,className:"mt-2 w-full sm:w-auto px-6 py-2.5 font-semibold bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-500 hover:to-indigo-500 shadow-lg shadow-violet-500/25 border-none transition-all duration-300 hover:scale-105 active:scale-95",children:"Start Guided Recap Session"})]})]});const se=xL[t.grade||"C"],be=YCt[t.grade||"C"],ve=t.segments,Re=ve?.customColumns||[],Oe=ve?.items||[];return l.jsxs("div",{className:Pe("bg-app-card/60 backdrop-blur-md rounded-2xl border border-app-border-color p-6 shadow-xl relative overflow-hidden transition-all duration-300",be,Se?"":"space-y-6"),children:[l.jsxs("div",{className:Pe("flex flex-col sm:flex-row sm:items-center justify-between gap-4",Se?"":"border-b border-app-border-color-soft pb-4"),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-app-button-bg text-app-text-accent rounded-xl",children:l.jsx(eb,{size:20})}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold uppercase tracking-wider text-app-primary-foreground
4478/70",children:"Daily Study Card"}),l.jsx("p",{className:"text-xs text-app-primary-foreground/50",children:"Performance Review & Lessons Learned"})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right",children:[l.jsx("span",{className:"text-xs text-app-primary-foreground/50 uppercase block",children:"Result"}),l.jsx("span",{className:Pe("text-sm font-semibold",Nn.pnl>=0?"text-app-positive-color":"text-app-negative-color"),children:c==="r"?fn(Nn.rMultiple):Ke(Nn.pnl)})]}),l.jsx("div",{className:Pe("flex items-center justify-center w-12 h-12 rounded-xl font-extrabold text-xl border shrink-0",se),children:t.grade}),l.jsx(ye,{variant:"secondary",size:"sm",onClick:()=>d(!0),className:"px-3",children:"Edit Card"}),l.jsx(ye,{variant:"secondary",size:"sm",onClick:()=>Ce(!Se),className:"px-2.5",title:Se?"Expand Study Card":"Collapse Study Card",children:Se?l.jsx(Eu,{size:16}):l.jsx(J4,{size:16})})]})]}),!Se&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-text-accent flex items-center gap-1.5",children:[l.jsx(zl,{size:14})," ","Goal"]}),l.jsx("p",{className:"text-sm text-app-primary-foreground/80 leading-relaxed whitespace-pre-wrap",children:t.goal||"No goal logged for today."})]}),l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-text-accent flex items-center gap-1.5",children:[l.jsx(N2,{size:14})," ","Reminders / Aphorisms to Myself"]}),t.reminders&&t.reminders.length>0?l.jsx("ul",{className:"space-y-1.5",children:t.reminders.map((lt,er)=>l.jsxs("li",{className:"text-sm text-app-primary-foreground/80 flex items-start gap-2",children:[l.jsx("span",{className:"text-app-text-accent font-bold mt-0.5",children:"•"}),l.jsx("span",{children:lt})]},er))}):l.jsx("p",{className:"text-sm text-app-primary-foreground/50 italic",children:"No reminders logged for today."})]})]}),Oe.length>0&&l.jsxs("div",{className:"bg-app-button-bg/15 border border-app-border-color-soft rounded-xl p-4 space-y-3",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/80 flex items-center gap-1.5",children:[l.jsx(Is,{size:14})," ","Execution Quality by Timeblocks"]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-left text-sm border-collapse",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-app-border-color-soft text-app-primary-foreground/60 text-xs uppercase font-medium",children:[l.jsx("th",{className:"py-2 pr-4 font-semibold",children:"Segment"}),l.jsx("th",{className:"py-2 px-4 text-center font-semibold",children:"Overall"}),Re.map(lt=>l.jsx("th",{className:"py-2 px-4 text-center font-semibold",children:lt},lt)),l.jsx("th",{className:"py-2 pl-4 font-semibold",children:"Comments"})]})}),l.jsx("tbody",{className:"divide-y divide-app-border-color-soft/50 text-app-primary-foreground/85",children:Oe.map((lt,er)=>l.jsxs("tr",{className:"hover:bg-app-button-bg/10 transition-colors",children:[l.jsx("td",{className:"py-2.5 pr-4 font-medium",children:lt.segment}),l.jsx("td",{className:"py-2.5 px-4 text-center",children:l.jsx("span",{className:Pe("px-2 py-0.5 rounded text-xs font-semibold border",lt.overall!=="-"?xL[lt.overall||"C"]:"text-app-primary-foreground/40 border-transparent"),children:lt.overall})}),Re.map(nn=>{const Pn=lt.customValues?.[nn]||"-";return l.jsx("td",{className:"py-2.5 px-4 text-center",children:l.jsx("span",{className:Pe("px-2 py-0.5 rounded text-xs font-semibold border",Pn!=="-"?xL[Pn]:"text-app-primary-foreground/40 border-transparent"),children:Pn})},nn)}),l.jsx("td",{className:"py-2.5 pl-4 text-xs text-app-primary-foreground/70 max-w-xs truncate",title:lt.comments,children:lt.comments||"-"})]},er))})]})})]}),t.easiestMoneyTradeId&&or&&l.jsxs("div",{className:"bg-gradient-to-r from-emerald-500/5 to-teal-500/5 border border-emerald-500/20 rounded-xl p-5 space-y-3",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-400 flex items-center gap-1.5",children:[l.jsx(Kc,{size:14})," ","Easiest Money Trade Spotlight"]}),l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-app-card/80 border border-app-border-color-soft p-4 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-app-button-bg border border-app-border-color font-mono font-bold text-sm",children:or.symbol}),l.jsxs("div",{children:[l.jsx("span",{className:Pe("text-xs px-2 py-0.5 rounded font-semibold",or.positionType==="SHORT"?"bg-app-negative-color-bg/40 text-app-negative-color":"bg-app-positive-color-bg/40 text-app-positive-color"),children:or.positionType}
4478),l.jsxs("div",{className:"text-xs text-app-primary-foreground/60 mt-1",children:["Entry:"," ",Ke(or.entryPrice)," ","• Exit:"," ",Ke(or.exitPrice)]})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right",children:[l.jsx("span",{className:"text-xs text-app-primary-foreground/50 uppercase block",children:"PnL"}),l.jsx("span",{className:Pe("text-sm font-bold",xt>=0?"text-app-positive-color":"text-app-negative-color"),children:c==="r"&&or.risk&&or.risk>0?fn(xt/or.risk):Ke(xt)})]}),l.jsx(At,{to:`/app/trades/${or.id}`,className:"p-1.5 rounded bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active transition-colors text-app-primary-foreground/80 hover:text-white",children:l.jsx(Cs,{size:14})})]})]}),t.easiestMoneyNotes&&l.jsxs("div",{className:"bg-app-card/30 rounded p-3 text-sm border border-app-border-color/30",children:[l.jsx("div",{className:"text-xs text-app-primary-foreground/50 mb-1 font-semibold uppercase",children:"Why this was the easiest money:"}),l.jsx("p",{className:"text-app-primary-foreground/90 whitespace-pre-wrap leading-relaxed",children:t.easiestMoneyNotes})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-teal-400 flex items-center gap-1.5",children:[l.jsx(sf,{size:14})," ","What I Learned / Improved Upon Today"]}),l.jsx("p",{className:"text-sm text-app-primary-foreground/80 leading-relaxed whitespace-pre-wrap",children:t.learned||"No notes logged."})]}),l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-rose-400 flex items-center gap-1.5",children:[l.jsx(T$,{size:14})," ","Changes I Need to Make From Today"]}),l.jsx("p",{className:"text-sm text-app-primary-foreground/80 leading-relaxed whitespace-pre-wrap",children:t.changes||"No changes logged."})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 pt-2",children:[l.jsxs("div",{className:"md:col-span-2 bg-app-button-bg/20 border border-app-border-color-soft rounded-xl p-4 space-y-2",children:[l.jsxs("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 flex items-center gap-1.5",children:[l.jsx(tb,{size:14})," ","Daily Overview"]}),l.jsx("p",{className:"text-sm text-app-primary-foreground/85 leading-relaxed whitespace-pre-wrap",children:t.overview||"No daily summary overview logged."})]}),l.jsxs("div",{className:"bg-app-button-bg/25 border border-app-border-color-soft rounded-xl p-4 space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/80",children:"Physical State"}),l.jsx("button",{type:"button",onClick:()=>It(!0),className:"text-app-primary-foreground/50 hover:text-white transition-colors",title:"Configure physical state metrics",children:l.jsx(fl,{size:14})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex justify-between text-xs text-app-primary-foreground/60",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[P.createElement(mo(m.sleep_quality?.icon,"Moon"),{size:12,className:"text-emerald-400"})," ",m.sleep_quality?.name||"Sleep Quality"]}),l.jsxs("span",{children:[t.sleepQuality||0,"/5"]})]}),l.jsx("div",{className:"w-full bg-app-button-bg h-1.5 rounded-full overflow-hidden",children:l.jsx("div",{className:"bg-emerald-500 h-full rounded-full transition-all duration-500",style:{width:`${(t.sleepQuality||0)*20}%`}})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex justify-between text-xs text-app-primary-foreground/60",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[P.createElement(mo(m.energy_level?.icon,"Zap"),{size:12,className:"text-yellow-400"})," ",m.energy_level?.name||"Energy Level"]}),l.jsxs("span",{children:[t.energyLevel||0,"/5"]})]}),l.jsx("div",{className:"w-full bg-app-button-bg h-1.5 rounded-full overflow-hidden",children:l.jsx("div",{className:"bg-yellow-500 h-full rounded-full transition-all duration-500",style:{width:`${(t.energyLevel||0)*20}%`}})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex justify-between text-xs text-app-primary-foreground
4478/60",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[P.createElement(mo(m.sleep_hours?.icon,"Clock"),{size:12,className:"text-blue-400"})," ",m.sleep_hours?.name||"Sleep Hours"]}),l.jsx("span",{children:t.sleepHours?`${t.sleepHours}h`:"N/A"})]}),l.jsx("div",{className:"w-full bg-app-button-bg h-1.5 rounded-full overflow-hidden",children:l.jsx("div",{className:"bg-blue-500 h-full rounded-full transition-all duration-500",style:{width:`${Math.min((Number(t.sleepHours)||0)/10*100,100)}%`}})})]})]})]}),t.notes&&l.jsxs("div",{className:"text-xs text-app-primary-foreground/50 border-t border-app-border-color-soft/50 pt-4",children:[l.jsx("span",{className:"font-semibold uppercase tracking-wider block mb-1",children:"Additional Notes"}),l.jsx("p",{className:"whitespace-pre-wrap",children:t.notes})]})]})]})}return l.jsxs("div",{className:"bg-app-card/75 backdrop-blur-md rounded-2xl border border-app-border-color p-6 space-y-6 shadow-2xl relative overflow-hidden transition-all duration-300",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 border-b border-app-border-color-soft pb-4",children:[l.jsxs("div",{children:[l.jsxs("h4",{className:"text-sm font-bold uppercase tracking-wider text-app-text-accent flex items-center gap-1.5",children:[l.jsx(Kc,{size:16})," ","Guided Review Session"]}),l.jsxs("p",{className:"text-xs text-app-primary-foreground/50",children:["Step"," ",E," ","of 5 —"," ",E===1?"Goals & Mindset":E===2?"Execution Segments":E===3?"Lessons Learned":E===4?"Easiest Money Trade":"Day Grade & Save"]})]}),l.jsx("div",{className:"flex items-center gap-2",children:[1,2,3,4,5].map(se=>l.jsx("button",{type:"button",onClick:()=>T(se),className:Pe("h-2 rounded-full transition-all duration-300",E===se?"w-8 bg-app-text-accent":"w-2 bg-app-button-bg border border-app-border-color hover:bg-app-border-color"),title:`Go to Step ${se}`},se))})]}),l.jsxs("div",{className:"min-h-[300px] flex flex-col justify-between",children:[l.jsx(Ss,{mode:"wait",children:l.jsxs(ct.div,{initial:{opacity:0,x:15},animate:{opacity:1,x:0},exit:{opacity:0,x:-15},transition:{duration:.2},className:"space-y-5",children:[E===1&&l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[k&&(k.goal||k.reminders&&k.reminders.length>0)&&l.jsxs("div",{className:"md:col-span-2 bg-emerald-500/5 border border-emerald-500/20 rounded-xl p-4 space-y-3",children:[l.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-2",children:[l.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-emerald-400 flex items-center gap-1.5",children:[l.jsx(Is,{size:14}),"From Last Recap Session (",k.tradeDay,")"]}),l.jsxs(ye,{type:"button",variant:"secondary",size:"sm",onClick:We,className:"text-xs py-1 px-2.5 h-auto flex items-center gap-1 bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active",children:[l.jsx(coe,{size:12}),"Copy to Today"]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[k.goal&&l.jsxs("div",{className:"text-xs text-app-primary-foreground/75 leading-relaxed bg-app-card/40 p-3 rounded-lg border border-app-border-color-soft",children:[l.jsx("span",{className:"font-semibold block mb-1 uppercase tracking-wide text-app-primary-foreground/50 text-[10px]",children:"Prior Goal:"}),l.jsx("p",{className:"whitespace-pre-wrap",children:k.goal})]}),k.reminders&&k.reminders.length>0&&l.jsxs("div",{className:"text-xs text-app-primary-foreground/75 leading-relaxed bg-app-card/40 p-3 rounded-lg border border-app-border-color-soft",children:[l.jsx("span",{className:"font-semibold block mb-1 uppercase tracking-wide text-app-primary-foreground/50 text-[10px]",children:"Prior Reminders:"}),l.jsx("ul",{className:"list-disc list-inside space-y-1",children:k.reminders.map((se,be)=>l.jsx("li",{children:se},be))})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 mb-2 block flex items-center gap-1",children:[l.jsx(zl,{size:12,className:"text-app-text-accent"})," ","What was your primary Goal today?"]}),l.jsx("textarea",{value:U,onChange:se=>z(se.target.value),placeholder:"e.g. Only take A quality setups, stay patient, don't chase FOMO...",className:"w-full p-3 bg-app-button-bg border border-app-border-color roun
4478ded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-24"})]}),l.jsxs("div",{className:"bg-app-button-bg/30 border border-app-border-color-soft p-4 rounded-xl space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/80",children:"Physical State Rating"}),l.jsx("button",{type:"button",onClick:()=>It(!0),className:"text-app-primary-foreground/50 hover:text-white transition-colors",title:"Configure physical state metrics",children:l.jsx(fl,{size:14})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs text-app-primary-foreground/70",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[P.createElement(mo(m.sleep_quality?.icon,"Moon"),{size:12,className:"text-emerald-400"})," ",m.sleep_quality?.name||"Sleep Quality"]}),l.jsxs("span",{className:"font-bold",children:[R,"/5"]})]}),l.jsx("input",{type:"range",min:"1",max:"5",value:R,onChange:se=>I(Number(se.target.value)),className:"w-full h-1.5 bg-gray-800 rounded-lg appearance-none cursor-pointer accent-emerald-500"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs text-app-primary-foreground/70",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[P.createElement(mo(m.energy_level?.icon,"Zap"),{size:12,className:"text-yellow-400"})," ",m.energy_level?.name||"Energy Level"]}),l.jsxs("span",{className:"font-bold",children:[V,"/5"]})]}),l.jsx("input",{type:"range",min:"1",max:"5",value:V,onChange:se=>$(Number(se.target.value)),className:"w-full h-1.5 bg-gray-800 rounded-lg appearance-none cursor-pointer accent-emerald-500"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs text-app-primary-foreground/70 block flex items-center gap-1",children:[P.createElement(mo(m.sleep_hours?.icon,"Clock"),{size:12,className:"text-blue-400"})," ",m.sleep_hours?.name||"Sleep Hours"]}),l.jsx("input",{type:"number",min:"0",max:"24",step:"0.5",value:B,onChange:se=>F(Number(se.target.value)),className:"w-full bg-app-button-bg border border-app-border-color rounded-lg p-2 text-sm text-app-primary-foreground focus:ring-1 focus:ring-emerald-500 focus:outline-hidden"})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 mb-2 block flex items-center gap-1",children:[l.jsx(N2,{size:12,className:"text-app-text-accent"})," ","Reminders / Aphorisms to Yourself"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:K,onChange:se=>q(se.target.value),onKeyDown:se=>se.key==="Enter"&&rt(),placeholder:"Add a discipline rule or reminder...",className:"flex-1 bg-app-button-bg border border-app-border-color rounded-xl p-2.5 text-sm text-app-primary-foreground focus:outline-hidden focus:border-app-border-color-accent"}),l.jsx(ye,{type:"button",onClick:rt,className:"px-3 bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active",children:l.jsx(k$,{size:16})})]})]}),l.jsx("div",{className:"bg-app-button-bg/15 border border-app-border-color-soft rounded-xl p-4 max-h-56 overflow-y-auto space-y-2 custom-scrollbar",children:L.length===0?l.jsx("p",{className:"text-xs text-app-primary-foreground/50 italic text-center py-6",children:"No reminders added yet. Add critical trading notes above."}):L.map((se,be)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 bg-app-card/50 p-2 rounded-lg border border-app-border-color-soft/50 text-sm",children:[l.jsx("span",{className:"text-app-primary-foreground/90 flex-1 leading-normal",children:se}),l.jsx("button",{type:"button",onClick:()=>bt(be),className:"text-app-primary-foreground/50 hover:text-rose-400 p-1 rounded hover:bg-app-button-bg/30",children:l.jsx(hl,{size:14})})]},be))})]})]}),E===2&&l.jsxs("div",{className:"space-y-4 relative",children:[l.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-4 border-b border-app-border-color-soft pb-3",children:[l.jsxs("div",{children:[l.jsx("h5",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground
4478/80 flex items-center gap-2",children:"Rate Execution by Time Segment"}),l.jsx("p",{className:"text-xs text-app-primary-foreground/50",children:"Configure custom tracking columns and add blocks to grade segments."})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(ye,{type:"button",variant:"secondary",size:"sm",onClick:()=>oe(!me),className:"text-xs flex items-center gap-1 bg-app-button-bg border border-app-border-color",children:[l.jsx(fl,{size:14})," ",me?"Hide Settings":"Configure Columns"]}),l.jsxs(ye,{type:"button",variant:"default",size:"sm",onClick:()=>gr(!0),className:"text-xs flex items-center gap-1 bg-gradient-to-r from-violet-600 to-indigo-600",children:[l.jsx(k$,{size:14})," ","Add Block"]})]})]}),l.jsx(Ss,{children:me&&l.jsxs(ct.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"bg-app-button-bg/40 border border-app-border-color rounded-xl p-4 space-y-3 shadow-xl",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-app-text-accent",children:"Custom Tracking Columns (Max 3)"}),l.jsxs("span",{className:"text-xs text-app-primary-foreground/50",children:[H.length,"/3 columns configured"]})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:H.map((se,be)=>l.jsxs("div",{className:"flex items-center gap-1.5 bg-app-card/65 p-2 rounded-lg border border-app-border-color-soft",children:[l.jsx("input",{type:"text",value:ge[be]??"",onChange:ve=>ie(be,ve.target.value),onBlur:()=>ue(be),onKeyDown:ve=>{ve.key==="Enter"&&ve.currentTarget.blur()},className:"bg-transparent border-none outline-hidden text-xs font-semibold text-app-primary-foreground w-full",title:"Click to rename",placeholder:"Column Name"}),l.jsx("button",{type:"button",onClick:()=>Q(se),className:"text-app-primary-foreground/45 hover:text-rose-400 p-0.5 rounded",children:l.jsx(pi,{size:12})})]},be))}),H.length<3&&l.jsxs("div",{className:"flex gap-2 max-w-sm mt-1",children:[l.jsx("input",{type:"text",value:Yt,onChange:se=>Qt(se.target.value),onKeyDown:se=>se.key==="Enter"&&yr(),placeholder:"e.g. FOMO, Rules, Emotion...",className:"bg-app-button-bg border border-app-border-color rounded-lg px-2.5 py-1 text-xs text-app-primary-foreground w-full"}),l.jsx(ye,{type:"button",onClick:yr,size:"sm",className:"text-xs py-1",children:"Add"})]})]})}),l.jsx(Ss,{children:Qr&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs p-4",children:l.jsxs(ct.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-app-card border border-app-border-color rounded-2xl p-5 max-w-sm w-full shadow-2xl space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center border-b border-app-border-color-soft pb-2",children:[l.jsxs("h6",{className:"text-sm font-bold text-app-primary-foreground uppercase tracking-wider flex items-center gap-1.5",children:[l.jsx(Is,{size:14,className:"text-app-text-accent"})," ","Create Time Segment"]}),l.jsx("button",{type:"button",onClick:()=>gr(!1),className:"text-app-primary-foreground/50 hover:text-white",children:l.jsx(pi,{size:16})})]}),Me&&l.jsx("div",{className:"text-xs text-rose-400 bg-rose-500/10 border border-rose-500/35 p-2 rounded-lg",children:Me}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-xs font-semibold uppercase text-app-primary-foreground/70 block",children:"Start Time"}),l.jsx("input",{type:"time",value:X,onChange:se=>ut(se.target.value),className:"w-full bg-app-button-bg border border-app-border-color rounded-xl p-2 text-sm text-app-primary-foreground focus:outline-hidden focus:border-app-border-color-accent"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-xs font-semibold uppercase text-app-primary-foreground/70 block",children:"End Time"}),l.jsx("input",{type:"time",value:de,onChange:se=>{Ee(se.target.value),Te(null)},className:"w-full bg-app-button-bg border border-app-border-color roun
4478ded-xl p-2 text-sm text-app-primary-foreground focus:outline-hidden focus:border-app-border-color-accent"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("span",{className:"text-xs font-semibold uppercase text-app-primary-foreground/70 block",children:"Quick Duration Addition"}),l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[l.jsx(ye,{type:"button",variant:"secondary",onClick:()=>it(15),className:"text-xs py-2 bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active",children:"+15 Min"}),l.jsx(ye,{type:"button",variant:"secondary",onClick:()=>it(30),className:"text-xs py-2 bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active",children:"+30 Min"}),l.jsx(ye,{type:"button",variant:"secondary",onClick:()=>it(60),className:"text-xs py-2 bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active",children:"+1 Hour"})]})]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-app-border-color-soft pt-3",children:[l.jsx(ye,{type:"button",variant:"secondary",onClick:()=>gr(!1),className:"text-xs",children:"Cancel"}),l.jsx(ye,{type:"button",onClick:Wt,className:"text-xs bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-500 hover:to-indigo-500",children:"Create Block"})]})]})})}),l.jsx("div",{className:"overflow-x-auto border border-app-border-color rounded-xl",children:l.jsxs("table",{className:"w-full text-left text-sm border-collapse",children:[l.jsx("thead",{className:"bg-app-button-bg/30",children:l.jsxs("tr",{className:"border-b border-app-border-color text-app-primary-foreground/60 text-xs uppercase font-medium",children:[l.jsx("th",{className:"py-2.5 px-3",children:"Segment"}),l.jsx("th",{className:"py-2.5 px-3 text-center",children:"Overall"}),H.map(se=>l.jsx("th",{className:"py-2.5 px-3 text-center",children:se},se)),l.jsx("th",{className:"py-2.5 px-3",children:"Comments"}),l.jsx("th",{className:"py-2.5 px-3 text-center",children:"Remove"})]})}),l.jsx("tbody",{className:"divide-y divide-app-border-color-soft/50 bg-app-card/10",children:J.map((se,be)=>l.jsxs("tr",{className:"hover:bg-app-button-bg/10",children:[l.jsx("td",{className:"py-2 px-3 font-semibold text-xs whitespace-nowrap",children:se.segment}),l.jsx("td",{className:"py-2 px-3",children:l.jsxs("select",{value:se.overall,onChange:ve=>Jt(be,"overall",ve.target.value),className:"bg-app-button-bg border border-app-border-color rounded p-1 text-xs text-app-primary-foreground focus:outline-hidden font-bold w-12 mx-auto block",children:[l.jsx("option",{value:"-",children:"-"}),bL.map(ve=>l.jsx("option",{value:ve,children:ve},ve))]})}),H.map(ve=>{const Re=se.customValues?.[ve]||"-";return l.jsx("td",{className:"py-2 px-3",children:l.jsxs("select",{value:Re,onChange:Oe=>pn(be,ve,Oe.target.value),className:"bg-app-button-bg border border-app-border-color rounded p-1 text-xs text-app-primary-foreground focus:outline-hidden font-bold w-12 mx-auto block",children:[l.jsx("option",{value:"-",children:"-"}),bL.map(Oe=>l.jsx("option",{value:Oe,children:Oe},Oe))]})},ve)}),l.jsx("td",{className:"py-2 px-3",children:l.jsx("input",{type:"text",value:se.comments,onChange:ve=>Jt(be,"comments",ve.target.value),placeholder:"Write a brief comment...",className:"bg-app-button-bg border border-app-border-color rounded px-2 py-1 text-xs text-app-primary-foreground w-full focus:outline-hidden"})}),l.jsx("td",{className:"py-2 px-3 text-center",children:l.jsx("button",{type:"button",onClick:()=>cr(be),className:"text-app-primary-foreground/40 hover:text-rose-400 p-1 rounded",children:l.jsx(hl,{size:14})})})]},be))})]})})]}),E===3&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-teal-400 mb-2 block flex items-center gap-1",children:[l.jsx(sf,{size:12})," ","WHAT I LEARNED / IMPROVED UPON TODAY"]}),l.jsx("textarea",{value:Qe,onChange:se=>Nt(se.target.value),placeholder:"e.g. Reduce share size quickly when not connecting. Follow discipline rules strictly...",className:"w-full p-3 bg-app-button-bg border border-app-border-color roun
4478ded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-32"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-rose-400 mb-2 block flex items-center gap-1",children:[l.jsx(T$,{size:12})," ","CHANGES I NEED TO MAKE FROM TODAY"]}),l.jsx("textarea",{value:jt,onChange:se=>jr(se.target.value),placeholder:"e.g. Decrease sizing quickly on slow days, hold size on hot volume days...",className:"w-full p-3 bg-app-button-bg border border-app-border-color rounded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-32"})]})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 mb-2 block flex items-center gap-1",children:[l.jsx(tb,{size:12})," ","DAILY OVERVIEW SUMMARY"]}),l.jsx("textarea",{value:Vr,onChange:se=>Dr(se.target.value),placeholder:"e.g. Slow, choppy day in the market. Glad I extracted small profits and stayed patient...",className:"w-full p-3 bg-app-button-bg border border-app-border-color rounded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-24"})]})]}),E===4&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-400 mb-2 block flex items-center gap-1",children:[l.jsx(Kc,{size:12})," ",'Tag the "Easiest Money Trade" of the Day']}),Nn.hasTrades?l.jsx("div",{className:"max-w-md",children:l.jsx(Ep,{options:$e,value:$r||"n
4478one",onSelect:se=>Ur(se==="none"?null:String(se)),placeholder:"Choose a trade...",className:"w-full",width:"w-full"})}):l.jsx("div",{className:"text-sm text-app-primary-foreground/50 border border-dashed border-app-border-color rounded-xl p-6 text-center",children:"No trades recorded for this day. You can skip this step."})]}),$r&&or&&l.jsxs("div",{className:"bg-app-button-bg/25 border border-emerald-500/20 rounded-xl p-4 space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-app-card/80 border border-app-border-color-soft p-4 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-app-button-bg border border-app-border-color font-mono font-bold text-sm",children:or.symbol}),l.jsxs("div",{children:[l.jsx("span",{className:Pe("text-xs px-2 py-0.5 rounded font-semibold",or.positionType==="SHORT"?"bg-app-negative-color-bg/40 text-app-negative-color":"bg-app-positive-color-bg/40 text-app-positive-color"),children:or.positionType}),l.jsxs("div",{className:"text-xs text-app-primary-foreground/60 mt-1",children:["Entry:"," ",Ke(or.entryPrice)," ","• Exit:"," ",Ke(or.exitPrice)]})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right",children:[l.jsx("span",{className:"text-xs text-app-primary-foreground/50 uppercase block",children:"PnL"}),l.jsx("span",{className:Pe("text-sm font-bold",xt>=0?"text-app-positive-color":"text-app-negative-color"),children:c==="r"&&or.risk&&or.risk>0?fn(xt/or.risk):Ke(xt)})]}),l.jsx(At,{to:`/app/trades/${or.id}`,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded bg-app-button-bg border border-app-border-color hover:bg-app-button-bg-active transition-colors text-app-primary-foreground/80 hover:text-white",title:"View Trade Details (Opens in new tab)",children:l.jsx(Cs,{size:14})})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-app-primary-foreground/70 mb-1.5 block",children:"Why was this setup the easiest or cleanest trade today?"}),l.jsx("textarea",{value:Ni,onChange:se=>zi(se.target.value),placeholder:"e.g. Overshoot of whole dollar, close to 9 EMA. Stock had agenda to pump, low risk entry...",className:"w-full p-3 bg-app-button-bg border border-app-border-color rounded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-28"})]})]})]}),E===5&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 block",children:"Assign Final Day Grade"}),l.jsx("div",{className:"flex gap-2",children:bL.map(se=>{const be=N===se;let ve="";return se==="A"&&(ve=be?"bg-emerald-500 text-white ring-2 ring-emerald-500/50":"bg-app-button-bg text-emerald-400 hover:bg-emerald-500/10"),se==="B"&&(ve=be?"bg-blue-500 text-white ring-2 ring-blue-500/50":"bg-app-button-bg text-blue-400 hover:bg-blue-500/10"),se==="C"&&(ve=be?"bg-amber-500 text-white ring-2 ring-amber-500/50":"bg-app-button-bg text-amber-400 hover:bg-amber-500/10"),se==="D"&&(ve=be?"bg-orange-500 text-white ring-2 ring-orange-500/50":"bg-app-button-bg text-orange-400 hover:bg-orange-500/10"),se==="F"&&(ve=be?"bg-rose-500 text-white ring-2 ring-rose-500/50":"bg-app-button-bg text-rose-400 hover:bg-rose-500/10"),l.jsx("button",{type:"button",onClick:()=>j(se),className:Pe("flex-1 py-3.5 rounded-xl font-black transition-all duration-300 hover:scale-105 active:scale-95 text-center border border-app-border-color",ve),children:se},se)})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-app-primary-foreground/70 mb-2 block",children:"Overall Recap Notes (optional)"}),l.jsx("textarea",{value:M,onChange:se=>O(se.target.value),placeholder:"Add final closing thoughts about your trading behavior today...",className:"w-full p-3 bg-app-button-bg border border-app-border-color roun
4478ded-xl text-sm text-app-primary-foreground resize-none focus:outline-hidden focus:border-app-border-color-accent h-24"})]})]})})]},E)}),l.jsxs("div",{className:"flex justify-between items-center border-t border-app-border-color-soft pt-4 mt-6",children:[l.jsxs("div",{className:"flex gap-2",children:[i&&t&&l.jsxs(ye,{variant:"destructive",size:"sm",onClick:i,disabled:a,className:"flex items-center gap-1.5",children:[l.jsx(hl,{size:14})," ","Delete"]}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:n,disabled:s,children:"Cancel"})]}),l.jsxs("div",{className:"flex gap-2",children:[E>1&&l.jsxs(ye,{variant:"secondary",size:"sm",onClick:Xe,className:"flex items-center gap-1",children:[l.jsx(up,{size:16})," ","Back"]}),E<5&&l.jsxs(ye,{variant:"default",size:"sm",onClick:Ue,className:"flex items-center gap-1",children:["Next"," ",l.jsx(Sf,{size:16})]}),l.jsxs(ye,{variant:"default",size:"sm",onClick:je,disabled:s,className:"flex items-center gap-1.5 bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500",children:[l.jsx(moe,{size:14})," ",s?"Saving...":"Save Recap"]})]})]})]}),l.jsx(Het,{isOpen:De,onClose:()=>It(!1)})]})},KCt=({trades:t,mode:e,currency:r="usd",tradeCount:n="show"})=>{const i=b.useMemo(()=>CCt(t,e,r),[t,e,r]),s=b.useMemo(()=>MCt(t,e,r),[t,e,r]);return l.jsxs("div",{className:"bg-app-card/70 rounded-2xl p-6",children:[l.jsxs("h4",{className:"text-sm uppercase tracking-wider mb-4 flex items-center gap-2 text-app-primary-foreground/80",children:["Trades",n!=="hide"&&l.jsxs("span",{className:"text-xs text-app-primary-foreground/70",children:["(",i.length,")"]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full",children:[l.jsx("thead",{className:"bg-app-input-bg",children:l.jsxs("tr",{children:[l.jsx(Rn,{compact:!0,rounded:"left",borders:"left",children:"Time"}),l.jsx(Rn,{compact:!0,children:"Symbol"}),l.jsx(Rn,{compact:!0,children:"Side"}),l.jsx(Rn,{compact:!0,children:"Volume"}),l.jsx(Rn,{compact:!0,children:"Entry Price"}),l.jsx(Rn,{compact:!0,children:"Exit Price"}),l.jsx(Rn,{compact:!0,children:"Comm/Fees"}),l.jsx(Rn,{compact:!0,children:"Risk"}),l.jsx(Rn,{compact:!0,children:"PnL"}),l.jsx(Rn,{compact:!0,rounded:"right",borders:"right",children:"Actions"})]})}),l.jsxs("tbody",{className:"divide-y divide-app-border-color-soft",children:[i.map(a=>l.jsxs("tr",{className:"hover:bg-app-input-bg/50",children:[l.jsx(Dn,{compact:!0,children:l.jsx($k,{icon:Is,children:a.time})}),l.jsx(Dn,{compact:!0,children:l.jsx(x6,{symbol:a.symbol})}),l.jsx(Dn,{compact:!0,children:l.jsx("span",{className:`px-2 py-1 rounded-lg text-xs border ${a.side==="SHORT"?"bg-app-negative-color-bg/70 text-app-negative-color border-app-negative-color/50":"bg-app-positive-color-bg/70 text-app-positive-color border-app-positive-color/50"}`,children:a.side||"-"})}),l.jsx(Dn,{compact:!0,children:l.jsx($k,{icon:_f,children:a.volume.toLocaleString()})}),l.jsx(Dn,{compact:!0,children:Ke(a.entryPrice)}),l.jsx(Dn,{compact:!0,children:Ke(a.exitPrice)}),l.jsx(Dn,{compact:!0,children:Ke(a.fees)}),l.jsx(Dn,{compact:!0,children:l.jsx($k,{icon:t3,children:a.risk&&a.risk>0?Ke(a.risk):l.jsx("span",{className:"text-app-primary-foreground/70",children:"N/A"})})}),l.jsx(Dn,{compact:!0,children:l.jsx("div",{className:"flex items-center gap-2",children:(()=>{const{icon:o,colorClass:c}=gE(a.pnl);return l.jsxs(l.Fragment,{children:[o&&l.jsx(o,{className:ee("size-4",c)}),l.jsx("span",{className:ee("text-sm",c),children:r==="r"?fn(a.pnl):Ke(a.pnl)})]})})()})}),l.jsx(Dn,{compact:!0,children:l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx(At,{to:`/app/trades/${a.id}`,className:"inline-flex items-center justify-center p-1 rounded-md hover:bg-app-input-bg/50 transition-colors pl-4",children:l.jsx(Cs,{className:"size-4 text-app-primary-foreground/70 hover:text-app-primary-foreground transition-colors"})})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs",children:"View trade details"})})]})})]},a.id)),l.jsxs("tr",{className:"border-t-2 border-app-border-color-soft",children:[l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground
4478/80 uppercase tracking-wider",children:"Total"}),l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80",children:"-"}),l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80",children:"-"}),l.jsx(On,{compact:!0,className:"text-sm text-app-primary-foreground/80",children:l.jsx(Xd,{icon:_f,label:"Total",value:s.totalVolume.toLocaleString()})}),l.jsx(On,{compact:!0,className:"text-sm text-app-primary-foreground/80",children:l.jsx(Xd,{label:"Avg",value:Ke(s.avgEntryPrice)})}),l.jsx(On,{compact:!0,className:"text-sm text-app-primary-foreground/80",children:l.jsx(Xd,{label:"Avg",value:Ke(s.avgExitPrice)})}),l.jsx(On,{compact:!0,className:"text-sm text-app-primary-foreground/80",children:l.jsx(Xd,{label:"Total",value:Ke(s.totalFees)})}),l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80",children:"-"}),l.jsx(On,{compact:!0,className:"text-sm text-app-primary-foreground/80",children:l.jsx("div",{className:"flex items-center gap-2",children:(()=>{const{icon:a,colorClass:o}=gE(s.totalPnL);return l.jsxs(l.Fragment,{children:[a&&l.jsx(a,{className:ee("size-4",o)}),l.jsx("span",{className:ee("text-sm",o),children:r==="r"?fn(s.totalPnL):Ke(s.totalPnL)})]})})()})}),l.jsx(On,{compact:!0,className:"text-xs text-app-primary-foreground/80",children:"-"})]})]})]})})]})},QCt=({date:t,message:e,backLink:r="/app/recap",backButtonText:n="Back to Recap"})=>{const i=t?`No trade details found for ${new Date(t).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}. This date may not have any trades, or the data may not be available.`:"No trade details found for the requested date. This date may not have any trades, or the data may not be available.";return l.jsxs("div",{className:"min-h-screen bg-app-primary flex flex-col items-center justify-center gap-4",children:[l.jsx(OPe,{className:"size-20 text-app-primary-foreground/80 mb-4"}),l.jsx("span",{className:"text-3xl font-semibold text-app-primary-foreground mb-2",children:"No details found"}),l.jsx("span",{className:"text-app-primary-foreground/70 text-base max-w-lg text-center",children:e||i}),l.jsx(ye,{variant:"outline",className:"mt-4 group hover:bg-app-card duration-300 transition-colors",asChild:!0,children:l.jsxs(At,{to:r,children:[l.jsx(Tu,{className:"size-4 mr-1 group-hover:-translate-x-0.5 transition-transform duration-300"}),n]})})]})},ZCt=({totals:t,currency:e="usd",tradeCount:r="show"})=>l.jsxs("div",{className:"flex flex-row flex-wrap justify-start items-center gap-8",children:[l.jsx(hg,{label:"Daily P&L",value:e==="r"?fn(t.selectedPnL):Ke(t.selectedPnL),icon:t.selectedPnL>=0?_s:Kl,colorClass:t.selectedPnL>=0?"text-green-400":"text-red-400"}),r!=="hide"&&l.jsxs(l.Fragment,{children:[l.jsx(tc,{orientation:"vertical",className:"h-8!"}
4478),l.jsx(hg,{label:"Winners",value:t.winners,icon:fk,colorClass:"text-app-primary-foreground"}),l.jsx(tc,{orientation:"vertical",className:"h-8!"}),l.jsx(hg,{label:"Losers",value:t.losers,icon:fk,colorClass:"text-app-primary-foreground"}),l.jsx(tc,{orientation:"vertical",className:"h-8!"}),l.jsx(hg,{label:"Scratch",value:t.scratch,icon:fk,colorClass:"text-app-primary-foreground"})]})]}),XCt=({trades:t,mode:e,currency:r="usd"})=>{const[n,i]=b.useState(1),[s,a]=b.useState(5),o=[{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:1.5,label:"1.5x"}],c=[{value:3,label:"3m"},{value:5,label:"5m"},{value:15,label:"15m"},{value:60,label:"1h"}],u=b.useMemo(()=>ybe(t,e,s,10,r),[t,e,s,r]);return u.length===0?l.jsx(_c,{title:"Intraday realized P&L",loadingText:"Loading intraday data..."}):l.jsxs("div",{className:"bg-app-card/70 rounded-2xl p-6 col-span-2",children:[l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center items-start justify-between mb-4 lg:gap-0 gap-4",children:[l.jsxs("h4",{className:"text-sm uppercase tracking-wider flex items-center gap-2 text-app-primary-foreground/80",children:["Intraday P&L",l.jsxs("span",{className:"text-xs text-app-primary-foreground/70",children:["(",u.length,")"]})]}),l.jsxs("div",{className:"flex flex-row flex-wrap items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs uppercase tracking-wider text-app-primary-foreground/70",children:"X-axis Scale"}),l.jsx(Ep,{options:c,value:s,onSelect:a,width:"w-16",minWidth:"min-w-16",dropdownClassName:"font-light",buttonClassName:"text-xs px-2 font-light"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs uppercase tracking-wider text-app-primary-foreground/70",children:"Y-axis Scale"}),l.jsx(Ep,{options:o,value:n,onSelect:i,width:"w-16",minWidth:"min-w-16",dropdownClassName:"font-light",buttonClassName:"text-xs px-2 font-light"})]})]})]}),l.jsx(gbe,{data:u,yAxisScale:n,compactYAxis:r!=="r",valueFormatter:r==="r"?d=>fn(d):void 0})]})},JCt=()=>l.jsxs("article",{className:"space-y-6 min-h-screen bg-app-primary mx-auto 
4478sm:pb-6 pb-8 pt-4",children:[l.jsxs("div",{className:"flex flex-row flex-wrap justify-start items-center gap-3",children:[l.jsx(Le,{className:"size-8 rounded-sm"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Le,{className:"h-6 w-32"}),l.jsx(Le,{className:"h-4 w-20"})]}),l.jsx("div",{className:"md:ml-auto",children:l.jsx(Le,{className:"h-8 w-40 rounded-sm"})})]}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-start items-center gap-8",children:[l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx(Le,{className:"h-3 w-16 mb-2"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-4 rounded-sm"}),l.jsx(Le,{className:"h-4 w-20"})]})]}),l.jsx("div",{className:"w-px h-8 bg-app-border-color-soft"}),l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx(Le,{className:"h-3 w-16 mb-2"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-4 rounded-sm"}),l.jsx(Le,{className:"h-4 w-6"})]})]}),l.jsx("div",{className:"w-px h-8 bg-app-border-color-soft"}),l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx(Le,{className:"h-3 w-16 mb-2"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-4 rounded-sm"}),l.jsx(Le,{className:"h-4 w-6"})]})]}),l.jsx("div",{className:"w-px h-8 bg-app-border-color-soft"}),l.jsxs("div",{className:"flex flex-col items-start justify-center",children:[l.jsx(Le,{className:"h-3 w-16 mb-2"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-4 rounded-sm"}),l.jsx(Le,{className:"h-4 w-6"})]})]})]}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx("div",{className:"bg-app-card/70 rounded-2xl p-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(Le,{className:"h-5 w-32"}),l.jsx("div",{className:"h-64 bg-app-card/30 rounded-xl border border-dashed border-app-border-color-soft p-4",children:l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsx("div",{className:"w-full h-48 relative",children:l.jsx("div",{className:"absolute inset-0",children:l.jsx(Le,{className:"h-px w-full",style:{clipPath:"polygon(0% 80%, 15% 60%, 30% 40%, 45% 30%, 60% 35%, 75% 50%, 90% 70%, 100% 85%)"}})})})})})]})}),l.jsx("div",{className:"bg-app-card/70 rounded-2xl p-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(Le,{className:"h-5 w-40"}),l.jsxs("div",{className:"grid grid-cols-5 gap-4 py-2 border-b border-app-border-color-soft",children:[l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-16"}),l.jsx(Le,{className:"h-4 w-20"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"})]}),Array.from({length:4}).map((t,e)=>l.jsxs("div",{className:"grid grid-cols-5 gap-4 py-2",children:[l.jsx(Le,{className:"h-4 w-8"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-3 rounded-sm"}),l.jsx(Le,{className:"h-4 w-16"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Le,{className:"size-3 rounded-sm"}),l.jsx(Le,{className:"h-4 w-6"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Le,{className:"size-3 rounded-sm"}),l.jsx(Le,{className:"h-4 w-8"})]})]},e))]})})]}),l.jsx("div",{className:"bg-app-card/70 rounded-2xl p-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(Le,{className:"h-5 w-32"}),l.jsxs("div",{className:"grid grid-cols-8 gap-4 py-3 border-b border-app-border-color-soft",children:[l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-16"}),l.jsx(Le,{className:"h-4 w-16"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"})]}),Array.from({length:8}).map((t,e)=>l.jsxs("div",{className:"grid grid-cols-8 gap-4 py-3",children:[l.jsx(Le,{className:"h-4 w-16"}),l.jsx(Le,{className:"h-4 w-8"}),l.jsx(Le,{className:"h-6 w-12 rounded-full"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Le,{className:"size-3 rounded-sm"}),l.jsx(Le,{className:"h-4 w-6"})]}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-4 w-12"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Le,{className:"size-3 rounded-sm"}),l.jsx(Le,{className:"h-4 w-16"})]})]},e))]})})]})]}),eEt=()=>{const{date:t}=G4(),{formattedDate:e,error:r}=ACt(t),n=Ws(),{viewSettings:i,updateViewSettings:s}
4478=o1("mt:recap:viewPrefs"),{existingGrade:a,editingGrade:o,setEditingGrade:c,handleSaveGrade:u,handleCancelGrade:d,handleDeleteGrade:f,upsertLoading:h,deleteLoading:m}=GCt(e||""),{allDailyGroups:y,isLoading:x}=bbe({dateRange:{start:e,end:e},page:1,perPage:10,mode:i.mode,currency:i.currency,fetchPolicy:"cache-and-network"}),v=y.length>0?y[0].trades:[],{currentPageItems:_,paginationInfo:S,page:k,perPage:E,setPage:T,setPerPage:N}=_be(v,{defaultPageSize:25,storageKey:"recap-details-trades-per-page"});if(r)return l.jsx(QCt,{date:t,backLink:"/app/recap",backButtonText:"Back to Recap"});const j=()=>{n(-1)};if(x)return l.jsx(JCt,{});if(!x&&y.length===0)return l.jsxs("article",{className:"space-y-6 min-h-screen bg-app-primary mx-auto sm:pb-6 pb-8 pt-4 overflow-hidden",children:[l.jsxs("div",{className:"flex flex-row flex-wrap justify-start items-center gap-3",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:j,className:"p-2 transition-all duration-300 hover:bg-app-button-bg group",children:l.jsx(Tu,{className:"size-4 transition-all duration-300 group-hover:-translate-x-0.5"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h3",{className:"text-xl text-app-primary-foreground",children:uw(e||"")}),i.tradeCount!=="hide"&&l.jsx("span",{className:"text-xs uppercase text-app-primary-foreground/70",children:"(0 trades)"})]})]}),l.jsx("div",{children:l.jsx(Tie,{existingGrade:a,trades:v,onSave:u,onCancel:d,onDelete:a?f:void 0,isSaving:h,isDeleting:m,mode:i.mode,currency:i.currency,editing:o,setEditing:c,tradeDay:e||""})}),l.jsxs("div",{className:"text-center text-gray-500 py-12 border border-dashed border-gray-800 rounded-xl bg-gray-900/30",children:[l.jsx("p",{children:"No trades recorded for this day."}),l.jsx("p",{className:"text-sm mt-1 text-gray-600",children:"You can still track your daily grade and physical state above."})]})]});const M=y[0];return l.jsxs("article",{className:"space-y-6 min-h-screen bg-app-primary mx-auto 
4478sm:pb-6 pb-8 pt-4 overflow-hidden",children:[l.jsxs("div",{className:"flex flex-row flex-wrap justify-start items-center gap-3",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:j,className:"p-2 transition-all duration-300 hover:bg-app-button-bg group",children:l.jsx(Tu,{className:"size-4 transition-all duration-300 group-hover:-translate-x-0.5"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h3",{className:"text-xl text-app-primary-foreground",children:uw(M.date)}),i.tradeCount!=="hide"&&l.jsxs("span",{className:"text-xs uppercase text-app-primary-foreground/70",children:["(",M.totals.tradeCount," ","trades)"]})]})]}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-center gap-4",children:[l.jsx(ZCt,{totals:M.totals,currency:i.currency,tradeCount:i.tradeCount}),l.jsx(a1,{mode:i.mode,currency:i.currency,tradeCount:i.tradeCount,setFilter:O=>s(()=>O),className:"md:ml-auto"})]}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx(XCt,{trades:v,mode:i.mode,currency:i.currency}),l.jsx(vbe,{trades:v,mode:i.mode,currency:i.currency,tradeCount:i.tradeCount,date:e})]}),l.jsx("div",{children:l.jsx(Tie,{existingGrade:a,trades:v,onSave:u,onCancel:d,onDelete:a?f:void 0,isSaving:h,isDeleting:m,mode:i.mode,currency:i.currency,editing:o,setEditing:c,tradeDay:e||""})}),l.jsx(KCt,{trades:_,mode:i.mode,currency:i.currency,tradeCount:i.tradeCount}),S.totalItems>0&&l.jsx(v6,{page:k,perPage:E,totalItems:S.totalItems,onPageChange:T,onPerPageChange:N})]})]})},yE=Wp(t=>({selectedExecutionsByTradeId:{},toggleExecution:(e,r)=>{t(n=>{const i=n.selectedExecutionsByTradeId[e]||[],a=i.some(o=>o.id===r.id)?i.filter(o=>o.id!==r.id):[...i,r];return{selectedExecutionsByTradeId:{...n.selectedExecutionsByTradeId,[e]:a}}})},selectAllExecutions:(e,r)=>{t(n=>({selectedExecutionsByTradeId:{...n.selectedExecutionsByTradeId,[e]:r}}))},clearSelection:e=>{t(r=>{if(!(e in r.selectedExecutionsByTradeId))return{};const n={...r.selectedExecutionsByTradeId};return delete n[e],{selectedExecutionsByTradeId:n}})}})),tEt=t=>yE(yl(e=>t?e.selectedExecutionsByTradeId[t]||[]:[])),rEt=t=>yE(yl(e=>(t?e.selectedExecutionsByTradeId[t]||[]:[]).map(n=>n.id))),HS={vwap:"#FF9F1C",ema9:"#FFFFFF",ema20:"#10B981",ema50:"#A855F7"},Sbe={vwap:{label:"VWAP",color:HS.vwap},ema9:{label:"9 EMA",color:HS.ema9},ema20:{label:"20 EMA",color:HS.ema20},ema50:{label:"50 EMA",color:HS.ema50}},nEt=t=>{if(t.length===0)return[];const e=[];let r=0,n=0;for(const i of t){const s=(i.high+i.low+i.close)/3;r+=s*i.volume,n+=i.volume;const a=n>0?r/n:s;e.push({time:i.time,value:a})}return e},_L=(t,e)=>{if(t.length<e)return[];const r=[],n=2/(e+1);let i=0;for(let a=0;a<e;a++)i+=t[a].close;let s=i/e;r.push({time:t[e-1].time,value:s});for(let a=e;a<t.length;a++)s=(t[a].close-s)*n+s,r.push({time:t[a].time,value:s});return r},iEt=4,sEt=0,aEt=9,oEt=30,lEt=16,cEt=0,uEt=20,dEt=0,qS=(t,e,r)=>{const n=t.toLocaleDateString("en-CA",{timeZone:"America/New_York"}),i=`${n}T${e.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:00`,s=new Intl.DateTimeFormat("en-US",{timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),a=new Date(`${n}T12:00:00Z`),o=s.formatToParts(a),u=Number(o.find(f=>f.type==="hour")?.value??"12")-12,d=new Date(i+"Z");return d.setHours(d.getHours()-u),d},kbe=t=>{const e=new Date(t);return{premarketStart:Math.floor(qS(e,iEt,sEt).getTime()/1e3),marketOpen:Math.floor(qS(e,aEt,oEt).getTime()/1e3),marketClose:Math.floor(qS(e,lEt,cEt).getTime()/1e3),postmarketEnd:Math.floor(qS(e,uEt,dEt).getTime()/1e3)}},fEt=(t,e)=>t<e.marketOpen?"premarket":t>=e.marketClose?"postmarket":"regular",hEt=t=>{const e=kbe(t);return{start:e.premarketStart,end:e.postmarketEnd}},Fv=new Map,pEt=t=>{const r=new Date(t*1e3).toLocaleDateString("en-CA",{timeZone:"America/New_York"});let n=Fv.get(r);if(!n&&(n=kbe(`${r}T12:00:00Z`),Fv.set(r,n),Fv.size>30)){const i=Fv.keys().next().value;i&&Fv.delete(i)}return fEt(t,n)},Cie={colors:ps},mEt=(t,e,r)=>sge(t,{layout:{background:{type:Eb.Solid,color:ps.background},textColor:ps.text},grid:{vertLines:{color:ps.grid},horzLines:{color:ps.grid}}
4478,crosshair:{mode:a5.Normal,horzLine:{labelBackgroundColor:"#291E5F"},vertLine:{labelBackgroundColor:"#291E5F"}},rightPriceScale:{borderColor:ps.border},timeScale:{borderColor:ps.border,timeVisible:!0,allowBoldLabels:!1,tickMarkFormatter:rZ},localization:{timeFormatter:rZ,priceFormatter:fge},width:e,height:r}),gEt=t=>t.addSeries(Yit,{upColor:ps.candleUp,downColor:ps.candleDown,borderVisible:!1,wickUpColor:ps.candleUp,wickDownColor:ps.candleDown}),yEt=(t,e,r=1)=>t.addSeries(Fit,{color:e,lineWidth:r,lineStyle:s5.Solid,lastValueVisible:!1,crosshairMarkerVisible:!0,priceLineVisible:!1}),vEt=t=>t.addSeries(Zit,{priceFormat:{type:"volume"},priceScaleId:"volume",lastValueVisible:!1,priceLineVisible:!1}),xEt=t=>{t.priceScale("volume").applyOptions({scaleMargins:{top:.8,bottom:0},borderVisible:!1,visible:!1})},bEt=({x:t,y:e,size:r,fill:n,stroke:i,direction:s,id:a})=>{const o=(d,f,h,m)=>{const y=h/2,x=h/4,v=Math.min(h*.3,3);switch(m){case"up":return`M ${d} ${f-y} 
4479                L ${d+y} ${f+x-v} 
4480                Q ${d+y} ${f+x} ${d+y-v} ${f+x}
4481                L ${d-y+v} ${f+x}
4482                Q ${d-y} ${f+x} ${d-y} ${f+x-v}
4483                Z`;case"down":return`M ${d} ${f+y} 
4484                L ${d+y} ${f-x+v} 
4485                Q ${d+y} ${f-x} ${d+y-v} ${f-x}
4486                L ${d-y+v} ${f-x}
4487                Q ${d-y} ${f-x} ${d-y} ${f-x+v}
4488                Z`;default:return`M ${d} ${f-y} 
4489                L ${d+y} ${f+x-v} 
4490                Q ${d+y} ${f+x} ${d+y-v} ${f+x}
4491                L ${d-y+v} ${f+x}
4492                Q ${d-y} ${f+x} ${d-y} ${f+x-v}
4493                Z`}},c=r/2,u=s==="up"?e+c:e-c;return l.jsx("path",{d:o(t,u,r,s),fill:n,stroke:i,strokeWidth:1,filter:"url(#triangleShadow)"},a)},wEt=P.memo(bEt),_Et=({data:t,trade:e,height:r=400,timeFrame:n,enabledIndicators:i=[],volumeEnabled:s=!0,markerSize:a=Ol.default})=>{const o=tEt(e.id),c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=b.useRef(!1),h=b.useRef(null),m=b.useRef(new Map),y=b.useRef(null),[x,v]=b.useState({w:0,h:0}),[_,S]=b.useState(null),k=P.useMemo(()=>ost(rst(t,n)),[t,n]),E=P.useMemo(()=>{const $=new Map,U=tZ(t,n);for(const z of U){const L=typeof z.time=="number"?z.time.toString():JSON.stringify(z.time);$.set(L,{o:z.open,h:z.high,l:z.low,c:z.close,v:z.volume})}return $},[t,n]),T=P.useMemo(()=>{const $=[],U=e.id?.startsWith("composite-");if(!U&&e.entryDate&&e.entryPrice!==void 0){const L=ist(e,n,k);L&&$.push({id:`entry-${e.id}-${JSON.stringify(L.time)}`,time:L.time,price:e.entryPrice,size:a,fill:Cie.colors.entry,stroke:"#13141F",direction:"up",markerType:"entry"})}const z=U?null:sst(e,n,k);z&&e.exitPrice!==void 0&&$.push({id:`exit-${e.id}-${String(z.time)}`,time:z.time,price:e.exitPrice,size:a,fill:Cie.colors.exit,stroke:"#13141F",direction:"down",markerType:"exit"});for(const L of o){const W=ast(L,n,k);if(W){const K=L.side?.toUpperCase()==="BUY";$.push({id:`exec-${L.id}-${String(W.time)}`,time:W.time,price:L.price,size:a,fill:dge(L.side),stroke:"#6142FE",direction:K?"up":"down",markerType:"execution"})}}return $},[e,o,n,k,a]),[N,j]=b.useState([]),[M,O]=b.useState([]),[R,I]=b.useState([]),B=P.useMemo(()=>{if(n==="1D"||k.length===0)return{lines:[],regions:[]};const $=[],U=[];let z=null,L="",W=null;for(const K of k){const q=typeof K.time=="number"?K.time:0;if(q===0)continue;const Y=new Date(q*1e3).toLocaleDateString("en-CA",{timeZone:"America/New_York"});Y!==L&&(L=Y,z=null);const J=pEt(q),re=J==="regular";z!==null&&z!==J&&$.push(K.time),re&&W===null?W=K.time:!re&&W!==null&&(U.push({start:W,end:K.time}),W=null),z=J}return W!==null&&U.push({start:W,end:k[k.length-1].time}),{lines:$,regions:U}},[k,n]),F=P.useCallback(()=>{const $=u.current,U=h.current;if(!$||!U)return;const z=$.timeScale(),L=[];for(const q of T){const H=z.timeToCoordinate(q.time),Y=U.priceToCoordinate(q.price);H==null||Y==null||L.push({id:q.id,x:H,y:Y,size:q.size??10,fill:q.fill??"rgba(0,0,0,0.9)",stroke:q.stroke,direction:q.direction??"up",markerType:q.markerType??"execution"})}j(L);const W=[];for(const q of B.lines){const H=z.timeToCoordinate(q);H!==null&&W.push(H)}O(W);const K=[];for(const q of B.regions){let H=z.timeToCoordinate(q.start),Y=z.timeToCoordinate(q.end);H!==null&&Y!==null&&(q.end===k[k.length-1].time&&(Y+=2e3),q.start===k[0].time&&(H-=2e3),K.push({startX:Math.min(H,Y),endX:Math.max(H,Y)}))}I(K)},[T,B,k]);b.useEffect(()=>{const $=c.current;if(!$)return;const U=mEt($,$.clientWidth,r);U.applyOptions({layout:{background:{type:Eb.Solid,color:"transparent"}}}),u.current=U;const z=gEt(U);return h.current=z,()=>{U.remove(),u.current=null,h.current=null}},[r]),b.useEffect(()=>{const $=u.current,U=h.current;!$||!U||k.length!==0&&(U.setData(k),$.timeScale().fitContent())},[k]),b.useEffect(()=>{const $=u.current;if($){if(s&&t.length>0){y.current||(y.current=vEt($),xEt($));const U=nst(t,n);y.current.setData(U)}else if(y.current){try{$.removeSeries(y.current)}catch{}y.current=null}}},[s,t,n]),b.useEffect(()=>{const $=u.current;if(!$||t.length===0)return;const U=tZ(t,n),z=new Set(i),L=m.current;for(const[W,K]of L.entries())if(!z.has(W)){try{$.removeSeries(K)}catch{}L.delete(W)}for(const W of i){const K=Sbe[W];let q;switch(W){case"vwap":q=nEt(U);break;case"ema9":q=_L(U,9);break;case"ema20":q=_L(U,20);break;case"ema50":q=_L(U,50);break;default:continue}if(q.length===0)continue;let H=L.get(W);H||(H=yEt($,K.color),L.set(W,H)),H.setData(q)}return()=>{try{for(const[,W]of L.entries())$.removeSeries(W);L.clear()}catch{}}},[i,t,n]),b.useEffect(()=>{const $=u.current;if($)return $.subscribeDblClick(F),$.timeScale().subscribeVisibleTimeRangeChange(F),$.timeScale().subscribeVisibleLogicalRangeChange(F),()=>{try{$.timeScale().unsubscribeVisibleTimeRangeChange(F),$.timeScale().unsubscribeVisibleLogicalRangeChange(F),$.unsubscribeDblClick(F)}catch{}}},[F]),b.useLayoutEffect(()=>{const $=c.current;if(!$)return;v({w:$.clientWidth,h:r}),F();const U=new ResizeObserver(()=>{v({w:$.clientWidth,h:r}),u.current&&u.current.applyOptions({width:$.clientWidth}
4493),F()});return U.observe($),()=>{U.disconnect()}},[r,F]),b.useEffect(()=>{const $=c.current;if(!$)return;const U=()=>{d.current==null&&(d.current=requestAnimationFrame(()=>{d.current=null,F()}))},z=q=>{if(q.button===0){try{$.setPointerCapture(q.pointerId)}catch{}f.current=!0,U()}},L=()=>{f.current&&U()},W=q=>{if(f.current){f.current=!1;try{$.releasePointerCapture(q.pointerId)}catch{}U()}},K=()=>{f.current&&(f.current=!1,U())};return $.addEventListener("pointerdown",z),$.addEventListener("pointermove",L),$.addEventListener("pointerup",W),$.addEventListener("lostpointercapture",K),()=>{$.removeEventListener("pointerdown",z),$.removeEventListener("pointermove",L),$.removeEventListener("pointerup",W),$.removeEventListener("lostpointercapture",K),d.current!=null&&(cancelAnimationFrame(d.current),d.current=null),f.current=!1}},[F]);const V=b.useCallback($=>{if(!$.time){S(null);return}const U=typeof $.time=="number"?$.time.toString():JSON.stringify($.time),z=E.get(U);S(z?{open:z.o,high:z.h,low:z.l,close:z.c,volume:z.v,isUp:z.c>=z.o}:null)},[E]);return b.useEffect(()=>{const $=u.current;if($)return $.subscribeCrosshairMove(V),()=>{try{$.unsubscribeCrosshairMove(V)}catch{}}},[V]),l.jsxs("div",{style:{position:"relative",width:"100%",height:r,backgroundColor:ps.background},children:[_&&l.jsxs("div",{style:{position:"absolute",top:8,left:8,zIndex:1001,display:"flex",gap:"10px",fontSize:"11px",fontFamily:"'Inter', system-ui, sans-serif",fontWeight:500,letterSpacing:"0.02em",pointerEvents:"none",color:"#9CA3AF"},children:[l.jsxs("span",{children:["O"," ",l.jsx("span",{style:{color:_.isUp?"#10B981":"#EF4444"},children:_.open.toFixed(2)})]}),l.jsxs("span",{children:["H"," ",l.jsx("span",{style:{color:_.isUp?"#10B981":"#EF4444"},children:_.high.toFixed(2)})]}),l.jsxs("span",{children:["L"," ",l.jsx("span",{style:{color:_.isUp?"#10B981":"#EF4444"},children:_.low.toFixed(2)})]}),l.jsxs("span",{children:["C"," ",l.jsx("span",{style:{color:_.isUp?"#10B981":"#EF4444"},children:_.close.toFixed(2)})]}),_.volume!==void 0&&l.jsxs("span",{children:["V"," ",l.jsx("span",{style:{color:"#6B7280"},children:_.volume.toLocaleString()})]})]}),l.jsx("svg",{"aria-hidden":"true",width:x.w,height:x.h,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:0},children:R.map(($,U)=>l.jsx("rect",{x:$.startX,y:0,width:Math.max(0,$.endX-$.startX),height:x.h,fill:"rgba(0, 0, 0, 0.25)"},`shaded-region-${U}`))}),l.jsx("div",{ref:c,style:{width:"100%",height:"100%",position:"relative",zIndex:1}}),l.jsxs("svg",{"aria-hidden":"true",width:x.w,height:x.h,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:1e3},children:[l.jsx("defs",{children:l.jsx("filter",{id:"triangleShadow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:l.jsx("feDropShadow",{dx:"2",dy:"2",stdDeviation:"3",floodColor:"rgba(0, 0, 0, 0.15)"})})}),M.map(($,U)=>l.jsx("line",{x1:$,y1:0,x2:$,y2:x.h,stroke:"#4B5563",strokeWidth:"1.5",strokeDasharray:"4 4",opacity:"0.6"},`session-line-${U}`)),N.map($=>l.jsx(wEt,{id:$.id,x:$.x,y:$.y,size:$.size,fill:$.fill,stroke:$.stroke,direction:$.direction},$.id))]})]})},SEt=P.memo(_Et),kEt=({data:t,trade:e,height:r=400,timeFrame:n,enabledIndicators:i=["vwap"],volumeEnabled:s=!0,markerSize:a})=>{const{proPlan:o,shouldShowProBanner:c}=Hs(),u=c();return l.jsx("div",{className:"relative h-full flex-1 min-h-[400px] rounded-xl overflow-hidden",children:u?l.jsxs("div",{className:"h-[500px] flex items-center justify-center w-full",children:[l.jsx("img",{src:"/trade-details-placeholder.png",alt:"Chart placeholder",className:"absolute inset-0 w-full h-full object-cover p-2"}),o&&l.jsx(eN,{plan:o,className:"backdrop-blur-xs bg-transparent rounded-xl"})]}):l.jsx(SEt,{data:t,trade:e,height:r,timeFrame:n,enabledIndicators:i,volumeEnabled:s,markerSize:a})})},TEt=["vwap","ema9","ema20","ema50"],CEt=({enabledIndicators:t,onToggleIndicator:e,volumeEnabled:r,onToggleVolume:n})=>l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[TEt.map(i=>{const s=Sbe[i],a=t.includes(i);return l.jsxs("button",{type:"button",onClick:()=>e(i),className:`
4494              flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium
4495              transition-all duration-150 cursor-pointer select-none
4496              ${a?"bg-app-button-bg/80 text-app-primary-foreground ring-1 ring-white/10":"bg-transparent text-app-primary-foreground
4496/50 hover:text-app-primary-foreground/70 hover:bg-app-button-bg/40"}
4497            `,children:[l.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:s.color,opacity:a?1:.4}}),s.label]},i)}),l.jsx("div",{className:"w-px h-4 bg-app-primary-foreground/20 mx-0.5"}),l.jsxs("button",{type:"button",onClick:n,className:`
4498          flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium
4499          transition-all duration-150 cursor-pointer select-none
4500          ${r?"bg-app-button-bg/80 text-app-primary-foreground ring-1 ring-white/10":"bg-transparent text-app-primary-foreground/50 hover:text-app-primary-foreground/70 hover:bg-app-button-bg/40"}
4501        `,children:[l.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:"rgba(16, 185, 129, 0.7)",opacity:r?1:.4}}),"Vol"]})]}),EEt=({size:t,min:e,max:r,onIncrease:n,onDecrease:i})=>l.jsxs("div",{className:"flex items-center gap-0.5 bg-app-button-bg/40 rounded-lg p-0.5",title:"Execution marker size",children:[l.jsx("button",{type:"button",onClick:i,disabled:t<=e,"aria-label":"Decrease marker size",className:"flex items-center justify-center size-5 rounded-md text-app-primary-foreground/60 hover:text-app-primary-foreground hover:bg-app-button-bg/80 disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-app-primary-foreground/60 transition-colors cursor-pointer",children:l.jsx(ju,{className:"size-3"})}),l.jsx("span",{className:"text-xs font-medium text-app-primary-foreground/70 w-4 text-center tabular-nums select-none",children:t}),l.jsx("button",{type:"button",onClick:n,disabled:t>=r,"aria-label":"Increase marker size",className:"flex items-center justify-center size-5 rounded-md text-app-primary-foreground/60 hover:text-app-primary-foreground hover:bg-app-button-bg/80 disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-app-primary-foreground/60 transition-colors cursor-pointer",children:l.jsx(k$,{className:"size-3"})})]}),jEt=[{value:"1min",label:"1m"},{value:"5min",label:"5m"},{value:"15min",label:"15m"},{value:"30min",label:"30m"},{value:"60min",label:"1h"},{value:"1D",label:"1d"}],NEt=({selectedTimeFrame:t,available:e,onTimeFrameChange:r})=>l.jsx("div",{className:"flex flex-wrap gap-2",children:jEt.map(({value:n,label:i})=>{const s=e.includes(n),d=l.jsx("button",{disabled:!s,onClick:()=>s&&r(n),className:ee("relative px-3 py-1 text-sm rounded-md transition-colors focus:outline-hidden 2k:text-xl",t===n&&s&&"bg-app-button-bg-active text-white",s&&t!==n&&"bg-app-button-bg text-gray-400 hover:bg-accent hover:text-white",!s&&"bg-app-button-bg text-gray-500 opacity-40 cursor-not-allowed","group"),children:i},n);return s?d:l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:d}),l.jsx(fi,{children:"No data available for this trade"})]},n)})});li({id:Mr().uuid(),symbol:Mr(),resolution:Gw(dj),trade_date:Mr(),bar_timestamp:Li(),open:Li(),high:Li(),low:Li(),close:Li(),volume:Li(),created_at:Mr().optional()});li({symbol:Mr(),startDate:Mr(),endDate:Mr(),resolution:Gw(dj)});const Eie=4*86400,PEt=tt`
4502  query GetStockCandles(
4503    $symbol: String!
4504    $startDate: date!
4505    $endDate: date!
4506    $resolution: String!
4507  ) {
4508    stock_candle(
4509      where: {
4510        symbol: { _eq: $symbol }
4511        trade_date: { _gte: $startDate, _lte: $endDate }
4512        resolution: { _eq: $resolution }
4513      }
4514      order_by: { bar_timestamp: asc }
4515    ) {
4516      id
4517      symbol
4518      resolution
4519      trade_date
4520      bar_timestamp
4521      open
4522      high
4523      low
4524      close
4525      volume
4526    }
4527    stock_candle_aggregate(
4528      where: {
4529        symbol: { _eq: $symbol }
4530        trade_date: { _gte: $startDate, _lte: $endDate }
4531        resolution: { _eq: $resolution }
4532      }
4533    ) {
4534      aggregate {
4535        min {
4536          bar_timestamp
4537        }
4538        max {
4539          bar_timestamp
4540        }
4541      }
4542    }
4543  }
4544`,Tbe={all:["stockData"],byParams:t=>[...Tbe.all,t.symbol,t.from,t.to,t.resolution]},MEt=({symbol:t,from:e,to:r,resolution:n,queryOptions:i={},isFreeUser:s})=>{const a=!!(t&&e&&r&&n&&!s),o=Tbe.byParams({symbol:t,from:e,to:r,resolution:n});return aje({queryKey:o,queryFn:async()=>{const c=new Date(e*1e3).toISOString().slice(0,10),u=new Date(r*1e3).toISOString().slice(0,10);try{const{data:d}=await xo.query({query:PEt,variables:{symbol:t,startDate:c,endDate:u,resolution:n},fetchPolicy:"network-only"}),f=d?.stock_candle??[],h=d?.stock_candle_aggregate?.aggregate,m=h?.min?.bar_timestamp,y=h?.max?.bar_timestamp;if(f.length>0&&m!=null&&y!=null&&m<=e+Eie&&y>=r-Eie)return AEt(f)}catch{}return OHe({symbol:t,from:e,to:r,resolution:n})},enabled:a,gcTime:i.gcTime??1200*1e3,retry:(c,u)=>{if(u instanceof Error&&u.message.includes("4"))return!1;const d=typeof i.retry=="number"?i.retry:2;return c<d}})};function AEt(t){return t.map(e=>({timestamp:e.bar_timestamp,open:e.open,high:e.high,low:e.low,close:e.close,volume:e.volume}))}const Cbe={"1min":{before:0,after:0,unit:"fullday"},"5min":{before:0,after:0,unit:"fullday"},"15min":{before:3,after:4,unit:"days"},"30min":{before:3,after:4,unit:"days"},"60min":{before:3,after:4,unit:"days"},"1D":{before:30,after:30,unit:"days"}},jie=t=>{if(!t)throw new Error("Trade date is required");const e=new Date(t);if(Number.isNaN(e.getTime()))throw new TypeError(`Invalid trade date: ${t}`);return e},DEt=(t,e)=>{const{before:r,after:n,unit:i}=Cbe[e],s=jie(t.entryDate);if(i==="fullday"){const x=t.entryDate??s.toISOString(),{start:v,end:_}=hEt(x),S=Math.floor(Date.now()/1e3),k=Math.min(_,S),E=Math.ceil((k-v)/(3600*24));return{startDate:v,endDate:k,totalDays:E}}const a=t.exitDate?jie(t.exitDate):null,o=s,c=a||new Date,u=new Date(o),d=new Date(c);i==="hours"?(u.setHours(u.getHours()-r),d.setHours(d.getHours()+n)):(u.setDate(u.getDate()-r),d.setDate(d.getDate()+n));const f=new Date;d>f&&d.setTime(f.getTime());const h=Math.ceil((d.getTime()-u.getTime())/(1e3*60*60*24)),m=Math.floor(u.getTime()/1e3),y=Math.floor(d.getTime()/1e3);return{startDate:m,endDate:y,totalDays:h}},Nie=t=>{const e=new Date,{before:r,unit:n}=Cbe[t],i=new Date(e);return n==="fullday"?i.setHours(i.getHours()-16):n==="hours"?i.setHours(i.getHours()-r):i.setDate(i.getDate()-r),{startDate:Math.floor(i.getTime()/1e3),endDate:Math.floor(e.getTime()/1e3),totalDays:n==="fullday"?1:n==="hours"?r/24:r}},OEt=(t,e)=>{const[r,n]=b.useState("1min"),{shouldShowProBanner:i}=Hs(),s=i(),a=b.useMemo(()=>{if(!e)return Nie(r);try{return DEt(e,r)}catch(h){return console.error("Error calculating date range:",ks(h)),Nie(r)}},[r,e]),{data:o=[],isLoading:c,isRefetching:u,error:d}=MEt({symbol:t,from:a.startDate,to:a.endDate,resolution:r,isFreeUser:s});return{stockData:o,timeFrame:r,stockDataLoading:c||u,handleTimeFrameChange:h=>{s||n(h)},error:d?.message,isFreeUser:s}},REt=()=>{const{id:t}=G4(),{data:e,loading:r,refetch:n}=ws(nYe,t?{variables:{tradeId:t}}:_w);return{trade:e?.trade_by_pk||null,loading:r,refetchTrade:n}},IEt=t=>{const{data:e,loading:r,refetch:n}=ws(lYe,t?{variables:{tradeId:t}}:_w),i=e?.trade_execution||[],s=i.reduce((c,u)=>c+u.quantity,0),a=i.reduce((c,u)=>c+u.commissionsFees,0),o=i.length>0?i.reduce((c,u)=>c+u.price,0)/i.length:0;return{executions:i,loading:r,refetchExecutions:n,totalQuantity:s,totalCommissions:a,averagePrice:o}},LEt=t=>{const[e,r]=b.useState(!1),[n,{loading:i}]=Zn(Dhe);return{editingNotes:e,handleEditNotes:()=>{r(!0)},handleSaveNotes:async c=>
4544{if(t?.id)try{await n({variables:{tradeId:t.id,input:{notes:c}}}),r(!1)}catch{console.error("Oops! Something went wrong while updating the notes"),Ft.error("There was an error saving your notes, please try again.")}},handleCancelNotes:()=>{r(!1)},updateTradeLoading:i}},SL="mt:tradeChart:markerSize",$Et=Li().min(Ol.min).max(Ol.max),Ebe=({symbol:t,trade:e})=>{const{stockData:r,timeFrame:n,stockDataLoading:i,handleTimeFrameChange:s,isFreeUser:a}=OEt(t,e),[o,c]=b.useState(["vwap"]),[u,d]=b.useState(!0),f=b.useCallback(E=>{c(T=>T.includes(E)?T.filter(N=>N!==E):[...T,E])},[]),h=b.useCallback(()=>{d(E=>!E)},[]),[m,y]=b.useState(()=>kT(SL,$Et)??Ol.default),x=b.useCallback(()=>{y(E=>{const T=Math.min(Ol.max,E+Ol.step);return Wc(SL,T),T})},[]),v=b.useCallback(()=>{y(E=>{const T=Math.max(Ol.min,E-Ol.step);return Wc(SL,T),T})},[]),_={...e,entryPrice:mE(e.entryPrice),exitPrice:mE(e.exitPrice)},S=Object.keys(uge),k=e.pnl>=0?"text-green-400":"text-red-400";return l.jsxs("div",{id:"trade-chart",className:"bg-app-card/50 rounded-2xl h-fit",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 w-full",children:[l.jsxs("div",{className:"flex flex-col items-start gap-3",children:[l.jsxs("h3",{className:"text-xl font-semibold text-app-primary-foreground",children:[t," ","Chart"]}),l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsx(NEt,{selectedTimeFrame:n,available:S,onTimeFrameChange:s}),l.jsx("div",{className:"w-px h-5 bg-app-primary-foreground/15"}),l.jsx(CEt,{enabledIndicators:o,onToggleIndicator:f,volumeEnabled:u,onToggleVolume:h}),l.jsx("div",{className:"w-px h-5 bg-app-primary-foreground/15"}),l.jsx(EEt,{size:m,min:Ol.min,max:Ol.max,onIncrease:x,onDecrease:v})]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"text-sm text-app-primary-foreground/70 mb-1",children:"Profit/Loss"}),l.jsx("div",{className:ee("text-2xl tabular-nums font-bold",k),children:Ke(e.pnl,4)})]})]}),l.jsxs("div",{className:"pr-6 pb-6 pt-2 pl-7 min-h-[500px] h-full flex w-full items-center justify-center",children:[i&&l.jsx("div",{className:"h-[500px] flex items-center justify-center w-full",children:l.jsx(gn,{size:"md"})}),!i&&(a||r.length>0)&&l.jsx(kEt,{data:r,trade:_,height:500,timeFrame:n,enabledIndicators:o,volumeEnabled:u,markerSize:m}),!i&&!a&&r.length===0&&l.jsx("div",{className:"flex items-center justify-center h-[500px]",children:l.jsxs("div",{className:"text-sm font-normal text-center flex flex-col items-center justify-center gap-2",children:[l.jsx("div",{className:"bg-app-button-bg rounded-xl p-2",children:l.jsx(dp,{strokeWidth:1.5,className:"size-7"})}),l.jsx("h5",{className:"text-lg leading-relaxed text-app-primary-foreground",children:"No market data available"}),l.jsxs("p",{className:"font-light max-w-xs leading-relaxed text-pretty text-app-primary-foreground/80",children:["Market information typically appears"," ",l.jsx("strong",{className:"text-app-primary-foreground",children:"15 minutes"})," ","after your trade executes. Once available, you'll be able to view detailed price movements and chart analysis for this trade."]})]})})]})]})},jbe=()=>
vendor: 7,042 bytes, line 4544
4544l.jsxs("div",{className:"min-h-screen bg-app-primary mx-auto sm:pb-6 pb-8 pt-4 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between pb-6 border-b border-app-border-color-soft mb-6 mt-0!",children:[l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx(Le,{className:"size-10 rounded-lg"}),l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx(Le,{className:"h-8 w-24 rounded-sm"}),l.jsx(Le,{className:"h-6 w-16 rounded-full"})]})]}),l.jsxs("div",{className:"text-right space-y-2",children:[l.jsx(Le,{className:"h-4 w-20"}),l.jsx(Le,{className:"h-8 w-32"}),l.jsx(Le,{className:"h-4 w-16"})]})]}),l.jsxs("div",{className:"bg-app-card/50 rounded-2xl",children:[l.jsx("div",{className:"px-6 py-4 border-b border-app-border-color-soft",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Le,{className:"h-6 w-32"}),l.jsx("div",{className:"flex items-center space-x-3",children:[...Array.from({length:4})].map((t,e)=>l.jsx(Le,{className:"h-8 w-12 rounded-sm"},e))})]})}),l.jsx("div",{className:"p-4 h-96"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx("div",{className:"md:col-span-2",children:l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6",children:[l.jsx(Le,{className:"h-5 w-32 mb-6"})," ",l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[...Array.from({length:8})].map((t,e)=>l.jsxs("div",{className:"space-y-2",children:[l.jsx(Le,{className:"h-4 w-20"}),l.jsx(Le,{className:"h-6 w-32"}),l.jsx(Le,{className:"h-3 w-24"})]},e))})]})}),l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6 h-full flex flex-col",children:[l.jsxs("div",{className:"flex items-start justify-between mb-4",children:[l.jsx(Le,{className:"h-5 w-16"}),l.jsx(Le,{className:"h-8 w-24"})]}),l.jsx("div",{className:"space-y-3 flex-1",children:[...Array.from({length:6})].map((t,e)=>l.jsx(Le,{className:"h-4 w-full"},e))})]})]}),l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6 md:mb-2",children:[l.jsx(Le,{className:"h-4 w-12"}),l.jsx(Le,{className:"h-8 w-28"})]}),l.jsxs("div",{className:"grid gap-6 md:gap-8 grid-cols-1 md:grid-cols-[280px_1fr]",children:[l.jsxs("div",{className:"flex flex-col gap-3.5",children:[l.jsx(Le,{className:"h-[34px] w-full rounded-sm"}),l.jsx(Le,{className:"h-[34px] w-full rounded-sm"})]}),l.jsxs("div",{className:"flex flex-col gap-3.5 md:pl-6 md:border-l md:border-app-border-color-soft",children:[l.jsx(Le,{className:"h-4 w-20"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:[...Array.from({length:4})].map((t,e)=>l.jsx(Le,{className:"h-6 w-20 rounded-full"},e))})]})]})]}),l.jsxs("div",{className:"bg-app-card/50 rounded-2xl min-h-96 p-2",children:[l.jsx("div",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Le,{className:"h-6 w-40"}),l.jsx(Le,{className:"h-8 w-32"})]})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsx("tr",{children:[...Array.from({length:6})].map((t,e)=>l.jsx("th",{className:"px-6 py-3",children:l.jsx(Le,{className:"h-4 w-20"})},e))})}),l.jsx("tbody",{children:[...Array.from({length:6})].map((t,e)=>l.jsx("tr",{children:[...Array.from({length:6})].map((r,n)=>l.jsx("td",{className:"px-6 py-4",children:l.jsx(Le,{className:"h-4 w-16"})},n))},e))})]})})]})]});function b6(){const{state:t,isMobile:e}=Ff();return{leftOffset:b.useMemo(()=>e?"0px":t==="expanded"?"224px":"64px",[t,e])}}var lP="Checkbox",[FEt]=ma(lP),[zEt,w6]=FEt(lP);function BEt(t){const{__scopeCheckbox:e,checked:r,children:n,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Ao({prop:r,defaultProp:i??!1,onChange:c,caller:lP}),[y,x]=b.useState(null),[v,_]=b.useState(null),S=b.useRef(!1),k=y?!!a||!!y.closest("form"):!0,E={checked:h,disabled:s,setChecked:m,control:y,setControl:x,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:S,required:u,defaultChecked:vf(i)?!1:i,isFormControl:k,bubbleInput:v,setBubbleInput:_};return l.jsx(zEt,{scope:e,...E,children:VEt(f)?f(E):n})}var Nbe="CheckboxTrigger",Pbe=b.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...n},i)=>{const{control:s,value:a,disabled:o,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:y}=w6(Nbe,t),x=Kt(i,d),v=b.useRef(c);return b.useEffect(()=>{const _=s?.form;if(_){const S=()=>f(v.current);return _.addEventListener("reset",S),()=>_.removeEventListener("reset",S)}},[s,f]),l.jsx(vt.button,{type:"button",role:"checkbox","aria-checked":vf(c)?"mixed":c,"aria-required":u,"data-state":Rbe(c),"data-disabled":o?"":void 0,disabled:o,value:a,...n,ref:x,onKeyDown:He(e,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:He(r,_=>{f(S=>vf(S)?!0:!S),y&&m&&(h.current=_.isPropagationStopped(),h.current||_.stopPropagation())})})});Pbe.displayName=Nbe;var _6=b.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:a,disabled:o,value:c,onCheckedChange:u,form:d,...f}=t;return l.jsx(BEt,{__scopeCheckbox:r,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>l.jsxs(l.Fragment,{children:[l.jsx(Pbe,{...f,ref:e,__scopeCheckbox:r}),h&&l.jsx(Obe,{__scopeCheckbox:r})]})})});_6.displayName=lP;var Mbe="CheckboxIndicator",Abe=b.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=w6(Mbe,r);return l.jsx($i,{present:n||vf(s.checked)||s.checked===!0,children:l.jsx(vt.span,{"data-state":Rbe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});Abe.displayName=Mbe;var Dbe="CheckboxBubbleInput",Obe=b.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m}=w6(Dbe,t),y=Kt(r,m),x=zV(s),v=XB(n);b.useEffect(()=>{const S=h;if(!S)return;const k=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(k,"checked").set,N=!i.current;if(x!==s&&T){const j=new Event("click",{bubbles:N});S.indeterminate=vf(s),T.call(S,vf(s)?!1:s),S.dispatchEvent(j)}},[h,x,s,i]);const _=b.useRef(vf(s)?!1:s);return l.jsx(vt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??_.current,required:o,disabled:c,name:u,value:d,form:f,...e,tabIndex:-1,ref:y,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Obe.displayName=Dbe;function VEt(t){return typeof t=="function"}function vf(t){return t==="indeterminate"}function Rbe(t){return vf(t)?"indeterminate":t?"checked":"unchecked"}const vc=b.forwardRef(({className:t,...e},r)=>l.jsx(_6,{ref:r,className:ee("peer size-4 shrink-0 rounded-[4px] border border-app-border-color shadow-sm focus-visible:outline-hidden focu
4544s-visible:ring-1 focus-visible:ring-app-border-color-accent disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-none data-[state=checked]:bg-app-button-bg-active data-[state=checked]:text-app-primary-foreground cursor-pointer",t),...e,children:l.jsx(Abe,{className:ee("flex items-center justify-center text-current"),children:e.checked==="indeterminate"?l.jsx(ju,{className:"size-2.5"}):l.jsx(ei,{className:"size-2.5"})})}));vc.displayName=_6.displayName;const UEt=({totalExecutions:t,selectedCount:e,allSelected:r,onToggleSelectAll:n,onClear:i,containerProp:s})=>{const[a,o]=P.useState(!1),{leftOffset:c}=b6(),u=()=>{const h=window.scrollY,m=window.innerHeight,y=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),x=h+m/2,v=y/2;x<v?window.scrollTo({top:y,behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"})};P.useLayoutEffect(()=>{o(!0)},[]),P.useEffect(()=>{const h=m=>{m.key==="Escape"&&i()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[i]);const d=s??(a?globalThis.document?.body:null),f=e>0;return d?bc.createPortal(l.jsx(Ss,{children:f&&l.jsxs(ct.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeInOut"},className:"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit items-center justify-center gap-2 rounded-xl border border-app-border-color-soft bg-app-card p-2 shadow-lg h-14 2k:h-20 2k:px-6 2k:py-3 font-light",style:{left:`calc(${c})`,transform:"translateX(-50%)"},children:[l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx("div",{className:"flex h-full items-center rounded-md border border-app-border-color-soft bg-app-input-bg px-3",children:l.jsx(vc,{checked:r,onCheckedChange:n})})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs text-gray-300 font-light",children:"Select all executions"})})]}),l.jsx("div",{className:"w-px h-5 bg-app-border-color-soft"}),l.jsxs("div",{className:"flex h-full items-center rounded-md border border-app-border-color-soft bg-app-input-bg px-2.5 pr-1",children:[l.jsxs("span",{className:"whitespace-nowrap text-xs text-gray-300 2k:text-2xl",children:[l.jsx("span",{className:"text-gray-50 font-medium",children:e})," ","out of"," ",l.jsx("span",{className:"text-gray-50 font-medium",children:t})," ","executions"]}),l.jsx("div",{className:"mx-2 h-4 w-px bg-app-border-color-soft"}),l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx("button",{onClick:i,type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-gray-400 hover:text-white transition-colors","aria-label":"Clear selection",children:l.jsx(pi,{size:14,className:"2k:size-10"})})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs text-gray-300 font-light",children:"Clear selection"})})]}),l.jsx("div",{className:"mx-2 h-4 w-px bg-app-border-color-soft"}),l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx("button",{onClick:u,type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-gray-400 hover:text-white transition-colors","aria-label":"Scroll to top or bottom",children:l.jsx(hoe,{size:14,className:"2k:size-10"})})}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs text-gray-300 font-light",children:"Scroll to top or bottom"})})]})]})]})}),d):null},Ibe=({trade:t,executions:e})=>{const{executions:r,loading:n,totalCommissions:i,totalQuantity:s,averagePrice:a}=IEt(e?void 0:t.id),o=e||r,c=e?!1:n,u=e?e.reduce((M,O)=>M+O.quantity,0):s,d=e?e.reduce((M,O)=>M+O.commissionsFees,0):i,f=e?e.length>0?e.reduce((M,O)=>M+O.price,0)/e.length:0:a,{currentPageItems:h,paginationInfo:m,page:y,setPage:x,perPage:v,setPerPage:_}=_be(o,{defaultPageSize:15,storageKey:"trade-executions-pagination"}),{toggleExecution:S,selectAllExecutions:k,clearSelection:E}=yE(yl(M=>({toggleExecution:M.toggleExecution,selectAllExecutions:M.selectAllExecutions,clearSelection:M.clearSelection}))),T=rEt(t.id);b.useEffect(()=>{!c&&o.length>0&&!yE.getState().selectedExecutionsByTradeId[t.id]&&k(t.id,o)},[c,o.length,t.id,k,o]);const N=h.length===0?!1:h.every(M=>T.includes(M.id))?!0:h.some(M=>T.includes(M.id))?"indeterminate":!1,j=()=>{h.length!==0&&(h.every(M=>T.includes(M.id))?E(t.id):k(t.id,h))};return c?l.jsxs("div",{className:"bg-app-card/50 rounded-2xl min-h-96 p-2",children:[l.jsx("div",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Le,{className:"h-6 w-40"}),l.jsx(Le,{className:"h-8 w-32"})]})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsx("tr",{children:Array.from({length:6},(M,O)=>l.jsx("th",{className:"px-6 py-3",children:l.jsx(Le,{className:"h-4 w-20"})},`header-${O}`))})}),l.jsx("tbody",{children:Array.from({length:6},(M,O)=>l.jsx("tr",{children:Array.from({length:6},(R,I)=>l.jsx("td",{className:"px-6 py-4",children:l.jsx(Le,{className:"h-4 w-16"})},`cell-${O}-${I}`))},`row-${O}`))})]})})]}):m.hasItems?l.jsxs(l.Fragment,{children:[l.jsxs("section",{id:"trade-executions",className:ee("bg-app-card/50 rounded-2xl p-6",T.length>0&&"mb-16"),children:[l.jsxs("h3",{className:"text-sm uppercase tracking-wider mb-6 flex items-center gap-2 text-app-primary-foreground
4544/80",children:[l.jsx("span",{children:"Trade Executions"}),l.jsxs("span",{className:"text-xs text-app-primary-foreground/70",children:["(",m.totalItems," ","total)"]}),t.symbol&&l.jsx("span",{className:"ml-2 px-2 py-0.5 rounded-sm bg-app-input-bg text-xs text-app-primary-foreground/70 border border-app-border-color-soft",children:t.symbol})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx(Rn,{borders:"left",rounded:"left",className:"flex items-center",children:l.jsx(vc,{checked:N,onCheckedChange:j,disabled:o.length===0})}),l.jsx(Rn,{children:"Date"}),l.jsx(Rn,{children:"Time"}),l.jsx(Rn,{children:"Symbol"}),l.jsx(Rn,{children:"Position"}),l.jsx(Rn,{children:"Side"}),l.jsx(Rn,{children:"Quantity"}),l.jsx(Rn,{children:"Price"}),l.jsx(Rn,{rounded:"right",borders:"right",children:"Comm/Fees"})]})}),l.jsxs("tbody",{className:"divide-y divide-app-border-color-soft rounded-xl",children:[h.map(M=>l.jsxs("tr",{className:ee("hover:bg-app-input-bg duration-150 transition-colors",T.includes(M.id)&&"bg-app-input-bg"),children:[l.jsx(Dn,{children:l.jsx("div",{className:"flex items-center gap-1",children:l.jsx(vc,{checked:T.includes(M.id),onCheckedChange:()=>S(t.id,M)})})}),l.jsx(Dn,{children:uw(M.executionTime)}),l.jsx(Dn,{children:wCt(M.executionTime,new Date(t.entryDate))}),l.jsx(Dn,{children:l.jsx(x6,{symbol:t.symbol})}),l.jsx(Dn,{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(_f,{className:"size-4 text-app-primary-foreground/70"}),l.jsx("span",{className:"text-sm text-app-primary-foreground",children:M.positionSize.toLocaleString()})]})}),l.jsx(Dn,{children:l.jsx(DCt,{side:M.side})}),l.jsx(Dn,{children:l.jsx(OCt,{quantity:M.quantity,side:M.side})}),l.jsx(Dn,{className:"tracking-wide",children:Ke(M.price,4)}),l.jsx(Dn,{className:"tracking-wide",children:Ke(M.commissionsFees,4)})]},M.id)),l.jsxs("tr",{className:"border-t-2 border-app-border-color-soft",children:[l.jsx(On,{}),l.jsx(On,{className:"text-xs text-app-primary-foreground/80 uppercase tracking-wider",children:"Total / Avg"}),l.jsx(On,{}),l.jsx(On,{}),l.jsx(On,{children:l.jsx(Xd,{value:u.toLocaleString(),label:"total"})}),l.jsx(On,{}),l.jsx(On,{}),l.jsx(On,{children:l.jsx(Xd,{value:Ke(f,4),label:"avg"})}),l.jsx(On,{children:l.jsx(Xd,{value:Ke(d,4),label:"total"})})]})]})]})}),l.jsx(v6,{page:y,perPage:v,totalItems:m.totalItems,onPageChange:x,onPerPageChange:_,className:"mt-6"})]}),l.jsx(UEt,{totalExecutions:o.length,selectedCount:T.length,allSelected:N,onToggleSelectAll:j,onClear:()=>E(t.id)})]}):l.jsx(yV,{title:"No executions found",description:"This trade doesn't have any execution records yet.",icon:l.jsx(_f,{className:"size-10"}),className:"bg-app-card/50 rounded-xl p-6"})},GEt=({trade:t})=>{const e=Ws(),r=()=>{e(-1)},n=t.positionType==="LONG";return l.jsx("div",{className:"flex items-center justify-between pb-6 border-b border-app-border-color-soft mb-6",children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:r,className:"p-2 transition-all duration-300 hover:bg-app-button-bg group",children:l.jsx(Tu,{className:"size-4 transition-all duration-300 group-hover:-translate-x-0.5"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-2xl font-bold text-app-primary-foreground",children:t.symbol}),l.jsx("span",{className:`px-3 py-1 rounded-lg text-sm font-medium ${n?"bg-app-positive-color-bg text-app-positive-color border border-app-positive-color/20":"bg-app-negative-color-bg text-app-negative-color border border-app-negative-color/20"}`,children:t.positionType})]})]})})},WEt=({trade:t})=>{const[e,{loading:r}]=Zn(Rhe),[n,i]=b.useState(!1),s=$o({resolver:xl(jge),defaultValues:{initialRisk:t.risk??null}}),a=!s.formState.dirtyFields.initialRisk,o=s.watch("initialRisk"),c=t.risk==null?null:Ke(t.risk,4),u=b.useCallback(f=>{f&&s.reset({initialRisk:t.risk??null}),i(f)},[s,t.risk]),d=async f=>{try{await e({variables:{tradeId:t.id,risk:f.initialRisk},optimisticResponse:{update_trade_by_pk:{__typename:"trade",id:t.id,risk:f.
4544initialRisk}},update:(h,m)=>{const y=m.data?.update_trade_by_pk?.risk??f.initialRisk;h.modify({id:h.identify({__typename:"trade",id:t.id}),fields:{risk:()=>y}})}}),s.reset({initialRisk:f.initialRisk}),i(!1)}catch(h){const m=jw(h);s.setError("initialRisk",{message:m})}};return l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(on,{label:"Initial Risk",icon:t3,value:l.jsx(l.Fragment,{children:c||l.jsx("span",{className:"text-xs italic text-app-primary-foreground/70 font-light max-w-xs",children:"Not yet configured"})})}),l.jsxs(Bf,{open:n,onOpenChange:u,children:[l.jsx(Vf,{asChild:!0,children:l.jsxs(ye,{type:"button",variant:"secondary",size:"icon",className:"border-none size-8",children:[l.jsx(fl,{className:"size-3.5"}),l.jsx("span",{className:"sr-only",children:"Configure initial risk"})]})}),l.jsx(Uf,{className:"w-80 rounded-2xl",align:"start",children:l.jsx(tN,{...s,children:l.jsxs("form",{onSubmit:s.handleSubmit(d),className:"flex flex-col gap-4",children:[l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-app-button-bg border-none text-app-primary-foreground/90 [&>svg]:text-app-primary-foreground/90",children:[l.jsx(Kc,{size:24,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1 ml-2 font-light max-w-sm leading-relaxed",children:[l.jsx("strong",{className:"font-semibold",children:"What is Risk?"})," ","Risk (R) is a normalized way to measure trade performance.",l.jsx("br",{})]})]}),l.jsx(kb,{control:s.control,name:"initialRisk",render:({field:f})=>{const h=m=>{const{value:y}=m.target,x=Number.parseFloat(y);f.onChange(y===""||Number.isNaN(x)?null:x)};return l.jsxs(ry,{children:[l.jsx(ny,{className:"text-xs font-normal uppercase tracking-wider text-app-primary-foreground/70",children:"Initial Risk (USD)"}),l.jsxs("div",{className:"relative flex w-full rounded-md",children:[l.jsx("span",{className:"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-lg font-light text-app-primary-foreground/70",children:"$"}),l.jsx(n1,{children:l.jsx(Wr,{...f,value:f.value??"",disabled:r,onChange:h,inputMode:"decimal",placeholder:"0.00",type:"number",step:"0.01",hasIcon:!0,className:"-me-px h-9 w-full rounded-e-none ps-6 text-app-primary-foreground/90"})}),l.jsx("span",{className:"z-10 inline-flex items-center rounded-e-lg border border-l-0 border-app-border-color bg-app-input-bg px-3 text-sm font-light text-app-primary-foreground/70",children:"USD"}),l.jsx(ye,{type:"submit",variant:"secondary",size:"icon",className:"ml-2 self-center border-none",disabled:r||a,children:r?l.jsx(gn,{size:"sm"}):l.jsx(ei,{className:"size-3"})})]}),l.jsx(nN,{children:"This configuration will only be applied to this trade. Existing trades remain unchanged."}),l.jsx(iN,{})]})}}),o!=null&&o>1e5&&l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-yellow-500/10 border-yellow-500/20 text-yellow-100 [&>svg]:text-yellow-400",children:[l.jsx(Wu,{size:20,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1.5 ml-1 font-light max-w-sm",children:[l.jsx("strong",{children:"High Risk Amount:"})," ",Ke(o,4)," ","is unusually high for a default risk amount. Please double-check this value before saving."]})]})]})})})]})]})},HEt=({trade:t})=>{const e=(()=>{const s=new Date(t.entryDate);return(t.exitDate?new Date(t.exitDate):new Date).getTime()-s.getTime()})(),r=typeof t.risk=="number"&&t.risk!==0,n=r?t.risk:0,i=s=>{if(r){const a=(s/n).toFixed(4);return`${Ke(s,4)} (${a}R)`}return Ke(s,4)};return l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6",children:[l.jsx("h3",{className:"text-sm uppercase tracking-wider mb-6 text-app-primary-foreground/80",children:"Trade Information"}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-10",children:[l.jsx(WEt,{trade:t}),l.jsx(on,{icon:_f,label:"Status",value:t.status||(t.exitDate?"Closed":"Open")}),l.jsx(on,{icon:Cu,label:"Entry Date",value:tp(t.entryDate)}),l.jsx(on,{icon:Cu,label:"Exit Date",value:t.exitDate?tp(t.exitDate):"N/A"}),l.jsx(on,{icon:j$,label:"Duration",value:y5(e)}),l.jsx(on,{icon:_f,label:"Position Size",value:t.positionSize.toLocaleStr
4544ing()}),l.jsx(on,{icon:Yc,label:"Entry Price",value:Ke(mE(t.entryPrice),4)}),l.jsx(on,{icon:Yc,label:"Exit Price",value:t.exitDate?Ke(mE(t.exitPrice),4):"N/A"}),l.jsx(on,{icon:Yc,label:"PnL",value:i(t.pnl??0)}),l.jsx(on,{icon:Yc,label:"Net PnL",value:i(t.netPnl??0)}),l.jsx(on,{icon:Yc,label:"Commissions",value:t.commissionsFees>0?Ke(t.commissionsFees,4):"N/A"}),l.jsx(on,{icon:Is,label:"Created at",value:tp(t.createdAt)})]})]})},qEt=li({notes:Mr().max(5e3,"Notes must be less than 5000 characters").optional()}),YEt=({trade:t})=>{const{editingNotes:e,handleEditNotes:r,handleSaveNotes:n,handleCancelNotes:i,updateTradeLoading:s}=LEt(t),a=$o({resolver:xl(qEt),values:{notes:t?.notes||""}}),o=u=>{u.notes!==void 0&&n(u.notes)},c=()=>{a.reset({notes:t?.notes||""}),i()};return l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6 h-full flex flex-col",children:[l.jsxs("div",{className:"flex items-start justify-between mb-4 shrink-0",children:[l.jsx("h3",{className:"text-sm uppercase tracking-wider text-app-primary-foreground/80",children:"Notes"}),e?l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsxs(ye,{type:"submit",form:"notes-form",variant:"default",size:"sm",className:"flex items-center space-x-2",disabled:s,children:[s&&l.jsx(No,{className:"size-3.5 animate-spin"}),s?"Saving...":"Save notes"]}),l.jsxs(ye,{type:"button",variant:"secondary",size:"sm",onClick:c,className:"group border-none",children:[l.jsx(pi,{className:"size-3.5 group-hover:text-app-primary-foreground transition-all duration-300"}),"Cancel"]})]}):l.jsxs(ye,{type:"button",variant:"secondary",size:"sm",onClick:r,className:"group border-none gap-2",children:[l.jsx(oMe,{className:"size-3.5 text-app-primary-foreground/70 group-hover:translate-x-px transition-all duration-300"}),l.jsx("span",{className:"group-hover:text-app-primary-foreground",children:"Edit notes"})]})]}),l.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:e?l.jsxs("form",{id:"notes-form",onSubmit:a.handleSubmit(o),className:"flex-1 flex flex-col",children:[l.jsx("label",{htmlFor:"notes",className:"sr-only",children:"Trade notes"}),l.jsxs("div",{className:"relative flex-1",children:[l.jsx(RV,{id:"notes",...a.register("notes"),placeholder:"Enter trade notes...",className:ee("w-full resize-none h-full  bg-app-input-bg/50 pr-16",s&&"animate-pulse pointer-events-none",a.formState.errors.notes&&"border-red-500 focus:border-red-500"),disabled:s,"aria-describedby":a.formState.errors.notes?"notes-error":"notes-help"}),l.jsxs("div",{className:"absolute bottom-2.5 right-2.5 text-xs pointer-events-none font-mono",children:[a.watch("notes")?.length||0,l.jsx("span",{className:"text-app-primary-foreground/40",children:"/5000"})]})]}),a.formState.errors.notes&&l.jsx("div",{id:"notes-error",className:"text-red-500 text-sm mt-1 px-1",children:a.formState.errors.notes.message}),l.jsx("div",{id:"notes-help",className:"sr-only",children:"Enter your notes about this trade. Press Enter to save or use the Save button."})]}):l.jsx(l.Fragment,{children:t.notes?l.jsx("button",{onClick:r,className:"text-app-primary-foreground whitespace-pre-wrap bg-app-input-bg/50 px-3 py-2 flex flex-col items-start justify-start text-left text-sm rounded-lg border border-app-border-color-soft flex-1 w-full overflow-auto cursor-pointer hover:bg-app-input-bg/70 transition-all duration-300 h-full overflow-y-auto",children:t.notes}):l.jsxs("button",{onClick:r,className:"text-app-primary-foreground/70 italic bg-app-input-bg/50 p-4 rounded-lg border border-dashed border-app-border-color-soft flex-1 w-full flex items-center justify-center text-center text-sm font-light cursor-pointer hover:bg-app-input-bg/70 transition-all duration-300",children:["No notes added yet.",l.jsx("br",{}),"Click edit to add notes about this trade."]})})})]})},KEt=()=>l.jsxs("div",{className:"min-h-screen bg-app-primary flex flex-col items-center justify-center gap-4",children:[l.jsx(NPe,{className:"size-20 text-app-primary-foreground/80 mb-4"}),l.jsx("span",{className:"text-3xl font-semibold text-app-primary-foreground mb-2",children:"Trade not found"}
4544),l.jsx("span",{className:"text-app-primary-foreground/70 text-base max-w-lg text-center",children:"The trade you are looking for does not exist or was removed. It may have been deleted, or you may have followed an outdated link. Please check your trades list or try searching again."}),l.jsx(ye,{variant:"outline",className:"mt-4 group hover:bg-app-card duration-300 transition-colors",asChild:!0,children:l.jsxs(At,{to:"/app/trades",children:[l.jsx(Tu,{className:"size-4 mr-1 group-hover:-translate-x-0.5 transition-transform duration-300"}),"Back to Trades"]})})]}),QEt=({tradeTags:t,busy:e={},onRemoveTag:r,className:n})=>t.length===0?l.jsxs("div",{className:ee("text-app-primary-foreground/50 italic w-full flex items-center justify-start text-left text-sm font-light",n),children:["No tags added yet.",l.jsx("br",{}),"Select tags on the left and save to add them."]}):l.jsx("div",{className:ee("flex flex-wrap gap-2.5",n),children:t.map(i=>{const s=!!(e[i.id]||e[i.tag.id]);return l.jsxs("div",{className:ee("group relative inline-flex items-center px-2 py-1.5 rounded-lg border transition-all",s&&"opacity-40 animate-pulse pointer-events-none"),style:{backgroundColor:i.tag?.backgroundColor||"#f3f4f6",color:i.tag?.textColor||"#374151",borderColor:i.tag?.backgroundColor||"#d1d5db"},children:[l.jsx("span",{className:"text-[13px] font-medium leading-none",children:i.tag?.name||"Loading..."}),l.jsx("button",{onClick:()=>r(i.id),className:"overflow-hidden w-0 ml-0 opacity-0 group-hover:opacity-100 group-hover:w-auto group-hover:ml-1 hover:text-red-500 transition-all duration-300","aria-label":`Remove ${i.tag?.name} tag`,children:l.jsx(pi,{className:"size-3.5"})})]},i.id)})}),Lbe=({options:t,selectedValues:e,onChange:r,placeholder:n="Select options...",minWidth:i="min-w-32",width:s="w-40",maxHeight:a="max-h-64",className:o="",inputClassName:c="",ariaLabel:u})=>{const[d,f]=b.useState(!1),[h,m]=b.useState(null),y=b.useRef(null),x=b.useRef(null),[v,_]=b.useState(!1),S=Array.isArray(e)?e:[],k=Array.isArray(t)?t:[],E=k.filter(O=>S.includes(O?.value)).map(O=>typeof O?.label=="string"?O.label:typeof O?.value=="string"?O.value:"").join(", "),T=O=>{const I=e.includes(O)?e.filter(B=>B!==O):[...e,O];r(I)},N=O=>{switch(O.key){case"Enter":case" ":O.preventDefault(),f(R=>!R);break;case"Escape":f(!1);break;case"ArrowDown":O.preventDefault(),f(!0),m(R=>R===null?0:Math.min(R+1,t.length-1));break;case"ArrowUp":O.preventDefault(),m(R=>R===null?t.length-1:Math.max(R-1,0));break}},j=O=>{y.current&&!y.current.contains(O.target)&&f(!1)},M=()=>{const O=y.current,R=x.current;if(!O||!R)return;const I=O.getBoundingClientRect(),B=I.top,F=window.innerHeight-I.bottom,V=R.offsetHeight;_(F<V&&B>F)};return b.useEffect(()=>(d&&(document.addEventListener("mousedown",j),M(),window.addEventListener("scroll",M,{passive:!0}),window.addEventListener("resize",M)),()=>{document.removeEventListener("mousedown",j),window.removeEventListener("scroll",M),window.removeEventListener("resize",M)}),[d,k.length]),l.jsxs("div",{ref:y,className:`relative ${o}`,children:[l.jsxs("button",{type:"button",onClick:()=>f(!d),onKeyDown:N,className:ee("group relative flex items-center justify-between px-3 py-2 bg-app-button-bg backdrop-blur-xs","border border-app-border-color rounded-lg","text-white text-sm min-h-12 pl-6","hover:border-app-border-color-accent focus:outline-hidden focus:border-app-border-color-accent",i,s,c,d&&"bg-app-primary/20 border-app-border-color shadow-lg","2k:py-6 2k:text-2xl 2k:min-h-[64px]"),"aria-label":u||"Multi-select dropdown","aria-expanded":d,"aria-haspopup":"listbox",children:[l.jsx("span",{className:"truncate text-left text-sm text-app-primary-foreground/70 2k:text-2xl",children:e.length>0?E.length>30?`${e.length} selected`:E:n}),l.jsx(Eu,{size:16,className:ee("ml-2 text-app-primary-foreground/70 transition-transform duration-200",d&&"rotate-180 text-app-primary-foreground","2k:w-7 2k:h-7")})]}),l.jsx("div",{ref:x,className:ee("absolute left-0 w-full z-50",v?"bottom-full mb-2 origin-bottom":"top-full mt-2 origin-top",i,"transition-all duration-200 ease-out",d?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-2 pointer-events-none"),children:l.jsx("div",{className:"bg-app-button-bg backdrop-blur-xl rounded-xl border border-app-border-color shadow-2xl overflow-hidden",children:l.jsx("div",{className:ee("overflow-y-auto",a),role:"listbox","aria-label":"Tag selection",children:k.length===0?l.jsx("div",{className:"px-4 py-3 text-xs text-gray-400 2k:text-xl",children:"No data available"}):k.map((O,R)=>{if(!O)return null;const I=`${O.value}-${R}`,B=S.includes(O.value);return l.jsxs("button",{type:"button",onClick:()=>T(O.value),onMouseEnter:()=>m(R),onMouseLeave:()=>m(null),className:ee("w-full px-4 py-3 text-left text-xs font-medium flex items-center justify-between gap-2 relative overflow-hidden transition-all duration-200 ease-out",B?"text-app-primary-foreground":"text-app-primary-foreground
4544/70 hover:text-app-primary-foreground"),role:"option","aria-selected":B,children:[l.jsx("div",{className:ee("absolute inset-0 bg-app-button-bg-active transition-opacity duration-200 ease-out z-0",h===R?"opacity-100":"opacity-0")}),l.jsx("span",{className:"truncate relative z-10 2k:text-2xl",children:O.label}),B&&l.jsx(ei,{className:"size-4 relative z-10 text-app-primary-foreground"})]},I)})})})})]})},qz=tt`
4545  query GetTradeTagsByTradeId($tradeId: uuid!) {
4546    trade_tag(
4547      where: { trade_id: { _eq: $tradeId }, is_active: { _is_null: false } }
4548    ) {
4549      id
4550      createdAt: created_at
4551      updatedAt: updated_at
4552      tag {
4553        id
4554        backgroundColor: background_color
4555        name
4556        textColor: text_color
4557      }
4558    }
4559  }
4560`,$be=tt`
4561  query GetTagsByUserId($userId: uuid!) {
4562    tag(where: { is_active: { _eq: true }, user_id: { _eq: $userId } }) {
4563      id
4564      name
4565      backgroundColor: background_color
4566      textColor: text_color
4567      createdAt: created_at
4568      updatedAt: updated_at
4569    }
4570  }
4571`,ZEt=tt`
4572  mutation UpdateTagBy($tagId: uuid!, $tag: tag_set_input!) {
4573    update_tag(_set: $tag, where: { id: { _eq: $tagId } }) {
4574      affected_rows
4575    }
4576  }
4577`;tt`
4578  mutation DeleteTagBy($tagId: uuid!) {
4579    delete_tag_by_pk(id: $tagId) {
4580      id
4581    }
4582  }
4583`;const XEt=tt`
4584  mutation DeleteMultipleTags($tagsId: [uuid!]) {
4585    delete_tag(where: { id: { _in: $tagsId } }) {
4586      affected_rows
4587    }
4588  }
4589`,JEt=()=>{const[t,{loading:e,error:r,data:n}]=Zn(ZEt);return{updateTag:t,loading:e,error:r,data:n}},ejt=()=>{const[t,{loading:e,error:r,data:n}]=Zn(XEt);return{deleteTags:t,loading:e,error:r,data:n}};function tjt(){return tj(aV)}const rjt=tt`
4590  mutation CreateTag($input: tag_insert_input!) {
4591    insert_tag_one(object: $input) {
4592      id
4593      user_id
4594      name
4595      text_color
4596      background_color
4597      created_at
4598      updated_at
4599      deleted_at
4600      created_by
4601      updated_by
4602      deleted_by
4603    }
4604  }
4605`;tt`
4606  mutation LinkTagToTrade($input: trade_tag_insert_input!) {
4607    insert_trade_tag_one(object: $input) {
4608      id
4609      tag_id
4610      trade_id
4611    }
4612  }
4613`;const njt=tt`
4614  mutation UnlinkTagFromTrade($tradeTagId: uuid!) {
4615    delete_trade_tag_by_pk(id: $tradeTagId) {
4616      id
4617    }
4618  }
4619`;function S6(t){return ws($be,t?{variables:{userId:t}}:_w)}function ijt(t){return da(qz,{variables:{tradeId:t},skip:!t})}function sjt(t){return da($be,{variables:{userId:t},skip:!t})}function ajt(){return Zn(rjt)}function ojt(){return Zn(njt)}const ljt=tt`
4620  mutation UnlinkMultipleTagsFromTrades($tradeTagIds: [uuid!]!) {
4621    delete_trade_tag(where: { id: { _in: $tradeTagIds } }) {
4622      affected_rows
4623    }
4624  }
4625`;function cjt(){return Zn(ljt)}const ujt=li({selectedTagIds:Uw(Mr().min(1,"Tag ID must be a non-empty string")).max(100,"Cannot select more than 100 tags").default([]).optional()}),djt=(t,e,r,n)=>{const i=Array.isArray(e),s=i?e:[e],a=i?s[0]:e,[o,c]=b.useState({}),[u,d]=b.useState([]),{data:f,loading:h}=ijt(i?void 0:a),{data:m,loading:y}=sjt(t),x=b.useMemo(()=>r||f?.trade_tag||[],[r,f]),v=b.useMemo(()=>m?.tag||[],[m]),_=b.useMemo(()=>Array.from(new Map(x.map(R=>[R.tag.id,R])).values()),[x]);b.useEffect(()=>{d(()=>{const R=[..._],I=Object.entries(o).filter(([,B])=>B==="adding").map(([B])=>{if(_.some(V=>V.tag.id===B))return null;const F=v.find(V=>V.id===B);return F?{id:B,tag:F,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}:null}).filter(B=>B!==null);return[...R,...I]})},[o,_,v]);const[S,{loading:k}]=tjt(),[E]=ojt(),[T]=cjt(),N=$o({resolver:xl(ujt),defaultValues:{selectedTagIds:[]}}),j=(R,I)=>c(B=>{const F={...B};return I?F[R]=I:delete F[R],F});return{form:N,currentTradeTags:u,currentUserTags:v,loading:h||y,busy:o,handleSaveTags:async R=>{if(s.length===0||!t)return;const I=R.selectedTagIds||[];if(!I.length)return;const B=u.map($=>$.tag.id),F=I.filter($=>!B.includes($));if(!F.length)return;for(const $ of F)j($,"adding");const V=s.flatMap($=>F.map(U=>({trade_id:$,tag_id:U,user_id:t})));try{await S({variables:{tradeTags:V},refetchQueries:i?[]:[{query:qz,variables:{tradeId:a}}],awaitRefetchQueries:!i}
4625);for(const $ of F)j($);N.reset({selectedTagIds:[]}),n?.()}catch($){console.error("Oops! Something went wrong while updating the trade tags",$),Ft.error("Failed to update trade tags, please try again.");for(const U of F)j(U);N.reset({selectedTagIds:[]})}},handleUnlinkTag:async R=>{if(s.length!==0)if(i){const I=x.find(V=>V.id===R);if(!I)return;const B=I.tag.id,F=x.filter(V=>V.tag.id===B).map(V=>V.id);for(const V of F)j(V,"removing");try{await T({variables:{tradeTagIds:F}});for(const V of F)j(V);n?.()}catch(V){console.error("Oops! Something went wrong while removing the tag",V),Ft.error("Failed to remove tag, please try again.");for(const $ of F)j($)}}else{j(R,"removing");try{await E({variables:{tradeTagId:R},refetchQueries:[{query:qz,variables:{tradeId:a}}],awaitRefetchQueries:!0}),j(R),n?.()}catch{console.error("Oops! Something went wrong while removing the tag"),Ft.error("Failed to remove tag, please try again."),j(R)}}},isSaving:k}},Fbe=({tradeId:t,customTradeTags:e,onRefresh:r})=>{const{userHasura:n}=Gt(),i=n?.id,{form:s,currentTradeTags:a,currentUserTags:o,loading:c,busy:u,handleSaveTags:d,handleUnlinkTag:f,isSaving:h}=djt(i,t,e,r),m=s.watch("selectedTagIds"),x=o.filter(S=>!a.some(k=>k.tag.id===S.id)).map(S=>({value:S.id,label:l.jsx("span",{className:"inline-flex items-center whitespace-nowrap rounded-lg px-2 py-[3px] text-xs font-medium",style:{backgroundColor:S.backgroundColor,color:S.textColor},children:S.name}),searchText:S.name.toLowerCase()})),v=S=>{d(S)},_=Object.values(u).includes("adding")||h;return c?l.jsx(gn,{}):l.jsxs("div",{className:"bg-app-card/50 rounded-2xl p-6 h-fit flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6 md:mb-2",children:[l.jsx("h3",{className:"text-sm uppercase tracking-wider text-app-primary-foreground/80",children:"Tags"}),l.jsx(ye,{type:"button",variant:"secondary",size:"sm",className:"group border-none",asChild:!0,children:l.jsxs(At,{to:"/app/manage-tags",children:[l.jsx(fl,{className:"size-3.5 mr-1"}),"Manage tags",l.jsx(Cs,{className:"size-3.5 transition-all duration-300 mr-1 group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})})]}),l.jsxs("div",{className:"grid gap-6 md:gap-8 grid-cols-1 md:grid-cols-[280px_1fr] min-h-0",children:[l.jsxs("form",{id:"tags-form",onSubmit:s.handleSubmit(v),className:"flex flex-col gap-3.5",children:[l.jsx("label",{htmlFor:"selectedTagIds",className:"sr-only",children:"Select trade tags"}),l.jsx(Lbe,{options:x,selectedValues:m||[],onChange:S=>s.setValue("selectedTagIds",S),placeholder:"Select tags...",width:"w-full",inputClassName:"min-h-0! h-[34px]! py-4!"}),l.jsxs(ye,{type:"submit",form:"tags-form",variant:"secondary",size:"sm",className:"h-[34px]! border-none w-full",disabled:_||!m?.length,children:[_?l.jsx(gn,{size:"sm",className:"mr-1",iconClassName:"size-3.5"}):l.jsx(ei,{className:"size-3.5 mr-1"}),_?"Saving...":"Save tags"]}),s.formState.errors.selectedTagIds&&l.jsx("div",{className:"text-red-500 text-sm mt-1 px-1",children:s.formState.errors.selectedTagIds.message})]}),l.jsxs("div",{className:"flex flex-col gap-3.5 md:pl-6 md:border-l md:border-app-border-color-soft",children:[l.jsx("h3",{className:"text-xs uppercase tracking-wider text-app-primary-foreground/80",children:"Current tags"}),l.jsx("div",{className:"max-w-2xl",children:l.jsx(QEt,{tradeTags:a,busy:u,onRemoveTag:f})})]})]})]})},fjt=()=>{const{date:t,symbol:e}=G4(),{userHasura:r}=Gt(),n=Ws(),{data:i,loading:s,refetch:a}=ws(uYe,t&&e&&r?.id?{variables:{userId:r.id,symbol:e,startDate:Mu(t),endDate:Mu(t,!0)}}:{skip:!0}),o=i?.trade||[],c=b.useMemo(()=>o.flatMap(y=>(y.trade_executions||[]).map(v=>({...v,trade:{symbol:y.symbol}}))),[o]),u=b.useMemo(()=>o.flatMap(y=>y.trade_tags||[]),[o]),d=b.useMemo(()=>o.map(y=>y.id),[o]),f=b.useMemo(()=>Array.from(new Set(o.map(y=>y.positionType).filter(Boolean))),[o]),h=b.useMemo(()=>{if(o.length===0)return null;const y=o.reduce((N,j)=>N+(j.pnl||0),0),x=o.reduce((N,j)=>N+(j.netPnl||0),0),v=o.reduce((N,j)=>N+(j.commissionsFees||0),0),_=o.map(N=>new Date(N.entryDate).getTime()).filter(Boolean),S=o.map(N=>
4625N.exitDate?new Date(N.exitDate).getTime():0).filter(Boolean),k=_.length>0?new Date(Math.min(..._)).toISOString():o[0].entryDate,E=S.length>0?new Date(Math.max(...S)).toISOString():o[0].exitDate,T=f.length===1?f[0]:"MIXED";return{id:`composite-${e}-${t}`,userId:r?.id||"",symbol:e||"",positionType:T,entryPrice:0,exitPrice:0,positionSize:o.reduce((N,j)=>N+(j.positionSize||0),0),entryDate:k,exitDate:E,status:"CLOSED",notes:"",pnl:y,netPnl:x,commissionsFees:v,risk:o.reduce((N,j)=>N+(j.risk||0),0),isActive:!1,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},[o,e,t,r,f]),m=()=>{n(-1)};return s?l.jsx(jbe,{}):o.length===0||!h?l.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] gap-4",children:[l.jsx("h3",{className:"text-xl font-semibold text-app-primary-foreground",children:"No trades found"}),l.jsxs("p",{className:"text-app-primary-foreground/60 text-sm",children:["We couldn't find any trades for ",e," on this day."]}),l.jsx(ye,{onClick:m,variant:"outline",children:"Back"})]}
4625):l.jsxs("div",{className:"min-h-screen bg-app-primary mx-auto sm:pb-6 pb-8 pt-4",children:[l.jsx("div",{className:"flex items-center justify-between pb-6 border-b border-app-border-color-soft mb-6",children:l.jsxs("div",{className:"flex items-center space-x-4",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:m,className:"p-2 transition-all duration-300 hover:bg-app-button-bg group",children:l.jsx(Tu,{className:"size-4 transition-all duration-300 group-hover:-translate-x-0.5"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-2xl font-bold text-app-primary-foreground",children:e}),l.jsx("span",{className:"text-sm text-app-primary-foreground/50",children:uw(t||"")}),l.jsx("div",{className:"flex gap-2",children:f.map(y=>l.jsx("span",{className:`px-3 py-1 rounded-lg text-sm font-medium ${y==="LONG"?"bg-app-positive-color-bg text-app-positive-color border border-app-positive-color/20":"bg-app-negative-color-bg text-app-negative-color border border-app-negative-color/20"}`,children:y},y))})]})]})}),l.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[l.jsx(Ebe,{symbol:e||"",trade:h}),l.jsx(Fbe,{tradeId:d,customTradeTags:u,onRefresh:a}),l.jsx(Ibe,{trade:h,executions:c})]})]})},{monthStart:Pie,monthEnd:Mie}=Hoe(),hjt=t=>{const[e,r]=ys("start",{defaultValue:Pie.toISOString()}),[n,i]=ys("end",{defaultValue:Mie.toISOString()}),[s,a]=ys("timeRange",{defaultValue:"this_month"});return{dateRange:b.useMemo(()=>({start:e,end:n}),[e,n]),startDate:e,endDate:n,timeRangeOption:s,setDateRange:({start:f,end:h})=>{r(f),i(h),s==="this_month"&&a("custom")},setStartDate:r,setEndDate:i,setTimeRangeOption:a,setDateRangeWithOption:({start:f,end:h},m="custom")=>{r(f),i(h),a(m)},resetToDefault:()=>{r(Pie.toISOString()),i(Mie.toISOString()),a("this_month")}}},pjt=({disabled:t=!1,className:e,label:r="Date Range"})=>{const{dateRange:n,setDateRange:i,resetToDefault:s}=hjt(),a=b.useCallback(f=>{if(!f)return;const h=iT(f);i({start:h,end:n?.end||""})},[n?.end,i]),o=b.useCallback(f=>{if(!f)return;const h=iT(f);i({start:n?.start||"",end:h})},[n?.start,i]),c=f=>{if(!f)return null;if(f.includes("T")&&f.endsWith("Z")){const h=new Date(f);return isNaN(h.getTime())?null:h}return uDe(f)},u=c(n?.start),d=c(n?.end);return l.jsx("div",{className:Pe("bg-app-card border border-app-border-color-soft p-4 rounded-xl mb-6 flex-1",e),children:l.jsxs("div",{className:"w-full",children:[l.jsx("p",{className:"text-sm font-medium text-app-primary-foreground/70 mb-2 2k:text-2xl 2k:mb-4",children:r}),l.jsxs("div",{className:"flex items-center w-full gap-4",children:[l.jsxs("div",{className:"flex flex-1 gap-2 sm:gap-4",children:[l.jsx(pE,{selected:u,onSelect:a,placeholder:"Start date",disabled:t,ariaLabel:"Select start date",maxDate:d||void 0}),l.jsx(pE,{selected:d,onSelect:o,placeholder:"End date",disabled:t,ariaLabel:"Select end date",minDate:u||void 0})]}),l.jsx(Sh,{onClick:s,icon:poe,ariaLabel:"Reset date range",variant:"accent",size:"sm",tooltip:"Reset default"})]})]})})};function mjt(){const[t,e]=b.useState(!1),[r,n]=b.useState(()=>{const a=new Date,o=new Date(a.getFullYear(),0,1).toISOString().split("T")[0],c=new Date(a.getFullYear(),11,31).toISOString().split("T")[0];return{dateRange:{start:o,end:c}}}),i=b.useCallback((a,o)=>{n(c=>({...c,[a]:o}))},[]),s=b.useCallback(a=>
4625{if(e(a),a)n(o=>({...o,dateRange:void 0}));else{const o=new Date,c=new Date(o.getFullYear(),0,1).toISOString().split("T")[0],u=new Date(o.getFullYear(),11,31).toISOString().split("T")[0];n(d=>({...d,dateRange:{start:c,end:u}}))}},[]);return{filters:r,showAllTime:t,handleFilterChange:i,handleAllTimeToggle:s}}const gjt=({trades:t})=>{sU(t);const e=[{type:"strength",icon:l.jsx(_s,{className:"text-app-border-color-accent w-6 h-6 2k:w-12 2k:h-12"}),title:"Strong Performance",description:"Your win rate is above average during morning trading sessions."},{type:"weakness",icon:l.jsx(Kl,{className:"text-app-border-color-accent w-6 h-6 2k:w-12 2k:h-12"}),title:"Area for Improvement",description:"Consider reducing position sizes on volatile market days."},{type:"warning",icon:l.jsx(Wu,{className:"text-app-border-color-accent w-6 h-6 2k:w-12 2k:h-12"}),title:"Risk Alert",description:"Your recent trades show increased exposure to market volatility."}];return l.jsxs("div",{className:"bg-app-card border border-app-border-color-soft rounded-xl p-6 2k:p-12",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6 2k:gap-8 2k:mb-10",children:[l.jsx(sf,{className:"text-app-border-color-accent",size:24}),l.jsx("h2",{className:"text-xl font-bold 2k:text-4xl",children:"AI Analysis"})]}),l.jsx("div",{className:"space-y-4 2k:space-y-8",children:e.map((r,n)=>l.jsxs("div",{className:"flex items-start gap-4 p-4 bg-app-input-bg border border-app-border-color rounded-xl 2k:gap-8 2k:p-8",children:[r.icon,l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium mb-1 2k:text-2xl",children:r.title}),l.jsx("p",{className:"text-sm text-gray-400 2k:text-xl",children:r.description})]})]},n))}),l.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-800 2k:mt-12 2k:pt-12",children:[l.jsx("h3",{className:"text-lg font-medium mb-4 2k:text-2xl 2k:mb-8",children:"Suggested Actions"}),l.jsxs("ul",{className:"space-y-2 text-sm text-gray-400 2k:text-xl 2k:space-y-4",children:[l.jsxs("li",{className:"flex items-center gap-2 2k:gap-4",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-app-border-color-accent 2k:w-4 2k:h-4"}),"Review your morning trading strategy for potential optimization"]}),l.jsxs("li",{className:"flex items-center gap-2 2k:gap-4",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-app-border-color-accent 2k:w-4 2k:h-4"}),"Consider implementing stricter stop-loss rules"]}),l.jsxs("li",{className:"flex items-center gap-2 2k:gap-4",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-app-border-color-accent 2k:w-4 2k:h-4"}),"Focus on high-probability setups during market volatility"]})]})]})]})},zv=[{id:1,question:"How well did you follow your trading plan today?",type:"rating"},{id:2,question:"What was your main reason for entering these trades?",type:"choice",choices:["Technical Analysis","News/Fundamental","Price Action","Pattern Recognition","Other"]},{id:3,question:"What could you have done better today?",type:"text"}],yjt=({trades:t})=>{const[e,r]=b.useState(0),[n,i]=b.useState({}),[s,a]=b.useState(!1),o=t.reduce((h,m)=>h+(m.pnl||0),0),u=t.filter(h=>h.pnl&&h.pnl>0).length/t.length*100,d=h=>{i(m=>({...m,[zv[e].id]:h})),e<zv.length-1?r(m=>m+1):a(!0)},f=()=>{const h=zv[e];switch(h.type){case"rating":return l.jsx("div",{className:"flex justify-center gap-4",children:[1,2,3,4,5].map(m=>l.jsx("button",{onClick:()=>d(m),className:"w-12 h-12 rounded-full bg-gray-800 hover:bg-emerald-500 transition-colors flex items-center justify-center text-lg font-medium",children:m},m))});case"choice":return l.jsx("div",{className:"space-y-2",children:h.choices?.map(m=>l.jsx("button",{onClick:()=>d(m),className:"w-full p-3 text-left rounded-lg bg-gray-800 hover:bg-gray-700 transition-colors",children:m},m))});case"text":return l.jsx("div",{children:l.jsx("textarea",{className:"w-full p-3 rounded-lg bg-gray-800 border border-gray-700 focus:outline-hidden focus:ring-2 focus:ring-emerald-500",rows:4,placeholder:"Enter your thoughts here...",onChange:m=>d(m.target.value)})})}};return l.jsxs("div",{className:"bg-gray-900 rounded-xl p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(FE,{className:"text-emerald-500",size:24}),l.jsx("h2",{className:"text-xl font-bold",children:"Daily Review"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"text-gray-400",children:"Win Rate:"}),l.jsxs("span",{className:"ml-2 font-medium",children:[u.toFixed(1),"%"]})]}),l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"text-gray-400",children:"P&L:"}),l.jsx("span",{className:`ml-2 font-medium ${o>0?"text-green-500":o<0?"text-red-500":"text-gray-400"}`,children:Ke(o)})]})]})]}),s?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-start gap-4 p-4 bg-emerald-500/10 border border-emerald-500/20 rounded-lg",children:[l.jsx(Ts,{className:"text-emerald-500 mt-1",size:20}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium mb-1",children:"Daily Insights"}),l.jsx("p",{className:"text-sm text-gray-400",children:"Based on your review, focus on maintaining discipline and following your trading plan. Your best trades today came from technical analysis setups."})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg",children:[l.jsxs("h4",{className:"font-medium mb-2 flex items-center gap-2",children:[l.jsx(E$,{className:"text-green-500",size:16}),"What Worked Well"]}),l.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[l.jsx("li",{children:"• Strong win rate in morning trades"}),l.jsx("li",{children:"• Consistent position sizing"}),l.jsx("li",{children:"• Good risk management"})]})]}),l.jsxs("div",{className:"p-4 bg-gray-800 rounded-lg",children:[l.jsxs("h4",{className:"font-medium mb-2 flex items-center gap-2",children:[l.jsx(C$,{className:"text-red-500",size:16}),"Areas for Improvement"]}),l.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[l.jsx("li",{children:"• Avoid overtrading in choppy markets"}),l.jsx("li",{children:"• Wait for better setups"}),l.jsx("li",{children:"• Take profits more consistently"})]})]})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center mb-8",children:[l.jsxs("h3",{className:"text-lg font-medium mb-2",children:["Question"," ",e+1," ","of"," ",zv.length]}),l.jsx("p",{className:"text-gray-400",children:zv[e].question})]}),f()]})]})},vjt=({trades:t})=>{const r=Xxe(t).map(n=>({time:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")} - ${n.minute===30?`${(n.hour+1).toString().padStart(2,"0")}:00`:`${n.hour.toString().padStart(2,"0")}:30`}`,trades:n.trades,pnl:n.totalPnL,winRate:n.trades>0?n.winningTrades/n.trades*100:0}));return l.jsxs("div",{className:"bg-app-card border border-app-border-color-soft rounded-xl p-2 sm:p-6 2k:p-12",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4 sm:mb-6 2k:gap-8 2k:mb-10",children:[l.jsx(Is,{className:"text-app-border-color-accent",size:24}),l.jsx("h2",{className:"text-xl font-bold 2k:text-4xl",children:"Time Distribution Analysis"})]}),l.jsx("div",{className:"overflow-x-auto no-scrollbar",children:l.jsxs("table",{className:"w-full min-w-[600px] table-auto text-xs sm:text-sm 2k:text-xl",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-left text-gray-400",children:[l.jsx("th",{className:"pb-2 sm:pb-4 2k:text-2xl",children:"Time Slot"}),l.jsx("th",{className:"pb-2 sm:pb-4 2k:text-2xl",children:"Trades"}),l.jsx("th",{className:"pb-2 sm:pb-4 2k:text-2xl",children:"Win Rate"}),l.jsx("th",{className:"pb-2 sm:pb-4 text-right 2k:text-2xl",children:"P&L"}),l.jsx("th",{className:"pb-2 sm:pb-4 2k:text-2xl",children:"Recommendation"})]})}),l.jsx("tbody",{className:"divide-y divide-gray-800",children:r.map((n,i)=>l.jsxs("tr",{children:[l.jsx("td",{className:"py-2 sm:py-4 font-medium 2k:text-2xl",children:n.time}),l.jsx("td",{className:"py-2 sm:py-4 2k:text-2xl",children:n.trades}),l.jsx("td",{className:"py-2 sm:py-4 2k:text-2xl",children:l.jsxs("div",{className:"flex items-center gap-2 2k:gap-4",children:[l.jsx("div",{className:"w-16 h-2 bg-gray-800 rounded-full overflow-hidden 2k:w-32 2k:h-4",children:l.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${n.winRate}%`}})}),l.jsxs("span",{children:[n.winRate.toFixed(1),"%"]})]})}),l.jsx("td",{className:`py-2 sm:py-4 text-right 2k:text-2xl ${n.pnl>0?"text-green-500":"text-red-500"}`,children:Ke(n.pnl)}),l.jsx("td",{className:"py-2 sm:py-4 text-gray-400 2k:text-2xl",children:n.winRate>=60?"Favorable":"Avoid Trading"})]},i))})]})})]})},xjt=({trades:t})=>{const e=[{name:"Morning Breakout",winRate:68,avgPnL:250,occurrences:15},{name:"Trend Reversal",winRate:45,avgPnL:-120,occurrences:8},{name:"Range Breakout",winRate:72,avgPnL:180,occurrences:12}];return l.jsxs("div",{className:"bg-app-card border border-app-border-color-soft rounded-xl p-6 2k:p-12",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6 2k:gap-8 2k:mb-10",children:[l.jsx(dp,{className:"text-app-border-color-accent",size:24}),l.jsx("h2",{className:"text-xl font-bold 2k:text-4xl",children:"Trade Patterns"})]}),l.jsx("div",{className:"space-y-4 2k:space-y-8",children:e.map((r,n)=>l.jsxs("div",{className:"p-4 bg-app-input-bg border border-app-border-color roun
4625ded-xl 2k:p-8",children:[l.jsxs("div",{className:"flex justify-between items-start mb-3 2k:mb-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium 2k:text-2xl",children:r.name}),l.jsxs("p",{className:"text-sm text-gray-400 2k:text-xl",children:[r.occurrences," ","occurrences"]})]}),r.avgPnL>0?l.jsx(_s,{className:"text-green-500",size:20}):l.jsx(Kl,{className:"text-red-500",size:20})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4 2k:gap-8",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-400 mb-1 2k:text-xl 2k:mb-2",children:"Win Rate"}),l.jsxs("p",{className:"font-medium 2k:text-2xl",children:[r.winRate,"%"]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-400 mb-1 2k:text-xl 2k:mb-2",children:"Avg. P&L"}),l.jsx("p",{className:`font-medium 2k:text-2xl ${r.avgPnL>0?"text-green-500":"text-red-500"}`,children:Ke(r.avgPnL)})]})]})]},n))})]})},bjt=()=>{const[t]=b.useState([]),[e]=b.useState(!1),{filters:r}=mjt();if(b.useEffect(()=>{},[r]),e)return l.jsx("div",{className:"flex justify-center items-center h-64",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-app-button-bg-active"})});const n=new Date;n.setHours(0,0,0,0);const i=t.filter(s=>{const a=new Date(s?.entryDate?s.entryDate:Date.now());return a.setHours(0,0,0,0),a.getTime()===n.getTime()});return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-2 sm:gap-0 2k:mt-8",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold 2k:text-5xl",children:"Trade Review"}),l.jsx("p",{className:"text-gray-400 mt-1 2k:text-xl 2k:mt-4",children:"Daily review and learning session"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-app-border-color-accent",children:[l.jsx(sf,{size:24,className:"2k:size-10"}),l.jsx("span",{className:"text-sm 2k:text-3xl",children:"AI Assistant"})]})]}),l.jsx(pjt,{label:"Analysis Period",className:"flex-1 mb-0"}),i.length>0&&l.jsx(yjt,{trades:i}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsx(gjt,{trades:t}),l.jsx(xjt,{trades:t})]}),l.jsx(vjt,{trades:t})]})};function wjt({onDrop:t}){const[e,r]=b.useState(!1),n=b.useCallback(a=>{a.preventDefault(),r(!0)},[]),i=b.useCallback(a=>{a.preventDefault(),r(!1)},[]),s=b.useCallback(a=>{a.preventDefault(),r(!1);const o=a.dataTransfer.files[0];o&&t(o)},[t]);return{isDragging:e,handleDragOver:n,handleDragLeave:i,handleDrop:s}}const _jt=({selectedTagIds:t,onChange:e,userId:r,disabled:n=!1,error:i})=>{const{data:s,loading:a}=S6(r),o=s?.tag||[],c=o.map(u=>({value:u.id,label:l.jsx("span",{className:"inline-flex items-center whitespace-nowrap rounded-lg px-2 py-[3px] text-xs font-medium",style:{backgroundColor:u.backgroundColor,color:u.textColor},children:u.name}),searchText:u.name.toLowerCase()}));return l.jsxs(tn,{label:"Tags",error:i,children:[l.jsx(Lbe,{options:c,selectedValues:t,onChange:e,placeholder:a?"Loading tags...":o.length===0?"No tags available":"Select tags to apply...",width:"w-full",ariaLabel:"Select tags to apply to imported trades",className:Pe(n&&"opacity-50 pointer-events-none")}),l.jsxs("p",{className:"mt-2 font-light text-sm text-app-primary-foreground/70",children:[l.jsx("span",{className:"italic text-xs",children:"(Optional) "}),"Selected tags will be applied to all imported trades."]})]})},Sjt=[{value:"thinkorswim",label:"ThinkOrSwim"},{value:"das",label:"DAS Trader"},{value:"tradestation",label:"TradeStation"},{value:"tradezero",label:"TradeZero"},{value:"webull",label:"Webull"},{value:"lightspeed",label:"Lightspeed"},{value:"tradervue",label:"Tradervue"},{value:"moredge",label:"MorEdge"},{value:"universalimport",label:"Universal Import"}],kjt=({value:t,onChange:e,error:r})=>{function n(i){e(i)}return l.jsx(tn,{label:"Trading Platform",icon:iMe,error:r,children:l.jsx(Ep,{width:"w-full",buttonClassName:"h-12 2k:h-20",value:t,onSelect:n,options:Sjt})})};var Vm={};const Tjt=JSON.parse(`[{"label":"Pacific/Midway (GMT-11:00)","tzCode":"Pacific/Midway","name":"(GMT-11:00) Midway","utc":"-11:00"},{"label":"Pacific/Niue (GMT-11:00)","tzCode":"Pacific/Niue","name":"(GMT-11:00) Alofi","utc":"-11:00"},{"label":"Pacific/Pago_Pago (GMT-11:00)","tzCode":"Pacific/Pago_Pago","name":"(GMT-11:00) Pago Pago, Tāfuna, Ta\`ū, Taulaga","utc":"-11:00"},{"label":"America/Adak (GMT-10:00)","tzCode":"America/Adak","name":"(GMT-10:00) Adak","utc":"-10:00"},{"label":"Pacific/Honolulu (GMT-10:00)","tzCode":"Pacific/Honolulu","name":"(GMT-10:00) Honolulu, East Honolulu, Pearl City, Hilo, Kailua","utc":"-10:00"},{"label":"Pacific/Rarotonga (GMT-10:00)","tzCode":"Pacific/Rarotonga","name":"(GMT-10:00) Avarua","utc":"-10:00"},{"label":"Pacific/Tahiti (GMT-10:00)","tzCode":"Pacific/Tahiti","name":"(GMT-10:00) Faaa, Papeete, Punaauia, Pirae, Mahina","utc":"-10:00"},{"label":"Pacific/Marquesas (GMT-09:30)","tzCode":"Pacific/Marquesas","name":"(GMT-09:30) Taiohae","utc":"-09:30"},{"label":"America/Anchorage (GMT-09:00)","tzCode":"America/Anchorage","name":"(GMT-09:00) Anchorage, Fairbanks, Eagle River, Badger, Knik-Fairview","utc":"-09:00"},{"label":"America/Juneau (GMT-09:00)","tzCode":"America/Juneau","name":"(GMT-09:00) Juneau","utc":"-09:00"},{"label":"America/Metlakatla (GMT-09:00)","tzCode":"America/Metlakatla","name":"(GMT-09:00) Metlakatla","utc":"-09:00"},{"label":"America/Nome (GMT-09:00)","tzCode":"America/Nome","name":"(GMT-09:00) Nome","utc":"-09:00"},{"label":"America/Sitka (GMT-09:00)","tzCode":"America/Sitka","name":"(GMT-09:00) Sitka, Ketchikan","utc":"-09:00"},{"label":"America/Yakutat (GMT-09:00)","tzCode":"America/Yakutat","name":"(GMT-09:00) Yakutat","utc":"-09:00"},{"label":"Pacific/Gambier (GMT-09:00)","tzCode":"Pacific/Gambier","name":"(GMT-09:00) Gambier","utc":"-09:00"},{"label":"America/Los_Angeles (GMT-08:00)","tzCode":"America/Los_Angeles","name":"(GMT-08:00) Los Angeles, San Diego, San Jose, San Francisco, Seattle","utc":"-08:00"},{"label":"America/Tijuana (GMT-08:00)","tzCode":"America/Tijuana","name":"(GMT-08:00) Tijuana, Mexicali, Ensenada, Rosarito, Tecate","utc":"-08:00"},{"label":"America/Vancouver (GMT-08:00)","tzCode":"America/Vancouver","name":"(GMT-08:00) Vancouver, Surrey, Okanagan, Victoria, Burnaby","utc":"-08:00"},{"label":"Pacific/Pitcairn (GMT-08:00)","tzCode":"Pacific/Pitcairn","name":"(GMT-08:00) Adamstown","utc":"-08:00"}
4625,{"label":"America/Boise (GMT-07:00)","tzCode":"America/Boise","name":"(GMT-07:00) Boise, Meridian, Nampa, Idaho Falls, Pocatello","utc":"-07:00"},{"label":"America/Cambridge_Bay (GMT-07:00)","tzCode":"America/Cambridge_Bay","name":"(GMT-07:00) Cambridge Bay","utc":"-07:00"},{"label":"America/Chihuahua (GMT-07:00)","tzCode":"America/Chihuahua","name":"(GMT-07:00) Chihuahua, Ciudad Delicias, Cuauhtémoc, Parral, Nuevo Casas Grandes","utc":"-07:00"},{"label":"America/Creston (GMT-07:00)","tzCode":"America/Creston","name":"(GMT-07:00) Creston","utc":"-07:00"},{"label":"America/Dawson (GMT-07:00)","tzCode":"America/Dawson","name":"(GMT-07:00) Dawson","utc":"-07:00"},{"label":"America/Dawson_Creek (GMT-07:00)","tzCode":"America/Dawson_Creek","name":"(GMT-07:00) Fort St. John, Dawson Creek","utc":"-07:00"},{"label":"America/Denver (GMT-07:00)","tzCode":"America/Denver","name":"(GMT-07:00) Denver, El Paso, Albuquerque, Colorado Springs, Aurora","utc":"-07:00"},{"label":"America/Edmonton (GMT-07:00)","tzCode":"America/Edmonton","name":"(GMT-07:00) Calgary, Edmonton, Fort McMurray, Red Deer, Lethbridge","utc":"-07:00"},{"label":"America/Fort_Nelson (GMT-07:00)","tzCode":"America/Fort_Nelson","name":"(GMT-07:00) Fort Nelson","utc":"-07:00"},{"label":"America/Hermosillo (GMT-07:00)","tzCode":"America/Hermosillo","name":"(GMT-07:00) Hermosillo, Ciudad Obregón, Nogales, San Luis Río Colorado, Navojoa","utc":"-07:00"},{"label":"America/Inuvik (GMT-07:00)","tzCode":"America/Inuvik","name":"(GMT-07:00) Inuvik","utc":"-07:00"},{"label":"America/Mazatlan (GMT-07:00)","tzCode":"America/Mazatlan","name":"(GMT-07:00) Culiacán, Mazatlán, Tepic, Los Mochis, La Paz","utc":"-07:00"},{"label":"America/Ojinaga (GMT-07:00)","tzCode":"America/Ojinaga","name":"(GMT-07:00) Ciudad Juárez, Manuel Ojinaga, Ojinaga","utc":"-07:00"},{"label":"America/Phoenix (GMT-07:00)","tzCode":"America/Phoenix","name":"(GMT-07:00) Phoenix, Tucson, Mesa, Chandler, Gilbert","utc":"-07:00"},{"label":"America/Whitehorse (GMT-07:00)","tzCode":"America/Whitehorse","name":"(GMT-07:00) Whitehorse","utc":"-07:00"},{"label":"America/Yellowknife (GMT-07:00)","tzCode":"America/Yellowknife","name":"(GMT-07:00) Yellowknife","utc":"-07:00"},{"label":"America/Bahia_Banderas (GMT-06:00)","tzCode":"America/Bahia_Banderas","name":"(GMT-06:00) Mezcales, San Vicente, Bucerías, Valle de Banderas","utc":"-06:00"},{"label":"America/Belize (GMT-06:00)","tzCode":"America/Belize","name":"(GMT-06:00) Belize City, San Ignacio, Orange Walk, Belmopan, Dangriga","utc":"-06:00"},{"label":"America/Chicago (GMT-06:00)","tzCode":"America/Chicago","name":"(GMT-06:00) Chicago, Houston, San Antonio, Dallas, Austin","utc":"-06:00"},{"label":"America/Costa_Rica (GMT-06:00)","tzCode":"America/Costa_Rica","name":"(GMT-06:00) San José, Limón, San Francisco, Alajuela, Liberia","utc":"-06:00"},{"label":"America/El_Salvador (GMT-06:00)","tzCode":"America/El_Salvador","name":"(GMT-06:00) San Salvador, Soyapango, Santa Ana, San Miguel, Mejicanos","utc":"-06:00"},{"label":"America/Guatemala (GMT-06:00)","tzCode":"America/Guatemala","name":"(GMT-06:00) Guatemala City, Mixco, Villa Nueva, Petapa, San Juan Sacatepéquez","utc":"-06:00"},{"label":"America/Indiana/Knox (GMT-06:00)","tzCode":"America/Indiana/Knox","name":"(GMT-06:00) Knox","utc":"-06:00"},{"label":"America/Indiana/Tell_City (GMT-06:00)","tzCode":"America/Indiana/Tell_City","name":"(GMT-06:00) Tell City","utc":"-06:00"},{"label":"America/Managua (GMT-06:00)","tzCode":"America/Managua","name":"(GMT-06:00) Managua, León, Masaya, Chinandega, Matagalpa","utc":"-06:00"},{"label":"America/Matamoros (GMT-06:00)","tzCode":"America/Matamoros","name":"(GMT-06:00) Reynosa, Heroica Matamoros, Nuevo Laredo, Piedras Negras, Ciudad Acuña","utc":"-06:00"},{"label":"America/Menominee (GMT-06:00)","tzCode":"America/Menominee","name":"(GMT-06:00) Menominee, Iron Mountain, Kingsford, Ironwood, Iron River","utc":"-06:00"},{"label":"America/Merida (GMT-06:00)","tzCode":"America/Merida","name":"(GMT-06:00) Mérida, Campeche, Ciudad del Carmen, Kanasín, Valladolid","utc":"-06:00"},{"label":"America/Mexico_City (GMT-06:00)","tzCode":"America/Mexico_City","name":"(GMT-06:00) Mexico City, Iztapalapa, Ecatepec de Morelos, Guadalajara, Puebla","utc":"-06:00"},{"label":"America/Monterrey (GMT-06:00)","tzCode":"America/Monterrey","name":"(GMT-06:00) Monterrey, Saltillo, Guadalupe, Torreón, Victoria de Durango","utc":"-06:00"},{"label":"America/North_Dakota/Beulah (GMT-06:00)","tzCode":"America/North_Dakota/Beulah","name":"(GMT-06:00) Beulah","utc":"-06:00"},{"label":"America/North_Dakota/Center (GMT-06:00)","tzCode":"America/North_Dakota/Center","name":"(GMT-06:00) Center","utc":"-06:00"},{"label":"America/North_Dakota/New_Salem (GMT-06:00)","tzCode":"America/North_Dakota/New_Salem","name":"(GMT-06:00) Mandan","utc":"-06:00"},{"label":"America/Rainy_River (GMT-06:00)","tzCode":"America/Rainy_River","name":"(GMT-06:00) Rainy River","utc":"-06:00"},{"label":"America/Rankin_Inlet (GMT-06:00)","tzCode":"America/Rankin_Inlet","name":"(GMT-06:00) Rankin Inlet","utc":"-06:00"},{"label":"America/Regina (GMT-06:00)","tzCode":"America/Regina","name":"(GMT-06:00) Saskatoon, Regina, Prince Albert, Moose Jaw, North Battleford","utc":"-06:00"},{"label":"America/Resolute (GMT-06:00)","tzCode":"America/Resolute","name":"(GMT-06:00) Resolute","utc":"-06:00"},{"label":"America/Swift_Current (GMT-06:00)","tzCode":"America/Swift_Current","name":"(GMT-06:00) Swift Current","utc":"-06:00"},{"label":"America/Tegucigalpa (GMT-06:00)","tzCode":"America/Tegucigalpa","name":"(GMT-06:00) Tegucigalpa, San Pedro Sula, Choloma, La Ceiba, El Progreso","utc":"-06:00"},{"label":"America/Winnipeg (GMT-06:00)","tzCode":"America/Winnipeg","name":"(GMT-06:00) Winnipeg, Brandon, Kenora, Portage la Prairie, Thompson","utc":"-06:00"},{"label":"Pacific/Easter (GMT-06:00)","tzCode":"Pacific/Easter","name":"(GMT-06:00) Easter","utc":"-06:00"},{"label":"Pacific/Galapagos (GMT-06:00)","tzCode":"Pacific/Galapagos","name":"(GMT-06:00) Puerto Ayora, Puerto Baquerizo Moreno","utc":"-06:00"},{"label":"America/Atikokan (GMT-05:00)","tzCode":"America/Atikokan","name":"(GMT-05:00) Atikokan","utc":"-05:00"},{"label":"America/Bogota (GMT-05:00)","tzCode":"America/Bogota","name":"(GMT-05:00) Bogotá, Cali, Medellín, Barranquilla, Cartagena","utc":"-05:00"},{"label":"America/Cancun (GMT-05:00)","tzCode":"America/Cancun","name":"(GMT-05:00) Cancún, Chetumal, Playa del Carmen, Cozumel, Felipe Carrillo Puerto","utc":"-05:00"},{"label":"America/Cayman (GMT-05:00)","tzCode":"America/Cayman","name":"(GMT-05:00) George Town, West Bay, Bodden Town, East End, North Side","utc":"-05:00"},{"label":"America/Detroit (GMT-05:00)","tzCode":"America/Detroit","name":"(GMT-05:00) Detroit, Grand Rapids, Warren, Sterling Heights, Ann Arbor","utc":"-05:00"},{"label":"America/Eirunepe (GMT-05:00)","tzCode":"America/Eirunepe","name":"(GMT-05:00) Eirunepé, Benjamin Constant, Envira","utc":"-05:00"},{"label":"America/Grand_Turk (GMT-05:00)","tzCode":"America/Grand_Turk","name":"(GMT-05:00) Cockburn Town","utc":"-05:00"},{"label":"America/Guayaquil (GMT-05:00)","tzCode":"America/Guayaquil","name":"(GMT-05:00) Guayaquil, Quito, Cuenca, Santo Domingo de los Colorados, Machala","utc":"-05:00"},{"label":"America/Havana (GMT-05:00)","tzCode":"America/Havana","name":"(GMT-05:00) Havana, Santiago de Cuba, Camagüey, Holguín, Guantánamo","utc":"-05:00"},{"label":"America/Indiana/Indianapolis (GMT-05:00)","tzCode":"America/Indiana/Indianapolis","name":"(GMT-05:00) Indianapolis, Fort Wayne, South Bend, Carmel, Bloomington","utc":"-05:00"},{"label":"America/Indiana/Marengo (GMT-05:00)","tzCode":"America/Indiana/Marengo","name":"(GMT-05:00) Marengo","utc":"-05:00"},{"label":"America/Indiana/Petersburg (GMT-05:00)","tzCode":"America/Indiana/Petersburg","name":"(GMT-05:00) Petersburg","utc":"-05:00"},{"label":"America/Indiana/Vevay (GMT-05:00)","tzCode":"America/Indiana/Vevay","name":"(GMT-05:00) Vevay","utc":"-05:00"},{"label":"America/Indiana/Vincennes (GMT-05:00)","tzCode":"America/Indiana/Vincennes","name":"(GMT-05:00) Vincennes, Jasper, Washington, Huntingburg","utc":"-05:00"},{"label":"America/Indiana/Winamac (GMT-05:00)","tzCode":"America/Indiana/Winamac","name":"(GMT-05:00) Winamac","utc":"-05:00"},{"label":"America/Iqaluit (GMT-05:00)","tzCode":"America/Iqaluit","name":"(GMT-05:00) Iqaluit","utc":"-05:00"},{"label":"America/Jamaica (GMT-05:00)","tzCode":"America/Jamaica","name":"(GMT-05:00) Kingston, New Kingston, Spanish Town, Portmore, Montego Bay","utc":"-05:00"},{"label":"America/Kentucky/Louisville (GMT-05:00)","tzCode":"America/Kentucky/Louisville","name":"(GMT-05:00) Louisville, Jeffersonville, New Albany, Jeffersontown, Pleasure Ridge Park","utc":"-05:00"},{"label":"America/Kentucky/Monticello (GMT-05:00)","tzCode":"America/Kentucky/Monticello","name":"(GMT-05:00) Monticello","utc":"-05:00"}
4625,{"label":"America/Lima (GMT-05:00)","tzCode":"America/Lima","name":"(GMT-05:00) Lima, Arequipa, Callao, Trujillo, Chiclayo","utc":"-05:00"},{"label":"America/Nassau (GMT-05:00)","tzCode":"America/Nassau","name":"(GMT-05:00) Nassau, Lucaya, Freeport, West End, Cooper’s Town","utc":"-05:00"},{"label":"America/New_York (GMT-05:00)","tzCode":"America/New_York","name":"(GMT-05:00) New York City, Brooklyn, Queens, Philadelphia, Manhattan","utc":"-05:00"},{"label":"America/Nipigon (GMT-05:00)","tzCode":"America/Nipigon","name":"(GMT-05:00) Nipigon","utc":"-05:00"},{"label":"America/Panama (GMT-05:00)","tzCode":"America/Panama","name":"(GMT-05:00) Panamá, San Miguelito, Juan Díaz, David, Arraiján","utc":"-05:00"},{"label":"America/Pangnirtung (GMT-05:00)","tzCode":"America/Pangnirtung","name":"(GMT-05:00) Pangnirtung","utc":"-05:00"},{"label":"America/Port-au-Prince (GMT-05:00)","tzCode":"America/Port-au-Prince","name":"(GMT-05:00) Port-au-Prince, Carrefour, Delmas 73, Pétionville, Port-de-Paix","utc":"-05:00"},{"label":"America/Rio_Branco (GMT-05:00)","tzCode":"America/Rio_Branco","name":"(GMT-05:00) Rio Branco, Cruzeiro do Sul, Sena Madureira, Tarauacá, Feijó","utc":"-05:00"},{"label":"America/Thunder_Bay (GMT-05:00)","tzCode":"America/Thunder_Bay","name":"(GMT-05:00) Thunder Bay","utc":"-05:00"},{"label":"America/Toronto (GMT-05:00)","tzCode":"America/Toronto","name":"(GMT-05:00) Toronto, Montréal, Ottawa, Mississauga, Québec","utc":"-05:00"},{"label":"America/Anguilla (GMT-04:00)","tzCode":"America/Anguilla","name":"(GMT-04:00) The Valley, Blowing Point Village, Sandy Ground Village, The Quarter, Sandy Hill","utc":"-04:00"},{"label":"America/Antigua (GMT-04:00)","tzCode":"America/Antigua","name":"(GMT-04:00) Saint John’s, Piggotts, Bolands, Codrington, Parham","utc":"-04:00"},{"label":"America/Aruba (GMT-04:00)","tzCode":"America/Aruba","name":"(GMT-04:00) Oranjestad, Tanki Leendert, San Nicolas, Santa Cruz, Paradera","utc":"-04:00"},{"label":"America/Asuncion (GMT-04:00)","tzCode":"America/Asuncion","name":"(GMT-04:00) Asunción, Ciudad del Este, San Lorenzo, Capiatá, Lambaré","utc":"-04:00"},{"label":"America/Barbados (GMT-04:00)","tzCode":"America/Barbados","name":"(GMT-04:00) Bridgetown, Speightstown, Oistins, Bathsheba, Holetown","utc":"-04:00"},{"label":"America/Blanc-Sablon (GMT-04:00)","tzCode":"America/Blanc-Sablon","name":"(GMT-04:00) Lévis","utc":"-04:00"},{"label":"America/Boa_Vista (GMT-04:00)","tzCode":"America/Boa_Vista","name":"(GMT-04:00) Boa Vista","utc":"-04:00"},{"label":"America/Campo_Grande (GMT-04:00)","tzCode":"America/Campo_Grande","name":"(GMT-04:00) Campo Grande, Dourados, Corumbá, Três Lagoas, Ponta Porã","utc":"-04:00"},{"label":"America/Caracas (GMT-04:00)","tzCode":"America/Caracas","name":"(GMT-04:00) Caracas, Maracaibo, Maracay, Valencia, Barquisimeto","utc":"-04:00"},{"label":"America/Cuiaba (GMT-04:00)","tzCode":"America/Cuiaba","name":"(GMT-04:00) Cuiabá, Várzea Grande, Rondonópolis, Sinop, Barra do Garças","utc":"-04:00"},{"label":"America/Curacao (GMT-04:00)","tzCode":"America/Curacao","name":"(GMT-04:00) Willemstad, Sint Michiel Liber","utc":"-04:00"},{"label":"America/Dominica (GMT-04:00)","tzCode":"America/Dominica","name":"(GMT-04:00) Roseau, Portsmouth, Berekua, Saint Joseph, Wesley","utc":"-04:00"},{"label":"America/Glace_Bay (GMT-04:00)","tzCode":"America/Glace_Bay","name":"(GMT-04:00) Sydney, Glace Bay, Sydney Mines","utc":"-04:00"},{"label":"America/Goose_Bay (GMT-04:00)","tzCode":"America/Goose_Bay","name":"(GMT-04:00) Labrador City, Happy Valley-Goose Bay","utc":"-04:00"},{"label":"America/Grenada (GMT-04:00)","tzCode":"America/Grenada","name":"(GMT-04:00) Saint George's, Gouyave, Grenville, Victoria, Saint David’s","utc":"-04:00"},{"label":"America/Guadeloupe (GMT-04:00)","tzCode":"America/Guadeloupe","name":"(GMT-04:00) Les Abymes, Baie-Mahault, Le Gosier, Petit-Bourg, Sainte-Anne","utc":"-04:00"},{"label":"America/Guyana (GMT-04:00)","tzCode":"America/Guyana","name":"(GMT-04:00) Georgetown, Linden, New Amsterdam, Anna Regina, Bartica","utc":"-04:00"},{"label":"America/Halifax (GMT-04:00)","tzCode":"America/Halifax","name":"(GMT-04:00) Halifax, Dartmouth, Charlottetown, Lower Sackville, Truro","utc":"-04:00"},{"label":"America/Kralendijk (GMT-04:00)","tzCode":"America/Kralendijk","name":"(GMT-04:00) Kralendijk, Oranjestad, The Bottom","utc":"-04:00"},{"label":"America/La_Paz (GMT-04:00)","tzCode":"America/La_Paz","name":"(GMT-04:00) Santa Cruz de la Sierra, Cochabamba, La Paz, Sucre, Oruro","utc":"-04:00"},{"label":"America/Lower_Princes (GMT-04:00)","tzCode":"America/Lower_Princes","name":"(GMT-04:00) Cul de Sac, Lower Prince’s Quarter, Koolbaai, Philipsburg","utc":"-04:00"},{"label":"America/Manaus (GMT-04:00)","tzCode":"America/Manaus","name":"(GMT-04:00) Manaus, Itacoatiara, Parintins, Manacapuru, Coari","utc":"-04:00"},{"label":"America/Marigot (GMT-04:00)","tzCode":"America/Marigot","name":"(GMT-04:00) Marigot","utc":"-04:00"},{"label":"America/Martinique (GMT-04:00)","tzCode":"America/Martinique","name":"(GMT-04:00) Fort-de-France, Le Lamentin, Le Robert, Sainte-Marie, Le François","utc":"-04:00"},{"label":"America/Moncton (GMT-04:00)","tzCode":"America/Moncton","name":"(GMT-04:00) Moncton, Saint John, Fredericton, Dieppe, Miramichi","utc":"-04:00"},{"label":"America/Montserrat (GMT-04:00)","tzCode":"America/Montserrat","name":"(GMT-04:00) Brades, Saint Peters, Plymouth","utc":"-04:00"},{"label":"America/Porto_Velho (GMT-04:00)","tzCode":"America/Porto_Velho","name":"(GMT-04:00) Porto Velho, Ji Paraná, Vilhena, Ariquemes, Cacoal","utc":"-04:00"},{"label":"America/Port_of_Spain (GMT-04:00)","tzCode":"America/Port_of_Spain","name":"(GMT-04:00) Chaguanas, Mon Repos, San Fernando, Port of Spain, Rio Claro","utc":"-04:00"},{"label":"America/Puerto_Rico (GMT-04:00)","tzCode":"America/Puerto_Rico","name":"(GMT-04:00) San Juan, Bayamón, Carolina, Ponce, Caguas","utc":"-04:00"},{"label":"America/Santiago (GMT-04:00)","tzCode":"America/Santiago","name":"(GMT-04:00) Santiago, Puente Alto, Antofagasta, Viña del Mar, Valparaíso","utc":"-04:00"},{"label":"America/Santo_Domingo (GMT-04:00)","tzCode":"America/Santo_Domingo","name":"(GMT-04:00) Santo Domingo, Santiago de los Caballeros, Santo Domingo Oeste, Santo Domingo Este, San Pedro de Macorís","utc":"-04:00"},{"label":"America/St_Barthelemy (GMT-04:00)","tzCode":"America/St_Barthelemy","name":"(GMT-04:00) Gustavia","utc":"-04:00"},{"label":"America/St_Kitts (GMT-04:00)","tzCode":"America/St_Kitts","name":"(GMT-04:00) Basseterre, Fig Tree, Market Shop, Saint Paul’s, Middle Island","utc":"-04:00"},{"label":"America/St_Lucia (GMT-04:00)","tzCode":"America/St_Lucia","name":"(GMT-04:00) Castries, Bisee, Vieux Fort, Micoud, Soufrière","utc":"-04:00"},{"label":"America/St_Thomas (GMT-04:00)","tzCode":"America/St_Thomas","name":"(GMT-04:00) Saint Croix, Charlotte Amalie, Cruz Bay","utc":"-04:00"},{"label":"America/St_Vincent (GMT-04:00)","tzCode":"America/St_Vincent","name":"(GMT-04:00) Kingstown, Kingstown Park, Georgetown, Barrouallie, Port Elizabeth","utc":"-04:00"},{"label":"America/Thule (GMT-04:00)","tzCode":"America/Thule","name":"(GMT-04:00) Thule","utc":"-04:00"},{"label":"America/Tortola (GMT-04:00)","tzCode":"America/Tortola","name":"(GMT-04:00) Road Town","utc":"-04:00"},{"label":"Atlantic/Bermuda (GMT-04:00)","tzCode":"Atlantic/Bermuda","name":"(GMT-04:00) Hamilton","utc":"-04:00"},{"label":"America/St_Johns (GMT-03:30)","tzCode":"America/St_Johns","name":"(GMT-03:30) St. John's, Mount Pearl, Corner Brook, Conception Bay South, Bay Roberts","utc":"-03:30"},{"label":"America/Araguaina (GMT-03:00)","tzCode":"America/Araguaina","name":"(GMT-03:00) Palmas, Araguaína, Gurupi, Miracema do Tocantins, Porto Franco","utc":"-03:00"},{"label":"America/Argentina/Buenos_Aires (GMT-03:00)","tzCode":"America/Argentina/Buenos_Aires","name":"(GMT-03:00) Buenos Aires, La Plata, Mar del Plata, Morón, Bahía Blanca","utc":"-03:00"},{"label":"America/Argentina/Catamarca (GMT-03:00)","tzCode":"America/Argentina/Catamarca","name":"(GMT-03:00) San Fernando del Valle de Catamarca, Trelew, Puerto Madryn, Esquel, Rawson","utc":"-03:00"},{"label":"America/Argentina/Cordoba (GMT-03:00)","tzCode":"America/Argentina/Cordoba","name":"(GMT-03:00) Córdoba, Rosario, Santa Fe, Resistencia, Santiago del Estero","utc":"-03:00"},{"label":"America/Argentina/Jujuy (GMT-03:00)","tzCode":"America/Argentina/Jujuy","name":"(GMT-03:00) San Salvador de Jujuy, San Pedro de Jujuy, Libertador General San Martín, Palpalá, La Quiaca","utc":"-03:00"},{"label":"America/Argentina/La_Rioja (GMT-03:00)","tzCode":"America/Argentina/La_Rioja","name":"(GMT-03:00) La Rioja, Chilecito, Arauco, Chamical","utc":"-03:00"},{"label":"America/Argentina/Mendoza (GMT-03:00)","tzCode":"America/Argentina/Mendoza","name":"(GMT-03:00) Mendoza, San Rafael, San Martín","utc":"-03:00"},{"label":"America/Argentina/Rio_Gallegos (GMT-03:00)","tzCode":"America/Argentina/Rio_Gallegos","name":"(GMT-03:00) Comodoro Rivadavia, Río Gallegos, Caleta Olivia, Pico Truncado, Puerto Deseado","utc":"-03:00"},{"label":"America/Argentina/Salta (GMT-03:00)","tzCode":"America/Argentina/Salta","name":"(GMT-03:00) Salta, Neuquén, Santa Rosa, San Carlos de Bariloche, Cipolletti","utc":"-03:00"},{"label":"America/Argentina/San_Juan (GMT-03:00)","tzCode":"America/Argentina/San_Juan","name":"(GMT-03:00) San Juan, Chimbas, Santa Lucía, Pocito, Caucete","utc":"-03:00"},{"label":"America/Argentina/San_Luis (GMT-03:00)","tzCode":"America/Argentina/San_Luis","name":"(GMT-03:00) San Luis, Villa Mercedes, La Punta, Merlo, Justo Daract","utc":"-03:00"},{"label":"America/Argentina/Tucuman (GMT-03:00)","tzCode":"America/Argentina/Tucuman","name":"(GMT-03:00) San Miguel de Tucumán, Yerba Buena, Tafí Viejo, Alderetes, Aguilares","utc":"-03:00"},{"label":"America/Argentina/Ushuaia (GMT-03:00)","tzCode":"America/Argentina/Ushuaia","name":"(GMT-03:00) Ushuaia, Río Grande","utc":"-03:00"},{"label":"America/Bahia (GMT-03:00)","tzCode":"America/Bahia","name":"(GMT-03:00) Salvador, Feira de Santana, Vitória da Conquista, Itabuna, Camaçari","utc":"-03:00"},{"label":"America/Belem (GMT-03:00)","tzCode":"America/Belem","name":"(GMT-03:00) Belém, Ananindeua, Macapá, Parauapebas, Marabá","utc":"-03:00"},{"label":"America/Cayenne (GMT-03:00)","tzCode":"America/Cayenne","name":"(GMT-03:00) Cayenne, Matoury, Saint-Laurent-du-Maroni, Kourou, Rémire-Montjoly","utc":"-03:00"},{"label":"America/Fortaleza (GMT-03:00)","tzCode":"America/Fortaleza","name":"(GMT-03:00) Fortaleza, São Luís, Natal, Teresina, João Pessoa","utc":"-03:00"},{"label":"America/Godthab (GMT-03:00)","tzCode":"America/Godthab","name":"(GMT-03:00) Nuuk, Sisimiut, Ilulissat, Qaqortoq, Aasiaat","utc":"-03:00"},{"label":"America/Maceio (GMT-03:00)","tzCode":"America/Maceio","name":"(GMT-03:00) Maceió, Aracaju, Arapiraca, Nossa Senhora do Socorro, São Cristóvão","utc":"-03:00"},{"label":"America/Miquelon (GMT-03:00)","tzCode":"America/Miquelon","name":"(GMT-03:00) Saint-Pierre, Miquelon","utc":"-03:00"},{"label":"America/Montevideo (GMT-03:00)","tzCode":"America/Montevideo","name":"(GMT-03:00) Montevideo, Salto, Paysandú, Las Piedras, Rivera","utc":"-03:00"},{"label":"America/Paramaribo (GMT-03:00)","tzCode":"America/Paramaribo","name":"(GMT-03:00) Paramaribo, Lelydorp, Brokopondo, Nieuw Nickerie, Moengo","utc":"-03:00"},{"label":"America/Punta_Arenas (GMT-03:00)","tzCode":"America/Punta_Arenas","name":"(GMT-03:00) Punta Arenas, Puerto Natales","utc":"-03:00"},{"label":"America/Recife (GMT-03:00)","tzCode":"America/Recife","name":"(GMT-03:00) Recife, Jaboatão, Jaboatão dos Guararapes, Olinda, Paulista","utc":"-03:00"},{"label":"America/Santarem (GMT-03:00)","tzCode":"America/Santarem","name":"(GMT-03:00) Santarém, Altamira, Itaituba, Oriximiná, Alenquer","utc":"-03:00"},{"label":"America/Sao_Paulo (GMT-03:00)","tzCode":"America/Sao_Paulo","name":"(GMT-03:00) São Paulo, Rio de Janeiro, Belo Horizonte, Brasília, Curitiba","utc":"-03:00"},{"label":"Antarctica/Palmer (GMT-03:00)","tzCode":"Antarctica/Palmer","name":"(GMT-03:00) Palmer","utc":"-03:00"},{"label":"Antarctica/Rothera (GMT-03:00)","tzCode":"Antarctica/Rothera","name":"(GMT-03:00) Rothera","utc":"-03:00"},{"label":"Atlantic/Stanley (GMT-03:00)","tzCode":"Atlantic/Stanley","name":"(GMT-03:00) Stanley","utc":"-03:00"},{"label":"America/Noronha (GMT-02:00)","tzCode":"America/Noronha","name":"(GMT-02:00) Itamaracá","utc":"-02:00"},{"label":"Atlantic/South_Georgia (GMT-02:00)","tzCode":"Atlantic/South_Georgia","name":"(GMT-02:00) Grytviken","utc":"-02:00"},{"label":"America/Scoresbysund (GMT-01:00)","tzCode":"America/Scoresbysund","name":"(GMT-01:00) Scoresbysund","utc":"-01:00"},{"label":"Atlantic/Azores (GMT-01:00)","tzCode":"Atlantic/Azores","name":"(GMT-01:00) Ponta Delgada, Lagoa, Angra do Heroísmo, Rosto de Cão, Rabo de Peixe","utc":"-01:00"},{"label":"Atlantic/Cape_Verde (GMT-01:00)","tzCode":"Atlantic/Cape_Verde","name":"(GMT-01:00) Praia, Mindelo, Santa Maria, Cova Figueira, Santa Cruz","utc":"-01:00"},{"label":"Africa/Abidjan (GMT+00:00)","tzCode":"Africa/Abidjan","name":"(GMT+00:00) Abidjan, Abobo, Bouaké, Daloa, San-Pédro","utc":"+00:00"},{"label":"Africa/Accra (GMT+00:00)","tzCode":"Africa/Accra","name":"(GMT+00:00) Accra, Kumasi, Tamale, Takoradi, Atsiaman","utc":"+00:00"},{"label":"Africa/Bamako (GMT+00:00)","tzCode":"Africa/Bamako","name":"(GMT+00:00) Bamako, Sikasso, Mopti, Koutiala, Ségou","utc":"+00:00"},{"label":"Africa/Banjul (GMT+00:00)","tzCode":"Africa/Banjul","name":"(GMT+00:00) Serekunda, Brikama, Bakau, Banjul, Farafenni","utc":"+00:00"},{"label":"Africa/Bissau (GMT+00:00)","tzCode":"Africa/Bissau","name":"(GMT+00:00) Bissau, Bafatá, Gabú, Bissorã, Bolama","utc":"+00:00"},{"label":"Africa/Casablanca (GMT+00:00)","tzCode":"Africa/Casablanca","name":"(GMT+00:00) Casablanca, Rabat, Fès, Sale, Marrakesh","utc":"+00:00"},{"label":"Africa/Conakry (GMT+00:00)","tzCode":"Africa/Conakry","name":"(GMT+00:00) Camayenne, Conakry, Nzérékoré, Kindia, Kankan","utc":"+00:00"},{"label":"Africa/Dakar (GMT+00:00)","tzCode":"Africa/Dakar","name":"(GMT+00:00) Dakar, Pikine, Touba, Thiès, Thiès Nones","utc":"+00:00"},{"label":"Africa/El_Aaiun (GMT+00:00)","tzCode":"Africa/El_Aaiun","name":"(GMT+00:00) Laayoune, Dakhla, Laayoune Plage","utc":"+00:00"},{"label":"Africa/Freetown (GMT+00:00)","tzCode":"Africa/Freetown","
4625name":"(GMT+00:00) Freetown, Bo, Kenema, Koidu, Makeni","utc":"+00:00"},{"label":"Africa/Lome (GMT+00:00)","tzCode":"Africa/Lome","name":"(GMT+00:00) Lomé, Sokodé, Kara, Atakpamé, Kpalimé","utc":"+00:00"},{"label":"Africa/Monrovia (GMT+00:00)","tzCode":"Africa/Monrovia","name":"(GMT+00:00) Monrovia, Gbarnga, Kakata, Bensonville, Harper","utc":"+00:00"},{"label":"Africa/Nouakchott (GMT+00:00)","tzCode":"Africa/Nouakchott","name":"(GMT+00:00) Nouakchott, Nouadhibou, Néma, Kaédi, Rosso","utc":"+00:00"},{"label":"Africa/Ouagadougou (GMT+00:00)","tzCode":"Africa/Ouagadougou","name":"(GMT+00:00) Ouagadougou, Bobo-Dioulasso, Koudougou, Ouahigouya, Banfora","utc":"+00:00"},{"label":"Africa/Sao_Tome (GMT+00:00)","tzCode":"Africa/Sao_Tome","name":"(GMT+00:00) São Tomé, Santo António","utc":"+00:00"},{"label":"America/Danmarkshavn (GMT+00:00)","tzCode":"America/Danmarkshavn","name":"(GMT+00:00) Danmarkshavn","utc":"+00:00"},{"label":"Antarctica/Troll (GMT+00:00)","tzCode":"Antarctica/Troll","name":"(GMT+00:00) Troll","utc":"+00:00"},{"label":"Atlantic/Canary (GMT+00:00)","tzCode":"Atlantic/Canary","name":"(GMT+00:00) Las Palmas de Gran Canaria, Santa Cruz de Tenerife, La Laguna, Telde, Arona","utc":"+00:00"},{"label":"Atlantic/Faroe (GMT+00:00)","tzCode":"Atlantic/Faroe","name":"(GMT+00:00) Tórshavn, Klaksvík, Fuglafjørður, Tvøroyri, Miðvágur","utc":"+00:00"},{"label":"Atlantic/Madeira (GMT+00:00)","tzCode":"Atlantic/Madeira","name":"(GMT+00:00) Funchal, Câmara de Lobos, São Martinho, Caniço, Machico","utc":"+00:00"},{"label":"Atlantic/Reykjavik (GMT+00:00)","tzCode":"Atlantic/Reykjavik","name":"(GMT+00:00) Reykjavík, Kópavogur, Hafnarfjörður, Akureyri, Garðabær","utc":"+00:00"},{"label":"Atlantic/St_Helena (GMT+00:00)","tzCode":"Atlantic/St_Helena","name":"(GMT+00:00) Jamestown, Georgetown, Edinburgh of the Seven Seas","utc":"+00:00"},{"label":"Europe/Dublin (GMT+00:00)","tzCode":"Europe/Dublin","name":"(GMT+00:00) Dublin, Cork, Luimneach, Gaillimh, Tallaght","utc":"+00:00"},{"label":"Europe/Guernsey (GMT+00:00)","tzCode":"Europe/Guernsey","name":"(GMT+00:00) Saint Peter Port, St Martin, Saint Sampson, St Anne, Saint Saviour","utc":"+00:00"},{"label":"Europe/Isle_of_Man (GMT+00:00)","tzCode":"Europe/Isle_of_Man","name":"(GMT+00:00) Douglas, Ramsey, Peel, Port Erin, Castletown","utc":"+00:00"},{"label":"Europe/Jersey (GMT+00:00)","tzCode":"Europe/Jersey","name":"(GMT+00:00) Saint Helier, Le Hocq","utc":"+00:00"},{"label":"Europe/Lisbon (GMT+00:00)","tzCode":"Europe/Lisbon","name":"(GMT+00:00) Lisbon, Porto, Amadora, Braga, Setúbal","utc":"+00:00"},{"label":"Europe/London (GMT+00:00)","tzCode":"Europe/London","name":"(GMT+00:00) London, Birmingham, Liverpool, Sheffield, Bristol","utc":"+00:00"},{"label":"Africa/Algiers (GMT+01:00)","tzCode":"Africa/Algiers","name":"(GMT+01:00) Algiers, Boumerdas, Oran, Tébessa, Constantine","utc":"+01:00"},{"label":"Africa/Bangui (GMT+01:00)","tzCode":"Africa/Bangui","name":"(GMT+01:00) Bangui, Bimbo, Mbaïki, Berbérati, Kaga Bandoro","utc":"+01:00"},{"label":"Africa/Brazzaville (GMT+01:00)","tzCode":"Africa/Brazzaville","name":"(GMT+01:00) Brazzaville, Pointe-Noire, Dolisie, Kayes, Owando","utc":"+01:00"},{"label":"Africa/Ceuta (GMT+01:00)","tzCode":"Africa/Ceuta","name":"(GMT+01:00) Ceuta, Melilla","utc":"+01:00"},{"label":"Africa/Douala (GMT+01:00)","tzCode":"Africa/Douala","name":"(GMT+01:00) Douala, Yaoundé, Garoua, Kousséri, Bamenda","utc":"+01:00"},{"label":"Africa/Kinshasa (GMT+01:00)","tzCode":"Africa/Kinshasa","name":"(GMT+01:00) Kinshasa, Masina, Kikwit, Mbandaka, Matadi","utc":"+01:00"},{"label":"Africa/Lagos (GMT+01:00)","tzCode":"Africa/Lagos","name":"(GMT+01:00) Lagos, Kano, Ibadan, Kaduna, Port Harcourt","utc":"+01:00"},{"label":"Africa/Libreville (GMT+01:00)","tzCode":"Africa/Libreville","name":"(GMT+01:00) Libreville, Port-Gentil, Franceville, Oyem, Moanda","utc":"+01:00"},{"label":"Africa/Luanda (GMT+01:00)","tzCode":"Africa/Luanda","name":"(GMT+01:00) Luanda, N’dalatando, Huambo, Lobito, Benguela","utc":"+01:00"},{"label":"Africa/Malabo (GMT+01:00)","tzCode":"Africa/Malabo","name":"(GMT+01:00) Bata, Malabo, Ebebiyin, Aconibe, Añisoc","utc":"+01:00"},{"label":"Africa/Ndjamena (GMT+01:00)","tzCode":"Africa/Ndjamena","name":"(GMT+01:00) N'Djamena, Moundou, Sarh, Abéché, Kelo","utc":"+01:00"},{"label":"Africa/Niamey (GMT+01:00)","tzCode":"Africa/Niamey","name":"(GMT+01:00) Niamey, Zinder, Maradi, Agadez, Alaghsas","utc":"+01:00"},{"label":"Africa/Porto-Novo (GMT+01:00)","tzCode":"Africa/Porto-Novo","name":"(GMT+01:00) Cotonou, Abomey-Calavi, Djougou, Porto-Novo, Parakou","utc":"+01:00"},{"label":"Africa/Tunis (GMT+01:00)","tzCode":"Africa/Tunis","name":"(GMT+01:00) Tunis, Sfax, Sousse, Kairouan, Bizerte","utc":"+01:00"},{"label":"Africa/Windhoek (GMT+01:00)","tzCode":"Africa/Windhoek","name":"(GMT+01:00) Windhoek, Ru
4625ndu, Walvis Bay, Oshakati, Swakopmund","utc":"+01:00"},{"label":"Arctic/Longyearbyen (GMT+01:00)","tzCode":"Arctic/Longyearbyen","name":"(GMT+01:00) Longyearbyen, Olonkinbyen","utc":"+01:00"},{"label":"Europe/Amsterdam (GMT+01:00)","tzCode":"Europe/Amsterdam","name":"(GMT+01:00) Amsterdam, Rotterdam, The Hague, Utrecht, Eindhoven","utc":"+01:00"},{"label":"Europe/Andorra (GMT+01:00)","tzCode":"Europe/Andorra","name":"(GMT+01:00) Andorra la Vella, les Escaldes, Encamp, Sant Julià de Lòria, la Massana","utc":"+01:00"},{"label":"Europe/Belgrade (GMT+01:00)","tzCode":"Europe/Belgrade","name":"(GMT+01:00) Belgrade, Pristina, Niš, Novi Sad, Prizren","utc":"+01:00"},{"label":"Europe/Berlin (GMT+01:00)","tzCode":"Europe/Berlin","name":"(GMT+01:00) Berlin, Hamburg, Munich, Köln, Frankfurt am Main","utc":"+01:00"},{"label":"Europe/Bratislava (GMT+01:00)","tzCode":"Europe/Bratislava","name":"(GMT+01:00) Bratislava, Košice, Prešov, Nitra, Žilina","utc":"+01:00"},{"label":"Europe/Brussels (GMT+01:00)","tzCode":"Europe/Brussels","name":"(GMT+01:00) Brussels, Antwerpen, Gent, Charleroi, Liège","utc":"+01:00"},{"label":"Europe/Budapest (GMT+01:00)","tzCode":"Europe/Budapest","name":"(GMT+01:00) Budapest, Debrecen, Miskolc, Szeged, Pécs","utc":"+01:00"},{"label":"Europe/Copenhagen (GMT+01:00)","tzCode":"Europe/Copenhagen","name":"(GMT+01:00) Copenhagen, Århus, Odense, Aalborg, Frederiksberg","utc":"+01:00"},{"label":"Europe/Gibraltar (GMT+01:00)","tzCode":"Europe/Gibraltar","name":"(GMT+01:00) Gibraltar","utc":"+01:00"},{"label":"Europe/Ljubljana (GMT+01:00)","tzCode":"Europe/Ljubljana","name":"(GMT+01:00) Ljubljana, Maribor, Celje, Kranj, Velenje","utc":"+01:00"},{"label":"Europe/Luxembourg (GMT+01:00)","tzCode":"Europe/Luxembourg","name":"(GMT+01:00) Luxembourg, Esch-sur-Alzette, Dudelange, Schifflange, Bettembourg","utc":"+01:00"},{"label":"Europe/Madrid (GMT+01:00)","tzCode":"Europe/Madrid","name":"(GMT+01:00) Madrid, Barcelona, Valencia, Sevilla, Zaragoza","utc":"+01:00"},{"label":"Europe/Malta (GMT+01:00)","tzCode":"Europe/Malta","name":"(GMT+01:00) Birkirkara, Qormi, Mosta, Żabbar, San Pawl il-Baħar","utc":"+01:00"},{"label":"Europe/Monaco (GMT+01:00)","tzCode":"Europe/Monaco","name":"(GMT+01:00) Monaco, Monte-Carlo, La Condamine","utc":"+01:00"},{"label":"Europe/Oslo (GMT+01:00)","tzCode":"Europe/Oslo","name":"(GMT+01:00) Oslo, Bergen, Trondheim, Stavanger, Drammen","utc":"+01:00"},{"label":"Europe/Paris (GMT+01:00)","tzCode":"Europe/Paris","name":"(GMT+01:00) Paris, Marseille, Lyon, Toulouse, Nice","utc":"+01:00"},{"label":"Europe/Podgorica (GMT+01:00)","tzCode":"Europe/Podgorica","name":"(GMT+01:00) Podgorica, Nikšić, Herceg Novi, Pljevlja, Budva","utc":"+01:00"},{"label":"Europe/Prague (GMT+01:00)","tzCode":"Europe/Prague","name":"(GMT+01:00) Prague, Brno, Ostrava, Pilsen, Olomouc","utc":"+01:00"},{"label":"Europe/Rome (GMT+01:00)","tzCode":"Europe/Rome","name":"(GMT+01:00) Rome, Milan, Naples, Turin, Palermo","utc":"+01:00"},{"label":"Europe/San_Marino (GMT+01:00)","tzCode":"Europe/San_Marino","name":"(GMT+01:00) Serravalle, Borgo Maggiore, San Marino, Domagnano, Fiorentino","utc":"+01:00"},{"label":"Europe/Sarajevo (GMT+01:00)","tzCode":"Europe/Sarajevo","name":"(GMT+01:00) Sarajevo, Banja Luka, Zenica, Tuzla, Mostar","utc":"+01:00"},{"label":"Europe/Skopje (GMT+01:00)","tzCode":"Europe/Skopje","name":"(GMT+01:00) Skopje, Bitola, Kumanovo, Prilep, Tetovo","utc":"+01:00"},{"label":"Europe/Stockholm (GMT+01:00)","tzCode":"Europe/Stockholm","name":"(GMT+01:00) Stockholm, Göteborg, Malmö, Uppsala, Sollentuna","utc":"+01:00"},{"label":"Europe/Tirane (GMT+01:00)","tzCode":"Europe/Tirane","name":"(GMT+01:00) Tirana, Durrës, Elbasan, Vlorë, Shkodër","utc":"+01:00"},{"label":"Europe/Vaduz (GMT+01:00)","tzCode":"Europe/Vaduz","name":"(GMT+01:00) Schaan, Vaduz, Triesen, Balzers, Eschen","utc":"+01:00"},{"label":"Europe/Vatican (GMT+01:00)","tzCode":"Europe/Vatican","name":"(GMT+01:00) Vatican City","utc":"+01:00"},{"label":"Europe/Vienna (GMT+01:00)","tzCode":"Europe/Vienna","name":"(GMT+01:00) Vienna, Graz, Linz, Favoriten, Donaustadt","utc":"+01:00"},{"label":"Europe/Warsaw (GMT+01:00)","tzCode":"Europe/Warsaw","name":"(GMT+01:00) Warsaw, Łódź, Kraków, Wrocław, Poznań","utc":"+01:00"},{"label":"Europe/Zagreb (GMT+01:00)","tzCode":"Europe/Zagreb","name":"(GMT+01:00) Zagreb, Split, Rijeka, Osijek, Zadar","utc":"+01:00"},{"label":"Europe/Zurich (GMT+01:00)","tzCode":"Europe/Zurich","name":"(GMT+01:00) Zürich, Genève, Basel, Lausanne, Bern","utc":"+01:00"},{"label":"Africa/Blantyre (GMT+02:00)","tzCode":"Africa/Blantyre","name":"(GMT+02:00) Lilongwe, Blantyre, Mzuzu, Zomba, Kasungu","utc":"+02:00"},{"label":"Africa/Bujumbura (GMT+02:00)","tzCode":"Africa/Bujumbura","name":"(GMT+02:00) Bujumbura, Muyinga, Gitega, Ruyigi, Ngozi","utc":"+02:00"},{"label":"Africa/Cairo (GMT+02:00)","tzCode":"Africa/Cairo","name":"(GMT+02:00) Cairo, Alexandria, Giza, Port Said, Suez","utc":"+02:00"},{"label":"Africa/Gaborone (GMT+02:00)","tzCode":"Africa/Gaborone","name":"(GMT+02:00) Gaborone, Francistown, Molepolole, Selebi-Phikwe, Maun","utc":"+02:00"},{"label":"Africa/Harare (GMT+02:00)","tzCode":"Africa/Harare","name":"(GMT+02:00) Harare, Bulawayo, Chitungwiza, Mutare, Gweru","utc":"+02:00"},{"label":"Africa/Johannesburg (GMT+02:00)","tzCode":"Africa/Johannesburg","name":"(GMT+02:00) Cape Town, Durban, Johannesburg, Soweto, Pretoria","utc":"+02:00"},{"label":"Africa/Juba (GMT+02:00)","tzCode":"Africa/Juba","name":"(GMT+02:00) Juba, Winejok, Malakal, Wau, Kuacjok","utc":"+02:00"},{"label":"Africa/Khartoum (GMT+02:00)","tzCode":"Africa/Khartoum","name":"(GMT+02:00) Khartoum, Omdurman, Nyala, Port Sudan, Kassala","utc":"+02:00"}
4625,{"label":"Africa/Kigali (GMT+02:00)","tzCode":"Africa/Kigali","name":"(GMT+02:00) Kigali, Butare, Gitarama, Musanze, Gisenyi","utc":"+02:00"},{"label":"Africa/Lubumbashi (GMT+02:00)","tzCode":"Africa/Lubumbashi","name":"(GMT+02:00) Lubumbashi, Mbuji-Mayi, Kisangani, Kananga, Likasi","utc":"+02:00"},{"label":"Africa/Lusaka (GMT+02:00)","tzCode":"Africa/Lusaka","name":"(GMT+02:00) Lusaka, Kitwe, Ndola, Kabwe, Chingola","utc":"+02:00"},{"label":"Africa/Maputo (GMT+02:00)","tzCode":"Africa/Maputo","name":"(GMT+02:00) Maputo, Matola, Beira, Nampula, Chimoio","utc":"+02:00"},{"label":"Africa/Maseru (GMT+02:00)","tzCode":"Africa/Maseru","name":"(GMT+02:00) Maseru, Mafeteng, Leribe, Maputsoe, Mohale’s Hoek","utc":"+02:00"},{"label":"Africa/Mbabane (GMT+02:00)","tzCode":"Africa/Mbabane","name":"(GMT+02:00) Manzini, Mbabane, Big Bend, Malkerns, Nhlangano","utc":"+02:00"},{"label":"Africa/Tripoli (GMT+02:00)","tzCode":"Africa/Tripoli","name":"(GMT+02:00) Tripoli, Benghazi, Mişrātah, Tarhuna, Al Khums","utc":"+02:00"},{"label":"Asia/Amman (GMT+02:00)","tzCode":"Asia/Amman","name":"(GMT+02:00) Amman, Zarqa, Irbid, Russeifa, Wādī as Sīr","utc":"+02:00"},{"label":"Asia/Beirut (GMT+02:00)","tzCode":"Asia/Beirut","name":"(GMT+02:00) Beirut, Ra’s Bayrūt, Tripoli, Sidon, Tyre","utc":"+02:00"},{"label":"Asia/Damascus (GMT+02:00)","tzCode":"Asia/Damascus","name":"(GMT+02:00) Aleppo, Damascus, Homs, Ḩamāh, Latakia","utc":"+02:00"},{"label":"Asia/Famagusta (GMT+02:00)","tzCode":"Asia/Famagusta","name":"(GMT+02:00) Famagusta, Kyrenia, Protaras, Paralímni, Lápithos","utc":"+02:00"},{"label":"Asia/Gaza (GMT+02:00)","tzCode":"Asia/Gaza","name":"(GMT+02:00) Gaza, Khān Yūnis, Jabālyā, Rafaḩ, Dayr al Balaḩ","utc":"+02:00"},{"label":"Asia/Hebron (GMT+02:00)","tzCode":"Asia/Hebron","name":"(GMT+02:00) East Jerusalem, Hebron, Nablus, Battir, Ţūlkarm","utc":"+02:00"},{"label":"Asia/Jerusalem (GMT+02:00)","tzCode":"Asia/Jerusalem","name":"(GMT+02:00) Jerusalem, Tel Aviv, West Jerusalem, Haifa, Ashdod","utc":"+02:00"},{"label":"Asia/Nicosia (GMT+02:00)","tzCode":"Asia/Nicosia","name":"(GMT+02:00) Nicosia, Limassol, Larnaca, Stróvolos, Paphos","utc":"+02:00"},{"label":"Europe/Athens (GMT+02:00)","tzCode":"Europe/Athens","name":"(GMT+02:00) Athens, Thessaloníki, Pátra, Piraeus, Lárisa","utc":"+02:00"},{"label":"Europe/Bucharest (GMT+02:00)","tzCode":"Europe/Bucharest","name":"(GMT+02:00) Bucharest, Sector 3, Sector 6, Sector 2, Iaşi","utc":"+02:00"},{"label":"Europe/Chisinau (GMT+02:00)","tzCode":"Europe/Chisinau","name":"(GMT+02:00) Chisinau, Tiraspol, Bălţi, Bender, Rîbniţa","utc":"+02:00"},{"label":"Europe/Helsinki (GMT+02:00)","tzCode":"Europe/Helsinki","name":"(GMT+02:00) Helsinki, Espoo, Tampere, Vantaa, Turku","utc":"+02:00"},{"label":"Europe/Kaliningrad (GMT+02:00)","tzCode":"Europe/Kaliningrad","name":"(GMT+02:00) Kaliningrad, Chernyakhovsk, Sovetsk, Baltiysk, Gusev","utc":"+02:00"},{"label":"Europe/Kyiv (GMT+02:00)","tzCode":"Europe/Kyiv","name":"(GMT+02:00) Kyiv, Kharkiv, Donetsk, Odesa, Dnipro","utc":"+02:00"},{"label":"Europe/Mariehamn (GMT+02:00)","tzCode":"Europe/Mariehamn","name":"(GMT+02:00) Mariehamn","utc":"+02:00"},{"label":"Europe/Riga (GMT+02:00)","tzCode":"Europe/Riga","name":"(GMT+02:00) Riga, Daugavpils, Liepāja, Jelgava, Jūrmala","utc":"+02:00"},{"label":"Europe/Sofia (GMT+02:00)","tzCode":"Europe/Sofia","name":"(GMT+02:00) Sofia, Plovdiv, Varna, Burgas, Ruse","utc":"+02:00"},{"label":"Europe/Tallinn (GMT+02:00)","tzCode":"Europe/Tallinn","name":"(GMT+02:00) Tallinn, Tartu, Narva, Kohtla-Järve, Pärnu","utc":"+02:00"},{"label":"Europe/Uzhgorod (GMT+02:00)","tzCode":"Europe/Uzhgorod","name":"(GMT+02:00) Uzhgorod, Mukachevo, Khust, Berehove, Tyachiv","utc":"+02:00"},{"label":"Europe/Vilnius (GMT+02:00)","tzCode":"Europe/Vilnius","name":"(GMT+02:00) Vilnius, Kaunas, Klaipėda, Šiauliai, Panevėžys","utc":"+02:00"},{"label":"Europe/Zaporizhzhia (GMT+02:00)","tzCode":"Europe/Zaporizhzhia","name":"(GMT+02:00) Luhansk, Sevastopol, Sievierodonetsk, Alchevsk, Lysychansk","utc":"+02:00"},{"label":"Africa/Addis_Ababa (GMT+03:00)","tzCode":"Africa/Addis_Ababa","name":"(GMT+03:00) Addis Ababa, Dire Dawa, Mek'ele, Nazrēt, Bahir Dar","utc":"+03:00"},{"label":"Africa/Asmara (GMT+03:00)","tzCode":"Africa/Asmara","name":"(GMT+03:00) Asmara, Keren, Massawa, Assab, Mendefera","utc":"+03:00"},{"label":"Africa/Dar_es_Salaam (GMT+03:00)","tzCode":"Africa/Dar_es_Salaam","name":"(GMT+03:00) Dar es Salaam, Mwanza, Zanzibar, Arusha, Mbeya","utc":"+03:00"},{"label":"Africa/Djibouti (GMT+03:00)","tzCode":"Africa/Djibouti","name":"(GMT+03:00) Djibouti, 'Ali 
4625Sabieh, Tadjourah, Obock, Dikhil","utc":"+03:00"},{"label":"Africa/Kampala (GMT+03:00)","tzCode":"Africa/Kampala","name":"(GMT+03:00) Kampala, Gulu, Lira, Mbarara, Jinja","utc":"+03:00"},{"label":"Africa/Mogadishu (GMT+03:00)","tzCode":"Africa/Mogadishu","name":"(GMT+03:00) Mogadishu, Hargeysa, Berbera, Kismayo, Marka","utc":"+03:00"},{"label":"Africa/Nairobi (GMT+03:00)","tzCode":"Africa/Nairobi","name":"(GMT+03:00) Nairobi, Mombasa, Nakuru, Eldoret, Kisumu","utc":"+03:00"},{"label":"Antarctica/Syowa (GMT+03:00)","tzCode":"Antarctica/Syowa","name":"(GMT+03:00) Syowa","utc":"+03:00"},{"label":"Asia/Aden (GMT+03:00)","tzCode":"Asia/Aden","name":"(GMT+03:00) Sanaa, Al Ḩudaydah, Taiz, Aden, Mukalla","utc":"+03:00"},{"label":"Asia/Baghdad (GMT+03:00)","tzCode":"Asia/Baghdad","name":"(GMT+03:00) Baghdad, Basrah, Al Mawşil al JadÄ«dah, Al Başrah al QadÄ«mah, Mosul","utc":"+03:00"},{"label":"Asia/Bahrain (GMT+03:00)","tzCode":"Asia/Bahrain","name":"(GMT+03:00) Manama, Al Muharraq, Ar Rifā‘, Dār Kulayb, MadÄ«nat Ḩamad","utc":"+03:00"},{"label":"Asia/Kuwait (GMT+03:00)","tzCode":"Asia/Kuwait","name":"(GMT+03:00) Al AḩmadÄ«, ḨawallÄ«, As SālimÄ«yah, Şabāḩ as Sālim, Al FarwānÄ«yah","utc":"+03:00"},{"label":"Asia/Qatar (GMT+03:00)","tzCode":"Asia/Qatar","name":"(GMT+03:00) Doha, Ar Rayyān, Umm Şalāl Muḩammad, Al Wakrah, Al Khawr","utc":"+03:00"},{"label":"Asia/Riyadh (GMT+03:00)","tzCode":"Asia/Riyadh","name":"(GMT+03:00) Riyadh, Jeddah, Mecca, Medina, Sulţānah","utc":"+03:00"},{"label":"Europe/Istanbul (GMT+03:00)","tzCode":"Europe/Istanbul","name":"(GMT+03:00) Istanbul, Ankara, İzmir, Bursa, Adana","utc":"+03:00"},{"label":"Europe/Kirov (GMT+03:00)","tzCode":"Europe/Kirov","name":"(GMT+03:00) Kirov, Kirovo-Chepetsk, Vyatskiye Polyany, Slobodskoy, Kotel’nich","utc":"+03:00"},{"label":"Europe/Minsk (GMT+03:00)","tzCode":"Europe/Minsk","name":"(GMT+03:00) Minsk, Homyel', Mahilyow, Vitebsk, Hrodna","utc":"+03:00"},{"label":"Europe/Moscow (GMT+03:00)","tzCode":"Europe/Moscow","name":"(GMT+03:00) Moscow, Saint Petersburg, Nizhniy Novgorod, Kazan, Rostov-na-Donu","utc":"+03:00"},{"label":"Europe/Simferopol (GMT+03:00)","tzCode":"Europe/Simferopol","name":"(GMT+03:00) Simferopol, Kerch, Yevpatoriya, Yalta, Feodosiya","utc":"+03:00"},{"label":"Europe/Volgograd (GMT+03:00)","tzCode":"Europe/Volgograd","name":"(GMT+03:00) Volgograd, Volzhskiy, Kamyshin, Mikhaylovka, Uryupinsk","utc":"+03:00"},{"label":"Indian/Antananarivo (GMT+03:00)","tzCode":"Indian/Antananarivo","name":"(GMT+03:00) Antananarivo, Toamasina, Antsirabe, Fianarantsoa, Mahajanga","utc":"+03:00"},{"label":"Indian/Comoro (GMT+03:00)","tzCode":"Indian/Comoro","name":"(GMT+03:00) Moroni, Moutsamoudou, Fomboni, Domoni, Tsimbeo","utc":"+03:00"},{"label":"Indian/Mayotte (GMT+03:00)","tzCode":"Indian/Mayotte","name":"(GMT+03:00) Mamoudzou, Koungou, Dzaoudzi, Dembeni, Sada","utc":"+03:00"},{"label":"Asia/Tehran (GMT+03:30)","tzCode":"Asia/Tehran","name":"(GMT+03:30) Tehran, Mashhad, Isfahan, Karaj, Tabriz","utc":"+03:30"},{"label":"Asia/Baku (GMT+04:00)","tzCode":"Asia/Baku","name":"(GMT+04:00) Baku, Ganja, Sumqayıt, Lankaran, Yevlakh","utc":"+04:00"},{"label":"Asia/Dubai (GMT+04:00)","tzCode":"Asia/Dubai","name":"(GMT+04:00) Dubai, Sharjah, Abu Dhabi, Ajman City, Ras Al Khaimah City","utc":"+04:00"},{"label":"Asia/Muscat (GMT+04:00)","tzCode":"Asia/Muscat","name":"(GMT+04:00) Muscat, Seeb, Şalālah, Bawshar, Sohar","utc":"+04:00"},{"label":"Asia/Tbilisi (GMT+04:00)","tzCode":"Asia/Tbilisi","name":"(GMT+04:00) Tbilisi, Kutaisi, Batumi, Sokhumi, Zugdidi","utc":"+04:00"},{"label":"Asia/Yerevan (GMT+04:00)","tzCode":"Asia/Yerevan","name":"(GMT+04:00) Yerevan, Gyumri, Vanadzor, Vagharshapat, Hrazdan","utc":"+04:00"},{"label":"Europe/Astrakhan (GMT+04:00)","tzCode":"Europe/Astrakhan","name":"(GMT+04:00) Astrakhan, Akhtubinsk, Znamensk, Kharabali, Kamyzyak","utc":"+04:00"},{"label":"Europe/Samara (GMT+04:00)","tzCode":"Europe/Samara","name":"(GMT+04:00) Samara, Togliatti-on-the-Volga, Izhevsk, Syzran’, Novokuybyshevsk","utc":"+04:00"},{"label":"Europe/Saratov (GMT+04:00)","tzCode":"Europe/Saratov","name":"(GMT+04:00) Saratov, Balakovo, Engel’s, Balashov, Vol’sk","utc":"+04:00"},{"label":"Europe/Ulyanovsk (GMT+04:00)","tzCode":"Europe/Ulyanovsk","name":"(GMT+04:00) Ulyanovsk, Dimitrovgrad, Inza, Barysh, Novoul’yanovsk","utc":"+04:00"},{"label":"Indian/Mahe (GMT+04:00)","tzCode":"Indian/Mahe","name":"(GMT+04:00) Victoria, Anse Boileau, Bel Ombre, Beau Vallon, Cascade","utc":"+04:00"},{"label":"Indian/Mauritius (GMT+04:00)","tzCode":"Indian/Mauritius","name":"(GMT+04:00) Port Louis, Beau Bassin-Rose Hill, Vacoas, Curepipe, Quatre Bornes","utc":"+04:00"},{"label":"Indian/Reunion (GMT+04:00)","tzCode":"Indian/Reunion","name":"(GMT+04:00) Saint-Denis, Saint-Paul, Saint-Pierre, Le Tampon, Saint-André","utc":"+04:00"},{"label":"Asia/Kabul (GMT+04:30)","tzCode":"Asia/Kabul","name":"(GMT+04:30) Kabul, Kandahār, Mazār-e SharÄ«f, Herāt, Jalālābād","utc":"+04:30"},{"label":"Antarctica/Mawson (GMT+05:00)","tzCode":"Antarctica/Mawson","name":"(GMT+05:00) Mawson","utc":"+05:00"},{"label":"Asia/Aqtau (GMT+05:00)","tzCode":"Asia/Aqtau","name":"(GMT+05:00) Shevchenko, Zhanaozen, Beyneu, Shetpe, Yeraliyev","utc":"+05:00"},{"label":"Asia/Aqtobe (GMT+05:00)","tzCode":"Asia/Aqtobe","name":"(GMT+05:00) Aktobe, Kandyagash, Shalqar, Khromtau, Embi","utc":"+05:00"},{"label":"Asia/Ashgabat (GMT+05:00)","tzCode":"Asia/Ashgabat","name":"(GMT+05:00) Ashgabat, Türkmenabat, Daşoguz, Mary, Balkanabat","utc":"+05:00"},{"label":"Asia/Atyrau (GMT+05:00)","tzCode":"Asia/Atyrau","name":"(GMT+05:00) Atyrau, Qulsary, Shalkar, Balykshi, Maqat","utc":"+05:00"},{"label":"Asia/Dushanbe (GMT+05:00)","tzCode":"Asia/Dushanbe","name":"(GMT+05:00) Dushanbe, Khujand, KÅ­lob, Bokhtar, Istaravshan","utc":"+05:00"},{"label":"Asia/Karachi (GMT+05:00)","tzCode":"Asia/Karachi","name":"(GMT+05:00) Karachi, Lahore, Faisalabad, Rawalpindi, Multan","utc":"+05:00"},{"label":"Asia/Oral (GMT+05:00)","tzCode":"Asia/Oral","name":"(GMT+05:00) Oral, Aqsay, ZhÃ
4625¤nibek, Tasqala, Zhumysker","utc":"+05:00"},{"label":"Asia/Qyzylorda (GMT+05:00)","tzCode":"Asia/Qyzylorda","name":"(GMT+05:00) Kyzylorda, Baikonur, Novokazalinsk, Aral, Chiili","utc":"+05:00"},{"label":"Asia/Samarkand (GMT+05:00)","tzCode":"Asia/Samarkand","name":"(GMT+05:00) Samarkand, Bukhara, Nukus, Qarshi, Jizzax","utc":"+05:00"},{"label":"Asia/Tashkent (GMT+05:00)","tzCode":"Asia/Tashkent","name":"(GMT+05:00) Tashkent, Namangan, Andijon, Qo‘qon, Chirchiq","utc":"+05:00"},{"label":"Asia/Yekaterinburg (GMT+05:00)","tzCode":"Asia/Yekaterinburg","name":"(GMT+05:00) Yekaterinburg, Chelyabinsk, Ufa, Perm, Orenburg","utc":"+05:00"},{"label":"Indian/Kerguelen (GMT+05:00)","tzCode":"Indian/Kerguelen","name":"(GMT+05:00) Port-aux-Français","utc":"+05:00"},{"label":"Indian/Maldives (GMT+05:00)","tzCode":"Indian/Maldives","name":"(GMT+05:00) Male, Fuvahmulah, Hithadhoo, Kulhudhuffushi, Thinadhoo","utc":"+05:00"},{"label":"Asia/Colombo (GMT+05:30)","tzCode":"Asia/Colombo","name":"(GMT+05:30) Colombo, Dehiwala-Mount Lavinia, Moratuwa, Jaffna, Negombo","utc":"+05:30"},{"label":"Asia/Kolkata (GMT+05:30)","tzCode":"Asia/Kolkata","name":"(GMT+05:30) Mumbai, Delhi, Bengaluru, Kolkata, Chennai","utc":"+05:30"},{"label":"Asia/Kathmandu (GMT+05:45)","tzCode":"Asia/Kathmandu","name":"(GMT+05:45) Kathmandu, Pokhara, Pātan, Biratnagar, Birgañj","utc":"+05:45"},{"label":"Antarctica/Vostok (GMT+06:00)","tzCode":"Antarctica/Vostok","name":"(GMT+06:00) Vostok","utc":"+06:00"},{"label":"Asia/Almaty (GMT+05:00)","tzCode":"Asia/Almaty","name":"(GMT+05:00) Almaty, Karagandy, Shymkent, Taraz, Nur-Sultan","utc":"+05:00"},{"label":"Asia/Bishkek (GMT+06:00)","tzCode":"Asia/Bishkek","name":"(GMT+06:00) Bishkek, Osh, Jalal-Abad, Karakol, Tokmok","utc":"+06:00"},{"label":"Asia/Dhaka (GMT+06:00)","tzCode":"Asia/Dhaka","name":"(GMT+06:00) Dhaka, Chattogram, Khulna, Rājshāhi, Comilla","utc":"+06:00"},{"label":"Asia/Omsk (GMT+06:00)","tzCode":"Asia/Omsk","name":"(GMT+06:00) Omsk, Tara, Kalachinsk, Znamenskoye, Tavricheskoye","utc":"+06:00"},{"label":"Asia/Qostanay (GMT+06:00)","tzCode":"Asia/Qostanay","name":"(GMT+06:00) Kostanay, Rudnyy, Dzhetygara, Arkalyk, Lisakovsk","utc":"+06:00"},{"label":"Asia/Thimphu (GMT+06:00)","tzCode":"Asia/Thimphu","name":"(GMT+06:00) himphu, Punākha, Tsirang, Phuntsholing, Pemagatshel","utc":"+06:00"},{"label":"Asia/Urumqi (GMT+06:00)","tzCode":"Asia/Urumqi","name":"(GMT+06:00) Zhongshan, Ürümqi, Zhanjiang, Shihezi, Huocheng","utc":"+06:00"},{"label":"Indian/Chagos (GMT+06:00)","tzCode":"Indian/Chagos","name":"(GMT+06:00) British Indian Ocean Territory","utc":"+06:00"},{"label":"Asia/Yangon (GMT+06:30)","tzCode":"Asia/Yangon","name":"(GMT+06:30) Yangon, Mandalay, Nay Pyi Taw, Mawlamyine, Kyain Seikgyi Township","utc":"+06:30"},{"label":"Indian/Cocos (GMT+06:30)","tzCode":"Indian/Cocos","name":"(GMT+06:30) West Island","utc":"+06:30"},{"label":"Antarctica/Davis (GMT+07:00)","tzCode":"Antarctica/Davis","name":"(GMT+07:00) Davis","utc":"+07:00"},{"label":"Asia/Bangkok (GMT+07:00)","tzCode":"Asia/Bangkok","name":"(GMT+07:00) Bangkok, Hanoi, Haiphong, Samut Prakan, Mueang Nonthaburi","utc":"+07:00"},{"label":"Asia/Barnaul (GMT+07:00)","tzCode":"Asia/Barnaul","name":"(GMT+07:00) Barnaul, Biysk, Rubtsovsk, Novoaltaysk, Gorno-Altaysk","utc":"+07:00"},{"label":"Asia/Hovd (GMT+07:00)","tzCode":"Asia/Hovd","name":"(GMT+07:00) Khovd, Ölgii, Ulaangom, Uliastay, Altai","utc":"+07:00"},{"label":"Asia/Ho_Chi_Minh (GMT+07:00)","tzCode":"Asia/Ho_Chi_Minh","name":"(GMT+07:00) Ho Chi Minh City, Da Nang, Biên Hòa, Nha Trang, Cần ThÆ¡","utc":"+07:00"},{"label":"Asia/Jakarta (GMT+07:00)","tzCode":"Asia/Jakarta","name":"(GMT+07:00) Jakarta, Surabaya, Medan, Bandung, Bekasi","utc":"+07:00"},{"label":"Asia/Krasnoyarsk (GMT+07:00)","tzCode":"Asia/Krasnoyarsk","name":"(GMT+07:00) Krasnoyarsk, Abakan, Norilsk, Achinsk, Kyzyl","utc":"+07:00"},{"label":"Asia/Novokuznetsk (GMT+07:00)","tzCode":"Asia/Novokuznetsk","name":"(GMT+07:00) Novokuznetsk, Kemerovo, Prokop’yevsk, Leninsk-Kuznetsky, Kiselëvsk","utc":"+07:00"},{"label":"Asia/Novosibirsk (GMT+07:00)","tzCode":"Asia/Novosibirsk","name":"(GMT+07:00) Novosibirsk, Berdsk, Iskitim, Akademgorodok, Kuybyshev","utc":"+07:00"},{"label":"Asia/Phnom_Penh (GMT+07:00)","tzCode":"Asia/Phnom_Penh","name":"(GMT+07:00) Phnom Penh, Takeo, Sihanoukville, Battambang, Siem Reap","utc":"+07:00"},{"label":"Asia/Pontianak (GMT+07:00)","tzCode":"Asia/Pontianak","name":"(GMT+07:00) Pontianak, Tanjung Pinang, Palangkaraya, Singkawang, Sampit","utc":"+07:00"},{"label":"Asia/Tomsk (GMT+07:00)","tzCode":"Asia/Tomsk","name":"(GMT+07:00) Tomsk, Seversk, Strezhevoy, Kolpashevo, Asino","utc":"+07:00"},{"label":"Asia/Vientiane (GMT+07:00)","tzCode":"Asia/Vientiane","name":"(GMT+07:00) Vientiane, Pakse, Thakhèk, Savannakhet, Luang Prabang","utc":"+07:00"},{"label":"Indian/Christmas (GMT+07:00)","tzCode":"Indian/Christmas","name":"(GMT+07:00) Flying Fish Cove","utc":"+07:00"},{"label":"Asia/Brunei (GMT+08:00)","tzCode":"Asia/Brunei","name":"(GMT+08:00) Bandar Seri Begawan, Kuala Belait, Seria, Tutong, Bangar","utc":"+08:00"},{"label":"Asia/Choibalsan (GMT+08:00)","tzCode":"Asia/Choibalsan","name":"(GMT+08:00) Baruun-Urt, Choibalsan","utc":"+08:00"},{"label":"Asia/Hong_Kong (GMT+08:00)","tzCode":"Asia/Hong_Kong","name":"(GMT+08:00) Hong Kong, Kowloon, Tsuen Wan, Yuen Long Kau Hui, Tung Chung","utc":"+08:00"},{"label":"Asia/Irkutsk (GMT+08:00)","tzCode":"Asia/Irkutsk","name":"(GMT+08:00) Irkutsk, Ulan-Ude, Bratsk, Angarsk, Ust’-Ilimsk","utc":"+08:00"},{"label":"Asia/Kuala_Lumpur (GMT+08:00)","tzCode":"Asia/Kuala_Lumpur","name":"(GMT+08:00) Kota Bharu, Kuala Lumpur, Klang, Kampu
4625ng Baru Subang, Johor Bahru","utc":"+08:00"},{"label":"Asia/Kuching (GMT+08:00)","tzCode":"Asia/Kuching","name":"(GMT+08:00) Kuching, Kota Kinabalu, Sandakan, Tawau, Miri","utc":"+08:00"},{"label":"Asia/Macau (GMT+08:00)","tzCode":"Asia/Macau","name":"(GMT+08:00) Macau","utc":"+08:00"},{"label":"Asia/Makassar (GMT+08:00)","tzCode":"Asia/Makassar","name":"(GMT+08:00) Makassar, Denpasar, City of Balikpapan, Banjarmasin, Manado","utc":"+08:00"},{"label":"Asia/Manila (GMT+08:00)","tzCode":"Asia/Manila","name":"(GMT+08:00) Quezon City, Manila, Caloocan City, Budta, Davao","utc":"+08:00"},{"label":"Asia/Shanghai (GMT+08:00)","tzCode":"Asia/Shanghai","name":"(GMT+08:00) Shanghai, Beijing, Tianjin, Guangzhou, Shenzhen","utc":"+08:00"},{"label":"Asia/Singapore (GMT+08:00)","tzCode":"Asia/Singapore","name":"(GMT+08:00) Singapore, Woodlands","utc":"+08:00"},{"label":"Asia/Taipei (GMT+08:00)","tzCode":"Asia/Taipei","name":"(GMT+08:00) Taipei, Kaohsiung, Taichung, Tainan, Banqiao","utc":"+08:00"},{"label":"Asia/Ulaanbaatar (GMT+08:00)","tzCode":"Asia/Ulaanbaatar","name":"(GMT+08:00) Ulan Bator, Erdenet, Darhan, Hovd, Mörön","utc":"+08:00"},{"label":"Australia/Perth (GMT+08:00)","tzCode":"Australia/Perth","name":"(GMT+08:00) Perth, Rockingham, Mandurah, Bunbury, Albany","utc":"+08:00"},{"label":"Australia/Eucla (GMT+08:45)","tzCode":"Australia/Eucla","name":"(GMT+08:45) Eucla","utc":"+08:45"},{"label":"Asia/Chita (GMT+09:00)","tzCode":"Asia/Chita","name":"(GMT+09:00) Chita, Krasnokamensk, Borzya, Petrovsk-Zabaykal’skiy, Aginskoye","utc":"+09:00"},{"label":"Asia/Dili (GMT+09:00)","tzCode":"Asia/Dili","name":"(GMT+09:00) Dili, Maliana, Suai, Likisá, Aileu","utc":"+09:00"},{"label":"Asia/Jayapura (GMT+09:00)","tzCode":"Asia/Jayapura","name":"(GMT+09:00) Ambon, Jayapura, Sorong, Ternate, Abepura","utc":"+09:00"},{"label":"Asia/Khandyga (GMT+09:00)","tzCode":"Asia/Khandyga","name":"(GMT+09:00) Khandyga","utc":"+09:00"},{"label":"Asia/Pyongyang (GMT+09:00)","tzCode":"Asia/Pyongyang","name":"(GMT+09:00) Pyongyang, Hamhŭng, Namp’o, Sunch’ŏn, Hŭngnam","utc":"+09:00"},{"label":"Asia/Seoul (GMT+09:00)","tzCode":"Asia/Seoul","name":"(GMT+09:00) Seoul, Busan, Incheon, Daegu, Daejeon","utc":"+09:00"},{"label":"Asia/Tokyo (GMT+09:00)","tzCode":"Asia/Tokyo","name":"(GMT+09:00) Tokyo, Yokohama, Osaka, Nagoya, Sapporo","utc":"+09:00"},{"label":"Asia/Yakutsk (GMT+09:00)","tzCode":"Asia/Yakutsk","name":"(GMT+09:00) Yakutsk, Blagoveshchensk, Belogorsk, Neryungri, Svobodnyy","utc":"+09:00"},{"label":"Pacific/Palau (GMT+09:00)","tzCode":"Pacific/Palau","name":"(GMT+09:00) Koror, Koror Town, Kloulklubed, Ulimang, Mengellang","utc":"+09:00"},{"label":"Australia/Adelaide (GMT+09:30)","tzCode":"Australia/Adelaide","name":"(GMT+09:30) Adelaide, Adelaide Hills, Mount Gambier, Morphett Vale, Gawler","utc":"+09:30"},{"label":"Australia/Broken_Hill (GMT+09:30)","tzCode":"Australia/Broken_Hill","name":"(GMT+09:30) Broken Hill","utc":"+09:30"},{"label":"Australia/Darwin (GMT+09:30)","tzCode":"Australia/Darwin","name":"(GMT+09:30) Darwin, Alice Springs, Palmerston, Howard Springs","utc":"+09:30"},{"label":"Antarctica/DumontDUrville (GMT+10:00)","tzCode":"Antarctica/DumontDUrville","name":"(GMT+10:00) DumontDUrville","utc":"+10:00"},{"label":"Antarctica/Macquarie (GMT+10:00)","tzCode":"Antarctica/Macquarie","name":"(GMT+10:00) Macquarie","utc":"+10:00"},{"label":"Asia/Ust-Nera (GMT+10:00)","tzCode":"Asia/Ust-Nera","name":"(GMT+10:00) Ust-Nera","utc":"+10:00"},{"label":"Asia/Vladivostok (GMT+10:00)","tzCode":"Asia/Vladivostok","name":"(GMT+10:00) Vladivostok, Khabarovsk, Khabarovsk Vtoroy, Komsomolsk-on-Amur, Ussuriysk","utc":"+10:00"},{"label":"Australia/Brisbane (GMT+10:00)","tzCode":"Australia/Brisbane","name":"(GMT+10:00) Brisbane, Gold Coast, Logan City, Townsville, Cairns","utc":"+10:00"},{"label":"Australia/Currie (GMT+10:00)","tzCode":"Australia/Currie","name":"(GMT+10:00) Currie","utc":"+10:00"},{"label":"Australia/Hobart (GMT+10:00)","tzCode":"Australia/Hobart","name":"(GMT+10:00) Hobart, Launceston, Burnie, Devonport, Sandy Bay","utc":"+10:00"},{"label":"Australia/Lindeman (GMT+10:00)","tzCode":"Australia/Lindeman","name":"(GMT+10:00) Lindeman","utc":"+10:00"},{"label":"Australia/Melbourne (GMT+10:00)","tzCode":"Australia/Melbourne","name":"(GMT+10:00) Melbourne, Geelong, Bendigo, Ballarat, Melbourne City Centre","utc":"+10:00"},{"label":"Australia/Sydney (GMT+10:00)","tzCode":"Australia/Sydney","name":"(GMT+10:00) Sydney, Canberra, Newcastle, Wollongong, Maitland","utc":"+10:00"},{"label":"Pacific/Chuuk (GMT+10:00)","tzCode":"Pacific/Chuuk","name":"(GMT+10:00) Weno, Colonia","utc":"+10:00"},{"label":"Pacific/Guam (GMT+10:00)","tzCode":"Pacific/Guam","name":"(GMT+10:00) Dededo Village, Yigo Village, Tamuning, Tamuning-Tumon-Harmon Village, Mangilao Village","utc":"+10:00"},{"label":"Pacific/Port_Moresby (GMT+10:00)","tzCode":"Pacific/Port_Moresby","name":"(GMT+10:00) Port Moresby, Lae, Mount Hagen, Popondetta, Madang","utc":"+10:00"},{"label":"Pacific/Saipan (GMT+10:00)","tzCode":"Pacific/Saipan","name":"(GMT+10:00) Saipan, San Jose Village","utc":"+10:00"},{"label":"Australia/Lord_Howe (GMT+10:30)","tzCode":"Australia/Lord_Howe","name":"(GMT+10:30) Lord Howe","utc":"+10:30"},{"label":"Antarctica/Casey (GMT+8:00)","tzCode":"Antarctica/Casey","name":"(GMT+8:00) Casey","utc":"+8:00"},{"label":"Asia/Magadan (GMT+11:00)","tzCode":"Asia/Magadan","name":"(GMT+11:00) Magadan, Ust-Nera, Susuman, Ola","utc":"+11:00"},{"label":"Asia/Sakhalin (GMT+11:00)","tzCode":"Asia/Sakhalin","name":"(GMT+11:00) Yuzhno-Sakhalinsk, Korsakov, Kholmsk, Okha, Nevel’sk","utc":"+11:00"},{"label":"Asia/Srednekolymsk (GMT+11:00)","tzCode":"Asia/Srednekolymsk","name":"(GMT+11:00) Srednekolymsk","utc":"+11:00"},{"label":"Pacific/Bougainville (GMT+11:00)","tzCode":"Pacific/Bougainville","name":"(GMT+11:00) Arawa, Buka","utc":"+11:00"},{"label":"Pacific/Efate (GMT+11:00)","tzCode":"Pacific/Efate","name":"(GMT+11:00) Port-Vila, Luganville, Isangel, Sola, Lakatoro","utc":"+11:00"},{"label":"Pacific/Guadalcanal (GMT+11:00)","tzCode":"Pacific/Guadalcanal","name":"(GMT+11:00) Honiara, Malango, Auki, Gizo, Buala","utc":"+11:00"},{"label":"Pacific/Kosrae (GMT+11:00)","tzCode":"Pacific/Kosrae","name":"(GMT+11:00) Tofol","utc":"+11:00"},{"label":"Pacific/Norfolk (GMT+11:00)","tzCode":"Pacific/Norfolk","name":"(GMT+11:00) Kingston","utc":"+11:00"},{"label":"Pacific/Noumea (GMT+11:00)","tzCode":"Pacific/Noumea","name":"(GMT+11:00) Nouméa, Mont-Dore, Dumbéa, Païta, Wé","utc":"+11:00"},{"label":"Pacific/Pohnpei (GMT+11:00)","tzCode":"Pacific/Pohnpei","name":"(GMT+11:00) Kolonia, Kolonia Town, Palikir - National Government Center","utc":"+11:00"},{"label":"Antarctica/McMurdo (GMT+12:00)","tzCode":"Antarctica/McMurdo","name":"(GMT+12:00) McMurdo","utc":"+12:00"},{"label":"Asia/Anadyr (GMT+12:00)","tzCode":"Asia/Anadyr","name":"(GMT+12:00) Anadyr, Bilibino","utc":"+12:00"},{"label":"Asia/Kamchatka (GMT+12:00)","tzCode":"Asia/Kamchatka","name":"(GMT+12:00) Petropavlovsk-Kamchatsky, Yelizovo, Vilyuchinsk, Klyuchi, Mil’kovo","utc":"+12:00"},{"label":"Pacific/Auckland (GMT+12:00)","tzCode":"Pacific/Auckland","name":"(GMT+12:00) Auckland, Wellington, Christchurch, Manukau City, North Shore","utc":"+12:00"}
4625,{"label":"Pacific/Fiji (GMT+12:00)","tzCode":"Pacific/Fiji","name":"(GMT+12:00) Suva, Lautoka, Nadi, Labasa, Ba","utc":"+12:00"},{"label":"Pacific/Funafuti (GMT+12:00)","tzCode":"Pacific/Funafuti","name":"(GMT+12:00) Funafuti, Savave Village, Tanrake Village, Toga Village, Asau Village","utc":"+12:00"},{"label":"Pacific/Kwajalein (GMT+12:00)","tzCode":"Pacific/Kwajalein","name":"(GMT+12:00) Ebaye, Jabat","utc":"+12:00"},{"label":"Pacific/Majuro (GMT+12:00)","tzCode":"Pacific/Majuro","name":"(GMT+12:00) Majuro, Arno, Jabor, Wotje, Mili","utc":"+12:00"},{"label":"Pacific/Nauru (GMT+12:00)","tzCode":"Pacific/Nauru","name":"(GMT+12:00) Yaren, Baiti, Anabar, Uaboe, Ijuw","utc":"+12:00"},{"label":"Pacific/Tarawa (GMT+12:00)","tzCode":"Pacific/Tarawa","name":"(GMT+12:00) Tarawa, Betio Village, Bikenibeu Village","utc":"+12:00"},{"label":"Pacific/Wake (GMT+12:00)","tzCode":"Pacific/Wake","name":"(GMT+12:00) Wake","utc":"+12:00"},{"label":"Pacific/Wallis (GMT+12:00)","tzCode":"Pacific/Wallis","name":"(GMT+12:00) Mata-Utu, Leava, Alo","utc":"+12:00"},{"label":"Pacific/Chatham (GMT+12:45)","tzCode":"Pacific/Chatham","name":"(GMT+12:45) Waitangi","utc":"+12:45"},{"label":"Pacific/Apia (GMT+13:00)","tzCode":"Pacific/Apia","name":"(GMT+13:00) Apia, Asau, Mulifanua, Afega, Leulumoega","utc":"+13:00"},{"label":"Pacific/Enderbury (GMT+13:00)","tzCode":"Pacific/Enderbury","name":"(GMT+13:00) Enderbury","utc":"+13:00"},{"label":"Pacific/Fakaofo (GMT+13:00)","tzCode":"Pacific/Fakaofo","name":"(GMT+13:00) Atafu Village, Nukunonu, Fale old settlement","utc":"+13:00"},{"label":"Pacific/Tongatapu (GMT+13:00)","tzCode":"Pacific/Tongatapu","name":"(GMT+13:00) Nuku‘alofa, Lapaha, Neiafu, Pangai, ‘Ohonua","utc":"+13:00"},{"label":"Pacific/Kiritimati (GMT+14:00)","tzCode":"Pacific/Kiritimati","name":"(GMT+14:00) Kiritimati","utc":"+14:00"}]`);var Aie;function Cjt(){if(Aie)return Vm;Aie=1;var t=Vm&&Vm.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vm,"__esModule",{value:!0});const e=t(Tjt);return Vm.default=e.default,Vm}var Ejt=Cjt();const jjt=Lr(Ejt),Njt=["Etc/GMT+12","Pacific/Pago_Pago","Pacific/Honolulu","Pacific/Tahiti","Pacific/Marquesas","America/Anchorage","America/Los_Angeles","America/Vancouver","America/Tijuana","America/Denver","America/Phoenix","America/Chihuahua","America/Edmonton","America/Chicago","America/Mexico_City","America/El_Salvador","America/Winnipeg","America/Regina","America/New_York","America/Toronto","America/Bogota","America/Lima","America/Havana","America/Halifax","America/Santiago","America/Caracas","America/La_Paz","America/Puerto_Rico","America/St_Johns","America/Sao_Paulo","America/Argentina/Buenos_Aires","America/Montevideo","America/Noronha","Atlantic/Azores","Atlantic/Cape_Verde","Etc/UTC","Europe/London","Europe/Lisbon","Atlantic/Canary","Atlantic/Reykjavik","Africa/Abidjan","Africa/Casablanca","Africa/Algiers","Africa/Lagos","Europe/Amsterdam","Europe/Berlin","Europe/Brussels","Europe/Paris","Europe/Madrid","Europe/Rome","Europe/Vienna","Europe/Zurich","Europe/Prague","Europe/Belgrade","Europe/Budapest","Europe/Warsaw","Europe/Copenhagen","Europe/Stockholm","Europe/Oslo","Europe/Ljubljana","Europe/Sarajevo","Europe/Skopje","Europe/Zagreb","Europe/Athens","Europe/Bucharest","Europe/Helsinki","Europe/Kyiv","Europe/Riga","Europe/Tallinn","Europe/Vilnius","Europe/Chisinau","Africa/Cairo","Africa/Johannesburg","Asia/Jerusalem","Europe/Kaliningrad","Asia/Beirut","Asia/Amman","Asia/Damascus","Africa/Tripoli","Africa/Windhoek","Europe/Istanbul","Europe/Moscow","Europe/Minsk","Europe/Volgograd","Asia/Baghdad","Asia/Riyadh","Asia/Qatar","Asia/Kuwait","Africa/Nairobi","Asia/Tehran","Asia/Dubai","Asia/Baku","Asia/Tbilisi","Asia/Yerevan","Europe/Samara","Indian/Mauritius","Indian/Reunion","Asia/Kabul","Asia/Tashkent","Asia/Karachi","Asia/Yekaterinburg","Indian/Maldives","Asia/Kolkata","Asia/Colombo","Asia/Kathmandu","Asia/Dhaka","Asia/Almaty","Asia/Bishkek","Asia/Omsk","Asia/Yangon","Asia/Bangkok","Asia/Ho_Chi_Minh","Asia/Jakarta","Asia/Novosibirsk","Asia/Krasnoyarsk","Asia/Phnom_Penh","Asia/Vientiane","Asia/Shanghai","Asia/Hong_Kong","Asia/Taipei","Asia/Singapore","Asia/Kuala_Lumpur","Australia/Perth","Asia/Ulaanbaatar","Asia/Manila","Asia/Macau","Asia/Irkutsk","Australia/Eucla","Asia/Tokyo","Asia/Seoul","Asia/Yakutsk","Australia/Adelaide","Australia/Darwin","Australia/Brisbane","Australia/Sydney","Australia/Melbourne","Australia/Hobart","Pacific/Port_Moresby","Pacific/Guam","Asia/Vladivostok","Australia/Lord_Howe","Asia/Magadan","Pacific/Noumea","Pacific/Guadalcanal","Asia/Srednekolymsk","Pacific/Auckland","Pacific/Fiji","Pacific/Majuro","Asia/Kamchatka","Pacific/Chatham","Pacific/Tongatapu","Pacific/Apia","Pacific/Kiritimati"],Pjt=jjt.filter(t=>Njt.includes(t.tzCode)),Mjt=Pjt.map(t=>({value:t.tzCode,label:t.label.replace(/_/g," ")})),Ajt=({value:t,onChange:e,error:r})=>l.jsx(tn,{label:"Time Zone",icon:WPe,error:r,children:l.jsx(Ep,{width:"w-full",buttonClassName:"h-12 2k:h-20",value:t,onSelect:e,options:Mjt,placeholder:"Select your time zone",enableSearch:!0})}),Djt=()=>{const{isAtLimit:t,isFreePlan:e}=zhe(),{proPlan:r}=Hs();return!t||!e||!r?null:l.jsx(eN,{plan:r,interval:"month",className:"backdrop-blur-xs bg-transparent roun
4625ded-xl h-full w-full"})},Ojt=({value:t,onChange:e,disabled:r=!1,error:n})=>l.jsxs(tn,{label:"Trade Data",error:n,children:[l.jsx(RV,{value:t,onChange:i=>e(i.target.value),placeholder:"Paste your TradeStation export data here...",className:Pe("min-h-32",r&&"opacity-50 pointer-events-none"),disabled:r,"aria-label":"TradeStation export data input"}),l.jsxs("p",{className:"mt-2 font-light text-sm text-app-primary-foreground/70",children:[l.jsx("strong",{children:"Instructions:"})," ","Copy and paste the plain text export from TradeStation. The data should include columns like Symbol, Type, Quantity, Filled Price, Order Status, etc."]})]}),Rjt=({platform:t,setPlatform:e})=>{const{userHasura:r}=Gt(),n=r?.id,{processFile:i}=oV(),{status:s}=n0(),[a,o]=b.useState(null),[c,u]=b.useState(null),[d,f]=b.useState([]),[h,m]=b.useState(""),[y,x]=b.useState(!1),[v,_]=b.useState(Intl.DateTimeFormat().resolvedOptions().timeZone||"America/New_York"),S=b.useRef(null),k=()=>{S.current&&(S.current.value="")},E=async R=>{const I=R.target.files?.[0],B=aK(I,t,n,c);if(B){o(B);return}await i(I,t,n,{tradeDate:c?iT(c):void 0,timeZone:v,tagIds:d.length>0?d:void 0,isFutures:y}),setTimeout(()=>k(),1e3)},T=async()=>{if(!h.trim()){o("Please enter TradeStation export data");return}o(null);try{const R=new File([h],"tradestation-export.txt",{type:"text/plain"});await i(R,"tradestation",n,{timeZone:v,tagIds:d.length>0?d:void 0,isFutures:y}),m("")}catch(R){o(R instanceof Error?R.message:"Failed to process TradeStation data")}},{isDragging:N,handleDragOver:j,handleDragLeave:M,handleDrop:O}=wjt({onDrop:async R=>{const I=aK(R,t,n,c);if(I){o(I);return}await i(R,t,n,{tradeDate:c?iT(c):void 0,timeZone:v,tagIds:d.length>0?d:void 0,isFutures:y}),setTimeout(()=>k(),1e3)}});return l.jsxs("div",{className:"space-y-6 relative p-2",children:[l.jsx(Djt,{}),r?.initial_risk&&r.initial_risk!==0&&l.jsxs(wo,{className:"max-w-xl rounded-2xl border px-4 py-4 font-normal bg-app-card border-none text-app-primary-foreground/90 [&>svg]:text-app-primary-foreground/90",children:[l.jsx(i3,{className:"size-5 mt-1"}),l.jsx(Dw,{className:"font-medium max-w-sm leading-relaxed",children:"Initial Risk Configuration"}),l.jsxs(_o,{className:"font-light leading-relaxed text-app-primary-foreground/80",children:["You have a default initial risk of"," ",l.jsxs("span",{className:"font-semibold",children:["$",r.initial_risk.toLocaleString()]})," ","configured in your account settings. This value will be automatically applied to all imported trades.",l.jsx("br",{}),l.jsxs(At,{to:"/app/profile",className:"inline-flex items-center text-app-primary-foreground/80 hover:text-app-primary-foreground underline underline-offset-4 transition-all duration-300 focus:outline-hidden focus:ring-4 focus:ring-app-primary-foreground/20 focus:ring-offset-0 rounded-xs decoration-app-border-color-accent group mt-1",children:["Manage your risk settings",l.jsx(Cs,{className:"ml-1 h-3 w-3 translate-y-0 translate-x-0 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-transform duration-300"})]})]})]}),l.jsx(kjt,{value:t,onChange:e,error:a&&!t?a:void 0}),(t==="thinkorswim"||t==="tradestation"||t==="universalimport")&&l.jsxs("div",{children:[l.jsx(Ajt,{value:v,onChange:_,error:a&&!v?a:void 0}),l.jsxs("p",{className:"mt-2 font-light text-sm text-app-primary-foreground/70",children:[l.jsx("strong",{children:"Important:"})," ","Make sure to select the same time zone that was set in your broker when you exported your file. If you are unsure, check your broker export settings. Selecting the correct time zone ensures your trades are imported with the correct times, regardless of your current location or device."]})]}),t==="das"&&l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium mb-2",children:"Trade Date"}),l.jsx(pE,{selected:c,onSelect:u,placeholder:"Select trade date",ariaLabel:"Select DAS trade date"}),l.jsx("p",{className:"mt-2 font-light text-sm text-app-primary-foreground/70",children:"You must select a date because DAS Trader exports do not include trade dates."})]}),t&&n&&l.jsx(_jt,{selectedTagIds:d,onChange:f,userId:n,disabled:s==="uploading"}),t==="universalimport"&&n&&l.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-app-border-color bg-app-card/30 p-4",children:[l.jsx("input",{id:"import-is-futures",type:"checkbox",checked:y,onChange:R=>x(R.target.checked),disabled:s==="uploading",className:"mt-1 size-4 rounded-sm border-gray-700 bg-app-input-bg text-app-button-bg-active focus:ring-app-button-bg-active focus:ring-offset-0 cursor-pointer"}),l.jsxs("div",{className:"grid gap-1",children:[l.jsx("label",{htmlFor:"import-is-futures",className:"text-sm font-medium text-app-primary-foreground cursor-pointer select-none",children:"Contains Futures trades"}
4625),l.jsx("p",{className:"text-xs text-app-primary-foreground/60 leading-relaxed font-light",children:"Toggle this on if you are importing futures contracts (e.g., ES, NQ, MES). This ensures symbol contract multipliers (e.g., $50/point for ES) are applied to calculate your P&L correctly."})]})]}),t==="tradestation"&&l.jsxs("div",{children:[l.jsx(Ojt,{value:h,onChange:m,disabled:s==="uploading",error:a||void 0}),l.jsx(ye,{onClick:T,disabled:!h.trim()||s==="uploading",className:"mt-4",children:s==="uploading"?"Processing...":"Process Trade Data"})]}),(t==="thinkorswim"||t==="das"||t==="tradezero"||t==="webull"||t==="lightspeed"||t==="tradervue"||t==="moredge"||t==="universalimport")&&l.jsxs("div",{className:`
4626            border-2 border-dashed rounded-lg p-8 transition-colors
4627            ${!t||s==="uploading"||t==="das"&&!c?"opacity-50 pointer-events-none":N?"border-app-border-color-accent bg-app-card/10":"border-gray-700 hover:border-gray-600"}
4628          `,onDragOver:j,onDragLeave:M,onDrop:O,children:[l.jsxs("div",{className:"text-center",children:[l.jsx(goe,{className:"mx-auto size-12 text-app-primary-foreground/70"}),l.jsx("div",{className:"mt-4",children:l.jsxs("label",{htmlFor:"bulk-trade-upload",className:`\r
4629                  inline-flex items-center justify-center px-6 py-3 text-base font-medium rounded-xl\r
4630                  text-app-primary-foreground bg-app-button-bg-active border border-app-border-color-accent\r
4631                  hover:bg-app-button-bg-active/80 cursor-pointer transition-colors\r
4632                  disabled:opacity-50 disabled:cursor-not-allowed\r
4633                `,children:["Choose File",l.jsx("input",{id:"bulk-trade-upload",type:"file",className:"hidden",accept:".csv",onChange:E,disabled:s==="uploading",ref:S})]})}),l.jsx("p",{className:"mt-4 text-sm text-gray-400",children:N?"Drop your file here":"Drag and drop or click to select your file"})]}),a&&l.jsxs("div",{className:"mt-4 flex items-center gap-2 text-red-500 text-sm",children:[l.jsx(Ts,{size:16}),l.jsx("span",{children:a})]})]})]})},Ijt=["trade_id","symbol","position_type","entry_date","exit_date","entry_price","exit_price","position_size","pnl","net_pnl","commissions_fees","risk","status","notes","execution_time","execution_side","execution_quantity","execution_price","execution_fees","execution_misc_fees"];function Ljt(t){if(t==null)return"";const e=String(t);return e.includes(",")||e.includes('"')||e.includes(`
4634`)?`"${e.replace(/"/g,'""')}"`:e}function Die(t){return t.map(Ljt).join(",")}function $jt(t){const e=[];e.push(Ijt.join(","));for(const r of t){const n=r.trade_executions||[];
4634if(n.length===0)e.push(Die([r.id,r.symbol,r.positionType,r.entryDate,r.exitDate||"",r.entryPrice,r.exitPrice||"",r.positionSize,r.pnl,r.netPnl,r.commissionsFees,r.risk??"",r.status,r.notes||"","","","","","",""]));else for(const i of n)e.push(Die([r.id,r.symbol,r.positionType,r.entryDate,r.exitDate||"",r.entryPrice,r.exitPrice||"",r.positionSize,r.pnl,r.netPnl,r.commissionsFees,r.risk??"",r.status,r.notes||"",i.executionTime,i.side,i.quantity,i.price,i.commissionsFees,i.miscFees]))}return e.join(`
4635`)}function Fjt(t,e){const r=new Blob([t],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(r),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",e),i.style.visibility="hidden",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}function zjt(t,e){const r=n=>n.toISOString().split("T")[0];return`moredge-trades-${r(t)}-to-${r(e)}.csv`}const Bjt={today:"Today",this_week:"This week",this_month:"This month",year_to_date:"Year to date",custom:"Custom"};function Oie(t){const e=new Date;switch(t){case"today":return{startDate:Us(e),endDate:Zi(e)};case"this_week":return{startDate:mi(e,{weekStartsOn:1}),endDate:$u(e,{weekStartsOn:1})};case"this_month":return{startDate:Gs(e),endDate:Zi(ga(e))};case"year_to_date":return{startDate:Zu(e),endDate:Zi(e)};default:return{startDate:Gs(e),endDate:Zi(e)}}}function Vjt({isOpen:t,onClose:e}){const{userHasura:r}=Gt(),n=Qp("(max-width: 768px)"),[i,s]=b.useState(()=>{const{startDate:d,endDate:f}=Oie("this_month");return{from:d,to:f,option:"this_month"}}),[a,{loading:o}]=hEe(cYe,{fetchPolicy:"network-only"}),c=d=>{if(d==="custom")return;const{startDate:f,endDate:h}=Oie(d);s({from:f,to:h,option:d})},u=async()=>{if(!r?.id){Ft.error("Please sign in to export trades");return}try{const{data:d}=await a({variables:{userId:r.id,startDate:i.from.toISOString(),endDate:i.to.toISOString()}}),f=d?.trade??[];if(f.length===0){Ft.info("No trades found in the selected date range");return}const h=f.map(v=>({id:v.id,userId:v.userId,symbol:v.symbol,positionType:v.positionType,entryPrice:v.entryPrice,exitPrice:v.exitPrice??0,positionSize:v.positionSize,entryDate:v.entryDate,exitDate:v.exitDate??"",status:v.status,notes:v.notes??"",pnl:v.pnl,netPnl:v.netPnl,commissionsFees:v.commissionsFees,risk:v.risk,isActive:!0,createdAt:"",updatedAt:"",trade_executions:v.trade_executions.map(_=>({id:_.id,tradeId:_.tradeId,executionTime:_.executionTime,quantity:_.quantity,price:_.price,positionSize:_.positionSize,commissionsFees:_.commissionsFees,miscFees:_.miscFees,side:_.side}))})),m=$jt(h),y=zjt(i.from,i.to);Fjt(m,y);const x=h.reduce((v,_)=>v+_.trade_executions.length,0);Ft.success(`Exported ${f.length} trades with ${x} executions`),e()}catch(d){console.error("Export failed:",d),Ft.error("Failed to export trades. Please try again.")}};return l.jsx(AV,{isOpen:t,onClose:e,title:"Export Trades",maxWidth:"max-w-lg",hideDefaultFooter:!0,icon:l.jsx(rT,{className:"size-5"}),children:l.jsxs("div",{className:"space-y-6",children:[l.jsx("p",{className:"text-sm text-app-primary-foreground/70",children:"Export your trades to a CSV file. Select a date range to include only trades from that period."}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-app-primary-foreground/70",children:"Quick Select"}),l.jsx("div",{className:"flex flex-row flex-wrap gap-2",children:["today","this_week","this_month","year_to_date"].map(d=>l.jsx("button",{type:"button",className:Pe("px-4 rounded-xl transition-colors text-sm border cursor-pointer leading-0 h-9",i.option===d?"bg-app-button-bg-active text-app-primary-foreground border-app-border-color-accent":"bg-app-input-bg/50 text-app-primary-foreground/70 border-app-border-color hover:bg-app-input-bg hover:text-app-primary-foreground border-dashed","focus-visible:border-app-border-color-accent focus-visible:ring-3 focus-visible:ring-app-border-color-accent/40 focus-visible:outline-hidden"),onClick:()=>c(d),children:Bjt[d]},d))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-app-primary-foreground
4635/70",children:"Or Select Custom Range"}),l.jsxs(Bf,{children:[l.jsx(Vf,{asChild:!0,children:l.jsx(ye,{variant:"outline",className:"w-full justify-start text-left font-normal bg-app-input-bg/50 h-10 border-dashed hover:border-app-border-color-accent",children:Ime(i.from,i.to,n)})}),l.jsx(Uf,{className:"w-auto p-0 border-none",align:"start",children:l.jsx(Yge,{mode:"range",showOutsideDays:!1,defaultMonth:i.from,selected:{from:i.from,to:i.to},onSelect:d=>{d?.from&&d?.to?s({from:Us(d.from),to:Zi(d.to),option:"custom"}):d?.from&&s({from:Us(d.from),to:Zi(d.from),option:"custom"})},numberOfMonths:n?1:2})})]})]}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx(ye,{variant:"outline",className:"flex-1",onClick:e,disabled:o,children:"Cancel"}),l.jsx(ye,{className:"flex-1 gap-2",onClick:u,disabled:o,children:o?l.jsxs(l.Fragment,{children:[l.jsx(No,{className:"size-4 animate-spin"}),"Exporting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(rT,{className:"size-4"}),"Export CSV"]})})]})]})})}const Ujt=()=>{const{currentCount:t,monthlyLimit:e,remainingTrades:r,isFreePlan:n,isAtLimit:i}=zhe(),{userCurrentPlan:s}=Hs();if(!n||s?.name.toLowerCase()!=="free")return null;const a=e>0?t/e*100:0;return l.jsxs("div",{className:"bg-app-card/50 w-full md:w-auto",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2 gap-8",children:[l.jsx("span",{className:"text-sm font-medium font-mono text-app-primary-foreground",children:"Monthly Trade Limit"}),l.jsxs("span",{className:"text-sm font-mono text-app-primary-foreground",children:[t," ","/",e]})]}),l.jsx("div",{className:"w-full bg-app-border-color rounded-full h-2 mb-2",children:l.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${i||a>=90?"bg-red-500":a>=75?"bg-yellow-500":"bg-app-button-bg-active"}`,style:{width:`${Math.min(a,100)}%`}})}),l.jsxs("p",{className:"text-xs text-app-primary-foreground/60 font-mono",children:[l.jsx("span",{className:"font-medium text-app-primary-foreground",children:r})," ","trades remaining this month"]})]})},Gjt=t=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",...t,children:[l.jsx("title",{children:"files"}),l.jsxs("g",{fill:"none",children:[l.jsx("path",{d:"M8.40248 1C7.3938 1 6.42236 1.38108 5.68272 2.06693L2.28024 5.22196C1.46393 5.9789 1 7.04178 1 8.15503L1 14.5C1 16.433 2.567 18 4.5 18H12.5C14.433 18 16 16.433 16 14.5V4.5C16 2.567 14.433 1 12.5 1L8.40248 1Z",fill:"url(#1752500502785-6928967_files_existing_0_u7sd7dn4k)","data-glass":"origin",mask:"url(#1752500502785-6928967_files_mask_412n3jmqd)"}),l.jsx("path",{d:"M8.40248 1C7.3938 1 6.42236 1.38108 5.68272 2.06693L2.28024 5.22196C1.46393 5.9789 1 7.04178 1 8.15503L1 14.5C1 16.433 2.567 18 4.5 18H12.5C14.433 18 16 16.433 16 14.5V4.5C16 2.567 14.433 1 12.5 1L8.40248 1Z",fill:"url(#1752500502785-6928967_files_existing_0_u7sd7dn4k)","data-glass":"clone",filter:"url(#1752500502785-6928967_files_f
4635ilter_0whf7kuql)",clipPath:"url(#1752500502785-6928967_files_clipPath_5sqyfl1z9)"}),l.jsx("path",{d:"M15.5975 6C16.6062 6 17.5776 6.38108 18.3173 7.06693L21.7198 10.222C22.5361 10.9789 23 12.0418 23 13.155L23 19.5C23 21.433 21.433 23 19.5 23L11.5 23C9.567 23 8 21.433 8 19.5L8 9.5C8 7.567 9.56701 6 11.5 6L15.5975 6Z",fill:"url(#1752500502785-6928967_files_existing_1_yc9h3ai2m)","data-glass":"blur"}),l.jsx("path",{d:"M8 19.5V9.5C8 7.567 9.567 6 11.5 6H15.5977L15.7861 6.00488C16.7267 6.04926 17.624 6.4244 18.3174 7.06738L21.7197 10.2217C22.536 10.9786 23 12.042 23 13.1553V19.5L22.9951 19.6797C22.9046 21.4697 21.4696 22.9046 19.6797 22.9951L19.5 23V22.25C21.0188 22.25 22.25 21.0188 22.25 19.5V13.1553C22.25 12.2508 21.8732 11.3865 21.21 10.7715L17.8076 7.61719C17.2067 7.05997 16.4172 6.75004 15.5977 6.75H11.5C9.98122 6.75 8.75 7.98122 8.75 9.5V19.5C8.75 21.0188 9.98122 22.25 11.5 22.25V23L11.3203 22.9951C9.47083 22.9016 8 21.3727 8 19.5ZM19.5 22.25V23H11.5V22.25H19.5Z",fill:"url(#1752500502785-6928967_files_existing_2_bhvt9x3j0)"}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"1752500502785-6928967_files_existing_0_u7sd7dn4k",x1:"8.5",y1:"1",x2:"8.5",y2:"18",gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#575757"}),l.jsx("stop",{offset:"1",stopColor:"#151515"})]}),l.jsxs("linearGradient",{id:"1752500502785-6928967_files_existing_1_yc9h3ai2m",x1:"23",y1:"14.5",x2:"8",y2:"14.5",gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#E3E3E5",stopOpacity:".6"}),l.jsx("stop",{offset:"1",stopColor:"#BBBBC0",stopOpacity:".6"})]}),l.jsxs("linearGradient",{id:"1752500502785-6928967_files_existing_2_bhvt9x3j0",x1:"15.5",y1:"6",x2:"15.5",y2:"15.845",gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#fff"}),l.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0"})]}
4635),l.jsx("filter",{id:"1752500502785-6928967_files_filter_0whf7kuql",x:"-100%",y:"-100%",width:"400%",height:"400%",filterUnits:"objectBoundingBox",primitiveUnits:"userSpaceOnUse",children:l.jsx("feGaussianBlur",{stdDeviation:"2",x:"0%",y:"0%",width:"100%",height:"100%",in:"SourceGraphic",edgeMode:"none",result:"blur"})}),l.jsx("clipPath",{id:"1752500502785-6928967_files_clipPath_5sqyfl1z9",children:l.jsx("path",{d:"M15.5975 6C16.6062 6 17.5776 6.38108 18.3173 7.06693L21.7198 10.222C22.5361 10.9789 23 12.0418 23 13.155L23 19.5C23 21.433 21.433 23 19.5 23L11.5 23C9.567 23 8 21.433 8 19.5L8 9.5C8 7.567 9.56701 6 11.5 6L15.5975 6Z",fill:"url(#1752500502785-6928967_files_existing_1_yc9h3ai2m)"})}),l.jsxs("mask",{id:"1752500502785-6928967_files_mask_412n3jmqd",children:[l.jsx("rect",{width:"100%",height:"100%",fill:"#FFF"}),l.jsx("path",{d:"M15.5975 6C16.6062 6 17.5776 6.38108 18.3173 7.06693L21.7198 10.222C22.5361 10.9789 23 12.0418 23 13.155L23 19.5C23 21.433 21.433 23 19.5 23L11.5 23C9.567 23 8 21.433 8 19.5L8 9.5C8 7.567 9.56701 6 11.5 6L15.5975 6Z",fill:"#000"})]})]})]})]}),Wjt={thinkorswim:{platform:"thinkorswim",title:"ThinkOrSwim export guide",subtitle:"Follow these steps to export your trades",steps:['Open Thinkorswim and select a specific account (not "ALL ACCOUNTS").',"Go to the Monitor tab, then choose Account Statement.","Select the date range for your trades in the Account Statement dropdown.","Wait for the Trade History section to load, then sort by Exec Time (oldest first).","Click the actions menu (top right), select Export to file.","Set file type to CSV and save it to your computer.","Return here, select your CSV file, and upload."],notesHeading:"Important Notes",notes:[{title:"Required Columns:",description:"Your CSV must include: Exec Time, Spread, Side, Qty, Symbol, Price."},{title:"Time Zone:",description:"Thinkorswim exports in your local time zone. Before importing, select the same time zone you used in ThinkOrSwim. This ensures your trades are imported with the correct times, even if you are in a different location now."},{title:"Options Trading:",description:"Option trades from 2012 and later import successfully. For issues, contact us.",link:{text:"contact us",href:"#"}}]},das:{platform:"das",title:"DAS Trader export guide",subtitle:"Follow these steps to export your trades",steps:["Select Trade Log from the Trade menu.","Right-click in the list of executions and select Export, then save the file to your desktop (or anywhere else — just remember where you put it).","On the import page, click the Trade Date box and select the date of the trades you are importing. You must select a date because DAS Trader exports do not include trade dates.","Click Choose file, pick the CSV you saved, and click Upload."],footnote:"Note: Since DAS Trader resets the trades executed each day, be sure to export your trades as soon as you finish trading for the day."},tradestation:{platform:"tradestation",title:"TradeStation export guide",subtitle:"Follow these steps to export your trades",steps:["Select the timezone your data is in on the left side of this page.","In TradeStation, go to the TradeManager, and select the 'Orders' tab on the bottom of the screen.","From the 'Status' drop-down at the top of the screen, select 'Filled Orders'.","Enter the date range you want to import into Tradervue and press the 'Retrieve Orders' button.","Change the sort order to sort by Filled/Cancelled orders in ascending order (e.g. oldest first).","Click (tick) the upper left 'square', then right click and select 'Copy'.","Paste the data into the 'Data' box on the left side of this page, and click 'Upload'."],notesHeading:"Important Notes",notes:[{title:"Required Columns:",description:"Your data must include the following columns: Filled/Canceled, Symbol, Type, Qty Filled, Filled Price, Order Status. The 'Commission' column is optional but recommended if you want to track commissions. If any required column is missing, the import will fail."},{title:"Unbundled Pricing:",description:"If you are using unbundled pricing, and wish to track ECN fees and liquidity in Tradervue, then add the 'Unbundled Route Fees' column to the Orders tab in the TradeManager before copying data."},{title:"Copy/Paste Issues:",description:"If you are experiencing any issue with the copy/paste functions, please reach out to us!",link:{text:"reach out to us",href:"#"}}],footnote:"Note: TradeStation exports do not include trade dates, so you must select the trade date before uploading."},universalimport:{platform:"universalimport",title:"Generic CSV Import Guide",subtitle:"How to prepare and import your trades using the generic format",steps:["Download the CSV template from this page.","Fill in your trade data in the template, following the required columns and format.","Save your file as CSV (comma or tab delimited).","Upload your completed file here to import your trades."],notesHeading:"Format Details & Tips",notes:[{title:"Required Columns:",de
4635scription:"Date, Time, Symbol, Quantity, Price. 'Side' is optional. If omitted, use a negative quantity for sells. The header row is highly recommended, especially if your columns are not in the exact order shown."},{title:"Date & Time:",description:"Date is highly recommended. Supported formats: mm/dd/yyyy, mm-dd-yyyy, yyyy/mm/dd, yyyy-mm-dd, yyyymmdd. Time should be in HH:MM:SS (24-hour). If omitted, 12:00:00 will be used."},{title:"Symbol:",description:"Required. For futures, use formats like ESZ1, ES DEC 11, ES 12-11, etc. For forex, use symbols like EURUSD."},{title:"Prices & Quantity:",description:"Price and Quantity are required. Use decimal points for prices (e.g., 1234.56). Quantity should be positive for buys and negative for sells, unless you use the 'Side' column."},{title:"Side (Optional):",description:"If present, must start with 'B' or 'S' (e.g., Buy, Sell, BOT, SLD, Short). If omitted, negative quantity indicates a sell."},{title:"Commissions/Fees (Optional):",description:"You may include a column named 'Commission' in your file to specify the commission for each trade. If this column is left empty for a row, it will be treated as 0.00 by default. Adding this column is optional and you can leave it blank if you do not wish to track commissions."},{title:"Delimiters:",description:"Both commas and tabs are accepted as delimiters."},{title:"Template:",description:"Start from our pre-formatted CSV template to ensure columns and headers match the importer.",link:{text:"Download CSV template",href:"/templates/universal-import-template.csv"}}],footnote:"Tip: Start with a small sample of your data to ensure it imports correctly. If you have questions or issues, please contact support."},webull:{platform:"webull",title:"Webull export guide",subtitle:"Follow these steps to export your trades",steps:["In the Webull mobile application, click the Account button, or the Webull logo on the bottom.","Click Orders.","Click the download symbol in the top right corner, then click Submit.","A file will be emailed to your account email. Move that file to your desktop (or anywhere else, just remember where you put it).",'Here on the import page, click "Choose file", choose the file moved above, and click "Upload".'],notesHeading:"Important Notes",notes:[{title:"Supported Regions:",description:"Both Webull U.S. and Webull Canada CSV exports are supported."},{title:"No Time Zone Selection:",description:"Webull exports all times in Eastern Time (New York)."}]},tradezero:{platform:"tradezero",title:"TradeZero export guide",subtitle:"Follow these steps to export your trades from TradeZero",steps:["Sign in to your TradeZero account at tradezero.co and go to My Account.","From the dropdown, select Account Overview.","Navigate to the Trades tab within your account stats.","Set the start and end dates for the trades you wish to export, then click Search.","Above the list of trades, click the Excel icon to export, and save the CSV file to your computer.",'On this import page, click "Choose file", select the CSV you just saved, and click "Upload".'],notesHeading:"Important Notes",notes:[{title:"Time Zone:",description:"TradeZero exports times in Eastern Time (New York). No time zone selection is needed."},{title:"Required Columns:",description:"Your CSV must include: Date/Time, Symbol, Side, Quantity, Price. If any required column is missing, the import will fail."}]},lightspeed:{platform:"lightspeed",title:"Lightspeed export guide",subtitle:"Supported Asset Types: Stocks, Futures, Options, Forex",steps:["Log into the Lightspeed web site, navigate to Reports, and then Account List.","Click on your account number to choose the account to view.",'Click "Blotter", and select the date range you wish to export.',"Click the CSV button, and download the CSV file to your desktop (or anywhere else - just remember where you put it).",'Here on the import page, click "Choose file", choose the file you created above, and click "Upload".'],notesHeading:"Important Notes",notes:[{title:"Time Zone:",description:"Lightspeed exports times in Eastern Time (America/Ne
4635w_York). No time zone selection is needed."},{title:"Required Columns:",description:"Your CSV must include: Symbol, Side, Qty, Price, Raw Exec. Time. Commission and fee columns are optional but recommended for accurate P&L tracking."}]},tradervue:{platform:"tradervue",title:"Tradervue export guide",subtitle:"Follow these steps to export your trades from Tradervue",steps:["Open Tradervue and go to the Trades tab.","Select the date range for the trades you want to download.",'Scroll down and click "Download CSV".',"Save the CSV file to your computer.",'Here on the import page, click "Choose file", select the CSV you just saved, and click "Upload".'],notesHeading:"Important Notes",notes:[{title:"Time Zone:",description:"Tradervue exports times in Eastern Time (America/New_York). No time zone selection is needed."},{title:"Trade Format:",description:"Tradervue exports complete round-trip trades, not individual executions. Each row in the CSV represents a full trade with entry and exit information."}]},moredge:{platform:"moredge",title:"MorEdge import guide",subtitle:"Import trades exported from MorEdge",steps:["Export your trades from MorEdge using the Export Trades feature on the Trade Entry page.","Save the CSV file to your computer.",'Here on the import page, click "Choose file", select the CSV you exported, and click "Upload".'],notesHeading:"Important Notes",notes:[{title:"Format:",description:"MorEdge exports include all execution-level data, allowing complete reconstruction of your trades."},{title:"Use Case:",description:"Use this to share trades with friends, transfer trades between accounts, or restore from a backup."}]}},Hjt=({title:t,subtitle:e})=>l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium text-app-primary-foreground mb-2 2k:text-3xl",children:t}),l.jsx("p",{className:"text-app-primary-foreground/60 2k:text-xl",children:e})]}),qjt=({steps:t,footnote:e})=>l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium text-app-primary-foreground mb-4 2k:text-2xl",children:"Export Steps:"}),l.jsx("ol",{className:"space-y-3 text-sm text-app-primary-foreground/80 2k:text-xl",children:t.map((r,n)=>l.jsxs("li",{className:"flex gap-3",children:[l.jsxs("span",{className:"text-app-border-color-accent font-medium min-w-[20px] 2k:text-2xl",children:[n+1,"."]}),l.jsx("p",{className:"leading-relaxed",children:r})]},n))}),e&&l.jsx("p",{className:"mt-4 text-xs text-app-primary-foreground/60 2k:text-xl",children:e})]}),Yjt=({heading:t="Important Notes",notes:e})=>!e||e.length===0?null:l.jsxs("div",{className:"border-t border-app-border-color-soft pt-6",children:[l.jsx("h4",{className:"font-medium text-app-primary-foreground mb-4 2k:text-2xl",children:t}),l.jsx("div",{className:"space-y-4 text-sm text-app-primary-foreground/70 2k:text-xl",children:e.map((r,n)=>l.jsxs("div",{children:[r.title&&l.jsx("p",{className:"font-medium text-app-primary-foreground mb-1 2k:text-xl",children:r.title}),l.jsxs("p",{className:"leading-relaxed",children:[r.description," ",r.link&&l.jsx("a",{className:"text-app-border-color-accent hover:underline",href:r.link.href,children:r.link.text})]})]},n))})]}),Kjt=()=>l.jsxs("div",{className:"p-6 flex items-center justify-center text-center flex-col gap-2",children:[l.jsx(Gjt,{className:"size-16 -rotate-12 2k:size-36"}),l.jsx("h3",{className:"text-lg font-semibold text-app-primary-foreground 2k:text-3xl",children:"Pick a Trading Platform"}),l.jsx("p",{className:"text-app-primary-foreground/70 font-light max-w-sm leading-relaaxed 2k:text-xl 2k:max-w-lg",children:"Select a platform above to see step-by-step export instructions."})]}),Qjt=({platform:t})=>{const e=X9e({duration:rn.relaxed,ease:Hr.cubic}),r=Wjt[t]||void 0;return l.jsx("div",{className:"relative w-full h-full min-h-[420px]",children:l.jsx(Ss,{mode:"wait",children:!t||!r?l.jsx(ct.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:e,className:"p-6 flex items-center justify-center text-center flex-col gap-2 h-full",children:l.jsx(Kjt,{})},"fallback"):l.jsx(ct.div,{initial:{opacity:0,y:8}
vendor: 51,772 bytes, lines 4635-4647
4635,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:e,className:"space-y-8",children:r&&l.jsxs(l.Fragment,{children:[l.jsx(Hjt,{title:r.title,subtitle:r.subtitle}),l.jsx(qjt,{steps:r.steps,footnote:r.footnote}),l.jsx(Yjt,{heading:r.notesHeading,notes:r.notes})]})},t)})})},Zjt=()=>{const[t,e]=b.useState(""),[r,n]=b.useState(!1);return l.jsxs("section",{className:"p-6 mx-auto w-full space-y-12 2k:py-8",children:[l.jsxs("div",{className:"flex md:flex-row flex-col gap-6 justify-between md:items-center items-start",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("h1",{className:"text-4xl font-bold text-app-primary-foreground 2k:text-5xl",children:"Add new trades"}),l.jsx("p",{className:"text-app-primary-foreground/60 text-lg max-w-2xl 2k:max-w-4xl 2k:text-2xl",children:"Record your trades manually or import them in bulk from your trading platform."})]}),l.jsxs("div",{className:"flex flex-row gap-4 items-center",children:[l.jsxs(ye,{variant:"outline",className:"gap-2",onClick:()=>n(!0),children:[l.jsx(rT,{className:"size-4"}),"Export Trades"]}),l.jsx(Ujt,{})]})]}),l.jsxs(Nge,{defaultValue:"bulk",className:"space-y-10",children:[l.jsx(Age,{className:"bg-transparent p-0 gap-8 border-b border-app-border-color-soft w-full justify-start flex flex-row",children:l.jsxs(p5,{value:"bulk",className:"gap-2 py-3 px-2 bg-transparent border-b-2 border-transparent border-x-0 border-t-0 data-[state=active]:border-app-button-bg-active rounded-none text-base font-medium flex items-center justify-center w-[200px] 2k:text-2xl",children:[l.jsx(goe,{className:"size-4 mr-1.5 2k:size-7"}),"Bulk Import"]})}),l.jsx(m5,{value:"bulk",children:l.jsxs("div",{className:"grid lg:grid-cols-3 gap-16 px-6 lg:px-12 pb-12",children:[l.jsx("div",{className:"lg:col-span-2",children:l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-semibold text-app-primary-foreground mb-2 2k:text-3xl",children:"Import from CSV"}),l.jsx("p",{className:"text-app-primary-foreground/60 2k:text-xl",children:"Upload trades directly from your trading platform"})]}),l.jsx(Rjt,{platform:t,setPlatform:e})]})}),l.jsx("div",{className:"lg:col-span-1",children:l.jsx(Qjt,{platform:t})})]})})]}),l.jsx(Vjt,{isOpen:r,onClose:()=>n(!1)})]})};/**
4636   * table-core
4637   *
4638   * Copyright (c) TanStack
4639   *
4640   * This source code is licensed under the MIT license found in the
4641   * LICENSE.md file in the root directory of this source tree.
4642   *
4643   * @license MIT
4644   */function Jd(t,e){return typeof t=="function"?t(e):t}function Ga(t,e){return r=>{e.setState(n=>({...n,[t]:Jd(r,n[t])}))}}function cP(t){return t instanceof Function}function Xjt(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Jjt(t,e){const r=[],n=i=>{i.forEach(s=>{r.push(s);const a=e(s);a!=null&&a.length&&n(a)})};return n(t),r}function Ot(t,e,r){let n=[],i;return s=>{let a;r.key&&r.debug&&(a=Date.now());const o=t(s);if(!(o.length!==n.length||o.some((d,f)=>n[f]!==d)))return i;n=o;let u;if(r.key&&r.debug&&(u=Date.now()),i=e(...o),r==null||r.onChange==null||r.onChange(i),r.key&&r.debug&&r!=null&&r.debug()){const d=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-u)*100)/100,h=f/16,m=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${m(f,5)} /${m(d,5)} ms`,`
4645            font-size: .6rem;
4646            font-weight: bold;
4647            color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,r?.key)}return i}}function Rt(t,e,r,n){return{debug:()=>{var i;return(i=t?.debugAll)!=null?i:t[e]},key:!1,onChange:n}}function eNt(t,e,r,n){const i=()=>{var a;return(a=s.getValue())!=null?a:t.options.renderFallbackValue},s={id:`${e.id}_${r.id}`,row:e,column:r,getValue:()=>e.getValue(n),renderValue:i,getContext:Ot(()=>[t,r,e,s],(a,o,c,u)=>({table:a,column:o,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),Rt(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(s,r,e,t)},{}),s}function tNt(t,e,r,n){var i,s;const o={...t._getDefaultColumnDef(),...e},c=o.accessorKey;let u=(i=(s=o.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?i:typeof o.header=="string"?o.header:void 0,d;if(o.accessorFn?d=o.accessorFn:c&&(c.includes(".")?d=h=>{let m=h;for(const x of c.split(".")){var y;m=(y=m)==null?void 0:y[x]}return m}:d=h=>h[o.accessorKey]),!u)throw new Error;let f={id:`${String(u)}`,accessorFn:d,parent:n,depth:r,columnDef:o,columns:[],getFlatColumns:Ot(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(m=>m.getFlatColumns())]},Rt(t.options,"debugColumns")),getLeafColumns:Ot(()=>[t._getOrderColumnsFn()],h=>{var m;if((m=f.columns)!=null&&m.length){let y=f.columns.flatMap(x=>x.getLeafColumns());return h(y)}return[f]},Rt(t.options,"debugColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(f,t);return f}const cs="debugHeaders";function Rie(t,e,r){var n;let s={id:(n=r.id)!=null?n:e.id,column:e,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],o=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(o),a.push(c)};return o(s),a},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(s,t)}),s}const rNt={createTable:t=>{t.getHeaderGroups=Ot(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,r,n,i)=>{var s,a;const o=(s=n?.map(f=>r.find(h=>h.id===f)).filter(Boolean))!=null?s:[],c=(a=i?.map(f=>r.find(h=>h.id===f)).filter(Boolean))!=null?a:[],u=r.filter(f=>!(n!=null&&n.includes(f.id))&&!(i!=null&&i.includes(f.id)));return YS(e,[...o,...u,...c],t)},Rt(t.options,cs)),t.getCenterHeaderGroups=Ot(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,r,n,i)=>(r=r.filter(s=>!(n!=null&&n.includes(s.id))&&!(i!=null&&i.includes(s.id))),YS(e,r,t,"center")),Rt(t.options,cs)),t.getLeftHeaderGroups=Ot(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,r,n)=>{var i;const s=(i=n?.map(a=>r.find(o=>o.id===a)).filter(Boolean))!=null?i:[];return YS(e,s,t,"left")},Rt(t.options,cs)),t.getRightHeaderGroups=Ot(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,r,n)=>{var i;const s=(i=n?.map(a=>r.find(o=>o.id===a)).filter(Boolean))!=null?i:[];return YS(e,s,t,"right")},Rt(t.options,cs)),t.getFooterGroups=Ot(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Rt(t.options,cs)),t.getLeftFooterGroups=Ot(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Rt(t.options,cs)),t.getCenterFooterGroups=Ot(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Rt(t.options,cs)),t.getRightFooterGroups=Ot(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Rt(t.options,cs)),t.getFlatHeaders=Ot(()=>[t.getHeaderGroups()],e=>e.map(r=>r.headers).flat(),Rt(t.options,cs)),t.getLeftFlatHeaders=Ot(()=>[t.getLeftHeaderGroups()],e=>e.map(r=>r.headers).flat(),Rt(t.options,cs)),t.getCenterFlatHeaders=Ot(()=>[t.getCenterHeaderGroups()],e=>e.map(r=>r.headers).flat(),Rt(t.options,cs)),t.getRightFlatHeaders=Ot(()=>[t.getRightHeaderGroups()],e=>e.map(r=>r.headers).flat(),Rt(t.options,cs)),t.getCenterLeafHeaders=Ot(()=>[t.getCenterFlatHeaders()],e=>e.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Rt(t.options,cs)),t.getLeftLeafHeaders=Ot(()=>[t.getLeftFlatHeaders()],e=>e.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Rt(t.options,cs)),t.getRightLeafHeaders=Ot(()=>[t.getRightFlatHeaders()],e=>e.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Rt(t.options,cs)),t.getLeafHeaders=Ot(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,r,n)=>{var i,s,a,o,c,u;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(a=(o=r[0])==null?void 0:o.headers)!=null?a:[],...(c=(u=n[0])==null?void 0:u.headers)!=null?c:[]].map(d=>d.getLeafHeaders()).flat()},Rt(t.options,cs))}};function YS(t,e,r,n){var i,s;let a=0;const o=function(h,m){m===void 0&&(m=1),a=Math.max(a,m),h.filter(y=>y.getIsVisible()).forEach(y=>{var x;(x=y.columns)!=null&&x.length&&o(y.columns,m+1)},0)};o(t);let c=[];const u=(h,m)=>{const y={depth:m,id:[n,`${m}`].filter(Boolean).join("_"),headers:[]},x=[];h.forEach(v=>{const _=[...x].reverse()[0],S=v.column.depth===y.depth;let k,E=!1;if(S&&v.column.parent?k=v.column.parent:(k=v.column,E=!0),_&&_?.column===k)_.subHeaders.push(v);else{const T=Rie(r,k,{id:[n,m,k.id,v?.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${x.filter(N=>N.column===k).length}`:void 0,depth:m,index:x.length});T.subHeaders.push(v),x.push(T)}y.headers.push(v),v.headerGroup=y}),c.push(y),m>0&&u(x,m-1)},d=e.map((h,m)=>Rie(r,h,{depth:a,index:m}));u(d,a-1),c.reverse();const f=h=>h.filter(y=>y.column.getIsVisible()).map(y=>{let x=0,v=0,_=[0];y.subHeaders&&y.subHeaders.length?(_=[],f(y.subHeaders).forEach(k=>{let{colSpan:E,rowSpan:T}=k;x+=E,_.push(T)})):x=1;const S=Math.min(..._);return v=v+S,y.colSpan=x,y.rowSpan=v,{colSpan:x,rowSpan:v}});return f((i=(s=c[0])==null?void 0:s.headers)!=null?i:[]),c}const nNt=(t,e,r,n,i,s,a)=>{let o={id:e,index:n,original:r,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(o._valuesCache.hasOwnProperty(c))return o._valuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return o._valuesCache[c]=u.accessorFn(o.original,n),o._valuesCache[c]},getUniqueValues:c=>{if(o._uniqueValuesCache.hasOwnProperty(c))return o._uniqueValuesCache[c];const u=t.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(o._uniqueValuesCache[c]=u.columnDef.getUniqueValues(o.original,n),o._uniqueValuesCache[c]):(o._uniqueValuesCache[c]=[o.getValue(c)],o._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=o.getValue(c))!=null?u:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>Jjt(o.subRows,c=>c.subRows),getParentRow:()=>o.parentId?t.getRow(o.parentId,!0):void 0,getParentRows:()=>{let c=[],u=o;for(;;){const d=u.getParentRow();if(!d)break;c.push(d),u=d}return c.reverse()},getAllCells:Ot(()=>[t.getAllLeafColumns()],c=>c.map(u=>eNt(t,o,u,u.id)),Rt(t.options,"debugRows")),_getAllCellsByColumnId:Ot(()=>[o.getAllCells()],c=>c.reduce((u,d)=>(u[d.column.id]=d,u),{}),Rt(t.options,"debugRows"))};for(let c=0;c<t._features.length;c++){const u=t._features[c];u==null||u.createRow==null||u.createRow(o,t)}return o},iNt={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},zbe=(t,e,r)=>{var n,i;const s=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};zbe.autoRemove=t=>gl(t);const Bbe=(t,e,r)=>{var n;return!!(!((n=t.getValue(e))==null||(n=n.toString())==null)&&n.includes(r))};Bbe.autoRemove=t=>gl(t);const Vbe=(t,e,r)=>{var n;return((n=t.getValue(e))==null||(n=n.toString())==null?void 0:n.toLowerCase())===r?.toLowerCase()};Vbe.autoRemove=t=>gl(t);const Ube=(t,e,r)=>{var n;return(n=t.getValue(e))==null?void 0:n.includes(r)};Ube.autoRemove=t=>gl(t);const Gbe=(t,e,r)=>!r.some(n=>{var i;return!((i=t.getValue(e))!=null&&i.includes(n))});Gbe.autoRemove=t=>gl(t)||!(t!=null&&t.length);const Wbe=(t,e,r)=>r.some(n=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(n)});Wbe.autoRemove=t=>gl(t)||!(t!=null&&t.length);const Hbe=(t,e,r)=>t.getValue(e)===r;Hbe.autoRemove=t=>gl(t);const qbe=(t,e,r)=>t.getValue(e)==r;qbe.autoRemove=t=>gl(t);const k6=(t,e,r)=>{let[n,i]=r;const s=t.getValue(e);return s>=n&&s<=i};k6.resolveFilterValue=t=>{let[e,r]=t,n=typeof e!="number"?parseFloat(e):e,i=typeof r!="number"?parseFloat(r):r,s=e===null||Number.isNaN(n)?-1/0:n,a=r===null||Number.isNaN(i)?1/0:i;if(s>a){const o=s;s=a,a=o}return[s,a]};k6.autoRemove=t=>gl(t)||gl(t[0])&&gl(t[1]);const Gc={includesString:zbe,includesStringSensitive:Bbe,equalsString:Vbe,arrIncludes:Ube,arrIncludesAll:Gbe,arrIncludesSome:Wbe,equals:Hbe,weakEquals:qbe,inNumberRange:k6};function gl(t){return t==null||t===""}const sNt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ga("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const r=e.getCoreRowModel().flatRows[0],n=r?.getValue(t.id);return typeof n=="string"?Gc.includesString:typeof n=="number"?Gc.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?Gc.equals:Array.isArray(n)?Gc.arrIncludes:Gc.weakEquals},t.getFilterFn=()=>{var r,n;return cP(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(r=(n=e.options.filterFns)==null?void 0:n[t.columnDef.filterFn])!=null?r:Gc[t.columnDef.filterFn]},t.getCanFilter=()=>{var r,n,i;return((r=t.columnDef.enableColumnFilter)!=null?r:!0)&&((n=e.options.enableColumnFilters)!=null?n:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var r;return(r=e.getState().columnFilters)==null||(r=r.find(n=>n.id===t.id))==null?void 0:r.value},t.getFilterIndex=()=>{var r,n;return(r=(n=e.getState().columnFilters)==null?void 0:n.findIndex(i=>i.id===t.id))!=null?r:-1},t.setFilterValue=r=>{e.setColumnFilters(n=>{const i=t.getFilterFn(),s=n?.find(d=>d.id===t.id),a=Jd(r,s?s.value:void 0);if(Iie(i,a,t)){var o;return(o=n?.filter(d=>d.id!==t.id))!=null?o:[]}const c={id:t.id,value:a};if(s){var u;return(u=n?.map(d=>d.id===t.id?c:d))!=null?u:[]}return n!=null&&n.length?[...n,c]:[c]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const r=t.getAllLeafColumns(),n=i=>{var s;return(s=Jd(e,i))==null?void 0:s.filter(a=>{const o=r.find(c=>c.id===a.id);if(o){const c=o.getFilterFn();if(Iie(c,a.value,o))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(n)},t.resetColumnFilters=e=>{var r,n;t.setColumnFilters(e?[]:(r=(n=t.initialState)==null?void 0:n.columnFilters)!=null?r:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function Iie(t,e,r){return(t&&t.autoRemove?t.autoRemove(e,r):!1)||typeof e>"u"||typeof e=="string"&&!e}const aNt=(t,e,r)=>r.reduce((n,i)=>{const s=i.getValue(t);return n+(typeof s=="number"?s:0)},0),oNt=(t,e,r)=>{let n;return r.forEach(i=>{const s=i.getValue(t);s!=null&&(n>s||n===void 0&&s>=s)&&(n=s)}),n},lNt=(t,e,r)=>{let n;return r.forEach(i=>{const s=i.getValue(t);s!=null&&(n<s||n===void 0&&s>=s)&&(n=s)}),n},cNt=(t,e,r)=>{let n,i;return r.forEach(s=>{const a=s.getValue(t);a!=null&&(n===void 0?a>=a&&(n=i=a):(n>a&&(n=a),i<a&&(i=a)))}),[n,i]},uNt=(t,e)=>{let r=0,n=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++r,n+=s)}),r)return n/r},dNt=(t,e)=>{if(!e.length)return;const r=e.map(s=>s.getValue(t));if(!Xjt(r))return;if(r.length===1)return r[0];const n=Math.floor(r.length/2),i=r.sort((s,a)=>s-a);return r.length%2!==0?i[n]:(i[n-1]+i[n])/2},fNt=(t,e)=>Array.from(new Set(e.map(r=>r.getValue(t))).values()),hNt=(t,e)=>new Set(e.map(r=>r.getValue(t))).size,pNt=(t,e)=>e.length,kL={sum:aNt,min:oNt,max:lNt,extent:cNt,mean:uNt,median:dNt,unique:fNt,uniqueCount:hNt,count:pNt},mNt={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,r;return(e=(r=t.getValue())==null||r.toString==null?void 0:r.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ga("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(r=>r!=null&&r.includes(t.id)?r.filter(n=>n!==t.id):[...r??[],t.id])},t.getCanGroup=()=>{var r,n;return((r=t.columnDef.enableGrouping)!=null?r:!0)&&((n=e.options.enableGrouping)!=null?n:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var r;return(r=e.getState().grouping)==null?void 0:r.includes(t.id)},t.getGroupedIndex=()=>{var r;return(r=e.getState().grouping)==null?void 0:r.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const r=t.getCanGroup();return()=>{r&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const r=e.getCoreRowModel().flatRows[0],n=r?.getValue(t.id);if(typeof n=="number")return kL.sum;if(Object.prototype.toString.call(n)==="[object Date]")return kL.extent},t.getAggregationFn=()=>{var r,n;if(!t)throw new Error;return cP(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(r=(n=e.options.aggregationFns)==null?void 0:n[t.columnDef.aggregationFn])!=null?r:kL[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var r,n;t.setGrouping(e?[]:(r=(n=t.initialState)==null?void 0:n.grouping)!=null?r:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=r=>{if(t._groupingValuesCache.hasOwnProperty(r))return t._groupingValuesCache[r];const n=e.getColumn(r);return n!=null&&n.columnDef.getGroupingValue?(t._groupingValuesCache[r]=n.columnDef.getGroupingValue(t.original),t._groupingValuesCache[r]):t.getValue(r)},t._groupingValuesCache={}},createCell:(t,e,r,n)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===r.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=r.subRows)!=null&&i.length)}}};function gNt(t,e,r){if(!(e!=null&&e.length)||!r)return t;const n=t.filter(s=>!e.includes(s.id));return r==="remove"?n:[...e.map(s=>t.find(a=>a.id===s)).filter(Boolean),...n]}const yNt={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ga("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Ot(r=>[Vx(e,r)],r=>r.findIndex(n=>n.id===t.id),Rt(e.options,"debugColumns")),t.getIsFirstColumn=r=>{var n;return((n=Vx(e,r)[0])==null?void 0:n.id)===t.id},t.getIsLastColumn=r=>{var n;const i=Vx(e,r);return((n=i[i.length-1])==null?void 0:n.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var r;t.setColumnOrder(e?[]:(r=t.initialState.columnOrder)!=null?r:[])},t._getOrderColumnsFn=Ot(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,r,n)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const a=[...e],o=[...i];for(;o.length&&a.length;){const c=a.shift(),u=o.findIndex(d=>d.id===c);u>-1&&s.push(o.splice(u,1)[0])}s=[...s,...o]}return gNt(s,r,n)},Rt(t.options,"debugTable"))}},TL=()=>({left:[],right:[]}),vNt={getInitialState:t=>({columnPinning:TL(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ga("columnPinning",t)}),createColumn:(t,e)=>{t.pin=r=>{const n=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,a;if(r==="right"){var o,c;return{left:((o=i?.left)!=null?o:[]).filter(f=>!(n!=null&&n.includes(f))),right:[...((c=i?.right)!=null?c:[]).filter(f=>!(n!=null&&n.includes(f))),...n]}}if(r==="left"){var u,d;return{left:[...((u=i?.left)!=null?u:[]).filter(f=>!(n!=null&&n.includes(f))),...n],right:((d=i?.right)!=null?d:[]).filter(f=>!(n!=null&&n.includes(f)))}}return{left:((s=i?.left)!=null?s:[]).filter(f=>!(n!=null&&n.includes(f))),right:((a=i?.right)!=null?a:[]).filter(f=>!(n!=null&&n.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(n=>{var i,s,a;return((i=n.columnDef.enablePinning)!=null?i:!0)&&((s=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const r=t.getLeafColumns().map(o=>o.id),{left:n,right:i}=e.getState().columnPinning,s=r.some(o=>n?.includes(o)),a=r.some(o=>i?.includes(o));return s?"left":a?"right":!1},t.getPinnedIndex=()=>{var r,n;const i=t.getIsPinned();return i?(r=(n=e.getState().columnPinning)==null||(n=n[i])==null?void 0:n.indexOf(t.id))!=null?r:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Ot(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(r,n,i)=>{const s=[...n??[],...i??[]];return r.filter(a=>!s.includes(a.column.id))},Rt(e.options,"debugRows")),t.getLeftVisibleCells=Ot(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(r,n)=>(n??[]).map(s=>r.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Rt(e.options,"debugRows")),t.getRightVisibleCells=Ot(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(r,n)=>(n??[]).map(s=>r.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Rt(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var r,n;return t.setColumnPinning(e?TL():(r=(n=t.initialState)==null?void 0:n.columnPinning)!=null?r:TL())},t.getIsSomeColumnsPinned=e=>{var r;const n=t.getState().columnPinning;if(!e){var i,s;return!!((i=n.left)!=null&&i.length||(s=n.right)!=null&&s.length)}return!!((r=n[e])!=null&&r.length)},t.getLeftLeafColumns=Ot(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,r)=>(r??[]).map(n=>e.find(i=>i.id===n)).filter(Boolean),Rt(t.options,"debugColumns")),t.getRightLeafColumns=Ot(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,r)=>(r??[]).map(n=>e.find(i=>i.id===n)).filter(Boolean),Rt(t.options,"debugColumns")),t.getCenterLeafColumns=Ot(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,r,n)=>{const i=[...r??[],...n??[]];return e.filter(s=>!i.includes(s.id))},Rt(t.options,"debugColumns"))}};function xNt(t){return t||(typeof document<"u"?document:null)}const KS={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},CL=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),bNt={getDefaultColumnDef:()=>KS,getInitialState:t=>({columnSizing:{},columnSizingInfo:CL(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ga("columnSizing",t),onColumnSizingInfoChange:Ga("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var r,n,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((r=t.columnDef.minSize)!=null?r:KS.minSize,(n=s??t.columnDef.size)!=null?n:KS.size),(i=t.columnDef.maxSize)!=null?i:KS.maxSize)},t.getStart=Ot(r=>[r,Vx(e,r),e.getState().columnSizing],(r,n)=>n.slice(0,t.getIndex(r)).reduce((i,s)=>i+s.getSize(),0),Rt(e.options,"debugColumns")),t.getAfter=Ot(r=>[r,Vx(e,r),e.getState().columnSizing],(r,n)=>n.slice(t.getIndex(r)+1).reduce((i,s)=>i+s.getSize(),0),Rt(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(r=>{let{[t.id]:n,...i}=r;return i})},t.getCanResize=()=>{var r,n;return((r=t.columnDef.enableResizing)!=null?r:!0)&&((n=e.options.enableColumnResizing)!=null?n:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let r=0;const n=i=>{if(i.subHeaders.length)i.subHeaders.forEach(n);else{var s;r+=(s=i.column.getSize())!=null?s:0}};return n(t),r},t.getStart=()=>{if(t.index>0){const r=t.headerGroup.headers[t.index-1];return r.getStart()+r.getSize()}return 0},t.getResizeHandler=r=>{const n=e.getColumn(t.column.id),i=n?.getCanResize();return s=>{if(!n||!i||(s.persist==null||s.persist(),EL(s)&&s.touches&&s.touches.length>1))return;const a=t.getSize(),o=t?t.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[n.id,n.getSize()]],c=EL(s)?Math.round(s.touches[0].clientX):s.clientX,u={},d=(_,S)=>{typeof S=="number"&&(e.setColumnSizingInfo(k=>{var E,T;const N=e.options.columnResizeDirection==="rtl"?-1:1,j=(S-((E=k?.startOffset)!=null?E:0))*N,M=Math.max(j/((T=k?.startSize)!=null?T:0),-.999999);return k.columnSizingStart.forEach(O=>{let[R,I]=O;u[R]=Math.round(Math.max(I+I*M,0)*100)/100}),{...k,deltaOffset:j,deltaPercentage:M}}),(e.options.columnResizeMode==="onChange"||_==="end")&&e.setColumnSizing(k=>({...k,...u})))},f=_=>d("move",_),h=_=>{d("end",_),e.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=xNt(r),y={moveHandler:_=>f(_.clientX),upHandler:_=>{m?.removeEventListener("mousemove",y.moveHandler),m?.removeEventListener("mouseup",y.upHandler),h(_.clientX)}},x={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),f(_.touches[0].clientX),!1),upHandler:_=>{var S;m?.removeEventListener("touchmove",x.moveHandler),m?.removeEventListener("touchend",x.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),h((S=_.touches[0])==null?void 0:S.clientX)}},v=wNt()?{passive:!1}:!1;EL(s)?(m?.addEventListener("touchmove",x.moveHandler,v),m?.addEventListener("touchend",x.upHandler,v)):(m?.addEventListener("mousemove",y.moveHandler,v),m?.addEventListener("mouseup",y.upHandler,v)),e.setColumnSizingInfo(_=>({..._,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:o,isResizingColumn:n.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var r;t.setColumnSizing(e?{}:(r=t.initialState.columnSizing)!=null?r:{})},t.resetHeaderSizeInfo=e=>{var r;t.setColumnSizingInfo(e?CL():(r=t.initialState.columnSizingInfo)!=null?r:CL())},t.getTotalSize=()=>{var e,r;return(e=(r=t.getHeaderGroups()[0])==null?void 0:r.headers.reduce((n,i)=>n+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,r;return(e=(r=t.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((n,i)=>n+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,r;return(e=(r=t.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((n,i)=>n+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,r;return(e=(r=t.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((n,i)=>n+i.getSize(),0))!=null?e:0}}};let QS=null;function wNt(){if(typeof QS=="boolean")return QS;let t=!1;try{const e={get passive(){return t=!0,!1}},r=()=>{};window.addEventListener("test",r,e),window.removeEventListener("test",r)}catch{t=!1}return QS=t,QS}function EL(t){return t.type==="touchstart"}const _Nt={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ga("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=r=>{t.getCanHide()&&e.setColumnVisibility(n=>({...n,[t.id]:r??!t.getIsVisible()}))},t.getIsVisible=()=>{var r,n;const i=t.columns;return(r=i.length?i.some(s=>s.getIsVisible()):(n=e.getState().columnVisibility)==null?void 0:n[t.id])!=null?r:!0},t.getCanHide=()=>{var r,n;return((r=t.columnDef.enableHiding)!=null?r:!0)&&((n=e.options.enableHiding)!=null?n:!0)},t.getToggleVisibilityHandler=()=>r=>{t.toggleVisibility==null||t.toggleVisibility(r.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Ot(()=>[t.getAllCells(),e.getState().columnVisibility],r=>r.filter(n=>n.column.getIsVisible()),Rt(e.options,"debugRows")),t.getVisibleCells=Ot(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(r,n,i)=>[...r,...n,...i],Rt(e.options,"debugRows"))},createTable:t=>{const e=(r,n)=>Ot(()=>[n(),n().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Rt(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=r=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(r),t.resetColumnVisibility=r=>{var n;t.setColumnVisibility(r?{}:(n=t.initialState.columnVisibility)!=null?n:{})},t.toggleAllColumnsVisible=r=>{var n;r=(n=r)!=null?n:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:r||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>r=>{var n;t.toggleAllColumnsVisible((n=r.target)==null?void 0:n.checked)}}};function Vx(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const SNt={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},kNt={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Ga("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var r;const n=(r=t.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[e.id])==null?void 0:r.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var r,n,i,s;return((r=t.columnDef.enableGlobalFilter)!=null?r:!0)&&((n=e.options.enableGlobalFilter)!=null?n:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Gc.includesString,t.getGlobalFilterFn=()=>{var e,r;const{globalFilterFn:n}=t.options;return cP(n)?n:n==="auto"?t.getGlobalAutoFilterFn():(e=(r=t.options.filterFns)==null?void 0:r[n])!=null?e:Gc[n]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},TNt={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ga("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,r=!1;t._autoResetExpanded=()=>{var n,i;if(!e){t._queue(()=>{e=!0});return}if((n=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?n:!t.options.manualExpanding){if(r)return;r=!0,t._queue(()=>{t.resetExpanded(),r=!1})}},t.setExpanded=n=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(n),t.toggleAllRowsExpanded=n=>{n??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=n=>{var i,s;t.setExpanded(n?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const n=t.getState().expanded;return n===!0||Object.values(n).some(Boolean)},t.getIsAllRowsExpanded=()=>{const n=t.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let n=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const a=s.split(".");n=Math.max(n,a.length)}),n},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=r=>{e.setExpanded(n=>{var i;const s=n===!0?!0:!!(n!=null&&n[t.id]);let a={};if(n===!0?Object.keys(e.getRowModel().rowsById).forEach(o=>{a[o]=!0}):a=n,r=(i=r)!=null?i:!s,!s&&r)return{...a,[t.id]:!0};if(s&&!r){const{[t.id]:o,...c}=a;return c}return n})},t.getIsExpanded=()=>{var r;const n=e.getState().expanded;return!!((r=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?r:n===!0||n?.[t.id])},t.getCanExpand=()=>{var r,n,i;return(r=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?r:((n=e.options.enableExpanding)!=null?n:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let r=!0,n=t;for(;r&&n.parentId;)n=e.getRow(n.parentId,!0),r=n.getIsExpanded();return r},t.getToggleExpandedHandler=()=>{const r=t.getCanExpand();return()=>{r&&t.toggleExpanded()}}}},Yz=0,Kz=10,jL=()=>({pageIndex:Yz,pageSize:Kz}),CNt={getInitialState:t=>({...t,pagination:{...jL(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ga("pagination",t)}),createTable:t=>{let e=!1,r=!1;t._autoResetPageIndex=()=>{var n,i;if(!e){t._queue(()=>{e=!0});return}if((n=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?n:!t.options.manualPagination){if(r)return;r=!0,t._queue(()=>{t.resetPageIndex(),r=!1})}},t.setPagination=n=>{const i=s=>Jd(n,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=n=>{var i;t.setPagination(n?jL():(i=t.initialState.pagination)!=null?i:jL())},t.setPageIndex=n=>{t.setPagination(i=>{let s=Jd(n,i.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...i,pageIndex:s}})},t.resetPageIndex=n=>{var i,s;t.setPageIndex(n?Yz:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Yz)},t.resetPageSize=n=>{var i,s;t.setPageSize(n?Kz:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Kz)},t.setPageSize=n=>{t.setPagination(i=>{const s=Math.max(1,Jd(n,i.pageSize)),a=i.pageSize*i.pageIndex,o=Math.floor(a/s);return{...i,pageIndex:o,pageSize:s}})},t.setPageCount=n=>t.setPagination(i=>{var s;let a=Jd(n,(s=t.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),t.getPageOptions=Ot(()=>[t.getPageCount()],n=>{let i=[];return n&&n>0&&(i=[...new Array(n)].fill(null).map((s,a)=>a)),i},Rt(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:n}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:n<i-1},t.previousPage=()=>t.setPageIndex(n=>n-1),t.nextPage=()=>t.setPageIndex(n=>n+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var n;return(n=t.options.pageCount)!=null?n:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var n;return(n=t.options.rowCount)!=null?n:t.getPrePaginationRowModel().rows.length}}},NL=()=>({top:[],bottom:[]}),ENt={getInitialState:t=>({rowPinning:NL(),...t}),getDefaultOptions:t=>({onRowPinningChange:Ga("rowPinning",t)}),createRow:(t,e)=>{t.pin=(r,n,i)=>{const s=n?t.getLeafRows().map(c=>{let{id:u}=c;return u}):[],a=i?t.getParentRows().map(c=>{let{id:u}=c;return u}):[],o=new Set([...a,t.id,...s]);e.setRowPinning(c=>{var u,d;if(r==="bottom"){var f,h;return{top:((f=c?.top)!=null?f:[]).filter(x=>!(o!=null&&o.has(x))),bottom:[...((h=c?.bottom)!=null?h:[]).filter(x=>!(o!=null&&o.has(x))),...Array.from(o)]}}if(r==="top"){var m,y;return{top:[...((m=c?.top)!=null?m:[]).filter(x=>!(o!=null&&o.has(x))),...Array.from(o)],bottom:((y=c?.bottom)!=null?y:[]).filter(x=>!(o!=null&&o.has(x)))}}return{top:((u=c?.top)!=null?u:[]).filter(x=>!(o!=null&&o.has(x))),bottom:((d=c?.bottom)!=null?d:[]).filter(x=>!(o!=null&&o.has(x)))}})},t.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:i}=e.options;return typeof n=="function"?n(t):(r=n??i)!=null?r:!0},t.getIsPinned=()=>{const r=[t.id],{top:n,bottom:i}=e.getState().rowPinning,s=r.some(o=>n?.includes(o)),a=r.some(o=>i?.includes(o));return s?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var r,n;const i=t.getIsPinned();if(!i)return-1;const s=(r=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:r.map(a=>{let{id:o}=a;return o});return(n=s?.indexOf(t.id))!=null?n:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var r,n;return t.setRowPinning(e?NL():(r=(n=t.initialState)==null?void 0:n.rowPinning)!=null?r:NL())},t.getIsSomeRowsPinned=e=>{var r;const n=t.getState().rowPinning;if(!e){var i,s;return!!((i=n.top)!=null&&i.length||(s=n.bottom)!=null&&s.length)}return!!((r=n[e])!=null&&r.length)},t._getPinnedRows=(e,r,n)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(r??[]).map(a=>{const o=t.getRow(a,!0);return o.getIsAllParentsExpanded()?o:null}):(r??[]).map(a=>e.find(o=>o.id===a))).filter(Boolean).map(a=>({...a,position:n}))},t.getTopRows=Ot(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,r)=>t._getPinnedRows(e,r,"top"),Rt(t.options,"debugRows")),t.getBottomRows=Ot(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,r)=>t._getPinnedRows(e,r,"bottom"),Rt(t.options,"debugRows")),t.getCenterRows=Ot(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,r,n)=>{const i=new Set([...r??[],...n??[]]);return e.filter(s=>!i.has(s.id))},Rt(t.options,"debugRows"))}},jNt={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ga("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var r;return t.setRowSelection(e?{}:(r=t.initialState.rowSelection)!=null?r:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(r=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const n={...r},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(n[s.id]=!0)}):i.forEach(s=>{delete n[s.id]}),n})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(r=>{const n=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...r};return t.getRowModel().rows.forEach(s=>{Qz(i,s.id,n,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Ot(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,r)=>Object.keys(e).length?PL(t,r):{rows:[],flatRows:[],rowsById:{}},Rt(t.options,"debugTable")),t.getFilteredSelectedRowModel=Ot(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,r)=>Object.keys(e).length?PL(t,r):{rows:[],flatRows:[],rowsById:{}},Rt(t.options,"debugTable")),t.getGroupedSelectedRowModel=Ot(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,r)=>Object.keys(e).length?PL(t,r):{rows:[],flatRows:[],rowsById:{}},Rt(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:r}=t.getState();let n=!!(e.length&&Object.keys(r).length);return n&&e.some(i=>i.getCanSelect()&&!r[i.id])&&(n=!1),n},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:r}=t.getState();let n=!!e.length;return n&&e.some(i=>!r[i.id])&&(n=!1),n},t.getIsSomeRowsSelected=()=>{var e;const r=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return r>0&&r<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(r,n)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var a;if(r=typeof r<"u"?r:!i,t.getCanSelect()&&i===r)return s;const o={...s};return Qz(o,t.id,r,(a=n?.selectChildren)!=null?a:!0,e),o})},t.getIsSelected=()=>{const{rowSelection:r}=e.getState();return T6(t,r)},t.getIsSomeSelected=()=>{const{rowSelection:r}=e.getState();return Zz(t,r)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=e.getState();return Zz(t,r)==="all"},t.getCanSelect=()=>{var r;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(r=e.options.enableRowSelection)!=null?r:!0},t.getCanSelectSubRows=()=>{var r;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(r=e.options.enableSubRowSelection)!=null?r:!0},t.getCanMultiSelect=()=>{var r;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(r=e.options.enableMultiRowSelection)!=null?r:!0},t.getToggleSelectedHandler=()=>{const r=t.getCanSelect();return n=>{var i;r&&t.toggleSelected((i=n.target)==null?void 0:i.checked)}}}},Qz=(t,e,r,n,i)=>{var s;const a=i.getRow(e,!0);r?(a.getCanMultiSelect()||Object.keys(t).forEach(o=>delete t[o]),a.getCanSelect()&&(t[e]=!0)):delete t[e],n&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(o=>Qz(t,o.id,r,n,i))};function PL(t,e){const r=t.getState().rowSelection,n=[],i={},s=function(a,o){return a.map(c=>{var u;const d=T6(c,r);if(d&&(n.push(c),i[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:s(c.subRows)}),d)return c}).filter(Boolean)};return{rows:s(e.rows),flatRows:n,rowsById:i}}function T6(t,e){var r;return(r=e[t.id])!=null?r:!1}function Zz(t,e,r){var n;if(!((n=t.subRows)!=null&&n.length))return!1;let i=!0,s=!1;return t.subRows.forEach(a=>{if(!(s&&!i)&&(a.getCanSelect()&&(T6(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const o=Zz(a,e);o==="all"?s=!0:(o==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const Xz=/([0-9]+)/gm,NNt=(t,e,r)=>Ybe(Pf(t.getValue(r)).toLowerCase(),Pf(e.getValue(r)).toLowerCase()),PNt=(t,e,r)=>Ybe(Pf(t.getValue(r)),Pf(e.getValue(r))),MNt=(t,e,r)=>C6(Pf(t.getValue(r)).toLowerCase(),Pf(e.getValue(r)).toLowerCase()),ANt=(t,e,r)=>C6(Pf(t.getValue(r)),Pf(e.getValue(r))),DNt=(t,e,r)=>{const n=t.getValue(r),i=e.getValue(r);return n>i?1:n<i?-1:0},ONt=(t,e,r)=>C6(t.getValue(r),e.getValue(r));function C6(t,e){return t===e?0:t>e?1:-1}function Pf(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function Ybe(t,e){const r=t.split(Xz).filter(Boolean),n=e.split(Xz).filter(Boolean);for(;r.length&&n.length;){const i=r.shift(),s=n.shift(),a=parseInt(i,10),o=parseInt(s,10),c=[a,o].sort();if(isNaN(c[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(c[1]))return isNaN(a)?-1:1;if(a>o)return 1;if(o>a)return-1}return r.length-n.length}const Bv={alphanumeric:NNt,alphanumericCaseSensitive:PNt,text:MNt,textCaseSensitive:ANt,datetime:DNt,basic:ONt},RNt={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ga("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const r=e.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const i of r){const s=i?.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return Bv.datetime;if(typeof s=="string"&&(n=!0,s.split(Xz).length>1))return Bv.alphanumeric}return n?Bv.text:Bv.basic},t.getAutoSortDir=()=>{const r=e.getFilteredRowModel().flatRows[0];return typeof r?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var r,n;if(!t)throw new Error;return cP(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(r=(n=e.options.sortingFns)==null?void 0:n[t.columnDef.sortingFn])!=null?r:Bv[t.columnDef.sortingFn]},t.toggleSorting=(r,n)=>{const i=t.getNextSortingOrder(),s=typeof r<"u"&&r!==null;e.setSorting(a=>{const o=a?.find(m=>m.id===t.id),c=a?.findIndex(m=>m.id===t.id);let u=[],d,f=s?r:i==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&n?o?d="toggle":d="add":a!=null&&a.length&&c!==a.length-1?d="replace":o?d="toggle":d="replace",d==="toggle"&&(s||i||(d="remove")),d==="add"){var h;u=[...a,{id:t.id,desc:f}],u.splice(0,u.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=a.map(m=>m.id===t.id?{...m,desc:f}:m):d==="remove"?u=a.filter(m=>m.id!==t.id):u=[{id:t.id,desc:f}];return u})},t.getFirstSortDir=()=>{var r,n;return((r=(n=t.columnDef.sortDescFirst)!=null?n:e.options.sortDescFirst)!=null?r:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=r=>{var n,i;const s=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==s&&((n=e.options.enableSortingRemoval)==null||n)&&(!(r&&(i=e.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":s},t.getCanSort=()=>{var r,n;return((r=t.columnDef.enableSorting)!=null?r:!0)&&((n=e.options.enableSorting)!=null?n:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var r,n;return(r=(n=t.columnDef.enableMultiSort)!=null?n:e.options.enableMultiSort)!=null?r:!!t.accessorFn},t.getIsSorted=()=>{var r;const n=(r=e.getState().sorting)==null?void 0:r.find(i=>i.id===t.id);return n?n.desc?"desc":"asc":!1},t.getSortIndex=()=>{var r,n;return(r=(n=e.getState().sorting)==null?void 0:n.findIndex(i=>i.id===t.id))!=null?r:-1},t.clearSorting=()=>{e.setSorting(r=>r!=null&&r.length?r.filter(n=>n.id!==t.id):[])},t.getToggleSortingHandler=()=>{const r=t.getCanSort();return n=>{r&&(n.persist==null||n.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(n):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var r,n;t.setSorting(e?[]:(r=(n=t.initialState)==null?void 0:n.sorting)!=null?r:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},INt=[rNt,_Nt,yNt,vNt,iNt,sNt,SNt,kNt,RNt,mNt,TNt,CNt,ENt,jNt,bNt];function LNt(t){var e,r;const n=[...INt,...(e=t._features)!=null?e:[]];let i={_features:n};const s=i._features.reduce((h,m)=>Object.assign(h,m.getDefaultOptions==null?void 0:m.getDefaultOptions(i)),{}),a=h=>i.options.mergeOptions?i.options.mergeOptions(s,h):{...s,...h};let c={...{},...(r=t.initialState)!=null?r:{}};i._features.forEach(h=>{var m;c=(m=h.getInitialState==null?void 0:h.getInitialState(c))!=null?m:c});const u=[];let d=!1;const f={_features:n,options:{...s,...t},initialState:c,_queue:h=>{u.push(h),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const m=Jd(h,i.options);i.options=a(m)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,m,y)=>{var x;return(x=i.options.getRowId==null?void 0:i.options.getRowId(h,m,y))!=null?x:`${y?[y.id,m].join("."):m}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,m)=>{let y=(m?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!y&&(y=i.getCoreRowModel().rowsById[h],!y))throw new Error;return y},_getDefaultColumnDef:Ot(()=>[i.options.defaultColumn],h=>{var m;return h=(m=h)!=null?m:{},{header:y=>{const x=y.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:y=>{var x,v;return(x=(v=y.renderValue())==null||v.toString==null?void 0:v.toString())!=null?x:null},...i._features.reduce((y,x)=>Object.assign(y,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...h}},Rt(t,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Ot(()=>[i._getColumnDefs()],h=>{const m=function(y,x,v){return v===void 0&&(v=0),y.map(_=>{const S=tNt(i,_,v,x),k=_;return S.columns=k.columns?m(k.columns,S,v+1):[],S})};return m(h)},Rt(t,"debugColumns")),getAllFlatColumns:Ot(()=>[i.getAllColumns()],h=>h.flatMap(m=>m.getFlatColumns()),Rt(t,"debugColumns")),_getAllFlatColumnsById:Ot(()=>[i.getAllFlatColumns()],h=>h.reduce((m,y)=>(m[y.id]=y,m),{}),Rt(t,"debugColumns")),getAllLeafColumns:Ot(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,m)=>{let y=h.flatMap(x=>x.getLeafColumns());return m(y)},Rt(t,"debugColumns")),getColumn:h=>i._getAllFlatColumnsById()[h]};Object.assign(i,f);for(let h=0;h<i._features.length;h++){const m=i._features[h];m==null||m.createTable==null||m.createTable(i)}return i}function $Nt(){return t=>Ot(()=>[t.options.data],e=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(i,s,a){s===void 0&&(s=0);const o=[];for(let u=0;u<i.length;u++){const d=nNt(t,t._getRowId(i[u],u,a),i[u],u,s,void 0,a?.id);if(r.flatRows.push(d),r.rowsById[d.id]=d,o.push(d),t.options.getSubRows){var c;d.originalSubRows=t.options.getSubRows(i[u],u),(c=d.originalSubRows)!=null&&c.length&&(d.subRows=n(d.originalSubRows,s+1,d))}}return o};return r.rows=n(e),r},Rt(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function FNt(t){const e=[],r=n=>{var i;e.push(n),(i=n.subRows)!=null&&i.length&&n.getIsExpanded()&&n.subRows.forEach(r)};return t.rows.forEach(r),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function zNt(t){return e=>Ot(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(r,n)=>{if(!n.rows.length)return n;const{pageSize:i,pageIndex:s}=r;let{rows:a,flatRows:o,rowsById:c}=n;const u=i*s,d=u+i;a=a.slice(u,d);let f;e.options.paginateExpandedRows?f={rows:a,flatRows:o,rowsById:c}:f=FNt({rows:a,flatRows:o,rowsById:c}),f.flatRows=[];const h=m=>{f.flatRows.push(m),m.subRows.length&&m.subRows.forEach(h)};return f.rows.forEach(h),f},Rt(e.options,"debugTable"))}function BNt(){return t=>Ot(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,r)=>{if(!r.rows.length||!(e!=null&&e.length))return r;const n=t.getState().sorting,i=[],s=n.filter(c=>{var u;return(u=t.getColumn(c.id))==null?void 0:u.getCanSort()}),a={};
4647s.forEach(c=>{const u=t.getColumn(c.id);u&&(a[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const o=c=>{const u=c.map(d=>({...d}));return u.sort((d,f)=>{for(let m=0;m<s.length;m+=1){var h;const y=s[m],x=a[y.id],v=x.sortUndefined,_=(h=y?.desc)!=null?h:!1;let S=0;if(v){const k=d.getValue(y.id),E=f.getValue(y.id),T=k===void 0,N=E===void 0;if(T||N){if(v==="first")return T?-1:1;if(v==="last")return T?1:-1;S=T&&N?0:T?v:-v}}if(S===0&&(S=x.sortingFn(d,f,y.id)),S!==0)return _&&(S*=-1),x.invertSorting&&(S*=-1),S}return d.index-f.index}),u.forEach(d=>{var f;i.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=o(d.subRows))}),u};return{rows:o(r.rows),flatRows:i,rowsById:r.rowsById}},Rt(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/**
4648   * react-table
4649   *
4650   * Copyright (c) TanStack
4651   *
4652   * This source code is licensed under the MIT license found in the
4653   * LICENSE.md file in the root directory of this source tree.
4654   *
4655   * @license MIT
4656   */function Lie(t,e){return t?VNt(t)?b.createElement(t,e):t:null}function VNt(t){return UNt(t)||typeof t=="function"||GNt(t)}function UNt(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function GNt(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function WNt(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[r]=b.useState(()=>({current:LNt(e)})),[n,i]=b.useState(()=>r.current.initialState);return r.current.setOptions(s=>({...s,...t,state:{...n,...t.state},onStateChange:a=>{i(a),t.onStateChange==null||t.onStateChange(a)}})),r.current}function HNt({table:t,defaultPageSizeOptions:e}){const r=e??[15,25,50,100,200];return l.jsx("div",{className:"flex items-center justify-between px-2",children:l.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("p",{className:"text-sm text-app-primary-foreground/70",children:"Rows per page"}),l.jsxs(vu,{value:`${t.getState().pagination.pageSize}`,onValueChange:n=>{t.setPageSize(Number(n))},children:[l.jsx(bu,{className:"!h-9 w-[90px]",children:l.jsx(xu,{placeholder:t.getState().pagination.pageSize})}),l.jsx(wu,{side:"top",children:r.map(n=>l.jsx(lc,{value:`${n}`,children:n},n))})]})]}),l.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm text-app-primary-foreground/70 gap-1.5",children:["Page",l.jsx("span",{className:"font-medium text-app-primary-foreground",children:t.getState().pagination.pageIndex+1}),"of",l.jsx("span",{className:"font-medium text-app-primary-foreground",children:t.getPageCount()})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsxs(ye,{variant:"secondary",className:"hidden size-9 p-0 lg:flex",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:[l.jsx("span",{className:"sr-only",children:"Go to first page"}),l.jsx(IPe,{})]}),l.jsxs(ye,{variant:"secondary",className:"size-9 p-0",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:[l.jsx("span",{className:"sr-only",children:"Go to previous page"}),l.jsx(up,{})]}),l.jsxs(ye,{variant:"secondary",className:"size-9 p-0",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:[l.jsx("span",{className:"sr-only",children:"Go to next page"}),l.jsx(Sf,{})]}),l.jsxs(ye,{variant:"secondary",className:"hidden size-9 p-0 lg:flex",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:[l.jsx("span",{className:"sr-only",children:"Go to last page"}),l.jsx(LPe,{})]})]})]})})}const Kbe=b.forwardRef(({className:t,...e},r)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:r,className:ee("w-full caption-bottom text-sm",t),...e})}));Kbe.displayName="Table";const Qbe=b.forwardRef(({className:t,...e},r)=>l.jsx("thead",{ref:r,className:ee("[&_tr]:border-b border-app-border-color-soft",t),...e}));Qbe.displayName="TableHeader";const Zbe=b.forwardRef(({className:t,...e},r)=>l.jsx("tbody",{ref:r,className:ee("[&_tr:last-child]:border-0",t),...e}));Zbe.displayName="TableBody";const qNt=b.forwardRef(({className:t,...e},r)=>l.jsx("tfoot",{ref:r,className:ee("border-t bg-gray-400 font-medium [&>tr]:last:border-b-0",t),...e}));qNt.displayName="TableFooter";const E6=b.forwardRef(({className:t,...e},r)=>l.jsx("tr",{ref:r,className:ee("border-b border-app-border-color-soft transition-colors hover:bg-app-input-bg data-[state=selected]:bg-app-input-bg duration-75",t),...e}));E6.displayName="TableRow";const Xbe=b.forwardRef(({className:t,...e},r)=>l.jsx("th",{ref:r,className:ee("h-11 px-2 text-left text-xs uppercase tracking-wider align-middle text-app-primary-foreground
4656/70 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-light",t),...e}));Xbe.displayName="TableHead";const Fk=b.forwardRef(({className:t,...e},r)=>l.jsx("td",{ref:r,className:ee("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-light h-12.5",t),...e}));Fk.displayName="TableCell";const YNt=b.forwardRef(({className:t,...e},r)=>l.jsx("caption",{ref:r,className:ee("mt-4 text-sm text-muted-foreground",t),...e}));YNt.displayName="TableCaption";const ML=ct.create(Zbe),KNt=ct.create(E6),QNt=Array.from({length:15},(t,e)=>`data-table-skeleton-row-${e}`);function ZNt({table:t,emptyState:e,actionToolbar:r,isLoading:n=!1,isFetching:i=!1}){const s=n||i&&t.getRowModel().rows.length===0,a=t.getRowModel().rows,o=t.getVisibleLeafColumns(),c=s?"loading":a.length>0?"rows":"empty";return l.jsxs("div",{className:"space-y-5","aria-busy":n||i,children:[l.jsxs("div",{className:"relative overflow-hidden rounded-xl bg-app-card border border-app-border-color-soft",children:[l.jsxs(Kbe,{children:[l.jsx(Qbe,{children:t.getHeaderGroups().map(u=>l.jsx(E6,{children:u.headers.map(d=>l.jsx(Xbe,{colSpan:d.colSpan,children:d.isPlaceholder?null:Lie(d.column.columnDef.header,d.getContext())},d.id))},u.id))}),l.jsxs(Ss,{mode:"wait",children:[c==="loading"&&l.jsx(ML,{layout:"position",className:"[&_tr:last-child]:border-0",initial:{opacity:0}
4656,animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},children:QNt.map(u=>l.jsx(ct.tr,{layout:!0,className:"border-b border-app-border-color-soft",children:o.map(d=>l.jsx(Fk,{children:l.jsx(Le,{className:"h-4 w-full"})},`${u}-${d.id}`))},u))},"loading"),c==="rows"&&l.jsx(ML,{layout:"preserve-aspect",className:"[&_tr:last-child]:border-0",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},children:a.map(u=>l.jsx(KNt,{layout:!0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.normal,ease:Hr.cubic},"data-state":u.getIsSelected()&&"selected",className:ee(typeof t.options.meta?.onRowClick=="function"&&"cursor-pointer"),onClick:d=>{const f=t.options.meta?.onRowClick;typeof f=="function"&&d.target instanceof HTMLElement&&(d.target.closest("[data-prevent-row-click]")||f(u.original))},children:u.getVisibleCells().map(d=>l.jsx(Fk,{children:Lie(d.column.columnDef.cell,d.getContext())},d.id))},u.id))},"rows"),c==="empty"&&!i&&l.jsx(ML,{layout:"position",className:"[&_tr:last-child]:border-0",initial:{opacity:0}
vendor: 19,726 bytes, line 4656
4656,animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},children:l.jsx(ct.tr,{layout:!0,initial:{opacity:0,y:4,filter:"blur(10px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-4,filter:"blur(10px)"},transition:{duration:rn.smooth,ease:Hr.cubic},children:l.jsx(Fk,{colSpan:t.getAllColumns().length,className:"!h-[750px] text-center",children:e??"No results."})})},"empty")]})]}),l.jsx(Ss,{children:i&&!n&&l.jsx(ct.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:rn.smooth,ease:Hr.cubic},className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-black/20 backdrop-blur-[1px]",children:l.jsx(gn,{})})})]}),l.jsx(HNt,{table:t}),r&&!n&&t.getRowModel().rows.length>0&&r]})}function XNt({className:t,...e}){return l.jsx("div",{"data-slot":"empty",className:ee("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",t),...e})}function JNt({className:t,...e}){return l.jsx("div",{"data-slot":"empty-header",className:ee("flex max-w-sm flex-col items-center gap-2 text-center",t),...e})}const ePt=Rf("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-app-input-bg text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function tPt({className:t,variant:e="default",...r}){return l.jsx("div",{"data-slot":"empty-icon","data-variant":e,className:ee(ePt({variant:e,className:t})),...r})}function rPt({className:t,...e}){return l.jsx("div",{"data-slot":"empty-title",className:ee("text-lg font-medium tracking-tight",t),...e})}function nPt({className:t,...e}){return l.jsx("div",{"data-slot":"empty-description",className:ee("text-app-primary-foreground/70 [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",t),...e})}function iPt({className:t,...e}){return l.jsx("div",{"data-slot":"empty-content",className:ee("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",t),...e})}const sPt=()=>l.jsxs(XNt,{children:[l.jsxs(JNt,{children:[l.jsx(tPt,{variant:"icon",className:"bg-app-button-bg",children:l.jsx(fk,{})}),l.jsx(rPt,{children:"No trades match your current filters"}),l.jsx(nPt,{children:"You can adjust your filters to find more results, or import new trades to get started."})]}),l.jsx(iPt,{children:l.jsx(ye,{asChild:!0,children:l.jsxs(At,{to:"/app/trade-entry",children:[l.jsx(rT,{}),"Import new trades"]})})})]});var Jz=["Enter"," "],aPt=["ArrowDown","PageUp","Home"],Jbe=["ArrowUp","PageDown","End"],oPt=[...aPt,...Jbe],lPt={ltr:[...Jz,"ArrowRight"],rtl:[...Jz,"ArrowLeft"]},cPt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},w1="Menu",[dw,uPt,dPt]=LV(w1),[rm,ewe]=ma(w1,[dPt,$f,o0]),uP=$f(),twe=o0(),[fPt,nm]=rm(w1),[hPt,_1]=rm(w1),rwe=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:i,onOpenChange:s,modal:a=!0}=t,o=uP(e),[c,u]=b.useState(null),d=b.useRef(!1),f=Ki(s),h=a0(i);return b.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),l.jsx(Tj,{...o,children:l.jsx(fPt,{scope:e,open:r,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(hPt,{scope:e,onClose:b.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:n})})})};rwe.displayName=w1;var pPt="MenuAnchor",j6=b.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=uP(r);return l.jsx(Qw,{...i,...n,ref:e})});j6.displayName=pPt;var N6="MenuPortal",[mPt,nwe]=rm(N6,{forceMount:void 0}),iwe=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:i}=t,s=nm(N6,e);return l.jsx(mPt,{scope:e,forceMount:r,children:l.jsx($i,{present:r||s.open,children:l.jsx(e0,{asChild:!0,container:i,children:n})})})};iwe.displayName=N6;var Eo="MenuContent",[gPt,P6]=rm(Eo),swe=b.forwardRef((t,e)=>{const r=nwe(Eo,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=nm(Eo,t.__scopeMenu),a=_1(Eo,t.__scopeMenu);return l.jsx(dw.Provider,{scope:t.__scopeMenu,children:l.jsx($i,{present:n||s.open,children:l.jsx(dw.Slot,{scope:t.__scopeMenu,children:a.modal?l.jsx(yPt,{...i,ref:e}):l.jsx(vPt,{...i,ref:e})})})})}),yPt=b.forwardRef((t,e)=>{const r=nm(Eo,t.__scopeMenu),n=b.useRef(null),i=Kt(e,n);return b.useEffect(()=>{const s=n.current;if(s)return pj(s)},[]),l.jsx(M6,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:He(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vPt=b.forwardRef((t,e)=>{const r=nm(Eo,t.__scopeMenu);return l.jsx(M6,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),xPt=kf("MenuContent.ScrollLock"),M6=b.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...x}=t,v=nm(Eo,r),_=_1(Eo,r),S=uP(r),k=twe(r),E=uPt(r),[T,N]=b.useState(null),j=b.useRef(null),M=Kt(e,j,v.onContentChange),O=b.useRef(0),R=b.useRef(""),I=b.useRef(0),B=b.useRef(null),F=b.useRef("right"),V=b.useRef(0),$=y?Yw:b.Fragment,U=y?{as:xPt,allowPinchZoom:!0}:void 0,z=W=>{const K=R.current+W,q=E().filter(oe=>!oe.disabled),H=document.activeElement,Y=q.find(oe=>oe.ref.current===H)?.textValue,J=q.map(oe=>oe.textValue),re=MPt(J,K,Y),me=q.find(oe=>oe.textValue===re)?.ref.current;(function oe(ge){R.current=ge,window.clearTimeout(O.current),ge!==""&&(O.current=window.setTimeout(()=>oe(""),1e3))})(K),me&&setTimeout(()=>me.focus())};b.useEffect(()=>()=>window.clearTimeout(O.current),[]),fj();const L=b.useCallback(W=>F.current===B.current?.side&&DPt(W,B.current?.area),[]);return l.jsx(gPt,{scope:r,searchRef:R,onItemEnter:b.useCallback(W=>{L(W)&&W.preventDefault()},[L]),onItemLeave:b.useCallback(W=>{L(W)||(j.current?.focus(),N(null))},[L]),onTriggerLeave:b.useCallback(W=>{L(W)&&W.preventDefault()},[L]),pointerGraceTimerRef:I,onPointerGraceIntentChange:b.useCallback(W=>{B.current=W},[]),children:l.jsx($,{...U,children:l.jsx(qw,{asChild:!0,trapped:i,onMountAutoFocus:He(s,W=>{W.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(Jy,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:l.jsx($V,{asChild:!0,...k,dir:_.dir,orientation:"vertical",loop:n,currentTabStopId:T,onCurrentTabStopIdChange:N,onEntryFocus:He(c,W=>{_.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Cj,{role:"menu","aria-orientation":"vertical","data-state":wwe(v.open),"data-radix-menu-content":"",dir:_.dir,...S,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:He(x.onKeyDown,W=>{const q=W.target.closest("[data-radix-menu-content]")===W.currentTarget,H=W.ctrlKey||W.altKey||W.metaKey,Y=W.key.length===1;q&&(W.key==="Tab"&&W.preventDefault(),!H&&Y&&z(W.key));const J=j.current;if(W.target!==J||!oPt.includes(W.key))return;W.preventDefault();const me=E().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);Jbe.includes(W.key)&&me.reverse(),NPt(me)}),onBlur:He(t.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(O.current),R.current="")}),onPointerMove:He(t.onPointerMove,fw(W=>{const K=W.target,q=V.current!==W.clientX;if(W.currentTarget.contains(K)&&q){const H=W.clientX>V.current?"right":"left";F.current=H,V.current=W.clientX}}))})})})})})})});swe.displayName=Eo;var bPt="MenuGroup",A6=b.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(vt.div,{role:"group",...n,ref:e})});A6.displayName=bPt;var wPt="MenuLabel",awe=b.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(vt.div,{...n,ref:e})});awe.displayName=wPt;var vE="MenuItem",$ie="menu.itemSelect",dP=b.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=b.useRef(null),a=_1(vE,t.__scopeMenu),o=P6(vE,t.__scopeMenu),c=Kt(e,s),u=b.useRef(!1),d=()=>{const f=s.current;if(!r&&f){const h=new CustomEvent($ie,{bubbles:!0,cancelable:!0});f.addEventListener($ie,m=>n?.(m),{once:!0}),xfe(f,h),h.defaultPrevented?u.current=!1:a.onClose()}};return l.jsx(owe,{...i,ref:c,disabled:r,onClick:He(t.onClick,d),onPointerDown:f=>{t.onPointerDown?.(f),u.current=!0},onPointerUp:He(t.onPointerUp,f=>{u.current||f.currentTarget?.click()}),onKeyDown:He(t.onKeyDown,f=>{const h=o.searchRef.current!=="";r||h&&f.key===" "||Jz.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});dP.displayName=vE;var owe=b.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,a=P6(vE,r),o=twe(r),c=b.useRef(null),u=Kt(e,c),[d,f]=b.useState(!1),[h,m]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[s.children]),l.jsx(dw.ItemSlot,{scope:r,disabled:n,textValue:i??h,children:l.jsx(FV,{asChild:!0,...o,focusable:!n,children:l.jsx(vt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:u,onPointerMove:He(t.onPointerMove,fw(y=>{n?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:He(t.onPointerLeave,fw(y=>a.onItemLeave(y))),onFocus:He(t.onFocus,()=>f(!0)),onBlur:He(t.onBlur,()=>f(!1))})})})}),_Pt="MenuCheckboxItem",lwe=b.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return l.jsx(hwe,{scope:t.__scopeMenu,checked:r,children:l.jsx(dP,{role:"menuitemcheckbox","aria-checked":xE(r)?"mixed":r,...i,ref:e,"data-state":O6(r),onSelect:He(i.onSelect,()=>n?.(xE(r)?!0:!r),{checkForDefaultPrevented:!1})})})});lwe.displayName=_Pt;var cwe="MenuRadioGroup",[SPt,kPt]=rm(cwe,{value:void 0,onValueChange:()=>{}}),uwe=b.forwardRef((t,e)=>{const{value:r,onValueChange:n,...i}=t,s=Ki(n);return l.jsx(SPt,{scope:t.__scopeMenu,value:r,onValueChange:s,children:l.jsx(A6,{...i,ref:e})})});uwe.displayName=cwe;var dwe="MenuRadioItem",fwe=b.forwardRef((t,e)=>{const{value:r,...n}=t,i=kPt(dwe,t.__scopeMenu),s=r===i.value;return l.jsx(hwe,{scope:t.__scopeMenu,checked:s,children:l.jsx(dP,{role:"menuitemradio","aria-checked":s,...n,ref:e,"data-state":O6(s),onSelect:He(n.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});fwe.displayName=dwe;var D6="MenuItemIndicator",[hwe,TPt]=rm(D6,{checked:!1}),pwe=b.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=TPt(D6,r);return l.jsx($i,{present:n||xE(s.checked)||s.checked===!0,children:l.jsx(vt.span,{...i,ref:e,"data-state":O6(s.checked)})})});pwe.displayName=D6;var CPt="MenuSeparator",mwe=b.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return l.jsx(vt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});mwe.displayName=CPt;var EPt="MenuArrow",gwe=b.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,i=uP(r);return l.jsx(Ej,{...i,...n,ref:e})});gwe.displayName=EPt;var jPt="MenuSub",[hDt,ywe]=rm(jPt),dx="MenuSubTrigger",vwe=b.forwardRef((t,e)=>{const r=nm(dx,t.__scopeMenu),n=_1(dx,t.__scopeMenu),i=ywe(dx,t.__scopeMenu),s=P6(dx,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=s,u={__scopeMenu:t.__scopeMenu},d=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>d,[d]),b.useEffect(()=>{const f=o.current;return()=>{window.clearTimeout(f),c(null)}},[o,c]),l.jsx(j6,{asChild:!0,...u,children:l.jsx(owe,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":wwe(r.open),...t,ref:Nu(e,i.onTriggerChange),onClick:f=>{t.onClick?.(f),!(t.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:He(t.onPointerMove,fw(f=>{s.onItemEnter(f),!f.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:He(t.onPointerLeave,fw(f=>{d();const h=r.content?.getBoundingClientRect();if(h){const m=r.content?.dataset.side,y=m==="right",x=y?-5:5,v=h[y?"left":"right"],_=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:v,y:h.top},{x:_,y:h.top},{x:_,y:h.bottom},{x:v,y:h.bottom}],side:m}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:He(t.onKeyDown,f=>{const h=s.searchRef.current!=="";t.disabled||h&&f.key===" "||lPt[n.dir].includes(f.key)&&(r.onOpenChange(!0),r.content?.focus(),f.preventDefault())})})})});vwe.displayName=dx;var xwe="MenuSubContent",bwe=b.forwardRef((t,e)=>{const r=nwe(Eo,t.__scopeMenu),{forceMount:n=r.forceMount,...i}=t,s=nm(Eo,t.__scopeMenu),a=_1(Eo,t.__scopeMenu),o=ywe(xwe,t.__scopeMenu),c=b.useRef(null),u=Kt(e,c);return l.jsx(dw.Provider,{scope:t.__scopeMenu,children:l.jsx($i,{present:n||s.open,children:l.jsx(dw.Slot,{scope:t.__scopeMenu,children:l.jsx(M6,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&c.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:He(t.onFocusOutside,d=>{d.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:He(t.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:He(t.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),h=cPt[a.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),o.trigger?.focus(),d.preventDefault())})})})})})});bwe.displayName=xwe;function wwe(t){return t?"open":"closed"}function xE(t){return t==="indeterminate"}function O6(t){return xE(t)?"indeterminate":t?"checked":"unchecked"}function NPt(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function PPt(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function MPt(t,e,r){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let a=PPt(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function APt(t,e){const{x:r,y:n}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],c=e[a],u=o.x,d=o.y,f=c.x,h=c.y;d>n!=h>n&&r<(f-u)*(n-d)/(h-d)+u&&(i=!i)}return i}function DPt(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return APt(r,e)}function fw(t){return e=>e.pointerType==="mouse"?t(e):void 0}var OPt=rwe,RPt=j6,IPt=iwe,LPt=swe,$Pt=A6,FPt=awe,zPt=dP,BPt=lwe,VPt=uwe,UPt=fwe,GPt=pwe,WPt=mwe,HPt=gwe,qPt=vwe,YPt=bwe,fP="DropdownMenu",[KPt]=ma(fP,[ewe]),qs=ewe(),[QPt,_we]=KPt(fP),Swe=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=t,c=qs(e),u=b.useRef(null),[d,f]=Ao({prop:i,defaultProp:s??!1,onChange:a,caller:fP});return l.jsx(QPt,{scope:e,triggerId:ts(),triggerRef:u,contentId:ts(),open:d,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(h=>!h),[f]),modal:o,children:l.jsx(OPt,{...c,open:d,onOpenChange:f,dir:n,modal:o,children:r})})};Swe.displayName=fP;var kwe="DropdownMenuTrigger",Twe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=t,s=_we(kwe,r),a=qs(r);return l.jsx(RPt,{asChild:!0,...a,children:l.jsx(vt.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":n?"":void 0,disabled:n,...i,ref:Nu(e,s.triggerRef),onPointerDown:He(t.onPointerDown,o=>{!n&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:He(t.onKeyDown,o=>{n||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});Twe.displayName=kwe;var ZPt="DropdownMenuPortal",Cwe=t=>{const{__scopeDropdownMenu:e,...r}=t,n=qs(e);return l.jsx(IPt,{...n,...r})};Cwe.displayName=ZPt;var Ewe="DropdownMenuContent",jwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=_we(Ewe,r),s=qs(r),a=b.useRef(!1);return l.jsx(LPt,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:e,onCloseAutoFocus:He(t.onCloseAutoFocus,o=>{a.current||i.triggerRef.current?.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:He(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(a.current=!0)}),style:{...t.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)"}})});jwe.displayName=Ewe;var XPt="DropdownMenuGroup",JPt=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx($Pt,{...i,...n,ref:e})});JPt.displayName=XPt;var eMt="DropdownMenuLabel",Nwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(FPt,{...i,...n,ref:e})});Nwe.displayName=eMt;var tMt="DropdownMenuItem",Pwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(zPt,{...i,...n,ref:e})});Pwe.displayName=tMt;var rMt="DropdownMenuCheckboxItem",Mwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(BPt,{...i,...n,ref:e})});Mwe.displayName=rMt;var nMt="DropdownMenuRadioGroup",iMt=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(VPt,{...i,...n,ref:e})});iMt.displayName=nMt;var sMt="DropdownMenuRadioItem",Awe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(UPt,{...i,...n,ref:e})});Awe.displayName=sMt;var aMt="DropdownMenuItemIndicator",Dwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(GPt,{...i,...n,ref:e})});Dwe.displayName=aMt;var oMt="DropdownMenuSeparator",Owe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(WPt,{...i,...n,ref:e})});Owe.displayName=oMt;var lMt="DropdownMenuArrow",cMt=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(HPt,{...i,...n,ref:e})});cMt.displayName=lMt;var uMt="DropdownMenuSubTrigger",Rwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(qPt,{...i,...n,ref:e})});Rwe.displayName=uMt;var dMt="DropdownMenuSubContent",Iwe=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=qs(r);return l.jsx(YPt,{...i,...n,ref:e,style:{...t.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)"}})});Iwe.displayName=dMt;var fMt=Swe,hMt=Twe,pMt=Cwe,Lwe=jwe,$we=Nwe,Fwe=Pwe,zwe=Mwe,Bwe=Awe,Vwe=Dwe,Uwe=Owe,Gwe=Rwe,Wwe=Iwe;const R6=fMt,I6=hMt,mMt=b.forwardRef(({className:t,inset:e,children:r,...n},i)=>
4656l.jsxs(Gwe,{ref:i,className:ee("text-app-primary-foreground/80","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",e&&"pl-8",t),...n,children:[r,l.jsx(Sf,{className:"ml-auto"})]}));mMt.displayName=Gwe.displayName;const gMt=b.forwardRef(({className:t,...e},r)=>l.jsx(Wwe,{ref:r,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-xl border border-app-border-color-soft bg-app-card p-1.5 text-app-primary-foreground/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...e}));gMt.displayName=Wwe.displayName;const hP=b.forwardRef(({className:t,sideOffset:e=4,...r},n)=>l.jsx(pMt,{children:l.jsx(Lwe,{ref:n,sideOffset:e,className:ee("rounded-xl border border-app-border-color-soft","z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden bg-app-card p-1.5 text-app-primary-foreground","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",t),...r})}));hP.displayName=Lwe.displayName;const ef=b.forwardRef(({className:t,inset:e,...r},n)=>l.jsx(Fwe,{ref:n,className:ee("hover:bg-app-button-bg hover:text-app-primary-foreground cursor-pointer text-app-primary-foreground/80","relative flex select-none items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-app-button-bg focus:text-app-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-3.5 [&>svg]:shrink-0",e&&"pl-8",t),...r}));ef.displayName=Fwe.displayName;const Hwe=b.forwardRef(({className:t,children:e,checked:r,...n},i)=>l.jsxs(zwe,{ref:i,className:ee("text-app-primary-foreground/80","relative flex select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-app-button-bg focus:text-app-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer hover:bg-app-button-bg hover:text-app-primary-foreground font-light rounded-lg",t),checked:r,...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Vwe,{children:l.jsx(ei,{className:"h-4 w-4"})})}),e]}));Hwe.displayName=zwe.displayName;const yMt=b.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(Bwe,{ref:n,className:ee("hover:bg-app-button-bg hover:text-app-primary-foreground text-app-primary-foreground/80 cursor-pointer","relative flex cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Vwe,{children:l.jsx(loe,{className:"h-2 w-2 fill-current"})})}),e]}));yMt.displayName=Bwe.displayName;const qwe=b.forwardRef(({className:t,inset:e,...r},n)=>l.jsx($we,{ref:n,className:ee("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));qwe.displayName=$we.displayName;const L6=b.forwardRef(({className:t,...e},r)=>l.jsx(Uwe,{ref:r,className:ee("-mx-1 my-1 h-px bg-app-border-color-soft",t),...e}));L6.displayName=Uwe.displayName;const e4=({className:t,...e})=>l.jsx("span",{className:ee("ml-auto text-xs tracking-widest opacity-60",t),...e});e4.displayName="DropdownMenuShortcut";function vMt({table:t}){return l.jsxs(R6,{children:[l.jsx(I6,{asChild:!0,children:l.jsxs(ye,{variant:"outline",className:"hidden lg:flex bg-app-input-bg/50 h-9 border-dashed",children:[l.jsx(a3,{className:"size-4"}),"View"]}
4656)}),l.jsxs(hP,{align:"end",className:"w-[180px]",children:[l.jsx(qwe,{className:"text-xs uppercase text-app-primary-foreground/70 font-light",children:"Toggle columns"}),l.jsx(L6,{className:"mx-1"}),t.getAllColumns().filter(e=>typeof e.accessorFn<"u"&&e.getCanHide()).map(e=>l.jsx(Hwe,{className:"capitalize",checked:e.getIsVisible(),onCheckedChange:r=>e.toggleVisibility(!!r),children:e.id.replace("_"," ")},e.id))]})]})}function xMt(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const Ywe=P.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),S1=()=>{const t=P.useContext(Ywe);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};xMt(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
4657[data-state=closed]
4658){opacity:0}
4658[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function bMt(){const t=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(t)&&/Mobile/.test(t)||/FxiOS/.test(t))}function wMt(){return $6(/^Mac/)}function _Mt(){return $6(/^iPhone/)}function Fie(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function SMt(){return $6(/^iPad/)||wMt()&&navigator.maxTouchPoints>1}function Kwe(){return _Mt()||SMt()}function $6(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const kMt=24,TMt=typeof window<"u"?b.useLayoutEffect:b.useEffect;function zie(...t){return(...e)=>{for(let r of t)typeof r=="function"&&r(...e)}}const AL=typeof document<"u"&&window.visualViewport;function Bie(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Qwe(t){for(Bie(t)&&(t=t.parentElement);t&&!Bie(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const CMt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ZS=0,DL;function EMt(t={}){let{isDisabled:e}=t;TMt(()=>{if(!e)return ZS++,ZS===1&&Kwe()&&(DL=jMt()),()=>{ZS--,ZS===0&&DL?.()}},[e])}function jMt(){let t,e=0,r=f=>{t=Qwe(f.target),!(t===document.documentElement&&t===document.body)&&(e=f.changedTouches[0].pageY)},n=f=>{if(!t||t===document.documentElement||t===document.body){f.preventDefault();return}let h=f.changedTouches[0].pageY,m=t.scrollTop,y=t.scrollHeight-t.clientHeight;y!==0&&((m<=0&&h>e||m>=y&&h<e)&&f.preventDefault(),e=h)},i=f=>{let h=f.target;t4(h)&&h!==document.activeElement&&(f.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},s=f=>{let h=f.target;t4(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",AL&&(AL.height<window.innerHeight?requestAnimationFrame(()=>{Vie(h)}):AL.addEventListener("resize",()=>Vie(h),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=zie(NMt(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=zie(Vv(document,"touchstart",r,{passive:!1,capture:!0}),Vv(document,"touchmove",n,{passive:!1,capture:!0}),Vv(document,"touchend",i,{passive:!1,capture:!0}),Vv(document,"focus",s,!0),Vv(window,"scroll",a));return()=>{u(),d(),window.scrollTo(o,c)}}function NMt(t,e,r){let n=t.style[e];return t.style[e]=r,()=>{t.style[e]=n}}function Vv(t,e,r,n){return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}}function Vie(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let r=Qwe(t);if(r!==document.documentElement&&r!==document.body&&r!==t){let n=r.getBoundingClientRect().top,i=t.getBoundingClientRect().top,s=t.getBoundingClientRect().bottom;const a=r.getBoundingClientRect().bottom+kMt;s>a&&(r.scrollTop+=i-n)}t=r.parentElement}}function t4(t){return t instanceof HTMLInputElement&&!CMt.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function PMt(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function MMt(...t){return e=>t.forEach(r=>PMt(r,e))}function Zwe(...t){return b.useCallback(MMt(...t),t)}const Xwe=new WeakMap;function _i(t,e,r=!1){if(!t||!(t instanceof HTMLElement))return;let n={};Object.entries(e).forEach(([i,s])=>{if(i.startsWith("--")){t.style.setProperty(i,s);return}n[i]=t.style[i],t.style[i]=s}
4658),!r&&Xwe.set(t,n)}function AMt(t,e){if(!t||!(t instanceof HTMLElement))return;let r=Xwe.get(t);r&&(t.style[e]=r[e])}const si=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function XS(t,e){if(!t)return null;const r=window.getComputedStyle(t),n=r.transform||r.webkitTransform||r.mozTransform;let i=n.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(", ")[si(e)?13:12]):(i=n.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(", ")[si(e)?5:4]):null)}function DMt(t){return 8*(Math.log(t+1)-2)}function OL(t,e){if(!t)return()=>{};const r=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=r}}function OMt(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}const kn={DURATION:.5,EASE:[.32,.72,0,1]},Jwe=.4,RMt=.25,IMt=100,e1e=8,yh=16,r4=26,RL="vaul-dragging";function t1e(t){const e=P.useRef(t);return P.useEffect(()=>{e.current=t}),P.useMemo(()=>(...r)=>e.current==null?void 0:e.current.call(e,...r),[])}function LMt({defaultProp:t,onChange:e}){const r=P.useState(t),[n]=r,i=P.useRef(n),s=t1e(e);return P.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function r1e({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=LMt({defaultProp:e,onChange:r}),s=t!==void 0,a=s?t:n,o=t1e(r),c=P.useCallback(u=>{if(s){const f=typeof u=="function"?u(t):u;f!==t&&o(f)}else i(u)},[s,t,i,o]);return[a,c]}function $Mt({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:r,drawerRef:n,overlayRef:i,fadeFromIndex:s,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=r1e({prop:t,defaultProp:r?.[0],onChange:e}),[h,m]=P.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);P.useEffect(()=>{function j(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const y=P.useMemo(()=>d===r?.[r.length-1]||null,[r,d]),x=P.useMemo(()=>{var j;return(j=r?.findIndex(M=>M===d))!=null?j:null},[r,d]),v=r&&r.length>0&&(s||s===0)&&!Number.isNaN(s)&&r[s]===d||!r,_=P.useMemo(()=>{const j=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var M;return(M=r?.map(O=>{const R=typeof O=="string";let I=0;if(R&&(I=parseInt(O,10)),si(o)){const F=R?I:h?O*j.height:0;return h?o==="bottom"?j.height-F:-j.height+F:F}const B=R?I:h?O*j.width:0;return h?o==="right"?j.width-B:-j.width+B:B}))!=null?M:[]},[r,h,c]),S=P.useMemo(()=>x!==null?_?.[x]:null,[_,x]),k=P.useCallback(j=>{var M;const O=(M=_?.findIndex(R=>R===j))!=null?M:null;a(O),_i(n.current,{transition:`transform ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,transform:si(o)?`translate3d(0, ${j}px, 0)`:`translate3d(${j}px, 0, 0)`}),_&&O!==_.length-1&&s!==void 0&&O!==s&&O<s?_i(i.current,{transition:`opacity ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,opacity:"0"}):_i(i.current,{transition:`opacity ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,opacity:"1"}),f(r?.[Math.max(O,0)])},[n.current,r,_,s,i,f]);P.useEffect(()=>{if(d||t){var j;const M=(j=r?.findIndex(O=>O===t||O===d))!=null?j:-1;_&&M!==-1&&typeof _[M]=="number"&&k(_[M])}},[d,t,r,_,k]);function E({draggedDistance:j,closeDrawer:M,velocity:O,dismissible:R}){if(s===void 0)return;const I=o==="bottom"||o==="right"?(S??0)-j:(S??0)+j,B=x===s-1,F=x===0,V=j>0;if(B&&_i(i.current,{transition:`opacity ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`}),!u&&O>2&&!V){R?M():k(_[0]);return}if(!u&&O>2&&V&&_&&r){k(_[r.length-1]);return}const $=_?.reduce((z,L)=>typeof z!="number"||typeof L!="number"?z:Math.abs(L-I)<Math.abs(z-I)?L:z),U=si(o)?window.innerHeight:window.innerWidth;if(O>Jwe&&Math.abs(j)<U*.4){const z=V?1:-1;if(z>0&&y&&r){k(_[r.length-1]);return}if(F&&z<0&&R&&M(),x===null)return;k(_[x+z]);return}k($)}function T({draggedDistance:j}){if(S===null)return;const M=o==="bottom"||o==="right"?S-j:S+j;(o==="bottom"||o==="right")&&M<_[_.length-1]||(o==="top"||o==="left")&&M>_[_.length-1]||_i(n.current,{transform:si(o)?`translate3d(0, ${M}
4658px, 0)`:`translate3d(${M}px, 0, 0)`})}function N(j,M){if(!r||typeof x!="number"||!_||s===void 0)return null;const O=x===s-1;if(x>=s&&M)return 0;if(O&&!M)return 1;if(!v&&!O)return null;const I=O?x+1:x-1,B=O?_[I]-_[I-1]:_[I+1]-_[I],F=j/Math.abs(B);return O?1-F:F}return{isLastSnapPoint:y,activeSnapPoint:d,shouldFade:v,getPercentageDragged:N,setActiveSnapPoint:f,activeSnapPointIndex:x,onRelease:E,onDrag:T,snapPointsOffset:_}}const FMt=()=>()=>{};function zMt(){const{direction:t,isOpen:e,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:i}=S1(),s=P.useRef(null),a=b.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-r4)/window.innerWidth}P.useEffect(()=>{if(e&&r){s.current&&clearTimeout(s.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;OMt(n&&!i?OL(document.body,{background:"black"}):FMt,OL(c,{transformOrigin:si(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kn.EASE.join(",")})`}));const u=OL(c,{borderRadius:`${e1e}px`,overflow:"hidden",...si(t)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),s.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},kn.DURATION*1e3)}}},[e,r,a])}let Uv=null;function BMt({isOpen:t,modal:e,nested:r,hasBeenOpened:n,preventScrollRestoration:i,noBodyStyles:s}){const[a,o]=P.useState(()=>typeof window<"u"?window.location.href:""),c=P.useRef(0),u=P.useCallback(()=>{if(Fie()&&Uv===null&&t&&!s){Uv={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=h-window.innerHeight;m&&c.current>=h&&(document.body.style.top=`${-(c.current+m)}px`)}),300)}},[t]),d=P.useCallback(()=>{if(Fie()&&Uv!==null&&!s){const f=-parseInt(document.body.style.top,10),h=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Uv),window.requestAnimationFrame(()=>{if(i&&a!==window.location.href){o(window.location.href);return}window.scrollTo(h,f)}),Uv=null}},[a]);return P.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),P.useEffect(()=>{if(e)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[e,d]),P.useEffect(()=>{r||!n||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{d()},500)):d())},[t,n,a,e,r,u,d]),{restorePositionSetting:d}}function VMt({open:t,onOpenChange:e,children:r,onDrag:n,onRelease:i,snapPoints:s,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=RMt,scrollLockTimeout:u=IMt,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:h=s&&s.length-1,activeSnapPoint:m,setActiveSnapPoint:y,fixed:x,modal:v=!0,onClose:_,nested:S,noBodyStyles:k=!1,direction:E="bottom",defaultOpen:T=!1,disablePreventScroll:N=!0,snapToSequentialPoint:j=!1,preventScrollRestoration:M=!1,repositionInputs:O=!0,onAnimationEnd:R,container:I,autoFocus:B=!1}){var F,V;const[$=!1,U]=r1e({defaultProp:T,prop:t,onChange:$e=>{e?.($e),!$e&&!S&&Nt(),setTimeout(()=>{R?.($e)},kn.DURATION*1e3),$e&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),$e||(document.body.style.pointerEvents="auto")}}),[z,L]=P.useState(!1),[W,K]=P.useState(!1),[q,H]=P.useState(!1),Y=P.useRef(null),J=P.useRef(null),re=P.useRef(null),me=P.useRef(null),oe=P.useRef(null),ge=P.useRef(!1),le=P.useRef(null),Se=P.useRef(0),Ce=P.useRef(!1),he=P.useRef(!T),Ct=P.useRef(0),De=P.useRef(null),It=P.useRef(((F=De.current)==null?void 0:F.getBoundingClientRect().height)||0),Yt=P.useRef(((V=De.current)==null?void 0:V.getBoundingClientRect().width)||0),Qt=P.useRef(0),Qr=P.useCallback($e=>
4658{s&&$e===Ee.length-1&&(J.current=new Date)},[]),{activeSnapPoint:gr,activeSnapPointIndex:X,setActiveSnapPoint:ae,onRelease:de,snapPointsOffset:Ee,onDrag:Me,shouldFade:Te,getPercentageDragged:Qe}=$Mt({snapPoints:s,activeSnapPointProp:m,setActiveSnapPointProp:y,drawerRef:De,fadeFromIndex:h,overlayRef:Y,onSnapPointChange:Qr,direction:E,container:I,snapToSequentialPoint:j});EMt({isDisabled:!$||W||!v||q||!z||!O||!N});const{restorePositionSetting:Nt}=BMt({isOpen:$,modal:v,nested:S??!1,hasBeenOpened:z,preventScrollRestoration:M,noBodyStyles:k});function jt(){return(window.innerWidth-r4)/window.innerWidth}function jr($e){var We,rt;!d&&!s||De.current&&!De.current.contains($e.target)||(It.current=((We=De.current)==null?void 0:We.getBoundingClientRect().height)||0,Yt.current=((rt=De.current)==null?void 0:rt.getBoundingClientRect().width)||0,K(!0),re.current=new Date,Kwe()&&window.addEventListener("touchend",()=>ge.current=!1,{once:!0}),$e.target.setPointerCapture($e.pointerId),Se.current=si(E)?$e.pageY:$e.pageX)}function Vr($e,We){var rt;let bt=$e;const ut=(rt=window.getSelection())==null?void 0:rt.toString(),it=De.current?XS(De.current,E):null,Wt=new Date;if(bt.tagName==="SELECT"||bt.hasAttribute("data-vaul-no-drag")||bt.closest("[data-vaul-no-drag]"))return!1;if(E==="right"||E==="left")return!0;if(J.current&&Wt.getTime()-J.current.getTime()<500)return!1;if(it!==null&&(E==="bottom"?it>0:it<0))return!0;if(ut&&ut.length>0)return!1;if(oe.current&&Wt.getTime()-oe.current.getTime()<u&&it===0||We)return oe.current=Wt,!1;for(;bt;){if(bt.scrollHeight>bt.clientHeight){if(bt.scrollTop!==0)return oe.current=new Date,!1;if(bt.getAttribute("role")==="dialog")return!0}bt=bt.parentNode}return!0}function Dr($e){if(De.current&&W){const We=E==="bottom"||E==="right"?1:-1,rt=(Se.current-(si(E)?$e.pageY:$e.pageX))*We,bt=rt>0,ut=s&&!d&&!bt;if(ut&&X===0)return;const it=Math.abs(rt),Wt=document.querySelector("[data-vaul-drawer-wrapper]"),cr=E==="bottom"||E==="top"?It.current:Yt.current;let Jt=it/cr;const pn=Qe(it,bt);if(pn!==null&&(Jt=pn),ut&&Jt>=1||!ge.current&&!Vr($e.target,bt))return;if(De.current.classList.add(RL),ge.current=!0,_i(De.current,{transition:"none"}),_i(Y.current,{transition:"none"}),s&&Me({draggedDistance:rt}),bt&&!s){const Q=DMt(rt),ie=Math.min(Q*-1,0)*We;_i(De.current,{transform:si(E)?`translate3d(0, ${ie}px, 0)`:`translate3d(${ie}px, 0, 0)`});return}const yr=1-Jt;if((Te||h&&X===h-1)&&(n?.($e,Jt),_i(Y.current,{opacity:`${yr}`,transition:"none"},!0)),Wt&&Y.current&&a){const Q=Math.min(jt()+Jt*(1-jt()),1),ie=8-Jt*8,ue=Math.max(0,14-Jt*14);_i(Wt,{borderRadius:`${ie}px`,transform:si(E)?`scale(${Q}) translate3d(0, ${ue}px, 0)`:`scale(${Q}) translate3d(${ue}px, 0, 0)`,transition:"none"},!0)}if(!s){const Q=it*We;_i(De.current,{transform:si(E)?`translate3d(0, ${Q}px, 0)`:`translate3d(${Q}px, 0, 0)`})}}}P.useEffect(()=>{window.requestAnimationFrame(()=>{he.current=!0})},[]),P.useEffect(()=>{var $e;function We(){if(!De.current||!O)return;const rt=document.activeElement;if(t4(rt)||Ce.current){var bt;const ut=((bt=window.visualViewport)==null?void 0:bt.height)||0,it=window.innerHeight;let Wt=it-ut;const cr=De.current.getBoundingClientRect().height||0,Jt=cr>it*.8;Qt.current||(Qt.current=cr);const pn=De.current.getBoundingClientRect().top;if(Math.abs(Ct.current-Wt)>60&&(Ce.current=!Ce.current),s&&s.length>0&&Ee&&X){const yr=Ee[X]||0;Wt+=yr}if(Ct.current=Wt,cr>ut||Ce.current){const yr=De.current.getBoundingClientRect().height;let Q=yr;yr>ut&&(Q=ut-(Jt?pn:r4)),x?De.current.style.height=`${yr-Math.max(Wt,0)}px`:De.current.style.height=`${Math.max(Q,ut-pn)}px`}else bMt()||(De.current.style.height=`${Qt.current}px`);s&&s.length>0&&!Ce.current?De.current.style.bottom="0px":De.current.style.bottom=`${Math.max(Wt,0)}px`}}return($e=window.visualViewport)==null||$e.addEventListener("resize",We),()=>{var rt;return(rt=window.visualViewport)==null?void 0:rt.removeEventListener("resize",We)}},[X,s,Ee]);function $r($e){Ni(),_?.(),$e||U(!1),setTimeout(()=>{s&&ae(s[0])}
4658,kn.DURATION*1e3)}function Ur(){if(!De.current)return;const $e=document.querySelector("[data-vaul-drawer-wrapper]"),We=XS(De.current,E);_i(De.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`}),_i(Y.current,{transition:`opacity ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,opacity:"1"}),a&&We&&We>0&&$&&_i($e,{borderRadius:`${e1e}px`,overflow:"hidden",...si(E)?{transform:`scale(${jt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${jt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kn.EASE.join(",")})`},!0)}function Ni(){!W||!De.current||(De.current.classList.remove(RL),ge.current=!1,K(!1),me.current=new Date)}function zi($e){if(!W||!De.current)return;De.current.classList.remove(RL),ge.current=!1,K(!1),me.current=new Date;const We=XS(De.current,E);
4658if(!$e||!Vr($e.target,!1)||!We||Number.isNaN(We)||re.current===null)return;const rt=me.current.getTime()-re.current.getTime(),bt=Se.current-(si(E)?$e.pageY:$e.pageX),ut=Math.abs(bt)/rt;if(ut>.05&&(H(!0),setTimeout(()=>{H(!1)},200)),s){de({draggedDistance:bt*(E==="bottom"||E==="right"?1:-1),closeDrawer:$r,velocity:ut,dismissible:d}),i?.($e,!0);return}if(E==="bottom"||E==="right"?bt>0:bt<0){Ur(),i?.($e,!0);return}if(ut>Jwe){$r(),i?.($e,!1);return}var it;const Wt=Math.min((it=De.current.getBoundingClientRect().height)!=null?it:0,window.innerHeight);var cr;const Jt=Math.min((cr=De.current.getBoundingClientRect().width)!=null?cr:0,window.innerWidth),pn=E==="left"||E==="right";if(Math.abs(We)>=(pn?Jt:Wt)*c){$r(),i?.($e,!1);return}i?.($e,!0),Ur()}P.useEffect(()=>($&&(_i(document.documentElement,{scrollBehavior:"auto"}),J.current=new Date),()=>{AMt(document.documentElement,"scrollBehavior")}),[$]);function Nn($e){const We=$e?(window.innerWidth-yh)/window.innerWidth:1,rt=$e?-yh:0;le.current&&window.clearTimeout(le.current),_i(De.current,{transition:`transform ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,transform:si(E)?`scale(${We}) translate3d(0, ${rt}px, 0)`:`scale(${We}) translate3d(${rt}px, 0, 0)`}),!$e&&De.current&&(le.current=setTimeout(()=>{const bt=XS(De.current,E);_i(De.current,{transition:"none",transform:si(E)?`translate3d(0, ${bt}px, 0)`:`translate3d(${bt}px, 0, 0)`})},500))}function or($e,We){if(We<0)return;const rt=(window.innerWidth-yh)/window.innerWidth,bt=rt+We*(1-rt),ut=-yh+We*yh;_i(De.current,{transform:si(E)?`scale(${bt}) translate3d(0, ${ut}px, 0)`:`scale(${bt}) translate3d(${ut}px, 0, 0)`,transition:"none"})}function xt($e,We){const rt=si(E)?window.innerHeight:window.innerWidth,bt=We?(rt-yh)/rt:1,ut=We?-yh:0;We&&_i(De.current,{transition:`transform ${kn.DURATION}s cubic-bezier(${kn.EASE.join(",")})`,transform:si(E)?`scale(${bt}) translate3d(0, ${ut}px, 0)`:`scale(${bt}) translate3d(${ut}px, 0, 0)`})}return P.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),P.createElement(gj,{defaultOpen:T,onOpenChange:$e=>{!d&&!$e||($e?L(!0):$r(!0),U($e))},open:$},P.createElement(Ywe.Provider,{value:{activeSnapPoint:gr,snapPoints:s,setActiveSnapPoint:ae,drawerRef:De,overlayRef:Y,onOpenChange:e,onPress:jr,onRelease:zi,onDrag:Dr,dismissible:d,shouldAnimate:he,handleOnly:f,isOpen:$,isDragging:W,shouldFade:Te,closeDrawer:$r,onNestedDrag:or,onNestedOpenChange:Nn,onNestedRelease:xt,keyboardIsOpen:Ce,modal:v,snapPointsOffset:Ee,activeSnapPointIndex:X,direction:E,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:k,container:I,autoFocus:B}},r))}const n1e=P.forwardRef(function({...t},e){const{overlayRef:r,snapPoints:n,onRelease:i,shouldFade:s,isOpen:a,modal:o,shouldAnimate:c}=S1(),u=Zwe(e,r),d=n&&n.length>0;if(!o)return null;const f=P.useCallback(h=>i(h),[i]);return P.createElement(vj,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":a&&d?"true":"false","data-vaul-snap-points-overlay":a&&s?"true":"false","data-vaul-animate":c?.current?"true":"false",...t})});n1e.displayName="Drawer.Overlay";const i1e=P.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:r,...n},i){const{drawerRef:s,onPress:a,onRelease:o,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,activeSnapPointIndex:f,modal:h,isOpen:m,direction:y,snapPoints:x,container:v,handleOnly:_,shouldAnimate:S,autoFocus:k}=S1(),[E,T]=P.useState(!1),N=Zwe(i,s),j=P.useRef(null),M=P.useRef(null),O=P.useRef(!1),R=x&&x.length>0;zMt();const I=(F,V,$=0)=>{if(O.current)return!0;const U=Math.abs(F.y),z=Math.abs(F.x),L=z>U,W=["bottom","right"].includes(V)?1:-1;if(V==="left"||V==="right"){if(!(F.x*W<0)&&z>=0&&z<=$)return L}else if(!(F.y*W<0)&&U>=0&&U<=$)return!L;return O.current=!0,!0};P.useEffect(()=>{R&&window.requestAnimationFrame(()=>{T(!0)})},[]);function B(F){j.current=null,O.current=!1,o(F)}return P.createElement(xj,{"data-vaul-drawer-direction":y,"data-vaul-drawer":"","data-vaul-delayed-snap-points":E?"true":"false","data-vaul-snap-points":m&&R?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":S?.current?"true":"false",...n,ref:N,style:d&&d.length>0?{"--snap-point-height":`${d[f??0]}px`,...e}:e,onPointerDown:F=>{_||(n.onPointerDown==null||n.onPointerDown.call(n,F),j.current={x:F.pageX,y:F.pageY},a(F))}
4658,onOpenAutoFocus:F=>{r?.(F),k||F.preventDefault()},onPointerDownOutside:F=>{if(t?.(F),!h||F.defaultPrevented){F.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:F=>{if(!h){F.preventDefault();return}},onPointerMove:F=>{if(M.current=F,_||(n.onPointerMove==null||n.onPointerMove.call(n,F),!j.current))return;const V=F.pageY-j.current.y,$=F.pageX-j.current.x,U=F.pointerType==="touch"?10:2;I({x:$,y:V},y,U)?c(F):(Math.abs($)>U||Math.abs(V)>U)&&(j.current=null)},onPointerUp:F=>{n.onPointerUp==null||n.onPointerUp.call(n,F),j.current=null,O.current=!1,o(F)},onPointerOut:F=>{n.onPointerOut==null||n.onPointerOut.call(n,F),B(M.current)},onContextMenu:F=>{n.onContextMenu==null||n.onContextMenu.call(n,F),M.current&&B(M.current)}})});i1e.displayName="Drawer.Content";const UMt=250,GMt=120,WMt=P.forwardRef(function({preventCycle:t=!1,children:e,...r},n){const{closeDrawer:i,isDragging:s,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:h,onDrag:m}=S1(),y=P.useRef(null),x=P.useRef(!1);function v(){if(x.current){k();return}window.setTimeout(()=>{_()},GMt)}function _(){if(s||t||x.current){k();return}if(k(),!a||a.length===0){u||i();return}if(o===a[a.length-1]&&u){i();return}const T=a.findIndex(j=>j===o);if(T===-1)return;const N=a[T+1];c(N)}function S(){y.current=window.setTimeout(()=>{x.current=!0},UMt)}function k(){y.current&&window.clearTimeout(y.current),x.current=!1}return P.createElement("div",{onClick:v,onPointerCancel:k,onPointerDown:E=>{d&&h(E),S()},onPointerMove:E=>{d&&m(E)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},P.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});WMt.displayName="Drawer.Handle";function HMt(t){const e=S1(),{container:r=e.container,...n}=t;return P.createElement(yj,{container:r,...n})}const _l={Root:VMt,Content:i1e,Overlay:n1e,Trigger:qfe,Portal:HMt,Close:bj,Title:GB,Description:WB},s1e=({shouldScaleBackground:t=!0,...e})=>l.jsx(_l.Root,{shouldScaleBackground:t,...e});s1e.displayName="Drawer";const qMt=_l.Trigger,YMt=_l.Portal,KMt=_l.Close,a1e=b.forwardRef(({className:t,...e},r)=>l.jsx(_l.Overlay,{ref:r,className:ee("fixed inset-0 z-50 bg-black/80",t),...e}));a1e.displayName=_l.Overlay.displayName;const o1e=b.forwardRef(({className:t,children:e,...r},n)=>l.jsxs(YMt,{children:[l.jsx(a1e,{}),l.jsxs(_l.Content,{ref:n,className:ee("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-2xl bg-app-card text-app-primary-foreground/90 px-2",t),...r,children:[l.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-app-border-color-soft"}),e]})]}));o1e.displayName="DrawerContent";const l1e=({className:t,...e})=>l.jsx("div",{className:ee("grid gap-1.5 p-4 text-center sm:text-left",t),...e});l1e.displayName="DrawerHeader";const c1e=({className:t,...e})=>l.jsx("div",{className:ee("mt-auto flex flex-col gap-2 p-4",t),...e});c1e.displayName="DrawerFooter";const u1e=b.forwardRef(({className:t,...e},r)=>l.jsx(_l.Title,{ref:r,className:ee("text-lg font-semibold leading-none tracking-tight",t),...e}));u1e.displayName=_l.Title.displayName;const d1e=b.forwardRef(({className:t,...e},r)=>l.jsx(_l.Description,{ref:r,className:ee("text-sm text-muted-foreground",t),...e}));d1e.displayName=_l.Description.displayName;const QMt=t=>{const{trades:e,table:r,showTrigger:n=!0,onSuccess:i,...s}=t,a=r.getState().rowSelection,o=b.useMemo(()=>Object.keys(a).length>0?Object.keys(a):e.length>0?[e[0].id]:[],[a,e]),[c,{loading:u}]=Zn(Ohe,{update(y,{data:x}){const v=x?.delete_trade?.returning??[];v.length!==0&&(v.forEach(({id:_})=>{y.evict({id:y.identify({__typename:"trade",id:_})})}),y.evict({id:"ROOT_QUERY",fieldName:"trade"}),y.evict({id:"ROOT_QUERY",fieldName:"trade_aggregate"}),y.gc())},onCompleted:y=>{const x=y?.delete_trade?.returning.length??0;Ft.success("Trade(s) deleted successfully"),s.onOpenChange?.(!1),i?.(x)},onError:y=>{Ft.error(y.message)}}),d=Qp("(min-width: 640px)"),f=o.length===1,h=f?e[0]:null,m=b.useCallback(()=>{c({variables:{tradesId:o}})},[c,o]);return d?l.jsxs(Pj,{...s,children:[n?l.jsx(vYe,{asChild:!0,children:l.jsxs(ye,{variant:"outline",size:"sm",children:[l.jsx(N$,{className:"mr-2 size-4","aria-hidden":"true"}),"Delete (",o.length,")"]})}
4658):null,l.jsxs(Xw,{children:[l.jsxs(Mj,{children:[l.jsx(Jw,{children:"Are you absolutely sure?"}),l.jsxs(Aj,{children:["This action cannot be undone. This will permanently delete your"," ",l.jsx("span",{className:"font-medium",children:o.length}),o.length===1?" trade":" trades"," ","from our servers."]})]}),f&&h&&l.jsxs("div",{className:"bg-app-input-bg rounded-lg p-4 space-y-3 tracking-wide",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Symbol"}),l.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-medium bg-app-button-bg",children:h.symbol})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Type"}),l.jsx("span",{className:ee("px-2 py-1 rounded-lg text-xs font-medium",h.position_type==="LONG"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:h.position_type})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Entry date"}),l.jsx("span",{className:"text-sm",children:tp(h.entry_date,"longWithPeriod")})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Entry price"}),l.jsx("span",{className:"text-sm",children:h.entry_price??"--"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"P/L"}),l.jsxs("span",{className:ee("px-2 py-1 flex items-center gap-1 rounded-lg text-sm font-medium",(h.pnl??0)>0?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:[(h.pnl??0)>0?l.jsx(eT,{className:"size-3","aria-hidden":"true"}):l.jsx(Jk,{className:"size-3","aria-hidden":"true"}),Ke(h.pnl)]})]})]}),l.jsxs(_b,{className:"gap-2 sm:space-x-0",children:[l.jsx(bYe,{asChild:!0,children:l.jsx(ye,{variant:"outline",children:"Cancel"})}),l.jsxs(ye,{"aria-label":"Delete selected rows",variant:"destructive",onClick:m,disabled:u,children:[u&&l.jsx(S$,{className:"mr-2 size-4 animate-spin","aria-hidden":"true"}),"Delete"]})]})]})]}):l.jsxs(s1e,{...s,children:[n?l.jsx(qMt,{asChild:!0,children:l.jsxs(ye,{variant:"outline",size:"sm",children:[l.jsx(N$,{className:"mr-2 size-4","aria-hidden":"true"}),"Delete (",e.length,")"]})}):null,l.jsxs(o1e,{className:"gap-3",children:[l.jsxs(l1e,{children:[l.jsx(u1e,{children:"Are you absolutely sure?"}),l.jsxs(d1e,{children:["This action cannot be undone. This will permanently delete your"," ",l.jsx("span",{className:"font-medium",children:e.length}),e.length===1?" trade":" trades"," ","from our servers."]})]}),f&&h&&l.jsxs("div",{className:"bg-app-input-bg rounded-lg p-4 space-y-3 tracking-wide",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Symbol"}),l.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-medium bg-app-button-bg",children:h.symbol})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Type"}),l.jsx("span",{className:ee("px-2 py-1 rounded-lg text-xs font-medium",h.position_type==="LONG"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:h.position_type})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Entry date"}),l.jsx("span",{className:"text-sm",children:tp(h.entry_date,"longWithPeriod")})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground/70 uppercase text-xs tracking-wider",children:"Entry price"}),l.jsx("span",{className:"text-sm",children:h.entry_price??"--"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-app-primary-foreground
4658/70 uppercase text-xs tracking-wider",children:"P/L"}),l.jsxs("span",{className:ee("px-2 py-1 flex items-center gap-1 rounded-lg text-sm font-medium",(h.pnl??0)>0?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:[(h.pnl??0)>0?l.jsx(eT,{className:"size-3","aria-hidden":"true"}):l.jsx(Jk,{className:"size-3","aria-hidden":"true"}),Ke(h.pnl)]})]})]}),l.jsxs(c1e,{className:"flex flex-row gap-2 sm:space-x-0",children:[l.jsx(KMt,{asChild:!0,children:l.jsx(ye,{variant:"outline",className:"flex-1",children:"Cancel"})}),l.jsxs(ye,{className:"flex-1","aria-label":"Delete selected rows",variant:"destructive",onClick:m,disabled:u,children:[u&&l.jsx(S$,{className:"mr-2 size-4 animate-spin","aria-hidden":"true"}),"Delete"]})]})]})]})},ZMt=({tradesIds:t,isPopoverOpen:e,onOpenChange:r,children:n})=>{const[i,{loading:s}]=Zn(Ihe),a=$o({resolver:xl(jge),defaultValues:{initialRisk:null}}),o=!a.formState.dirtyFields.initialRisk,c=a.watch("initialRisk"),u=b.useCallback(f=>{f||a.reset({initialRisk:null}),r(f)},[a,r]),d=async f=>{try{await i({variables:{tradesIds:t,risk:f.initialRisk},update:h=>{const m=f.initialRisk;t.forEach(y=>{h.modify({id:h.identify({__typename:"trade",id:y}),fields:{risk:()=>m}})})}}),a.reset({initialRisk:f.initialRisk}),u(!1)}catch(h){const m=jw(h);a.setError("initialRisk",{message:m})}};return l.jsxs(Bf,{open:e,onOpenChange:u,children:[l.jsx(Vf,{asChild:!0,children:n}),l.jsx(Uf,{className:"w-80 rounded-2xl",align:"start",side:"top",sideOffset:24,children:l.jsx(tN,{...a,children:l.jsxs("form",{onSubmit:a.handleSubmit(d),className:"flex flex-col gap-4",children:[l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-app-button-bg border-none text-app-primary-foreground/90 [&>svg]:text-app-primary-foreground/90",children:[l.jsx(fl,{size:24,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1 ml-2 font-light max-w-sm leading-relaxed",children:[l.jsx("strong",{className:"font-semibold",children:"Apply initial risk to selected trades"})," ","This will set an initial risk amount for all currently selected trades (",t.length,"). It overwrites the existing initial risk on those trades and can be changed later."]})]}),l.jsx(kb,{control:a.control,name:"initialRisk",render:({field:f})=>{const h=m=>{const{value:y}=m.target,x=Number.parseFloat(y);f.onChange(y===""||Number.isNaN(x)?null:x)};return l.jsxs(ry,{children:[l.jsx(ny,{className:"text-xs font-normal uppercase tracking-wider text-app-primary-foreground/70",children:"Initial Risk (USD)"}),l.jsxs("div",{className:"relative flex w-full rounded-md",children:[l.jsx("span",{className:"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-lg font-light text-app-primary-foreground/70",children:"$"}),l.jsx(n1,{children:l.jsx(Wr,{...f,value:f.value??"",disabled:s,onChange:h,inputMode:"decimal",placeholder:"0.00",type:"number",step:"0.01",hasIcon:!0,className:"-me-px h-9 w-full rounded-e-none ps-6 text-app-primary-foreground/90"})}),l.jsx("span",{className:"z-10 inline-flex items-center rounded-e-lg border border-l-0 border-app-border-color bg-app-input-bg px-3 text-sm font-light text-app-primary-foreground/70",children:"USD"}),l.jsx(ye,{type:"submit",variant:"secondary",size:"icon",className:"ml-2 self-center border-none",disabled:s||o,children:s?l.jsx(gn,{size:"sm"}):l.jsx(ei,{className:"size-3"})})]}),l.jsx(nN,{children:"Sets the initial risk on all selected trades."}),l.jsx(iN,{})]})}}),c!=null&&c>1e5&&l.jsxs(wo,{className:"w-full rounded-2xl border px-4 py-3 text-sm font-normal bg-yellow-500/10 border-yellow-500/20 text-yellow-100 [&>svg]:text-yellow-400",children:[l.jsx(Wu,{size:20,strokeWidth:1.5}),l.jsxs(_o,{className:"mt-1.5 ml-1 font-light max-w-sm",children:[l.jsx("strong",{children:"High Risk Amount:"})," ",Ke(c)," ","is unusually high for a default risk amount. Please double-check this value before saving."]})]})]})})})]})},f1e=()=>{const{shouldShowProBanner:t}=Hs(),e=t();return{canDeleteTrades:!e,isFreePlan:e}},IL=({children:t,content:e})=>l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:t}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs text-gray-300 font-light",children:e})})]}),XMt=({table:t,containerProp:e,setRowsAction:r,totalCount:n})=>{const[i,s]=P.useState(!1),[a,o]=P.useState(!1),{leftOffset:c}=b6(),u=t.getRowModel().rows,d=t.getState().rowSelection,f=P.useMemo(()=>Object.keys(d),[d]),{canDeleteTrades:h}=f1e(),m=P.useCallback(()=>
4658{if(!h){Ft.error("Upgrade to a PRO plan to delete trades");return}r({rows:u,variant:"delete"})},[h,r,u]);P.useLayoutEffect(()=>{s(!0)},[]),P.useEffect(()=>{function v(_){_.key==="Escape"&&t.resetRowSelection()}return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[t]);const y=e??(i?globalThis.document?.body:null);if(!y)return null;const x=f.length>0;return bc.createPortal(l.jsx(Ss,{children:x&&l.jsxs(ct.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeInOut"},className:"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit items-center justify-center gap-2 rounded-xl border border-app-border-color-soft bg-app-card p-2 shadow-lg h-14 2k:h-20 2k:px-6 2k:py-3",style:{left:`calc(${c})`,transform:"translateX(-50%)"},children:[l.jsx(IL,{content:"Select all on this page",children:l.jsx("div",{className:"flex h-full items-center rounded-md border border-app-border-color-soft bg-app-input-bg px-3",children:l.jsx(vc,{checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:v=>t.toggleAllPageRowsSelected(!!v),className:"cursor-pointer"})})}),l.jsxs("div",{className:"flex h-full items-center justify-center rounded-md border border-app-border-color-soft bg-app-input-bg px-2.5 pr-1",children:[l.jsxs("span",{className:"whitespace-nowrap text-xs text-gray-300 2k:text-2xl",children:[l.jsx("span",{className:"text-gray-50 font-medium",children:f.length})," out of ",l.jsx("span",{className:"text-gray-50 font-medium",children:n})," trades"]}),l.jsx("div",{className:"mx-2 h-4 w-px bg-app-border-color-soft"}),l.jsx(IL,{content:"Clear selection",children:l.jsx("button",{onClick:()=>t.resetRowSelection(),type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-gray-400 hover:text-white transition-colors cursor-pointer",title:"Clear selection",children:l.jsx(pi,{size:14,className:"2k:w-10 2k:h-10"})})})]}),l.jsx("div",{className:"flex h-full items-center rounded-md border border-app-border-color-soft bg-app-input-bg px-2.5",children:l.jsx(ZMt,{tradesIds:f,isPopoverOpen:a,onOpenChange:o,children:l.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-gray-400 hover:text-white transition-colors cursor-pointer","aria-label":"Open bulk risk control",children:l.jsx(t3,{size:14,className:"2k:size-10"})})})}),l.jsx("div",{className:"w-px h-5 bg-app-border-color-soft"}),h&&l.jsx(IL,{content:"Delete trades",children:l.jsx(ye,{variant:"destructive",size:"icon",onClick:m,children:l.jsx(hl,{className:"text-white 2k:w-10 2k:h-10"})})}),!h&&l.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-2 rounded-md border border-app-border-color-soft bg-app-input-bg",children:[l.jsx(hl,{size:16,className:"text-gray-500"}),l.jsx(Oj,{message:"Upgrade to a PRO plan to delete trades",showTooltip:!0})]})]})}),y)};function Vc({column:t,title:e,className:r}){return t.getCanSort()?l.jsx("div",{className:ee("flex items-center space-x-2",r),children:l.jsxs(R6,{children:[l.jsx(I6,{asChild:!0,children:l.jsxs(ye,{size:"sm",variant:"secondary",className:"-ml-3 h-7 data-[state=open]:bg-app-button-bg bg-transparent border-none focus-visible:ring-0 focus-visible:border-none text-current font-light",children:[l.jsx("span",{className:"text-xs uppercase tracking-wider",children:e}),t.getIsSorted()==="desc"?l.jsx(w$,{className:"size-3.5 text-app-border-color-accent"}):t.getIsSorted()==="asc"?l.jsx(_$,{className:"size-3.5 text-app-border-color-accent"}):l.jsx($Pe,{className:"size-3.5"})]})}),l.jsxs(hP,{className:"min-w-32",align:"start",children:[l.jsxs(ef,{onClick:()=>t.toggleSorting(!1),className:"text-xs",children:[l.jsx(_$,{className:"size-3 mr-0.5 text-muted-foreground/70"}),"Asc"]}),l.jsxs(ef,{onClick:()=>t.toggleSorting(!0),className:"text-xs",children:[l.jsx(w$,{className:"size-3 mr-0.5 text-muted-foreground/70"}),"Desc"]}),l.jsx(L6,{className:"mx-0.5"}),l.jsxs(ef,{onClick:()=>t.clearSorting(),className:"text-xs",children:[l.jsx(pi,{className:"size-3 mr-0.5 text-muted-foreground
4658/70"}),"Reset"]}),l.jsxs(ef,{onClick:()=>t.toggleVisibility(!1),className:"text-xs",children:[l.jsx(uoe,{className:"size-3 mr-0.5 text-muted-foreground/70"}),"Hide"]})]})]})}):l.jsx("div",{className:ee(r),children:e})}function JMt({rows:t,setRowsAction:e,canPerformDeleteAction:r}){if(!t.length)return null;const n=t[0].original;return l.jsxs(R6,{children:[l.jsx(I6,{asChild:!0,children:l.jsxs(ye,{"data-prevent-row-click":!0,variant:"ghost",className:"flex size-8 p-0 data-[state=open]:bg-app-button-bg hover:bg-app-button-bg",children:[l.jsx(aMe,{}),l.jsx("span",{className:"sr-only",children:"Open menu"})]})}),l.jsxs(hP,{align:"end",className:"w-[160px] space-y-1",children:[l.jsx(ef,{asChild:!0,children:l.jsxs(At,{to:`/app/trades/${n.id}`,"data-prevent-row-click":!0,children:[l.jsx(tb,{className:"size-4"}),"View Details"]})}),r&&l.jsxs(ef,{"data-prevent-row-click":!0,className:"text-red-400 hover:!text-red-300 hover:!bg-red-500/10",onClick:()=>e({rows:t,variant:"delete"}),children:[l.jsx(hl,{className:"size-4"}),"Delete",l.jsx(e4,{children:"⌘⌫"})]}),!r&&l.jsxs(ef,{"data-prevent-row-click":!0,className:"text-gray-400 hover:!bg-transparent hover:!text-gray-400 relative cursor-default pointer-events-none",children:[l.jsx(hl,{className:"size-4"}),"Delete",l.jsx(e4,{children:"⌘⌫"}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 backdrop-blur-[1px] rounded-lg pointer-events-auto",children:l.jsx(Oj,{message:"Upgrade to a PRO plan to delete trades"})})]})]})]})}const e2t=["default","sm","lg"],t2t=Rf("relative [--size-default:12px] [--size-lg:16px] [--size-sm:8px] after:absolute after:content-['']",{variants:{size:{default:"[--size:var(--size-default)]",sm:"[--size:var(--size-sm)]",lg:"[--size:var(--size-lg)]",dynamic:"[--size:var(--size)]"},position:{all:"after:[inset:calc(-1*var(--size))]",top:"after:[height:var(--size)] after:[left:0] after:[right:0] after:[top:calc(-1*var(--size))]",bottom:"after:[bottom:calc(-1*var(--size))] after:[height:var(--size)] after:[left:0] after:[right:0]",left:"after:[bottom:0] after:[left:calc(-1*var(--size))] after:[top:0] after:[width:var(--size)]",right:"after:[bottom:0] after:[right:calc(-1*var(--size))] after:[top:0] after:[width:var(--size)]",vertical:"after:[bottom:calc(-1*var(--size))] after:[left:0] after:[right:0] after:[top:calc(-1*var(--size))]",horizontal:"after:[bottom:0] after:[left:calc(-1*var(--size))] after:[right:calc(-1*var(--size))] after:[top:0]"},radius:{none:"",sm:"after:rounded-sm",md:"after:rounded-md",lg:"after:rounded-lg",full:"after:rounded-full"},debug:{true:"after:border after:border-red-500 after:border-dashed after:bg-red-500/20",false:""}},defaultVariants:{size:"default",position:"all",radius:"none",debug:!1}});function Uie(t){const{className:e,style:r,size:n,position:i,radius:s,debug:a=!1,...o}=t,c=n&&!e2t.includes(n);return l.jsx(Cw,{...o,className:ee(t2t({size:c?"dynamic":n,position:i,radius:s,debug:a}),e),style:{...r,...c&&{"--size":n}}})}const r2t=({notes:t})=>{if(!t||t.trim()==="")return l.jsxs("div",{className:"min-w-28 lg:min-w-[60px] text-app-primary-foreground/70 flex items-center gap-1 shrink-0 text-nowrap",children:[l.jsx(j2,{className:"size-3.5"}),l.jsx("span",{className:"text-xs",children:"No notes"})]});const e=t.length>8?`${t.substring(0,8)}...`:t;return l.jsx("div",{className:"min-w-28 lg:min-w-[60px] shrink-0 text-nowrap",children:l.jsxs(ui,{children:[l.jsxs(di,{className:"flex items-center gap-1 cursor-pointer",children:[l.jsx(j2,{className:"size-3.5 text-app-primary-foreground/70"}),l.jsx("span",{className:"text-xs",children:e})]}),l.jsx(fi,{side:"top",className:"max-w-xs",children:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(j2,{className:"size-3 text-app-primary-foreground/70"}),l.jsx("p",{className:"text-xs uppercase font-medium text-app-primary-foreground/70",children:"Notes"})]}),l.jsx("p",{className:"text-app-primary-foreground/80 whitespace-pre-wrap text-pretty",children:t})]})})]})})},n2t=({tags:t})=>{if(t.length===0)return l.jsxs("div",{className:"min-w-28 lg:min-w-[60px] text-app-primary-foreground
4658/70 flex items-center gap-1 shrink-0 text-nowrap",children:[l.jsx(P2,{className:"size-3.5"}),l.jsx("span",{className:"text-xs",children:"No tags"})]});const e=t.slice(0,2),r=t.length-2,n=l.jsxs("div",{className:"flex items-center flex-wrap gap-1",children:[l.jsx(P2,{className:"size-3.5 text-app-primary-foreground/70"}),e.map(s=>l.jsx(nc,{variant:"outline",className:"p-0.5 px-1 text-[11px]",style:{backgroundColor:s.tag.background_color,color:s.tag.text_color,borderColor:s.tag.text_color},children:s.tag.name},s.id)),r>0&&l.jsxs(nc,{variant:"outline",className:"text-xs text-app-primary-foreground/70 p-0 font-light border-none",children:["+",r]})]}),i=t.length>=3;return l.jsx("div",{className:"min-w-28 lg:min-w-[60px] shrink-0 text-nowrap",children:i?l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:l.jsx("div",{className:"cursor-pointer",children:n})}),l.jsx(fi,{side:"top",className:"max-w-xs",children:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(P2,{className:"size-3 text-app-primary-foreground/70"}),l.jsx("p",{className:"text-xs uppercase font-medium text-app-primary-foreground/70",children:"Tags"})]}),l.jsx("div",{className:"flex items-center flex-wrap gap-1",children:t.map(s=>l.jsx(nc,{variant:"outline",className:"p-0.5 px-1 text-[11px]",style:{backgroundColor:s.tag.background_color,color:s.tag.text_color,borderColor:s.tag.text_color},children:s.tag.name},s.id))})]})})]}):n})},i2t=({canSortColumns:t=!1,setRowsAction:e})=>[{id:"select",header:({table:r})=>l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx(Uie,{children:l.jsx(vc,{"data-prevent-row-click":!0,checked:r.getIsAllPageRowsSelected()||r.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:n=>r.toggleAllPageRowsSelected(!!n),"aria-label":"Select all",className:"mx-3"})})}),cell:({row:r})=>l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:l.jsx(Uie,{children:l.jsx(vc,{"data-prevent-row-click":!0,checked:r.getIsSelected(),onCheckedChange:n=>r.toggleSelected(!!n),"aria-label":"Select row"})})}),enableSorting:!1,enableHiding:!1},{accessorKey:"entry_date",header:({column:r})=>l.jsx(Vc,{column:r,title:"Date"}),cell:({row:r})=>l.jsx("div",{className:"min-w-[200px] text-nowrap",children:tp(r.getValue("entry_date"),"withPeriod")}),enableSorting:t,size:200},{accessorKey:"symbol",header:({column:r})=>l.jsx(Vc,{column:r,title:"Symbol"}),cell:({row:r})=>{const n=r.original;return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(nc,{variant:"outline",className:"bg-app-button-bg p-1.5 px-2.5 font-normal rounded-xl border-none",children:n.symbol}),n.status==="OPEN"&&l.jsx(nc,{variant:"outline",className:"bg-blue-500/10 text-blue-500 border-blue-500/20 p-1.5 px-2.5 font-normal rounded-xl border-none",children:"OPEN"})]})},enableSorting:t},{accessorKey:"position_type",header:({column:r})=>l.jsx(Vc,{column:r,title:"Type"}),cell:({row:r})=>{const n=r.getValue("position_type");return l.jsx(nc,{className:Pe("border-none p-1.5 px-2.5 font-normal rounded-xl",n==="LONG"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"),children:n})},enableSorting:t},{accessorKey:"entry_price",header:({column:r})=>l.jsx(Vc,{column:r,title:"Entry Price"}),cell:({row:r})=>{const n=r.getValue("entry_price");return l.jsx("div",{className:"w-[80px] 2k:text-xl",children:n||l.jsx("span",{className:"text-gray-400",children:"$0.00"})})},enableSorting:t},{accessorKey:"exit_price",header:({column:r})=>l.jsx(Vc,{column:r,title:"Exit Price"}),cell:({row:r})=>{const n=r.getValue("exit_price");return l.jsx("div",{className:"w-[80px] 2k:text-xl",children:n||l.jsx("span",{className:"text-gray-400",children:"$0.00"})})},enableSorting:t},{accessorKey:"pnl",header:({column:r})=>l.jsx(Vc,{column:r,title:"Gross PnL"}),cell:({row:r})=>{const n=r.getValue("pnl");return l.jsxs("div",{className:Pe("w-[100px] min-w-fit flex items-center gap-1.5 rounded-xl p-1 px-2 [&>svg]:shrink-0",n>qn?"bg-green-500/10 text-green-400":n<-qn?"bg-red-500/10 text-red-400":"bg-gray-500/10 text-gray-400"),children:[n>qn?l.jsx(eT,{className:"size-3"}):n<-qn?l.jsx(Jk,{className:"size-3"}):l.jsx(ju,{className:"size-3"}),Ke(n)]})},enableSorting:t},{accessorKey:"net_pnl",header:({column:r})=>l.jsx(Vc,{column:r,title:"Net PnL"}),cell:({row:r})=>{const n=r.getValue("net_pnl");return l.jsxs("div",{className:Pe("w-[100px] min-w-fit flex items-center gap-1.5 rounded-xl p-1 px-2 [&>svg]:shrink-0",n>qn?"bg-green-500/10 text-green-400":n<-qn?"bg-red-500/10 text-red-400":"bg-gray-500/10 text-gray-400"),children:[n>qn?l.jsx(eT,{className:"size-3"}):n<-qn?l.jsx(Jk,{className:"size-3"}):l.jsx(ju,{className:"size-3"}),Ke(n)]})},enableSorting:t},{accessorKey:"commissions_fees",header:({column:r})=>l.jsx(Vc,{column:r,title:"Comm/Fees"}),cell:({row:r})=>{const n=r.getValue("commissions_fees");return l.jsx("div",{className:"w-[80px] text-gray-400 2k:text-xl",children:n!=null?Ke(n):"0.00"})},enableSorting:t},{accessorKey:"risk",header:({column:r})=>l.jsx(Vc,{column:r,title:"Risk"}),cell:({row:r})=>{const n=r.getValue("risk");return l.jsx("div",{className:"w-[80px] text-gray-400 2k:text-xl",children:n!=null?Ke(n):"0.00"})},enableSorting:t},{accessorKey:"trade_tags",header:"Tags",cell:({row:r})=>{const n=r.getValue("trade_tags");return l.jsx(n2t,{tags:n})},enableSorting:!1},{accessorKey:"notes",header:"Notes",cell:({row:r})=>{const n=r.getValue("notes");return l.jsx(r2t,{notes:n})},enableSorting:!1},{id:"actions",cell:({row:r})=>{const n=r.original.id;return l.jsxs("div",{className:"min-w-[40px] flex items-center justify-start",children:[l.jsx(At,{"data-prevent-row-click":!0,to:`/app/trades/${n}`,target:"_blank",rel:"noopener noreferrer",className:"p-2 hover:bg-app-button-bg rounded-lg flex items-center gap-2 text-app-primary-foreground
4658/70 hover:text-app-primary-foreground",children:l.jsx(Cs,{className:"size-3.5"})}),l.jsx(JMt,{rows:[r],setRowsAction:e,canPerformDeleteAction:t})]})},enableSorting:!1,enableHiding:!1}];function s2t(t,e=!0){const{data:r,loading:n}=ws(oYe,{variables:{totalWhere:t.totalWhere,profitableWhere:t.profitableWhere,losingWhere:t.losingWhere,scratchWhere:t.scratchWhere},skip:!e,fetchPolicy:"cache-first"}),i=r?.trade_aggregate?.aggregate,s=r?.profitable_trades?.aggregate,a=r?.losing_trades?.aggregate,o=i?.count??0,c=s?.count??0,u=a?.count??0,d=i?.sum?.pnl??0,f=o>0?c/o*100:0;return{totalPnL:d,winningTrades:c,losingTrades:u,winRate:f,loading:n}}function h1e(t,e,r){const n=[{user_id:{_eq:t}},{is_active:{_eq:!0}},{deleted_at:{_is_null:!0}},{entry_date:{_gte:Mu(r.start)}},{entry_date:{_lte:Mu(r.end,!0)}}];return e.symbol?.trim()&&n.push({symbol:{_ilike:`%${e.symbol.trim()}%`}}),e.positionType?.trim()&&n.push({position_type:{_eq:e.positionType}}),Array.isArray(e.tags)&&e.tags.length>0&&n.push({trade_tags:{tag:{name:{_in:e.tags}}}}),e.minPnL!==void 0&&e.minPnL!==null&&n.push({pnl:{_gte:e.minPnL}}),e.maxPnL!==void 0&&e.maxPnL!==null&&n.push({pnl:{_lte:e.maxPnL}}),{_and:n}}function a2t(t,e,r){return b.useMemo(()=>{const n=h1e(t,e,r),i=n,s={_and:[...n._and,{pnl:{_gt:qn}}]},a={_and:[...n._and,{pnl:{_lt:-qn}}]},o={_and:[...n._and,{pnl:{_eq:0}}]};return{totalWhere:i,profitableWhere:s,losingWhere:a,scratchWhere:o}},[t,e,r])}const o2t=({userId:t,filters:e,dateRange:r})=>{const n=a2t(t,e,r),{totalPnL:i,winningTrades:s,losingTrades:a,winRate:o}=s2t(n);return l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[l.jsx(qd,{title:"Total P&L",value:Ke(i),icon:Yc,variant:i>0?"success":i<0?"danger":"neutral"}),l.jsx(qd,{title:"Win Rate",value:`${o.toFixed(2)}%`,icon:_s,variant:o>0?"success":"warning"}),l.jsx(qd,{title:"Winning Trades",value:s,icon:J8,variant:"success"}),l.jsx(qd,{title:"Losing Trades",value:a,icon:J8,variant:"danger"})]})};var Gie=1,l2t=.9,c2t=.8,u2t=.17,LL=.1,$L=.999,d2t=.9999,f2t=.99,h2t=/[\\\/_+.#"@\[\(\{&]/,p2t=/[\\\/_+.#"@\[\(\{&]/g,m2t=/[\s-]/,p1e=/[\s-]/g;function n4(t,e,r,n,i,s,a){if(s===e.length)return i===t.length?Gie:f2t;var o=`${i},${s}`;if(a[o]!==void 0)return a[o];for(var c=n.charAt(s),u=r.indexOf(c,i),d=0,f,h,m,y;u>=0;)f=n4(t,e,r,n,u+1,s+1,a),f>d&&(u===i?f*=Gie:h2t.test(t.charAt(u-1))?(f*=c2t,m=t.slice(i,u-1).match(p2t),m&&i>0&&(f*=Math.pow($L,m.length))):m2t.test(t.charAt(u-1))?(f*=l2t,y=t.slice(i,u-1).match(p1e),y&&i>0&&(f*=Math.pow($L,y.length))):(f*=u2t,i>0&&(f*=Math.pow($L,u-i))),t.charAt(u)!==e.charAt(s)&&(f*=d2t)),(f<LL&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(h=n4(t,e,r,n,u+1,s+2,a),h*LL>f&&(f=h*LL)),f>d&&(d=f),u=r.indexOf(c,u+1);return a[o]=d,d}function Wie(t){return t.toLowerCase().replace(p1e," ")}function g2t(t,e,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,n4(t,e,Wie(t),Wie(e),0,0,{})}var Gv='[cmdk-group=""]',FL='[cmdk-group-items=""]',y2t='[cmdk-group-heading=""]',m1e='[cmdk-item=""]',Hie=`${m1e}:not([aria-disabled="true"])`,i4="cmdk-item-select",Km="data-value",v2t=(t,e,r)=>g2t(t,e,r),g1e=b.createContext(void 0),k1=()=>b.useContext(g1e),y1e=b.createContext(void 0),F6=()=>b.useContext(y1e),v1e=b.createContext(void 0),x1e=b.forwardRef((t,e)=>{let r=Qm(()=>{var H,Y;return{search:"",value:(Y=(H=t.value)!=null?H:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Qm(()=>new Set),i=Qm(()=>new Map),s=Qm(()=>new Map),a=Qm(()=>new Set),o=b1e(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:y,disablePointerSelection:x=!1,vimBindings:v=!0,..._}=t,S=ts(),k=ts(),E=ts(),T=b.useRef(null),N=N2t();Vp(()=>{if(d!==void 0){let H=d.trim();r.current.value=H,j.emit()}},[d]),Vp(()=>{N(6,F)},[]);let j=b.useMemo(()=>({subscribe:H=>(a.current.add(H),()=>a.current.delete(H)),snapshot:()=>r.current,setState:(H,Y,J)=>{var re,me,oe,ge;if(!Object.is(r.current[H],Y)){if(r.current[H]=Y,H==="search")B(),R(),N(1,I);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(E);
vendor: 8,860 bytes, line 4658
4658le?le.focus():(re=document.getElementById(S))==null||re.focus()}if(N(7,()=>{var le;r.current.selectedItemId=(le=V())==null?void 0:le.id,j.emit()}),J||N(5,F),((me=o.current)==null?void 0:me.value)!==void 0){let le=Y??"";(ge=(oe=o.current).onValueChange)==null||ge.call(oe,le);return}}j.emit()}},emit:()=>{a.current.forEach(H=>H())}}),[]),M=b.useMemo(()=>({value:(H,Y,J)=>{var re;Y!==((re=s.current.get(H))==null?void 0:re.value)&&(s.current.set(H,{value:Y,keywords:J}),r.current.filtered.items.set(H,O(Y,J)),N(2,()=>{R(),j.emit()}))},item:(H,Y)=>(n.current.add(H),Y&&(i.current.has(Y)?i.current.get(Y).add(H):i.current.set(Y,new Set([H]))),N(3,()=>{B(),R(),r.current.value||I(),j.emit()}),()=>{s.current.delete(H),n.current.delete(H),r.current.filtered.items.delete(H);let J=V();N(4,()=>{B(),J?.getAttribute("id")===H&&I(),j.emit()})}),group:H=>(i.current.has(H)||i.current.set(H,new Set),()=>{s.current.delete(H),i.current.delete(H)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:E,labelId:k,listInnerRef:T}),[]);function O(H,Y){var J,re;let me=(re=(J=o.current)==null?void 0:J.filter)!=null?re:v2t;return H?me(H,r.current.search,Y):0}function R(){if(!r.current.search||o.current.shouldFilter===!1)return;let H=r.current.filtered.items,Y=[];r.current.filtered.groups.forEach(re=>{let me=i.current.get(re),oe=0;me.forEach(ge=>{let le=H.get(ge);oe=Math.max(le,oe)}),Y.push([re,oe])});let J=T.current;$().sort((re,me)=>{var oe,ge;let le=re.getAttribute("id"),Se=me.getAttribute("id");return((oe=H.get(Se))!=null?oe:0)-((ge=H.get(le))!=null?ge:0)}).forEach(re=>{let me=re.closest(FL);me?me.appendChild(re.parentElement===me?re:re.closest(`${FL} > *`)):J.appendChild(re.parentElement===J?re:re.closest(`${FL} > *`))}),Y.sort((re,me)=>me[1]-re[1]).forEach(re=>{var me;let oe=(me=T.current)==null?void 0:me.querySelector(`${Gv}[${Km}="${encodeURIComponent(re[0])}"]`);oe?.parentElement.appendChild(oe)})}function I(){let H=$().find(J=>J.getAttribute("aria-disabled")!=="true"),Y=H?.getAttribute(Km);j.setState("value",Y||void 0)}function B(){var H,Y,J,re;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let me=0;for(let oe of n.current){let ge=(Y=(H=s.current.get(oe))==null?void 0:H.value)!=null?Y:"",le=(re=(J=s.current.get(oe))==null?void 0:J.keywords)!=null?re:[],Se=O(ge,le);r.current.filtered.items.set(oe,Se),Se>0&&me++}for(let[oe,ge]of i.current)for(let le of ge)if(r.current.filtered.items.get(le)>0){r.current.filtered.groups.add(oe);break}r.current.filtered.count=me}function F(){var H,Y,J;let re=V();re&&(((H=re.parentElement)==null?void 0:H.firstChild)===re&&((J=(Y=re.closest(Gv))==null?void 0:Y.querySelector(y2t))==null||J.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function V(){var H;return(H=T.current)==null?void 0:H.querySelector(`${m1e}[aria-selected="true"]`)}function $(){var H;return Array.from(((H=T.current)==null?void 0:H.querySelectorAll(Hie))||[])}function U(H){let Y=$()[H];Y&&j.setState("value",Y.getAttribute(Km))}function z(H){var Y;let J=V(),re=$(),me=re.findIndex(ge=>ge===J),oe=re[me+H];(Y=o.current)!=null&&Y.loop&&(oe=me+H<0?re[re.length-1]:me+H===re.length?re[0]:re[me+H]),oe&&j.setState("value",oe.getAttribute(Km))}function L(H){let Y=V(),J=Y?.closest(Gv),re;for(;J&&!re;)J=H>0?E2t(J,Gv):j2t(J,Gv),re=J?.querySelector(Hie);re?j.setState("value",re.getAttribute(Km)):z(H)}let W=()=>U($().length-1),K=H=>{H.preventDefault(),H.metaKey?W():H.altKey?L(1):z(1)},q=H=>{H.preventDefault(),H.metaKey?U(0):H.altKey?L(-1):z(-1)};return b.createElement(vt.div,{ref:e,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:H=>{var Y;(Y=_.onKeyDown)==null||Y.call(_,H);let J=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||J))switch(H.key){case"n":case"j":{v&&H.ctrlKey&&K(H);break}case"ArrowDown":{K(H);break}case"p":case"k":{v&&H.ctrlKey&&q(H);break}case"ArrowUp":{q(H);break}case"Home":{H.preventDefault(),U(0);break}case"End":{H.preventDefault(),W();break}case"Enter":{H.preventDefault();let re=V();if(re){let me=new Event(i4);re.dispatchEvent(me)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:M2t},c),pP(t,H=>b.createElement(y1e.Provider,{value:j},b.createElement(g1e.Provider,{value:M},H))))}),x2t=b.forwardRef((t,e)=>{var r,n;let i=ts(),s=b.useRef(null),a=b.useContext(v1e),o=k1(),c=b1e(t),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:a?.forceMount;Vp(()=>{if(!u)return o.item(i,a?.id)},[u]);let d=w1e(i,s,[t.value,t.children,s],t.keywords),f=F6(),h=Mf(N=>N.value&&N.value===d.current),m=Mf(N=>u||o.filter()===!1?!0:N.search?N.filtered.items.get(i)>0:!0);b.useEffect(()=>{let N=s.current;if(!(!N||t.disabled))return N.addEventListener(i4,y),()=>N.removeEventListener(i4,y)},[m,t.onSelect,t.disabled]);function y(){var N,j;x(),(j=(N=c.current).onSelect)==null||j.call(N,d.current)}function x(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:_,onSelect:S,forceMount:k,keywords:E,...T}=t;return b.createElement(vt.div,{ref:Nu(s,e),...T,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||o.getDisablePointerSelection()?void 0:x,onClick:v?void 0:y},t.children)}),b2t=b.forwardRef((t,e)=>{let{heading:r,children:n,forceMount:i,...s}=t,a=ts(),o=b.useRef(null),c=b.useRef(null),u=ts(),d=k1(),f=Mf(m=>i||d.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Vp(()=>d.group(a),[]),w1e(a,o,[t.value,t.heading,c]);let h=b.useMemo(()=>({id:a,forceMount:i}),[i]);return b.createElement(vt.div,{ref:Nu(o,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),pP(t,m=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},b.createElement(v1e.Provider,{value:h},m))))}),w2t=b.forwardRef((t,e)=>{let{alwaysRender:r,...n}=t,i=b.useRef(null),s=Mf(a=>!a.search);return!r&&!s?null:b.createElement(vt.div,{ref:Nu(i,e),...n,"cmdk-separator":"",role:"separator"})}),_2t=b.forwardRef((t,e)=>{let{onValueChange:r,...n}=t,i=t.value!=null,s=F6(),a=Mf(u=>u.search),o=Mf(u=>u.selectedItemId),c=k1();return b.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),b.createElement(vt.input,{ref:e,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:i?t.value:a,onChange:u=>{i||s.setState("search",u.target.value),r?.(u.target.value)}})}),S2t=b.forwardRef((t,e)=>{let{children:r,label:n="Suggestions",...i}=t,s=b.useRef(null),a=b.useRef(null),o=Mf(u=>u.selectedItemId),c=k1();return b.useEffect(()=>{if(a.current&&s.current){let u=a.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),b.createElement(vt.div,{ref:Nu(s,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:c.listId},pP(t,u=>b.createElement("div",{ref:Nu(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),k2t=b.forwardRef((t,e)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:s,container:a,...o}=t;return b.createElement(gj,{open:r,onOpenChange:n},b.createElement(yj,{container:a},b.createElement(vj,{"cmdk-overlay":"",className:i}),b.createElement(xj,{"aria-label":t.label,"cmdk-dialog":"",className:s},b.createElement(x1e,{ref:e,...o}))))}),T2t=b.forwardRef((t,e)=>Mf(r=>r.filtered.count===0)?b.createElement(vt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),C2t=b.forwardRef((t,e)=>{let{progress:r,children:n,label:i="Loading...",...s}=t;return b.createElement(vt.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},pP(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),im=Object.assign(x1e,{List:S2t,Item:x2t,Input:_2t,Group:b2t,Separator:w2t,Dialog:k2t,Empty:T2t,Loading:C2t});function E2t(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return r;r=r.nextElementSibling}}function j2t(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return r;r=r.previousElementSibling}}function b1e(t){let e=b.useRef(t);return Vp(()=>{e.current=t}),e}var Vp=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Qm(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function Mf(t){let e=F6(),r=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,r,r)}function w1e(t,e,r,n=[]){let i=b.useRef(),s=k1();return Vp(()=>{var a;let o=(()=>{var u;
4658for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():i.current}})(),c=n.map(u=>u.trim());s.value(t,o,c),(a=e.current)==null||a.setAttribute(Km,o),i.current=o}),i}var N2t=()=>{let[t,e]=b.useState(),r=Qm(()=>new Map);return Vp(()=>{r.current.forEach(n=>n()),r.current=new Map},[t]),(n,i)=>{r.current.set(n,i),e({})}};function P2t(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function pP({asChild:t,children:e},r){return t&&b.isValidElement(e)?b.cloneElement(P2t(e),{ref:e.ref},r(e.props.children)):r(e)}var M2t={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function A2t({className:t,...e}){return l.jsx(im,{"data-slot":"command",className:ee("bg-app-card/50 text-app-primary-foreground flex size-full flex-col overflow-hidden rounded-xl",t),...e})}function D2t({className:t,...e}){return l.jsxs("div",{className:"border-app-border-color-soft flex items-center border-b px-5","cmdk-input-wrapper":"",children:[l.jsx(cMe,{className:"text-app-primary-foreground/80 me-3 size-4"}),l.jsx(im.Input,{"data-slot":"command-input-wrapper",className:ee("placeholder:text-app-primary-foreground/70 flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...e})]})}function O2t({className:t,...e}){return l.jsx(im.List,{"data-slot":"command-list",className:ee("max-h-80 flex-1 overflow-x-hidden overflow-y-auto",t),...e})}function R2t({...t}){return l.jsx(im.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function qie({className:t,...e}){return l.jsx(im.Group,{"data-slot":"command-group",className:ee("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function I2t({className:t,...e}){return l.jsx(im.Separator,{"data-slot":"command-separator",className:ee("bg-border -mx-1 h-px",t),...e})}function Yie({className:t,...e}){return l.jsx(im.Item,{"data-slot":"command-item",className:ee("data-[selected=true]:hover:bg-app-button-bg data-[selected=true]:text-app-primary-foreground relative flex items-center gap-3 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 focus:bg-app-button-bg focus:text-app-primary-foreground cursor-pointer",t),...e})}const L2t=({title:t,options:e,multiple:r,clearAllButton:n,values:i,onChange:s,className:a})=>{const[o,c]=b.useState(!1),u=b.useMemo(()=>new Set(Array.isArray(i)?i:[]),[i]),d=b.useCallback((h,m)=>{if(i)if(r){const y=new Set(u);m?y.delete(h.value):y.add(h.value);const x=Array.from(y);s(x.length?x:void 0)}else s(m?void 0:[h.value]),c(!1)},[i,r,u,s]),f=b.useCallback(h=>{h?.stopPropagation(),s(void 0)},[s]);return l.jsxs(Bf,{open:o,onOpenChange:c,children:[l.jsx(Vf,{asChild:!0,children:l.jsxs(ye,{variant:"outline",size:"sm",className:ee("border-dashed",a),children:[u?.size>0&&l.jsx("div",{role:"button","aria-label":`Clear ${t} filter`,tabIndex:0,onClick:f,className:"rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:l.jsx(Tw,{})}),u?.size===0&&l.jsx("span",{className:"text-app-primary-foreground/70",children:t}),u?.size>0&&l.jsxs(l.Fragment,{children:[l.jsx(tc,{orientation:"vertical",className:"mx-0.5 data-[orientation=vertical]:h-4"}),l.jsx(nc,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:u.size}),l.jsx("div",{className:"hidden items-center gap-1 lg:flex",children:u.size>2?l.jsxs(nc,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[u.size," ","selected"]}):e.filter(h=>u.has(h.value)).map(h=>l.jsx(nc,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:h.label},h.value))})]})]})}),l.jsx(Uf,{className:"w-[250px] p-0",align:"center",children:l.jsxs(A2t,{children:[l.jsx(D2t,{placeholder:t}),l.jsxs(O2t,{className:"max-h-full",children:[l.jsx(R2t,{children:"No results found."}),l.jsx(qie,{className:"max-h-[18.75rem] overflow-y-auto overflow-x-hidden",children:e.map(h=>{const m=u.has(h.value);return l.jsxs(Yie,{onSelect:()=>d(h,m),children:[h.icon&&l.jsx(h.icon,{}),l.jsx("span",{className:"truncate p-0.5 px-1.5 text-xs rounded-md",style:h.style,children:h.label}),h.count&&l.jsx("span",{className:"ml-auto font-mono text-xs",children:h.count}),l.jsx("div",{className:ee("flex size-4 items-center justify-center ml-auto",m?"bg-primary":"opacity-50 [&_svg]:invisible"),children:l.jsx(ei,{className:"size-4 text-app-primary-foreground"})})]},h.value)})}),u.size>0&&n&&l.jsxs(l.Fragment,{children:[l.jsx(I2t,{}),l.jsx(qie,{children:l.jsx(Yie,{onSelect:()=>f(),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})},zL=({label:t,...e})=>l.jsxs("div",{className:"flex flex-col items-start justify-center",...e,children:[t&&l.jsx("p",{className:"uppercase text-xs tracking-wider text-app-primary-foreground
4658/70 mb-2 2k:text-2xl 2k:mb-4",children:t}),e.children]}),$2t=({userId:t,filters:e,onFilterChange:r})=>{const{data:n}=S6(t),i=b.useMemo(()=>(n?.tag??[]).map(c=>({value:c.name,label:c.name,style:{backgroundColor:c.backgroundColor,color:c.textColor}})),[n]),s=()=>{r("symbol",""),r("positionType",""),r("tags",[]),r("minPnL",null),r("maxPnL",null)},a=Object.values(e).some(c=>c!=null&&c!==""&&!(Array.isArray(c)&&c.length===0)),o="data-[empty=true]:text-app-primary-foreground/50 min-w-fit w-fit sm:w-[250px] justify-start text-left font-normal data-[state=open]:border-app-border-color-accent hover:border-app-border-color-accent data-[state=open]:ring-3 focus-visible:ring-3 transition-all duration-200 focus-visible:ring-app-border-color-accent/40 data-[state=open]:ring-app-border-color-accent/40 bg-app-input-bg/50 !h-9 border-dashed placeholder:font-normal text-sm placeholder:text-app-primary-foreground/70 rounded-xl";return l.jsxs("div",{className:"flex flex-row flex-wrap gap-4 items-end justify-start",children:[l.jsx(zL,{label:"Symbol",children:l.jsx(Wr,{name:"symbol",placeholder:"Search symbol...",value:e.symbol||"",onChange:c=>r("symbol",c.target.value),className:o,autoComplete:"off"})}),l.jsx(zL,{label:"Position Type",children:l.jsxs(vu,{name:"positionType",value:e.positionType||"",onValueChange:c=>r("positionType",c),children:[l.jsx(bu,{className:ee(o,"justify-between"),children:l.jsx(xu,{placeholder:"Select type..."})}),l.jsxs(wu,{children:[l.jsx(lc,{value:"LONG",children:"Long"}),l.jsx(lc,{value:"SHORT",children:"Short"})]})]})}),l.jsx(zL,{label:"Tags",children:l.jsx(L2t,{options:Array.isArray(i)?i:[],values:e.tags||[],onChange:c=>r("tags",c),multiple:!0,className:o,title:"Select tags..."})}),a&&l.jsxs(ye,{variant:"ghost",onClick:s,className:"group !no-underline",children:[l.jsx(pi,{}),l.jsx("span",{className:"text-app-primary-foreground/70 group-hover:text-app-primary-foreground group-hover:translate-x-0.5 transition-all duration-200 opacity-0 group-hover:opacity-100",children:"Reset"})]})]})},F2t=li({id:Mr(),desc:wF()}),_1e=t=>{const e=t?t instanceof Set?t:new Set(t):null;return zo({parse:r=>{try{const n=JSON.parse(r),i=Uw(F2t).safeParse(n);return!i.success||e&&i.data.some(s=>!e.has(s.id))?null:i.data}catch{return null}},serialize:r=>JSON.stringify(r),eq:(r,n)=>r.length===n.length&&r.every((i,s)=>i.id===n[s]?.id&&i.desc===n[s]?.desc)})},z2t={page:Zg.withDefault(1),perPage:Zg.withDefault(15),sortBy:_1e().withDefault([{id:"entry_date",desc:!0}])},B2t=MYe(z2t);function V2t(t){const{columns:e,initialState:r,defaultPage:n=1,defaultPageSize:i=15,...s}=t,a=b.useMemo(()=>new Set(e.map(T=>T.id).filter(Boolean)),[e]),[o,c]=b.useState(r?.rowSelection??{}),[u,d]=b.useState(r?.columnVisibility??{}),[f,h]=ys("sortBy",_1e(a).withOptions({shallow:!1}).withDefault(r?.sorting??[])),m=b.useCallback(T=>{if(typeof T=="function"){const N=T(f);h(N)}else h(T)},[f,h]),[y,x]=ys("page",Zg.withDefault(n).withOptions({shallow:!1})),[v,_]=ys("perPage",Zg.withDefault(i).withOptions({shallow:!1})),S=b.useMemo(()=>({pageIndex:Math.max(0,y-1),pageSize:v}),[y,v]),k=b.useCallback(T=>{const N=typeof T=="function"?T(S):T;x(N.pageIndex+1),_(N.pageSize)},[S,x,_]);return WNt({...s,columns:e,state:{sorting:f,columnVisibility:u,rowSelection:o,pagination:S},defaultColumn:{...s.defaultColumn,enableColumnFilter:!1},enableRowSelection:!0,onRowSelectionChange:c,onSortingChange:m,onColumnVisibilityChange:d,onPaginationChange:k,getCoreRowModel:$Nt(),getPaginationRowModel:zNt(),getSortedRowModel:BNt(),manualPagination:!0,manualSorting:!0,manualFiltering:!0})}function U2t(t,e,r){if(r<=0)return;const{pageIndex:n,pageSize:i}=t.getState().pagination,s=Math.max(0,e-r),a=Math.max(0,Math.ceil(s/i)-1);n>a&&t.setPageIndex(a)}const G2t=t=>{const{dateRange:e}=s0({onChange:t}),[r,n]=ys("symbol",lK.withDefault("")),[i,s]=ys("pos",df(["LONG","SHORT",""]).withDefault("")),[a,o]=ys("min",cK.withDefault(void 0)),[c,u]=ys("max",cK.withDefault(void 0)),[d,f]=ys("tags",Ghe(lK).withDefault([])),h=b.useCallback((y,x)=>{switch(y){case"symbol":n(x);break;case"positionType":s(x);break;case"minPnL":o(x);break;case"maxPnL":u(x);break;case"tags":f(Array.isArray(x)?x:[]);break;default:return}t?.()},[n,s,o,u,f,t]);
4658return{dateRange:e,filters:{symbol:r,positionType:i,minPnL:a,maxPnL:c,tags:d},handleFilterChange:h}},W2t=({userId:t,filters:e,dateRange:r,sortConfig:n,page:i,pageSize:s=15})=>{const{data:a,loading:o,error:c,previousData:u,networkStatus:d}=ws($he,t?{variables:{where:h1e(t,e,r),orderBy:n,limit:s,offset:(i-1)*s},notifyOnNetworkStatusChange:!0,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}:_w),h=!(a?.trade?.length!==void 0&&a?.trade_aggregate?.aggregate?.count!==void 0)&&u?u:a??u,m=h?.trade??[],y=h?.trade_aggregate?.aggregate?.count??0,x=m.length>0||y>0,v=o&&!x,_=o&&x||d===$t.setVariables||d===$t.refetch||d===$t.fetchMore;return{trades:m,totalTrades:y,isLoading:v,isFetching:_,error:c}},H2t=t=>{t(e=>{if(e.get("page")==="1")return e;const r=new URLSearchParams(e);return r.set("page","1"),r})},q2t=()=>{const[t,e]=aoe(),{userHasura:r}=Gt(),n=Ws(),i=B2t(t),s=r?.id,{isFreePlan:a}=f1e(),o=b.useCallback(()=>{H2t(e)},[e]),{filters:c,dateRange:u,handleFilterChange:d}=G2t(o),{trades:f,totalTrades:h,isLoading:m,isFetching:y}=W2t({userId:s,filters:c,dateRange:{start:u.from.toISOString(),end:u.to.toISOString()},sortConfig:i.sortBy.reduce((T,N)=>({...T,[N.id]:N.desc?"desc":"asc"}),{}),page:i.page,pageSize:i.perPage}),[x,v]=b.useState(null),_=b.useMemo(()=>i2t({canSortColumns:!a,setRowsAction:v}),[a,v]),S=b.useMemo(()=>Math.max(1,Math.ceil(h/i.perPage)),[h,i.perPage]),k=b.useCallback(T=>{n(`/app/trades/${T.id}`)},[n]),E=V2t({columns:_,data:f,pageCount:S,getRowId:T=>T.id,initialState:{sorting:[{id:"entry_date",desc:!0}]},meta:{onRowClick:k}});return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-6 pt-4 pb-8",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-2 sm:gap-0",children:[l.jsx("h1",{className:"text-3xl font-bold 2k:text-5xl",children:"Trades"}),l.jsxs("p",{className:"text-gray-400 2k:text-xl",children:["Showing"," ",h," ","trades"]})]}),l.jsx("div",{className:"flex flex-col sm:flex-row flex-wrap items-start justify-between gap-4",children:l.jsx($2t,{userId:s,filters:c,onFilterChange:d})}),l.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end w-full gap-4",children:[l.jsx(Vj,{label:"Time presets"}),l.jsx(vN,{label:"Analysis Period",className:"lg:ml-auto"}),l.jsx(vMt,{table:E})]}),l.jsx(o2t,{userId:s||"",filters:c,dateRange:{start:u.from.toISOString(),end:u.to.toISOString()}}),l.jsx(ZNt,{table:E,isLoading:m,isFetching:y,emptyState:l.jsx(sPt,{}),actionToolbar:l.jsx(XMt,{table:E,setRowsAction:v,totalCount:h})})]}),l.jsx(QMt,{open:x?.variant==="delete",onOpenChange:()=>v(null),trades:x?.rows.map(T=>T.original)||[],table:E,showTrigger:!1,onSuccess:T=>{U2t(E,h,T),E.resetRowSelection()}})]})};function mP(){return(mP=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function S1e(t,e){if(t==null)return{};var r,n,i={},s=Object.keys(t);for(n=0;n<s.length;n++)e.indexOf(r=s[n])>=0||(i[r]=t[r]);return i}function s4(t){var e=b.useRef(t),r=b.useRef(function(n){e.current&&e.current(n)});return e.current=t,r.current}var hw=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t<e?e:t},Ux=function(t){return"touches"in t},a4=function(t){return t&&t.ownerDocument.defaultView||self},Kie=function(t,e,r){var n=t.getBoundingClientRect(),i=Ux(e)?(function(s,a){for(var o=0;o<s.length;o++)if(s[o].identifier===a)return s[o];return s[0]})(e.touches,r):e;return{left:hw((i.pageX-(n.left+a4(t).pageXOffset))/n.width),top:hw((i.pageY-(n.top+a4(t).pageYOffset))/n.height)}},Qie=function(t){!Ux(t)&&t.preventDefault()},k1e=P.memo(function(t){var e=t.onMove,r=t.onKey,n=S1e(t,["onMove","onKey"]),i=b.useRef(null),s=s4(e),a=s4(r),o=b.useRef(null),c=b.useRef(!1),u=b.useMemo(function(){var m=function(v){Qie(v),(Ux(v)?v.touches.length>0:v.buttons>0)&&i.current?s(Kie(i.current,v,o.current)):x(!1)},y=function(){return x(!1)};function x(v){var _=c.current,S=a4(i.current),k=v?S.addEventListener:S.removeEventListener;
vendor: 4,279 bytes, line 4658
4658k(_?"touchmove":"mousemove",m),k(_?"touchend":"mouseup",y)}return[function(v){var _=v.nativeEvent,S=i.current;if(S&&(Qie(_),!(function(E,T){return T&&!Ux(E)})(_,c.current)&&S)){if(Ux(_)){c.current=!0;var k=_.changedTouches||[];k.length&&(o.current=k[0].identifier)}S.focus(),s(Kie(S,_,o.current)),x(!0)}},function(v){var _=v.which||v.keyCode;_<37||_>40||(v.preventDefault(),a({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},x]},[a,s]),d=u[0],f=u[1],h=u[2];return b.useEffect(function(){return h},[h]),P.createElement("div",mP({},n,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:f,tabIndex:0,role:"slider"}))}),z6=function(t){return t.filter(Boolean).join(" ")},T1e=function(t){var e=t.color,r=t.left,n=t.top,i=n===void 0?.5:n,s=z6(["react-colorful__pointer",t.className]);return P.createElement("div",{className:s,style:{top:100*i+"%",left:100*r+"%"}},P.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Ji=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r},Y2t=function(t){return J2t(o4(t))},o4=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ji(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Ji(parseInt(t.substring(6,8),16)/255,2):1}},K2t=function(t){return X2t(Z2t(t))},Q2t=function(t){var e=t.s,r=t.v,n=t.a,i=(200-e)*r/100;return{h:Ji(t.h),s:Ji(i>0&&i<200?e*r/100/(i<=100?i:200-i)*100:0),l:Ji(i/2),a:Ji(n,2)}},l4=function(t){var e=Q2t(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Z2t=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var s=Math.floor(e),a=n*(1-r),o=n*(1-(e-s)*r),c=n*(1-(1-e+s)*r),u=s%6;return{r:Ji(255*[n,o,a,a,c,n][u]),g:Ji(255*[c,n,n,o,a,a][u]),b:Ji(255*[a,a,c,n,n,o][u]),a:Ji(i,2)}},JS=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},X2t=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=i<1?JS(Ji(255*i)):"";return"#"+JS(e)+JS(r)+JS(n)+s},J2t=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=Math.max(e,r,n),a=s-Math.min(e,r,n),o=a?s===e?(r-n)/a:s===r?2+(n-e)/a:4+(e-r)/a:0;return{h:Ji(60*(o<0?o+6:o)),s:Ji(s?a/s*100:0),v:Ji(s/255*100),a:i}},eAt=P.memo(function(t){var e=t.hue,r=t.onChange,n=z6(["react-colorful__hue",t.className]);return P.createElement("div",{className:n},P.createElement(k1e,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:hw(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ji(e),"aria-valuemax":"360","aria-valuemin":"0"},P.createElement(T1e,{className:"react-colorful__hue-pointer",left:e/360,color:l4({h:e,s:100,v:100,a:1})})))}),tAt=P.memo(function(t){var e=t.hsva,r=t.onChange,n={backgroundColor:l4({h:e.h,s:100,v:100,a:1})};return P.createElement("div",{className:"react-colorful__saturation",style:n},P.createElement(k1e,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:hw(e.s+100*i.left,0,100),v:hw(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ji(e.s)+"%, Brightness "+Ji(e.v)+"%"},P.createElement(T1e,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:l4(e)})))}),C1e=function(t,e){if(t===e)return!0;for(var r in t)if(t[r]!==e[r])return!1;return!0},rAt=function(t,e){return t.toLowerCase()===e.toLowerCase()||C1e(o4(t),o4(e))};function nAt(t,e,r){var n=s4(r),i=b.useState(function(){return t.toHsva(e)}),s=i[0],a=i[1],o=b.useRef({color:e,hsva:s});b.useEffect(function(){if(!t.equal(e,o.current.color)){var u=t.toHsva(e);o.current={hsva:u,color:e},a(u)}},[e,t]),b.useEffect(function(){var u;C1e(s,o.current.hsva)||t.equal(u=t.fromHsva(s),o.current.color)||(o.current={hsva:s,color:u},n(u))},[s,t,n]);var c=b.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[s,c]}var iAt=typeof window<"u"?b.useLayoutEffect:b.useEffect,sAt=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Zie=new Map,aAt=function(t){iAt(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!Zie.has(e)){var r=e.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;
4658width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Zie.set(e,r);var n=sAt();n&&r.setAttribute("nonce",n),e.head.appendChild(r)}},[])},oAt=function(t){var e=t.className,r=t.colorModel,n=t.color,i=n===void 0?r.defaultColor:n,s=t.onChange,a=S1e(t,["className","colorModel","color","onChange"]),o=b.useRef(null);aAt(o);var c=nAt(r,i,s),u=c[0],d=c[1],f=z6(["react-colorful",e]);return P.createElement("div",mP({},a,{ref:o,className:f}),P.createElement(tAt,{hsva:u,onChange:d}),P.createElement(eAt,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},lAt={defaultColor:"000",toHsva:Y2t,fromHsva:function(t){return K2t({h:t.h,s:t.s,v:t.v,a:1})},equal:rAt},Xie=function(t){return P.createElement(oAt,mP({},t,{colorModel:lAt}))};const Jie=(t,e,r)=>{const n=[t,e,r].map(i=>(i=i/255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return n[0]*.2126+n[1]*.7152+n[2]*.0722},cAt=(t,e)=>{const r=o=>{const c=o.match(/\w\w/g);return c?[Number.parseInt(c[0],16),Number.parseInt(c[1],16),Number.parseInt(c[2],16)]:[0,0,0]},n=Jie(...r(t)),i=Jie(...r(e)),s=Math.max(n,i),a=Math.min(n,i);
4658return(s+.05)/(a+.05)},uAt=(t,e)=>e?l.jsxs(l.Fragment,{children:[t==="edit"?"Saving...":"Creating...",l.jsx(No,{className:"size-3.5 ml-1 animate-spin"})]}):l.jsxs(l.Fragment,{children:[t==="edit"?"Save changes":"Create",l.jsx(ei,{className:"size-3.5 ml-1"})]}),dAt=({open:t,onClose:e,onSubmit:r,initialValues:n,existingTags:i=[],mode:s="create",isLoading:a})=>{const{register:o,handleSubmit:c,setValue:u,watch:d,formState:{errors:f,isSubmitting:h}}=$o({defaultValues:{name:"",textColor:"#000000",bgColor:"#e5e7eb"},values:{name:n?.name||"",textColor:n?.textColor||"#000000",bgColor:n?.bgColor||"#e5e7eb"}}),m=d(),y=k=>{const E=k.trim();return E?E.length>=30?"Max 30 characters":i.some(N=>N.name.toLowerCase()===E.toLowerCase())&&s==="create"?"Tag already exists":!0:"Name required"},x=async k=>{await r(k),e()},v=h||a,_=!m.name||!!f.name||v,S=()=>{v||e()};return l.jsxs(Zpe,{open:t,className:"relative z-10 focus:outline-hidden",onClose:S,children:[l.jsx(Qpe,{transition:!0,className:"fixed inset-0 bg-black/30 duration-300 ease-out data-closed:opacity-0"}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:l.jsxs(PV,{transition:!0,"aria-busy":v,className:"bg-app-card rounded-2xl p-6 max-w-[470px] w-full mx-auto border border-app-border-color-soft duration-300 ease-out data-closed:scale-95 data-closed:opacity-0",children:[l.jsx(MV,{className:"text-lg font-bold mb-1 2k:text-3xl",children:s==="edit"?"Edit Tag":"Create New Tag"}),l.jsx(kpe,{className:"mb-4 text-sm text-app-primary-foreground/80 2k:text-xl",children:"Set a name and colors for your tag. You can adjust them later."}),l.jsxs("form",{onSubmit:c(x),className:"flex flex-col gap-4",children:[l.jsx(tn,{label:"Tag name",error:f.name?.message,children:l.jsx(Wr,{...o("name",{validate:y,onChange:k=>{f.name&&u("name",k.target.value,{shouldValidate:!0})}}),maxLength:30,placeholder:"Enter tag name",autoFocus:!0,disabled:v})}),l.jsxs("div",{className:"flex flex-col md:flex-row md:gap-4 mt-2",children:[l.jsx(tn,{label:"Text color",children:l.jsx(Xie,{color:m.textColor,onChange:k=>u("textColor",k),className:"w-full h-24 rounded-sm border border-gray-700"})}),l.jsx(tn,{label:"Background",children:l.jsx(Xie,{color:m.bgColor,onChange:k=>u("bgColor",k),className:"w-full h-24 rounded-sm border border-gray-700"})})]}),l.jsxs("div",{className:"flex flex-row items-center justify-start gap-4 mt-2",children:[l.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-lg text-xs font-medium border border-gray-700 2k:text-xl h-8",style:{background:m.bgColor,color:m.textColor},children:m.name||"Tag preview"}),cAt(m.textColor,m.bgColor)<4.5&&l.jsxs("div",{className:"flex items-center gap-2 bg-orange-500/10 rounded-lg p-2 border border-orange-500/20 h-8",children:[l.jsx(Wu,{strokeWidth:1.5,className:"size-3.5 text-orange-400"}),l.jsx("p",{className:"text-xs text-orange-400 2k:text-lg",children:"Warning: low contrast"})]})]}),l.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[l.jsx(ye,{type:"button",variant:"outline",className:"2k:text-xl 2k:py-6",onClick:e,disabled:v,children:"Cancel"}),l.jsx(ye,{type:"submit",className:"2k:text-xl 2k:py-6",disabled:_,children:uAt(s,v)})]})]})]})})]})},fAt=({isOpen:t,onClose:e,onConfirm:r,tags:n,tagsToDelete:i,isDeleting:s})=>{const a=n.filter(o=>i.includes(o.id));return l.jsx(Pj,{open:t,onOpenChange:e,children:l.jsxs(Xw,{className:"max-w-md 2k:max-w-2xl text-app-primary-foreground/90",children:[l.jsx(Mj,{children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-2",children:l.jsx(hl,{className:"size-4 text-red-400"})}),l.jsx(Jw,{className:"text-left font-normal",children:"Confirm deletion"})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"2k:text-2xl font-normal text-base",children:["Are you sure you want to delete the following tag",i.length>1?"s":"","?"]}),l.jsx("div",{className:"flex flex-wrap justify-center py-4 gap-3 text-gray-400",children:a.map(o=>l.jsx("span",{className:"inline-block px-2 py-1 rounded-lg text-xs font-medium border border-gray-700 2k:text-2xl",style:{backgroundColor:o.backgroundColor,color:o.textColor},children:o.name},o.id))})]}),l.jsxs(_b,{children:[l.jsx(ye,{variant:"outline",className:"2k:text-2xl 2k:px-4 2k:py-7",onClick:e,disabled:s,children:"Cancel"}),l.jsx(ye,{variant:"destructive",className:"2k:text-2xl 2k:px-4 2k:py-7",onClick:r,disabled:s,children:s?"Deleting...":"Delete"})]})]})})},BL=({children:t,content:e})=>l.jsxs(ui,{children:[l.jsx(di,{asChild:!0,children:t}),l.jsx(fi,{children:l.jsx("p",{className:"text-xs text-gray-300 font-light",children:e})})]}),hAt=({selectedIds:t,totalTags:e,onClear:r,onDelete:n,onToggleSelectAll:i,allSelected:s,isDeleting:a,containerProp:o})=>{const[c,u]=P.useState(!1),{leftOffset:d}=b6();P.useLayoutEffect(()=>{u(!0)},[]),P.useEffect(()=>{function m(y){y.key==="Escape"&&r()}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r]);const f=o??(c?globalThis.document?.body:null);if(!f)return null;const h=t.length>0;return bc.createPortal(l.jsx(Ss,{children:h&&l.jsxs(ct.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20}
4658,animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeInOut"},className:"fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit items-center justify-center gap-2 rounded-xl border border-app-border-color-soft bg-app-card p-2 shadow-lg h-14 2k:h-20 2k:px-6 2k:py-3",style:{left:`calc(${d})`,transform:"translateX(-50%)"},children:[l.jsx(BL,{content:"Select all tags",children:l.jsx("div",{className:"flex h-full items-center rounded-md border border-app-border-color-soft bg-app-input-bg px-3",children:l.jsx(vc,{checked:s,onCheckedChange:i,className:"cursor-pointer"})})}),l.jsxs("div",{className:"flex h-full items-center justify-center rounded-md border border-app-border-color-soft bg-app-input-bg px-2.5 pr-1",children:[l.jsxs("span",{className:"whitespace-nowrap text-xs text-gray-300 2k:text-2xl",children:[l.jsx("span",{className:"text-gray-50 font-medium",children:t.length})," out of ",l.jsx("span",{className:"text-gray-50 font-medium",children:e})," tags"]}),l.jsx("div",{className:"mx-2 h-4 w-px bg-app-border-color-soft"}),l.jsx(BL,{content:"Clear selection",children:l.jsx("button",{onClick:r,type:"button",className:"flex h-5 w-5 items-center justify-center rounded-sm text-gray-400 hover:text-white transition-colors cursor-pointer",title:"Clear selection",disabled:a,children:l.jsx(pi,{size:14,className:"2k:w-10 2k:h-10"})})})]}),l.jsx("div",{className:"w-px h-5 bg-app-border-color-soft"}),l.jsx(BL,{content:"Delete tags",children:l.jsx(ye,{variant:"destructive",size:"icon",onClick:n,disabled:a,children:a?l.jsx(S$,{className:"animate-spin 2k:w-8 2k:h-8"}):l.jsx(hl,{className:"text-white 2k:w-10 2k:h-10"})})})]})}),f)};function pAt(t){const[e,r]=b.useState([]),n=u=>e.includes(u),i=u=>{r(d=>d.includes(u)?d.filter(f=>f!==u):[...d,u])},s=()=>{e.length===t.length?r([]):r(t.map(u=>u.id))},a=b.useMemo(()=>t.filter(u=>e.includes(u.id)),[e,t]),o=t.length>0&&e.length===t.length;return{selectedIds:e,allSelectedItems:a,isSelected:n,toggle:i,toggleAll:s,allSelected:o,clear:()=>r([])}}const mAt=()=>{const{userHasura:t}=Gt(),e=t?.id,[r,n]=b.useState(!1),[i,s]=b.useState(null),[a,o]=b.useState(!1),[c,u]=b.useState([]),d=b.useRef(null),[f,{loading:h}]=ajt(),{updateTag:m,loading:y}=JEt(),{deleteTags:x,loading:v}=ejt(),_=Ws(),{data:S,refetch:k}=S6(e||""),E=S?.tag||[],{selectedIds:T,isSelected:N,toggle:j,toggleAll:M,allSelected:O,clear:R}=pAt(E),I=async V=>{if(e)try{i?await m({variables:{tagId:i.id,tag:{name:V.name,text_color:V.textColor,background_color:V.bgColor}}}):await f({variables:{input:{user_id:e,name:V.name,text_color:V.textColor,background_color:V.bgColor}}}),n(!1),s(null),k()}catch($){Ft.error($.message)}},B=async()=>{try{await x({variables:{tagsId:c}}),xo.cache.modify({fields:{trade_tags(V=[],{readField:$}){return V.filter(U=>{const z=$("tag",U),L=z?$("id",z):null;return L&&!c.includes(String(L))})}}}),c.forEach(V=>{xo.cache.evict({id:xo.cache.identify({__typename:"tag",id:V})})}),xo.cache.gc(),o(!1),R(),k()}catch(V){Ft.error(V.message)}},F=V=>{u(V),o(!0)};return l.jsxs("div",{className:"p-6 space-y-6 2k:mt-8",children:[l.jsxs("div",{className:"flex justify-between items-center 2k:mb-10",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("button",{type:"button",onClick:()=>_(-1),className:"text-gray-400 hover:text-white transition-colors",children:l.jsx(Tu,{size:24,className:"2k:w-10 2k:h-10"})}),l.jsx("h2",{className:"text-3xl font-bold 2k:text-5xl",children:"Manage Tags"})]}),l.jsx(ye,{type:"button",onClick:()=>n(!0),variant:"secondary",size:"sm",className:"px-3 mt-6 2k:text-2xl 2k:px-4 2k:py-7",children:"+ New tag"})]}),l.jsx(dAt,{open:r,onClose:()=>{s(null),n(!1)},isLoading:h||y,onSubmit:I,existingTags:E,initialValues:i?{name:i.name,textColor:i.textColor,bgColor:i.backgroundColor}:void 0,mode:i?"edit":"create"}),E.length===0?l.jsx("div",{className:"flex flex-col items-center justify-center space-y-4",children:l.jsx(tpe,{title:"No tags available yet",subtitle:"Create your first tag to start organizing your trades visually and improve your workflow.",imageSrc:"/empty-tag.png"})}):l.jsx("div",{ref:d,className:"bg-app-card border border-app-border-color-soft rounded-xl overflow-hidden mt-8",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-app-border-color-soft",children:[l.jsx("thead",{className:"bg-app-input-bg border-b border-app-border-color-soft",children:l.jsxs("tr",{children:[l.jsx("th",{className:"pl-10 pr-4 py-3 text-left text-xs font-medium text-gray-400 uppercase",children:l.jsx(vc,{checked:O,onCheckedChange:M})}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase 2k:text-lg",children:"Preview"}),l.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase 2k:text-lg",children:"Name"}),l.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-400 uppercase 2k:text-lg",children:"Backgroun
4658d Color"}),l.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-400 uppercase 2k:text-lg",children:"Text Color"}),l.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-400 uppercase 2k:text-lg",children:"Actions"})]})}),l.jsx("tbody",{className:"divide-y divide-app-border-color-soft",children:E.map(V=>l.jsxs("tr",{className:"hover:bg-gray-800",children:[l.jsx("td",{className:"pl-10 pr-4 py-3",children:l.jsx(vc,{checked:N(V.id),onCheckedChange:()=>j(V.id)})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"inline-block px-2 py-1 rounded-lg text-xs font-medium border border-gray-700 2k:text-xl",style:{backgroundColor:V.backgroundColor,color:V.textColor},children:V.name})}),l.jsx("td",{className:"px-4 py-3 2k:text-xl",children:V.name}),l.jsx("td",{className:"px-4 py-3 text-center",children:l.jsx("div",{className:"w-4 h-4 mx-auto rounded-full 2k:w-7 2k:h-7",style:{backgroundColor:V.backgroundColor}})}),l.jsx("td",{className:"px-4 py-3 text-center",children:l.jsx("div",{className:"w-4 h-4 mx-auto rounded-full 2k:w-7 2k:h-7",style:{backgroundColor:V.textColor}})}),l.jsxs("td",{className:"px-4 py-3 text-center space-x-4",children:[l.jsx("button",{type:"button",onClick:()=>{s(V),n(!0)},"aria-label":"Edit tag",title:"Edit",className:"text-gray-400 hover:text-emerald-400 transition-colors",children:l.jsx(dMe,{size:18,className:"2k:w-8 2k:h-8"})}),l.jsx("button",{type:"button",onClick:()=>F([V.id]),"aria-label":"Delete tag",title:"Delete",className:"text-gray-400 hover:text-red-500 transition-colors",children:l.jsx(N$,{size:18,className:"2k:w-8 2k:h-8"})})]})]},V.id))})]})})}),l.jsx(hAt,{totalTags:E.length,selectedIds:T,onClear:R,onDelete:()=>F(T),isDeleting:v,allSelected:O,onToggleSelectAll:M,containerProp:d.current}),l.jsx(fAt,{isOpen:a,onClose:()=>o(!1),onConfirm:B,tags:E,tagsToDelete:c,isDeleting:v})]})};function gAt(){const{trade:t,loading:e}=REt();return e?l.jsx(jbe,{}):t?l.jsxs("div",{className:"min-h-screen bg-app-primary mx-auto 
4658sm:pb-6 pb-8 pt-4",children:[l.jsx(GEt,{trade:t}),l.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[l.jsx(Ebe,{symbol:t.symbol,trade:t}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx("div",{className:"md:col-span-2",children:l.jsx(HEt,{trade:t})}),l.jsx(YEt,{trade:t})]}),l.jsx(Fbe,{tradeId:t.id}),l.jsx(Ibe,{trade:t})]})]}):l.jsx(KEt,{})}const yAt=[{path:"/app",element:l.jsx(BKe,{}),errorElement:l.jsx(sot,{}),children:[{index:!0,element:l.jsx(IE,{to:"/app/dashboard",replace:!0})},{path:"dashboard",element:l.jsx(Sa,{feature:"DASHBOARD",children:l.jsx(not,{})})},{path:"edge",element:l.jsx(Sa,{feature:"DASHBOARD",children:l.jsx(iot,{})})},{path:"calendar",element:l.jsx(Sa,{feature:"CALENDAR",children:l.jsx(ert,{})})},{path:"insights",element:l.jsx(Sa,{feature:"INSIGHTS",children:l.jsx(wkt,{})})},{path:"trade-entry",element:l.jsx(Sa,{feature:"TRADES",action:"WRITE",children:l.jsx(Zjt,{})})},{path:"trades",element:l.jsx(Sa,{feature:"TRADES",children:l.jsx(q2t,{})})},{path:"trades/:id",element:l.jsx(Sa,{feature:"TRADE_DETAILS",children:l.jsx(gAt,{})})},{path:"manage-tags",element:l.jsx(Sa,{feature:"TRADE_DETAILS",children:l.jsx(mAt,{})})},{path:"review",element:l.jsx(Sa,{feature:"REVIEW",children:l.jsx(bjt,{})})},{path:"profile",element:l.jsx(Sa,{feature:"PROFILE",children:l.jsx(aCt,{})})},{path:"recap",element:l.jsx(Sa,{feature:"TRADES",children:l.jsx(BCt,{})})},{path:"recap/:date",element:l.jsx(Sa,{feature:"TRADES",children:l.jsx(eEt,{})})},{path:"recap/:date/symbol/:symbol",element:l.jsx(Sa,{feature:"TRADES",children:l.jsx(fjt,{})})},{path:"success",element:l.jsx(Skt,{})},{path:"cancel",element:l.jsx(_kt,{})}]}],vAt=pPe([...zXe,...yAt,{path:"*",element:l.jsx(pDe,{})}]);function xAt(){return l.jsxs(l.Fragment,{children:[l.jsx(BNe,{router:vAt}),l.jsx(VMe,{})]})}const bAt=Mae();CEe.createRoot(document.getElementById("root")).render(l.jsx(b.StrictMode,{children:l.jsx(mSe,{client:xo,children:l.jsx(cje,{client:bAt,children:l.jsx(xAt,{})})})}));export{AAt as C,Ome as a,WV as b,tXe as c,xo as d,DAt as e,Dme as n,qZe as p,ks as s,yrt as t,Gt as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.