@yoast/ai-insights-client 1.4.24 → 1.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Kx=Object.defineProperty;var
|
|
1
|
+
"use strict";var Kx=Object.defineProperty;var _h=e=>{throw TypeError(e)};var Wx=(e,t,n)=>t in e?Kx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var me=(e,t,n)=>Wx(e,typeof t!="symbol"?t+"":t,n),Xc=(e,t,n)=>t.has(e)||_h("Cannot "+n);var P=(e,t,n)=>(Xc(e,t,"read from private field"),n?n.call(e):t.get(e)),le=(e,t,n)=>t.has(e)?_h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),X=(e,t,n,r)=>(Xc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Te=(e,t,n)=>(Xc(e,t,"access private method"),n);var Ga=(e,t,n,r)=>({set _(i){X(e,t,i,n)},get _(){return P(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),E=require("@yoast/ui-library"),q=require("react"),Vx=require("styled-components");function Gx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=Gx(q);function Zp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var io={},kh;function Qx(){if(kh)return io;kh=1,Object.defineProperty(io,"__esModule",{value:!0}),io.parse=o,io.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function o(f,h){const g=new s,m=f.length;if(m<2)return g;const p=(h==null?void 0:h.decode)||u;let v=0;do{const b=f.indexOf("=",v);if(b===-1)break;const w=f.indexOf(";",v),S=w===-1?m:w;if(b>S){v=f.lastIndexOf(";",b-1)+1;continue}const x=a(f,v,b),O=l(f,b,x),C=f.slice(x,O);if(g[C]===void 0){let k=a(f,b+1,S),_=l(f,S,k);const A=p(f.slice(k,_));g[C]=A}v=S+1}while(v<m);return g}function a(f,h,g){do{const m=f.charCodeAt(h);if(m!==32&&m!==9)return h}while(++h<g);return g}function l(f,h,g){for(;h>g;){const m=f.charCodeAt(--h);if(m!==32&&m!==9)return h+1}return g}function c(f,h,g){const m=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const p=m(h);if(!t.test(p))throw new TypeError(`argument val is invalid: ${h}`);let v=f+"="+p;if(!g)return v;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);v+="; Max-Age="+g.maxAge}if(g.domain){if(!n.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);v+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);v+="; Path="+g.path}if(g.expires){if(!d(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);v+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(v+="; HttpOnly"),g.secure&&(v+="; Secure"),g.partitioned&&(v+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":v+="; Priority=Low";break;case"medium":v+="; Priority=Medium";break;case"high":v+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":v+="; SameSite=Strict";break;case"lax":v+="; SameSite=Lax";break;case"none":v+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return v}function u(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch(h){return f}}function d(f){return i.call(f)==="[object Date]"}return io}Qx();/**
|
|
2
2
|
* react-router v7.6.3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
@@ -7,75 +7,75 @@
|
|
|
7
7
|
* LICENSE.md file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/function Yx(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,g)=>u(h,typeof h=="string"?null:h.state,g===0?"default":void 0));let s=l(n==null?i.length-1:n),o="POP",a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function u(h,g=null,m){let p=Jx(i?c().pathname:"/",h,g,m);return vn(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:Dl(h)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let g=typeof h=="string"?Li(h):h;return{pathname:g.pathname||"",search:g.search||"",hash:g.hash||""}},push(h,g){o="PUSH";let m=u(h,g);s+=1,i.splice(s,i.length,m),r&&a&&a({action:o,location:m,delta:1})},replace(h,g){o="REPLACE";let m=u(h,g);i[s]=m,r&&a&&a({action:o,location:m,delta:0})},go(h){o="POP";let g=l(s+h),m=i[g];s=g,a&&a({action:o,location:m,delta:h})},listen(h){return a=h,()=>{a=null}}}}function it(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function vn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Xx(){return Math.random().toString(36).substring(2,10)}function Jx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Li(t):t,state:n,key:t&&t.key||r||Xx()}}function Dl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Li(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Zp(e,t,n="/"){return Zx(e,t,n,!1)}function Zx(e,t,n,r){let i=typeof t=="string"?Li(t):t,s=fr(i.pathname||"/",n);if(s==null)return null;let o=e0(e);ew(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=n0(s);a=cw(o[l],c,r)}return a}function e0(e,t=[],n=[],r=""){let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(it(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=lr([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(it(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),e0(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:aw(c,s.index),routesMeta:u})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of t0(s.path))i(s,o,l)}),t}function t0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=t0(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function ew(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var tw=/^:[\w-]+$/,nw=3,rw=2,iw=1,sw=10,ow=-2,kh=e=>e==="*";function aw(e,t){let n=e.split("/"),r=n.length;return n.some(kh)&&(r+=ow),t&&(r+=rw),n.filter(i=>!kh(i)).reduce((i,s)=>i+(tw.test(s)?nw:s===""?iw:sw),r)}function lw(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function cw(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",d=Ds({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ds({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:lr([s,d.pathname]),pathnameBase:gw(lr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=lr([s,d.pathnameBase]))}return o}function Ds(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=uw(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:d},f)=>{if(u==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const h=a[f];return d&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function uw(e,t=!1,n=!0){vn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function n0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function fr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dw(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Li(e):e;return{pathname:n?n.startsWith("/")?n:fw(n,t):t,search:yw(r),hash:mw(i)}}function fw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Jc(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tf(e){let t=hw(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function nf(e,t,n,r=!1){let i;typeof e=="string"?i=Li(e):(i={...e},it(!i.pathname||!i.pathname.includes("?"),Jc("?","pathname","search",i)),it(!i.pathname||!i.pathname.includes("#"),Jc("#","pathname","hash",i)),it(!i.search||!i.search.includes("#"),Jc("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=dw(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var lr=e=>e.join("/").replace(/\/\/+/g,"/"),gw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var r0=["POST","PUT","PATCH","DELETE"];new Set(r0);var vw=["GET",...r0];new Set(vw);var Hs=$.createContext(null);Hs.displayName="DataRouter";var fc=$.createContext(null);fc.displayName="DataRouterState";var i0=$.createContext({isTransitioning:!1});i0.displayName="ViewTransition";var bw=$.createContext(new Map);bw.displayName="Fetchers";var xw=$.createContext(null);xw.displayName="Await";var jn=$.createContext(null);jn.displayName="Navigation";var ja=$.createContext(null);ja.displayName="Location";var bn=$.createContext({outlet:null,matches:[],isDataRoute:!1});bn.displayName="Route";var rf=$.createContext(null);rf.displayName="RouteError";function ww(e,{relative:t}={}){it(Ri(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=$.useContext(jn),{hash:i,pathname:s,search:o}=Ma(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:lr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Ri(){return $.useContext(ja)!=null}function Ut(){return it(Ri(),"useLocation() may be used only in the context of a <Router> component."),$.useContext(ja).location}function Ga(e){it(Ri(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ut();return $.useMemo(()=>Ds(e,n0(t)),[t,e])}var s0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function o0(e){$.useContext(jn).static||$.useLayoutEffect(e)}function xn(){let{isDataRoute:e}=$.useContext(bn);return e?Lw():Sw()}function Sw(){it(Ri(),"useNavigate() may be used only in the context of a <Router> component.");let e=$.useContext(Hs),{basename:t,navigator:n}=$.useContext(jn),{matches:r}=$.useContext(bn),{pathname:i}=Ut(),s=JSON.stringify(tf(r)),o=$.useRef(!1);return o0(()=>{o.current=!0}),$.useCallback((l,c={})=>{if(vn(o.current,s0),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=nf(l,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:lr([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,s,i,e])}var Cw=$.createContext(null);function _w(e){let t=$.useContext(bn).outlet;return t&&$.createElement(Cw.Provider,{value:e},t)}function hc(){let{matches:e}=$.useContext(bn),t=e[e.length-1];return t?t.params:{}}function Ma(e,{relative:t}={}){let{matches:n}=$.useContext(bn),{pathname:r}=Ut(),i=JSON.stringify(tf(n));return $.useMemo(()=>nf(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function kw(e,t){return a0(e,t)}function a0(e,t,n,r){var v;it(Ri(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=$.useContext(jn),{matches:s}=$.useContext(bn),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let b=u&&u.path||"";l0(l,!u||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${b}">) 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.
|
|
10
|
+
*/function Yx(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,g)=>u(h,typeof h=="string"?null:h.state,g===0?"default":void 0));let s=l(n==null?i.length-1:n),o="POP",a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function u(h,g=null,m){let p=Jx(i?c().pathname:"/",h,g,m);return bn(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:Il(h)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let g=typeof h=="string"?Li(h):h;return{pathname:g.pathname||"",search:g.search||"",hash:g.hash||""}},push(h,g){o="PUSH";let m=u(h,g);s+=1,i.splice(s,i.length,m),r&&a&&a({action:o,location:m,delta:1})},replace(h,g){o="REPLACE";let m=u(h,g);i[s]=m,r&&a&&a({action:o,location:m,delta:0})},go(h){o="POP";let g=l(s+h),m=i[g];s=g,a&&a({action:o,location:m,delta:h})},listen(h){return a=h,()=>{a=null}}}}function it(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function bn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Xx(){return Math.random().toString(36).substring(2,10)}function Jx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Li(t):t,state:n,key:t&&t.key||r||Xx()}}function Il({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Li(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function e0(e,t,n="/"){return Zx(e,t,n,!1)}function Zx(e,t,n,r){let i=typeof t=="string"?Li(t):t,s=fr(i.pathname||"/",n);if(s==null)return null;let o=t0(e);ew(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=r0(s);a=cw(o[l],c,r)}return a}function t0(e,t=[],n=[],r=""){let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(it(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=lr([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(it(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),t0(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:aw(c,s.index),routesMeta:u})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of n0(s.path))i(s,o,l)}),t}function n0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=n0(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function ew(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var tw=/^:[\w-]+$/,nw=3,rw=2,iw=1,sw=10,ow=-2,Oh=e=>e==="*";function aw(e,t){let n=e.split("/"),r=n.length;return n.some(Oh)&&(r+=ow),t&&(r+=rw),n.filter(i=>!Oh(i)).reduce((i,s)=>i+(tw.test(s)?nw:s===""?iw:sw),r)}function lw(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function cw(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",d=Ds({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ds({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:lr([s,d.pathname]),pathnameBase:gw(lr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=lr([s,d.pathnameBase]))}return o}function Ds(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=uw(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:d},f)=>{if(u==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const h=a[f];return d&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function uw(e,t=!1,n=!0){bn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function r0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function fr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dw(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Li(e):e;return{pathname:n?n.startsWith("/")?n:fw(n,t):t,search:yw(r),hash:mw(i)}}function fw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Jc(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nf(e){let t=hw(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function rf(e,t,n,r=!1){let i;typeof e=="string"?i=Li(e):(i={...e},it(!i.pathname||!i.pathname.includes("?"),Jc("?","pathname","search",i)),it(!i.pathname||!i.pathname.includes("#"),Jc("#","pathname","hash",i)),it(!i.search||!i.search.includes("#"),Jc("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=dw(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var lr=e=>e.join("/").replace(/\/\/+/g,"/"),gw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var i0=["POST","PUT","PATCH","DELETE"];new Set(i0);var vw=["GET",...i0];new Set(vw);var Hs=M.createContext(null);Hs.displayName="DataRouter";var hc=M.createContext(null);hc.displayName="DataRouterState";var s0=M.createContext({isTransitioning:!1});s0.displayName="ViewTransition";var bw=M.createContext(new Map);bw.displayName="Fetchers";var xw=M.createContext(null);xw.displayName="Await";var jn=M.createContext(null);jn.displayName="Navigation";var ja=M.createContext(null);ja.displayName="Location";var xn=M.createContext({outlet:null,matches:[],isDataRoute:!1});xn.displayName="Route";var sf=M.createContext(null);sf.displayName="RouteError";function ww(e,{relative:t}={}){it(Ri(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=M.useContext(jn),{hash:i,pathname:s,search:o}=Ma(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:lr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Ri(){return M.useContext(ja)!=null}function Ut(){return it(Ri(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(ja).location}function Qa(e){it(Ri(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ut();return M.useMemo(()=>Ds(e,r0(t)),[t,e])}var o0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function a0(e){M.useContext(jn).static||M.useLayoutEffect(e)}function ln(){let{isDataRoute:e}=M.useContext(xn);return e?Lw():Sw()}function Sw(){it(Ri(),"useNavigate() may be used only in the context of a <Router> component.");let e=M.useContext(Hs),{basename:t,navigator:n}=M.useContext(jn),{matches:r}=M.useContext(xn),{pathname:i}=Ut(),s=JSON.stringify(nf(r)),o=M.useRef(!1);return a0(()=>{o.current=!0}),M.useCallback((l,c={})=>{if(bn(o.current,o0),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=rf(l,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:lr([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,s,i,e])}var Cw=M.createContext(null);function _w(e){let t=M.useContext(xn).outlet;return t&&M.createElement(Cw.Provider,{value:e},t)}function gc(){let{matches:e}=M.useContext(xn),t=e[e.length-1];return t?t.params:{}}function Ma(e,{relative:t}={}){let{matches:n}=M.useContext(xn),{pathname:r}=Ut(),i=JSON.stringify(nf(n));return M.useMemo(()=>rf(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function kw(e,t){return l0(e,t)}function l0(e,t,n,r){var v;it(Ri(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=M.useContext(jn),{matches:s}=M.useContext(xn),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let b=u&&u.path||"";c0(l,!u||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${b}">) 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.
|
|
11
11
|
|
|
12
|
-
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Ut(),f;if(t){let b=typeof t=="string"?Li(t):t;it(c==="/"||((v=b.pathname)==null?void 0:v.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${b.pathname}" was given in the \`location\` prop.`),f=b}else f=d;let h=f.pathname||"/",g=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let m=Zp(e,{pathname:g});vn(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),vn(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let p=Tw(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:lr([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:lr([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?$.createElement(ja.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function Ow(){let e=Iw(),t=pw(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=$.createElement($.Fragment,null,$.createElement("p",null,"💿 Hey developer 👋"),$.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",$.createElement("code",{style:s},"ErrorBoundary")," or"," ",$.createElement("code",{style:s},"errorElement")," prop on your route.")),$.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},t),n?$.createElement("pre",{style:i},n):null,o)}var Ew=$.createElement(Ow,null),Aw=class extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?$.createElement(bn.Provider,{value:this.props.routeContext},$.createElement(rf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Pw({routeContext:e,match:t,children:n}){let r=$.useContext(Hs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),$.createElement(bn.Provider,{value:e},n)}function Tw(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n==null?void 0:n.errors;if(s!=null){let l=i.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);it(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,l+1))}let o=!1,a=-1;if(n)for(let l=0;l<i.length;l++){let c=i[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=l),c.route.id){let{loaderData:u,errors:d}=n,f=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,c,u)=>{let d,f=!1,h=null,g=null;n&&(d=s&&c.route.id?s[c.route.id]:void 0,h=c.route.errorElement||Ew,o&&(a<0&&u===0?(l0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):a===u&&(f=!0,g=c.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,u+1)),p=()=>{let v;return d?v=h:f?v=g:c.route.Component?v=$.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,$.createElement(Pw,{match:c,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?$.createElement(Aw,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function sf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jw(e){let t=$.useContext(Hs);return it(t,sf(e)),t}function Mw(e){let t=$.useContext(fc);return it(t,sf(e)),t}function $w(e){let t=$.useContext(bn);return it(t,sf(e)),t}function of(e){let t=$w(e),n=t.matches[t.matches.length-1];return it(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Dw(){return of("useRouteId")}function Iw(){var r;let e=$.useContext(rf),t=Mw("useRouteError"),n=of("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Lw(){let{router:e}=jw("useNavigate"),t=of("useNavigate"),n=$.useRef(!1);return o0(()=>{n.current=!0}),$.useCallback(async(i,s={})=>{vn(n.current,s0),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var Oh={};function l0(e,t,n){!t&&!Oh[e]&&(Oh[e]=!0,vn(!1,n))}$.memo(Rw);function Rw({routes:e,future:t,state:n}){return a0(e,void 0,n,t)}function Nw({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=$.useRef();i.current==null&&(i.current=Yx({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=i.current,[o,a]=$.useState({action:s.action,location:s.location}),l=$.useCallback(c=>{$.startTransition(()=>a(c))},[a]);return $.useLayoutEffect(()=>s.listen(l),[s,l]),$.createElement(Fw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function ci({to:e,replace:t,state:n,relative:r}){it(Ri(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=$.useContext(jn);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}=$.useContext(bn),{pathname:o}=Ut(),a=xn(),l=nf(e,tf(s),o,r==="path"),c=JSON.stringify(l);return $.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function Is(e){return _w(e.context)}function Ct(e){it(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Fw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){it(!Ri(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=$.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=Li(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=$.useMemo(()=>{let g=fr(l,o);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:f},navigationType:r}},[o,l,c,u,d,f,r]);return vn(h!=null,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:$.createElement(jn.Provider,{value:a},$.createElement(ja.Provider,{children:t,value:h}))}function Bw({children:e,location:t}){return kw(zu(e),t)}function zu(e,t=[]){let n=[];return $.Children.forEach(e,(r,i)=>{if(!$.isValidElement(r))return;let s=[...t,i];if(r.type===$.Fragment){n.push.apply(n,zu(r.props.children,s));return}it(r.type===Ct,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),it(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=zu(r.props.children,s)),n.push(o)}),n}var Sl="get",Cl="application/x-www-form-urlencoded";function gc(e){return e!=null&&typeof e.tagName=="string"}function qw(e){return gc(e)&&e.tagName.toLowerCase()==="button"}function zw(e){return gc(e)&&e.tagName.toLowerCase()==="form"}function Hw(e){return gc(e)&&e.tagName.toLowerCase()==="input"}function Uw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kw(e,t){return e.button===0&&(!t||t==="_self")&&!Uw(e)}var Qa=null;function Ww(){if(Qa===null)try{new FormData(document.createElement("form"),0),Qa=!1}catch(e){Qa=!0}return Qa}var Vw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zc(e){return e!=null&&!Vw.has(e)?(vn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cl}"`),null):e}function Gw(e,t){let n,r,i,s,o;if(zw(e)){let a=e.getAttribute("action");r=a?fr(a,t):null,n=e.getAttribute("method")||Sl,i=Zc(e.getAttribute("enctype"))||Cl,s=new FormData(e)}else if(qw(e)||Hw(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?fr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Sl,i=Zc(e.getAttribute("formenctype"))||Zc(a.getAttribute("enctype"))||Cl,s=new FormData(a,e),!Ww()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?`${c}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else c&&s.append(c,d)}}else{if(gc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sl,r=null,i=Cl,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function af(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function Qw(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Yw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Xw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await Qw(s,n);return o.links?o.links():[]}return[]}));return t2(r.flat(1).filter(Yw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Eh(e,t,n,r,i,s){let o=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,a=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,c)=>o(l,c)||a(l,c)):s==="data"?t.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Jw(e,t,{includeHydrateFallback:n}={}){return Zw(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Zw(e){return[...new Set(e)]}function e2(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function t2(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(e2(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var n2=new Set([100,101,204,205]);function r2(e,t){let n=typeof e=="string"?new URL(e,typeof window=="undefined"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&fr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function c0(){let e=$.useContext(Hs);return af(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function i2(){let e=$.useContext(fc);return af(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var lf=$.createContext(void 0);lf.displayName="FrameworkContext";function u0(){let e=$.useContext(lf);return af(e,"You must render this element inside a <HydratedRouter> element"),e}function s2(e,t){let n=$.useContext(lf),[r,i]=$.useState(!1),[s,o]=$.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=$.useRef(null);$.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let m=v=>{v.forEach(b=>{o(b.isIntersecting)})},p=new IntersectionObserver(m,{threshold:.5});return f.current&&p.observe(f.current),()=>{p.disconnect()}}},[e]),$.useEffect(()=>{if(r){let m=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(m)}}},[r]);let h=()=>{i(!0)},g=()=>{i(!1),o(!1)};return n?e!=="intent"?[s,f,{}]:[s,f,{onFocus:so(a,h),onBlur:so(l,g),onMouseEnter:so(c,h),onMouseLeave:so(u,g),onTouchStart:so(d,h)}]:[!1,f,{}]}function so(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function o2({page:e,...t}){let{router:n}=c0(),r=$.useMemo(()=>Zp(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?$.createElement(l2,{page:e,matches:r,...t}):null}function a2(e){let{manifest:t,routeModules:n}=u0(),[r,i]=$.useState([]);return $.useEffect(()=>{let s=!1;return Xw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function l2({page:e,matches:t,...n}){let r=Ut(),{manifest:i,routeModules:s}=u0(),{basename:o}=c0(),{loaderData:a,matches:l}=i2(),c=$.useMemo(()=>Eh(e,t,l,i,r,"data"),[e,t,l,i,r]),u=$.useMemo(()=>Eh(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=$.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(v=>{var w;let b=i.routes[v.route.id];!b||!b.hasLoader||(!c.some(S=>S.route.id===v.route.id)&&v.route.id in a&&((w=s[v.route.id])!=null&&w.shouldRevalidate)||b.hasClientLoader?m=!0:g.add(v.route.id))}),g.size===0)return[];let p=r2(e,o);return m&&g.size>0&&p.searchParams.set("_routes",t.filter(v=>g.has(v.route.id)).map(v=>v.route.id).join(",")),[p.pathname+p.search]},[o,a,r,i,c,t,e,s]),f=$.useMemo(()=>Jw(u,i),[u,i]),h=a2(u);return $.createElement($.Fragment,null,d.map(g=>$.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),f.map(g=>$.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),h.map(({key:g,link:m})=>$.createElement("link",{key:g,...m})))}function c2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var d0=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{d0&&(window.__reactRouterVersion="7.6.3")}catch(e){}var f0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yr=$.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...f},h){let{basename:g}=$.useContext(jn),m=typeof c=="string"&&f0.test(c),p,v=!1;if(typeof c=="string"&&m&&(p=c,d0))try{let k=new URL(window.location.href),E=c.startsWith("//")?new URL(k.protocol+c):new URL(c),j=fr(E.pathname,g);E.origin===k.origin&&j!=null?c=j+E.search+E.hash:v=!0}catch(k){vn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=ww(c,{relative:i}),[w,S,x]=s2(r,f),O=h2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function C(k){t&&t(k),k.defaultPrevented||O(k)}let _=$.createElement("a",{...f,...x,href:p||b,onClick:v||s?t:C,ref:c2(h,S),target:l,"data-discover":!m&&n==="render"?"true":void 0});return w&&!m?$.createElement($.Fragment,null,_,$.createElement(o2,{page:b})):_});Yr.displayName="Link";var u2=$.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...c},u){let d=Ma(o,{relative:c.relative}),f=Ut(),h=$.useContext(fc),{navigator:g,basename:m}=$.useContext(jn),p=h!=null&&v2(d)&&a===!0,v=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,b=f.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&m&&(w=fr(w,m)||w);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let x=b===v||!i&&b.startsWith(v)&&b.charAt(S)==="/",O=w!=null&&(w===v||!i&&w.startsWith(v)&&w.charAt(v.length)==="/"),C={isActive:x,isPending:O,isTransitioning:p},_=x?t:void 0,k;typeof r=="function"?k=r(C):k=[r,x?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let E=typeof s=="function"?s(C):s;return $.createElement(Yr,{...c,"aria-current":_,className:k,ref:u,style:E,to:o,viewTransition:a},typeof l=="function"?l(C):l)});u2.displayName="NavLink";var d2=$.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=Sl,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=m2(),m=p2(a,{relative:c}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&f0.test(a),b=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let S=w.nativeEvent.submitter,x=(S==null?void 0:S.getAttribute("formmethod"))||o;g(S||w.currentTarget,{fetcherKey:t,method:x,navigate:n,replace:i,state:s,relative:c,preventScrollReset:u,viewTransition:d})};return $.createElement("form",{ref:h,method:p,action:m,onSubmit:r?l:b,...f,"data-discover":!v&&e==="render"?"true":void 0})});d2.displayName="Form";function f2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function h0(e){let t=$.useContext(Hs);return it(t,f2(e)),t}function h2(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=xn(),l=Ut(),c=Ma(e,{relative:s});return $.useCallback(u=>{if(Kw(u,t)){u.preventDefault();let d=n!==void 0?n:Dl(l)===Dl(c);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,n,r,t,e,i,s,o])}var g2=0,y2=()=>`__${String(++g2)}__`;function m2(){let{router:e}=h0("useSubmit"),{basename:t}=$.useContext(jn),n=Dw();return $.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=Gw(r,t);if(i.navigate===!1){let u=i.fetcherKey||y2();await e.fetch(u,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function p2(e,{relative:t}={}){let{basename:n}=$.useContext(jn),r=$.useContext(bn);it(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ma(e||".",{relative:t})},o=Ut();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let u=a.toString();s.search=u?`?${u}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:lr([n,s.pathname])),Dl(s)}function v2(e,t={}){let n=$.useContext(i0);it(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=h0("useViewTransitionState"),i=Ma(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=fr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=fr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ds(i.pathname,o)!=null||Ds(i.pathname,s)!=null}[...n2];var Us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ei=typeof window=="undefined"||"Deno"in globalThis;function $t(){}function b2(e,t){return typeof e=="function"?e(t):e}function Hu(e){return typeof e=="number"&&e>=0&&e!==1/0}function g0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qr(e,t){return typeof e=="function"?e(t):e}function hn(e,t){return typeof e=="function"?e(t):e}function Ah(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==cf(o,t.options))return!1}else if(!Ho(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Ph(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ai(t.options.mutationKey)!==Ai(s))return!1}else if(!Ho(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function cf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ai)(e)}function Ai(e){return JSON.stringify(e,(t,n)=>Ku(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ho(e[n],t[n])):!1}function Uu(e,t){if(e===t)return e;const n=Th(e)&&Th(t);if(n||Ku(e)&&Ku(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,c++):(a[d]=Uu(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return i===o&&c===i?e:a}return t}function Il(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Th(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ku(e){if(!jh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jh(e){return Object.prototype.toString.call(e)==="[object Object]"}function x2(e){return new Promise(t=>{setTimeout(t,e)})}function Wu(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Uu(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Uu(e,t)}return t}function w2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function S2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ll=Symbol();function y0(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ll&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ll?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function m0(e,t){return typeof e=="function"?e(...t):!!e}var hi,Er,as,Bp,C2=(Bp=class extends Us{constructor(){super();ae(this,hi);ae(this,Er);ae(this,as);X(this,as,t=>{if(!Ei&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Er)||this.setEventListener(P(this,as))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Er))==null||t.call(this),X(this,Er,void 0))}setEventListener(t){var n;X(this,as,t),(n=P(this,Er))==null||n.call(this),X(this,Er,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,hi)!==t&&(X(this,hi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,hi)=="boolean"?P(this,hi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hi=new WeakMap,Er=new WeakMap,as=new WeakMap,Bp),uf=new C2,ls,Ar,cs,qp,_2=(qp=class extends Us{constructor(){super();ae(this,ls,!0);ae(this,Ar);ae(this,cs);X(this,cs,t=>{if(!Ei&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,Ar)||this.setEventListener(P(this,cs))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Ar))==null||t.call(this),X(this,Ar,void 0))}setEventListener(t){var n;X(this,cs,t),(n=P(this,Ar))==null||n.call(this),X(this,Ar,t(this.setOnline.bind(this)))}setOnline(t){P(this,ls)!==t&&(X(this,ls,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,ls)}},ls=new WeakMap,Ar=new WeakMap,cs=new WeakMap,qp),Ls=new _2;function Vu(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function k2(e){return Math.min(1e3*2**e,3e4)}function p0(e){return(e!=null?e:"online")==="online"?Ls.isOnline():!0}var v0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eu(e){return e instanceof v0}function b0(e){let t=!1,n=0,r=!1,i;const s=Vu(),o=m=>{var p;r||(f(new v0(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>uf.isFocused()&&(e.networkMode==="always"||Ls.isOnline())&&e.canRun(),u=()=>p0(e.networkMode)&&e.canRun(),d=m=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,m),i==null||i(),s.resolve(m))},f=m=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,m),i==null||i(),s.reject(m))},h=()=>new Promise(m=>{var p;i=v=>{(r||c())&&m(v)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p!=null?p:e.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(d).catch(v=>{var O,C,_;if(r)return;const b=(O=e.retry)!=null?O:Ei?0:3,w=(C=e.retryDelay)!=null?C:k2,S=typeof w=="function"?w(n,v):w,x=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(t||!x){f(v);return}n++,(_=e.onFail)==null||_.call(e,n,v),x2(S).then(()=>c()?void 0:h()).then(()=>{t?f(v):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),s)}}var O2=e=>setTimeout(e,0);function E2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=O2;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var gt=E2(),gi,zp,x0=(zp=class{constructor(){ae(this,gi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hu(this.gcTime)&&X(this,gi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Ei?1/0:5*60*1e3)}clearGcTimeout(){P(this,gi)&&(clearTimeout(P(this,gi)),X(this,gi,void 0))}},gi=new WeakMap,zp),us,yi,fn,mi,_t,pa,pi,kn,Jn,Hp,A2=(Hp=class extends x0{constructor(t){var n;super();ae(this,kn);ae(this,us);ae(this,yi);ae(this,fn);ae(this,mi);ae(this,_t);ae(this,pa);ae(this,pi);X(this,pi,!1),X(this,pa,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,mi,t.client),X(this,fn,P(this,mi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,us,P2(this.options)),this.state=(n=t.state)!=null?n:P(this,us),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,_t))==null?void 0:t.promise}setOptions(t){this.options={...P(this,pa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,fn).remove(this)}setData(t,n){const r=Wu(this.state.data,t,this.options);return Te(this,kn,Jn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Te(this,kn,Jn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,_t))==null?void 0:r.promise;return(i=P(this,_t))==null||i.cancel(t),n?n.then($t).catch($t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,us))}isActive(){return this.observers.some(t=>hn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ll||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qr(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:!g0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,_t))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,_t))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,fn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,_t)&&(P(this,pi)?P(this,_t).cancel({revert:!0}):P(this,_t).cancelRetry()),this.scheduleGc()),P(this,fn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,kn,Jn).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,_t))return P(this,_t).continueRetry(),P(this,_t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(X(this,pi,!0),r.signal)})},s=()=>{const f=y0(this.options,n),g=(()=>{const m={client:P(this,mi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return X(this,pi,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,mi),state:this.state,fetchFn:s};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),X(this,yi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Te(this,kn,Jn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;eu(f)&&f.silent||Te(this,kn,Jn).call(this,{type:"error",error:f}),eu(f)||((g=(h=P(this,fn).config).onError)==null||g.call(h,f,this),(p=(m=P(this,fn).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return X(this,_t,b0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,m,p;if(f===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){l(v);return}(g=(h=P(this,fn).config).onSuccess)==null||g.call(h,f,this),(p=(m=P(this,fn).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Te(this,kn,Jn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Te(this,kn,Jn).call(this,{type:"pause"})},onContinue:()=>{Te(this,kn,Jn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,_t).start()}},us=new WeakMap,yi=new WeakMap,fn=new WeakMap,mi=new WeakMap,_t=new WeakMap,pa=new WeakMap,pi=new WeakMap,kn=new WeakSet,Jn=function(t){const n=r=>{var i,s;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,...w0(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return X(this,yi,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return eu(o)&&o.revert&&P(this,yi)?{...P(this,yi),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),gt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,fn).notify({query:this,type:"updated",action:t})})},Hp);function w0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:p0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function P2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var qn,Up,T2=(Up=class extends Us{constructor(t={}){super();ae(this,qn);this.config=t,X(this,qn,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:cf(i,n);let o=this.get(s);return o||(o=new A2({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){P(this,qn).has(t.queryHash)||(P(this,qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,qn).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,qn).get(t)}getAll(){return[...P(this,qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ah(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ah(t,r)):n}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qn=new WeakMap,Up),zn,jt,vi,Hn,Or,Kp,j2=(Kp=class extends x0{constructor(t){super();ae(this,Hn);ae(this,zn);ae(this,jt);ae(this,vi);this.mutationId=t.mutationId,X(this,jt,t.mutationCache),X(this,zn,[]),this.state=t.state||S0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,zn).includes(t)||(P(this,zn).push(t),this.clearGcTimeout(),P(this,jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,zn,P(this,zn).filter(n=>n!==t)),this.scheduleGc(),P(this,jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,zn).length||(this.state.status==="pending"?this.scheduleGc():P(this,jt).remove(this))}continue(){var t,n;return(n=(t=P(this,vi))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}async execute(t){var s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,S,x,O,C,_,k;const n=()=>{Te(this,Hn,Or).call(this,{type:"continue"})};X(this,vi,b0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,j)=>{Te(this,Hn,Or).call(this,{type:"failed",failureCount:E,error:j})},onPause:()=>{Te(this,Hn,Or).call(this,{type:"pause"})},onContinue:n,retry:(s=this.options.retry)!=null?s:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,jt).canRun(this)}));const r=this.state.status==="pending",i=!P(this,vi).canStart();try{if(r)n();else{Te(this,Hn,Or).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=P(this,jt).config).onMutate)==null?void 0:a.call(o,t,this));const j=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));j!==this.state.context&&Te(this,Hn,Or).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const E=await P(this,vi).start();return await((d=(u=P(this,jt).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,E,t,this.state.context)),await((m=(g=P(this,jt).config).onSettled)==null?void 0:m.call(g,E,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,E,null,t,this.state.context)),Te(this,Hn,Or).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(b=P(this,jt).config).onError)==null?void 0:w.call(b,E,t,this.state.context,this)),await((x=(S=this.options).onError)==null?void 0:x.call(S,E,t,this.state.context)),await((C=(O=P(this,jt).config).onSettled)==null?void 0:C.call(O,void 0,E,this.state.variables,this.state.context,this)),await((k=(_=this.options).onSettled)==null?void 0:k.call(_,void 0,E,t,this.state.context)),E}finally{Te(this,Hn,Or).call(this,{type:"error",error:E})}}finally{P(this,jt).runNext(this)}}},zn=new WeakMap,jt=new WeakMap,vi=new WeakMap,Hn=new WeakSet,Or=function(t){const n=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=n(this.state),gt.batch(()=>{P(this,zn).forEach(r=>{r.onMutationUpdate(t)}),P(this,jt).notify({mutation:this,type:"updated",action:t})})},Kp);function S0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rr,On,va,Wp,M2=(Wp=class extends Us{constructor(t={}){super();ae(this,rr);ae(this,On);ae(this,va);this.config=t,X(this,rr,new Set),X(this,On,new Map),X(this,va,0)}build(t,n,r){const i=new j2({mutationCache:this,mutationId:++Va(this,va)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){P(this,rr).add(t);const n=Ya(t);if(typeof n=="string"){const r=P(this,On).get(n);r?r.push(t):P(this,On).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,rr).delete(t)){const n=Ya(t);if(typeof n=="string"){const r=P(this,On).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&P(this,On).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ya(t);if(typeof n=="string"){const r=P(this,On).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r,i;const n=Ya(t);if(typeof n=="string"){const s=(r=P(this,On).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i=s==null?void 0:s.continue())!=null?i:Promise.resolve()}else return Promise.resolve()}clear(){gt.batch(()=>{P(this,rr).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,rr).clear(),P(this,On).clear()})}getAll(){return Array.from(P(this,rr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ph(n,r))}findAll(t={}){return this.getAll().filter(n=>Ph(t,n))}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return gt.batch(()=>Promise.all(t.map(n=>n.continue().catch($t))))}},rr=new WeakMap,On=new WeakMap,va=new WeakMap,Wp);function Ya(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Mh(e){return{onFetch:(t,n)=>{var u,d,f,h,g;const r=t.options,i=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{var w;let m=!1;const p=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},v=y0(t.options,t.fetchOptions),b=async(S,x,O)=>{if(m)return Promise.reject();if(x==null&&S.pages.length)return Promise.resolve(S);const _=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:x,direction:O?"backward":"forward",meta:t.options.meta};return p(D),D})(),k=await v(_),{maxPages:E}=t.options,j=O?S2:w2;return{pages:j(S.pages,k,E),pageParams:j(S.pageParams,x,E)}};if(i&&s.length){const S=i==="backward",x=S?$2:$h,O={pages:s,pageParams:o},C=x(r,O);a=await b(O,C,S)}else{const S=e!=null?e:s.length;do{const x=l===0?(w=o[0])!=null?w:r.initialPageParam:$h(r,a);if(l>0&&x==null)break;a=await b(a,x),l++}while(l<S)}return a};t.options.persister?t.fetchFn=()=>{var m,p;return(p=(m=t.options).persister)==null?void 0:p.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function $h(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ut,Pr,Tr,ds,fs,jr,hs,gs,Vp,D2=(Vp=class{constructor(e={}){ae(this,ut);ae(this,Pr);ae(this,Tr);ae(this,ds);ae(this,fs);ae(this,jr);ae(this,hs);ae(this,gs);X(this,ut,e.queryCache||new T2),X(this,Pr,e.mutationCache||new M2),X(this,Tr,e.defaultOptions||{}),X(this,ds,new Map),X(this,fs,new Map),X(this,jr,0)}mount(){Va(this,jr)._++,P(this,jr)===1&&(X(this,hs,uf.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ut).onFocus())})),X(this,gs,Ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ut).onOnline())})))}unmount(){var e,t;Va(this,jr)._--,P(this,jr)===0&&((e=P(this,hs))==null||e.call(this),X(this,hs,void 0),(t=P(this,gs))==null||t.call(this),X(this,gs,void 0))}isFetching(e){return P(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,Pr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,ut).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,ut).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=P(this,ut).get(r.queryHash),s=i==null?void 0:i.state.data,o=b2(t,s);if(o!==void 0)return P(this,ut).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return gt.batch(()=>P(this,ut).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,ut);gt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,ut);return gt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=gt.batch(()=>P(this,ut).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($t).catch($t)}invalidateQueries(e,t={}){return gt.batch(()=>{var n,r;return P(this,ut).findAll(e).forEach(i=>{i.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(r=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?r:"active"},t)})}refetchQueries(e,t={}){var i;const n={...t,cancelRefetch:(i=t.cancelRefetch)!=null?i:!0},r=gt.batch(()=>P(this,ut).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($t)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,ut).build(this,t);return n.isStaleByTime(qr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($t).catch($t)}fetchInfiniteQuery(e){return e.behavior=Mh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($t).catch($t)}ensureInfiniteQueryData(e){return e.behavior=Mh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ls.isOnline()?P(this,Pr).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,ut)}getMutationCache(){return P(this,Pr)}getDefaultOptions(){return P(this,Tr)}setDefaultOptions(e){X(this,Tr,e)}setQueryDefaults(e,t){P(this,ds).set(Ai(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ds).values()],n={};return t.forEach(r=>{Ho(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,fs).set(Ai(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,fs).values()],n={};return t.forEach(r=>{Ho(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Tr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ll&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Tr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,ut).clear(),P(this,Pr).clear()}},ut=new WeakMap,Pr=new WeakMap,Tr=new WeakMap,ds=new WeakMap,fs=new WeakMap,jr=new WeakMap,hs=new WeakMap,gs=new WeakMap,Vp),Nt,Ie,ba,Mt,bi,ys,Mr,$r,xa,ms,ps,xi,wi,Dr,vs,Ke,Co,Gu,Qu,Yu,Xu,Ju,Zu,ed,C0,Gp,I2=(Gp=class extends Us{constructor(t,n){super();ae(this,Ke);ae(this,Nt);ae(this,Ie);ae(this,ba);ae(this,Mt);ae(this,bi);ae(this,ys);ae(this,Mr);ae(this,$r);ae(this,xa);ae(this,ms);ae(this,ps);ae(this,xi);ae(this,wi);ae(this,Dr);ae(this,vs,new Set);this.options=n,X(this,Nt,t),X(this,$r,null),X(this,Mr,Vu()),this.options.experimental_prefetchInRender||P(this,Mr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Ie).addObserver(this),Dh(P(this,Ie),this.options)?Te(this,Ke,Co).call(this):this.updateResult(),Te(this,Ke,Xu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(P(this,Ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(P(this,Ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ke,Ju).call(this),Te(this,Ke,Zu).call(this),P(this,Ie).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,Ie);if(this.options=P(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hn(this.options.enabled,P(this,Ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ke,ed).call(this),P(this,Ie).setOptions(this.options),n._defaulted&&!Il(this.options,n)&&P(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Ie),observer:this});const i=this.hasListeners();i&&Ih(P(this,Ie),r,this.options,n)&&Te(this,Ke,Co).call(this),this.updateResult(),i&&(P(this,Ie)!==r||hn(this.options.enabled,P(this,Ie))!==hn(n.enabled,P(this,Ie))||qr(this.options.staleTime,P(this,Ie))!==qr(n.staleTime,P(this,Ie)))&&Te(this,Ke,Gu).call(this);const s=Te(this,Ke,Qu).call(this);i&&(P(this,Ie)!==r||hn(this.options.enabled,P(this,Ie))!==hn(n.enabled,P(this,Ie))||s!==P(this,Dr))&&Te(this,Ke,Yu).call(this,s)}getOptimisticResult(t){const n=P(this,Nt).getQueryCache().build(P(this,Nt),t),r=this.createResult(n,t);return R2(this,r)&&(X(this,Mt,r),X(this,ys,this.options),X(this,bi,P(this,Ie).state)),r}getCurrentResult(){return P(this,Mt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){P(this,vs).add(t)}getCurrentQuery(){return P(this,Ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Nt).defaultQueryOptions(t),r=P(this,Nt).getQueryCache().build(P(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return Te(this,Ke,Co).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),P(this,Mt)))}createResult(t,n){var k;const r=P(this,Ie),i=this.options,s=P(this,Mt),o=P(this,bi),a=P(this,ys),c=t!==r?t.state:P(this,ba),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),j=!E&&Dh(t,n),D=E&&Ih(t,r,n,i);(j||D)&&(d={...d,...w0(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:p}=d;h=d.data;let v=!1;if(n.placeholderData!==void 0&&h===void 0&&p==="pending"){let E;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(E=s.data,v=!0):E=typeof n.placeholderData=="function"?n.placeholderData((k=P(this,ps))==null?void 0:k.state.data,P(this,ps)):n.placeholderData,E!==void 0&&(p="success",h=Wu(s==null?void 0:s.data,E,n),f=!0)}if(n.select&&h!==void 0&&!v)if(s&&h===(o==null?void 0:o.data)&&n.select===P(this,xa))h=P(this,ms);else try{X(this,xa,n.select),h=n.select(h),h=Wu(s==null?void 0:s.data,h,n),X(this,ms,h),X(this,$r,null)}catch(E){X(this,$r,E)}P(this,$r)&&(g=P(this,$r),h=P(this,ms),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",w=p==="pending",S=p==="error",x=w&&b,O=h!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:w,isSuccess:p==="success",isError:S,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:m,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:b,isRefetching:b&&!w,isLoadingError:S&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&O,isStale:df(t,n),refetch:this.refetch,promise:P(this,Mr),isEnabled:hn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=z=>{_.status==="error"?z.reject(_.error):_.data!==void 0&&z.resolve(_.data)},j=()=>{const z=X(this,Mr,_.promise=Vu());E(z)},D=P(this,Mr);switch(D.status){case"pending":t.queryHash===r.queryHash&&E(D);break;case"fulfilled":(_.status==="error"||_.data!==D.value)&&j();break;case"rejected":(_.status!=="error"||_.error!==D.reason)&&j();break}}return _}updateResult(){const t=P(this,Mt),n=this.createResult(P(this,Ie),this.options);if(X(this,bi,P(this,Ie).state),X(this,ys,this.options),P(this,bi).data!==void 0&&X(this,ps,P(this,Ie)),Il(n,t))return;X(this,Mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!P(this,vs).size)return!0;const o=new Set(s!=null?s:P(this,vs));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Mt)).some(a=>{const l=a;return P(this,Mt)[l]!==t[l]&&o.has(l)})};Te(this,Ke,C0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ke,Xu).call(this)}},Nt=new WeakMap,Ie=new WeakMap,ba=new WeakMap,Mt=new WeakMap,bi=new WeakMap,ys=new WeakMap,Mr=new WeakMap,$r=new WeakMap,xa=new WeakMap,ms=new WeakMap,ps=new WeakMap,xi=new WeakMap,wi=new WeakMap,Dr=new WeakMap,vs=new WeakMap,Ke=new WeakSet,Co=function(t){Te(this,Ke,ed).call(this);let n=P(this,Ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($t)),n},Gu=function(){Te(this,Ke,Ju).call(this);const t=qr(this.options.staleTime,P(this,Ie));if(Ei||P(this,Mt).isStale||!Hu(t))return;const r=g0(P(this,Mt).dataUpdatedAt,t)+1;X(this,xi,setTimeout(()=>{P(this,Mt).isStale||this.updateResult()},r))},Qu=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Ie)):this.options.refetchInterval)!=null?t:!1},Yu=function(t){Te(this,Ke,Zu).call(this),X(this,Dr,t),!(Ei||hn(this.options.enabled,P(this,Ie))===!1||!Hu(P(this,Dr))||P(this,Dr)===0)&&X(this,wi,setInterval(()=>{(this.options.refetchIntervalInBackground||uf.isFocused())&&Te(this,Ke,Co).call(this)},P(this,Dr)))},Xu=function(){Te(this,Ke,Gu).call(this),Te(this,Ke,Yu).call(this,Te(this,Ke,Qu).call(this))},Ju=function(){P(this,xi)&&(clearTimeout(P(this,xi)),X(this,xi,void 0))},Zu=function(){P(this,wi)&&(clearInterval(P(this,wi)),X(this,wi,void 0))},ed=function(){const t=P(this,Nt).getQueryCache().build(P(this,Nt),this.options);if(t===P(this,Ie))return;const n=P(this,Ie);X(this,Ie,t),X(this,ba,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},C0=function(t){gt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Mt))}),P(this,Nt).getQueryCache().notify({query:P(this,Ie),type:"observerResultsUpdated"})})},Gp);function L2(e,t){return hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dh(e,t){return L2(e,t)||e.state.data!==void 0&&td(e,t,t.refetchOnMount)}function td(e,t,n){if(hn(t.enabled,e)!==!1&&qr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&df(e,t)}return!1}function Ih(e,t,n,r){return(e!==t||hn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&df(e,n)}function df(e,t){return hn(t.enabled,e)!==!1&&e.isStaleByTime(qr(t.staleTime,e))}function R2(e,t){return!Il(e.getCurrentResult(),t)}var Ir,Lr,Ft,ir,dr,_l,nd,Qp,N2=(Qp=class extends Us{constructor(n,r){super();ae(this,dr);ae(this,Ir);ae(this,Lr);ae(this,Ft);ae(this,ir);X(this,Ir,n),this.setOptions(r),this.bindMethods(),Te(this,dr,_l).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=P(this,Ir).defaultMutationOptions(n),Il(this.options,r)||P(this,Ir).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Ft),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ai(r.mutationKey)!==Ai(this.options.mutationKey)?this.reset():((i=P(this,Ft))==null?void 0:i.state.status)==="pending"&&P(this,Ft).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Ft))==null||n.removeObserver(this)}onMutationUpdate(n){Te(this,dr,_l).call(this),Te(this,dr,nd).call(this,n)}getCurrentResult(){return P(this,Lr)}reset(){var n;(n=P(this,Ft))==null||n.removeObserver(this),X(this,Ft,void 0),Te(this,dr,_l).call(this),Te(this,dr,nd).call(this)}mutate(n,r){var i;return X(this,ir,r),(i=P(this,Ft))==null||i.removeObserver(this),X(this,Ft,P(this,Ir).getMutationCache().build(P(this,Ir),this.options)),P(this,Ft).addObserver(this),P(this,Ft).execute(n)}},Ir=new WeakMap,Lr=new WeakMap,Ft=new WeakMap,ir=new WeakMap,dr=new WeakSet,_l=function(){var r,i;const n=(i=(r=P(this,Ft))==null?void 0:r.state)!=null?i:S0();X(this,Lr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},nd=function(n){gt.batch(()=>{var r,i,s,o,a,l,c,u;if(P(this,ir)&&this.hasListeners()){const d=P(this,Lr).variables,f=P(this,Lr).context;(n==null?void 0:n.type)==="success"?((i=(r=P(this,ir)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=P(this,ir)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=P(this,ir)).onError)==null||l.call(a,n.error,d,f),(u=(c=P(this,ir)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(P(this,Lr))})})},Qp),_0=$.createContext(void 0),Kt=e=>{const t=$.useContext(_0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},F2=({client:e,children:t})=>($.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(_0.Provider,{value:e,children:t})),k0=$.createContext(!1),B2=()=>$.useContext(k0);k0.Provider;function q2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z2=$.createContext(q2()),H2=()=>$.useContext(z2),U2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},K2=e=>{$.useEffect(()=>{e.clearReset()},[e])},W2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||m0(n,[e.error,r])),V2=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r!=null?r:1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},G2=(e,t)=>e.isLoading&&e.isFetching&&!t,Q2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Lh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Y2(e,t,n){var d,f,h,g,m;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=B2(),i=H2(),s=Kt(n),o=s.defaultQueryOptions(e);(f=(d=s.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=r?"isRestoring":"optimistic",V2(o),U2(o,i),K2(i);const a=!s.getQueryCache().get(o.queryHash),[l]=$.useState(()=>new t(s,o)),c=l.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if($.useSyncExternalStore($.useCallback(p=>{const v=u?l.subscribe(gt.batchCalls(p)):$t;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),$.useEffect(()=>{l.setOptions(o)},[o,l]),Q2(o,c))throw Lh(o,l,i);if(W2({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,c),o.experimental_prefetchInRender&&!Ei&&G2(c,r)){const p=a?Lh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch($t).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function mr(e,t){return Y2(e,I2,t)}function pr(e,t){const n=Kt(t),[r]=$.useState(()=>new N2(n,e));$.useEffect(()=>{r.setOptions(e)},[r,e]);const i=$.useSyncExternalStore($.useCallback(o=>r.subscribe(gt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=$.useCallback((o,a)=>{r.mutate(o,a).catch($t)},[r]);if(i.error&&m0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Oe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Rh(this.context.count)},getNextContextId(){return Rh(this.context.count++)}};function Rh(e){const t=String(e),n=t.length-1;return Oe.context.id+(n?String.fromCharCode(96+n):"")+t}function _o(e){Oe.context=e}var O0=!1,X2=(e,t)=>e===t,Rl=Symbol("solid-proxy"),E0=typeof Proxy=="function",yc=Symbol("solid-track"),Nl={equals:X2},A0=D0,vr=1,Fl=2,P0={owned:null,cleanups:null,context:null,owner:null},tu={},qe=null,nu=null,J2=null,Je=null,Pt=null,cr=null,mc=0;function ur(e,t){const n=Je,r=qe,i=e.length===0,s=t===void 0?r:t,o=i?P0:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>ct(()=>Uo(o)));qe=o,Je=null;try{return Kn(a,!0)}finally{Je=n,qe=r}}function se(e,t){t=t?Object.assign({},Nl,t):Nl;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),$0(n,i));return[M0.bind(n),r]}function T0(e,t,n){const r=pc(e,t,!0,vr);Ks(r)}function ve(e,t,n){const r=pc(e,t,!1,vr);Ks(r)}function be(e,t,n){A0=cS;const r=pc(e,t,!1,vr);(!n||!n.render)&&(r.user=!0),cr?cr.push(r):Ks(r)}function U(e,t,n){n=n?Object.assign({},Nl,n):Nl;const r=pc(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ks(r),M0.bind(r)}function Z2(e){return e&&typeof e=="object"&&"then"in e}function eS(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=tu,l=null,c=!1,u="initialValue"in s,d=typeof r=="function"&&U(r);const f=new Set,[h,g]=(s.storage||se)(s.initialValue),[m,p]=se(void 0),[v,b]=se(void 0,{equals:!1}),[w,S]=se(u?"ready":"unresolved");Oe.context&&(l=Oe.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Oe.load&&Oe.has(l)&&(a=Oe.load(l)));function x(k,E,j,D){return o===k&&(o=null,D!==void 0&&(u=!0),(k===a||E===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(D,{value:E})),a=tu,O(E,j)),E}function O(k,E){Kn(()=>{E===void 0&&g(()=>k),S(E!==void 0?"errored":u?"ready":"unresolved"),p(E);for(const j of f.keys())j.decrement();f.clear()},!1)}function C(){const k=oS,E=h(),j=m();if(j!==void 0&&!o)throw j;return Je&&Je.user,E}function _(k=!0){if(k!==!1&&c)return;c=!1;const E=d?d():r;if(E==null||E===!1){x(o,ct(h));return}const j=a!==tu?a:ct(()=>i(E,{value:h(),refetching:k}));return Z2(j)?(o=j,"value"in j?(j.status==="success"?x(o,j.value,void 0,E):x(o,void 0,rd(j.value),E),j):(c=!0,queueMicrotask(()=>c=!1),Kn(()=>{S(u?"refreshing":"pending"),b()},!1),j.then(D=>x(j,D,void 0,E),D=>x(j,void 0,rd(D),E)))):(x(o,j,void 0,E),j)}return Object.defineProperties(C,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const k=w();return k==="pending"||k==="refreshing"}},latest:{get(){if(!u)return C();const k=m();if(k&&!o)throw k;return h()}}}),d?T0(()=>_(!1)):_(!1),[C,{refetch:_,mutate:g}]}function tS(e){return Kn(e,!1)}function ct(e){if(Je===null)return e();const t=Je;Je=null;try{return e()}finally{Je=t}}function hr(e,t,n){const r=Array.isArray(e);let i,s=n&&n.defer;return o=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(s)return s=!1,o;const l=ct(()=>t(a,i,o));return i=a,l}}function gr(e){be(()=>ct(e))}function Se(e){return qe===null||(qe.cleanups===null?qe.cleanups=[e]:qe.cleanups.push(e)),e}function Nh(){return qe}function nS(e,t){const n=qe,r=Je;qe=e,Je=null;try{return Kn(t,!0)}catch(i){ff(i)}finally{qe=n,Je=r}}function rS(e){const t=Je,n=qe;return Promise.resolve().then(()=>{Je=t,qe=n;let r;return Kn(e,!1),Je=qe=null,r?r.done:void 0})}var[iS,NN]=se(!1);function sS(){return[iS,rS]}function wt(e,t){const n=Symbol("context");return{id:n,Provider:uS(n),defaultValue:e}}function St(e){let t;return qe&&qe.context&&(t=qe.context[e.id])!==void 0?t:e.defaultValue}function j0(e){const t=U(e),n=U(()=>id(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var oS;function M0(){if(this.sources&&this.state)if(this.state===vr)Ks(this);else{const e=Pt;Pt=null,Kn(()=>ql(this),!1),Pt=e}if(Je){const e=this.observers?this.observers.length:0;Je.sources?(Je.sources.push(this),Je.sourceSlots.push(e)):(Je.sources=[this],Je.sourceSlots=[e]),this.observers?(this.observers.push(Je),this.observerSlots.push(Je.sources.length-1)):(this.observers=[Je],this.observerSlots=[Je.sources.length-1])}return this.value}function $0(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Kn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=nu&&nu.running;o&&nu.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Pt.push(s):cr.push(s),s.observers&&I0(s)),o||(s.state=vr)}if(Pt.length>1e6)throw Pt=[],new Error},!1)),t}function Ks(e){if(!e.fn)return;Uo(e);const t=mc;aS(e,e.value,t)}function aS(e,t,n){let r;const i=qe,s=Je;Je=qe=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=vr,e.owned&&e.owned.forEach(Uo),e.owned=null),e.updatedAt=n+1,ff(o)}finally{Je=s,qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?$0(e,r):e.value=r,e.updatedAt=n)}function pc(e,t,n,r=vr,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:qe,context:qe?qe.context:null,pure:n};return qe===null||qe!==P0&&(qe.owned?qe.owned.push(s):qe.owned=[s]),s}function Bl(e){if(e.state===0)return;if(e.state===Fl)return ql(e);if(e.suspense&&ct(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<mc);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===vr)Ks(e);else if(e.state===Fl){const r=Pt;Pt=null,Kn(()=>ql(e,t[0]),!1),Pt=r}}function Kn(e,t){if(Pt)return e();let n=!1;t||(Pt=[]),cr?n=!0:cr=[],mc++;try{const r=e();return lS(n),r}catch(r){n||(cr=null),Pt=null,ff(r)}}function lS(e){if(Pt&&(D0(Pt),Pt=null),e)return;const t=cr;cr=null,t.length&&Kn(()=>A0(t),!1)}function D0(e){for(let t=0;t<e.length;t++)Bl(e[t])}function cS(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Bl(r)}if(Oe.context){if(Oe.count){Oe.effects||(Oe.effects=[]),Oe.effects.push(...e.slice(0,n));return}_o()}for(Oe.effects&&(Oe.done||!Oe.count)&&(e=[...Oe.effects,...e],n+=Oe.effects.length,delete Oe.effects),t=0;t<n;t++)Bl(e[t])}function ql(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===vr?r!==t&&(!r.updatedAt||r.updatedAt<mc)&&Bl(r):i===Fl&&ql(r,t)}}}function I0(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Fl,n.pure?Pt.push(n):cr.push(n),n.observers&&I0(n))}}function Uo(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Uo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Uo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function rd(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ff(e,t=qe){throw rd(e)}function id(e){if(typeof e=="function"&&!e.length)return id(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=id(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function uS(e,t){return function(r){let i;return ve(()=>i=ct(()=>(qe.context={...qe.context,[e]:r.value},j0(()=>r.children))),void 0),i}}var sd=Symbol("fallback");function zl(e){for(let t=0;t<e.length;t++)e[t]()}function dS(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return Se(()=>zl(s)),()=>{let l=e()||[],c=l.length,u,d;return l[yc],ct(()=>{let h,g,m,p,v,b,w,S,x;if(c===0)o!==0&&(zl(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[sd],i[0]=ur(O=>(s[0]=O,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=ur(f);o=c}else{for(m=new Array(c),p=new Array(c),a&&(v=new Array(c)),b=0,w=Math.min(o,c);b<w&&r[b]===l[b];b++);for(w=o-1,S=c-1;w>=b&&S>=b&&r[w]===l[S];w--,S--)m[S]=i[w],p[S]=s[w],a&&(v[S]=a[w]);for(h=new Map,g=new Array(S+1),d=S;d>=b;d--)x=l[d],u=h.get(x),g[d]=u===void 0?-1:u,h.set(x,d);for(u=b;u<=w;u++)x=r[u],d=h.get(x),d!==void 0&&d!==-1?(m[d]=i[u],p[d]=s[u],a&&(v[d]=a[u]),d=g[d],h.set(x,d)):s[u]();for(d=b;d<c;d++)d in m?(i[d]=m[d],s[d]=p[d],a&&(a[d]=v[d],a[d](d))):i[d]=ur(f);i=i.slice(0,o=c),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=se(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function fS(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return Se(()=>zl(s)),()=>{const c=e()||[],u=c.length;return c[yc],ct(()=>{if(u===0)return a!==0&&(zl(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[sd],i[0]=ur(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===sd&&(s[0](),s=[],r=[],i=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=ur(d));for(;l<r.length;l++)s[l]();return a=o.length=s.length=u,r=c.slice(0),i=i.slice(0,a)});function d(f){s[l]=f;const[h,g]=se(c[l]);return o[l]=g,t(h,l)}}}function T(e,t){return ct(()=>e(t||{}))}function Xa(){return!0}var od={get(e,t,n){return t===Rl?n:e.get(t)},has(e,t){return t===Rl?!0:e.has(t)},set:Xa,deleteProperty:Xa,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Xa,deleteProperty:Xa}},ownKeys(e){return e.keys()}};function ru(e){return(e=typeof e=="function"?e():e)?e:{}}function hS(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Ee(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Rl in a,e[o]=typeof a=="function"?(t=!0,U(a)):a}if(E0&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=ru(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ru(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ru(e[a])));return[...new Set(o)]}},od);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:hS.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function We(e,...t){if(E0&&Rl in e){const i=new Set(t.length>1?t.flat():t[0]),s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},od));return s.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},od)),s}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,i),o=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const c of t)c.includes(i)&&(a=!0,o?r[l][i]=s.value:Object.defineProperty(r[l],i,s)),++l;a||(o?n[i]=s.value:Object.defineProperty(n,i,s))}return[...r,n]}function L0(e){let t,n;const r=i=>{const s=Oe.context;if(s){const[a,l]=se();Oe.count||(Oe.count=0),Oe.count++,(n||(n=e())).then(c=>{!Oe.done&&_o(s),Oe.count--,l(()=>c.default),_o()}),t=a}else if(!t){const[a]=eS(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return U(()=>(o=t())?ct(()=>{if(!s||Oe.done)return o(i);const a=Oe.context;_o(s);const l=o(i);return _o(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var gS=0;function wn(){return Oe.context?Oe.getNextContextId():`cl-${gS++}`}var R0=e=>`Stale read from <${e}>.`;function yS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(dS(()=>e.each,e.children,t||void 0))}function mS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(fS(()=>e.each,e.children,t||void 0))}function pe(e){const t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(i,s)=>!i==!s});return U(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?ct(()=>s(t?i:()=>{if(!ct(r))throw R0("Show");return n()})):s}return e.fallback},void 0,void 0)}function pS(e){const t=j0(()=>e.children),n=U(()=>{const r=t(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;o<i.length;o++){const a=o,l=i[o],c=s,u=U(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:U(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return U(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?ct(()=>a(o.keyed?s():()=>{var c;if(((c=ct(n)())==null?void 0:c[0])!==i)throw R0("Match");return s()})):a},void 0,void 0)}function iu(e){return e}var vS=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],bS=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...vS]),xS=new Set(["innerHTML","textContent","innerText","children"]),wS=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),SS=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function CS(e,t){const n=SS[e];return typeof n=="object"?n[t]?n.$:void 0:n}var _S=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),kS=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","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-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),OS={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ES(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,c=null;for(;o<i||a<s;){if(t[o]===n[a]){o++,a++;continue}for(;t[i-1]===n[s-1];)i--,s--;if(i===o){const u=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],u)}else if(s===a)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[a]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[a++],t[o++].nextSibling),e.insertBefore(n[--s],u),t[i]=n[s]}else{if(!c){c=new Map;let d=a;for(;d<s;)c.set(n[d],d++)}const u=c.get(t[o]);if(u!=null)if(a<u&&u<s){let d=o,f=1,h;for(;++d<i&&d<s&&!((h=c.get(t[d]))==null||h!==u+f);)f++;if(f>u-a){const g=t[o];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[o++])}else o++;else t[o++].remove()}}}var Lo="_$DX_DELEGATE";function N0(e,t,n,r={}){let i;return ur(s=>{i=s,t===document?e():W(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function de(e,t,n,r){let i;const s=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},o=()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function vc(e,t=window.document){const n=t[Lo]||(t[Lo]=new Set);for(let r=0,i=e.length;r<i;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,q0))}}function AS(e=window.document){if(e[Lo]){for(let t of e[Lo].keys())e.removeEventListener(t,q0);delete e[Lo]}}function Z(e,t,n){Ni(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function PS(e,t,n,r){Ni(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function TS(e,t,n){Ni(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function te(e,t){Ni(e)||(t==null?e.removeAttribute("class"):e.className=t)}function F0(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=s=>i.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function jS(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let s,o;for(s=0,o=i.length;s<o;s++){const a=i[s];!a||a==="undefined"||t[a]||(Fh(e,a,!1),delete n[a])}for(s=0,o=r.length;s<o;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Fh(e,a,!0),n[a]=l)}return n}function MS(e,t,n){if(!t)return n?Z(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)i=t[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function B0(e,t={},n,r){const i={};return r||ve(()=>i.children=Ko(e,t.children,i.children)),ve(()=>typeof t.ref=="function"&&Ws(t.ref,e)),ve(()=>$S(e,t,n,!0,i,!0)),i}function Ws(e,t,n){return ct(()=>e(t,n))}function W(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ko(e,t,r,n);ve(i=>Ko(e,t(),i,n),r)}function $S(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Bh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=Bh(e,o,a,i[o],n,s,t)}}function DS(e){let t,n;return!Ni()||!(t=Oe.registry.get(n=LS()))?e():(Oe.completed&&Oe.completed.add(t),Oe.registry.delete(n),t)}function Ni(e){return!!Oe.context&&!Oe.done&&(!e||e.isConnected)}function IS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Fh(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,s=r.length;i<s;i++)e.classList.toggle(r[i],n)}function Bh(e,t,n,r,i,s,o){let a,l,c,u,d;if(t==="style")return MS(e,n,r);if(t==="classList")return jS(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=_S.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(F0(e,f,n,h),h&&vc([f]))}else if(t.slice(0,5)==="attr:")Z(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")TS(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=xS.has(t))||!i&&((u=CS(t,e.tagName))||(l=bS.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Ni(e))return n;t==="class"||t==="className"?te(e,n):a&&!l&&!c?e[IS(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&OS[t.split(":")[0]];f?PS(e,f,t,n):Z(e,wS[t]||t,n)}return n}function q0(e){if(Oe.registry&&Oe.events&&Oe.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Oe.registry&&!Oe.done&&(Oe.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();s(r)}function Ko(e,t,n,r,i){const s=Ni(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(s||o==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Wi(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(s)return n;n=Wi(e,n,r)}else{if(o==="function")return ve(()=>{let l=t();for(;typeof l=="function";)l=l();n=Ko(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ad(l,t,n,i))return ve(()=>n=Ko(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Wi(e,n,r),a)return n}else c?n.length===0?qh(e,l,r):ES(e,n,l):(n&&Wi(e),qh(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=Wi(e,n,r,t);Wi(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ad(e,t,n,r){let i=!1;for(let s=0,o=t.length;s<o;s++){let a=t[s],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=ad(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=ad(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function qh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Wi(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else s=!0}}else e.insertBefore(i,n);return[i]}function LS(){return Oe.getNextContextId()}var RS="http://www.w3.org/2000/svg";function z0(e,t=!1){return t?document.createElementNS(RS,e):document.createElement(e)}function H0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Nh();let s,o=!!Oe.context;return be(()=>{o&&(Nh().user=o=!1),s||(s=nS(i,()=>U(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=se(!1),u=()=>c(!0);ur(d=>W(a,()=>l()?d():s(),null)),Se(u)}else{const l=z0(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),W(c,s),a.appendChild(l),e.ref&&e.ref(l),Se(()=>a.removeChild(l))}},void 0,{render:!o}),n}function NS(e,t){const n=U(e);return U(()=>{const r=n();switch(typeof r){case"function":return ct(()=>r(t));case"string":const i=kS.has(r),s=Oe.context?DS():z0(r,i);return B0(s,t,i),s}})}function FS(e){const[,t]=We(e,["component"]);return NS(()=>e.component,t)}var BS=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},U0=class{constructor(t){this.generateIdentifier=t,this.kv=new BS}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},qS=class extends U0{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function zS(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function HS(e,t){const n=zS(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const s=r[i];if(t(s))return s}}function Rs(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function kl(e,t){return e.indexOf(t)!==-1}function zh(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var US=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return HS(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},KS=e=>Object.prototype.toString.call(e).slice(8,-1),K0=e=>typeof e=="undefined",WS=e=>e===null,Wo=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ld=e=>Wo(e)&&Object.keys(e).length===0,Kr=e=>Array.isArray(e),VS=e=>typeof e=="string",GS=e=>typeof e=="number"&&!isNaN(e),QS=e=>typeof e=="boolean",YS=e=>e instanceof RegExp,Vo=e=>e instanceof Map,Go=e=>e instanceof Set,W0=e=>KS(e)==="Symbol",XS=e=>e instanceof Date&&!isNaN(e.valueOf()),JS=e=>e instanceof Error,Hh=e=>typeof e=="number"&&isNaN(e),ZS=e=>QS(e)||WS(e)||K0(e)||GS(e)||VS(e)||W0(e),eC=e=>typeof e=="bigint",tC=e=>e===1/0||e===-1/0,nC=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),rC=e=>e instanceof URL,V0=e=>e.replace(/\./g,"\\."),su=e=>e.map(String).map(V0).join("."),Ro=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(s==="."){t.push(n),n="";continue}n+=s}const r=n;return t.push(r),t};function $n(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var G0=[$n(K0,"undefined",()=>null,()=>{}),$n(eC,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),$n(XS,"Date",e=>e.toISOString(),e=>new Date(e)),$n(JS,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),$n(YS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),$n(Go,"set",e=>[...e.values()],e=>new Set(e)),$n(Vo,"map",e=>[...e.entries()],e=>new Map(e)),$n(e=>Hh(e)||tC(e),"number",e=>Hh(e)?"NaN":e>0?"Infinity":"-Infinity",Number),$n(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),$n(rC,"URL",e=>e.toString(),e=>new URL(e))];function bc(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var Q0=bc((e,t)=>W0(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),iC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Y0=bc(nC,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=iC[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function X0(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var J0=bc(X0,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),Z0=bc((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),sC=[J0,Q0,Z0,Y0],Uh=(e,t)=>{const n=zh(sC,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=zh(G0,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},ev={};G0.forEach(e=>{ev[e.annotation]=e});var oC=(e,t,n)=>{if(Kr(t))switch(t[0]){case"symbol":return Q0.untransform(e,t,n);case"class":return J0.untransform(e,t,n);case"custom":return Z0.untransform(e,t,n);case"typed-array":return Y0.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=ev[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},es=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function tv(e){if(kl(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(kl(e,"prototype"))throw new Error("prototype is not allowed as a property");if(kl(e,"constructor"))throw new Error("constructor is not allowed as a property")}var aC=(e,t)=>{tv(t);for(let n=0;n<t.length;n++){const r=t[n];if(Go(e))e=es(e,+r);else if(Vo(e)){const i=+r,s=+t[++n]==0?"key":"value",o=es(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},cd=(e,t,n)=>{if(tv(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(Kr(r)){const a=+o;r=r[a]}else if(Wo(r))r=r[o];else if(Go(r)){const a=+o;r=es(r,a)}else if(Vo(r)){if(s===t.length-2)break;const l=+o,c=+t[++s]==0?"key":"value",u=es(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(Kr(r)?r[+i]=n(r[+i]):Wo(r)&&(r[i]=n(r[i])),Go(r)){const s=es(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Vo(r)){const s=+t[t.length-2],o=es(r,s);switch(+i==0?"key":"value"){case"key":{const l=n(o);r.set(l,r.get(o)),l!==o&&r.delete(o);break}case"value":{r.set(o,n(r.get(o)));break}}}return e};function ud(e,t,n=[]){if(!e)return;if(!Kr(e)){Rs(e,(s,o)=>ud(s,t,[...n,...Ro(o)]));return}const[r,i]=e;i&&Rs(i,(s,o)=>{ud(s,t,[...n,...Ro(o)])}),t(r,n)}function lC(e,t,n){return ud(t,(r,i)=>{e=cd(e,i,s=>oC(s,r,n))}),e}function cC(e,t){function n(r,i){const s=aC(e,Ro(i));r.map(Ro).forEach(o=>{e=cd(e,o,()=>s)})}if(Kr(t)){const[r,i]=t;r.forEach(s=>{e=cd(e,Ro(s),()=>e)}),i&&Rs(i,n)}else Rs(t,n);return e}var uC=(e,t)=>Wo(e)||Kr(e)||Vo(e)||Go(e)||X0(e,t);function dC(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function fC(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[s,...o]=i;s.length===0?r=o.map(su):n[su(s)]=o.map(su)}),r?ld(n)?[r]:[r,n]:ld(n)?void 0:n}var nv=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=ZS(e);if(!a){dC(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!uC(e,n)){const g=Uh(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(kl(s,e))return{transformedValue:null};const l=Uh(e,n),c=(h=l==null?void 0:l.value)!=null?h:e,u=Kr(c)?[]:{},d={};Rs(c,(g,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const p=nv(g,t,n,r,[...i,m],[...s,e],o);u[m]=p.transformedValue,Kr(p.annotations)?d[m]=p.annotations:Wo(p.annotations)&&Rs(p.annotations,(v,b)=>{d[V0(m)+"."+b]=v})});const f=ld(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return a||o.set(e,f),f};function rv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Kh(e){return rv(e)==="Array"}function hC(e){if(rv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function gC(e,t,n,r,i){const s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=n),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dd(e,t={}){if(Kh(e))return e.map(i=>dd(i,t));if(!hC(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(Kh(t.props)&&!t.props.includes(s))return i;const o=e[s],a=dd(o,t);return gC(i,s,a,e,t.nonenumerable),i},{})}var Ze=class{constructor({dedupe:e=!1}={}){this.classRegistry=new qS,this.symbolRegistry=new U0(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new US,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=nv(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=fC(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=dd(t);return n!=null&&n.values&&(r=lC(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=cC(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Ze.defaultInstance=new Ze;Ze.serialize=Ze.defaultInstance.serialize.bind(Ze.defaultInstance);Ze.deserialize=Ze.defaultInstance.deserialize.bind(Ze.defaultInstance);Ze.stringify=Ze.defaultInstance.stringify.bind(Ze.defaultInstance);Ze.parse=Ze.defaultInstance.parse.bind(Ze.defaultInstance);Ze.registerClass=Ze.defaultInstance.registerClass.bind(Ze.defaultInstance);Ze.registerSymbol=Ze.defaultInstance.registerSymbol.bind(Ze.defaultInstance);Ze.registerCustom=Ze.defaultInstance.registerCustom.bind(Ze.defaultInstance);Ze.allowErrorProps=Ze.defaultInstance.allowErrorProps.bind(Ze.defaultInstance);var iv=Ze.serialize,yC=Ze.stringify;function Xi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function mC(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function pC({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ts({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function vC(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Hl=(e,t=!1)=>{const{json:n}=iv(e);return JSON.stringify(n,null,t?2:void 0)},Ja=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,bC=(e,t)=>e.queryHash.localeCompare(t.queryHash),sv=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,xC=(e,t)=>Ja(e)===Ja(t)?sv(e,t):Ja(e)>Ja(t)?1:-1,fd={status:xC,"query hash":bC,"last updated":sv},Za=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,ov=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,wC=(e,t)=>Za(e)===Za(t)?ov(e,t):Za(e)>Za(t)?1:-1,hd={status:wC,"last updated":ov},Wh=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),av=()=>{const[e,t]=se("dark");return gr(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",r),Se(()=>n.removeEventListener("change",r))}),e},ui=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[i,...s]=t;return r.set(i,ui(r.get(i),s,n)),r}if(e instanceof Set){const r=ui(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ui(r[i],s,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ui(r[i],s,n),r}return e},ko=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...i]=t;return n.set(r,ko(n.get(r),i)),n}if(e instanceof Set){const n=ko(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((s,o)=>o.toString()!==t[0]);const[r,...i]=t;return n[r]=ko(n[r],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...i]=t;return n[r]=ko(n[r],i),n}return e},lv=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const r=document.createElement("style"),i=document.createTextNode("");r.appendChild(i),r.id="_goober",r.setAttribute("nonce",e),t?t.appendChild(r):document.head.appendChild(r)},bs,wa,Sa,Ca,Si,_a,xs,ws,Ss,Cs,_s,ks,ka,Yp,SC=(Yp=class{constructor(e){ae(this,bs);ae(this,wa);ae(this,Sa);ae(this,Ca);ae(this,Si,!1);ae(this,_a);ae(this,xs);ae(this,ws);ae(this,Ss);ae(this,Cs);ae(this,_s);ae(this,ks);ae(this,ka);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;X(this,bs,se(t)),X(this,Sa,n),X(this,Ca,r),X(this,wa,i),X(this,_a,c),X(this,xs,u),X(this,ws,se(s)),X(this,Ss,se(o)),X(this,Cs,se(a)),X(this,_s,se(l))}setButtonPosition(e){P(this,ws)[1](e)}setPosition(e){P(this,Ss)[1](e)}setInitialIsOpen(e){P(this,Cs)[1](e)}setErrorTypes(e){P(this,_s)[1](e)}setClient(e){P(this,bs)[1](e)}mount(e){if(P(this,Si))throw new Error("Devtools is already mounted");const t=N0(()=>{const n=this,[r]=P(this,ws),[i]=P(this,Ss),[s]=P(this,Cs),[o]=P(this,_s),[a]=P(this,bs);let l;return P(this,ks)?l=P(this,ks):(l=L0(()=>Promise.resolve().then(()=>eR)),X(this,ks,l)),lv(P(this,_a),P(this,xs)),T(l,Ee({get queryFlavor(){return P(n,Sa)},get version(){return P(n,Ca)},get onlineManager(){return P(n,wa)},get shadowDOMTarget(){return P(n,xs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);X(this,Si,!0),X(this,ka,t)}unmount(){var e;if(!P(this,Si))throw new Error("Devtools is not mounted");(e=P(this,ka))==null||e.call(this),X(this,Si,!1)}},bs=new WeakMap,wa=new WeakMap,Sa=new WeakMap,Ca=new WeakMap,Si=new WeakMap,_a=new WeakMap,xs=new WeakMap,ws=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,_s=new WeakMap,ks=new WeakMap,ka=new WeakMap,Yp),Os,Oa,Ea,Aa,Ci,Pa,Es,As,Ps,Ts,js,Ms,$s,Ta,Xp,CC=(Xp=class{constructor(e){ae(this,Os);ae(this,Oa);ae(this,Ea);ae(this,Aa);ae(this,Ci,!1);ae(this,Pa);ae(this,Es);ae(this,As);ae(this,Ps);ae(this,Ts);ae(this,js);ae(this,Ms);ae(this,$s);ae(this,Ta);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;X(this,Os,se(t)),X(this,Ea,n),X(this,Aa,r),X(this,Oa,i),X(this,Pa,c),X(this,Es,u),X(this,As,se(s)),X(this,Ps,se(o)),X(this,Ts,se(a)),X(this,js,se(l)),X(this,Ms,se(d))}setButtonPosition(e){P(this,As)[1](e)}setPosition(e){P(this,Ps)[1](e)}setInitialIsOpen(e){P(this,Ts)[1](e)}setErrorTypes(e){P(this,js)[1](e)}setClient(e){P(this,Os)[1](e)}setOnClose(e){P(this,Ms)[1](()=>e)}mount(e){if(P(this,Ci))throw new Error("Devtools is already mounted");const t=N0(()=>{const n=this,[r]=P(this,As),[i]=P(this,Ps),[s]=P(this,Ts),[o]=P(this,js),[a]=P(this,Os),[l]=P(this,Ms);let c;return P(this,$s)?c=P(this,$s):(c=L0(()=>Promise.resolve().then(()=>rR)),X(this,$s,c)),lv(P(this,Pa),P(this,Es)),T(c,Ee({get queryFlavor(){return P(n,Ea)},get version(){return P(n,Aa)},get onlineManager(){return P(n,Oa)},get shadowDOMTarget(){return P(n,Es)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()},get onClose(){return l()}}))},e);X(this,Ci,!0),X(this,Ta,t)}unmount(){var e;if(!P(this,Ci))throw new Error("Devtools is not mounted");(e=P(this,Ta))==null||e.call(this),X(this,Ci,!1)}},Os=new WeakMap,Oa=new WeakMap,Ea=new WeakMap,Aa=new WeakMap,Ci=new WeakMap,Pa=new WeakMap,Es=new WeakMap,As=new WeakMap,Ps=new WeakMap,Ts=new WeakMap,js=new WeakMap,Ms=new WeakMap,$s=new WeakMap,Ta=new WeakMap,Xp);function _C(e){const t=Kt(e.client),n=$.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[c]=$.useState(new SC({client:t,queryFlavor:"React Query",version:"5",onlineManager:Ls,buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}));return $.useEffect(()=>{c.setClient(t)},[t,c]),$.useEffect(()=>{r&&c.setButtonPosition(r)},[r,c]),$.useEffect(()=>{i&&c.setPosition(i)},[i,c]),$.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),$.useEffect(()=>{c.setErrorTypes(o||[])},[o,c]),$.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),y.jsx("div",{dir:"ltr",className:"tsqd-parent-container",ref:n})}function kC(e){const t=Kt(e.client),n=$.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=$.useState(new CC({client:t,queryFlavor:"React Query",version:"5",onlineManager:Ls,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:s,onClose:e.onClose}));return $.useEffect(()=>{o.setClient(t)},[t,o]),$.useEffect(()=>{var a;o.setOnClose((a=e.onClose)!=null?a:()=>{})},[e.onClose,o]),$.useEffect(()=>{o.setErrorTypes(r||[])},[r,o]),$.useEffect(()=>(n.current&&o.mount(n.current),()=>{o.unmount()}),[o]),y.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var OC=process.env.NODE_ENV!=="development"?function(){return null}:_C;process.env.NODE_ENV;function cv(e,t){return function(){return e.apply(t,arguments)}}const{toString:EC}=Object.prototype,{getPrototypeOf:hf}=Object,{iterator:xc,toStringTag:uv}=Symbol,wc=(e=>t=>{const n=EC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mn=e=>(e=e.toLowerCase(),t=>wc(t)===e),Sc=e=>t=>typeof t===e,{isArray:Vs}=Array,Qo=Sc("undefined");function AC(e){return e!==null&&!Qo(e)&&e.constructor!==null&&!Qo(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const dv=Mn("ArrayBuffer");function PC(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&dv(e.buffer),t}const TC=Sc("string"),zt=Sc("function"),fv=Sc("number"),Cc=e=>e!==null&&typeof e=="object",jC=e=>e===!0||e===!1,Ol=e=>{if(wc(e)!=="object")return!1;const t=hf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(uv in e)&&!(xc in e)},MC=Mn("Date"),$C=Mn("File"),DC=Mn("Blob"),IC=Mn("FileList"),LC=e=>Cc(e)&&zt(e.pipe),RC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=wc(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},NC=Mn("URLSearchParams"),[FC,BC,qC,zC]=["ReadableStream","Request","Response","Headers"].map(Mn),HC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $a(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),Vs(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function hv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const di=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,gv=e=>!Qo(e)&&e!==di;function gd(){const{caseless:e}=gv(this)&&this||{},t={},n=(r,i)=>{const s=e&&hv(t,i)||i;Ol(t[s])&&Ol(r)?t[s]=gd(t[s],r):Ol(r)?t[s]=gd({},r):Vs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&$a(arguments[r],n);return t}const UC=(e,t,n,{allOwnKeys:r}={})=>($a(t,(i,s)=>{n&&zt(i)?e[s]=cv(i,n):e[s]=i},{allOwnKeys:r}),e),KC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),WC=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},VC=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&hf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},GC=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},QC=e=>{if(!e)return null;if(Vs(e))return e;let t=e.length;if(!fv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},YC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&hf(Uint8Array)),XC=(e,t)=>{const r=(e&&e[xc]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},JC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ZC=Mn("HTMLFormElement"),e_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Vh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),t_=Mn("RegExp"),yv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$a(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},n_=e=>{yv(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},r_=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Vs(e)?r(e):r(String(e).split(t)),n},i_=()=>{},s_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function o_(e){return!!(e&&zt(e.append)&&e[uv]==="FormData"&&e[xc])}const a_=e=>{const t=new Array(10),n=(r,i)=>{if(Cc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Vs(r)?[]:{};return $a(r,(o,a)=>{const l=n(o,i+1);!Qo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},l_=Mn("AsyncFunction"),c_=e=>e&&(Cc(e)||zt(e))&&zt(e.then)&&zt(e.catch),mv=((e,t)=>e?setImmediate:t?((n,r)=>(di.addEventListener("message",({source:i,data:s})=>{i===di&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),di.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zt(di.postMessage)),u_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(di):typeof process!="undefined"&&process.nextTick||mv,d_=e=>e!=null&&zt(e[xc]),B={isArray:Vs,isArrayBuffer:dv,isBuffer:AC,isFormData:RC,isArrayBufferView:PC,isString:TC,isNumber:fv,isBoolean:jC,isObject:Cc,isPlainObject:Ol,isReadableStream:FC,isRequest:BC,isResponse:qC,isHeaders:zC,isUndefined:Qo,isDate:MC,isFile:$C,isBlob:DC,isRegExp:t_,isFunction:zt,isStream:LC,isURLSearchParams:NC,isTypedArray:YC,isFileList:IC,forEach:$a,merge:gd,extend:UC,trim:HC,stripBOM:KC,inherits:WC,toFlatObject:VC,kindOf:wc,kindOfTest:Mn,endsWith:GC,toArray:QC,forEachEntry:XC,matchAll:JC,isHTMLForm:ZC,hasOwnProperty:Vh,hasOwnProp:Vh,reduceDescriptors:yv,freezeMethods:n_,toObjectSet:r_,toCamelCase:e_,noop:i_,toFiniteNumber:s_,findKey:hv,global:di,isContextDefined:gv,isSpecCompliantForm:o_,toJSONObject:a_,isAsyncFn:l_,isThenable:c_,setImmediate:mv,asap:u_,isIterable:d_};function Ae(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}B.inherits(Ae,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const pv=Ae.prototype,vv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{vv[e]={value:e}});Object.defineProperties(Ae,vv);Object.defineProperty(pv,"isAxiosError",{value:!0});Ae.from=(e,t,n,r,i,s)=>{const o=Object.create(pv);return B.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Ae.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const f_=null;function yd(e){return B.isPlainObject(e)||B.isArray(e)}function bv(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function Gh(e,t,n){return e?e.concat(t).map(function(i,s){return i=bv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function h_(e){return B.isArray(e)&&!e.some(yd)}const g_=B.toFlatObject(B,{},null,function(t){return/^is[A-Z]/.test(t)});function _c(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!B.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(B.isDate(g))return g.toISOString();if(B.isBoolean(g))return g.toString();if(!l&&B.isBlob(g))throw new Ae("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(g)||B.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,m,p){let v=g;if(g&&!p&&typeof g=="object"){if(B.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(B.isArray(g)&&h_(g)||(B.isFileList(g)||B.endsWith(m,"[]"))&&(v=B.toArray(g)))return m=bv(m),v.forEach(function(w,S){!(B.isUndefined(w)||w===null)&&t.append(o===!0?Gh([m],S,s):o===null?m:m+"[]",c(w))}),!1}return yd(g)?!0:(t.append(Gh(p,m,s),c(g)),!1)}const d=[],f=Object.assign(g_,{defaultVisitor:u,convertValue:c,isVisitable:yd});function h(g,m){if(!B.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),B.forEach(g,function(v,b){(!(B.isUndefined(v)||v===null)&&i.call(t,v,B.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!B.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Qh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function gf(e,t){this._pairs=[],e&&_c(e,this,t)}const xv=gf.prototype;xv.append=function(t,n){this._pairs.push([t,n])};xv.toString=function(t){const n=t?function(r){return t.call(this,r,Qh)}:Qh;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function y_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wv(e,t,n){if(!t)return e;const r=n&&n.encode||y_;B.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=B.isURLSearchParams(t)?t.toString():new gf(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Yh{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Sv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},m_=typeof URLSearchParams!="undefined"?URLSearchParams:gf,p_=typeof FormData!="undefined"?FormData:null,v_=typeof Blob!="undefined"?Blob:null,b_={isBrowser:!0,classes:{URLSearchParams:m_,FormData:p_,Blob:v_},protocols:["http","https","file","blob","url","data"]},yf=typeof window!="undefined"&&typeof document!="undefined",md=typeof navigator=="object"&&navigator||void 0,x_=yf&&(!md||["ReactNative","NativeScript","NS"].indexOf(md.product)<0),w_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",S_=yf&&window.location.href||"http://localhost",C_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yf,hasStandardBrowserEnv:x_,hasStandardBrowserWebWorkerEnv:w_,navigator:md,origin:S_},Symbol.toStringTag,{value:"Module"})),At={...C_,...b_};function __(e,t){return _c(e,new At.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return At.isNode&&B.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function k_(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O_(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Cv(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&B.isArray(i)?i.length:o,l?(B.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!B.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&B.isArray(i[o])&&(i[o]=O_(i[o])),!a)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,(r,i)=>{t(k_(r),i,n,0)}),n}return null}function E_(e,t,n){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Da={transitional:Sv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=B.isObject(t);if(s&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return i?JSON.stringify(Cv(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t)||B.isReadableStream(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return __(t,this.formSerializer).toString();if((a=B.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return _c(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),E_(t)):t}],transformResponse:[function(t){const n=this.transitional||Da.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(B.isResponse(t)||B.isReadableStream(t))return t;if(t&&B.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Ae.from(a,Ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],e=>{Da.headers[e]={}});const A_=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),P_=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
13
|
-
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&A_[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},
|
|
14
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Xh]=this[Xh]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=oo(o);r[a]||($_(i,o),r[a]=!0)}return B.isArray(t)?t.forEach(s):s(t),this}};Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});B.freezeMethods(Ht);function au(e,t){const n=this||Da,r=t||n,i=Ht.from(r.headers);let s=r.data;return B.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function _v(e){return!!(e&&e.__CANCEL__)}function Gs(e,t,n){Ae.call(this,e==null?"canceled":e,Ae.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(Gs,Ae,{__CANCEL__:!0});function kv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ae("Request failed with status code "+n.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function D_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function I_(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const h=u&&c-u;return h?Math.round(f*1e3/h):void 0}}function L_(e,t){let n=0,r=1e3/t,i,s;const o=(c,u=Date.now())=>{n=u,i=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?o(c,u):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Ul=(e,t,n=3)=>{let r=0;const i=I_(50,250);return L_(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,c=i(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Jh=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Zh=e=>(...t)=>B.asap(()=>e(...t)),R_=At.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,At.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,N_=At.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];B.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),B.isString(r)&&o.push("path="+r),B.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function F_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function B_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ov(e,t,n){let r=!F_(t);return e&&(r||n==!1)?B_(e,t):t}const eg=e=>e instanceof Ht?{...e}:e;function Pi(e,t){t=t||{};const n={};function r(c,u,d,f){return B.isPlainObject(c)&&B.isPlainObject(u)?B.merge.call({caseless:f},c,u):B.isPlainObject(u)?B.merge({},u):B.isArray(u)?u.slice():u}function i(c,u,d,f){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!B.isUndefined(u))return r(void 0,u)}function o(c,u){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>i(eg(c),eg(u),d,!0)};return B.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,f=d(e[u],t[u],u);B.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Ev=e=>{const t=Pi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ht.from(o),t.url=wv(Ov(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(B.isFormData(n)){if(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(At.hasStandardBrowserEnv&&(r&&B.isFunction(r)&&(r=r(t)),r||r!==!1&&R_(t.url))){const c=i&&s&&N_.read(s);c&&o.set(i,c)}return t},q_=typeof XMLHttpRequest!="undefined",z_=q_&&function(e){return new Promise(function(n,r){const i=Ev(e);let s=i.data;const o=Ht.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,f,h,g;function m(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const w=Ht.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:w,config:e,request:p};kv(function(C){n(C),m()},function(C){r(C),m()},x),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new Ae("Request aborted",Ae.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Ae("Network Error",Ae.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||Sv;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new Ae(S,x.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&B.forEach(o.toJSON(),function(S,x){p.setRequestHeader(x,S)}),B.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),c&&([f,g]=Ul(c,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Ul(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=w=>{p&&(r(!w||w.type?new Gs(null,e,p):w),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const b=D_(i.url);if(b&&At.protocols.indexOf(b)===-1){r(new Ae("Unsupported protocol "+b+":",Ae.ERR_BAD_REQUEST,e));return}p.send(s||null)})},H_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Ae?u:new Gs(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new Ae(`timeout ${t} of ms exceeded`,Ae.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>B.asap(a),l}},U_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},K_=async function*(e,t){for await(const n of W_(e))yield*U_(n,t)},W_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},tg=(e,t,n,r)=>{const i=K_(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},kc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Av=kc&&typeof ReadableStream=="function",V_=kc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Pv=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},G_=Av&&Pv(()=>{let e=!1;const t=new Request(At.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ng=64*1024,pd=Av&&Pv(()=>B.isReadableStream(new Response("").body)),Kl={stream:pd&&(e=>e.body)};kc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kl[t]&&(Kl[t]=B.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ae(`Response type '${t}' is not supported`,Ae.ERR_NOT_SUPPORT,r)})})})(new Response);const Q_=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new Request(At.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e=e+""),B.isString(e))return(await V_(e)).byteLength},Y_=async(e,t)=>{const n=B.toFiniteNumber(e.getContentLength());return n==null?Q_(t):n},X_=kc&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Ev(e);c=c?(c+"").toLowerCase():"text";let h=H_([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&G_&&n!=="get"&&n!=="head"&&(p=await Y_(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(B.isFormData(r)&&(O=x.headers.get("content-type"))&&u.setContentType(O),x.body){const[C,_]=Jh(p,Ul(Zh(l)));r=tg(x.body,ng,C,_)}}B.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?d:void 0});let b=await fetch(g,f);const w=pd&&(c==="stream"||c==="response");if(pd&&(a||w&&m)){const x={};["status","statusText","headers"].forEach(k=>{x[k]=b[k]});const O=B.toFiniteNumber(b.headers.get("content-length")),[C,_]=a&&Jh(O,Ul(Zh(a),!0))||[];b=new Response(tg(b.body,ng,C,()=>{_&&_(),m&&m()}),x)}c=c||"text";let S=await Kl[B.findKey(Kl,c)||"text"](b,e);return!w&&m&&m(),await new Promise((x,O)=>{kv(x,O,{data:S,headers:Ht.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:g})})}catch(v){throw m&&m(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new Ae("Network Error",Ae.ERR_NETWORK,e,g),{cause:v.cause||v}):Ae.from(v,v&&v.code,e,g)}}),vd={http:f_,xhr:z_,fetch:X_};B.forEach(vd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const rg=e=>`- ${e}`,J_=e=>B.isFunction(e)||e===null||e===!1,Tv={getAdapter:e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!J_(n)&&(r=vd[(o=String(n)).toLowerCase()],r===void 0))throw new Ae(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
15
|
-
`+s.map(
|
|
16
|
-
`):" "+
|
|
17
|
-
`+s):r.stack=s}catch(o){}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Al.assertOptions(r,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),i!=null&&(B.isFunction(i)?n.paramsSerializer={serialize:i}:Al.assertOptions(i,{encode:Dn.function,serialize:Dn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Al.assertOptions(n,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&B.merge(s.common,s[n.method]);s&&B.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ht.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!l){const g=[ig.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),f=g.length,u=Promise.resolve(n);d<f;)u=u.then(g[d++],g[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const g=a[d++],m=a[d++];try{h=g(h)}catch(p){m.call(this,p);break}}try{u=ig.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Pi(this.defaults,t);const n=Ov(t.baseURL,t.url,t.allowAbsoluteUrls);return wv(n,t.params,t.paramsSerializer)}};B.forEach(["delete","get","head","options"],function(t){_i.prototype[t]=function(n,r){return this.request(Pi(r||{},{method:t,url:n,data:(r||{}).data}))}});B.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Pi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}_i.prototype[t]=n(),_i.prototype[t+"Form"]=n(!0)});let ek=class Mv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Gs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mv(function(i){t=i}),cancel:t}}};function tk(e){return function(n){return e.apply(null,n)}}function nk(e){return B.isObject(e)&&e.isAxiosError===!0}const bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bd).forEach(([e,t])=>{bd[t]=e});function $v(e){const t=new _i(e),n=cv(_i.prototype.request,t);return B.extend(n,_i.prototype,t,{allOwnKeys:!0}),B.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return $v(Pi(e,i))},n}const st=$v(Da);st.Axios=_i;st.CanceledError=Gs;st.CancelToken=ek;st.isCancel=_v;st.VERSION=jv;st.toFormData=_c;st.AxiosError=Ae;st.Cancel=st.CanceledError;st.all=function(t){return Promise.all(t)};st.spread=tk;st.isAxiosError=nk;st.mergeConfig=Pi;st.AxiosHeaders=Ht;st.formToJSON=e=>Cv(B.isHTMLForm(e)?new FormData(e):e);st.getAdapter=Tv.getAdapter;st.HttpStatusCode=bd;st.default=st;const{Axios:zN,AxiosError:HN,CanceledError:UN,isCancel:KN,CancelToken:WN,VERSION:VN,all:GN,Cancel:QN,isAxiosError:YN,spread:XN,toFormData:JN,AxiosHeaders:ZN,HttpStatusCode:eF,formToJSON:tF,getAdapter:nF,mergeConfig:rF}=st,rk={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Dt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Yt(b,"_invoke",function(w,S,x){var O,C,_,k=0,E=x||[],j=!1,D={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(M,I){return O=M,C=0,_=e,D.n=I,o}};function z(N,M){for(C=N,_=M,t=0;!j&&k&&!I&&t<E.length;t++){var I,L=E[t],J=D.p,ce=L[2];N>3?(I=ce===M)&&(_=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=J&&((I=N<2&&J<L[1])?(C=0,D.v=M,D.n=L[1]):J<ce&&(I=N<3||L[0]>M||M>ce)&&(L[4]=N,L[5]=M,D.n=ce,C=0))}if(I||N>1)return o;throw j=!0,M}return function(N,M,I){if(k>1)throw TypeError("Generator is already running");for(j&&M===1&&z(M,I),C=M,_=I;(t=C<2?e:_)||!j;){O||(C?C<3?(C>1&&(D.n=-1),z(C,_)):D.n=_:D.v=_);try{if(k=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(j=D.n<0)?_:w.call(S,D))!==o)break}catch(L){O=e,C=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Yt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Yt(d,"constructor",c),Yt(c,"constructor",l),l.displayName="GeneratorFunction",Yt(c,i,"GeneratorFunction"),Yt(d),Yt(d,i,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:s,m:f}})()}function Yt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Yt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Yt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Yt(e,t,n,r)}function og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?og(Object(n),!0).forEach(function(r){ik(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):og(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ik(e,t,n){return(t=sk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(e){var t=ok(e,"string");return Yo(t)=="symbol"?t:t+""}function ok(e,t){if(Yo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ag(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ti(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ag(s,r,i,o,a,"next",l)}function a(l){ag(s,r,i,o,a,"throw",l)}o(void 0)})}}var Dv=function(){var t;return((t=rk)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function lg(e){var t;if(typeof document!="undefined"){var n="; ".concat(document.cookie),r=n.split("; ".concat(e,"="));if(r.length===2)return(t=r.pop())===null||t===void 0?void 0:t.split(";").shift()}}var ak="yst-insights-token",Qs=st.create({withCredentials:!0});Qs.interceptors.request.use(function(){var e=Ti(Dt().m(function t(n){var r,i;return Dt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,ck();case 1:return r=s.v,s.n=2,Lv();case 2:return i=s.v,n.headers=ki(ki(ki({},n.headers||{}),i?{"X-XSRF-TOKEN":i}:{}),r?{Authorization:"Bearer ".concat(r)}:{}),s.a(2,n)}},t)}));return function(t){return e.apply(this,arguments)}}(),function(e){return Promise.reject(e)},{synchronous:!1});Qs.interceptors.response.use(function(e){return e},function(){var e=Ti(Dt().m(function t(n){var r;return Dt().w(function(i){for(;;)switch(i.n){case 0:return n==null||(r=n.response)===null||r===void 0||r.status,i.a(2,Promise.reject(n))}},t)}));return function(t){return e.apply(this,arguments)}}());function bt(e){return xd.apply(this,arguments)}function xd(){return xd=Ti(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=ki({},t),delete n.baseURL,r.a(2,Qs.request(ki(ki({},n),{},{withCredentials:!0})))}},e)})),xd.apply(this,arguments)}function Iv(e){Qs.defaults.baseURL=e}function cg(){return Qs.defaults.baseURL}function lk(e){Dv=e}var ao=null;function ck(){return wd.apply(this,arguments)}function wd(){return wd=Ti(Dt().m(function e(){var t,n,r,i,s;return Dt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=Dv(),n=Qs.defaults.baseURL,r=uk(t,n),i=sessionStorage.getItem(r),!i){o.n=4;break}if(o.p=1,s=JSON.parse(i),!((s==null?void 0:s.validUntil)>Date.now()&&s.value)){o.n=2;break}return o.a(2,String(s.value));case 2:o.n=4;break;case 3:o.p=3,o.v;case 4:if(!ao){o.n=5;break}return o.a(2,ao);case 5:return ao=Ti(Dt().m(function a(){var l,c,u,d,f;return Dt().w(function(h){for(;;)switch(h.p=h.n){case 0:return h.p=0,h.n=1,Lv();case 1:return l=h.v,h.n=2,st.post(n+"/users/getToken",{},{headers:ki({Authorization:"Bearer "+t},l?{"X-XSRF-TOKEN":l}:{}),withCredentials:!0});case 2:if(c=h.v,u=c.data,!(u!=null&&u.plainTextToken)){h.n=3;break}return sessionStorage.setItem(r,JSON.stringify({value:u.plainTextToken,validUntil:Date.parse(((d=u.accessToken)===null||d===void 0?void 0:d.expires_at)||"")||Date.now()+15*60*1e3})),h.a(2,u.plainTextToken);case 3:h.n=5;break;case 4:h.p=4,f=h.v,st.isAxiosError(f)?f.response?console.error("Login failed with status",f.response.status,f.response.data):f.request?console.error("Login request made but no response received",f.request):console.error("Error setting up login request",f.message):console.error("Non-Axios error during login",f);case 5:return h.p=5,ao=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,ao)}},e,null,[[1,3]])})),wd.apply(this,arguments)}function uk(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return ak+":"+n}var lo=null;function Lv(){return Sd.apply(this,arguments)}function Sd(){return Sd=Ti(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(cg()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=lg("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!lo){n.n=3;break}return n.a(2,lo);case 3:return lo=Ti(Dt().m(function r(){var i;return Dt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,st.get(((i=cg())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(lg("XSRF-TOKEN")||""));case 2:return s.p=2,lo=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,lo)}},e)})),Sd.apply(this,arguments)}function Xo(e){"@babel/helpers - typeof";return Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(e)}function ug(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ug(Object(n),!0).forEach(function(r){dk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ug(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dk(e,t,n){return(t=fk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fk(e){var t=hk(e,"string");return Xo(t)=="symbol"?t:t+""}function hk(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Rv=function(t){return["/brands/".concat(t,"/analysis")]},yk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Rv(t),a=function(c){var u=c.signal;return gk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Nv(e,t,n){var r=yk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var mk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Fv=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},pk=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:Fv(t,n),l=function(u){var d=u.signal;return mk(t,n,d)};return we({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function Ec(e,t,n,r){var i=pk(e,t,n),s=mr(i,r);return s.queryKey=i.queryKey,s}var vk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},bk=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.analysisId;return vk(c,u)};return we({mutationFn:s},i)},xk=function(t,n){var r=bk(t);return pr(r,n)},wk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},Sk=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},Ck=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:Sk(t,n),l=function(u){var d=u.signal;return wk(t,n,d)};return we({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function _k(e,t,n,r){var i=Ck(e,t,n),s=mr(i,r);return s.queryKey=i.queryKey,s}var kk=function(t){return bt({url:"/users/logout",method:"POST",signal:t})},Ok=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return kk()};return we({mutationFn:s},i)},Ek=function(t,n){var r=Ok(t);return pr(r,n)},Ak=function(t,n){return bt({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},Wl=function(t){return["/brands/".concat(t,"/associated-brands")]},Pk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Wl(t),a=function(c){var u=c.signal;return Ak(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Tk(e,t,n){var r=Pk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var jk=function(t,n,r){return bt({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Mk=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return jk(c,u)};return we({mutationFn:s},i)},Bv=function(t,n){var r=Mk(t);return pr(r,n)},$k=function(t){return bt({url:"/brandGroups/".concat(t),method:"DELETE"})},Dk=function(t){var n=["deleteBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandGroupId;return $k(c)};return we({mutationFn:s},i)},Ik=function(t,n){var r=Dk(t);return pr(r,n)},Lk=function(t){return bt({url:"/brands",method:"GET",signal:t})},sr=function(){return["/brands"]},Rk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:sr(),o=function(l){var c=l.signal;return Lk(c)};return we({queryKey:s,queryFn:o},i)};function Fi(e,t){var n=Rk(e),r=mr(n,t);return r.queryKey=n.queryKey,r}var Nk=function(t,n){return bt({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},Fk=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.data;return Nk(c)};return we({mutationFn:s},i)},Bk=function(t,n){var r=Fk(t);return pr(r,n)},qk=function(t,n){return bt({url:"/brands/".concat(t),method:"GET",signal:n})},mf=function(t){return["/brands/".concat(t)]},zk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:mf(t),a=function(c){var u=c.signal;return qk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function pf(e,t,n){var r=zk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var Hk=function(t){return bt({url:"/brands/".concat(t),method:"DELETE"})},Uk=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return Hk(c)};return we({mutationFn:s},i)},Kk=function(t,n){var r=Uk(t);return pr(r,n)},Wk=function(t,n){return bt({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},Vk=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return Wk(c,u)};return we({mutationFn:s},i)},qv=function(t,n){var r=Vk(t);return pr(r,n)},Gk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"GET",signal:n})},Qk=function(t){return["/brands/".concat(t,"/queries")]},Yk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Qk(t),a=function(c){var u=c.signal;return Gk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Xk(e,t,n){var r=Yk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var Jk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},Zk=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return Jk(c,u)};return we({mutationFn:s},i)},eO=function(t,n){var r=Zk(t);return pr(r,n)},tO=function(t,n){return bt({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},nO=function(t){return["/brands/".concat(t,"/query-suggestions")]},rO=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:nO(t),a=function(c){var u=c.signal;return tO(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function iO(e,t,n){var r=rO(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var sO=function(t){return bt({url:"/users/current",method:"GET",signal:t})},vf=function(){return["/users/current"]},oO=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:vf(),o=function(l){var c=l.signal;return sO(c)};return we({queryKey:s,queryFn:o},i)};function Ac(e,t){var n=oO(e),r=mr(n,t);return r.queryKey=n.queryKey,r}var aO=function(){return bt({url:"/users/data",method:"DELETE"})},lO=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return aO()};return we({mutationFn:s},i)},cO=function(t,n){var r=lO(t);return pr(r,n)},zv=q.createContext(void 0),uO=function(t){var n,r,i,s,o,a,l,c,u=t.children,d=t.brandId,f=t.analysisId,h=t.model,g=t.hostAppProps,m=g===void 0?{}:g,p=Ga("/brands/:brandId"),v=Ga("/brands/:brandId/*"),b=Ga("/brands/:brandId/analysis/:analysisId"),w=Ga("/brands/:brandId/analysis/:analysisId/*"),S=(b==null||(n=b.params)===null||n===void 0?void 0:n.brandId)||(w==null||(r=w.params)===null||r===void 0?void 0:r.brandId)||(v==null||(i=v.params)===null||i===void 0?void 0:i.brandId)||(p==null||(s=p.params)===null||s===void 0?void 0:s.brandId),x=b!=null&&(o=b.params)!==null&&o!==void 0&&o.analysisId||w!=null&&(a=w.params)!==null&&a!==void 0&&a.analysisId?Number((b==null||(l=b.params)===null||l===void 0?void 0:l.analysisId)||(w==null||(c=w.params)===null||c===void 0?void 0:c.analysisId)):void 0,O=q.useMemo(function(){return{brandId:S||d||"",analysisId:x||f||"latest",model:h||"openai",hostAppProps:m}},[S,d,x,f,h,m]),C=q.useMemo(function(){return{data:O}},[O]);return y.jsx(zv.Provider,{value:C,children:u})},Hv=q.createContext(void 0),dO=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=q.useCallback(function(d){r(d),i("latest")},[r,i]),a=q.useCallback(function(d){i(d)},[i]),l=q.useCallback(function(d){s(d)},[s]),c=q.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),u=q.useMemo(function(){return{mutations:c}},[c]);return y.jsx(Hv.Provider,{value:u,children:n})};function cu(e,t){return yO(e)||gO(e,t)||hO(e,t)||fO()}function fO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hO(e,t){if(e){if(typeof e=="string")return
|
|
12
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Ut(),f;if(t){let b=typeof t=="string"?Li(t):t;it(c==="/"||((v=b.pathname)==null?void 0:v.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${b.pathname}" was given in the \`location\` prop.`),f=b}else f=d;let h=f.pathname||"/",g=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let m=e0(e,{pathname:g});bn(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),bn(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let p=Tw(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:lr([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:lr([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?M.createElement(ja.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function Ow(){let e=Iw(),t=pw(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:s},"ErrorBoundary")," or"," ",M.createElement("code",{style:s},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),n?M.createElement("pre",{style:i},n):null,o)}var Ew=M.createElement(Ow,null),Aw=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?M.createElement(xn.Provider,{value:this.props.routeContext},M.createElement(sf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Pw({routeContext:e,match:t,children:n}){let r=M.useContext(Hs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(xn.Provider,{value:e},n)}function Tw(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n==null?void 0:n.errors;if(s!=null){let l=i.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);it(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,l+1))}let o=!1,a=-1;if(n)for(let l=0;l<i.length;l++){let c=i[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=l),c.route.id){let{loaderData:u,errors:d}=n,f=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,c,u)=>{let d,f=!1,h=null,g=null;n&&(d=s&&c.route.id?s[c.route.id]:void 0,h=c.route.errorElement||Ew,o&&(a<0&&u===0?(c0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):a===u&&(f=!0,g=c.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,u+1)),p=()=>{let v;return d?v=h:f?v=g:c.route.Component?v=M.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,M.createElement(Pw,{match:c,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?M.createElement(Aw,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function of(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jw(e){let t=M.useContext(Hs);return it(t,of(e)),t}function Mw(e){let t=M.useContext(hc);return it(t,of(e)),t}function $w(e){let t=M.useContext(xn);return it(t,of(e)),t}function af(e){let t=$w(e),n=t.matches[t.matches.length-1];return it(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Dw(){return af("useRouteId")}function Iw(){var r;let e=M.useContext(sf),t=Mw("useRouteError"),n=af("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Lw(){let{router:e}=jw("useNavigate"),t=af("useNavigate"),n=M.useRef(!1);return a0(()=>{n.current=!0}),M.useCallback(async(i,s={})=>{bn(n.current,o0),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var Eh={};function c0(e,t,n){!t&&!Eh[e]&&(Eh[e]=!0,bn(!1,n))}M.memo(Rw);function Rw({routes:e,future:t,state:n}){return l0(e,void 0,n,t)}function Nw({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=M.useRef();i.current==null&&(i.current=Yx({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=i.current,[o,a]=M.useState({action:s.action,location:s.location}),l=M.useCallback(c=>{M.startTransition(()=>a(c))},[a]);return M.useLayoutEffect(()=>s.listen(l),[s,l]),M.createElement(Fw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function ci({to:e,replace:t,state:n,relative:r}){it(Ri(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=M.useContext(jn);bn(!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}=M.useContext(xn),{pathname:o}=Ut(),a=ln(),l=rf(e,nf(s),o,r==="path"),c=JSON.stringify(l);return M.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function Is(e){return _w(e.context)}function Ct(e){it(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Fw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){it(!Ri(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=M.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=Li(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=M.useMemo(()=>{let g=fr(l,o);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:f},navigationType:r}},[o,l,c,u,d,f,r]);return bn(h!=null,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:M.createElement(jn.Provider,{value:a},M.createElement(ja.Provider,{children:t,value:h}))}function Bw({children:e,location:t}){return kw(zu(e),t)}function zu(e,t=[]){let n=[];return M.Children.forEach(e,(r,i)=>{if(!M.isValidElement(r))return;let s=[...t,i];if(r.type===M.Fragment){n.push.apply(n,zu(r.props.children,s));return}it(r.type===Ct,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),it(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=zu(r.props.children,s)),n.push(o)}),n}var Cl="get",_l="application/x-www-form-urlencoded";function yc(e){return e!=null&&typeof e.tagName=="string"}function qw(e){return yc(e)&&e.tagName.toLowerCase()==="button"}function zw(e){return yc(e)&&e.tagName.toLowerCase()==="form"}function Hw(e){return yc(e)&&e.tagName.toLowerCase()==="input"}function Uw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kw(e,t){return e.button===0&&(!t||t==="_self")&&!Uw(e)}var Ya=null;function Ww(){if(Ya===null)try{new FormData(document.createElement("form"),0),Ya=!1}catch(e){Ya=!0}return Ya}var Vw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zc(e){return e!=null&&!Vw.has(e)?(bn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_l}"`),null):e}function Gw(e,t){let n,r,i,s,o;if(zw(e)){let a=e.getAttribute("action");r=a?fr(a,t):null,n=e.getAttribute("method")||Cl,i=Zc(e.getAttribute("enctype"))||_l,s=new FormData(e)}else if(qw(e)||Hw(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?fr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Cl,i=Zc(e.getAttribute("formenctype"))||Zc(a.getAttribute("enctype"))||_l,s=new FormData(a,e),!Ww()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?`${c}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else c&&s.append(c,d)}}else{if(yc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Cl,r=null,i=_l,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function lf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function Qw(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Yw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Xw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await Qw(s,n);return o.links?o.links():[]}return[]}));return t2(r.flat(1).filter(Yw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Ah(e,t,n,r,i,s){let o=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,a=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,c)=>o(l,c)||a(l,c)):s==="data"?t.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(o(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function Jw(e,t,{includeHydrateFallback:n}={}){return Zw(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Zw(e){return[...new Set(e)]}function e2(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function t2(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(e2(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var n2=new Set([100,101,204,205]);function r2(e,t){let n=typeof e=="string"?new URL(e,typeof window=="undefined"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&fr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function u0(){let e=M.useContext(Hs);return lf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function i2(){let e=M.useContext(hc);return lf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cf=M.createContext(void 0);cf.displayName="FrameworkContext";function d0(){let e=M.useContext(cf);return lf(e,"You must render this element inside a <HydratedRouter> element"),e}function s2(e,t){let n=M.useContext(cf),[r,i]=M.useState(!1),[s,o]=M.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=M.useRef(null);M.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let m=v=>{v.forEach(b=>{o(b.isIntersecting)})},p=new IntersectionObserver(m,{threshold:.5});return f.current&&p.observe(f.current),()=>{p.disconnect()}}},[e]),M.useEffect(()=>{if(r){let m=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(m)}}},[r]);let h=()=>{i(!0)},g=()=>{i(!1),o(!1)};return n?e!=="intent"?[s,f,{}]:[s,f,{onFocus:so(a,h),onBlur:so(l,g),onMouseEnter:so(c,h),onMouseLeave:so(u,g),onTouchStart:so(d,h)}]:[!1,f,{}]}function so(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function o2({page:e,...t}){let{router:n}=u0(),r=M.useMemo(()=>e0(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?M.createElement(l2,{page:e,matches:r,...t}):null}function a2(e){let{manifest:t,routeModules:n}=d0(),[r,i]=M.useState([]);return M.useEffect(()=>{let s=!1;return Xw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function l2({page:e,matches:t,...n}){let r=Ut(),{manifest:i,routeModules:s}=d0(),{basename:o}=u0(),{loaderData:a,matches:l}=i2(),c=M.useMemo(()=>Ah(e,t,l,i,r,"data"),[e,t,l,i,r]),u=M.useMemo(()=>Ah(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=M.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(v=>{var w;let b=i.routes[v.route.id];!b||!b.hasLoader||(!c.some(S=>S.route.id===v.route.id)&&v.route.id in a&&((w=s[v.route.id])!=null&&w.shouldRevalidate)||b.hasClientLoader?m=!0:g.add(v.route.id))}),g.size===0)return[];let p=r2(e,o);return m&&g.size>0&&p.searchParams.set("_routes",t.filter(v=>g.has(v.route.id)).map(v=>v.route.id).join(",")),[p.pathname+p.search]},[o,a,r,i,c,t,e,s]),f=M.useMemo(()=>Jw(u,i),[u,i]),h=a2(u);return M.createElement(M.Fragment,null,d.map(g=>M.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),f.map(g=>M.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),h.map(({key:g,link:m})=>M.createElement("link",{key:g,...m})))}function c2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var f0=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{f0&&(window.__reactRouterVersion="7.6.3")}catch(e){}var h0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yr=M.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...f},h){let{basename:g}=M.useContext(jn),m=typeof c=="string"&&h0.test(c),p,v=!1;if(typeof c=="string"&&m&&(p=c,f0))try{let _=new URL(window.location.href),A=c.startsWith("//")?new URL(_.protocol+c):new URL(c),D=fr(A.pathname,g);A.origin===_.origin&&D!=null?c=D+A.search+A.hash:v=!0}catch(_){bn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=ww(c,{relative:i}),[w,S,x]=s2(r,f),O=h2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function C(_){t&&t(_),_.defaultPrevented||O(_)}let k=M.createElement("a",{...f,...x,href:p||b,onClick:v||s?t:C,ref:c2(h,S),target:l,"data-discover":!m&&n==="render"?"true":void 0});return w&&!m?M.createElement(M.Fragment,null,k,M.createElement(o2,{page:b})):k});Yr.displayName="Link";var u2=M.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...c},u){let d=Ma(o,{relative:c.relative}),f=Ut(),h=M.useContext(hc),{navigator:g,basename:m}=M.useContext(jn),p=h!=null&&v2(d)&&a===!0,v=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,b=f.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&m&&(w=fr(w,m)||w);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let x=b===v||!i&&b.startsWith(v)&&b.charAt(S)==="/",O=w!=null&&(w===v||!i&&w.startsWith(v)&&w.charAt(v.length)==="/"),C={isActive:x,isPending:O,isTransitioning:p},k=x?t:void 0,_;typeof r=="function"?_=r(C):_=[r,x?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let A=typeof s=="function"?s(C):s;return M.createElement(Yr,{...c,"aria-current":k,className:_,ref:u,style:A,to:o,viewTransition:a},typeof l=="function"?l(C):l)});u2.displayName="NavLink";var d2=M.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=Cl,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=m2(),m=p2(a,{relative:c}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&h0.test(a),b=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let S=w.nativeEvent.submitter,x=(S==null?void 0:S.getAttribute("formmethod"))||o;g(S||w.currentTarget,{fetcherKey:t,method:x,navigate:n,replace:i,state:s,relative:c,preventScrollReset:u,viewTransition:d})};return M.createElement("form",{ref:h,method:p,action:m,onSubmit:r?l:b,...f,"data-discover":!v&&e==="render"?"true":void 0})});d2.displayName="Form";function f2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function g0(e){let t=M.useContext(Hs);return it(t,f2(e)),t}function h2(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=ln(),l=Ut(),c=Ma(e,{relative:s});return M.useCallback(u=>{if(Kw(u,t)){u.preventDefault();let d=n!==void 0?n:Il(l)===Il(c);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,n,r,t,e,i,s,o])}var g2=0,y2=()=>`__${String(++g2)}__`;function m2(){let{router:e}=g0("useSubmit"),{basename:t}=M.useContext(jn),n=Dw();return M.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=Gw(r,t);if(i.navigate===!1){let u=i.fetcherKey||y2();await e.fetch(u,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:c,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function p2(e,{relative:t}={}){let{basename:n}=M.useContext(jn),r=M.useContext(xn);it(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ma(e||".",{relative:t})},o=Ut();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let u=a.toString();s.search=u?`?${u}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:lr([n,s.pathname])),Il(s)}function v2(e,t={}){let n=M.useContext(s0);it(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=g0("useViewTransitionState"),i=Ma(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=fr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=fr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ds(i.pathname,o)!=null||Ds(i.pathname,s)!=null}[...n2];var Us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ei=typeof window=="undefined"||"Deno"in globalThis;function $t(){}function b2(e,t){return typeof e=="function"?e(t):e}function Hu(e){return typeof e=="number"&&e>=0&&e!==1/0}function y0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qr(e,t){return typeof e=="function"?e(t):e}function gn(e,t){return typeof e=="function"?e(t):e}function Ph(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==uf(o,t.options))return!1}else if(!Ho(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Th(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ai(t.options.mutationKey)!==Ai(s))return!1}else if(!Ho(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ai)(e)}function Ai(e){return JSON.stringify(e,(t,n)=>Ku(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ho(e[n],t[n])):!1}function Uu(e,t){if(e===t)return e;const n=jh(e)&&jh(t);if(n||Ku(e)&&Ku(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,c++):(a[d]=Uu(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return i===o&&c===i?e:a}return t}function Ll(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function jh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ku(e){if(!Mh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Mh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Mh(e){return Object.prototype.toString.call(e)==="[object Object]"}function x2(e){return new Promise(t=>{setTimeout(t,e)})}function Wu(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Uu(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Uu(e,t)}return t}function w2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function S2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Rl=Symbol();function m0(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Rl&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Rl?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function p0(e,t){return typeof e=="function"?e(...t):!!e}var hi,Er,as,qp,C2=(qp=class extends Us{constructor(){super();le(this,hi);le(this,Er);le(this,as);X(this,as,t=>{if(!Ei&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Er)||this.setEventListener(P(this,as))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Er))==null||t.call(this),X(this,Er,void 0))}setEventListener(t){var n;X(this,as,t),(n=P(this,Er))==null||n.call(this),X(this,Er,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,hi)!==t&&(X(this,hi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,hi)=="boolean"?P(this,hi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hi=new WeakMap,Er=new WeakMap,as=new WeakMap,qp),df=new C2,ls,Ar,cs,zp,_2=(zp=class extends Us{constructor(){super();le(this,ls,!0);le(this,Ar);le(this,cs);X(this,cs,t=>{if(!Ei&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,Ar)||this.setEventListener(P(this,cs))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Ar))==null||t.call(this),X(this,Ar,void 0))}setEventListener(t){var n;X(this,cs,t),(n=P(this,Ar))==null||n.call(this),X(this,Ar,t(this.setOnline.bind(this)))}setOnline(t){P(this,ls)!==t&&(X(this,ls,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,ls)}},ls=new WeakMap,Ar=new WeakMap,cs=new WeakMap,zp),Ls=new _2;function Vu(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function k2(e){return Math.min(1e3*2**e,3e4)}function v0(e){return(e!=null?e:"online")==="online"?Ls.isOnline():!0}var b0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eu(e){return e instanceof b0}function x0(e){let t=!1,n=0,r=!1,i;const s=Vu(),o=m=>{var p;r||(f(new b0(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>df.isFocused()&&(e.networkMode==="always"||Ls.isOnline())&&e.canRun(),u=()=>v0(e.networkMode)&&e.canRun(),d=m=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,m),i==null||i(),s.resolve(m))},f=m=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,m),i==null||i(),s.reject(m))},h=()=>new Promise(m=>{var p;i=v=>{(r||c())&&m(v)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p!=null?p:e.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(d).catch(v=>{var O,C,k;if(r)return;const b=(O=e.retry)!=null?O:Ei?0:3,w=(C=e.retryDelay)!=null?C:k2,S=typeof w=="function"?w(n,v):w,x=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(t||!x){f(v);return}n++,(k=e.onFail)==null||k.call(e,n,v),x2(S).then(()=>c()?void 0:h()).then(()=>{t?f(v):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),s)}}var O2=e=>setTimeout(e,0);function E2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=O2;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var gt=E2(),gi,Hp,w0=(Hp=class{constructor(){le(this,gi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hu(this.gcTime)&&X(this,gi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Ei?1/0:5*60*1e3)}clearGcTimeout(){P(this,gi)&&(clearTimeout(P(this,gi)),X(this,gi,void 0))}},gi=new WeakMap,Hp),us,yi,hn,mi,_t,pa,pi,kn,Jn,Up,A2=(Up=class extends w0{constructor(t){var n;super();le(this,kn);le(this,us);le(this,yi);le(this,hn);le(this,mi);le(this,_t);le(this,pa);le(this,pi);X(this,pi,!1),X(this,pa,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,mi,t.client),X(this,hn,P(this,mi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,us,P2(this.options)),this.state=(n=t.state)!=null?n:P(this,us),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,_t))==null?void 0:t.promise}setOptions(t){this.options={...P(this,pa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,hn).remove(this)}setData(t,n){const r=Wu(this.state.data,t,this.options);return Te(this,kn,Jn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Te(this,kn,Jn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,_t))==null?void 0:r.promise;return(i=P(this,_t))==null||i.cancel(t),n?n.then($t).catch($t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,us))}isActive(){return this.observers.some(t=>gn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qr(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:!y0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,_t))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,_t))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,hn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,_t)&&(P(this,pi)?P(this,_t).cancel({revert:!0}):P(this,_t).cancelRetry()),this.scheduleGc()),P(this,hn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,kn,Jn).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,_t))return P(this,_t).continueRetry(),P(this,_t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(X(this,pi,!0),r.signal)})},s=()=>{const f=m0(this.options,n),g=(()=>{const m={client:P(this,mi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return X(this,pi,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,mi),state:this.state,fetchFn:s};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),X(this,yi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Te(this,kn,Jn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;eu(f)&&f.silent||Te(this,kn,Jn).call(this,{type:"error",error:f}),eu(f)||((g=(h=P(this,hn).config).onError)==null||g.call(h,f,this),(p=(m=P(this,hn).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return X(this,_t,x0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,m,p;if(f===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){l(v);return}(g=(h=P(this,hn).config).onSuccess)==null||g.call(h,f,this),(p=(m=P(this,hn).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Te(this,kn,Jn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Te(this,kn,Jn).call(this,{type:"pause"})},onContinue:()=>{Te(this,kn,Jn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,_t).start()}},us=new WeakMap,yi=new WeakMap,hn=new WeakMap,mi=new WeakMap,_t=new WeakMap,pa=new WeakMap,pi=new WeakMap,kn=new WeakSet,Jn=function(t){const n=r=>{var i,s;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,...S0(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return X(this,yi,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return eu(o)&&o.revert&&P(this,yi)?{...P(this,yi),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),gt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,hn).notify({query:this,type:"updated",action:t})})},Up);function S0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:v0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function P2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var qn,Kp,T2=(Kp=class extends Us{constructor(t={}){super();le(this,qn);this.config=t,X(this,qn,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:uf(i,n);let o=this.get(s);return o||(o=new A2({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){P(this,qn).has(t.queryHash)||(P(this,qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,qn).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,qn).get(t)}getAll(){return[...P(this,qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ph(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ph(t,r)):n}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qn=new WeakMap,Kp),zn,jt,vi,Hn,Or,Wp,j2=(Wp=class extends w0{constructor(t){super();le(this,Hn);le(this,zn);le(this,jt);le(this,vi);this.mutationId=t.mutationId,X(this,jt,t.mutationCache),X(this,zn,[]),this.state=t.state||C0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,zn).includes(t)||(P(this,zn).push(t),this.clearGcTimeout(),P(this,jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,zn,P(this,zn).filter(n=>n!==t)),this.scheduleGc(),P(this,jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,zn).length||(this.state.status==="pending"?this.scheduleGc():P(this,jt).remove(this))}continue(){var t,n;return(n=(t=P(this,vi))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}async execute(t){var s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,S,x,O,C,k,_;const n=()=>{Te(this,Hn,Or).call(this,{type:"continue"})};X(this,vi,x0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,D)=>{Te(this,Hn,Or).call(this,{type:"failed",failureCount:A,error:D})},onPause:()=>{Te(this,Hn,Or).call(this,{type:"pause"})},onContinue:n,retry:(s=this.options.retry)!=null?s:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,jt).canRun(this)}));const r=this.state.status==="pending",i=!P(this,vi).canStart();try{if(r)n();else{Te(this,Hn,Or).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=P(this,jt).config).onMutate)==null?void 0:a.call(o,t,this));const D=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));D!==this.state.context&&Te(this,Hn,Or).call(this,{type:"pending",context:D,variables:t,isPaused:i})}const A=await P(this,vi).start();return await((d=(u=P(this,jt).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,A,t,this.state.context)),await((m=(g=P(this,jt).config).onSettled)==null?void 0:m.call(g,A,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,A,null,t,this.state.context)),Te(this,Hn,Or).call(this,{type:"success",data:A}),A}catch(A){try{throw await((w=(b=P(this,jt).config).onError)==null?void 0:w.call(b,A,t,this.state.context,this)),await((x=(S=this.options).onError)==null?void 0:x.call(S,A,t,this.state.context)),await((C=(O=P(this,jt).config).onSettled)==null?void 0:C.call(O,void 0,A,this.state.variables,this.state.context,this)),await((_=(k=this.options).onSettled)==null?void 0:_.call(k,void 0,A,t,this.state.context)),A}finally{Te(this,Hn,Or).call(this,{type:"error",error:A})}}finally{P(this,jt).runNext(this)}}},zn=new WeakMap,jt=new WeakMap,vi=new WeakMap,Hn=new WeakSet,Or=function(t){const n=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=n(this.state),gt.batch(()=>{P(this,zn).forEach(r=>{r.onMutationUpdate(t)}),P(this,jt).notify({mutation:this,type:"updated",action:t})})},Wp);function C0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rr,On,va,Vp,M2=(Vp=class extends Us{constructor(t={}){super();le(this,rr);le(this,On);le(this,va);this.config=t,X(this,rr,new Set),X(this,On,new Map),X(this,va,0)}build(t,n,r){const i=new j2({mutationCache:this,mutationId:++Ga(this,va)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){P(this,rr).add(t);const n=Xa(t);if(typeof n=="string"){const r=P(this,On).get(n);r?r.push(t):P(this,On).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,rr).delete(t)){const n=Xa(t);if(typeof n=="string"){const r=P(this,On).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&P(this,On).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Xa(t);if(typeof n=="string"){const r=P(this,On).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r,i;const n=Xa(t);if(typeof n=="string"){const s=(r=P(this,On).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i=s==null?void 0:s.continue())!=null?i:Promise.resolve()}else return Promise.resolve()}clear(){gt.batch(()=>{P(this,rr).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,rr).clear(),P(this,On).clear()})}getAll(){return Array.from(P(this,rr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Th(n,r))}findAll(t={}){return this.getAll().filter(n=>Th(t,n))}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return gt.batch(()=>Promise.all(t.map(n=>n.continue().catch($t))))}},rr=new WeakMap,On=new WeakMap,va=new WeakMap,Vp);function Xa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function $h(e){return{onFetch:(t,n)=>{var u,d,f,h,g;const r=t.options,i=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{var w;let m=!1;const p=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},v=m0(t.options,t.fetchOptions),b=async(S,x,O)=>{if(m)return Promise.reject();if(x==null&&S.pages.length)return Promise.resolve(S);const k=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:x,direction:O?"backward":"forward",meta:t.options.meta};return p(I),I})(),_=await v(k),{maxPages:A}=t.options,D=O?S2:w2;return{pages:D(S.pages,_,A),pageParams:D(S.pageParams,x,A)}};if(i&&s.length){const S=i==="backward",x=S?$2:Dh,O={pages:s,pageParams:o},C=x(r,O);a=await b(O,C,S)}else{const S=e!=null?e:s.length;do{const x=l===0?(w=o[0])!=null?w:r.initialPageParam:Dh(r,a);if(l>0&&x==null)break;a=await b(a,x),l++}while(l<S)}return a};t.options.persister?t.fetchFn=()=>{var m,p;return(p=(m=t.options).persister)==null?void 0:p.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Dh(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ut,Pr,Tr,ds,fs,jr,hs,gs,Gp,D2=(Gp=class{constructor(e={}){le(this,ut);le(this,Pr);le(this,Tr);le(this,ds);le(this,fs);le(this,jr);le(this,hs);le(this,gs);X(this,ut,e.queryCache||new T2),X(this,Pr,e.mutationCache||new M2),X(this,Tr,e.defaultOptions||{}),X(this,ds,new Map),X(this,fs,new Map),X(this,jr,0)}mount(){Ga(this,jr)._++,P(this,jr)===1&&(X(this,hs,df.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ut).onFocus())})),X(this,gs,Ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ut).onOnline())})))}unmount(){var e,t;Ga(this,jr)._--,P(this,jr)===0&&((e=P(this,hs))==null||e.call(this),X(this,hs,void 0),(t=P(this,gs))==null||t.call(this),X(this,gs,void 0))}isFetching(e){return P(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,Pr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,ut).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,ut).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=P(this,ut).get(r.queryHash),s=i==null?void 0:i.state.data,o=b2(t,s);if(o!==void 0)return P(this,ut).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return gt.batch(()=>P(this,ut).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,ut);gt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,ut);return gt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=gt.batch(()=>P(this,ut).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($t).catch($t)}invalidateQueries(e,t={}){return gt.batch(()=>{var n,r;return P(this,ut).findAll(e).forEach(i=>{i.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(r=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?r:"active"},t)})}refetchQueries(e,t={}){var i;const n={...t,cancelRefetch:(i=t.cancelRefetch)!=null?i:!0},r=gt.batch(()=>P(this,ut).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($t)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,ut).build(this,t);return n.isStaleByTime(qr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($t).catch($t)}fetchInfiniteQuery(e){return e.behavior=$h(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($t).catch($t)}ensureInfiniteQueryData(e){return e.behavior=$h(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ls.isOnline()?P(this,Pr).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,ut)}getMutationCache(){return P(this,Pr)}getDefaultOptions(){return P(this,Tr)}setDefaultOptions(e){X(this,Tr,e)}setQueryDefaults(e,t){P(this,ds).set(Ai(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ds).values()],n={};return t.forEach(r=>{Ho(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,fs).set(Ai(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,fs).values()],n={};return t.forEach(r=>{Ho(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Tr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Rl&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Tr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,ut).clear(),P(this,Pr).clear()}},ut=new WeakMap,Pr=new WeakMap,Tr=new WeakMap,ds=new WeakMap,fs=new WeakMap,jr=new WeakMap,hs=new WeakMap,gs=new WeakMap,Gp),Nt,Ie,ba,Mt,bi,ys,Mr,$r,xa,ms,ps,xi,wi,Dr,vs,Ke,Co,Gu,Qu,Yu,Xu,Ju,Zu,ed,_0,Qp,I2=(Qp=class extends Us{constructor(t,n){super();le(this,Ke);le(this,Nt);le(this,Ie);le(this,ba);le(this,Mt);le(this,bi);le(this,ys);le(this,Mr);le(this,$r);le(this,xa);le(this,ms);le(this,ps);le(this,xi);le(this,wi);le(this,Dr);le(this,vs,new Set);this.options=n,X(this,Nt,t),X(this,$r,null),X(this,Mr,Vu()),this.options.experimental_prefetchInRender||P(this,Mr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Ie).addObserver(this),Ih(P(this,Ie),this.options)?Te(this,Ke,Co).call(this):this.updateResult(),Te(this,Ke,Xu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(P(this,Ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(P(this,Ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ke,Ju).call(this),Te(this,Ke,Zu).call(this),P(this,Ie).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,Ie);if(this.options=P(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gn(this.options.enabled,P(this,Ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ke,ed).call(this),P(this,Ie).setOptions(this.options),n._defaulted&&!Ll(this.options,n)&&P(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Ie),observer:this});const i=this.hasListeners();i&&Lh(P(this,Ie),r,this.options,n)&&Te(this,Ke,Co).call(this),this.updateResult(),i&&(P(this,Ie)!==r||gn(this.options.enabled,P(this,Ie))!==gn(n.enabled,P(this,Ie))||qr(this.options.staleTime,P(this,Ie))!==qr(n.staleTime,P(this,Ie)))&&Te(this,Ke,Gu).call(this);const s=Te(this,Ke,Qu).call(this);i&&(P(this,Ie)!==r||gn(this.options.enabled,P(this,Ie))!==gn(n.enabled,P(this,Ie))||s!==P(this,Dr))&&Te(this,Ke,Yu).call(this,s)}getOptimisticResult(t){const n=P(this,Nt).getQueryCache().build(P(this,Nt),t),r=this.createResult(n,t);return R2(this,r)&&(X(this,Mt,r),X(this,ys,this.options),X(this,bi,P(this,Ie).state)),r}getCurrentResult(){return P(this,Mt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){P(this,vs).add(t)}getCurrentQuery(){return P(this,Ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Nt).defaultQueryOptions(t),r=P(this,Nt).getQueryCache().build(P(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return Te(this,Ke,Co).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),P(this,Mt)))}createResult(t,n){var _;const r=P(this,Ie),i=this.options,s=P(this,Mt),o=P(this,bi),a=P(this,ys),c=t!==r?t.state:P(this,ba),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const A=this.hasListeners(),D=!A&&Ih(t,n),I=A&&Lh(t,r,n,i);(D||I)&&(d={...d,...S0(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:p}=d;h=d.data;let v=!1;if(n.placeholderData!==void 0&&h===void 0&&p==="pending"){let A;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(A=s.data,v=!0):A=typeof n.placeholderData=="function"?n.placeholderData((_=P(this,ps))==null?void 0:_.state.data,P(this,ps)):n.placeholderData,A!==void 0&&(p="success",h=Wu(s==null?void 0:s.data,A,n),f=!0)}if(n.select&&h!==void 0&&!v)if(s&&h===(o==null?void 0:o.data)&&n.select===P(this,xa))h=P(this,ms);else try{X(this,xa,n.select),h=n.select(h),h=Wu(s==null?void 0:s.data,h,n),X(this,ms,h),X(this,$r,null)}catch(A){X(this,$r,A)}P(this,$r)&&(g=P(this,$r),h=P(this,ms),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",w=p==="pending",S=p==="error",x=w&&b,O=h!==void 0,k={status:p,fetchStatus:d.fetchStatus,isPending:w,isSuccess:p==="success",isError:S,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:m,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:b,isRefetching:b&&!w,isLoadingError:S&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&O,isStale:ff(t,n),refetch:this.refetch,promise:P(this,Mr),isEnabled:gn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=z=>{k.status==="error"?z.reject(k.error):k.data!==void 0&&z.resolve(k.data)},D=()=>{const z=X(this,Mr,k.promise=Vu());A(z)},I=P(this,Mr);switch(I.status){case"pending":t.queryHash===r.queryHash&&A(I);break;case"fulfilled":(k.status==="error"||k.data!==I.value)&&D();break;case"rejected":(k.status!=="error"||k.error!==I.reason)&&D();break}}return k}updateResult(){const t=P(this,Mt),n=this.createResult(P(this,Ie),this.options);if(X(this,bi,P(this,Ie).state),X(this,ys,this.options),P(this,bi).data!==void 0&&X(this,ps,P(this,Ie)),Ll(n,t))return;X(this,Mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!P(this,vs).size)return!0;const o=new Set(s!=null?s:P(this,vs));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Mt)).some(a=>{const l=a;return P(this,Mt)[l]!==t[l]&&o.has(l)})};Te(this,Ke,_0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ke,Xu).call(this)}},Nt=new WeakMap,Ie=new WeakMap,ba=new WeakMap,Mt=new WeakMap,bi=new WeakMap,ys=new WeakMap,Mr=new WeakMap,$r=new WeakMap,xa=new WeakMap,ms=new WeakMap,ps=new WeakMap,xi=new WeakMap,wi=new WeakMap,Dr=new WeakMap,vs=new WeakMap,Ke=new WeakSet,Co=function(t){Te(this,Ke,ed).call(this);let n=P(this,Ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($t)),n},Gu=function(){Te(this,Ke,Ju).call(this);const t=qr(this.options.staleTime,P(this,Ie));if(Ei||P(this,Mt).isStale||!Hu(t))return;const r=y0(P(this,Mt).dataUpdatedAt,t)+1;X(this,xi,setTimeout(()=>{P(this,Mt).isStale||this.updateResult()},r))},Qu=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Ie)):this.options.refetchInterval)!=null?t:!1},Yu=function(t){Te(this,Ke,Zu).call(this),X(this,Dr,t),!(Ei||gn(this.options.enabled,P(this,Ie))===!1||!Hu(P(this,Dr))||P(this,Dr)===0)&&X(this,wi,setInterval(()=>{(this.options.refetchIntervalInBackground||df.isFocused())&&Te(this,Ke,Co).call(this)},P(this,Dr)))},Xu=function(){Te(this,Ke,Gu).call(this),Te(this,Ke,Yu).call(this,Te(this,Ke,Qu).call(this))},Ju=function(){P(this,xi)&&(clearTimeout(P(this,xi)),X(this,xi,void 0))},Zu=function(){P(this,wi)&&(clearInterval(P(this,wi)),X(this,wi,void 0))},ed=function(){const t=P(this,Nt).getQueryCache().build(P(this,Nt),this.options);if(t===P(this,Ie))return;const n=P(this,Ie);X(this,Ie,t),X(this,ba,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_0=function(t){gt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Mt))}),P(this,Nt).getQueryCache().notify({query:P(this,Ie),type:"observerResultsUpdated"})})},Qp);function L2(e,t){return gn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ih(e,t){return L2(e,t)||e.state.data!==void 0&&td(e,t,t.refetchOnMount)}function td(e,t,n){if(gn(t.enabled,e)!==!1&&qr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ff(e,t)}return!1}function Lh(e,t,n,r){return(e!==t||gn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ff(e,n)}function ff(e,t){return gn(t.enabled,e)!==!1&&e.isStaleByTime(qr(t.staleTime,e))}function R2(e,t){return!Ll(e.getCurrentResult(),t)}var Ir,Lr,Ft,ir,dr,kl,nd,Yp,N2=(Yp=class extends Us{constructor(n,r){super();le(this,dr);le(this,Ir);le(this,Lr);le(this,Ft);le(this,ir);X(this,Ir,n),this.setOptions(r),this.bindMethods(),Te(this,dr,kl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=P(this,Ir).defaultMutationOptions(n),Ll(this.options,r)||P(this,Ir).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Ft),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ai(r.mutationKey)!==Ai(this.options.mutationKey)?this.reset():((i=P(this,Ft))==null?void 0:i.state.status)==="pending"&&P(this,Ft).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Ft))==null||n.removeObserver(this)}onMutationUpdate(n){Te(this,dr,kl).call(this),Te(this,dr,nd).call(this,n)}getCurrentResult(){return P(this,Lr)}reset(){var n;(n=P(this,Ft))==null||n.removeObserver(this),X(this,Ft,void 0),Te(this,dr,kl).call(this),Te(this,dr,nd).call(this)}mutate(n,r){var i;return X(this,ir,r),(i=P(this,Ft))==null||i.removeObserver(this),X(this,Ft,P(this,Ir).getMutationCache().build(P(this,Ir),this.options)),P(this,Ft).addObserver(this),P(this,Ft).execute(n)}},Ir=new WeakMap,Lr=new WeakMap,Ft=new WeakMap,ir=new WeakMap,dr=new WeakSet,kl=function(){var r,i;const n=(i=(r=P(this,Ft))==null?void 0:r.state)!=null?i:C0();X(this,Lr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},nd=function(n){gt.batch(()=>{var r,i,s,o,a,l,c,u;if(P(this,ir)&&this.hasListeners()){const d=P(this,Lr).variables,f=P(this,Lr).context;(n==null?void 0:n.type)==="success"?((i=(r=P(this,ir)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=P(this,ir)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=P(this,ir)).onError)==null||l.call(a,n.error,d,f),(u=(c=P(this,ir)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(P(this,Lr))})})},Yp),k0=M.createContext(void 0),Kt=e=>{const t=M.useContext(k0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},F2=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(k0.Provider,{value:e,children:t})),O0=M.createContext(!1),B2=()=>M.useContext(O0);O0.Provider;function q2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z2=M.createContext(q2()),H2=()=>M.useContext(z2),U2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},K2=e=>{M.useEffect(()=>{e.clearReset()},[e])},W2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||p0(n,[e.error,r])),V2=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r!=null?r:1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},G2=(e,t)=>e.isLoading&&e.isFetching&&!t,Q2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Y2(e,t,n){var d,f,h,g,m;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=B2(),i=H2(),s=Kt(n),o=s.defaultQueryOptions(e);(f=(d=s.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=r?"isRestoring":"optimistic",V2(o),U2(o,i),K2(i);const a=!s.getQueryCache().get(o.queryHash),[l]=M.useState(()=>new t(s,o)),c=l.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(p=>{const v=u?l.subscribe(gt.batchCalls(p)):$t;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),M.useEffect(()=>{l.setOptions(o)},[o,l]),Q2(o,c))throw Rh(o,l,i);if(W2({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,c),o.experimental_prefetchInRender&&!Ei&&G2(c,r)){const p=a?Rh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch($t).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function mr(e,t){return Y2(e,I2,t)}function pr(e,t){const n=Kt(t),[r]=M.useState(()=>new N2(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const i=M.useSyncExternalStore(M.useCallback(o=>r.subscribe(gt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=M.useCallback((o,a)=>{r.mutate(o,a).catch($t)},[r]);if(i.error&&p0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Oe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Nh(this.context.count)},getNextContextId(){return Nh(this.context.count++)}};function Nh(e){const t=String(e),n=t.length-1;return Oe.context.id+(n?String.fromCharCode(96+n):"")+t}function _o(e){Oe.context=e}var E0=!1,X2=(e,t)=>e===t,Nl=Symbol("solid-proxy"),A0=typeof Proxy=="function",mc=Symbol("solid-track"),Fl={equals:X2},P0=I0,vr=1,Bl=2,T0={owned:null,cleanups:null,context:null,owner:null},tu={},qe=null,nu=null,J2=null,Je=null,Pt=null,cr=null,pc=0;function ur(e,t){const n=Je,r=qe,i=e.length===0,s=t===void 0?r:t,o=i?T0:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>ct(()=>Uo(o)));qe=o,Je=null;try{return Kn(a,!0)}finally{Je=n,qe=r}}function oe(e,t){t=t?Object.assign({},Fl,t):Fl;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),D0(n,i));return[$0.bind(n),r]}function j0(e,t,n){const r=vc(e,t,!0,vr);Ks(r)}function ve(e,t,n){const r=vc(e,t,!1,vr);Ks(r)}function be(e,t,n){P0=cS;const r=vc(e,t,!1,vr);(!n||!n.render)&&(r.user=!0),cr?cr.push(r):Ks(r)}function U(e,t,n){n=n?Object.assign({},Fl,n):Fl;const r=vc(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ks(r),$0.bind(r)}function Z2(e){return e&&typeof e=="object"&&"then"in e}function eS(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=tu,l=null,c=!1,u="initialValue"in s,d=typeof r=="function"&&U(r);const f=new Set,[h,g]=(s.storage||oe)(s.initialValue),[m,p]=oe(void 0),[v,b]=oe(void 0,{equals:!1}),[w,S]=oe(u?"ready":"unresolved");Oe.context&&(l=Oe.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Oe.load&&Oe.has(l)&&(a=Oe.load(l)));function x(_,A,D,I){return o===_&&(o=null,I!==void 0&&(u=!0),(_===a||A===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(I,{value:A})),a=tu,O(A,D)),A}function O(_,A){Kn(()=>{A===void 0&&g(()=>_),S(A!==void 0?"errored":u?"ready":"unresolved"),p(A);for(const D of f.keys())D.decrement();f.clear()},!1)}function C(){const _=oS,A=h(),D=m();if(D!==void 0&&!o)throw D;return Je&&Je.user,A}function k(_=!0){if(_!==!1&&c)return;c=!1;const A=d?d():r;if(A==null||A===!1){x(o,ct(h));return}const D=a!==tu?a:ct(()=>i(A,{value:h(),refetching:_}));return Z2(D)?(o=D,"value"in D?(D.status==="success"?x(o,D.value,void 0,A):x(o,void 0,rd(D.value),A),D):(c=!0,queueMicrotask(()=>c=!1),Kn(()=>{S(u?"refreshing":"pending"),b()},!1),D.then(I=>x(D,I,void 0,A),I=>x(D,void 0,rd(I),A)))):(x(o,D,void 0,A),D)}return Object.defineProperties(C,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const _=w();return _==="pending"||_==="refreshing"}},latest:{get(){if(!u)return C();const _=m();if(_&&!o)throw _;return h()}}}),d?j0(()=>k(!1)):k(!1),[C,{refetch:k,mutate:g}]}function tS(e){return Kn(e,!1)}function ct(e){if(Je===null)return e();const t=Je;Je=null;try{return e()}finally{Je=t}}function hr(e,t,n){const r=Array.isArray(e);let i,s=n&&n.defer;return o=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(s)return s=!1,o;const l=ct(()=>t(a,i,o));return i=a,l}}function gr(e){be(()=>ct(e))}function Se(e){return qe===null||(qe.cleanups===null?qe.cleanups=[e]:qe.cleanups.push(e)),e}function Fh(){return qe}function nS(e,t){const n=qe,r=Je;qe=e,Je=null;try{return Kn(t,!0)}catch(i){hf(i)}finally{qe=n,Je=r}}function rS(e){const t=Je,n=qe;return Promise.resolve().then(()=>{Je=t,qe=n;let r;return Kn(e,!1),Je=qe=null,r?r.done:void 0})}var[iS,NN]=oe(!1);function sS(){return[iS,rS]}function wt(e,t){const n=Symbol("context");return{id:n,Provider:uS(n),defaultValue:e}}function St(e){let t;return qe&&qe.context&&(t=qe.context[e.id])!==void 0?t:e.defaultValue}function M0(e){const t=U(e),n=U(()=>id(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var oS;function $0(){if(this.sources&&this.state)if(this.state===vr)Ks(this);else{const e=Pt;Pt=null,Kn(()=>zl(this),!1),Pt=e}if(Je){const e=this.observers?this.observers.length:0;Je.sources?(Je.sources.push(this),Je.sourceSlots.push(e)):(Je.sources=[this],Je.sourceSlots=[e]),this.observers?(this.observers.push(Je),this.observerSlots.push(Je.sources.length-1)):(this.observers=[Je],this.observerSlots=[Je.sources.length-1])}return this.value}function D0(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Kn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=nu&&nu.running;o&&nu.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Pt.push(s):cr.push(s),s.observers&&L0(s)),o||(s.state=vr)}if(Pt.length>1e6)throw Pt=[],new Error},!1)),t}function Ks(e){if(!e.fn)return;Uo(e);const t=pc;aS(e,e.value,t)}function aS(e,t,n){let r;const i=qe,s=Je;Je=qe=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=vr,e.owned&&e.owned.forEach(Uo),e.owned=null),e.updatedAt=n+1,hf(o)}finally{Je=s,qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?D0(e,r):e.value=r,e.updatedAt=n)}function vc(e,t,n,r=vr,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:qe,context:qe?qe.context:null,pure:n};return qe===null||qe!==T0&&(qe.owned?qe.owned.push(s):qe.owned=[s]),s}function ql(e){if(e.state===0)return;if(e.state===Bl)return zl(e);if(e.suspense&&ct(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<pc);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===vr)Ks(e);else if(e.state===Bl){const r=Pt;Pt=null,Kn(()=>zl(e,t[0]),!1),Pt=r}}function Kn(e,t){if(Pt)return e();let n=!1;t||(Pt=[]),cr?n=!0:cr=[],pc++;try{const r=e();return lS(n),r}catch(r){n||(cr=null),Pt=null,hf(r)}}function lS(e){if(Pt&&(I0(Pt),Pt=null),e)return;const t=cr;cr=null,t.length&&Kn(()=>P0(t),!1)}function I0(e){for(let t=0;t<e.length;t++)ql(e[t])}function cS(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:ql(r)}if(Oe.context){if(Oe.count){Oe.effects||(Oe.effects=[]),Oe.effects.push(...e.slice(0,n));return}_o()}for(Oe.effects&&(Oe.done||!Oe.count)&&(e=[...Oe.effects,...e],n+=Oe.effects.length,delete Oe.effects),t=0;t<n;t++)ql(e[t])}function zl(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===vr?r!==t&&(!r.updatedAt||r.updatedAt<pc)&&ql(r):i===Bl&&zl(r,t)}}}function L0(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Bl,n.pure?Pt.push(n):cr.push(n),n.observers&&L0(n))}}function Uo(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const s=i.pop(),o=n.observerSlots.pop();r<i.length&&(s.sourceSlots[o]=r,i[r]=s,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Uo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Uo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function rd(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function hf(e,t=qe){throw rd(e)}function id(e){if(typeof e=="function"&&!e.length)return id(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=id(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function uS(e,t){return function(r){let i;return ve(()=>i=ct(()=>(qe.context={...qe.context,[e]:r.value},M0(()=>r.children))),void 0),i}}var sd=Symbol("fallback");function Hl(e){for(let t=0;t<e.length;t++)e[t]()}function dS(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return Se(()=>Hl(s)),()=>{let l=e()||[],c=l.length,u,d;return l[mc],ct(()=>{let h,g,m,p,v,b,w,S,x;if(c===0)o!==0&&(Hl(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[sd],i[0]=ur(O=>(s[0]=O,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=ur(f);o=c}else{for(m=new Array(c),p=new Array(c),a&&(v=new Array(c)),b=0,w=Math.min(o,c);b<w&&r[b]===l[b];b++);for(w=o-1,S=c-1;w>=b&&S>=b&&r[w]===l[S];w--,S--)m[S]=i[w],p[S]=s[w],a&&(v[S]=a[w]);for(h=new Map,g=new Array(S+1),d=S;d>=b;d--)x=l[d],u=h.get(x),g[d]=u===void 0?-1:u,h.set(x,d);for(u=b;u<=w;u++)x=r[u],d=h.get(x),d!==void 0&&d!==-1?(m[d]=i[u],p[d]=s[u],a&&(v[d]=a[u]),d=g[d],h.set(x,d)):s[u]();for(d=b;d<c;d++)d in m?(i[d]=m[d],s[d]=p[d],a&&(a[d]=v[d],a[d](d))):i[d]=ur(f);i=i.slice(0,o=c),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=oe(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function fS(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return Se(()=>Hl(s)),()=>{const c=e()||[],u=c.length;return c[mc],ct(()=>{if(u===0)return a!==0&&(Hl(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[sd],i[0]=ur(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===sd&&(s[0](),s=[],r=[],i=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=ur(d));for(;l<r.length;l++)s[l]();return a=o.length=s.length=u,r=c.slice(0),i=i.slice(0,a)});function d(f){s[l]=f;const[h,g]=oe(c[l]);return o[l]=g,t(h,l)}}}function j(e,t){return ct(()=>e(t||{}))}function Ja(){return!0}var od={get(e,t,n){return t===Nl?n:e.get(t)},has(e,t){return t===Nl?!0:e.has(t)},set:Ja,deleteProperty:Ja,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ja,deleteProperty:Ja}},ownKeys(e){return e.keys()}};function ru(e){return(e=typeof e=="function"?e():e)?e:{}}function hS(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Ee(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Nl in a,e[o]=typeof a=="function"?(t=!0,U(a)):a}if(A0&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=ru(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ru(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ru(e[a])));return[...new Set(o)]}},od);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:hS.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function We(e,...t){if(A0&&Nl in e){const i=new Set(t.length>1?t.flat():t[0]),s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},od));return s.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},od)),s}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,i),o=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const c of t)c.includes(i)&&(a=!0,o?r[l][i]=s.value:Object.defineProperty(r[l],i,s)),++l;a||(o?n[i]=s.value:Object.defineProperty(n,i,s))}return[...r,n]}function R0(e){let t,n;const r=i=>{const s=Oe.context;if(s){const[a,l]=oe();Oe.count||(Oe.count=0),Oe.count++,(n||(n=e())).then(c=>{!Oe.done&&_o(s),Oe.count--,l(()=>c.default),_o()}),t=a}else if(!t){const[a]=eS(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return U(()=>(o=t())?ct(()=>{if(!s||Oe.done)return o(i);const a=Oe.context;_o(s);const l=o(i);return _o(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var gS=0;function wn(){return Oe.context?Oe.getNextContextId():`cl-${gS++}`}var N0=e=>`Stale read from <${e}>.`;function yS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(dS(()=>e.each,e.children,t||void 0))}function mS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(fS(()=>e.each,e.children,t||void 0))}function pe(e){const t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(i,s)=>!i==!s});return U(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?ct(()=>s(t?i:()=>{if(!ct(r))throw N0("Show");return n()})):s}return e.fallback},void 0,void 0)}function pS(e){const t=M0(()=>e.children),n=U(()=>{const r=t(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;o<i.length;o++){const a=o,l=i[o],c=s,u=U(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:U(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return U(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?ct(()=>a(o.keyed?s():()=>{var c;if(((c=ct(n)())==null?void 0:c[0])!==i)throw N0("Match");return s()})):a},void 0,void 0)}function iu(e){return e}var vS=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],bS=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...vS]),xS=new Set(["innerHTML","textContent","innerText","children"]),wS=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),SS=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function CS(e,t){const n=SS[e];return typeof n=="object"?n[t]?n.$:void 0:n}var _S=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),kS=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","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-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),OS={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ES(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,c=null;for(;o<i||a<s;){if(t[o]===n[a]){o++,a++;continue}for(;t[i-1]===n[s-1];)i--,s--;if(i===o){const u=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],u)}else if(s===a)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[a]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[a++],t[o++].nextSibling),e.insertBefore(n[--s],u),t[i]=n[s]}else{if(!c){c=new Map;let d=a;for(;d<s;)c.set(n[d],d++)}const u=c.get(t[o]);if(u!=null)if(a<u&&u<s){let d=o,f=1,h;for(;++d<i&&d<s&&!((h=c.get(t[d]))==null||h!==u+f);)f++;if(f>u-a){const g=t[o];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[o++])}else o++;else t[o++].remove()}}}var Lo="_$DX_DELEGATE";function F0(e,t,n,r={}){let i;return ur(s=>{i=s,t===document?e():W(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function de(e,t,n,r){let i;const s=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},o=()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function bc(e,t=window.document){const n=t[Lo]||(t[Lo]=new Set);for(let r=0,i=e.length;r<i;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,z0))}}function AS(e=window.document){if(e[Lo]){for(let t of e[Lo].keys())e.removeEventListener(t,z0);delete e[Lo]}}function J(e,t,n){Ni(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function PS(e,t,n,r){Ni(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function TS(e,t,n){Ni(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function te(e,t){Ni(e)||(t==null?e.removeAttribute("class"):e.className=t)}function B0(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=s=>i.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function jS(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let s,o;for(s=0,o=i.length;s<o;s++){const a=i[s];!a||a==="undefined"||t[a]||(Bh(e,a,!1),delete n[a])}for(s=0,o=r.length;s<o;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Bh(e,a,!0),n[a]=l)}return n}function MS(e,t,n){if(!t)return n?J(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)i=t[s],i!==n[s]&&(r.setProperty(s,i),n[s]=i);return n}function q0(e,t={},n,r){const i={};return r||ve(()=>i.children=Ko(e,t.children,i.children)),ve(()=>typeof t.ref=="function"&&Ws(t.ref,e)),ve(()=>$S(e,t,n,!0,i,!0)),i}function Ws(e,t,n){return ct(()=>e(t,n))}function W(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ko(e,t,r,n);ve(i=>Ko(e,t(),i,n),r)}function $S(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=qh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=qh(e,o,a,i[o],n,s,t)}}function DS(e){let t,n;return!Ni()||!(t=Oe.registry.get(n=LS()))?e():(Oe.completed&&Oe.completed.add(t),Oe.registry.delete(n),t)}function Ni(e){return!!Oe.context&&!Oe.done&&(!e||e.isConnected)}function IS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Bh(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,s=r.length;i<s;i++)e.classList.toggle(r[i],n)}function qh(e,t,n,r,i,s,o){let a,l,c,u,d;if(t==="style")return MS(e,n,r);if(t==="classList")return jS(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=_S.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(B0(e,f,n,h),h&&bc([f]))}else if(t.slice(0,5)==="attr:")J(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")TS(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=xS.has(t))||!i&&((u=CS(t,e.tagName))||(l=bS.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Ni(e))return n;t==="class"||t==="className"?te(e,n):a&&!l&&!c?e[IS(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&OS[t.split(":")[0]];f?PS(e,f,t,n):J(e,wS[t]||t,n)}return n}function z0(e){if(Oe.registry&&Oe.events&&Oe.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Oe.registry&&!Oe.done&&(Oe.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();s(r)}function Ko(e,t,n,r,i){const s=Ni(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(s||o==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Wi(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(s)return n;n=Wi(e,n,r)}else{if(o==="function")return ve(()=>{let l=t();for(;typeof l=="function";)l=l();n=Ko(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(ad(l,t,n,i))return ve(()=>n=Ko(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Wi(e,n,r),a)return n}else c?n.length===0?zh(e,l,r):ES(e,n,l):(n&&Wi(e),zh(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=Wi(e,n,r,t);Wi(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ad(e,t,n,r){let i=!1;for(let s=0,o=t.length;s<o;s++){let a=t[s],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=ad(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=ad(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function zh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Wi(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,n):l&&a.remove()}else s=!0}}else e.insertBefore(i,n);return[i]}function LS(){return Oe.getNextContextId()}var RS="http://www.w3.org/2000/svg";function H0(e,t=!1){return t?document.createElementNS(RS,e):document.createElement(e)}function U0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Fh();let s,o=!!Oe.context;return be(()=>{o&&(Fh().user=o=!1),s||(s=nS(i,()=>U(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=oe(!1),u=()=>c(!0);ur(d=>W(a,()=>l()?d():s(),null)),Se(u)}else{const l=H0(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),W(c,s),a.appendChild(l),e.ref&&e.ref(l),Se(()=>a.removeChild(l))}},void 0,{render:!o}),n}function NS(e,t){const n=U(e);return U(()=>{const r=n();switch(typeof r){case"function":return ct(()=>r(t));case"string":const i=kS.has(r),s=Oe.context?DS():H0(r,i);return q0(s,t,i),s}})}function FS(e){const[,t]=We(e,["component"]);return NS(()=>e.component,t)}var BS=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},K0=class{constructor(t){this.generateIdentifier=t,this.kv=new BS}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},qS=class extends K0{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t=="object"?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function zS(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function HS(e,t){const n=zS(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const s=r[i];if(t(s))return s}}function Rs(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Ol(e,t){return e.indexOf(t)!==-1}function Hh(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var US=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return HS(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},KS=e=>Object.prototype.toString.call(e).slice(8,-1),W0=e=>typeof e=="undefined",WS=e=>e===null,Wo=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ld=e=>Wo(e)&&Object.keys(e).length===0,Kr=e=>Array.isArray(e),VS=e=>typeof e=="string",GS=e=>typeof e=="number"&&!isNaN(e),QS=e=>typeof e=="boolean",YS=e=>e instanceof RegExp,Vo=e=>e instanceof Map,Go=e=>e instanceof Set,V0=e=>KS(e)==="Symbol",XS=e=>e instanceof Date&&!isNaN(e.valueOf()),JS=e=>e instanceof Error,Uh=e=>typeof e=="number"&&isNaN(e),ZS=e=>QS(e)||WS(e)||W0(e)||GS(e)||VS(e)||V0(e),eC=e=>typeof e=="bigint",tC=e=>e===1/0||e===-1/0,nC=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),rC=e=>e instanceof URL,G0=e=>e.replace(/\./g,"\\."),su=e=>e.map(String).map(G0).join("."),Ro=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(s==="."){t.push(n),n="";continue}n+=s}const r=n;return t.push(r),t};function $n(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var Q0=[$n(W0,"undefined",()=>null,()=>{}),$n(eC,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),$n(XS,"Date",e=>e.toISOString(),e=>new Date(e)),$n(JS,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),$n(YS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),$n(Go,"set",e=>[...e.values()],e=>new Set(e)),$n(Vo,"map",e=>[...e.entries()],e=>new Map(e)),$n(e=>Uh(e)||tC(e),"number",e=>Uh(e)?"NaN":e>0?"Infinity":"-Infinity",Number),$n(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),$n(rC,"URL",e=>e.toString(),e=>new URL(e))];function xc(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var Y0=xc((e,t)=>V0(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),iC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),X0=xc(nC,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=iC[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function J0(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Z0=xc(J0,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),ev=xc((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),sC=[Z0,Y0,ev,X0],Kh=(e,t)=>{const n=Hh(sC,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Hh(Q0,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},tv={};Q0.forEach(e=>{tv[e.annotation]=e});var oC=(e,t,n)=>{if(Kr(t))switch(t[0]){case"symbol":return Y0.untransform(e,t,n);case"class":return Z0.untransform(e,t,n);case"custom":return ev.untransform(e,t,n);case"typed-array":return X0.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=tv[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},es=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function nv(e){if(Ol(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ol(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ol(e,"constructor"))throw new Error("constructor is not allowed as a property")}var aC=(e,t)=>{nv(t);for(let n=0;n<t.length;n++){const r=t[n];if(Go(e))e=es(e,+r);else if(Vo(e)){const i=+r,s=+t[++n]==0?"key":"value",o=es(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},cd=(e,t,n)=>{if(nv(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(Kr(r)){const a=+o;r=r[a]}else if(Wo(r))r=r[o];else if(Go(r)){const a=+o;r=es(r,a)}else if(Vo(r)){if(s===t.length-2)break;const l=+o,c=+t[++s]==0?"key":"value",u=es(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(Kr(r)?r[+i]=n(r[+i]):Wo(r)&&(r[i]=n(r[i])),Go(r)){const s=es(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Vo(r)){const s=+t[t.length-2],o=es(r,s);switch(+i==0?"key":"value"){case"key":{const l=n(o);r.set(l,r.get(o)),l!==o&&r.delete(o);break}case"value":{r.set(o,n(r.get(o)));break}}}return e};function ud(e,t,n=[]){if(!e)return;if(!Kr(e)){Rs(e,(s,o)=>ud(s,t,[...n,...Ro(o)]));return}const[r,i]=e;i&&Rs(i,(s,o)=>{ud(s,t,[...n,...Ro(o)])}),t(r,n)}function lC(e,t,n){return ud(t,(r,i)=>{e=cd(e,i,s=>oC(s,r,n))}),e}function cC(e,t){function n(r,i){const s=aC(e,Ro(i));r.map(Ro).forEach(o=>{e=cd(e,o,()=>s)})}if(Kr(t)){const[r,i]=t;r.forEach(s=>{e=cd(e,Ro(s),()=>e)}),i&&Rs(i,n)}else Rs(t,n);return e}var uC=(e,t)=>Wo(e)||Kr(e)||Vo(e)||Go(e)||J0(e,t);function dC(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function fC(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[s,...o]=i;s.length===0?r=o.map(su):n[su(s)]=o.map(su)}),r?ld(n)?[r]:[r,n]:ld(n)?void 0:n}var rv=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=ZS(e);if(!a){dC(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!uC(e,n)){const g=Kh(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(Ol(s,e))return{transformedValue:null};const l=Kh(e,n),c=(h=l==null?void 0:l.value)!=null?h:e,u=Kr(c)?[]:{},d={};Rs(c,(g,m)=>{if(m==="__proto__"||m==="constructor"||m==="prototype")throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);const p=rv(g,t,n,r,[...i,m],[...s,e],o);u[m]=p.transformedValue,Kr(p.annotations)?d[m]=p.annotations:Wo(p.annotations)&&Rs(p.annotations,(v,b)=>{d[G0(m)+"."+b]=v})});const f=ld(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return a||o.set(e,f),f};function iv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Wh(e){return iv(e)==="Array"}function hC(e){if(iv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function gC(e,t,n,r,i){const s={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=n),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function dd(e,t={}){if(Wh(e))return e.map(i=>dd(i,t));if(!hC(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(Wh(t.props)&&!t.props.includes(s))return i;const o=e[s],a=dd(o,t);return gC(i,s,a,e,t.nonenumerable),i},{})}var Ze=class{constructor({dedupe:e=!1}={}){this.classRegistry=new qS,this.symbolRegistry=new K0(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new US,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=rv(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=fC(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=dd(t);return n!=null&&n.values&&(r=lC(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=cC(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Ze.defaultInstance=new Ze;Ze.serialize=Ze.defaultInstance.serialize.bind(Ze.defaultInstance);Ze.deserialize=Ze.defaultInstance.deserialize.bind(Ze.defaultInstance);Ze.stringify=Ze.defaultInstance.stringify.bind(Ze.defaultInstance);Ze.parse=Ze.defaultInstance.parse.bind(Ze.defaultInstance);Ze.registerClass=Ze.defaultInstance.registerClass.bind(Ze.defaultInstance);Ze.registerSymbol=Ze.defaultInstance.registerSymbol.bind(Ze.defaultInstance);Ze.registerCustom=Ze.defaultInstance.registerCustom.bind(Ze.defaultInstance);Ze.allowErrorProps=Ze.defaultInstance.allowErrorProps.bind(Ze.defaultInstance);var sv=Ze.serialize,yC=Ze.stringify;function Xi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function mC(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function pC({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ts({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function vC(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Ul=(e,t=!1)=>{const{json:n}=sv(e);return JSON.stringify(n,null,t?2:void 0)},Za=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,bC=(e,t)=>e.queryHash.localeCompare(t.queryHash),ov=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,xC=(e,t)=>Za(e)===Za(t)?ov(e,t):Za(e)>Za(t)?1:-1,fd={status:xC,"query hash":bC,"last updated":ov},el=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,av=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,wC=(e,t)=>el(e)===el(t)?av(e,t):el(e)>el(t)?1:-1,hd={status:wC,"last updated":av},Vh=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),lv=()=>{const[e,t]=oe("dark");return gr(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=i=>{t(i.matches?"dark":"light")};n.addEventListener("change",r),Se(()=>n.removeEventListener("change",r))}),e},ui=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[i,...s]=t;return r.set(i,ui(r.get(i),s,n)),r}if(e instanceof Set){const r=ui(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ui(r[i],s,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[i,...s]=t;return r[i]=ui(r[i],s,n),r}return e},ko=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...i]=t;return n.set(r,ko(n.get(r),i)),n}if(e instanceof Set){const n=ko(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((s,o)=>o.toString()!==t[0]);const[r,...i]=t;return n[r]=ko(n[r],i),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...i]=t;return n[r]=ko(n[r],i),n}return e},cv=(e,t)=>{if(!e||document.querySelector("#_goober")||(t==null?void 0:t.querySelector("#_goober")))return;const r=document.createElement("style"),i=document.createTextNode("");r.appendChild(i),r.id="_goober",r.setAttribute("nonce",e),t?t.appendChild(r):document.head.appendChild(r)},bs,wa,Sa,Ca,Si,_a,xs,ws,Ss,Cs,_s,ks,ka,Xp,SC=(Xp=class{constructor(e){le(this,bs);le(this,wa);le(this,Sa);le(this,Ca);le(this,Si,!1);le(this,_a);le(this,xs);le(this,ws);le(this,Ss);le(this,Cs);le(this,_s);le(this,ks);le(this,ka);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;X(this,bs,oe(t)),X(this,Sa,n),X(this,Ca,r),X(this,wa,i),X(this,_a,c),X(this,xs,u),X(this,ws,oe(s)),X(this,Ss,oe(o)),X(this,Cs,oe(a)),X(this,_s,oe(l))}setButtonPosition(e){P(this,ws)[1](e)}setPosition(e){P(this,Ss)[1](e)}setInitialIsOpen(e){P(this,Cs)[1](e)}setErrorTypes(e){P(this,_s)[1](e)}setClient(e){P(this,bs)[1](e)}mount(e){if(P(this,Si))throw new Error("Devtools is already mounted");const t=F0(()=>{const n=this,[r]=P(this,ws),[i]=P(this,Ss),[s]=P(this,Cs),[o]=P(this,_s),[a]=P(this,bs);let l;return P(this,ks)?l=P(this,ks):(l=R0(()=>Promise.resolve().then(()=>eR)),X(this,ks,l)),cv(P(this,_a),P(this,xs)),j(l,Ee({get queryFlavor(){return P(n,Sa)},get version(){return P(n,Ca)},get onlineManager(){return P(n,wa)},get shadowDOMTarget(){return P(n,xs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);X(this,Si,!0),X(this,ka,t)}unmount(){var e;if(!P(this,Si))throw new Error("Devtools is not mounted");(e=P(this,ka))==null||e.call(this),X(this,Si,!1)}},bs=new WeakMap,wa=new WeakMap,Sa=new WeakMap,Ca=new WeakMap,Si=new WeakMap,_a=new WeakMap,xs=new WeakMap,ws=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,_s=new WeakMap,ks=new WeakMap,ka=new WeakMap,Xp),Os,Oa,Ea,Aa,Ci,Pa,Es,As,Ps,Ts,js,Ms,$s,Ta,Jp,CC=(Jp=class{constructor(e){le(this,Os);le(this,Oa);le(this,Ea);le(this,Aa);le(this,Ci,!1);le(this,Pa);le(this,Es);le(this,As);le(this,Ps);le(this,Ts);le(this,js);le(this,Ms);le(this,$s);le(this,Ta);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;X(this,Os,oe(t)),X(this,Ea,n),X(this,Aa,r),X(this,Oa,i),X(this,Pa,c),X(this,Es,u),X(this,As,oe(s)),X(this,Ps,oe(o)),X(this,Ts,oe(a)),X(this,js,oe(l)),X(this,Ms,oe(d))}setButtonPosition(e){P(this,As)[1](e)}setPosition(e){P(this,Ps)[1](e)}setInitialIsOpen(e){P(this,Ts)[1](e)}setErrorTypes(e){P(this,js)[1](e)}setClient(e){P(this,Os)[1](e)}setOnClose(e){P(this,Ms)[1](()=>e)}mount(e){if(P(this,Ci))throw new Error("Devtools is already mounted");const t=F0(()=>{const n=this,[r]=P(this,As),[i]=P(this,Ps),[s]=P(this,Ts),[o]=P(this,js),[a]=P(this,Os),[l]=P(this,Ms);let c;return P(this,$s)?c=P(this,$s):(c=R0(()=>Promise.resolve().then(()=>rR)),X(this,$s,c)),cv(P(this,Pa),P(this,Es)),j(c,Ee({get queryFlavor(){return P(n,Ea)},get version(){return P(n,Aa)},get onlineManager(){return P(n,Oa)},get shadowDOMTarget(){return P(n,Es)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()},get onClose(){return l()}}))},e);X(this,Ci,!0),X(this,Ta,t)}unmount(){var e;if(!P(this,Ci))throw new Error("Devtools is not mounted");(e=P(this,Ta))==null||e.call(this),X(this,Ci,!1)}},Os=new WeakMap,Oa=new WeakMap,Ea=new WeakMap,Aa=new WeakMap,Ci=new WeakMap,Pa=new WeakMap,Es=new WeakMap,As=new WeakMap,Ps=new WeakMap,Ts=new WeakMap,js=new WeakMap,Ms=new WeakMap,$s=new WeakMap,Ta=new WeakMap,Jp);function _C(e){const t=Kt(e.client),n=M.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[c]=M.useState(new SC({client:t,queryFlavor:"React Query",version:"5",onlineManager:Ls,buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}));return M.useEffect(()=>{c.setClient(t)},[t,c]),M.useEffect(()=>{r&&c.setButtonPosition(r)},[r,c]),M.useEffect(()=>{i&&c.setPosition(i)},[i,c]),M.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),M.useEffect(()=>{c.setErrorTypes(o||[])},[o,c]),M.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),y.jsx("div",{dir:"ltr",className:"tsqd-parent-container",ref:n})}function kC(e){const t=Kt(e.client),n=M.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=M.useState(new CC({client:t,queryFlavor:"React Query",version:"5",onlineManager:Ls,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:s,onClose:e.onClose}));return M.useEffect(()=>{o.setClient(t)},[t,o]),M.useEffect(()=>{var a;o.setOnClose((a=e.onClose)!=null?a:()=>{})},[e.onClose,o]),M.useEffect(()=>{o.setErrorTypes(r||[])},[r,o]),M.useEffect(()=>(n.current&&o.mount(n.current),()=>{o.unmount()}),[o]),y.jsx("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:n})}var OC=process.env.NODE_ENV!=="development"?function(){return null}:_C;process.env.NODE_ENV;function uv(e,t){return function(){return e.apply(t,arguments)}}const{toString:EC}=Object.prototype,{getPrototypeOf:gf}=Object,{iterator:wc,toStringTag:dv}=Symbol,Sc=(e=>t=>{const n=EC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mn=e=>(e=e.toLowerCase(),t=>Sc(t)===e),Cc=e=>t=>typeof t===e,{isArray:Vs}=Array,Qo=Cc("undefined");function AC(e){return e!==null&&!Qo(e)&&e.constructor!==null&&!Qo(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fv=Mn("ArrayBuffer");function PC(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fv(e.buffer),t}const TC=Cc("string"),zt=Cc("function"),hv=Cc("number"),_c=e=>e!==null&&typeof e=="object",jC=e=>e===!0||e===!1,El=e=>{if(Sc(e)!=="object")return!1;const t=gf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(dv in e)&&!(wc in e)},MC=Mn("Date"),$C=Mn("File"),DC=Mn("Blob"),IC=Mn("FileList"),LC=e=>_c(e)&&zt(e.pipe),RC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=Sc(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},NC=Mn("URLSearchParams"),[FC,BC,qC,zC]=["ReadableStream","Request","Response","Headers"].map(Mn),HC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $a(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),Vs(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function gv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const di=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,yv=e=>!Qo(e)&&e!==di;function gd(){const{caseless:e}=yv(this)&&this||{},t={},n=(r,i)=>{const s=e&&gv(t,i)||i;El(t[s])&&El(r)?t[s]=gd(t[s],r):El(r)?t[s]=gd({},r):Vs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&$a(arguments[r],n);return t}const UC=(e,t,n,{allOwnKeys:r}={})=>($a(t,(i,s)=>{n&&zt(i)?e[s]=uv(i,n):e[s]=i},{allOwnKeys:r}),e),KC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),WC=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},VC=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&gf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},GC=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},QC=e=>{if(!e)return null;if(Vs(e))return e;let t=e.length;if(!hv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},YC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&gf(Uint8Array)),XC=(e,t)=>{const r=(e&&e[wc]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},JC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ZC=Mn("HTMLFormElement"),e_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Gh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),t_=Mn("RegExp"),mv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$a(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},n_=e=>{mv(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},r_=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Vs(e)?r(e):r(String(e).split(t)),n},i_=()=>{},s_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function o_(e){return!!(e&&zt(e.append)&&e[dv]==="FormData"&&e[wc])}const a_=e=>{const t=new Array(10),n=(r,i)=>{if(_c(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Vs(r)?[]:{};return $a(r,(o,a)=>{const l=n(o,i+1);!Qo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},l_=Mn("AsyncFunction"),c_=e=>e&&(_c(e)||zt(e))&&zt(e.then)&&zt(e.catch),pv=((e,t)=>e?setImmediate:t?((n,r)=>(di.addEventListener("message",({source:i,data:s})=>{i===di&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),di.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zt(di.postMessage)),u_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(di):typeof process!="undefined"&&process.nextTick||pv,d_=e=>e!=null&&zt(e[wc]),B={isArray:Vs,isArrayBuffer:fv,isBuffer:AC,isFormData:RC,isArrayBufferView:PC,isString:TC,isNumber:hv,isBoolean:jC,isObject:_c,isPlainObject:El,isReadableStream:FC,isRequest:BC,isResponse:qC,isHeaders:zC,isUndefined:Qo,isDate:MC,isFile:$C,isBlob:DC,isRegExp:t_,isFunction:zt,isStream:LC,isURLSearchParams:NC,isTypedArray:YC,isFileList:IC,forEach:$a,merge:gd,extend:UC,trim:HC,stripBOM:KC,inherits:WC,toFlatObject:VC,kindOf:Sc,kindOfTest:Mn,endsWith:GC,toArray:QC,forEachEntry:XC,matchAll:JC,isHTMLForm:ZC,hasOwnProperty:Gh,hasOwnProp:Gh,reduceDescriptors:mv,freezeMethods:n_,toObjectSet:r_,toCamelCase:e_,noop:i_,toFiniteNumber:s_,findKey:gv,global:di,isContextDefined:yv,isSpecCompliantForm:o_,toJSONObject:a_,isAsyncFn:l_,isThenable:c_,setImmediate:pv,asap:u_,isIterable:d_};function Ae(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}B.inherits(Ae,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const vv=Ae.prototype,bv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{bv[e]={value:e}});Object.defineProperties(Ae,bv);Object.defineProperty(vv,"isAxiosError",{value:!0});Ae.from=(e,t,n,r,i,s)=>{const o=Object.create(vv);return B.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Ae.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const f_=null;function yd(e){return B.isPlainObject(e)||B.isArray(e)}function xv(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function Qh(e,t,n){return e?e.concat(t).map(function(i,s){return i=xv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function h_(e){return B.isArray(e)&&!e.some(yd)}const g_=B.toFlatObject(B,{},null,function(t){return/^is[A-Z]/.test(t)});function kc(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!B.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(B.isDate(g))return g.toISOString();if(B.isBoolean(g))return g.toString();if(!l&&B.isBlob(g))throw new Ae("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(g)||B.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,m,p){let v=g;if(g&&!p&&typeof g=="object"){if(B.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(B.isArray(g)&&h_(g)||(B.isFileList(g)||B.endsWith(m,"[]"))&&(v=B.toArray(g)))return m=xv(m),v.forEach(function(w,S){!(B.isUndefined(w)||w===null)&&t.append(o===!0?Qh([m],S,s):o===null?m:m+"[]",c(w))}),!1}return yd(g)?!0:(t.append(Qh(p,m,s),c(g)),!1)}const d=[],f=Object.assign(g_,{defaultVisitor:u,convertValue:c,isVisitable:yd});function h(g,m){if(!B.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),B.forEach(g,function(v,b){(!(B.isUndefined(v)||v===null)&&i.call(t,v,B.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!B.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Yh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function yf(e,t){this._pairs=[],e&&kc(e,this,t)}const wv=yf.prototype;wv.append=function(t,n){this._pairs.push([t,n])};wv.toString=function(t){const n=t?function(r){return t.call(this,r,Yh)}:Yh;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function y_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Sv(e,t,n){if(!t)return e;const r=n&&n.encode||y_;B.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=B.isURLSearchParams(t)?t.toString():new yf(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Xh{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Cv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},m_=typeof URLSearchParams!="undefined"?URLSearchParams:yf,p_=typeof FormData!="undefined"?FormData:null,v_=typeof Blob!="undefined"?Blob:null,b_={isBrowser:!0,classes:{URLSearchParams:m_,FormData:p_,Blob:v_},protocols:["http","https","file","blob","url","data"]},mf=typeof window!="undefined"&&typeof document!="undefined",md=typeof navigator=="object"&&navigator||void 0,x_=mf&&(!md||["ReactNative","NativeScript","NS"].indexOf(md.product)<0),w_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",S_=mf&&window.location.href||"http://localhost",C_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mf,hasStandardBrowserEnv:x_,hasStandardBrowserWebWorkerEnv:w_,navigator:md,origin:S_},Symbol.toStringTag,{value:"Module"})),At={...C_,...b_};function __(e,t){return kc(e,new At.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return At.isNode&&B.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function k_(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O_(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function _v(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&B.isArray(i)?i.length:o,l?(B.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!B.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&B.isArray(i[o])&&(i[o]=O_(i[o])),!a)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,(r,i)=>{t(k_(r),i,n,0)}),n}return null}function E_(e,t,n){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Da={transitional:Cv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=B.isObject(t);if(s&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return i?JSON.stringify(_v(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t)||B.isReadableStream(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return __(t,this.formSerializer).toString();if((a=B.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return kc(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),E_(t)):t}],transformResponse:[function(t){const n=this.transitional||Da.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(B.isResponse(t)||B.isReadableStream(t))return t;if(t&&B.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Ae.from(a,Ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],e=>{Da.headers[e]={}});const A_=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),P_=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
13
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&A_[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Jh=Symbol("internals");function oo(e){return e&&String(e).trim().toLowerCase()}function Al(e){return e===!1||e==null?e:B.isArray(e)?e.map(Al):String(e)}function T_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const j_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ou(e,t,n,r,i){if(B.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!B.isString(t)){if(B.isString(r))return t.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(t)}}function M_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $_(e,t){const n=B.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Ht=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=oo(l);if(!u)throw new Error("header name must be a non-empty string");const d=B.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Al(a))}const o=(a,l)=>B.forEach(a,(c,u)=>s(c,u,l));if(B.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(B.isString(t)&&(t=t.trim())&&!j_(t))o(P_(t),n);else if(B.isObject(t)&&B.isIterable(t)){let a={},l,c;for(const u of t){if(!B.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?B.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=oo(t),t){const r=B.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return T_(i);if(B.isFunction(n))return n.call(this,i,r);if(B.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=oo(t),t){const r=B.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ou(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=oo(o),o){const a=B.findKey(r,o);a&&(!n||ou(r,r[a],a,n))&&(delete r[a],i=!0)}}return B.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||ou(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return B.forEach(this,(i,s)=>{const o=B.findKey(r,s);if(o){n[o]=Al(i),delete n[s];return}const a=t?M_(s):String(s).trim();a!==s&&delete n[s],n[a]=Al(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return B.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&B.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
14
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Jh]=this[Jh]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=oo(o);r[a]||($_(i,o),r[a]=!0)}return B.isArray(t)?t.forEach(s):s(t),this}};Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});B.freezeMethods(Ht);function au(e,t){const n=this||Da,r=t||n,i=Ht.from(r.headers);let s=r.data;return B.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function kv(e){return!!(e&&e.__CANCEL__)}function Gs(e,t,n){Ae.call(this,e==null?"canceled":e,Ae.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(Gs,Ae,{__CANCEL__:!0});function Ov(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ae("Request failed with status code "+n.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function D_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function I_(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const h=u&&c-u;return h?Math.round(f*1e3/h):void 0}}function L_(e,t){let n=0,r=1e3/t,i,s;const o=(c,u=Date.now())=>{n=u,i=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?o(c,u):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Kl=(e,t,n=3)=>{let r=0;const i=I_(50,250);return L_(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,c=i(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Zh=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},eg=e=>(...t)=>B.asap(()=>e(...t)),R_=At.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,At.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,N_=At.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];B.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),B.isString(r)&&o.push("path="+r),B.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function F_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function B_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ev(e,t,n){let r=!F_(t);return e&&(r||n==!1)?B_(e,t):t}const tg=e=>e instanceof Ht?{...e}:e;function Pi(e,t){t=t||{};const n={};function r(c,u,d,f){return B.isPlainObject(c)&&B.isPlainObject(u)?B.merge.call({caseless:f},c,u):B.isPlainObject(u)?B.merge({},u):B.isArray(u)?u.slice():u}function i(c,u,d,f){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!B.isUndefined(u))return r(void 0,u)}function o(c,u){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>i(tg(c),tg(u),d,!0)};return B.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,f=d(e[u],t[u],u);B.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Av=e=>{const t=Pi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ht.from(o),t.url=Sv(Ev(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(B.isFormData(n)){if(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(At.hasStandardBrowserEnv&&(r&&B.isFunction(r)&&(r=r(t)),r||r!==!1&&R_(t.url))){const c=i&&s&&N_.read(s);c&&o.set(i,c)}return t},q_=typeof XMLHttpRequest!="undefined",z_=q_&&function(e){return new Promise(function(n,r){const i=Av(e);let s=i.data;const o=Ht.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,f,h,g;function m(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const w=Ht.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:w,config:e,request:p};Ov(function(C){n(C),m()},function(C){r(C),m()},x),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new Ae("Request aborted",Ae.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Ae("Network Error",Ae.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||Cv;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),r(new Ae(S,x.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&B.forEach(o.toJSON(),function(S,x){p.setRequestHeader(x,S)}),B.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),c&&([f,g]=Kl(c,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Kl(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=w=>{p&&(r(!w||w.type?new Gs(null,e,p):w),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const b=D_(i.url);if(b&&At.protocols.indexOf(b)===-1){r(new Ae("Unsupported protocol "+b+":",Ae.ERR_BAD_REQUEST,e));return}p.send(s||null)})},H_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Ae?u:new Gs(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new Ae(`timeout ${t} of ms exceeded`,Ae.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>B.asap(a),l}},U_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},K_=async function*(e,t){for await(const n of W_(e))yield*U_(n,t)},W_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ng=(e,t,n,r)=>{const i=K_(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Oc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Pv=Oc&&typeof ReadableStream=="function",V_=Oc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Tv=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},G_=Pv&&Tv(()=>{let e=!1;const t=new Request(At.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),rg=64*1024,pd=Pv&&Tv(()=>B.isReadableStream(new Response("").body)),Wl={stream:pd&&(e=>e.body)};Oc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Wl[t]&&(Wl[t]=B.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ae(`Response type '${t}' is not supported`,Ae.ERR_NOT_SUPPORT,r)})})})(new Response);const Q_=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new Request(At.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e=e+""),B.isString(e))return(await V_(e)).byteLength},Y_=async(e,t)=>{const n=B.toFiniteNumber(e.getContentLength());return n==null?Q_(t):n},X_=Oc&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Av(e);c=c?(c+"").toLowerCase():"text";let h=H_([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&G_&&n!=="get"&&n!=="head"&&(p=await Y_(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(B.isFormData(r)&&(O=x.headers.get("content-type"))&&u.setContentType(O),x.body){const[C,k]=Zh(p,Kl(eg(l)));r=ng(x.body,rg,C,k)}}B.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?d:void 0});let b=await fetch(g,f);const w=pd&&(c==="stream"||c==="response");if(pd&&(a||w&&m)){const x={};["status","statusText","headers"].forEach(_=>{x[_]=b[_]});const O=B.toFiniteNumber(b.headers.get("content-length")),[C,k]=a&&Zh(O,Kl(eg(a),!0))||[];b=new Response(ng(b.body,rg,C,()=>{k&&k(),m&&m()}),x)}c=c||"text";let S=await Wl[B.findKey(Wl,c)||"text"](b,e);return!w&&m&&m(),await new Promise((x,O)=>{Ov(x,O,{data:S,headers:Ht.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:g})})}catch(v){throw m&&m(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new Ae("Network Error",Ae.ERR_NETWORK,e,g),{cause:v.cause||v}):Ae.from(v,v&&v.code,e,g)}}),vd={http:f_,xhr:z_,fetch:X_};B.forEach(vd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const ig=e=>`- ${e}`,J_=e=>B.isFunction(e)||e===null||e===!1,jv={getAdapter:e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!J_(n)&&(r=vd[(o=String(n)).toLowerCase()],r===void 0))throw new Ae(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
15
|
+
`+s.map(ig).join(`
|
|
16
|
+
`):" "+ig(s[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:vd};function lu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gs(null,e)}function sg(e){return lu(e),e.headers=Ht.from(e.headers),e.data=au.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jv.getAdapter(e.adapter||Da.adapter)(e).then(function(r){return lu(e),r.data=au.call(e,e.transformResponse,r),r.headers=Ht.from(r.headers),r},function(r){return kv(r)||(lu(e),r&&r.response&&(r.response.data=au.call(e,e.transformResponse,r.response),r.response.headers=Ht.from(r.response.headers))),Promise.reject(r)})}const Mv="1.10.0",Ec={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ec[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const og={};Ec.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Mv+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new Ae(i(o," has been removed"+(n?" in "+n:"")),Ae.ERR_DEPRECATED);return n&&!og[o]&&(og[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};Ec.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Z_(e,t,n){if(typeof e!="object")throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new Ae("option "+s+" must be "+l,Ae.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}}const Pl={assertOptions:Z_,validators:Ec},Dn=Pl.validators;let _i=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Xh,response:new Xh}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
17
|
+
`+s):r.stack=s}catch(o){}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Pl.assertOptions(r,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),i!=null&&(B.isFunction(i)?n.paramsSerializer={serialize:i}:Pl.assertOptions(i,{encode:Dn.function,serialize:Dn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pl.assertOptions(n,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&B.merge(s.common,s[n.method]);s&&B.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ht.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!l){const g=[sg.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),f=g.length,u=Promise.resolve(n);d<f;)u=u.then(g[d++],g[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const g=a[d++],m=a[d++];try{h=g(h)}catch(p){m.call(this,p);break}}try{u=sg.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Pi(this.defaults,t);const n=Ev(t.baseURL,t.url,t.allowAbsoluteUrls);return Sv(n,t.params,t.paramsSerializer)}};B.forEach(["delete","get","head","options"],function(t){_i.prototype[t]=function(n,r){return this.request(Pi(r||{},{method:t,url:n,data:(r||{}).data}))}});B.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Pi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}_i.prototype[t]=n(),_i.prototype[t+"Form"]=n(!0)});let ek=class $v{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Gs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new $v(function(i){t=i}),cancel:t}}};function tk(e){return function(n){return e.apply(null,n)}}function nk(e){return B.isObject(e)&&e.isAxiosError===!0}const bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bd).forEach(([e,t])=>{bd[t]=e});function Dv(e){const t=new _i(e),n=uv(_i.prototype.request,t);return B.extend(n,_i.prototype,t,{allOwnKeys:!0}),B.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Dv(Pi(e,i))},n}const st=Dv(Da);st.Axios=_i;st.CanceledError=Gs;st.CancelToken=ek;st.isCancel=kv;st.VERSION=Mv;st.toFormData=kc;st.AxiosError=Ae;st.Cancel=st.CanceledError;st.all=function(t){return Promise.all(t)};st.spread=tk;st.isAxiosError=nk;st.mergeConfig=Pi;st.AxiosHeaders=Ht;st.formToJSON=e=>_v(B.isHTMLForm(e)?new FormData(e):e);st.getAdapter=jv.getAdapter;st.HttpStatusCode=bd;st.default=st;const{Axios:zN,AxiosError:HN,CanceledError:UN,isCancel:KN,CancelToken:WN,VERSION:VN,all:GN,Cancel:QN,isAxiosError:YN,spread:XN,toFormData:JN,AxiosHeaders:ZN,HttpStatusCode:eF,formToJSON:tF,getAdapter:nF,mergeConfig:rF}=st,rk={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Dt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Yt(b,"_invoke",function(w,S,x){var O,C,k,_=0,A=x||[],D=!1,I={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(T,$){return O=T,C=0,k=e,I.n=$,o}};function z(N,T){for(C=N,k=T,t=0;!D&&_&&!$&&t<A.length;t++){var $,L=A[t],Z=I.p,ue=L[2];N>3?($=ue===T)&&(k=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=Z&&(($=N<2&&Z<L[1])?(C=0,I.v=T,I.n=L[1]):Z<ue&&($=N<3||L[0]>T||T>ue)&&(L[4]=N,L[5]=T,I.n=ue,C=0))}if($||N>1)return o;throw D=!0,T}return function(N,T,$){if(_>1)throw TypeError("Generator is already running");for(D&&T===1&&z(T,$),C=T,k=$;(t=C<2?e:k)||!D;){O||(C?C<3?(C>1&&(I.n=-1),z(C,k)):I.n=k:I.v=k);try{if(_=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,k)))throw TypeError("iterator result is not an object");if(!t.done)return t;k=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(k=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(D=I.n<0)?k:w.call(S,I))!==o)break}catch(L){O=e,C=1,k=L}finally{_=1}}return{value:t,done:D}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Yt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Yt(d,"constructor",c),Yt(c,"constructor",l),l.displayName="GeneratorFunction",Yt(c,i,"GeneratorFunction"),Yt(d),Yt(d,i,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:s,m:f}})()}function Yt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Yt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Yt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Yt(e,t,n,r)}function ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ag(Object(n),!0).forEach(function(r){ik(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ag(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ik(e,t,n){return(t=sk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(e){var t=ok(e,"string");return Yo(t)=="symbol"?t:t+""}function ok(e,t){if(Yo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ti(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){lg(s,r,i,o,a,"next",l)}function a(l){lg(s,r,i,o,a,"throw",l)}o(void 0)})}}var Iv=function(){var t;return((t=rk)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function cg(e){var t;if(typeof document!="undefined"){var n="; ".concat(document.cookie),r=n.split("; ".concat(e,"="));if(r.length===2)return(t=r.pop())===null||t===void 0?void 0:t.split(";").shift()}}var ak="yst-insights-token",Qs=st.create({withCredentials:!0});Qs.interceptors.request.use(function(){var e=Ti(Dt().m(function t(n){var r,i;return Dt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,ck();case 1:return r=s.v,s.n=2,Rv();case 2:return i=s.v,n.headers=ki(ki(ki({},n.headers||{}),i?{"X-XSRF-TOKEN":i}:{}),r?{Authorization:"Bearer ".concat(r)}:{}),s.a(2,n)}},t)}));return function(t){return e.apply(this,arguments)}}(),function(e){return Promise.reject(e)},{synchronous:!1});Qs.interceptors.response.use(function(e){return e},function(){var e=Ti(Dt().m(function t(n){var r;return Dt().w(function(i){for(;;)switch(i.n){case 0:return n==null||(r=n.response)===null||r===void 0||r.status,i.a(2,Promise.reject(n))}},t)}));return function(t){return e.apply(this,arguments)}}());function bt(e){return xd.apply(this,arguments)}function xd(){return xd=Ti(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=ki({},t),delete n.baseURL,r.a(2,Qs.request(ki(ki({},n),{},{withCredentials:!0})))}},e)})),xd.apply(this,arguments)}function Lv(e){Qs.defaults.baseURL=e}function ug(){return Qs.defaults.baseURL}function lk(e){Iv=e}var ao=null;function ck(){return wd.apply(this,arguments)}function wd(){return wd=Ti(Dt().m(function e(){var t,n,r,i,s;return Dt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=Iv(),n=Qs.defaults.baseURL,r=uk(t,n),i=sessionStorage.getItem(r),!i){o.n=4;break}if(o.p=1,s=JSON.parse(i),!((s==null?void 0:s.validUntil)>Date.now()&&s.value)){o.n=2;break}return o.a(2,String(s.value));case 2:o.n=4;break;case 3:o.p=3,o.v;case 4:if(!ao){o.n=5;break}return o.a(2,ao);case 5:return ao=Ti(Dt().m(function a(){var l,c,u,d,f;return Dt().w(function(h){for(;;)switch(h.p=h.n){case 0:return h.p=0,h.n=1,Rv();case 1:return l=h.v,h.n=2,st.post(n+"/users/getToken",{},{headers:ki({Authorization:"Bearer "+t},l?{"X-XSRF-TOKEN":l}:{}),withCredentials:!0});case 2:if(c=h.v,u=c.data,!(u!=null&&u.plainTextToken)){h.n=3;break}return sessionStorage.setItem(r,JSON.stringify({value:u.plainTextToken,validUntil:Date.parse(((d=u.accessToken)===null||d===void 0?void 0:d.expires_at)||"")||Date.now()+15*60*1e3})),h.a(2,u.plainTextToken);case 3:h.n=5;break;case 4:h.p=4,f=h.v,st.isAxiosError(f)?f.response?console.error("Login failed with status",f.response.status,f.response.data):f.request?console.error("Login request made but no response received",f.request):console.error("Error setting up login request",f.message):console.error("Non-Axios error during login",f);case 5:return h.p=5,ao=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,ao)}},e,null,[[1,3]])})),wd.apply(this,arguments)}function uk(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return ak+":"+n}var lo=null;function Rv(){return Sd.apply(this,arguments)}function Sd(){return Sd=Ti(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(ug()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=cg("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!lo){n.n=3;break}return n.a(2,lo);case 3:return lo=Ti(Dt().m(function r(){var i;return Dt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,st.get(((i=ug())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(cg("XSRF-TOKEN")||""));case 2:return s.p=2,lo=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,lo)}},e)})),Sd.apply(this,arguments)}function Xo(e){"@babel/helpers - typeof";return Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(e)}function dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dg(Object(n),!0).forEach(function(r){dk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dk(e,t,n){return(t=fk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fk(e){var t=hk(e,"string");return Xo(t)=="symbol"?t:t+""}function hk(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Nv=function(t){return["/brands/".concat(t,"/analysis")]},yk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Nv(t),a=function(c){var u=c.signal;return gk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Fv(e,t,n){var r=yk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var mk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Bv=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},pk=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:Bv(t,n),l=function(u){var d=u.signal;return mk(t,n,d)};return we({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function Ac(e,t,n,r){var i=pk(e,t,n),s=mr(i,r);return s.queryKey=i.queryKey,s}var vk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},bk=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.analysisId;return vk(c,u)};return we({mutationFn:s},i)},xk=function(t,n){var r=bk(t);return pr(r,n)},wk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},Sk=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},Ck=function(t,n,r){var i,s=r!=null?r:{},o=s.query,a=(i=o==null?void 0:o.queryKey)!==null&&i!==void 0?i:Sk(t,n),l=function(u){var d=u.signal;return wk(t,n,d)};return we({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function _k(e,t,n,r){var i=Ck(e,t,n),s=mr(i,r);return s.queryKey=i.queryKey,s}var kk=function(t){return bt({url:"/users/logout",method:"POST",signal:t})},Ok=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return kk()};return we({mutationFn:s},i)},Ek=function(t,n){var r=Ok(t);return pr(r,n)},Ak=function(t,n){return bt({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},Vl=function(t){return["/brands/".concat(t,"/associated-brands")]},Pk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Vl(t),a=function(c){var u=c.signal;return Ak(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Tk(e,t,n){var r=Pk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var jk=function(t,n,r){return bt({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Mk=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return jk(c,u)};return we({mutationFn:s},i)},qv=function(t,n){var r=Mk(t);return pr(r,n)},$k=function(t){return bt({url:"/brandGroups/".concat(t),method:"DELETE"})},Dk=function(t){var n=["deleteBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandGroupId;return $k(c)};return we({mutationFn:s},i)},Ik=function(t,n){var r=Dk(t);return pr(r,n)},Lk=function(t){return bt({url:"/brands",method:"GET",signal:t})},sr=function(){return["/brands"]},Rk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:sr(),o=function(l){var c=l.signal;return Lk(c)};return we({queryKey:s,queryFn:o},i)};function Fi(e,t){var n=Rk(e),r=mr(n,t);return r.queryKey=n.queryKey,r}var Nk=function(t,n){return bt({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},Fk=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.data;return Nk(c)};return we({mutationFn:s},i)},Bk=function(t,n){var r=Fk(t);return pr(r,n)},qk=function(t,n){return bt({url:"/brands/".concat(t),method:"GET",signal:n})},pf=function(t){return["/brands/".concat(t)]},zk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:pf(t),a=function(c){var u=c.signal;return qk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function vf(e,t,n){var r=zk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var Hk=function(t){return bt({url:"/brands/".concat(t),method:"DELETE"})},Uk=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return Hk(c)};return we({mutationFn:s},i)},Kk=function(t,n){var r=Uk(t);return pr(r,n)},Wk=function(t,n){return bt({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},Vk=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return Wk(c,u)};return we({mutationFn:s},i)},zv=function(t,n){var r=Vk(t);return pr(r,n)},Gk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"GET",signal:n})},Qk=function(t){return["/brands/".concat(t,"/queries")]},Yk=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Qk(t),a=function(c){var u=c.signal;return Gk(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function Xk(e,t,n){var r=Yk(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var Jk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},Zk=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId,u=l.data;return Jk(c,u)};return we({mutationFn:s},i)},eO=function(t,n){var r=Zk(t);return pr(r,n)},tO=function(t,n){return bt({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},nO=function(t){return["/brands/".concat(t,"/query-suggestions")]},rO=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:nO(t),a=function(c){var u=c.signal;return tO(t,u)};return we({queryKey:o,queryFn:a,enabled:!!t},s)};function iO(e,t,n){var r=rO(e,t),i=mr(r,n);return i.queryKey=r.queryKey,i}var sO=function(t){return bt({url:"/users/current",method:"GET",signal:t})},bf=function(){return["/users/current"]},oO=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:bf(),o=function(l){var c=l.signal;return sO(c)};return we({queryKey:s,queryFn:o},i)};function Pc(e,t){var n=oO(e),r=mr(n,t);return r.queryKey=n.queryKey,r}var aO=function(){return bt({url:"/users/data",method:"DELETE"})},lO=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:we(we({},t),{},{mutation:we(we({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return aO()};return we({mutationFn:s},i)},cO=function(t,n){var r=lO(t);return pr(r,n)},Hv=q.createContext(void 0),uO=function(t){var n,r,i,s,o,a,l,c,u=t.children,d=t.brandId,f=t.analysisId,h=t.model,g=t.hostAppProps,m=g===void 0?{}:g,p=Qa("/brands/:brandId"),v=Qa("/brands/:brandId/*"),b=Qa("/brands/:brandId/analysis/:analysisId"),w=Qa("/brands/:brandId/analysis/:analysisId/*"),S=(b==null||(n=b.params)===null||n===void 0?void 0:n.brandId)||(w==null||(r=w.params)===null||r===void 0?void 0:r.brandId)||(v==null||(i=v.params)===null||i===void 0?void 0:i.brandId)||(p==null||(s=p.params)===null||s===void 0?void 0:s.brandId),x=b!=null&&(o=b.params)!==null&&o!==void 0&&o.analysisId||w!=null&&(a=w.params)!==null&&a!==void 0&&a.analysisId?Number((b==null||(l=b.params)===null||l===void 0?void 0:l.analysisId)||(w==null||(c=w.params)===null||c===void 0?void 0:c.analysisId)):void 0,O=q.useMemo(function(){return{brandId:S||d||"",analysisId:x||f||"latest",model:h||"openai",hostAppProps:m}},[S,d,x,f,h,m]),C=q.useMemo(function(){return{data:O}},[O]);return y.jsx(Hv.Provider,{value:C,children:u})},Uv=q.createContext(void 0),dO=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=q.useCallback(function(d){r(d),i("latest")},[r,i]),a=q.useCallback(function(d){i(d)},[i]),l=q.useCallback(function(d){s(d)},[s]),c=q.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),u=q.useMemo(function(){return{mutations:c}},[c]);return y.jsx(Uv.Provider,{value:u,children:n})};function cu(e,t){return yO(e)||gO(e,t)||hO(e,t)||fO()}function fO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hO(e,t){if(e){if(typeof e=="string")return fg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fg(e,t):void 0}}function fg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gO(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function yO(e){if(Array.isArray(e))return e}var mO=function(t){var n=t.children,r=t.hostAppProps,i=r===void 0?{}:r,s=q.useState(void 0),o=cu(s,2),a=o[0],l=o[1],c=q.useState("latest"),u=cu(c,2),d=u[0],f=u[1],h=q.useState(void 0),g=cu(h,2),m=g[0],p=g[1];return y.jsx(dO,{brandId:a,setBrandId:l,analysisId:d,setAnalysisId:f,model:m,setModel:p,children:y.jsx(uO,{brandId:a,analysisId:d,model:m,hostAppProps:i,children:n})})},Gn=function(){var t=q.useContext(Hv);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Ia=function(){var t=q.useContext(Uv);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},uu={exports:{}};/*!
|
|
19
19
|
Copyright (c) 2018 Jed Watson.
|
|
20
20
|
Licensed under the MIT License (MIT), see
|
|
21
21
|
http://jedwatson.github.io/classnames
|
|
22
|
-
*/var fg;function pO(){return fg||(fg=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(uu)),uu.exports}var vO=pO();const _e=Jp(vO);var bO=function(t){return Ek({mutation:{onSettled:function(){t&&t()}}})};function xO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))}const wO=$.forwardRef(xO);function SO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const CO=$.forwardRef(SO);function _O(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const kO=$.forwardRef(_O);function OO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const EO=$.forwardRef(OO);function AO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const PO=$.forwardRef(AO);function TO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))}const jO=$.forwardRef(TO);function MO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))}const $O=$.forwardRef(MO);function DO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))}const IO=$.forwardRef(DO);function LO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const RO=$.forwardRef(LO);function NO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}const Uv=$.forwardRef(NO);function FO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const Kv=$.forwardRef(FO);function BO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const qO=$.forwardRef(BO);function zO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))}const HO=$.forwardRef(zO);function UO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))}const KO=$.forwardRef(UO);function WO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))}const bf=$.forwardRef(WO);function VO(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const GO=$.forwardRef(VO);var QO=function(){return[{label:"Brand analysis",href:"/",Icon:qO,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:PO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},hg;function YO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gg=function(t){var n=t.className,r=Ut(),i=r.pathname,s=QO();return y.jsx("div",{className:_e("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(A.SidebarNavigation.Sidebar,{children:y.jsx(A.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(A.SidebarNavigation.SubmenuItem,{className:_e("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Yr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:_e(hg||(hg=YO(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const XO="data:image/svg+xml,%3csvg%20width='96'%20height='42'%20viewBox='0%200%2096%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M31.6517%2010.1419C24.3001%2010.1419%2021.3588%2015.0112%2021.3588%2020.4319C21.3588%2025.8525%2024.2564%2030.9356%2031.6517%2030.9356C39.0469%2030.9356%2041.9256%2025.8375%2041.9123%2020.7619C41.8952%2014.58%2038.7258%2010.14%2031.6517%2010.14V10.1419ZM27.1978%2020.7394C27.3764%2013.485%2033.0235%2013.4925%2034.9104%2016.0912C36.63%2018.4594%2036.9815%2026.5556%2031.6536%2026.4975C29.1986%2026.4712%2027.2719%2024.8344%2027.1997%2020.7394H27.1978ZM91.2791%2025.905V15.3956H95.0869V10.8337H91.2791V5.32312H85.3982V10.8337H82.415V15.3956H85.3982V25.3087C85.3982%2030.9431%2089.3789%2034.2919%2093.5801%2034.9856L95.3358%2030.3206C92.8866%2030.015%2091.3019%2028.2075%2091.2791%2025.9069V25.905ZM61.6088%2024.2419V16.3425C61.6088%2016.0537%2061.5898%2015.7837%2061.5613%2015.5194C61.0521%209.13687%2051.8669%209.15%2044.7529%2011.6006L46.8089%2015.6844C51.4413%2013.5131%2054.2136%2014.0737%2055.1826%2015.1425C55.2073%2015.1706%2055.232%2015.1969%2055.2548%2015.2269C55.2567%2015.2306%2055.2605%2015.2344%2055.2624%2015.2381C55.7565%2015.8962%2055.6387%2016.935%2055.6387%2017.7525C49.5849%2017.7525%2043.1416%2018.5456%2043.1416%2025.0969C43.1416%2030.0769%2049.4652%2033.2812%2056.0738%2028.5337L57.0542%2030.8681H62.7185C62.2131%2028.1269%2061.6069%2025.7794%2061.6069%2024.2419H61.6088ZM55.6843%2024.1987C51.0271%2029.3419%2046.7613%2024.5006%2051.1297%2022.3894C52.4161%2021.9562%2054.1604%2021.9375%2055.6843%2021.9375V24.1987ZM70.6477%2015.9169C70.6477%2013.9706%2073.8037%2013.0612%2078.7839%2015.3037L80.5054%2011.1769C73.8037%209.17812%2064.6509%208.99812%2064.592%2015.9169C64.5635%2019.2319%2066.7182%2021.015%2069.8211%2022.1531C71.9701%2022.9406%2075.073%2023.3494%2075.0635%2025.0387C75.0521%2027.2456%2070.241%2027.5831%2065.8632%2024.615L64.0942%2029.0906C70.0662%2032.0231%2081.1705%2032.1056%2081.1116%2024.7556C81.0527%2017.4881%2070.6457%2018.735%2070.6457%2015.9169H70.6477ZM18.8734%200.1875L10.3495%2023.5519L6.26617%2010.935H0.195312L6.99391%2028.1644C7.57346%2029.6312%207.57346%2031.2594%206.99391%2032.7262C6.23387%2034.6481%204.97029%2036.2944%201.88831%2036.7031V41.8106C7.88886%2041.8106%2011.1324%2038.1712%2014.0262%2030.1931L25.368%200.1875H18.8734Z'%20fill='%23A61E69'/%3e%3c/svg%3e";function JO(e,t){return nE(e)||tE(e,t)||eE(e,t)||ZO()}function ZO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eE(e,t){if(e){if(typeof e=="string")return
|
|
24
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aE(e,t){if(e){if(typeof e=="string")return pg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pg(e,t):void 0}}function pg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function cE(e){if(Array.isArray(e))return e}var uE=function(t){var n,r,i=t.className,s=Kt(),o=xn(),a=q.useState(!1),l=sE(a,2),c=l[0],u=l[1],d=Fi({query:{select:function(O){var C=O.data;return C==null?void 0:C.brands}}}),f=d.data,h=qv({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[sr()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(x){var O;return((O=x.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){u(!1)},b=function(){var x=iE(Cd().m(function O(){var C;return Cd().w(function(_){for(;;)switch(_.n){case 0:if(p.length!==0){_.n=1;break}return _.a(2);case 1:return C=p.map(function(k){return g({brandId:String(k.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),_.n=2,Promise.all(C);case 2:o("/settings"),v();case 3:return _.a(2)}},O)}));return function(){return x.apply(this,arguments)}}();q.useEffect(function(){f&&f.some(function(x){var O;return((O=x.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0})&&u(!0)},[f]);var w=p.length===1?"One brand has been deactivated":"Multiple brands have been deactivated",S=p.length===1?y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"You recently lost a subscription. Because of this, we could not analyze all your active brands."}),y.jsxs("p",{children:["The brand ",y.jsx("b",{children:p==null||(r=p[0])===null||r===void 0?void 0:r.name})," was deactivated, since it was the most recently analyzed."]}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate a different brand instead."]})]}):y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"You recently lost a subscription. Because of this, we could not analyze all your active brands."}),y.jsx("p",{children:"The following brands were deactivated, since they were the most recently analyzed:"}),y.jsx("ul",{children:p.map(function(x){return y.jsx("li",{children:y.jsx("b",{children:x.name})},x.id)})}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate different brand(s) instead."]})]});return c?y.jsx(A.Modal,{isOpen:c,onClose:b,position:"center",as:"div",className:i,children:y.jsxs(A.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:w})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:S})]})}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:b,children:"Close"}),y.jsx(A.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null},Tc=function(){return y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(A.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})})},dE={HOME:"/"},fE=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=Ut(),l=xn(),c={disable:s,hideNav:r},u=Gn(),d=u.brandId,f=Pc(),h=f.setBrandId,g=Fi({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(C){var _;return C==null||(_=C.data)===null||_===void 0?void 0:_.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=q.useRef(!1),S=q.useMemo(function(){return m==null?void 0:m.find(function(O){return O.id===d})},[m,d]);q.useEffect(function(){var O;if(!(m===void 0||d)){var C=(O=m[0])===null||O===void 0?void 0:O.id;C&&h(C)}},[m,d,h,l,a.pathname]),q.useEffect(function(){!d||w.current||(w.current=!0)},[S,d,l,a.pathname,m]);var x=q.useCallback(function(){b()},[b]);return a.pathname!==dE.HOME&&p?y.jsx(du,{...c,children:y.jsx(Tc,{})}):v?y.jsx(du,{...c,children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-space-y-4 yst-text-center",children:[y.jsx("div",{className:"yst-mb-4 yst-text-6xl yst-text-red-600",children:"⚠️"}),y.jsx("h2",{className:"yst-text-xl yst-font-semibold yst-text-slate-900",children:"Something went wrong"}),y.jsx("p",{className:"yst-text-slate-600",children:"We couldn't load your Brand Analysis. Please try again shortly."}),y.jsx(A.Button,{variant:"primary",onClick:x,children:"Retry"})]})})}):y.jsxs(du,{DebugInfo:o,...c,children:[y.jsx(Is,{}),y.jsx(uE,{})]})},hE=function(){var t=hc(),n=t.brandId,r=t.analysisId,i=Nv(n,{query:{enabled:!!n,select:function(d){var f=d.data;return(f==null?void 0:f.analyses)||[]}}}),s=i.data,o=i.isLoading,a=i.error;if(o)return y.jsx(Tc,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(ci,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(ci,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Is,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(ci,{to:"/brands/".concat(n),replace:!0});var c=s==null?void 0:s.some(function(u){return u.id===l});return c?y.jsx(Is,{}):y.jsx(ci,{to:"/brands/".concat(n),replace:!0})},vg=function(){var t=hc(),n=t.brandId,r=Fi({query:{select:function(f){var h=f.data;return h}}}),i=r.data,s=r.isLoading,o=r.error,a=r.isFetched,l=(i==null?void 0:i.brands)||[];if(s||!a)return y.jsx(Tc,{});if(o)return y.jsx(ci,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(ci,{to:"/",replace:!0});var c=parseInt(n,10),u=l.length>0&&l.some(function(d){var f=String(d.id),h=typeof d.id=="number"?d.id:parseInt(String(d.id),10);return f===n||h===c||d.id===n});return a&&!u?y.jsx(ci,{to:"/",replace:!0}):y.jsx(Is,{})},gE={openai:"openai",perplexity:"perplexity",anthropic:"anthropic"},yE={updating:"updating"},ii={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},mE=function(t){return typeof t=="string"&&t!=="latest"&&t.trim().length>0};function pE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}const Vv=$.forwardRef(pE);function vE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))}const bE=$.forwardRef(vE);function xE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}const Gv=$.forwardRef(xE);function wE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))}const Qv=$.forwardRef(wE);function SE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))}const CE=$.forwardRef(SE);function _E(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"}))}const kE=$.forwardRef(_E);function OE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"}))}const bg=$.forwardRef(OE);function EE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),$.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))}const AE=$.forwardRef(EE);function PE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))}const TE=$.forwardRef(PE);function jE(e,t){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),$.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))}const ME=$.forwardRef(jE);function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}var $E=["children","as","startColor","endColor","angle","disabled","style","className"];function xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xg(Object(n),!0).forEach(function(r){DE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DE(e,t,n){return(t=IE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IE(e){var t=LE(e,"string");return Jo(t)=="symbol"?t:t+""}function LE(e,t){if(Jo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RE(e,t){if(e==null)return{};var n,r,i=NE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function NE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jc=function(t){var n=t.children,r=t.as,i=r===void 0?"span":r,s=t.startColor,o=s===void 0?"#A61E69":s,a=t.endColor,l=a===void 0?"#6366F1":a,c=t.angle,u=c===void 0?102:c,d=t.disabled,f=d===void 0?!1:d,h=t.style,g=h===void 0?{}:h,m=t.className,p=m===void 0?"":m,v=RE(t,$E),b=wg(f?{display:"inline-block"}:{background:"linear-gradient(".concat(u,"deg, ").concat(o,", ").concat(l,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",display:"inline-block"},g);return y.jsx(i,{className:p,style:b,...v,children:n})};function xf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:_e("yst-mt-8 yst-flex yst-items-center yst-justify-end yst-gap-6 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",{"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem]":r},i),children:t})}var FE=function(){var t=xn();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(A.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(A.Paper.Header,{children:y.jsxs(A.Title,{size:"1",children:["Welcome to ",y.jsx(jc,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(A.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers."}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(A.Stepper.Step,{isActive:!0,isComplete:!1,children:y.jsx("span",{className:"yst-hidden",children:r+1})}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(A.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{className:"yst-my-0 yst-py-0",children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(xf,{className:"yst-justify-end",children:y.jsxs(A.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(bE,{})]})})]})})};function Zo(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ia(e){var t=e.score,n=e.total,r=e.suffix,i=e.isLoading,s=i===void 0?!1:i,o=e.className,a=e.hideTotal,l=a===void 0?!1:a,c=e.delta,u=e.deltaFormat,d=u===void 0?"absolute":u,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:_e(o,"yst-font-medium"),children:[y.jsxs("span",{className:"yst-mr-1 yst-text-xl yst-font-bold yst-text-slate-900",children:[s||t===void 0||t===null?"—":t,!s&&t!==void 0&&t!==null&&g==="percentage"?"%":""]}),!l&&n&&n!==0&&n!=="0"&&y.jsxs("span",{className:"yst-text-slate-500",children:["/ ",s?"—":n]}),r&&y.jsxs("span",{className:"yst-text-slate-500",children:[" ",r]}),typeof c=="number"&&!isNaN(c)&&y.jsxs("span",{className:_e("yst-ml-2",Zo(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var BE=["Icon","className","children","position","id"];function qE(e,t){return KE(e)||UE(e,t)||HE(e,t)||zE()}function zE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HE(e,t){if(e){if(typeof e=="string")return
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uA(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dA(e){if(Array.isArray(e))return _d(e)}function
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
28
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bA(e,t){if(e){if(typeof e=="string")return
|
|
22
|
+
*/var hg;function pO(){return hg||(hg=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(uu)),uu.exports}var vO=pO();const _e=Zp(vO);var bO=function(t){return Ek({mutation:{onSettled:function(){t&&t()}}})};function xO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))}const wO=M.forwardRef(xO);function SO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const CO=M.forwardRef(SO);function _O(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const kO=M.forwardRef(_O);function OO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const EO=M.forwardRef(OO);function AO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const PO=M.forwardRef(AO);function TO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))}const jO=M.forwardRef(TO);function MO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))}const $O=M.forwardRef(MO);function DO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))}const IO=M.forwardRef(DO);function LO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const RO=M.forwardRef(LO);function NO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}const Kv=M.forwardRef(NO);function FO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const Wv=M.forwardRef(FO);function BO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const qO=M.forwardRef(BO);function zO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))}const HO=M.forwardRef(zO);function UO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))}const KO=M.forwardRef(UO);function WO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))}const xf=M.forwardRef(WO);function VO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const GO=M.forwardRef(VO);var QO=function(){return[{label:"Brand analysis",href:"/",Icon:qO,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:PO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},gg;function YO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var yg=function(t){var n=t.className,r=Ut(),i=r.pathname,s=QO();return y.jsx("div",{className:_e("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(E.SidebarNavigation.Sidebar,{children:y.jsx(E.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(E.SidebarNavigation.SubmenuItem,{className:_e("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Yr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:_e(gg||(gg=YO(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const XO="data:image/svg+xml,%3csvg%20width='96'%20height='42'%20viewBox='0%200%2096%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M31.6517%2010.1419C24.3001%2010.1419%2021.3588%2015.0112%2021.3588%2020.4319C21.3588%2025.8525%2024.2564%2030.9356%2031.6517%2030.9356C39.0469%2030.9356%2041.9256%2025.8375%2041.9123%2020.7619C41.8952%2014.58%2038.7258%2010.14%2031.6517%2010.14V10.1419ZM27.1978%2020.7394C27.3764%2013.485%2033.0235%2013.4925%2034.9104%2016.0912C36.63%2018.4594%2036.9815%2026.5556%2031.6536%2026.4975C29.1986%2026.4712%2027.2719%2024.8344%2027.1997%2020.7394H27.1978ZM91.2791%2025.905V15.3956H95.0869V10.8337H91.2791V5.32312H85.3982V10.8337H82.415V15.3956H85.3982V25.3087C85.3982%2030.9431%2089.3789%2034.2919%2093.5801%2034.9856L95.3358%2030.3206C92.8866%2030.015%2091.3019%2028.2075%2091.2791%2025.9069V25.905ZM61.6088%2024.2419V16.3425C61.6088%2016.0537%2061.5898%2015.7837%2061.5613%2015.5194C61.0521%209.13687%2051.8669%209.15%2044.7529%2011.6006L46.8089%2015.6844C51.4413%2013.5131%2054.2136%2014.0737%2055.1826%2015.1425C55.2073%2015.1706%2055.232%2015.1969%2055.2548%2015.2269C55.2567%2015.2306%2055.2605%2015.2344%2055.2624%2015.2381C55.7565%2015.8962%2055.6387%2016.935%2055.6387%2017.7525C49.5849%2017.7525%2043.1416%2018.5456%2043.1416%2025.0969C43.1416%2030.0769%2049.4652%2033.2812%2056.0738%2028.5337L57.0542%2030.8681H62.7185C62.2131%2028.1269%2061.6069%2025.7794%2061.6069%2024.2419H61.6088ZM55.6843%2024.1987C51.0271%2029.3419%2046.7613%2024.5006%2051.1297%2022.3894C52.4161%2021.9562%2054.1604%2021.9375%2055.6843%2021.9375V24.1987ZM70.6477%2015.9169C70.6477%2013.9706%2073.8037%2013.0612%2078.7839%2015.3037L80.5054%2011.1769C73.8037%209.17812%2064.6509%208.99812%2064.592%2015.9169C64.5635%2019.2319%2066.7182%2021.015%2069.8211%2022.1531C71.9701%2022.9406%2075.073%2023.3494%2075.0635%2025.0387C75.0521%2027.2456%2070.241%2027.5831%2065.8632%2024.615L64.0942%2029.0906C70.0662%2032.0231%2081.1705%2032.1056%2081.1116%2024.7556C81.0527%2017.4881%2070.6457%2018.735%2070.6457%2015.9169H70.6477ZM18.8734%200.1875L10.3495%2023.5519L6.26617%2010.935H0.195312L6.99391%2028.1644C7.57346%2029.6312%207.57346%2031.2594%206.99391%2032.7262C6.23387%2034.6481%204.97029%2036.2944%201.88831%2036.7031V41.8106C7.88886%2041.8106%2011.1324%2038.1712%2014.0262%2030.1931L25.368%200.1875H18.8734Z'%20fill='%23A61E69'/%3e%3c/svg%3e";function JO(e,t){return nE(e)||tE(e,t)||eE(e,t)||ZO()}function ZO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eE(e,t){if(e){if(typeof e=="string")return mg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mg(e,t):void 0}}function mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function nE(e){if(Array.isArray(e))return e}var rE=function(t){var n=t.className,r=Ut(),i=r.pathname,s=Gn(),o=s.hostAppProps,a=o.onLogout,l=q.useState(!1),c=JO(l,2),u=c[0],d=c[1],f=Pc({query:{select:function(S){var x=S.data;return x==null?void 0:x.data}}}),h=f.data,g=f.isLoading,m=bO(a),p=m.mutate,v=m.isPending,b=function(S){if(S.preventDefault(),d(!0),!v)return p()};return y.jsxs("div",{className:_e("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(E.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(yg,{})})})}),y.jsxs("div",{className:_e("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-items-center yst-justify-between yst-px-4","lg:yst-flex-col lg:yst-items-start lg:yst-space-y-12"),children:[y.jsx(E.Title,{children:y.jsx(Yr,{className:_e("yst-outline-none"),to:"/",children:y.jsx("img",{src:XO,alt:"Yoast",className:"yst-inline-block yst-h-8"})})}),y.jsxs("div",{className:_e("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(h==null?void 0:h.displayName)||y.jsx(E.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(E.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(E.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(E.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):u||v?y.jsx(y.Fragment,{children:"Signing out..."}):y.jsxs(y.Fragment,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]})})})]})]}),y.jsx("div",{className:_e("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(yg,{className:n})})})]})},Vv=Vx.a.withConfig({displayName:"SkipLink",componentId:"sc-40h6pc-0"})(["position:absolute;top:-1000em;left:10px;z-index:100000;display:block;height:48px;min-width:150px;padding:0 15px;font-size:14px;line-height:48px;background:var(--bg-color-white);border-radius:3px;box-shadow:0px 2px 2px 2px rgba(0,0,0,0.1);text-decoration:underline;text-align:center;outline:none;&:focus{top:10px;color:var(--text-color-blue);}"]);Vv.defaultProps={href:"#content"};function du(e){var t=e.children,n=e.disable,r=n===void 0?!1:n,i=e.hideNav,s=i===void 0?!1:i,o=e.DebugInfo;return r?t:y.jsxs("div",{className:_e("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(Vv,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:_e("ystaii-sidebar","yst-overflow-hidden","lg:yst-flex-grow-1 lg:yst-max-w-[300px] lg:yst-flex-shrink-0 lg:yst-basis-[300px] lg:yst-overflow-visible lg:yst-pl-4"),children:[y.jsx(rE,{}),o&&y.jsx(o,{})]}),y.jsx("main",{className:_e("ystaii-main","yst-mx-4 yst-my-0 yst-flex yst-min-w-0 yst-shrink yst-grow yst-basis-auto yst-px-0 yst-py-6","lg:yst-ml-12 lg:yst-mr-6"),children:y.jsx("div",{className:_e("ystaii-main-content","yst-mx-auto yst-flex yst-flex-col yst-gap-8","lg:yst-w-full lg:yst-flex-row"),children:y.jsx("div",{className:"yst-layout-root yst-mx-auto yst-w-full yst-max-w-[1200px] yst-flex-1",children:t})})})]})}function Cd(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(w,S,x){var O,C,k,_=0,A=x||[],D=!1,I={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(T,$){return O=T,C=0,k=e,I.n=$,o}};function z(N,T){for(C=N,k=T,t=0;!D&&_&&!$&&t<A.length;t++){var $,L=A[t],Z=I.p,ue=L[2];N>3?($=ue===T)&&(k=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=Z&&(($=N<2&&Z<L[1])?(C=0,I.v=T,I.n=L[1]):Z<ue&&($=N<3||L[0]>T||T>ue)&&(L[4]=N,L[5]=T,I.n=ue,C=0))}if($||N>1)return o;throw D=!0,T}return function(N,T,$){if(_>1)throw TypeError("Generator is already running");for(D&&T===1&&z(T,$),C=T,k=$;(t=C<2?e:k)||!D;){O||(C?C<3?(C>1&&(I.n=-1),z(C,k)):I.n=k:I.v=k);try{if(_=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,k)))throw TypeError("iterator result is not an object");if(!t.done)return t;k=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(k=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(D=I.n<0)?k:w.call(S,I))!==o)break}catch(L){O=e,C=1,k=L}finally{_=1}}return{value:t,done:D}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Xt(d,"constructor",c),Xt(c,"constructor",l),l.displayName="GeneratorFunction",Xt(c,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Cd=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Xt(e,t,n,r)}function pg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function iE(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){pg(s,r,i,o,a,"next",l)}function a(l){pg(s,r,i,o,a,"throw",l)}o(void 0)})}}function sE(e,t){return cE(e)||lE(e,t)||aE(e,t)||oE()}function oE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aE(e,t){if(e){if(typeof e=="string")return vg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vg(e,t):void 0}}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function cE(e){if(Array.isArray(e))return e}var uE=function(t){var n,r,i=t.className,s=Kt(),o=ln(),a=q.useState(!1),l=sE(a,2),c=l[0],u=l[1],d=Fi({query:{select:function(O){var C=O.data;return C==null?void 0:C.brands}}}),f=d.data,h=zv({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[sr()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(x){var O;return((O=x.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){u(!1)},b=function(){var x=iE(Cd().m(function O(){var C;return Cd().w(function(k){for(;;)switch(k.n){case 0:if(p.length!==0){k.n=1;break}return k.a(2);case 1:return C=p.map(function(_){return g({brandId:String(_.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),k.n=2,Promise.all(C);case 2:o("/settings"),v();case 3:return k.a(2)}},O)}));return function(){return x.apply(this,arguments)}}();q.useEffect(function(){f&&f.some(function(x){var O;return((O=x.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0})&&u(!0)},[f]);var w=p.length===1?"One brand has been deactivated":"Multiple brands have been deactivated",S=p.length===1?y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"You recently lost a subscription. Because of this, we could not analyze all your active brands."}),y.jsxs("p",{children:["The brand ",y.jsx("b",{children:p==null||(r=p[0])===null||r===void 0?void 0:r.name})," was deactivated, since it was the most recently analyzed."]}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate a different brand instead."]})]}):y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"You recently lost a subscription. Because of this, we could not analyze all your active brands."}),y.jsx("p",{children:"The following brands were deactivated, since they were the most recently analyzed:"}),y.jsx("ul",{children:p.map(function(x){return y.jsx("li",{children:y.jsx("b",{children:x.name})},x.id)})}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate different brand(s) instead."]})]});return c?y.jsx(E.Modal,{isOpen:c,onClose:b,position:"center",as:"div",className:i,children:y.jsxs(E.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:w})}),y.jsx(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:S})]})}),y.jsxs(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:b,children:"Close"}),y.jsx(E.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null},Tc=function(){return y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(E.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})})},dE={HOME:"/"},fE=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=Ut(),l=ln(),c={disable:s,hideNav:r},u=Gn(),d=u.brandId,f=Ia(),h=f.setBrandId,g=Fi({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(C){var k;return C==null||(k=C.data)===null||k===void 0?void 0:k.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=q.useRef(!1),S=q.useMemo(function(){return m==null?void 0:m.find(function(O){return O.id===d})},[m,d]);q.useEffect(function(){var O;if(!(m===void 0||d)){var C=(O=m[0])===null||O===void 0?void 0:O.id;C&&h(C)}},[m,d,h,l,a.pathname]),q.useEffect(function(){!d||w.current||(w.current=!0)},[S,d,l,a.pathname,m]);var x=q.useCallback(function(){b()},[b]);return a.pathname!==dE.HOME&&p?y.jsx(du,{...c,children:y.jsx(Tc,{})}):v?y.jsx(du,{...c,children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-space-y-4 yst-text-center",children:[y.jsx("div",{className:"yst-mb-4 yst-text-6xl yst-text-red-600",children:"⚠️"}),y.jsx("h2",{className:"yst-text-xl yst-font-semibold yst-text-slate-900",children:"Something went wrong"}),y.jsx("p",{className:"yst-text-slate-600",children:"We couldn't load your Brand Analysis. Please try again shortly."}),y.jsx(E.Button,{variant:"primary",onClick:x,children:"Retry"})]})})}):y.jsxs(du,{DebugInfo:o,...c,children:[y.jsx(Is,{}),y.jsx(uE,{})]})},hE=function(){var t=gc(),n=t.brandId,r=t.analysisId,i=Fv(n,{query:{enabled:!!n,select:function(d){var f=d.data;return(f==null?void 0:f.analyses)||[]}}}),s=i.data,o=i.isLoading,a=i.error;if(o)return y.jsx(Tc,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(ci,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(ci,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Is,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(ci,{to:"/brands/".concat(n),replace:!0});var c=s==null?void 0:s.some(function(u){return u.id===l});return c?y.jsx(Is,{}):y.jsx(ci,{to:"/brands/".concat(n),replace:!0})},bg=function(){var t=gc(),n=t.brandId,r=Fi({query:{select:function(f){var h=f.data;return h}}}),i=r.data,s=r.isLoading,o=r.error,a=r.isFetched,l=(i==null?void 0:i.brands)||[];if(s||!a)return y.jsx(Tc,{});if(o)return y.jsx(ci,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(ci,{to:"/",replace:!0});var c=parseInt(n,10),u=l.length>0&&l.some(function(d){var f=String(d.id),h=typeof d.id=="number"?d.id:parseInt(String(d.id),10);return f===n||h===c||d.id===n});return a&&!u?y.jsx(ci,{to:"/",replace:!0}):y.jsx(Is,{})},gE={openai:"openai",perplexity:"perplexity",anthropic:"anthropic"},yE={updating:"updating"},ii={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},mE=function(t){return typeof t=="string"&&t!=="latest"&&t.trim().length>0};function pE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}const Gv=M.forwardRef(pE);function vE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))}const bE=M.forwardRef(vE);function xE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}const Qv=M.forwardRef(xE);function wE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))}const Yv=M.forwardRef(wE);function SE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))}const CE=M.forwardRef(SE);function _E(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"}))}const kE=M.forwardRef(_E);function OE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"}))}const xg=M.forwardRef(OE);function EE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),M.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))}const AE=M.forwardRef(EE);function PE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))}const TE=M.forwardRef(PE);function jE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))}const ME=M.forwardRef(jE);function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}var $E=["children","as","startColor","endColor","angle","disabled","style","className"];function wg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(n),!0).forEach(function(r){DE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DE(e,t,n){return(t=IE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IE(e){var t=LE(e,"string");return Jo(t)=="symbol"?t:t+""}function LE(e,t){if(Jo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RE(e,t){if(e==null)return{};var n,r,i=NE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function NE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jc=function(t){var n=t.children,r=t.as,i=r===void 0?"span":r,s=t.startColor,o=s===void 0?"#A61E69":s,a=t.endColor,l=a===void 0?"#6366F1":a,c=t.angle,u=c===void 0?102:c,d=t.disabled,f=d===void 0?!1:d,h=t.style,g=h===void 0?{}:h,m=t.className,p=m===void 0?"":m,v=RE(t,$E),b=Sg(f?{display:"inline-block"}:{background:"linear-gradient(".concat(u,"deg, ").concat(o,", ").concat(l,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",display:"inline-block"},g);return y.jsx(i,{className:p,style:b,...v,children:n})};function wf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:_e("yst-mt-8 yst-flex yst-items-center yst-justify-end yst-gap-6 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",{"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem]":r},i),children:t})}var FE=function(){var t=ln();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(E.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(E.Paper.Header,{children:y.jsxs(E.Title,{size:"1",children:["Welcome to ",y.jsx(jc,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(E.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers."}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(E.Stepper.Step,{isActive:!0,isComplete:!1,children:y.jsx("span",{className:"yst-hidden",children:r+1})}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(E.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{className:"yst-my-0 yst-py-0",children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(wf,{className:"yst-justify-end",children:y.jsxs(E.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(bE,{})]})})]})})};function Zo(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function La(e){var t=e.score,n=e.total,r=e.suffix,i=e.isLoading,s=i===void 0?!1:i,o=e.className,a=e.hideTotal,l=a===void 0?!1:a,c=e.delta,u=e.deltaFormat,d=u===void 0?"absolute":u,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:_e(o,"yst-font-medium"),children:[y.jsxs("span",{className:"yst-mr-1 yst-text-xl yst-font-bold yst-text-slate-900",children:[s||t===void 0||t===null?"—":t,!s&&t!==void 0&&t!==null&&g==="percentage"?"%":""]}),!l&&n&&n!==0&&n!=="0"&&y.jsxs("span",{className:"yst-text-slate-500",children:["/ ",s?"—":n]}),r&&y.jsxs("span",{className:"yst-text-slate-500",children:[" ",r]}),typeof c=="number"&&!isNaN(c)&&y.jsxs("span",{className:_e("yst-ml-2",Zo(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var BE=["Icon","className","children","position","id"];function qE(e,t){return KE(e)||UE(e,t)||HE(e,t)||zE()}function zE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
25
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HE(e,t){if(e){if(typeof e=="string")return Cg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cg(e,t):void 0}}function Cg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UE(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function KE(e){if(Array.isArray(e))return e}function WE(e,t){if(e==null)return{};var n,r,i=VE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Sf(e){var t=e.Icon,n=t===void 0?RO:t,r=e.className,i=r===void 0?"":r,s=e.children,o=e.position,a=o===void 0?"left":o,l=e.id,c=l===void 0?"":l,u=WE(e,BE),d=q.useState(!1),f=qE(d,2),h=f[0],g=f[1];return s?y.jsxs("div",{className:i||"yst-relative",onMouseEnter:function(){return g(!0)},onMouseLeave:function(){return g(!1)},"aria-describedby":c?"tooltip-button-id":"tooltip-button",...u,children:[y.jsx(n,{className:"yst-relative yst-h-6 yst-w-6 yst-text-slate-400"}),h&&y.jsx(E.Tooltip,{position:a,id:c||"tooltip-button",children:s})]}):null}var Ra=function(t){var n=t.title,r=t.tooltip,i=t.size,s=i===void 0?"3":i,o=t.className,a=o===void 0?"":o,l=function(d){var f=typeof d=="string"?d:"tooltip";return"tooltip-".concat(f.toLowerCase().replace(/\s+/g,"-"))},c=l(n);return y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between ".concat(a),children:[y.jsx(E.Title,{size:s,children:n}),y.jsx(Sf,{id:c,children:r})]})},_g=function(t){var n=t.keywords,r=t.badgeClassName;return y.jsx("div",{className:"yst-flex yst-flex-wrap yst-gap-2",children:n.map(function(i,s){return i&&y.jsx(E.Badge,{className:r,children:i},s)})})},Xv=function(t){var n,r,i,s,o=t.title,a=o===void 0?"Sentiment":o,l=t.tooltip,c=l===void 0?"":l,u=t.data,d=u==null?void 0:u.brandName,f=u==null||(n=u.positivityPercentage)===null||n===void 0?void 0:n.value,h=u==null||(r=u.positivityPercentage)===null||r===void 0||(r=r.previous)===null||r===void 0?void 0:r.difference,g=u==null||(i=u.keywords)===null||i===void 0?void 0:i.positive,m=u==null||(s=u.keywords)===null||s===void 0?void 0:s.negative,p=!u||f===void 0&&h===void 0;return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-8",children:[y.jsx(Ra,{title:a,tooltip:c}),y.jsx("div",{className:"yst-space-y-3",children:!p&&y.jsxs(y.Fragment,{children:[y.jsx("p",{children:d||y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(La,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(E.ProgressBar,{max:100,min:0,progress:f||0,className:_e({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(E.Alert,{variant:"info",children:"The selected AI model returned no brand sentiment data for your queries. This can happen with some queries or models."}),!!g&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(E.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(_g,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(E.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(_g,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}var GE=["data"];function kg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function QE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kg(Object(n),!0).forEach(function(r){YE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YE(e,t,n){return(t=XE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XE(e){var t=JE(e,"string");return ea(t)=="symbol"?t:t+""}function JE(e,t){if(ea(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ea(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZE(e,t){if(e==null)return{};var n,r,i=eA(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bi=function(t,n,r){var i=Gn(),s=i.brandId,o=i.analysisId,a=i.model,l=s,c=o,u=a,d=Ac(l,c,{query:{enabled:!!l&&!!c,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=ZE(d,GE),g=q.useMemo(function(){if(!f||!u)return null;var m=f.scans||[];return m.find(function(p){return String(p.aiProvider)===String(u)})||null},[f,u]);return QE({data:g},h)};function tA(){var e,t=Bi(),n=t.data;return y.jsx(Xv,{title:"Brand Sentiment",data:n==null||(e=n.sentiment)===null||e===void 0?void 0:e.own,tooltip:"Percentage of positive versus negative keywords in your query results related to your brand."})}var nA=["children","as","className"];function rA(e,t){if(e==null)return{};var n,r,i=iA(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function iA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Na=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=t.reduce(function(o,a,l){return o+a+(r[l]||"")},"");return function(o){var a=o.children,l=o.as,c=l===void 0?"div":l,u=o.className,d=u===void 0?"":u,f=rA(o,nA);return y.jsx(c,{className:_e(String(s).trim(),d),...f,children:a})}},fu=[{bg:"yst-bg-blue-200",text:"yst-text-blue-900"},{bg:"yst-bg-green-200",text:"yst-text-green-900"},{bg:"yst-bg-purple-200",text:"yst-text-purple-900"},{bg:"yst-bg-pink-200",text:"yst-text-pink-900"},{bg:"yst-bg-yellow-200",text:"yst-text-yellow-900"},{bg:"yst-bg-indigo-200",text:"yst-text-indigo-900"},{bg:"yst-bg-red-200",text:"yst-text-red-900"},{bg:"yst-bg-orange-200",text:"yst-text-orange-900"},{bg:"yst-bg-teal-200",text:"yst-text-teal-900"},{bg:"yst-bg-cyan-200",text:"yst-text-cyan-900"},{bg:"yst-bg-lime-200",text:"yst-text-lime-900"},{bg:"yst-bg-emerald-200",text:"yst-text-emerald-900"},{bg:"yst-bg-sky-200",text:"yst-text-sky-900"},{bg:"yst-bg-violet-200",text:"yst-text-violet-900"},{bg:"yst-bg-fuchsia-200",text:"yst-text-fuchsia-900"},{bg:"yst-bg-rose-200",text:"yst-text-rose-900"},{bg:"yst-bg-amber-200",text:"yst-text-amber-900"}],Og=function(t){if(!t)return fu[0];if(t.toLowerCase()==="other")return{bg:"yst-bg-slate-200",text:"yst-text-slate-900"};for(var n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);n=(n<<5)-n+i,n=n&n}var s=Math.abs(n)%fu.length;return fu[s]};function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}var Eg;function Ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ag(Object(n),!0).forEach(function(r){sA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ag(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sA(e,t,n){return(t=oA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oA(e){var t=aA(e,"string");return ta(t)=="symbol"?t:t+""}function aA(e,t){if(ta(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ta(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lA(e){return dA(e)||uA(e)||Jv(e)||cA()}function cA(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uA(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dA(e){if(Array.isArray(e))return _d(e)}function Tg(e,t){return gA(e)||hA(e,t)||Jv(e,t)||fA()}function fA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jv(e,t){if(e){if(typeof e=="string")return _d(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_d(e,t):void 0}}function _d(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function gA(e){if(Array.isArray(e))return e}function yA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var co=Na(Eg||(Eg=yA(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),jg=function(t){var n=t.data,r=t.totalQueries,i=t.isLoading,s=i===void 0?!1:i,o=t.isFirstScan,a=o===void 0?!1:o,l=s||!n,c=n||{},u=c.rank,d=c.url,f=c.rootDomain,h=c.category,g=c.impact,m=c.numberOfMentions,p=m==null?void 0:m.value,v=m==null?void 0:m.previous,b=typeof(v==null?void 0:v.difference)=="number"?v.difference:p;return y.jsxs("tr",{className:"yst-flex yst-flex-col md:yst-table-row",children:[y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(co,{as:"span",children:"Rank:"}),l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:u!=null?u:"—"})]}),y.jsx(E.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(E.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:d||"#",rel:"nofollow noreferrer",target:"_blank",children:[y.jsx("span",{children:d!=null?d:"—"})," ",y.jsx(AE,{})]})})}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(co,{as:"span",children:"Domain:"}),l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:f!=null?f:"—"})]}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(co,{as:"span",children:"Category:"}),l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(E.Badge,{className:_e(Og(h||"").bg,Og(h||"").text),children:h!=null?h:"—"})]}),y.jsxs(E.Table.Cell,{className:_e("yst-ml-2 yst-py-0 md:yst-ml-0 md:yst-p-2","yst-font-medium",{"yst-text-green-600":g==="High","yst-text-yellow-600":g==="Medium","yst-text-red-600":g==="Low"}),children:[y.jsx(co,{as:"span",children:"Impact:"}),l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):g!=null?g:"—"]}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(co,{as:"span",children:"Mentions:"}),l?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):p?y.jsxs("span",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsxs("span",{className:"yst-flex yst-flex-nowrap yst-gap-1 yst-font-medium",children:[y.jsx("span",{className:"yst-text-slate-500",children:p}),y.jsxs("span",{className:"yst-text-slate-900",children:["/ ",r]})]}),!a&&y.jsxs("span",{className:_e("yst-ml-auto",Zo(b)),children:[b>-1&&"+",b]})]}):"—"]})]},l?void 0:d)},mA=function(){var t,n,r,i,s,o=q.useState("all"),a=Tg(o,2),l=a[0],c=a[1],u=q.useState(1),d=Tg(u,2),f=d[0],h=d[1],g=Bi(),m=g.data,p=g.isLoading,v=g.isRefetching,b=m==null?void 0:m.citations,w=(m==null||(t=m.scores)===null||t===void 0||(t=t.standardized)===null||t===void 0?void 0:t.citations)||{},S=Object.hasOwn(w,"previous"),x=b==null||(n=b.list)===null||n===void 0?void 0:n.filter(function(I){return l==="all"?!0:I.category===l}),O=10,C=(x==null?void 0:x.length)||0,k=Math.ceil(C/O),_=(f-1)*O,A=_+O,D=x==null?void 0:x.slice(_,A);return q.useEffect(function(){f>k&&k>0&&h(1)},[k,f,h,l]),y.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Ra,{title:"Citations",tooltip:"Sources the AI used to support brand mentions in the results."}),y.jsx("p",{children:"This table highlights the most important sources where your brand was cited."}),y.jsx(La,{score:b==null||(r=b.total)===null||r===void 0?void 0:r.value,suffix:"citations",delta:b==null||(i=b.total)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,deltaSuffix:"since last scan",isLoading:p,hideTotal:!0})]}),(b==null||(s=b.list)===null||s===void 0?void 0:s.length)===0&&!p&&!v?y.jsx(E.Alert,{children:"The selected AI model returned no citations for your queries. This can happen with some queries or models."}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{children:[y.jsx(E.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:l,onChange:function(I){c(I)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(lA(b!=null&&b.categories?b.categories.map(function(I){return{value:I,label:I}}):[]))}),y.jsxs(E.Table,{variant:"minimal",children:[y.jsx(E.Table.Head,{className:"yst-font-semibold",children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(E.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(E.Table.Body,{children:p||v?Array.from({length:5}).map(function(I,z){return y.jsx(jg,{isLoading:!0},"skeleton-".concat(z))}):D&&D.length>0?D.map(function(I,z){return y.jsx(jg,{data:Pg(Pg({},I),{},{rank:_+z+1}),totalQueries:m==null?void 0:m.numberOfQueries,isFirstScan:!S},"citation-table-row-".concat(I.url,"-").concat(z))}):y.jsx(E.Table.Row,{children:y.jsxs(E.Table.Cell,{colSpan:6,className:"yst-py-8 yst-text-center yst-text-slate-500",children:[l==="all"?"No citations found.":'No citations found for the "'.concat(l,'" category.')," ",y.jsx(E.Link,{onClick:function(){return c("all")},children:"Show all categories."})]})},"no-results")})]})]}),x&&x.length>O&&y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:[y.jsxs("p",{className:"yst-mb-0",children:["Showing ",_+1," to"," ",A>C?C:A," of"," ",C," results"]}),y.jsx(E.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:f,total:k,onNavigate:h,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function pA(e,t){return wA(e)||xA(e,t)||bA(e,t)||vA()}function vA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bA(e,t){if(e){if(typeof e=="string")return Mg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mg(e,t):void 0}}function Mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xA(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function wA(e){if(Array.isArray(e))return e}var $g=function(t){var n,r=t.data,i=t.totalQueries,s=t.isFirstScan,o=s===void 0?!0:s,a=t.isLoading,l=a===void 0?!1:a,c=l||!r,u=r||{},d=u.rank,f=u.brand,h=d==null?void 0:d.previous,g=typeof(h==null?void 0:h.difference)=="number"?h.difference*-1:void 0,m=f==null?void 0:f.numberOfMentions,p=m==null?void 0:m.previous,v=typeof(p==null?void 0:p.difference)=="number"?p.difference:void 0;return y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:c?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsxs("span",{className:"yst-flex yst-justify-between yst-gap-4",children:[y.jsxs("span",{className:"yst-flex yst-flex-nowrap yst-gap-2 yst-font-medium",children:[y.jsx("span",{className:"yst-text-slate-500",children:"#"}),y.jsx("span",{className:"yst-text-slate-900",children:d==null?void 0:d.value})]}),!o&&y.jsx("span",{className:_e("yst-inline-flex yst-items-center yst-justify-end",Zo(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(kE,{className:"yst-h-4 yst-w-4"}):y.jsx(CE,{className:"yst-h-4 yst-w-4"})]}):y.jsx(xg,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(E.Table.Cell,{children:c?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(jc,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(E.Table.Cell,{children:c?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsxs("span",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsxs("span",{className:"yst-flex yst-flex-nowrap yst-gap-1 yst-font-medium",children:[y.jsx("span",{className:"yst-text-slate-500",children:m==null?void 0:m.value}),y.jsxs("span",{className:"yst-text-slate-900",children:["/ ",i]})]}),!o&&y.jsx("span",{className:_e("yst-ml-auto",Zo(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx(xg,{className:"yst-h-4 yst-w-4"})})]})})]},c||d==null?void 0:d.value)},SA=function(t){var n,r,i=t.className,s=q.useRef(null),o=q.useState(1),a=pA(o,2),l=a[0],c=a[1],u=Bi(),d=u.data,f=u.isLoading,h=u.isRefetching,g=d==null||(n=d.rankings)===null||n===void 0?void 0:n.list,m=(d==null||(r=d.scores)===null||r===void 0||(r=r.standardized)===null||r===void 0?void 0:r.ranking)||{},p=Object.hasOwn(m,"previous"),v=5,b=(g==null?void 0:g.length)||0,w=Math.ceil(b/v),S=(l-1)*v,x=S+v,O=g==null?void 0:g.slice(S,x);return q.useEffect(function(){l>w&&w>0&&c(1)},[w,l,c]),y.jsx(E.Card,{ref:s,className:_e("yst-overflow-visible",i),children:y.jsxs(E.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ra,{title:"Competitor ranking",tooltip:"How often competitors are mentioned in your submitted queries."}),y.jsx("p",{children:"Brands with the most mentions for your prompts."})]}),!f&&!h&&(!g||g.length===0)?y.jsx(E.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(E.Table,{variant:"minimal",children:[y.jsx(E.Table.Head,{children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(E.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(E.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(E.Table.Body,{children:O&&Array.isArray(O)&&O.length>0?O.map(function(C){var k;return y.jsx($g,{data:C,totalQueries:d==null?void 0:d.numberOfQueries,isFirstScan:!p},"rank-row-".concat((k=C.rank)===null||k===void 0?void 0:k.value))}):f||h?Array.from({length:v}).map(function(C,k){return y.jsx($g,{isLoading:!0},"skeleton-".concat(k))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(E.Pagination,{current:l,total:w,className:"yst-flex-row",onNavigate:c,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},CA=function(){var t,n=Bi(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(Xv,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},_A=function(t){var n=t.brand,r=ln(),i=Ia(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(E.Alert,{className:"yst-mt-0",children:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsxs("h3",{className:"yst-font-medium",children:["Finish your analysis for ",(n==null?void 0:n.name)||"Brand ".concat(n==null?void 0:n.id)]}),y.jsx("p",{children:"Your brand is saved, but you haven’t completed the analysis yet. Review your queries and run the analysis to get your brand insights!"})]}),y.jsx("div",{className:"yst-flex yst-justify-start yst-gap-6",children:y.jsx(E.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},Mc=function(t){var n=t.isOpen,r=t.onClose,i=t.onConfirm,s=t.isLoading,o=s===void 0?!1:s,a=t.title,l=t.description,c=t.disabled,u=c===void 0?!1:c,d=t.confirmText,f=d===void 0?"Yes, delete":d,h=t.cancelText,g=h===void 0?"No, go back":h,m=t.className;return y.jsx(E.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(E.Modal.Panel,{children:[y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:y.jsx(IO,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(E.Button,{variant:"error",onClick:i,isLoading:o,disabled:u,children:f})]})]})})},tl={exports:{}},nl={exports:{}},He={};/** @license React v16.13.1
|
|
29
29
|
* react-is.production.min.js
|
|
30
30
|
*
|
|
31
31
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/var
|
|
35
|
+
*/var Dg;function kA(){if(Dg)return He;Dg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(x){if(typeof x=="object"&&x!==null){var O=x.$$typeof;switch(O){case t:switch(x=x.type,x){case l:case c:case r:case s:case i:case d:return x;default:switch(x=x&&x.$$typeof,x){case a:case u:case g:case h:case o:return x;default:return O}}case n:return O}}}function S(x){return w(x)===c}return He.AsyncMode=l,He.ConcurrentMode=c,He.ContextConsumer=a,He.ContextProvider=o,He.Element=t,He.ForwardRef=u,He.Fragment=r,He.Lazy=g,He.Memo=h,He.Portal=n,He.Profiler=s,He.StrictMode=i,He.Suspense=d,He.isAsyncMode=function(x){return S(x)||w(x)===l},He.isConcurrentMode=S,He.isContextConsumer=function(x){return w(x)===a},He.isContextProvider=function(x){return w(x)===o},He.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},He.isForwardRef=function(x){return w(x)===u},He.isFragment=function(x){return w(x)===r},He.isLazy=function(x){return w(x)===g},He.isMemo=function(x){return w(x)===h},He.isPortal=function(x){return w(x)===n},He.isProfiler=function(x){return w(x)===s},He.isStrictMode=function(x){return w(x)===i},He.isSuspense=function(x){return w(x)===d},He.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===s||x===i||x===d||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===h||x.$$typeof===o||x.$$typeof===a||x.$$typeof===u||x.$$typeof===p||x.$$typeof===v||x.$$typeof===b||x.$$typeof===m)},He.typeOf=w,He}var Ue={};/** @license React v16.13.1
|
|
36
36
|
* react-is.development.js
|
|
37
37
|
*
|
|
38
38
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var
|
|
42
|
+
*/var Ig;function OA(){return Ig||(Ig=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,p=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(H){return typeof H=="string"||typeof H=="function"||H===r||H===c||H===s||H===i||H===d||H===f||typeof H=="object"&&H!==null&&(H.$$typeof===g||H.$$typeof===h||H.$$typeof===o||H.$$typeof===a||H.$$typeof===u||H.$$typeof===p||H.$$typeof===v||H.$$typeof===b||H.$$typeof===m)}function S(H){if(typeof H=="object"&&H!==null){var Pe=H.$$typeof;switch(Pe){case t:var et=H.type;switch(et){case l:case c:case r:case s:case i:case d:return et;default:var nt=et&&et.$$typeof;switch(nt){case a:case u:case g:case h:case o:return nt;default:return Pe}}case n:return Pe}}}var x=l,O=c,C=a,k=o,_=t,A=u,D=r,I=g,z=h,N=n,T=s,$=i,L=d,Z=!1;function ue(H){return Z||(Z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(H)||S(H)===l}function F(H){return S(H)===c}function V(H){return S(H)===a}function re(H){return S(H)===o}function se(H){return typeof H=="object"&&H!==null&&H.$$typeof===t}function R(H){return S(H)===u}function ae(H){return S(H)===r}function ne(H){return S(H)===g}function xe(H){return S(H)===h}function ee(H){return S(H)===n}function ie(H){return S(H)===s}function Q(H){return S(H)===i}function Ce(H){return S(H)===d}Ue.AsyncMode=x,Ue.ConcurrentMode=O,Ue.ContextConsumer=C,Ue.ContextProvider=k,Ue.Element=_,Ue.ForwardRef=A,Ue.Fragment=D,Ue.Lazy=I,Ue.Memo=z,Ue.Portal=N,Ue.Profiler=T,Ue.StrictMode=$,Ue.Suspense=L,Ue.isAsyncMode=ue,Ue.isConcurrentMode=F,Ue.isContextConsumer=V,Ue.isContextProvider=re,Ue.isElement=se,Ue.isForwardRef=R,Ue.isFragment=ae,Ue.isLazy=ne,Ue.isMemo=xe,Ue.isPortal=ee,Ue.isProfiler=ie,Ue.isStrictMode=Q,Ue.isSuspense=Ce,Ue.isValidElementType=w,Ue.typeOf=S}()),Ue}var Lg;function Zv(){return Lg||(Lg=1,process.env.NODE_ENV==="production"?nl.exports=kA():nl.exports=OA()),nl.exports}/*
|
|
43
43
|
object-assign
|
|
44
44
|
(c) Sindre Sorhus
|
|
45
45
|
@license MIT
|
|
46
|
-
*/var hu,
|
|
47
|
-
Valid keys: `+JSON.stringify(Object.keys(F),null," "));var H=Ce(xe,Q,R,oe,ne+"."+Q,n);if(H)return H}return null}return p(V)}function N(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(N);if(F===null||a(F))return!0;var V=d(F);if(V){var ie=V.call(F),ue;if(V!==F.entries){for(;!(ue=ie.next()).done;)if(!N(ue.value))return!1}else for(;!(ue=ie.next()).done;){var R=ue.value;if(R&&!N(R[1]))return!1}}else return!1;return!0;default:return!1}}function M(F,V){return F==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function I(F){var V=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":M(V,F)?"symbol":V}function L(F){if(typeof F=="undefined"||F===null)return""+F;var V=I(F);if(V==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return V}function J(F){var V=L(F);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function ce(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},pu}var vu,qg;function TA(){if(qg)return vu;qg=1;var e=Sf();function t(){}function n(){}return n.resetWarningCache=t,vu=function(){function r(o,a,l,c,u,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},vu}var zg;function jA(){if(zg)return el.exports;if(zg=1,process.env.NODE_ENV!=="production"){var e=Jv(),t=!0;el.exports=PA()(e.isElement,t)}else el.exports=TA()();return el.exports}var MA=jA();const kd=Jp(MA);var Na=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:_e("yst-my-6",r)})};Na.propTypes={className:kd.string};const eb=6048e5,$A=864e5,Hg=Symbol.for("constructDateFrom");function an(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Hg in e?e[Hg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Wt(e,t){return an(t||e,e)}function tb(e,t,n){const r=Wt(e,n==null?void 0:n.in);if(isNaN(t))return an(e,NaN);if(!t)return r;const i=r.getDate(),s=an(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let DA={};function $c(){return DA}function na(e,t){var a,l,c,u,d,f,h,g;const n=$c(),r=(g=(h=(u=(c=t==null?void 0:t.weekStartsOn)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?u:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Wt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Vl(e,t){return na(e,{...t,weekStartsOn:1})}function nb(e,t){const n=Wt(e,t==null?void 0:t.in),r=n.getFullYear(),i=an(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Vl(i),o=an(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Vl(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ug(e){const t=Wt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Dc(e,...t){const n=an.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Gl(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function IA(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t),s=Gl(r),o=Gl(i),a=+s-Ug(s),l=+o-Ug(o);return Math.round((a-l)/$A)}function LA(e,t){const n=nb(e,t),r=an(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Vl(r)}function RA(e){return an(e,Date.now())}function NA(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t);return+Gl(r)==+Gl(i)}function FA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BA(e){return!(!FA(e)&&typeof e!="number"||isNaN(+Wt(e)))}function qA(e,t){const n=Wt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function zA(e,t){const[n,r]=Dc(e,t.start,t.end);return{start:n,end:r}}function HA(e,t){const{start:n,end:r}=zA(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(an(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function UA(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function KA(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const WA={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"}},VA=(e,t,n)=>{let r;const i=WA[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function bu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XA={date:bu({formats:GA,defaultWidth:"full"}),time:bu({formats:QA,defaultWidth:"full"}),dateTime:bu({formats:YA,defaultWidth:"full"})},JA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ZA=(e,t,n,r)=>JA[e];function uo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const e3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},t3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},n3={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"]},r3={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"]},i3={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"}},s3={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"}},o3=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},a3={ordinalNumber:o3,era:uo({values:e3,defaultWidth:"wide"}),quarter:uo({values:t3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:uo({values:n3,defaultWidth:"wide"}),day:uo({values:r3,defaultWidth:"wide"}),dayPeriod:uo({values:i3,defaultWidth:"wide",formattingValues:s3,defaultFormattingWidth:"wide"})};function fo(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?c3(a,d=>d.test(o)):l3(a,d=>d.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function l3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function c3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function u3(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const d3=/^(\d+)(th|st|nd|rd)?/i,f3=/\d+/i,h3={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},g3={any:[/^b/i,/^(a|c)/i]},y3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m3={any:[/1/i,/2/i,/3/i,/4/i]},p3={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},v3={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]},b3={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},x3={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]},w3={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},S3={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}},C3={ordinalNumber:u3({matchPattern:d3,parsePattern:f3,valueCallback:e=>parseInt(e,10)}),era:fo({matchPatterns:h3,defaultMatchWidth:"wide",parsePatterns:g3,defaultParseWidth:"any"}),quarter:fo({matchPatterns:y3,defaultMatchWidth:"wide",parsePatterns:m3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fo({matchPatterns:p3,defaultMatchWidth:"wide",parsePatterns:v3,defaultParseWidth:"any"}),day:fo({matchPatterns:b3,defaultMatchWidth:"wide",parsePatterns:x3,defaultParseWidth:"any"}),dayPeriod:fo({matchPatterns:w3,defaultMatchWidth:"any",parsePatterns:S3,defaultParseWidth:"any"})},_3={code:"en-US",formatDistance:VA,formatLong:XA,formatRelative:ZA,localize:a3,match:C3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k3(e,t){const n=Wt(e,t==null?void 0:t.in);return IA(n,KA(n))+1}function O3(e,t){const n=Wt(e,t==null?void 0:t.in),r=+Vl(n)-+LA(n);return Math.round(r/eb)+1}function rb(e,t){var u,d,f,h,g,m,p,v;const n=Wt(e,t==null?void 0:t.in),r=n.getFullYear(),i=$c(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)!=null?v:1,o=an((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=na(o,t),l=an((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=na(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function E3(e,t){var a,l,c,u,d,f,h,g;const n=$c(),r=(g=(h=(u=(c=t==null?void 0:t.firstWeekContainsDate)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?u:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=rb(e,t),s=an((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),na(s,t)}function A3(e,t){const n=Wt(e,t==null?void 0:t.in),r=+na(n,t)-+E3(n,t);return Math.round(r/eb)+1}function Qe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Sr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Qe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qe(n+1,2)},d(e,t){return Qe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Qe(e.getHours()%12||12,t.length)},H(e,t){return Qe(e.getHours(),t.length)},m(e,t){return Qe(e.getMinutes(),t.length)},s(e,t){return Qe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Qe(i,t.length)}},Vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kg={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Sr.y(e,t)},Y:function(e,t,n,r){const i=rb(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Qe(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qe(s,t.length)},R:function(e,t){const n=nb(e);return Qe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Qe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Qe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Sr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Qe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=A3(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Qe(i,t.length)},I:function(e,t,n){const r=O3(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Qe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Sr.d(e,t)},D:function(e,t,n){const r=k3(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Qe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qe(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Qe(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Vi.noon:r===0?i=Vi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Vi.evening:r>=12?i=Vi.afternoon:r>=4?i=Vi.morning:i=Vi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Sr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Sr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Sr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Sr.s(e,t)},S:function(e,t){return Sr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Vg(r);case"XXXX":case"XX":return si(r);case"XXXXX":case"XXX":default:return si(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Vg(r);case"xxxx":case"xx":return si(r);case"xxxxx":case"xxx":default:return si(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Wg(r,":");case"OOOO":default:return"GMT"+si(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Wg(r,":");case"zzzz":default:return"GMT"+si(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Qe(r,t.length)},T:function(e,t,n){return Qe(+e,t.length)}};function Wg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Qe(s,2)}function Vg(e,t){return e%60===0?(e>0?"-":"+")+Qe(Math.abs(e)/60,2):si(e,t)}function si(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return n+i+t+s}const Gg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ib=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},P3=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Gg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Gg(r,t)).replace("{{time}}",ib(i,t))},T3={p:ib,P:P3},j3=/^D+$/,M3=/^Y+$/,$3=["D","DD","YY","YYYY"];function D3(e){return j3.test(e)}function I3(e){return M3.test(e)}function L3(e,t,n){const r=R3(e,t,n);if(console.warn(r),$3.includes(e))throw new RangeError(r)}function R3(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const N3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,F3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B3=/^'([^]*?)'?$/,q3=/''/g,z3=/[a-zA-Z]/;function Oo(e,t,n){var u,d,f,h,g,m,p,v,b;const r=$c(),i=(u=r.locale)!=null?u:_3,s=(g=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,o=(b=(v=r.weekStartsOn)!=null?v:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?b:0,a=Wt(e,n==null?void 0:n.in);if(!BA(a))throw new RangeError("Invalid time value");let l=t.match(F3).map(w=>{const S=w[0];if(S==="p"||S==="P"){const x=T3[S];return x(w,i.formatLong)}return w}).join("").match(N3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const S=w[0];if(S==="'")return{isToken:!1,value:H3(w)};if(Kg[S])return{isToken:!0,value:w};if(S.match(z3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(w=>{if(!w.isToken)return w.value;const S=w.value;(I3(S)||D3(S))&&L3(S,t,String(e));const x=Kg[S[0]];return x(a,S,i.localize,c)}).join("")}function H3(e){const t=e.match(B3);return t?t[1].replace(q3,"'"):e}function Qg(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function U3(e,t){return NA(an(e,e),RA(e))}function K3(e,t,n){return tb(e,-1,n)}function ra(e){"@babel/helpers - typeof";return ra=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(e)}function xu(e,t,n){return(t=W3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W3(e){var t=V3(e,"string");return ra(t)=="symbol"?t:t+""}function V3(e,t){if(ra(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ra(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yg(e,t){return X3(e)||Y3(e,t)||Q3(e,t)||G3()}function G3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q3(e,t){if(e){if(typeof e=="string")return
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eP(e,t){if(e){if(typeof e=="string")return
|
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aP(e,t){if(e){if(typeof e=="string")return ty(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ty(e,t):void 0}}function ty(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lP(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function cP(e){if(Array.isArray(e))return e}function Od(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Jt(b,"_invoke",function(w,S,x){var O,C,_,k=0,E=x||[],j=!1,D={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(M,I){return O=M,C=0,_=e,D.n=I,o}};function z(N,M){for(C=N,_=M,t=0;!j&&k&&!I&&t<E.length;t++){var I,L=E[t],J=D.p,ce=L[2];N>3?(I=ce===M)&&(_=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=J&&((I=N<2&&J<L[1])?(C=0,D.v=M,D.n=L[1]):J<ce&&(I=N<3||L[0]>M||M>ce)&&(L[4]=N,L[5]=M,D.n=ce,C=0))}if(I||N>1)return o;throw j=!0,M}return function(N,M,I){if(k>1)throw TypeError("Generator is already running");for(j&&M===1&&z(M,I),C=M,_=I;(t=C<2?e:_)||!j;){O||(C?C<3?(C>1&&(D.n=-1),z(C,_)):D.n=_:D.v=_);try{if(k=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(j=D.n<0)?_:w.call(S,D))!==o)break}catch(L){O=e,C=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Jt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Jt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Jt(d,"constructor",c),Jt(c,"constructor",l),l.displayName="GeneratorFunction",Jt(c,i,"GeneratorFunction"),Jt(d),Jt(d,i,"Generator"),Jt(d,r,function(){return this}),Jt(d,"toString",function(){return"[object Generator]"}),(Od=function(){return{w:s,m:f}})()}function Jt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Jt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Jt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Jt(e,t,n,r)}function ny(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function uP(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ny(s,r,i,o,a,"next",l)}function a(l){ny(s,r,i,o,a,"throw",l)}o(void 0)})}}function dP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Su=Ra(Zg||(Zg=dP(["yst-flex-1 yst-space-y-2"]))),fP=function(t){var n,r,i,s=t.className,o=Gn(),a=o.brandId,l=o.analysisId,c=o.model,u=Pc(),d=u.setModel,f=u.setAnalysisId,h=Kt(),g=xn(),m=Bi(),p=m.data,v=Ac({query:{select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.data}}}),b=v.data,w=v.isLoading,S=b==null?void 0:b.displayName,x=Fi({query:{select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.brands}}}),O=x.data,C=x.isLoading,_=Nv(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.analyses}}}),k=_.data,E=_.isLoading,j=Ec(a,l,{query:{enabled:!!a&&!!l,select:function(ze){var Ge=ze.data;return Ge}}}),D=j.data,z=j.isLoading,N=Xk(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge}}}),M=N.data,I=N.isLoading,L=xk({mutation:{onSuccess:function(){var ke=uP(Od().m(function Ge(){var Vt,_n;return Od().w(function(Gt){for(;;)switch(Gt.n){case 0:return Gt.n=1,Promise.all([h.invalidateQueries({queryKey:Rv(a)}),h.invalidateQueries({queryKey:Fv(a,l)}),h.invalidateQueries({queryKey:mf(a)})]);case 1:Vt=(k==null?void 0:k.filter(function(Lt){return String(Lt.id)!==String(l)}))||[],Vt.length>0?(_n=Vt.reduce(function(Lt,wr){var Zr=Lt.createdAt?new Date(Lt.createdAt).getTime():0,Hi=wr.createdAt?new Date(wr.createdAt).getTime():0;return Hi>Zr?wr:Lt}),f(_n.id),g("/brands/".concat(a,"/analysis/").concat(_n.id))):(f("latest"),g("/brands/".concat(a))),ue(!1);case 2:return Gt.a(2)}},Ge)}));function ze(){return ke.apply(this,arguments)}return ze}()}}),J=L.mutate,ce=L.isPending;q.useEffect(function(){!I&&!z&&a&&O&&(O==null?void 0:O.length)<2&&(!M||Array.isArray(M)&&M.length===0)&&(k==null?void 0:k.length)===0&&g("/setup/".concat(a,"/queries"))},[I,z,M,a,g,O,k==null?void 0:k.length]);var F=q.useState(!1),V=ey(F,2),ie=V[0],ue=V[1],R=function(){ue(!1)},oe=O==null?void 0:O.find(function(ke){return String(ke.id)===String(a)}),ne=D==null||(n=D.analysis)===null||n===void 0?void 0:n.id,xe=a!=null&&typeof ne=="number"&&!isNaN(ne),ee=q.useState(!1),re=ey(ee,2),Q=re[0],Ce=re[1];q.useEffect(function(){if(xe){var ke="yst_legal_alert_dismissed_".concat(a,"_").concat(ne);Ce(window.localStorage.getItem(ke)===null)}},[a,ne,xe]);var H=function(ze){if(ze.preventDefault(),!!xe){var Ge="yst_legal_alert_dismissed_".concat(a,"_").concat(ne);window.localStorage.setItem(Ge,"true"),Ce(!1)}},Pe=function(ze){switch(ze){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return ze||"Unknown"}},et=(D==null||(r=D.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(ke){return{value:ke.aiProvider,label:Pe(ke.aiProvider)}}))||[{value:"",label:"Default model"}],nt=k!=null&&k.some(function(ke){return String(ke.id)===String(l)})?l:k&&k.length>0?k[0].id:"latest",Ve=pf(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge}}}),Le=Ve.data,Y=(Le==null?void 0:Le.name)||"your brand",je=ab(Le==null?void 0:Le.nextScheduledAnalysis),at=D==null||(i=D.analysis)===null||i===void 0?void 0:i.status,Re=function(){switch(at){case ii.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:Y}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:je}),". You'll see the results here once it's ready. We'll also notify you by email."]})]}),alertVariant:"info"};case ii.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Y,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case ii.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ii.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ii.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),$e=Re.alertContent,he=Re.alertVariant,ye=!E&&(k==null?void 0:k.length)===0,fe=p==null?void 0:p.isUpToDateWithBrandGroups,Ne=(p==null?void 0:p.status)===yE.updating&&fe===!1;return y.jsxs(y.Fragment,{children:[y.jsx(Mc,{isOpen:ie,onClose:R,onConfirm:function(){a&&l&&J({brandId:a,analysisId:l})},isLoading:ce,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsx(A.Card,{className:_e("yst-relative yst-overflow-visible",s),children:y.jsxs(A.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(A.Title,{children:y.jsxs(y.Fragment,{children:[w||!S?y.jsx(A.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",S,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return g("/setup")},disabled:E||C,children:[y.jsx(Kv,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(A.DropdownMenu,{children:[y.jsx(A.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:E||C||O&&(O==null?void 0:O.length)<1,children:y.jsx($O,{})}),y.jsx(A.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(A.DropdownMenu.ButtonItem,{onClick:function(){return ue(!0)},disabled:E||C||!k||k.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(bf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Na,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(Su,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.Select,{onChange:function(ke){g("/brands/".concat(ke.toString()))},id:"brand-name",value:a?Number(a):"loading",options:O&&O.length>0?O.map(function(ke){return{value:ke.id,label:ke.name}}):[{value:"loading",label:"Loading..."}],disabled:C||!O||O.length<2||!a})]}),y.jsxs(Su,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(rP,{analyses:k||[],selectedAnalysisId:nt,onAnalysisSelect:function(ke){g("/brands/".concat(a,"/analysis/").concat(String(ke)))},isLoading:E,disabled:E||!k||k.length<1,id:"analysis-date"})]}),y.jsxs(Su,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(ke){Object.values(gE).includes(ke)?d(ke):console.error("Invalid AI provider selected:",ke)},id:"ai-tool",value:c,options:z||E?[{value:c,label:"Loading..."}]:et,disabled:z||E||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[xe&&Q&&y.jsx(A.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:H,variant:"default",children:y.jsx(ME,{})})})]})}),at!==ii.completed&&$e&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:he,children:$e}),typeof fe=="boolean"&&!fe&&y.jsxs(A.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",Ne?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ye&&y.jsx(A.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:oe==null?void 0:oe.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return g("/settings")},role:"button",tabIndex:0,onKeyPress:function(ke){(ke.key==="Enter"||ke.key===" ")&&g("/settings")},children:"Settings"}),"."]})]})})}),oe&&y.jsx(_A,{brand:oe},oe.id)]})},hP=function(){var t,n,r,i=Bi(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(La,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ia,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?y.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(c,u){var d=u===0,f=l.queriesWithMentions&&u===l.queriesWithMentions.length-1;return y.jsxs("li",{className:_e("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:c!=null&&c.mentioned?y.jsx(CO,{className:"yst-text-green-500"}):y.jsx(GO,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:c.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:c!=null&&c.mentioned?y.jsx(A.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(A.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},c.query)})}):y.jsx(A.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
46
|
+
*/var hu,Rg;function EA(){if(Rg)return hu;Rg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}return hu=i()?Object.assign:function(s,o){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},hu}var gu,Ng;function Cf(){if(Ng)return gu;Ng=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gu=e,gu}var yu,Fg;function eb(){return Fg||(Fg=1,yu=Function.call.bind(Object.prototype.hasOwnProperty)),yu}var mu,Bg;function AA(){if(Bg)return mu;Bg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Cf(),n={},r=eb();e=function(s){var o="Warning: "+s;typeof console!="undefined"&&console.error(o);try{throw new Error(o)}catch(a){}}}function i(s,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](o,u,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},mu=i,mu}var pu,qg;function PA(){if(qg)return pu;qg=1;var e=Zv(),t=EA(),n=Cf(),r=eb(),i=AA(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(c){}});function o(){return null}return pu=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(F){var V=F&&(c&&F[c]||F[u]);if(typeof V=="function")return V}var f="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:b(),arrayOf:w,element:S(),elementType:x(),instanceOf:O,node:A(),objectOf:k,oneOf:C,oneOfType:_,shape:I,exact:z};function g(F,V){return F===V?F!==0||1/F===1/V:F!==F&&V!==V}function m(F,V){this.message=F,this.data=V&&typeof V=="object"?V:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var V={},re=0;function se(ae,ne,xe,ee,ie,Q,Ce){if(ee=ee||f,Q=Q||xe,Ce!==n){if(l){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}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var Pe=ee+":"+xe;!V[Pe]&&re<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Pe]=!0,re++)}}return ne[xe]==null?ae?ne[xe]===null?new m("The "+ie+" `"+Q+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new m("The "+ie+" `"+Q+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:F(ne,xe,ee,ie,Q)}var R=se.bind(null,!1);return R.isRequired=se.bind(null,!0),R}function v(F){function V(re,se,R,ae,ne,xe){var ee=re[se],ie=$(ee);if(ie!==F){var Q=L(ee);return new m("Invalid "+ae+" `"+ne+"` of type "+("`"+Q+"` supplied to `"+R+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(V)}function b(){return p(o)}function w(F){function V(re,se,R,ae,ne){if(typeof F!="function")return new m("Property `"+ne+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var xe=re[se];if(!Array.isArray(xe)){var ee=$(xe);return new m("Invalid "+ae+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+R+"`, expected an array."))}for(var ie=0;ie<xe.length;ie++){var Q=F(xe,ie,R,ae,ne+"["+ie+"]",n);if(Q instanceof Error)return Q}return null}return p(V)}function S(){function F(V,re,se,R,ae){var ne=V[re];if(!a(ne)){var xe=$(ne);return new m("Invalid "+R+" `"+ae+"` of type "+("`"+xe+"` supplied to `"+se+"`, expected a single ReactElement."))}return null}return p(F)}function x(){function F(V,re,se,R,ae){var ne=V[re];if(!e.isValidElementType(ne)){var xe=$(ne);return new m("Invalid "+R+" `"+ae+"` of type "+("`"+xe+"` supplied to `"+se+"`, expected a single ReactElement type."))}return null}return p(F)}function O(F){function V(re,se,R,ae,ne){if(!(re[se]instanceof F)){var xe=F.name||f,ee=ue(re[se]);return new m("Invalid "+ae+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+R+"`, expected ")+("instance of `"+xe+"`."))}return null}return p(V)}function C(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function V(re,se,R,ae,ne){for(var xe=re[se],ee=0;ee<F.length;ee++)if(g(xe,F[ee]))return null;var ie=JSON.stringify(F,function(Ce,H){var Pe=L(H);return Pe==="symbol"?String(H):H});return new m("Invalid "+ae+" `"+ne+"` of value `"+String(xe)+"` "+("supplied to `"+R+"`, expected one of "+ie+"."))}return p(V)}function k(F){function V(re,se,R,ae,ne){if(typeof F!="function")return new m("Property `"+ne+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var xe=re[se],ee=$(xe);if(ee!=="object")return new m("Invalid "+ae+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+R+"`, expected an object."));for(var ie in xe)if(r(xe,ie)){var Q=F(xe,ie,R,ae,ne+"."+ie,n);if(Q instanceof Error)return Q}return null}return p(V)}function _(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var V=0;V<F.length;V++){var re=F[V];if(typeof re!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(re)+" at index "+V+"."),o}function se(R,ae,ne,xe,ee){for(var ie=[],Q=0;Q<F.length;Q++){var Ce=F[Q],H=Ce(R,ae,ne,xe,ee,n);if(H==null)return null;H.data&&r(H.data,"expectedType")&&ie.push(H.data.expectedType)}var Pe=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new m("Invalid "+xe+" `"+ee+"` supplied to "+("`"+ne+"`"+Pe+"."))}return p(se)}function A(){function F(V,re,se,R,ae){return N(V[re])?null:new m("Invalid "+R+" `"+ae+"` supplied to "+("`"+se+"`, expected a ReactNode."))}return p(F)}function D(F,V,re,se,R){return new m((F||"React class")+": "+V+" type `"+re+"."+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function I(F){function V(re,se,R,ae,ne){var xe=re[se],ee=$(xe);if(ee!=="object")return new m("Invalid "+ae+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+R+"`, expected `object`."));for(var ie in F){var Q=F[ie];if(typeof Q!="function")return D(R,ae,ne,ie,L(Q));var Ce=Q(xe,ie,R,ae,ne+"."+ie,n);if(Ce)return Ce}return null}return p(V)}function z(F){function V(re,se,R,ae,ne){var xe=re[se],ee=$(xe);if(ee!=="object")return new m("Invalid "+ae+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+R+"`, expected `object`."));var ie=t({},re[se],F);for(var Q in ie){var Ce=F[Q];if(r(F,Q)&&typeof Ce!="function")return D(R,ae,ne,Q,L(Ce));if(!Ce)return new m("Invalid "+ae+" `"+ne+"` key `"+Q+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(re[se],null," ")+`
|
|
47
|
+
Valid keys: `+JSON.stringify(Object.keys(F),null," "));var H=Ce(xe,Q,R,ae,ne+"."+Q,n);if(H)return H}return null}return p(V)}function N(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(N);if(F===null||a(F))return!0;var V=d(F);if(V){var re=V.call(F),se;if(V!==F.entries){for(;!(se=re.next()).done;)if(!N(se.value))return!1}else for(;!(se=re.next()).done;){var R=se.value;if(R&&!N(R[1]))return!1}}else return!1;return!0;default:return!1}}function T(F,V){return F==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function $(F){var V=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":T(V,F)?"symbol":V}function L(F){if(typeof F=="undefined"||F===null)return""+F;var V=$(F);if(V==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return V}function Z(F){var V=L(F);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function ue(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},pu}var vu,zg;function TA(){if(zg)return vu;zg=1;var e=Cf();function t(){}function n(){}return n.resetWarningCache=t,vu=function(){function r(o,a,l,c,u,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},vu}var Hg;function jA(){if(Hg)return tl.exports;if(Hg=1,process.env.NODE_ENV!=="production"){var e=Zv(),t=!0;tl.exports=PA()(e.isElement,t)}else tl.exports=TA()();return tl.exports}var MA=jA();const kd=Zp(MA);var Fa=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:_e("yst-my-6",r)})};Fa.propTypes={className:kd.string};const tb=6048e5,$A=864e5,Ug=Symbol.for("constructDateFrom");function an(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ug in e?e[Ug](t):e instanceof Date?new e.constructor(t):new Date(t)}function Wt(e,t){return an(t||e,e)}function nb(e,t,n){const r=Wt(e,n==null?void 0:n.in);if(isNaN(t))return an(e,NaN);if(!t)return r;const i=r.getDate(),s=an(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const o=s.getDate();return i>=o?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let DA={};function $c(){return DA}function na(e,t){var a,l,c,u,d,f,h,g;const n=$c(),r=(g=(h=(u=(c=t==null?void 0:t.weekStartsOn)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?u:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Wt(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Gl(e,t){return na(e,{...t,weekStartsOn:1})}function rb(e,t){const n=Wt(e,t==null?void 0:t.in),r=n.getFullYear(),i=an(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Gl(i),o=an(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Gl(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Kg(e){const t=Wt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Dc(e,...t){const n=an.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ql(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function IA(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t),s=Ql(r),o=Ql(i),a=+s-Kg(s),l=+o-Kg(o);return Math.round((a-l)/$A)}function LA(e,t){const n=rb(e,t),r=an(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Gl(r)}function RA(e){return an(e,Date.now())}function NA(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t);return+Ql(r)==+Ql(i)}function FA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BA(e){return!(!FA(e)&&typeof e!="number"||isNaN(+Wt(e)))}function qA(e,t){const n=Wt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function zA(e,t){const[n,r]=Dc(e,t.start,t.end);return{start:n,end:r}}function HA(e,t){const{start:n,end:r}=zA(t==null?void 0:t.in,e);let i=+n>+r;const s=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let a=1;const l=[];for(;+o<=s;)l.push(an(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function UA(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function KA(e,t){const n=Wt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const WA={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"}},VA=(e,t,n)=>{let r;const i=WA[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function bu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XA={date:bu({formats:GA,defaultWidth:"full"}),time:bu({formats:QA,defaultWidth:"full"}),dateTime:bu({formats:YA,defaultWidth:"full"})},JA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ZA=(e,t,n,r)=>JA[e];function uo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const e3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},t3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},n3={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"]},r3={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"]},i3={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"}},s3={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"}},o3=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},a3={ordinalNumber:o3,era:uo({values:e3,defaultWidth:"wide"}),quarter:uo({values:t3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:uo({values:n3,defaultWidth:"wide"}),day:uo({values:r3,defaultWidth:"wide"}),dayPeriod:uo({values:i3,defaultWidth:"wide",formattingValues:s3,defaultFormattingWidth:"wide"})};function fo(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?c3(a,d=>d.test(o)):l3(a,d=>d.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function l3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function c3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function u3(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const d3=/^(\d+)(th|st|nd|rd)?/i,f3=/\d+/i,h3={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},g3={any:[/^b/i,/^(a|c)/i]},y3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m3={any:[/1/i,/2/i,/3/i,/4/i]},p3={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},v3={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]},b3={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},x3={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]},w3={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},S3={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}},C3={ordinalNumber:u3({matchPattern:d3,parsePattern:f3,valueCallback:e=>parseInt(e,10)}),era:fo({matchPatterns:h3,defaultMatchWidth:"wide",parsePatterns:g3,defaultParseWidth:"any"}),quarter:fo({matchPatterns:y3,defaultMatchWidth:"wide",parsePatterns:m3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fo({matchPatterns:p3,defaultMatchWidth:"wide",parsePatterns:v3,defaultParseWidth:"any"}),day:fo({matchPatterns:b3,defaultMatchWidth:"wide",parsePatterns:x3,defaultParseWidth:"any"}),dayPeriod:fo({matchPatterns:w3,defaultMatchWidth:"any",parsePatterns:S3,defaultParseWidth:"any"})},_3={code:"en-US",formatDistance:VA,formatLong:XA,formatRelative:ZA,localize:a3,match:C3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k3(e,t){const n=Wt(e,t==null?void 0:t.in);return IA(n,KA(n))+1}function O3(e,t){const n=Wt(e,t==null?void 0:t.in),r=+Gl(n)-+LA(n);return Math.round(r/tb)+1}function ib(e,t){var u,d,f,h,g,m,p,v;const n=Wt(e,t==null?void 0:t.in),r=n.getFullYear(),i=$c(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)!=null?h:i.firstWeekContainsDate)!=null?p:(m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)!=null?v:1,o=an((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=na(o,t),l=an((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=na(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function E3(e,t){var a,l,c,u,d,f,h,g;const n=$c(),r=(g=(h=(u=(c=t==null?void 0:t.firstWeekContainsDate)!=null?c:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?u:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=ib(e,t),s=an((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),na(s,t)}function A3(e,t){const n=Wt(e,t==null?void 0:t.in),r=+na(n,t)-+E3(n,t);return Math.round(r/tb)+1}function Qe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Sr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Qe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qe(n+1,2)},d(e,t){return Qe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Qe(e.getHours()%12||12,t.length)},H(e,t){return Qe(e.getHours(),t.length)},m(e,t){return Qe(e.getMinutes(),t.length)},s(e,t){return Qe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Qe(i,t.length)}},Vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wg={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Sr.y(e,t)},Y:function(e,t,n,r){const i=ib(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Qe(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qe(s,t.length)},R:function(e,t){const n=rb(e);return Qe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Qe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Qe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Sr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Qe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=A3(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Qe(i,t.length)},I:function(e,t,n){const r=O3(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Qe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Sr.d(e,t)},D:function(e,t,n){const r=k3(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Qe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qe(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Qe(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Vi.noon:r===0?i=Vi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Vi.evening:r>=12?i=Vi.afternoon:r>=4?i=Vi.morning:i=Vi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Sr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Sr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Sr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Sr.s(e,t)},S:function(e,t){return Sr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Gg(r);case"XXXX":case"XX":return si(r);case"XXXXX":case"XXX":default:return si(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Gg(r);case"xxxx":case"xx":return si(r);case"xxxxx":case"xxx":default:return si(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vg(r,":");case"OOOO":default:return"GMT"+si(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vg(r,":");case"zzzz":default:return"GMT"+si(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Qe(r,t.length)},T:function(e,t,n){return Qe(+e,t.length)}};function Vg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Qe(s,2)}function Gg(e,t){return e%60===0?(e>0?"-":"+")+Qe(Math.abs(e)/60,2):si(e,t)}function si(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return n+i+t+s}const Qg=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sb=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},P3=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Qg(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Qg(r,t)).replace("{{time}}",sb(i,t))},T3={p:sb,P:P3},j3=/^D+$/,M3=/^Y+$/,$3=["D","DD","YY","YYYY"];function D3(e){return j3.test(e)}function I3(e){return M3.test(e)}function L3(e,t,n){const r=R3(e,t,n);if(console.warn(r),$3.includes(e))throw new RangeError(r)}function R3(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const N3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,F3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B3=/^'([^]*?)'?$/,q3=/''/g,z3=/[a-zA-Z]/;function Oo(e,t,n){var u,d,f,h,g,m,p,v,b;const r=$c(),i=(u=r.locale)!=null?u:_3,s=(g=(h=r.firstWeekContainsDate)!=null?h:(f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,o=(b=(v=r.weekStartsOn)!=null?v:(p=(m=r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)!=null?b:0,a=Wt(e,n==null?void 0:n.in);if(!BA(a))throw new RangeError("Invalid time value");let l=t.match(F3).map(w=>{const S=w[0];if(S==="p"||S==="P"){const x=T3[S];return x(w,i.formatLong)}return w}).join("").match(N3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const S=w[0];if(S==="'")return{isToken:!1,value:H3(w)};if(Wg[S])return{isToken:!0,value:w};if(S.match(z3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(w=>{if(!w.isToken)return w.value;const S=w.value;(I3(S)||D3(S))&&L3(S,t,String(e));const x=Wg[S[0]];return x(a,S,i.localize,c)}).join("")}function H3(e){const t=e.match(B3);return t?t[1].replace(q3,"'"):e}function Yg(e,t,n){const[r,i]=Dc(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function U3(e,t){return NA(an(e,e),RA(e))}function K3(e,t,n){return nb(e,-1,n)}function ra(e){"@babel/helpers - typeof";return ra=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(e)}function xu(e,t,n){return(t=W3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W3(e){var t=V3(e,"string");return ra(t)=="symbol"?t:t+""}function V3(e,t){if(ra(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ra(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xg(e,t){return X3(e)||Y3(e,t)||Q3(e,t)||G3()}function G3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q3(e,t){if(e){if(typeof e=="string")return Jg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jg(e,t):void 0}}function Jg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y3(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function X3(e){if(Array.isArray(e))return e}var In={selected:{background:"yst-bg-primary-500",text:"yst-text-white",hover:"hover:yst-bg-primary-600"},hasAnalysis:{border:"yst-border-2 yst-border-primary-500",text:"yst-text-slate-900",hover:"hover:yst-bg-primary-50"},today:{underline:"yst-border-b-2 yst-border-slate-400"},indicator:{default:"yst-bg-blue-500"}},J3=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.isOpen,l=a===void 0?!1:a,c=t.onClose,u=q.useState(new Date),d=Xg(u,2),f=d[0],h=d[1],g=function(k){if(!k)return null;var _=k.slice(0,10),A=_.split("-"),D=Xg(A,3),I=D[0],z=D[1],N=D[2],T=Number(I),$=Number(z),L=Number(N);return Number.isNaN(T)||Number.isNaN($)||Number.isNaN(L)||$<1||$>12||L<1||L>31?null:new Date(T,$-1,L)},m=q.useMemo(function(){var C=new Map;return n.forEach(function(k){var _=g(k.createdAt),A=_?Oo(_,"yyyy-MM-dd"):"";A&&(C.has(A)||C.set(A,[]),C.get(A).push(k))}),C},[n]);q.useEffect(function(){if(l&&r){var C=n.find(function(D){return D.id===r});if(C){var k=g(C.createdAt);k&&h(k)}}else if(l&&n.length>0){var _=n.reduce(function(D,I){return new Date(I.createdAt)>new Date(D.createdAt)?I:D}),A=g(_.createdAt);A&&h(A)}},[l,r,n]);var p=q.useMemo(function(){return n.length===0?null:n.reduce(function(C,k){return new Date(k.createdAt)>new Date(C.createdAt)?k:C})},[n]),v=function(){if(p){var k=g(p.createdAt);k&&h(k)}},b=q.useMemo(function(){if(!p)return!1;var C=g(p.createdAt);return C?Yg(C,f):!1},[p,f]),w=q.useMemo(function(){var C=UA(f),k=qA(f),_=new Date(C),A=_.getDay(),D=A===0?6:A-1;_.setDate(_.getDate()-D);var I=new Date(k),z=I.getDay(),N=z===0?0:7-z;return I.setDate(I.getDate()+N),HA({start:_,end:I}).map(function(T){var $=Oo(T,"yyyy-MM-dd"),L=m.get($)||[],Z=L.find(function(ue){return String(ue.id)===String(r)});return{date:$,dateObj:T,isCurrentMonth:Yg(T,f),isToday:U3(T),isSelected:!!Z,hasAnalyses:L.length>0,analyses:L}})},[f,m,r]),S=function(){h(function(k){return K3(k)})},x=function(){h(function(k){return nb(k,1)})},O=function(k){if(k.hasAnalyses){if(k.analyses.length===1)i(k.analyses[0].id);else{var _=k.analyses.reduce(function(A,D){return new Date(D.createdAt)>new Date(A.createdAt)?D:A});i(_.id)}c==null||c()}};return l?o?y.jsx("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:y.jsxs("div",{className:"yst-animate-pulse yst-space-y-4",children:[y.jsx("div",{className:"yst-h-6 yst-rounded yst-bg-slate-200"}),y.jsx("div",{className:"yst-h-48 yst-rounded yst-bg-slate-200"})]})}):y.jsxs("div",{className:"yst-absolute yst-left-0 yst-right-0 yst-top-full yst-z-50 yst-mt-1 yst-min-w-80 yst-max-w-sm yst-rounded-md yst-border yst-border-slate-200 yst-bg-white yst-p-4 yst-shadow-lg",children:[y.jsxs("div",{className:"yst-mb-6 yst-flex yst-items-center yst-justify-between",children:[y.jsxs("button",{type:"button",onClick:S,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Previous month"}),y.jsx(kO,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:Oo(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:x,className:"yst-rounded-md yst-p-1.5 yst-text-slate-400 hover:yst-bg-slate-100 hover:yst-text-slate-500",children:[y.jsx("span",{className:"yst-sr-only",children:"Next month"}),y.jsx(EO,{className:"yst-h-5 yst-w-5"})]})]}),y.jsx("div",{className:"yst-mb-0 yst-grid yst-grid-cols-7 yst-gap-x-1",children:["M","T","W","T","F","S","S"].map(function(C,k){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:C},"".concat(C,"-").concat(k))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:w.map(function(C){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return O(C)},disabled:!C.hasAnalyses,className:_e("yst-relative yst-rounded-full yst-text-sm yst-transition-colors","yst-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center","yst-p-0",{"yst-text-slate-900":C.isCurrentMonth,"yst-text-slate-400":!C.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":C.hasAnalyses,"yst-cursor-not-allowed":!C.hasAnalyses,"yst-cursor-pointer":C.hasAnalyses},xu({},"".concat(In.selected.background," ").concat(In.selected.text," ").concat(In.selected.hover),C.isSelected),xu({},"".concat(In.hasAnalysis.border," ").concat(In.hasAnalysis.text," ").concat(In.hasAnalysis.hover),C.hasAnalyses&&!C.isSelected)),children:[y.jsx("span",{className:_e("yst-relative yst-z-10 yst-w-4",xu({},In.today.underline,C.isToday&&!C.isSelected)),children:Oo(C.dateObj,"d")}),C.hasAnalyses&&C.analyses.length>1&&!C.isSelected&&y.jsx("span",{className:_e("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",In.indicator.default)})]})},C.date)})}),y.jsxs("div",{className:"yst-mt-4 yst-flex yst-items-center yst-gap-4 yst-text-xs yst-text-slate-600",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(In.hasAnalysis.border)}),y.jsx("span",{children:"Has analysis"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-3 yst-w-3 yst-rounded-full ".concat(In.selected.background)}),y.jsx("span",{children:"Selected"})]}),y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-1",children:[y.jsx("div",{className:"yst-h-0.5 yst-w-4 yst-bg-slate-400"}),y.jsx("span",{children:"Today"})]})]}),p&&y.jsx("div",{className:"yst-mt-6",children:y.jsx(E.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function wu(e,t){return nP(e)||tP(e,t)||eP(e,t)||Z3()}function Z3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eP(e,t){if(e){if(typeof e=="string")return Zg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zg(e,t):void 0}}function Zg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tP(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function nP(e){if(Array.isArray(e))return e}var rP=function(t){var n=t.analyses,r=t.selectedAnalysisId,i=t.onAnalysisSelect,s=t.isLoading,o=s===void 0?!1:s,a=t.disabled,l=a===void 0?!1:a,c=t.id,u=c===void 0?"analysis-date-select":c,d=q.useState(!1),f=wu(d,2),h=f[0],g=f[1],m=q.useState("latest"),p=wu(m,2),v=p[0],b=p[1],w=q.useRef(null),S=function(T){if(!T)return null;var $=T.slice(0,10),L=$.split("-"),Z=wu(L,3),ue=Z[0],F=Z[1],V=Z[2],re=Number(ue),se=Number(F),R=Number(V);return Number.isNaN(re)||Number.isNaN(se)||Number.isNaN(R)||se<1||se>12||R<1||R>31?null:new Date(re,se-1,R)},x=function(T){var $=S(T.createdAt);return $?$.getTime():-1/0};q.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var N=n.reduce(function(T,$){return x($)>x(T)?$:T});i(N.id)}},[n,r,i,o]);var O=q.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var N=n.reduce(function(T,$){return x($)>x(T)?$:T});return N.id}return"latest"}return r},[r,n,x]);q.useEffect(function(){b(O)},[O]);var C=n.find(function(N){return String(N.id)===String(v)}),k=n.length>0?String(n.reduce(function(N,T){return x(T)>x(N)?T:N}).id):"",_=function(){if(C){var N=S(C.createdAt),T=N?Oo(N,"MMMM d, yyyy"):C.createdAt?C.createdAt.slice(0,10):"Unknown date",$=String(C.id)===k?"(latest)":"(older)";return"".concat(T," ").concat($)}return n.length>0?"Select date...":"No analyses available"}();q.useEffect(function(){var N=function($){w.current&&!w.current.contains($.target)&&g(!1)};return h&&document.addEventListener("mousedown",N),function(){document.removeEventListener("mousedown",N)}},[h]);var A=function(){!l&&!o&&g(!h)},D=function(T){b(T),i(T),g(!1)},I=function(){g(!1)},z=function(T){T.key==="Enter"||T.key===" "?(T.preventDefault(),A()):T.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:w,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(E.TextInput,{id:u,onClick:A,onKeyDown:z,onChange:function(){},disabled:l||o,value:_,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:_e("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(wO,{className:_e("yst-pointer-events-none yst-absolute yst-right-3 yst-top-1/2 yst--translate-y-1/2 yst-transform",{"yst-text-gray-400":l||o})})]}),y.jsx(J3,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:D,isLoading:o,isOpen:h,onClose:I})]})};function ob(e){if(e!=null){if(typeof e=="number"){var t=1e12;return e>t?e-Date.now():e}var n=Date.parse(e);if(!Number.isNaN(n))return n-Date.now()}}function iP(e,t){var n=ob(e);return n!==void 0&&n>t*60*1e3}var sP=2;function ab(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sP,n=ob(e);return n!==void 0&&n>0&&n<=t*60*1e3}function Od(e){if(e==null)return"a future date";var t;if(typeof e=="number"){var n=1e12;e>n?t=e:t=Date.now()+e}else{var r=Date.parse(e);Number.isNaN(r)||(t=r)}if(t===void 0)return"a future date";var i=new Date(t),s={month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0},o=i.toLocaleDateString("en-US",s),a=o.split(" ");if(a.length>=4){var l=a[0],c=a[1].replace(",",""),u=a.slice(2).join(" ");return"".concat(l," ").concat(c," at ").concat(u)}return"".concat(o)}var ey;function ty(e,t){return cP(e)||lP(e,t)||aP(e,t)||oP()}function oP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
50
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aP(e,t){if(e){if(typeof e=="string")return ny(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ny(e,t):void 0}}function ny(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lP(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function cP(e){if(Array.isArray(e))return e}function Ed(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Jt(b,"_invoke",function(w,S,x){var O,C,k,_=0,A=x||[],D=!1,I={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(T,$){return O=T,C=0,k=e,I.n=$,o}};function z(N,T){for(C=N,k=T,t=0;!D&&_&&!$&&t<A.length;t++){var $,L=A[t],Z=I.p,ue=L[2];N>3?($=ue===T)&&(k=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=Z&&(($=N<2&&Z<L[1])?(C=0,I.v=T,I.n=L[1]):Z<ue&&($=N<3||L[0]>T||T>ue)&&(L[4]=N,L[5]=T,I.n=ue,C=0))}if($||N>1)return o;throw D=!0,T}return function(N,T,$){if(_>1)throw TypeError("Generator is already running");for(D&&T===1&&z(T,$),C=T,k=$;(t=C<2?e:k)||!D;){O||(C?C<3?(C>1&&(I.n=-1),z(C,k)):I.n=k:I.v=k);try{if(_=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,k)))throw TypeError("iterator result is not an object");if(!t.done)return t;k=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(k=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(D=I.n<0)?k:w.call(S,I))!==o)break}catch(L){O=e,C=1,k=L}finally{_=1}}return{value:t,done:D}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Jt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Jt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Jt(d,"constructor",c),Jt(c,"constructor",l),l.displayName="GeneratorFunction",Jt(c,i,"GeneratorFunction"),Jt(d),Jt(d,i,"Generator"),Jt(d,r,function(){return this}),Jt(d,"toString",function(){return"[object Generator]"}),(Ed=function(){return{w:s,m:f}})()}function Jt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Jt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Jt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Jt(e,t,n,r)}function ry(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function uP(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ry(s,r,i,o,a,"next",l)}function a(l){ry(s,r,i,o,a,"throw",l)}o(void 0)})}}function dP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Su=Na(ey||(ey=dP(["yst-flex-1 yst-space-y-2"]))),fP=function(t){var n,r,i,s=t.className,o=Gn(),a=o.brandId,l=o.analysisId,c=o.model,u=Ia(),d=u.setModel,f=u.setAnalysisId,h=Kt(),g=ln(),m=Bi(),p=m.data,v=Pc({query:{select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.data}}}),b=v.data,w=v.isLoading,S=b==null?void 0:b.displayName,x=Fi({query:{select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.brands}}}),O=x.data,C=x.isLoading,k=Fv(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge==null?void 0:Ge.analyses}}}),_=k.data,A=k.isLoading,D=Ac(a,l,{query:{enabled:!!a&&!!l,select:function(ze){var Ge=ze.data;return Ge}}}),I=D.data,z=D.isLoading,N=Xk(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge}}}),T=N.data,$=N.isLoading,L=xk({mutation:{onSuccess:function(){var ke=uP(Ed().m(function Ge(){var Vt,_n;return Ed().w(function(Gt){for(;;)switch(Gt.n){case 0:return Gt.n=1,Promise.all([h.invalidateQueries({queryKey:Nv(a)}),h.invalidateQueries({queryKey:Bv(a,l)}),h.invalidateQueries({queryKey:pf(a)})]);case 1:Vt=(_==null?void 0:_.filter(function(Lt){return String(Lt.id)!==String(l)}))||[],Vt.length>0?(_n=Vt.reduce(function(Lt,wr){var Zr=Lt.createdAt?new Date(Lt.createdAt).getTime():0,Hi=wr.createdAt?new Date(wr.createdAt).getTime():0;return Hi>Zr?wr:Lt}),f(_n.id),g("/brands/".concat(a,"/analysis/").concat(_n.id))):(f("latest"),g("/brands/".concat(a))),se(!1);case 2:return Gt.a(2)}},Ge)}));function ze(){return ke.apply(this,arguments)}return ze}()}}),Z=L.mutate,ue=L.isPending;q.useEffect(function(){!$&&!z&&a&&O&&(O==null?void 0:O.length)<2&&(!T||Array.isArray(T)&&T.length===0)&&(_==null?void 0:_.length)===0&&g("/setup/".concat(a,"/queries"))},[$,z,T,a,g,O,_==null?void 0:_.length]);var F=q.useState(!1),V=ty(F,2),re=V[0],se=V[1],R=function(){se(!1)},ae=O==null?void 0:O.find(function(ke){return String(ke.id)===String(a)}),ne=I==null||(n=I.analysis)===null||n===void 0?void 0:n.id,xe=a!=null&&typeof ne=="number"&&!isNaN(ne),ee=q.useState(!1),ie=ty(ee,2),Q=ie[0],Ce=ie[1];q.useEffect(function(){if(xe){var ke="yst_legal_alert_dismissed_".concat(a,"_").concat(ne);Ce(window.localStorage.getItem(ke)===null)}},[a,ne,xe]);var H=function(ze){if(ze.preventDefault(),!!xe){var Ge="yst_legal_alert_dismissed_".concat(a,"_").concat(ne);window.localStorage.setItem(Ge,"true"),Ce(!1)}},Pe=function(ze){switch(ze){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return ze||"Unknown"}},et=(I==null||(r=I.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(ke){return{value:ke.aiProvider,label:Pe(ke.aiProvider)}}))||[{value:"",label:"Default model"}],nt=_!=null&&_.some(function(ke){return String(ke.id)===String(l)})?l:_&&_.length>0?_[0].id:"latest",Ve=vf(a,{query:{enabled:!!a,select:function(ze){var Ge=ze.data;return Ge}}}),Le=Ve.data,Y=(Le==null?void 0:Le.name)||"your brand",je=Od(Le==null?void 0:Le.nextScheduledAnalysis),at=I==null||(i=I.analysis)===null||i===void 0?void 0:i.status,Re=function(){switch(at){case ii.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:Y}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:je}),". You'll see the results here once it's ready. We'll also notify you by email."]})]}),alertVariant:"info"};case ii.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Y,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case ii.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ii.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ii.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),$e=Re.alertContent,he=Re.alertVariant,ye=!A&&(_==null?void 0:_.length)===0,fe=p==null?void 0:p.isUpToDateWithBrandGroups,Ne=(p==null?void 0:p.status)===yE.updating&&fe===!1;return y.jsxs(y.Fragment,{children:[y.jsx(Mc,{isOpen:re,onClose:R,onConfirm:function(){a&&l&&Z({brandId:a,analysisId:l})},isLoading:ue,title:"Delete analysis?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this analysis."}),y.jsx("p",{children:"This action cannot be undone."})]}),confirmText:"Yes, delete analysis",cancelText:"No, go back"}),y.jsx(E.Card,{className:_e("yst-relative yst-overflow-visible",s),children:y.jsxs(E.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(E.Title,{children:y.jsxs(y.Fragment,{children:[w||!S?y.jsx(E.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",S,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(E.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return g("/setup")},disabled:A||C,children:[y.jsx(Wv,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(E.DropdownMenu,{children:[y.jsx(E.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:A||C||O&&(O==null?void 0:O.length)<1,children:y.jsx($O,{})}),y.jsx(E.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(E.DropdownMenu.ButtonItem,{onClick:function(){return se(!0)},disabled:A||C||!_||_.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(xf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Fa,{}),y.jsxs("form",{className:"yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center",children:[y.jsxs(Su,{children:[y.jsx(E.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(E.Select,{onChange:function(ke){g("/brands/".concat(ke.toString()))},id:"brand-name",value:a?Number(a):"loading",options:O&&O.length>0?O.map(function(ke){return{value:ke.id,label:ke.name}}):[{value:"loading",label:"Loading..."}],disabled:C||!O||O.length<2||!a})]}),y.jsxs(Su,{children:[y.jsx(E.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(rP,{analyses:_||[],selectedAnalysisId:nt,onAnalysisSelect:function(ke){g("/brands/".concat(a,"/analysis/").concat(String(ke)))},isLoading:A,disabled:A||!_||_.length<1,id:"analysis-date"})]}),y.jsxs(Su,{children:[y.jsx(E.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(E.Select,{onChange:function(ke){Object.values(gE).includes(ke)?d(ke):console.error("Invalid AI provider selected:",ke)},id:"ai-tool",value:c,options:z||A?[{value:c,label:"Loading..."}]:et,disabled:z||A||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[xe&&Q&&y.jsx(E.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(E.Link,{onClick:H,variant:"default",children:y.jsx(ME,{})})})]})}),at!==ii.completed&&$e&&y.jsx(E.Alert,{className:"md:yst-col-span-2",variant:he,children:$e}),typeof fe=="boolean"&&!fe&&y.jsxs(E.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",Ne?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ye&&y.jsx(E.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:ae==null?void 0:ae.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return g("/settings")},role:"button",tabIndex:0,onKeyPress:function(ke){(ke.key==="Enter"||ke.key===" ")&&g("/settings")},children:"Settings"}),"."]})]})})}),ae&&y.jsx(_A,{brand:ae},ae.id)]})},hP=function(){var t,n,r,i=Bi(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ra,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(La,{score:l==null||(t=l.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value,total:l==null||(n=l.queriesWithMentions)===null||n===void 0?void 0:n.length,suffix:"queries",isLoading:o||a})]}),!o&&l?y.jsx("ul",{children:l==null||(r=l.queriesWithMentions)===null||r===void 0?void 0:r.map(function(c,u){var d=u===0,f=l.queriesWithMentions&&u===l.queriesWithMentions.length-1;return y.jsxs("li",{className:_e("yst-flex yst-flex-row yst-items-center yst-gap-2 yst-border-l yst-border-r yst-border-slate-300 yst-p-4 yst-font-medium yst-text-slate-800",{"yst-rounded-t-lg yst-border-t":d,"yst-rounded-b-lg yst-border-b":f,"yst-border-b":!f}),children:[y.jsx("div",{className:"yst-h-4 yst-w-4",children:c!=null&&c.mentioned?y.jsx(CO,{className:"yst-text-green-500"}):y.jsx(GO,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:c.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:c!=null&&c.mentioned?y.jsx(E.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(E.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},c.query)})}):y.jsx(E.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
|
|
51
51
|
* @kurkle/color v0.3.4
|
|
52
52
|
* https://github.com/kurkle/color#readme
|
|
53
53
|
* (c) 2024 Jukka Kurkela
|
|
54
54
|
* Released under the MIT License
|
|
55
|
-
*/function
|
|
55
|
+
*/function Ba(e){return e+.5|0}const Rr=(e,t,n)=>Math.max(Math.min(e,n),t);function Eo(e){return Rr(Ba(e*2.55),0,255)}function zr(e){return Rr(Ba(e*255),0,255)}function tr(e){return Rr(Ba(e/2.55)/100,0,1)}function iy(e){return Rr(Ba(e*100),0,100)}const cn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ad=[..."0123456789ABCDEF"],gP=e=>Ad[e&15],yP=e=>Ad[(e&240)>>4]+Ad[e&15],rl=e=>(e&240)>>4===(e&15),mP=e=>rl(e.r)&&rl(e.g)&&rl(e.b)&&rl(e.a);function pP(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&cn[e[1]]*17,g:255&cn[e[2]]*17,b:255&cn[e[3]]*17,a:t===5?cn[e[4]]*17:255}:(t===7||t===9)&&(n={r:cn[e[1]]<<4|cn[e[2]],g:cn[e[3]]<<4|cn[e[4]],b:cn[e[5]]<<4|cn[e[6]],a:t===9?cn[e[7]]<<4|cn[e[8]]:255})),n}const vP=(e,t)=>e<255?t(e):"";function bP(e){var t=mP(e)?gP:yP;return e?"#"+t(e.r)+t(e.g)+t(e.b)+vP(e.a,t):void 0}const xP=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function lb(e,t,n){const r=t*Math.min(n,1-n),i=(s,o=(s+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function wP(e,t,n){const r=(i,s=(i+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function SP(e,t,n){const r=lb(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function CP(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function _f(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=CP(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function kf(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(zr)}function Of(e,t,n){return kf(lb,e,t,n)}function _P(e,t,n){return kf(SP,e,t,n)}function kP(e,t,n){return kf(wP,e,t,n)}function cb(e){return(e%360+360)%360}function OP(e){const t=xP.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Eo(+t[5]):zr(+t[5]));const i=cb(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=_P(i,s,o):t[1]==="hsv"?r=kP(i,s,o):r=Of(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function EP(e,t){var n=_f(e);n[0]=cb(n[0]+t),n=Of(n),e.r=n[0],e.g=n[1],e.b=n[2]}function AP(e){if(!e)return;const t=_f(e),n=t[0],r=iy(t[1]),i=iy(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${tr(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const sy={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},oy={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function PP(){const e={},t=Object.keys(oy),n=Object.keys(sy);let r,i,s,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,sy[s]);s=parseInt(oy[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let il;function TP(e){il||(il=PP(),il.transparent=[0,0,0,0]);const t=il[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const jP=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function MP(e){const t=jP.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?Eo(o):Rr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?Eo(r):Rr(r,0,255)),i=255&(t[4]?Eo(i):Rr(i,0,255)),s=255&(t[6]?Eo(s):Rr(s,0,255)),{r,g:i,b:s,a:n}}}function $P(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${tr(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Cu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Gi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function DP(e,t,n){const r=Gi(tr(e.r)),i=Gi(tr(e.g)),s=Gi(tr(e.b));return{r:zr(Cu(r+n*(Gi(tr(t.r))-r))),g:zr(Cu(i+n*(Gi(tr(t.g))-i))),b:zr(Cu(s+n*(Gi(tr(t.b))-s))),a:e.a+n*(t.a-e.a)}}function sl(e,t,n){if(e){let r=_f(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Of(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ub(e,t){return e&&Object.assign(t||{},e)}function ay(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=zr(e[3]))):(t=ub(e,{r:0,g:0,b:0,a:1}),t.a=zr(t.a)),t}function IP(e){return e.charAt(0)==="r"?MP(e):OP(e)}class ia{constructor(t){if(t instanceof ia)return t;const n=typeof t;let r;n==="object"?r=ay(t):n==="string"&&(r=pP(t)||TP(t)||IP(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=ub(this._rgb);return t&&(t.a=tr(t.a)),t}set rgb(t){this._rgb=ay(t)}rgbString(){return this._valid?$P(this._rgb):void 0}hexString(){return this._valid?bP(this._rgb):void 0}hslString(){return this._valid?AP(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*i.r+.5,r.g=255&c*r.g+s*i.g+.5,r.b=255&c*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=DP(this._rgb,t._rgb,n)),this}clone(){return new ia(this.rgb)}alpha(t){return this._rgb.a=zr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ba(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return sl(this._rgb,2,t),this}darken(t){return sl(this._rgb,2,-t),this}saturate(t){return sl(this._rgb,1,t),this}desaturate(t){return sl(this._rgb,1,-t),this}rotate(t){return EP(this._rgb,t),this}}/*!
|
|
56
56
|
* Chart.js v4.5.0
|
|
57
57
|
* https://www.chartjs.org
|
|
58
58
|
* (c) 2025 Chart.js Contributors
|
|
59
59
|
* Released under the MIT License
|
|
60
|
-
*/function Yn(){}const LP=(()=>{let e=0;return()=>e++})();function Xe(e){return e==null}function lt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Fe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function vt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ln(e,t){return vt(e)?e:t}function De(e,t){return typeof e=="undefined"?t:e}const RP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function tt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ye(e,t,n,r){let i,s,o;if(lt(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(Fe(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function Ql(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Yl(e){if(lt(e))return e.map(Yl);if(Fe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Yl(e[n[i]]);return t}return e}function db(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function NP(e,t,n,r){if(!db(e))return;const i=t[e],s=n[e];Fe(i)&&Fe(s)?sa(i,s,r):t[e]=Yl(s)}function sa(e,t,n){const r=lt(t)?t:[t],i=r.length;if(!Fe(e))return e;n=n||{};const s=n.merger||NP;let o;for(let a=0;a<i;++a){if(o=r[a],!Fe(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],e,o,n)}return e}function No(e,t){return sa(e,t,{merger:FP})}function FP(e,t,n){if(!db(e))return;const r=t[e],i=n[e];Fe(r)&&Fe(i)?No(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Yl(i))}const ay={"":e=>e,x:e=>e.x,y:e=>e.y};function BP(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function qP(e){const t=BP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function oa(e,t){return(ay[t]||(ay[t]=qP(t)))(e)}function Of(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Xl=e=>typeof e!="undefined",Wr=e=>typeof e=="function",ly=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function zP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ht=Math.PI,sn=2*ht,HP=sn+ht,Jl=Number.POSITIVE_INFINITY,UP=ht/180,rn=ht/2,ei=ht/4,cy=ht*2/3,fb=Math.log10,Ns=Math.sign;function Fo(e,t,n){return Math.abs(e-t)<n}function uy(e){const t=Math.round(e);e=Fo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(fb(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function KP(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,s)=>i-s).pop(),t}function WP(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function aa(e){return!WP(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function VP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function GP(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function Nr(e){return e*(ht/180)}function Ef(e){return e*(180/ht)}function dy(e){if(!vt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function QP(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ht&&(s+=sn),{angle:s,distance:i}}function Ad(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function YP(e,t){return(e-t+HP)%sn-ht}function en(e){return(e%sn+sn)%sn}function hb(e,t,n,r){const i=en(e),s=en(t),o=en(n),a=en(s-i),l=en(o-i),c=en(i-s),u=en(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function gn(e,t,n){return Math.max(t,Math.min(n,e))}function XP(e){return gn(e,-32768,32767)}function ns(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Af(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const fi=(e,t,n,r)=>Af(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),JP=(e,t,n)=>Af(e,n,r=>e[r][t]>=n);function ZP(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const gb=["push","pop","shift","splice","unshift"];function eT(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),gb.forEach(n=>{const r="_onData"+Of(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function fy(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(gb.forEach(s=>{delete e[s]}),delete e._chartjs)}function tT(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const yb=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function mb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,yb.call(window,()=>{r=!1,e.apply(t,n)}))}}function nT(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Pf=e=>e==="start"?"left":e==="end"?"right":"center",kt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,rT=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function iT(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:h,maxDefined:g}=o.getUserBounds();if(h){if(i=Math.min(fi(l,u,d).lo,n?r:fi(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(p=>!Xe(p[a.axis]));i-=Math.max(0,m)}i=gn(i,0,r-1)}if(g){let m=Math.max(fi(l,o.axis,f,!0).hi+1,n?0:fi(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const p=l.slice(m-1).findIndex(v=>!Xe(v[a.axis]));m+=Math.max(0,p)}s=gn(m,i,r)-i}else s=r-i}return{start:i,count:s}}function sT(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const sl=e=>e===0||e===1,hy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*sn/n)),gy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*sn/n)+1,Bo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*rn)+1,easeOutSine:e=>Math.sin(e*rn),easeInOutSine:e=>-.5*(Math.cos(ht*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>sl(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>sl(e)?e:hy(e,.075,.3),easeOutElastic:e=>sl(e)?e:gy(e,.075,.3),easeInOutElastic(e){return sl(e)?e:e<.5?.5*hy(e*2,.1125,.45):.5+.5*gy(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Bo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Bo.easeInBounce(e*2)*.5:Bo.easeOutBounce(e*2-1)*.5+.5};function Tf(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function yy(e){return Tf(e)?e:new ia(e)}function _u(e){return Tf(e)?e:new ia(e).saturate(.5).darken(.1).hexString()}const oT=["x","y","borderWidth","radius","tension"],aT=["color","borderColor","backgroundColor"];function lT(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:aT},numbers:{type:"number",properties:oT}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function cT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const my=new Map;function uT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=my.get(n);return r||(r=new Intl.NumberFormat(e,t),my.set(n,r)),r}function pb(e,t,n){return uT(t,n).format(e)}const dT={values(e){return lt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=fT(e,n)}const o=fb(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),pb(e,r,l)}};function fT(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var jf={formatters:dT};function hT(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ji=Object.create(null),Pd=Object.create(null);function qo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function ku(e,t,n){return typeof t=="string"?sa(qo(e,t),n):sa(qo(e,""),t)}class gT{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>_u(i.backgroundColor),this.hoverBorderColor=(r,i)=>_u(i.borderColor),this.hoverColor=(r,i)=>_u(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return ku(this,t,n)}get(t){return qo(this,t)}describe(t,n){return ku(Pd,t,n)}override(t,n){return ku(ji,t,n)}route(t,n,r,i){const s=qo(this,t),o=qo(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return Fe(l)?Object.assign({},c,l):De(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var dt=new gT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lT,cT,hT]);function yT(e){return!e||Xe(e.size)||Xe(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Zl(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function mT(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!lt(d))o=Zl(e,i,s,o,d);else if(lt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!lt(f)&&(o=Zl(e,i,s,o,f));e.restore();const h=s.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[s[l]];s.splice(0,h)}return o}function ti(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function py(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Td(e,t,n,r){vb(e,t,n,r,null)}function vb(e,t,n,r,i){let s,o,a,l,c,u,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*UP;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(p),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,m,0,0,sn):e.arc(n,r,m,0,sn),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=cy,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=cy,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(p+ei)*l,d=Math.cos(p+ei)*(i?i/2-c:l),a=Math.sin(p+ei)*l,f=Math.sin(p+ei)*(i?i/2-c:l),e.arc(n-d,r-a,c,p-ht,p-rn),e.arc(n+f,r-o,c,p-rn,p),e.arc(n+d,r+a,c,p,p+rn),e.arc(n-f,r+o,c,p+rn,p+ht),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}p+=ei;case"rectRot":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-o),e.lineTo(n+d,r+a),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":p+=ei;case"cross":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),p+=ei,d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(p)*m,a=Math.sin(p)*m,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(p)*(i?i/2:m),r+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ar(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ic(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Lc(e){e.restore()}function pT(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function vT(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function bT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Xe(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function xT(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function wT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Mi(e,t,n,r,i,s={}){const o=lt(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,bT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&wT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Xe(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),xT(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function ec(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ht,ht,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ht,rn,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,rn,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-rn,!0),e.lineTo(n+o.topLeft,r)}const ST=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,CT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _T(e,t){const n=(""+e).match(ST);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const kT=e=>+e||0;function bb(e,t){const n={},r=Fe(t),i=r?Object.keys(t):t,s=Fe(e)?r?o=>De(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=kT(s(o));return n}function OT(e){return bb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function rs(e){return bb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Tt(e){const t=OT(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function yt(e,t){e=e||{},t=t||dt.font;let n=De(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=De(e.style,t.style);r&&!(""+r).match(CT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:De(e.family,t.family),lineHeight:_T(De(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:De(e.weight,t.weight),string:""};return i.string=yT(i),i}function ol(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function ET(e,t,n){const{min:r,max:i}=e,s=RP(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function Xr(e,t){return Object.assign(Object.create(e),t)}function Mf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=Cb("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Mf([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return wb(a,l,()=>IT(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return by(a).includes(l)},ownKeys(a){return by(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Fs(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:xb(e,r),setContext:s=>Fs(e,s,n,r),override:s=>Fs(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return wb(s,o,()=>PT(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function xb(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Wr(n)?n:()=>n,isIndexable:Wr(r)?r:()=>r}}const AT=(e,t)=>e?e+Of(t):t,$f=(e,t)=>Fe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function wb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function PT(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return Wr(a)&&o.isScriptable(t)&&(a=TT(t,a,e,n)),lt(a)&&a.length&&(a=jT(t,a,e,o.isIndexable)),$f(t,a)&&(a=Fs(a,i,s&&s[t],o)),a}function TT(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),$f(e,l)&&(l=Df(i._scopes,i,e,l)),l}function jT(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index!="undefined"&&r(e))return t[s.index%t.length];if(Fe(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Df(c,i,e,u);t.push(Fs(d,s,o&&o[e],a))}}return t}function Sb(e,t,n){return Wr(e)?e(t,n):e}const MT=(e,t)=>e===!0?t:typeof e=="string"?oa(t,e):void 0;function $T(e,t,n,r,i){for(const s of t){const o=MT(n,s);if(o){e.add(o);const a=Sb(o._fallback,n,i);if(typeof a!="undefined"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r!="undefined"&&n!==r)return null}return!1}function Df(e,t,n,r){const i=t._rootScopes,s=Sb(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=vy(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=vy(a,o,s,l,r),l===null)?!1:Mf(Array.from(a),[""],i,s,()=>DT(t,n,r))}function vy(e,t,n,r,i){for(;n;)n=$T(e,t,n,r,i);return n}function DT(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return lt(i)&&Fe(n)?n:i||{}}function IT(e,t,n,r){let i;for(const s of t)if(i=Cb(AT(s,e),n),typeof i!="undefined")return $f(e,i)?Df(n,r,e,i):i}function Cb(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function by(e){let t=e._keys;return t||(t=e._keys=LT(e._scopes)),t}function LT(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function RT(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],o[a]={r:i.parse(oa(u,s),c)};return o}const NT=Number.EPSILON||1e-14,Bs=(e,t)=>t<e.length&&!e[t].skip&&e[t],_b=e=>e==="x"?"y":"x";function FT(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Ad(s,i),l=Ad(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:s.x-d*(o.x-i.x),y:s.y-d*(o.y-i.y)},next:{x:s.x+f*(o.x-i.x),y:s.y+f*(o.y-i.y)}}}function BT(e,t,n){const r=e.length;let i,s,o,a,l,c=Bs(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Bs(e,u+1),!(!l||!c)){if(Fo(t[u],0,NT)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],s=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=i*o*t[u],n[u+1]=s*o*t[u])}}function qT(e,t,n="x"){const r=_b(n),i=e.length;let s,o,a,l=Bs(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Bs(e,c+1),!a)continue;const u=a[n],d=a[r];o&&(s=(u-o[n])/3,a[`cp1${n}`]=u-s,a[`cp1${r}`]=d-s*t[c]),l&&(s=(l[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${r}`]=d+s*t[c])}}function zT(e,t="x"){const n=_b(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Bs(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Bs(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[n]-l[n])/u:0}s[o]=a?c?Ns(i[o-1])!==Ns(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}BT(e,i,s),qT(e,s,t)}function al(e,t,n){return Math.max(Math.min(e,n),t)}function HT(e,t){let n,r,i,s,o,a=ar(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&ar(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=al(i.cp1x,t.left,t.right),i.cp1y=al(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=al(i.cp2x,t.left,t.right),i.cp2y=al(i.cp2y,t.top,t.bottom)))}function UT(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zT(e,i);else{let c=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=FT(c,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&HT(e,n)}function If(){return typeof window!="undefined"&&typeof document!="undefined"}function Lf(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function tc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Rc=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function KT(e,t){return Rc(e).getPropertyValue(t)}const WT=["top","right","bottom","left"];function Oi(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=WT[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const VT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function GT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(VT(i,s,e.target))a=i,l=s;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function oi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Rc(n),s=i.boxSizing==="border-box",o=Oi(i,"padding"),a=Oi(i,"border","width"),{x:l,y:c,box:u}=GT(e,n),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:h,height:g}=t;return s&&(h-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-f)/g*n.height/r)}}function QT(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Lf(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Rc(s),l=Oi(a,"border","width"),c=Oi(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=tc(a.maxWidth,s,"clientWidth"),i=tc(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Jl,maxHeight:i||Jl}}const ll=e=>Math.round(e*10)/10;function YT(e,t,n,r){const i=Rc(e),s=Oi(i,"margin"),o=tc(i.maxWidth,e,"clientWidth")||Jl,a=tc(i.maxHeight,e,"clientHeight")||Jl,l=QT(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Oi(i,"border","width"),h=Oi(i,"padding");c-=h.width+f.width,u-=h.height+f.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=ll(Math.min(c,o,l.maxWidth)),u=ll(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ll(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=ll(Math.floor(u*r))),{width:c,height:u}}function xy(e,t,n){const r=t||1,i=Math.floor(e.height*r),s=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const XT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};If()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function wy(e,t){const n=KT(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ai(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function JT(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function ZT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=ai(e,i,n),a=ai(i,s,n),l=ai(s,t,n),c=ai(o,a,n),u=ai(a,l,n);return ai(c,u,n)}const e5=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},t5=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function is(e,t,n){return e?e5(t,n):t5()}function kb(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Ob(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Eb(e){return e==="angle"?{between:hb,compare:YP,normalize:en}:{between:ns,compare:(t,n)=>t-n,normalize:t=>t}}function Sy({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function n5(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=Eb(r),l=t.length;let{start:c,end:u,loop:d}=e,f,h;if(d){for(c+=l,u+=l,f=0,h=l;f<h&&o(a(t[c%l][r]),i,s);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function Ab(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=Eb(r),{start:u,end:d,loop:f,style:h}=n5(e,t,n),g=[];let m=!1,p=null,v,b,w;const S=()=>l(i,w,v)&&a(i,w)!==0,x=()=>a(s,v)===0||l(s,w,v),O=()=>m||S(),C=()=>!m||x();for(let _=u,k=u;_<=d;++_)b=t[_%o],!b.skip&&(v=c(b[r]),v!==w&&(m=l(v,i,s),p===null&&O()&&(p=a(v,i)===0?_:k),p!==null&&C()&&(g.push(Sy({start:p,end:_,loop:f,count:o,style:h})),p=null),k=_,w=v));return p!==null&&g.push(Sy({start:p,end:d,loop:f,count:o,style:h})),g}function Pb(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=Ab(r[i],e.points,t);s.length&&n.push(...s)}return n}function r5(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function i5(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function s5(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=r5(n,i,s,r);if(r===!0)return Cy(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return Cy(e,i5(n,o,l,c),n,t)}function Cy(e,t,n,r){return!r||!r.setContext||!n?t:o5(e,t,n,r)}function o5(e,t,n,r){const i=e._chart.getContext(),s=_y(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[];let u=s,d=t[0].start,f=d;function h(g,m,p,v){const b=a?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=b;for(;n[m%l].skip;)m+=b;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:v}),u=v,d=m%l)}}for(const g of t){d=a?d:g.start;let m=n[d%l],p;for(f=d+1;f<=g.end;f++){const v=n[f%l];p=_y(r.setContext(Xr(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),a5(p,u)&&h(d,f-1,g.loop,u),m=v,u=p}d<f-1&&h(d,f-1,g.loop,u)}return c}function _y(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function a5(e,t){if(!t)return!1;const n=[],r=function(i,s){return Tf(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function cl(e,t,n){return e.options.clip?e[n]:t[n]}function l5(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:cl(n,t,"left"),right:cl(n,t,"right"),top:cl(r,t,"top"),bottom:cl(r,t,"bottom")}:t}function Tb(e,t){const n=t._clip;if(n.disabled)return!1;const r=l5(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
60
|
+
*/function Yn(){}const LP=(()=>{let e=0;return()=>e++})();function Xe(e){return e==null}function lt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Fe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function vt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ln(e,t){return vt(e)?e:t}function De(e,t){return typeof e=="undefined"?t:e}const RP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function tt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ye(e,t,n,r){let i,s,o;if(lt(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(Fe(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function Yl(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Xl(e){if(lt(e))return e.map(Xl);if(Fe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Xl(e[n[i]]);return t}return e}function db(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function NP(e,t,n,r){if(!db(e))return;const i=t[e],s=n[e];Fe(i)&&Fe(s)?sa(i,s,r):t[e]=Xl(s)}function sa(e,t,n){const r=lt(t)?t:[t],i=r.length;if(!Fe(e))return e;n=n||{};const s=n.merger||NP;let o;for(let a=0;a<i;++a){if(o=r[a],!Fe(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],e,o,n)}return e}function No(e,t){return sa(e,t,{merger:FP})}function FP(e,t,n){if(!db(e))return;const r=t[e],i=n[e];Fe(r)&&Fe(i)?No(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Xl(i))}const ly={"":e=>e,x:e=>e.x,y:e=>e.y};function BP(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function qP(e){const t=BP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function oa(e,t){return(ly[t]||(ly[t]=qP(t)))(e)}function Ef(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Jl=e=>typeof e!="undefined",Wr=e=>typeof e=="function",cy=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function zP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ht=Math.PI,sn=2*ht,HP=sn+ht,Zl=Number.POSITIVE_INFINITY,UP=ht/180,rn=ht/2,ei=ht/4,uy=ht*2/3,fb=Math.log10,Ns=Math.sign;function Fo(e,t,n){return Math.abs(e-t)<n}function dy(e){const t=Math.round(e);e=Fo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(fb(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function KP(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,s)=>i-s).pop(),t}function WP(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function aa(e){return!WP(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function VP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function GP(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function Nr(e){return e*(ht/180)}function Af(e){return e*(180/ht)}function fy(e){if(!vt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function QP(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ht&&(s+=sn),{angle:s,distance:i}}function Pd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function YP(e,t){return(e-t+HP)%sn-ht}function en(e){return(e%sn+sn)%sn}function hb(e,t,n,r){const i=en(e),s=en(t),o=en(n),a=en(s-i),l=en(o-i),c=en(i-s),u=en(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function yn(e,t,n){return Math.max(t,Math.min(n,e))}function XP(e){return yn(e,-32768,32767)}function ns(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Pf(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const fi=(e,t,n,r)=>Pf(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),JP=(e,t,n)=>Pf(e,n,r=>e[r][t]>=n);function ZP(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const gb=["push","pop","shift","splice","unshift"];function eT(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),gb.forEach(n=>{const r="_onData"+Ef(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function hy(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(gb.forEach(s=>{delete e[s]}),delete e._chartjs)}function tT(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const yb=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function mb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,yb.call(window,()=>{r=!1,e.apply(t,n)}))}}function nT(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Tf=e=>e==="start"?"left":e==="end"?"right":"center",kt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,rT=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function iT(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:h,maxDefined:g}=o.getUserBounds();if(h){if(i=Math.min(fi(l,u,d).lo,n?r:fi(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(p=>!Xe(p[a.axis]));i-=Math.max(0,m)}i=yn(i,0,r-1)}if(g){let m=Math.max(fi(l,o.axis,f,!0).hi+1,n?0:fi(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const p=l.slice(m-1).findIndex(v=>!Xe(v[a.axis]));m+=Math.max(0,p)}s=yn(m,i,r)-i}else s=r-i}return{start:i,count:s}}function sT(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const ol=e=>e===0||e===1,gy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*sn/n)),yy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*sn/n)+1,Bo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*rn)+1,easeOutSine:e=>Math.sin(e*rn),easeInOutSine:e=>-.5*(Math.cos(ht*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ol(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ol(e)?e:gy(e,.075,.3),easeOutElastic:e=>ol(e)?e:yy(e,.075,.3),easeInOutElastic(e){return ol(e)?e:e<.5?.5*gy(e*2,.1125,.45):.5+.5*yy(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Bo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Bo.easeInBounce(e*2)*.5:Bo.easeOutBounce(e*2-1)*.5+.5};function jf(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function my(e){return jf(e)?e:new ia(e)}function _u(e){return jf(e)?e:new ia(e).saturate(.5).darken(.1).hexString()}const oT=["x","y","borderWidth","radius","tension"],aT=["color","borderColor","backgroundColor"];function lT(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:aT},numbers:{type:"number",properties:oT}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function cT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const py=new Map;function uT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=py.get(n);return r||(r=new Intl.NumberFormat(e,t),py.set(n,r)),r}function pb(e,t,n){return uT(t,n).format(e)}const dT={values(e){return lt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=fT(e,n)}const o=fb(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),pb(e,r,l)}};function fT(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Mf={formatters:dT};function hT(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Mf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ji=Object.create(null),Td=Object.create(null);function qo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function ku(e,t,n){return typeof t=="string"?sa(qo(e,t),n):sa(qo(e,""),t)}class gT{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>_u(i.backgroundColor),this.hoverBorderColor=(r,i)=>_u(i.borderColor),this.hoverColor=(r,i)=>_u(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return ku(this,t,n)}get(t){return qo(this,t)}describe(t,n){return ku(Td,t,n)}override(t,n){return ku(ji,t,n)}route(t,n,r,i){const s=qo(this,t),o=qo(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return Fe(l)?Object.assign({},c,l):De(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var dt=new gT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[lT,cT,hT]);function yT(e){return!e||Xe(e.size)||Xe(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ec(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function mT(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!lt(d))o=ec(e,i,s,o,d);else if(lt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!lt(f)&&(o=ec(e,i,s,o,f));e.restore();const h=s.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[s[l]];s.splice(0,h)}return o}function ti(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function vy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function jd(e,t,n,r){vb(e,t,n,r,null)}function vb(e,t,n,r,i){let s,o,a,l,c,u,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*UP;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(p),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,m,0,0,sn):e.arc(n,r,m,0,sn),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=uy,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=uy,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(p+ei)*l,d=Math.cos(p+ei)*(i?i/2-c:l),a=Math.sin(p+ei)*l,f=Math.sin(p+ei)*(i?i/2-c:l),e.arc(n-d,r-a,c,p-ht,p-rn),e.arc(n+f,r-o,c,p-rn,p),e.arc(n+d,r+a,c,p,p+rn),e.arc(n-f,r+o,c,p+rn,p+ht),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}p+=ei;case"rectRot":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-o),e.lineTo(n+d,r+a),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":p+=ei;case"cross":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),p+=ei,d=Math.cos(p)*(i?i/2:m),o=Math.cos(p)*m,a=Math.sin(p)*m,f=Math.sin(p)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(p)*m,a=Math.sin(p)*m,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(p)*(i?i/2:m),r+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ar(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ic(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Lc(e){e.restore()}function pT(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function vT(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function bT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Xe(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function xT(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function wT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Mi(e,t,n,r,i,s={}){const o=lt(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,bT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&wT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Xe(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),xT(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function tc(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ht,ht,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ht,rn,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,rn,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-rn,!0),e.lineTo(n+o.topLeft,r)}const ST=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,CT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _T(e,t){const n=(""+e).match(ST);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const kT=e=>+e||0;function bb(e,t){const n={},r=Fe(t),i=r?Object.keys(t):t,s=Fe(e)?r?o=>De(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=kT(s(o));return n}function OT(e){return bb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function rs(e){return bb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Tt(e){const t=OT(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function yt(e,t){e=e||{},t=t||dt.font;let n=De(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=De(e.style,t.style);r&&!(""+r).match(CT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:De(e.family,t.family),lineHeight:_T(De(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:De(e.weight,t.weight),string:""};return i.string=yT(i),i}function al(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function ET(e,t,n){const{min:r,max:i}=e,s=RP(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function Xr(e,t){return Object.assign(Object.create(e),t)}function $f(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=Cb("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>$f([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return wb(a,l,()=>IT(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return xy(a).includes(l)},ownKeys(a){return xy(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Fs(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:xb(e,r),setContext:s=>Fs(e,s,n,r),override:s=>Fs(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return wb(s,o,()=>PT(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function xb(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Wr(n)?n:()=>n,isIndexable:Wr(r)?r:()=>r}}const AT=(e,t)=>e?e+Ef(t):t,Df=(e,t)=>Fe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function wb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function PT(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return Wr(a)&&o.isScriptable(t)&&(a=TT(t,a,e,n)),lt(a)&&a.length&&(a=jT(t,a,e,o.isIndexable)),Df(t,a)&&(a=Fs(a,i,s&&s[t],o)),a}function TT(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),Df(e,l)&&(l=If(i._scopes,i,e,l)),l}function jT(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index!="undefined"&&r(e))return t[s.index%t.length];if(Fe(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=If(c,i,e,u);t.push(Fs(d,s,o&&o[e],a))}}return t}function Sb(e,t,n){return Wr(e)?e(t,n):e}const MT=(e,t)=>e===!0?t:typeof e=="string"?oa(t,e):void 0;function $T(e,t,n,r,i){for(const s of t){const o=MT(n,s);if(o){e.add(o);const a=Sb(o._fallback,n,i);if(typeof a!="undefined"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r!="undefined"&&n!==r)return null}return!1}function If(e,t,n,r){const i=t._rootScopes,s=Sb(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=by(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=by(a,o,s,l,r),l===null)?!1:$f(Array.from(a),[""],i,s,()=>DT(t,n,r))}function by(e,t,n,r,i){for(;n;)n=$T(e,t,n,r,i);return n}function DT(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return lt(i)&&Fe(n)?n:i||{}}function IT(e,t,n,r){let i;for(const s of t)if(i=Cb(AT(s,e),n),typeof i!="undefined")return Df(e,i)?If(n,r,e,i):i}function Cb(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function xy(e){let t=e._keys;return t||(t=e._keys=LT(e._scopes)),t}function LT(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function RT(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],o[a]={r:i.parse(oa(u,s),c)};return o}const NT=Number.EPSILON||1e-14,Bs=(e,t)=>t<e.length&&!e[t].skip&&e[t],_b=e=>e==="x"?"y":"x";function FT(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Pd(s,i),l=Pd(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:s.x-d*(o.x-i.x),y:s.y-d*(o.y-i.y)},next:{x:s.x+f*(o.x-i.x),y:s.y+f*(o.y-i.y)}}}function BT(e,t,n){const r=e.length;let i,s,o,a,l,c=Bs(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Bs(e,u+1),!(!l||!c)){if(Fo(t[u],0,NT)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],s=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=i*o*t[u],n[u+1]=s*o*t[u])}}function qT(e,t,n="x"){const r=_b(n),i=e.length;let s,o,a,l=Bs(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Bs(e,c+1),!a)continue;const u=a[n],d=a[r];o&&(s=(u-o[n])/3,a[`cp1${n}`]=u-s,a[`cp1${r}`]=d-s*t[c]),l&&(s=(l[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${r}`]=d+s*t[c])}}function zT(e,t="x"){const n=_b(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Bs(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Bs(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[n]-l[n])/u:0}s[o]=a?c?Ns(i[o-1])!==Ns(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}BT(e,i,s),qT(e,s,t)}function ll(e,t,n){return Math.max(Math.min(e,n),t)}function HT(e,t){let n,r,i,s,o,a=ar(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&ar(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=ll(i.cp1x,t.left,t.right),i.cp1y=ll(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ll(i.cp2x,t.left,t.right),i.cp2y=ll(i.cp2y,t.top,t.bottom)))}function UT(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zT(e,i);else{let c=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=FT(c,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&HT(e,n)}function Lf(){return typeof window!="undefined"&&typeof document!="undefined"}function Rf(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function nc(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Rc=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function KT(e,t){return Rc(e).getPropertyValue(t)}const WT=["top","right","bottom","left"];function Oi(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=WT[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const VT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function GT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(VT(i,s,e.target))a=i,l=s;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function oi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Rc(n),s=i.boxSizing==="border-box",o=Oi(i,"padding"),a=Oi(i,"border","width"),{x:l,y:c,box:u}=GT(e,n),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:h,height:g}=t;return s&&(h-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-f)/g*n.height/r)}}function QT(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Rf(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Rc(s),l=Oi(a,"border","width"),c=Oi(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=nc(a.maxWidth,s,"clientWidth"),i=nc(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Zl,maxHeight:i||Zl}}const cl=e=>Math.round(e*10)/10;function YT(e,t,n,r){const i=Rc(e),s=Oi(i,"margin"),o=nc(i.maxWidth,e,"clientWidth")||Zl,a=nc(i.maxHeight,e,"clientHeight")||Zl,l=QT(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Oi(i,"border","width"),h=Oi(i,"padding");c-=h.width+f.width,u-=h.height+f.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=cl(Math.min(c,o,l.maxWidth)),u=cl(Math.min(u,a,l.maxHeight)),c&&!u&&(u=cl(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=cl(Math.floor(u*r))),{width:c,height:u}}function wy(e,t,n){const r=t||1,i=Math.floor(e.height*r),s=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const XT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Lf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function Sy(e,t){const n=KT(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ai(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function JT(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function ZT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=ai(e,i,n),a=ai(i,s,n),l=ai(s,t,n),c=ai(o,a,n),u=ai(a,l,n);return ai(c,u,n)}const e5=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},t5=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function is(e,t,n){return e?e5(t,n):t5()}function kb(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Ob(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Eb(e){return e==="angle"?{between:hb,compare:YP,normalize:en}:{between:ns,compare:(t,n)=>t-n,normalize:t=>t}}function Cy({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function n5(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=Eb(r),l=t.length;let{start:c,end:u,loop:d}=e,f,h;if(d){for(c+=l,u+=l,f=0,h=l;f<h&&o(a(t[c%l][r]),i,s);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function Ab(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=Eb(r),{start:u,end:d,loop:f,style:h}=n5(e,t,n),g=[];let m=!1,p=null,v,b,w;const S=()=>l(i,w,v)&&a(i,w)!==0,x=()=>a(s,v)===0||l(s,w,v),O=()=>m||S(),C=()=>!m||x();for(let k=u,_=u;k<=d;++k)b=t[k%o],!b.skip&&(v=c(b[r]),v!==w&&(m=l(v,i,s),p===null&&O()&&(p=a(v,i)===0?k:_),p!==null&&C()&&(g.push(Cy({start:p,end:k,loop:f,count:o,style:h})),p=null),_=k,w=v));return p!==null&&g.push(Cy({start:p,end:d,loop:f,count:o,style:h})),g}function Pb(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=Ab(r[i],e.points,t);s.length&&n.push(...s)}return n}function r5(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function i5(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function s5(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=r5(n,i,s,r);if(r===!0)return _y(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return _y(e,i5(n,o,l,c),n,t)}function _y(e,t,n,r){return!r||!r.setContext||!n?t:o5(e,t,n,r)}function o5(e,t,n,r){const i=e._chart.getContext(),s=ky(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[];let u=s,d=t[0].start,f=d;function h(g,m,p,v){const b=a?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=b;for(;n[m%l].skip;)m+=b;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:v}),u=v,d=m%l)}}for(const g of t){d=a?d:g.start;let m=n[d%l],p;for(f=d+1;f<=g.end;f++){const v=n[f%l];p=ky(r.setContext(Xr(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),a5(p,u)&&h(d,f-1,g.loop,u),m=v,u=p}d<f-1&&h(d,f-1,g.loop,u)}return c}function ky(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function a5(e,t){if(!t)return!1;const n=[],r=function(i,s){return jf(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ul(e,t,n){return e.options.clip?e[n]:t[n]}function l5(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ul(n,t,"left"),right:ul(n,t,"right"),top:ul(r,t,"top"),bottom:ul(r,t,"bottom")}:t}function Tb(e,t){const n=t._clip;if(n.disabled)return!1;const r=l5(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
61
61
|
* Chart.js v4.5.0
|
|
62
62
|
* https://www.chartjs.org
|
|
63
63
|
* (c) 2025 Chart.js Contributors
|
|
64
64
|
* Released under the MIT License
|
|
65
|
-
*/class c5{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=yb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Zn=new c5;const ky="transparent",u5={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=yy(e||ky),i=r.valid&&yy(t||ky);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class d5{constructor(t,n,r,i){const s=n[r];i=ol([t.to,i,s,t.from]);const o=ol([t.from,s,i]);this._active=!0,this._fn=t.fn||u5[t.type||typeof o],this._easing=Bo[t.easing]||Bo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ol([t.to,n,i,t.from]),this._from=ol([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class jb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Fe(t))return;const n=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Fe(s))return;const o={};for(const a of n)o[a]=s[a];(lt(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=h5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&f5(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new d5(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Zn.add(this._chart,r),!0}}function f5(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function h5(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Oy(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function g5(e,t,n){if(n===!1)return!1;const r=Oy(e,n),i=Oy(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function y5(e){let t,n,r,i;return Fe(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Mb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Ey(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],vt(c)&&(s||t===0||Ns(t)===Ns(c))&&(t+=c)}return!u&&!r.all?0:t}function m5(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function Ou(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function p5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function v5(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function b5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Ay(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function Py(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=p5(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:p}=g,v=g._stacks||(g._stacks={});f=v[c]=b5(i,u,m),f[a]=p,f._top=Ay(f,o,!0,r.type),f._bottom=Ay(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Eu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function x5(e,t){return Xr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function w5(e,t,n){return Xr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ho(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Au=e=>e==="reset"||e==="none",Ty=(e,t)=>t?e:Object.assign({},e),S5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Mb(n,!0),values:null};class ss{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ou(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ho(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=De(r.xAxisID,Eu(t,"x")),o=n.yAxisID=De(r.yAxisID,Eu(t,"y")),a=n.rAxisID=De(r.rAxisID,Eu(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&fy(this._data,this),t._stacked&&ho(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Fe(n)){const i=this._cachedMeta;this._data=m5(n,i)}else if(r!==n){if(r){fy(r,this);const i=this._cachedMeta;ho(i),i._parsed=[]}n&&Object.isExtensible(n)&&eT(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Ou(n.vScale,n),n.stack!==r.stack&&(i=!0,ho(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Py(this,n._parsed),n._stacked=Ou(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{lt(i[t])?f=this.parseArrayData(r,i,t,n):Fe(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&Py(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(oa(h,a),f),y:o.parse(oa(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:Mb(i,!0),values:n._stacks[t.axis]._visualValues};return Ey(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Ey(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=S5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=v5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!vt(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],vt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=y5(De(this.options.clip,g5(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=w5(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=x5(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Xl(r);if(a)return Ty(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(dt.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Ty(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new jb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Au(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Au(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Au(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ho(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(ss,"defaults",{}),me(ss,"datasetElementType",null),me(ss,"dataElementType",null);class Pl extends ss{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=iT(n,i,o);this._drawStart=a,this._drawCount=l,sT(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=aa(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,w=t.length;let S=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const O=t[x],C=v?O:{};if(x<n||x>=b){C.skip=!0;continue}const _=this.getParsed(x),k=Xe(_[h]),E=C[f]=o.getPixelForValue(_[f],x),j=C[h]=s||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);C.skip=isNaN(E)||isNaN(j)||k,C.stop=x>0&&Math.abs(_[f]-S[f])>p,m&&(C.parsed=_,C.raw=c.data[x]),d&&(C.options=u||this.resolveDataElementOptions(x,O.active?"active":i)),v||this.updateElement(O,x,C,i),S=_}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}me(Pl,"id","line"),me(Pl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(Pl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Tl extends ss{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return RT.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}me(Tl,"id","radar"),me(Tl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),me(Tl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ni(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Rf{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Rf.prototype,t)}init(){}formats(){return ni()}parse(){return ni()}format(){return ni()}add(){return ni()}diff(){return ni()}startOf(){return ni()}endOf(){return ni()}}var C5={_date:Rf};function _5(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?JP:fi;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),h=c(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!Xe(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Xe(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Nc(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=_5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function k5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Pu(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Nc(e,n,t,function(a,l,c){!i&&!ar(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function O5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=QP(o,{x:t.x,y:t.y});hb(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Nc(e,n,t,s),i}function E5(e,t,n,r,i,s){let o=[];const a=k5(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:u,datasetIndex:d,index:f})}return Nc(e,n,t,c),o}function Tu(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?O5(e,t,n,i):E5(e,t,n,r,i,s)}function jy(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Nc(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var A5={modes:{index(e,t,n,r){const i=oi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Pu(e,i,s,r,o):Tu(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Pu(e,i,s,r,o):Tu(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Pu(e,i,s,r,o)},nearest(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Tu(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=oi(t,e);return jy(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=oi(t,e);return jy(e,i,"y",n.intersect,r)}}};const $b=["left","top","right","bottom"];function go(e,t){return e.filter(n=>n.pos===t)}function My(e,t){return e.filter(n=>$b.indexOf(n.pos)===-1&&n.box.axis===t)}function yo(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function P5(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function T5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!$b.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function j5(e,t){const n=T5(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function M5(e){const t=P5(e),n=yo(t.filter(c=>c.box.fullSize),!0),r=yo(go(t,"left"),!0),i=yo(go(t,"right")),s=yo(go(t,"top"),!0),o=yo(go(t,"bottom")),a=My(t,"x"),l=My(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:go(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function $y(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Db(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function $5(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Fe(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Db(o,s.getPadding());const a=Math.max(0,t.outerWidth-$y(o,e,"left","right")),l=Math.max(0,t.outerHeight-$y(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function D5(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function I5(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function Ao(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,I5(a.horizontal,t));const{same:d,other:f}=$5(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&Ao(i,t,n,r)||u}function ul(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Dy(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Xl(c.start)&&(o=c.start),l.fullSize?ul(l,i.left,o,n.outerWidth-i.right-i.left,f):ul(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Xl(c.start)&&(s=c.start),l.fullSize?ul(l,s,i.top,f,n.outerHeight-i.bottom-i.top):ul(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var yn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Tt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=M5(e.boxes),l=a.vertical,c=a.horizontal;Ye(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Db(f,Tt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=j5(l.concat(c),d);Ao(a.fullSize,h,d,g),Ao(l,h,d,g),Ao(c,h,d,g)&&Ao(l,h,d,g),D5(h),Dy(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Dy(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ye(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Ib{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class L5 extends Ib{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const jl="$chartjs",R5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Iy=e=>e===null||e==="";function N5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[jl]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Iy(i)){const s=wy(e,"width");s!==void 0&&(e.width=s)}if(Iy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=wy(e,"height");s!==void 0&&(e.height=s)}return e}const Lb=XT?{passive:!0}:!1;function F5(e,t,n){e&&e.addEventListener(t,n,Lb)}function B5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Lb)}function q5(e,t){const n=R5[e.type]||e.type,{x:r,y:i}=oi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function nc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function z5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nc(a.addedNodes,r),o=o&&!nc(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function H5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||nc(a.removedNodes,r),o=o&&!nc(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const la=new Map;let Ly=0;function Rb(){const e=window.devicePixelRatio;e!==Ly&&(Ly=e,la.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function U5(e,t){la.size||window.addEventListener("resize",Rb),la.set(e,t)}function K5(e){la.delete(e),la.size||window.removeEventListener("resize",Rb)}function W5(e,t,n){const r=e.canvas,i=r&&Lf(r);if(!i)return;const s=mb((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),U5(e,s),o}function ju(e,t,n){n&&n.disconnect(),t==="resize"&&K5(e)}function V5(e,t,n){const r=e.canvas,i=mb(s=>{e.ctx!==null&&n(q5(s,e))},e);return F5(r,t,i),i}class G5 extends Ib{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(N5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[jl])return!1;const r=n[jl].initial;["height","width"].forEach(s=>{const o=r[s];Xe(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[jl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:z5,detach:H5,resize:W5}[n]||V5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:ju,detach:ju,resize:ju}[n]||B5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return YT(t,n,r,i)}isAttached(t){const n=t&&Lf(t);return!!(n&&n.isConnected)}}function Q5(e){return!If()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?L5:G5}var wl;let qi=(wl=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return aa(this.x)&&aa(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},me(wl,"defaults",{}),me(wl,"defaultRoutes"),wl);function Y5(e,t){const n=e.options.ticks,r=X5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?Z5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return ej(t,c,s,o/i),c;const u=J5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(dl(t,c,u,Xe(h)?0:a-h,a),d=0,f=o-1;d<f;d++)dl(t,c,u,s[d],s[d+1]);return dl(t,c,u,l,Xe(h)?t.length:l+h),c}return dl(t,c,u),c}function X5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function J5(e,t,n){const r=tj(e),i=t.length/n;if(!r)return Math.max(i,1);const s=KP(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function Z5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function ej(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function dl(e,t,n,r,i){const s=De(r,0),o=Math.min(De(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function tj(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const nj=e=>e==="left"?"right":e==="right"?"left":e,Ry=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Ny=(e,t)=>Math.min(t||e,e);function Fy(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function rj(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function ij(e,t){Ye(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function mo(e){return e.drawTicks?e.tickLength:0}function By(e,t){if(!e.display)return 0;const n=yt(e.font,t),r=Tt(e.padding);return(lt(e.text)?e.text.length:1)*n.lineHeight+r.height}function sj(e,t){return Xr(e,{scale:t,type:"scale"})}function oj(e,t,n){return Xr(e,{tick:n,index:t,type:"tick"})}function aj(e,t,n){let r=Pf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=nj(r)),r}function lj(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=kt(r,s,a),Fe(n)){const v=Object.keys(n)[0],b=n[v];g=u[v].getPixelForValue(b)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=Ry(e,n,t);f=a-s}else{if(Fe(n)){const v=Object.keys(n)[0],b=n[v];h=u[v].getPixelForValue(b)-p+t}else n==="center"?h=(c.left+c.right)/2-p+t:h=Ry(e,n,t);g=kt(r,o,i),d=n==="left"?-rn:rn}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Ys extends qi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Ln(t,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),r=Ln(r,Number.POSITIVE_INFINITY),i=Ln(i,Number.NEGATIVE_INFINITY),{min:Ln(t,r),max:Ln(n,i),minDefined:vt(t),maxDefined:vt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Ln(n,Ln(r,n)),max:Ln(r,Ln(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ET(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Fy(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Y5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){tt(this.options.afterUpdate,[this])}beforeSetDimensions(){tt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=tt(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Ny(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=gn(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-mo(t.grid)-n.padding-By(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Ef(Math.min(Math.asin(gn((u.highest.height+6)/a,-1,1)),Math.asin(gn(l/c,-1,1))-Math.asin(gn(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=By(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=mo(s)+l):(t.height=this.maxHeight,t.width=mo(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Nr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,u,p,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Xe(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Fy(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Ny(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,w,S,x;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,w=S=0,!Xe(g)&&!lt(g))w=Zl(i,v.data,v.gc,w,g),S=b;else if(lt(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Xe(x)&&!lt(x)&&(w=Zl(i,v.data,v.gc,w,x),S+=b);o.push(w),a.push(S),c=Math.max(w,c),u=Math.max(S,u)}ij(s,n);const O=o.indexOf(c),C=a.indexOf(u),_=k=>({width:o[k]||0,height:a[k]||0});return{first:_(0),last:_(n-1),widest:_(O),highest:_(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return XP(this._alignToPixels?ti(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=oj(this.getContext(),t,r))}return this.$context||(this.$context=sj(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Nr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=mo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(I){return ti(r,I,m)};let b,w,S,x,O,C,_,k,E,j,D,z;if(o==="top")b=v(this.bottom),C=this.bottom-f,k=b-p,j=v(t.top)+p,z=t.bottom;else if(o==="bottom")b=v(this.top),j=t.top,z=v(t.bottom)-p,C=b+p,k=this.top+f;else if(o==="left")b=v(this.right),O=this.right-f,_=b-p,E=v(t.left)+p,D=t.right;else if(o==="right")b=v(this.left),E=t.left,D=v(t.right)-p,O=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Fe(o)){const I=Object.keys(o)[0],L=o[I];b=v(this.chart.scales[I].getPixelForValue(L))}j=t.top,z=t.bottom,C=b+p,k=C+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Fe(o)){const I=Object.keys(o)[0],L=o[I];b=v(this.chart.scales[I].getPixelForValue(L))}O=b-p,_=O-f,E=t.left,D=t.right}const N=De(i.ticks.maxTicksLimit,d),M=Math.max(1,Math.ceil(d/N));for(w=0;w<d;w+=M){const I=this.getContext(w),L=s.setContext(I),J=a.setContext(I),ce=L.lineWidth,F=L.color,V=J.dash||[],ie=J.dashOffset,ue=L.tickWidth,R=L.tickColor,oe=L.tickBorderDash||[],ne=L.tickBorderDashOffset;S=rj(this,w,l),S!==void 0&&(x=ti(r,S,ce),c?O=_=E=D=x:C=k=j=z=x,h.push({tx1:O,ty1:C,tx2:_,ty2:k,x1:E,y1:j,x2:D,y2:z,width:ce,color:F,borderDash:V,borderDashOffset:ie,tickWidth:ue,tickColor:R,tickBorderDash:oe,tickBorderDashOffset:ne}))}return this._ticksLength=d,this._borderValue=b,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=mo(r.grid),h=f+u,g=d?-u:h,m=-Nr(this.labelRotation),p=[];let v,b,w,S,x,O,C,_,k,E,j,D,z="middle";if(i==="top")O=this.bottom-g,C=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+g,C=this._getXAxisLabelAlignment();else if(i==="left"){const M=this._getYAxisLabelAlignment(f);C=M.textAlign,x=M.x}else if(i==="right"){const M=this._getYAxisLabelAlignment(f);C=M.textAlign,x=M.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+h;else if(Fe(i)){const M=Object.keys(i)[0],I=i[M];O=this.chart.scales[M].getPixelForValue(I)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Fe(i)){const M=Object.keys(i)[0],I=i[M];x=this.chart.scales[M].getPixelForValue(I)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?z="top":l==="end"&&(z="bottom"));const N=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){w=a[v],S=w.label;const M=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,k=this._resolveTickFontOptions(v),E=k.lineHeight,j=lt(S)?S.length:1;const I=j/2,L=M.color,J=M.textStrokeColor,ce=M.textStrokeWidth;let F=C;o?(x=_,C==="inner"&&(v===b-1?F=this.options.reverse?"left":"right":v===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?c==="near"||m!==0?D=-j*E+E/2:c==="center"?D=-N.highest.height/2-I*E+E:D=-N.highest.height+E/2:c==="near"||m!==0?D=E/2:c==="center"?D=N.highest.height/2-I*E:D=N.highest.height-j*E,d&&(D*=-1),m!==0&&!M.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(O=_,D=(1-j)*E/2);let V;if(M.showLabelBackdrop){const ie=Tt(M.backdropPadding),ue=N.heights[v],R=N.widths[v];let oe=D-ie.top,ne=0-ie.left;switch(z){case"middle":oe-=ue/2;break;case"bottom":oe-=ue;break}switch(C){case"center":ne-=R/2;break;case"right":ne-=R;break;case"inner":v===b-1?ne-=R:v>0&&(ne-=R/2);break}V={left:ne,top:oe,width:R+ie.width,height:ue+ie.height,color:M.backdropColor}}p.push({label:S,font:k,textOffset:D,options:{rotation:m,color:L,strokeColor:J,strokeWidth:ce,textAlign:F,textBaseline:z,translation:[x,O],backdrop:V}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Nr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=ti(t,this.left,o)-o/2,u=ti(t,this.right,a)+a/2,d=f=l):(d=ti(t,this.top,o)-o/2,f=ti(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ic(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Mi(r,c,0,u,l,a)}i&&Lc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=yt(r.font),o=Tt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Fe(n)?(l+=o.bottom,lt(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=lj(this,l,n,a);Mi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:aj(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=De(t.grid&&t.grid.z,-1),i=De(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ys.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return yt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class fl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;dj(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,cj(t,o,r),this.override&&dt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in dt[i]&&(delete dt[i][r],this.override&&delete ji[r])}}function cj(e,t,n){const r=sa(Object.create(null),[n?dt.get(n):{},dt.get(t),e.defaults]);dt.set(t,r),e.defaultRoutes&&uj(t,e.defaultRoutes),e.descriptors&&dt.describe(t,e.descriptors)}function uj(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");dt.route(s,i,l,a)})}function dj(e){return"id"in e&&"defaults"in e}class fj{constructor(){this.controllers=new fl(ss,"datasets",!0),this.elements=new fl(qi,"elements"),this.plugins=new fl(Object,"plugins"),this.scales=new fl(Ys,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Ye(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Of(t);tt(r["before"+i],[],r),n[t](r),tt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Fn=new fj;class hj{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(tt(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Xe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=De(r.options&&r.options.plugins,{}),s=gj(r);return i===!1&&!n?[]:mj(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function gj(e){const t={},n=[],r=Object.keys(Fn.plugins.items);for(let s=0;s<r.length;s++)n.push(Fn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function yj(e,t){return!t&&e===!1?null:e===!0?{}:e}function mj(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=yj(r[l],i);c!==null&&s.push({plugin:a,options:pj(e.config,{plugin:a,local:n[l]},c,o)})}return s}function pj(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function jd(e,t){const n=dt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function vj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function bj(e,t){return e===t?"_index_":"_value_"}function qy(e){if(e==="x"||e==="y"||e==="r")return e}function xj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Md(e,...t){if(qy(e))return e;for(const n of t){const r=n.axis||xj(n.position)||e.length>1&&qy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function zy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function wj(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return zy(e,"x",n[0])||zy(e,"y",n[0])}return{}}function Sj(e,t){const n=ji[e.type]||{scales:{}},r=t.scales||{},i=jd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Fe(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Md(o,a,wj(o,e),dt.scales[a.type]),c=bj(l,i),u=n.scales||{};s[o]=No(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||jd(a,t),u=(ji[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=vj(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),No(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];No(a,[dt.scales[a.type],dt.scale])}),s}function Nb(e){const t=e.options||(e.options={});t.plugins=De(t.plugins,{}),t.scales=Sj(e,t)}function Fb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Cj(e){return e=e||{},e.data=Fb(e.data),Nb(e),e}const Hy=new Map,Bb=new Set;function hl(e,t){let n=Hy.get(e);return n||(n=t(),Hy.set(e,n),Bb.add(n)),n}const po=(e,t,n)=>{const r=oa(t,n);r!==void 0&&e.add(r)};class _j{constructor(t){this._config=Cj(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Fb(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Nb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return hl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return hl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return hl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return hl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>po(l,t,d))),u.forEach(d=>po(l,i,d)),u.forEach(d=>po(l,ji[s]||{},d)),u.forEach(d=>po(l,dt,d)),u.forEach(d=>po(l,Pd,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Bb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ji[n]||{},dt.datasets[n]||{},{type:n},dt,Pd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Uy(this._resolverCache,t,i);let l=o;if(Oj(o,n)){s.$shared=!1,r=Wr(r)?r():r;const c=this.createResolver(t,r,a);l=Fs(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Uy(this._resolverCache,t,r);return Fe(n)?Fs(s,n,void 0,i):s}}function Uy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Mf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const kj=e=>Fe(e)&&Object.getOwnPropertyNames(e).some(t=>Wr(e[t]));function Oj(e,t){const{isScriptable:n,isIndexable:r}=xb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(Wr(a)||kj(a))||o&<(a))return!0}return!1}var Ej="4.5.0";const Aj=["top","bottom","left","right","chartArea"];function Ky(e,t){return e==="top"||e==="bottom"||Aj.indexOf(e)===-1&&t==="x"}function Wy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Vy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),tt(n&&n.onComplete,[e],t)}function Pj(e){const t=e.chart,n=t.options.animation;tt(n&&n.onProgress,[e],t)}function qb(e){return If()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ml={},Gy=e=>{const t=qb(e);return Object.values(Ml).filter(n=>n.canvas===t).pop()};function Tj(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function jj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var kr;let Fc=(kr=class{static register(...t){Fn.add(...t),Qy()}static unregister(...t){Fn.remove(...t),Qy()}constructor(t,n){const r=this.config=new _j(n),i=qb(t),s=Gy(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Q5(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LP(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new hj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nT(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Ml[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Zn.listen(this,"complete",Vy),Zn.listen(this,"progress",Pj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Xe(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Fn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return py(this.canvas,this.ctx),this}stop(){return Zn.stop(this),this}resize(t,n){Zn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,xy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),tt(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ye(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=Md(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ye(s,o=>{const a=o.options,l=a.id,c=Md(l,a),u=De(a.type,o.dtype);(a.position===void 0||Ky(a.position,c)!==Ky(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Fn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ye(i,(o,a)=>{o||delete r[a]}),Ye(r,o=>{yn.configure(this,o,o.options),yn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Wy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||jd(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Fn.getController(a),{datasetElementType:c,dataElementType:u}=dt.datasets[a];Object.assign(l,{dataElementType:Fn.getElement(u),datasetElementType:c&&Fn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Ye(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Ye(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Wy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ye(this.scales,t=>{yn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ly(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;Tj(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!ly(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;yn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ye(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Wr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Zn.has(this)?this.attached&&!Zn.running(this)&&Zn.start(this):(this.draw(),Vy({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=Tb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ic(n,i),t.controller.draw(),i&&Lc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ar(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=A5.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Xr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Xl(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Zn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),py(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ml[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};Ye(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ye(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ye(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Ql(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=zP(t),c=jj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,tt(s.onHover,[t,a,this],this),l&&tt(s.onClick,[t,a,this],this));const u=!Ql(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},me(kr,"defaults",dt),me(kr,"instances",Ml),me(kr,"overrides",ji),me(kr,"registry",Fn),me(kr,"version",Ej),me(kr,"getChart",Gy),kr);function Qy(){return Ye(Fc.instances,e=>e._plugins.invalidate())}function zb(e,t,n=t){e.lineCap=De(n.borderCapStyle,t.borderCapStyle),e.setLineDash(De(n.borderDash,t.borderDash)),e.lineDashOffset=De(n.borderDashOffset,t.borderDashOffset),e.lineJoin=De(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=De(n.borderWidth,t.borderWidth),e.strokeStyle=De(n.borderColor,t.borderColor)}function Mj(e,t,n){e.lineTo(n.x,n.y)}function $j(e){return e.stepped?pT:e.tension||e.cubicInterpolationMode==="monotone"?vT:Mj}function Hb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Dj(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Hb(i,n,r),u=$j(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(a+(f?c-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function Ij(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Hb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=S=>(o+(c?a-S:S))%s,w=()=>{m!==p&&(e.lineTo(u,p),e.lineTo(u,m),e.lineTo(u,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const S=h.x,x=h.y,O=S|0;O===g?(x<m?m=x:x>p&&(p=x),u=(d*u+S)/++d):(w(),e.lineTo(S,x),g=O,d=0,m=p=x),v=x}w()}function $d(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Ij:Dj}function Lj(e){return e.stepped?JT:e.tension||e.cubicInterpolationMode==="monotone"?ZT:ai}function Rj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),zb(e,t.options),e.stroke(i)}function Nj(e,t,n,r){const{segments:i,options:s}=t,o=$d(t);for(const a of i)zb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Fj=typeof Path2D=="function";function Bj(e,t,n,r){Fj&&!t.options.segment?Rj(e,t,n,r):Nj(e,t,n,r)}class Fr extends qi{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;UT(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=s5(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=Pb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Lj(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return $d(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=$d(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),Bj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(Fr,"id","line"),me(Fr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(Fr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class $l extends qi{constructor(n){super();me(this,"parsed");me(this,"skip");me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Yy(this,n,"x",r)}inYRange(n,r){return Yy(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!ar(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Td(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}me($l,"id","point"),me($l,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me($l,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function qj(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Bc(l,c,i);const u=Dd(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=Pb(t,u);for(const f of d){const h=Dd(n,s[f.start],s[f.end],f.loop),g=Ab(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Xy(u,h,"start",Math.max)},end:{[n]:Xy(u,h,"end",Math.min)}})}}return o}function Dd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=en(i),s=en(s)),{property:e,start:i,end:s}}function zj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Bc(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Bc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Xy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Ub(e,t){let n=[],r=!1;return lt(e)?(r=!0,n=e):n=zj(e,t),n.length?new Fr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Jy(e){return e&&e.fill!==!1}function Hj(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!vt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function Uj(e,t,n){const r=Gj(e);if(Fe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return vt(i)&&Math.floor(i)===i?Kj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Kj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Wj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Fe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Vj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Fe(e)?r=e.value:r=t.getBaseValue(),r}function Gj(e){const t=e.options,n=t.fill;let r=De(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Qj(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=Yj(t,n);a.push(Ub({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)Xj(i,o[u],a)}return new Fr({points:i,options:{}})}function Yj(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function Xj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=Jj(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Jj(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(ns(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class Kb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:sn},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function Zj(e){const{chart:t,fill:n,line:r}=e;if(vt(n))return eM(t,n);if(n==="stack")return Qj(e);if(n==="shape")return!0;const i=tM(e);return i instanceof Kb?i:Ub(i,r)}function eM(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function tM(e){return(e.scale||{}).getPointPositionForValue?rM(e):nM(e)}function nM(e){const{scale:t={},fill:n}=e,r=Wj(n,t);if(vt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function rM(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Vj(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Kb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Mu(e,t,n){const r=Zj(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:h=d}=u||{},g=i.getDatasetMeta(s),m=Tb(i,g);r&&o.points.length&&(Ic(e,n),iM(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Lc(e))}function iM(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(Zy(e,r,o.top),$u(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Zy(e,r,o.bottom)):c==="y"&&(em(e,r,o.left),$u(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),em(e,r,o.right),u=i)),$u(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Zy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Bc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function em(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Bc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function $u(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=qj(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=h,sM(e,o,a,g&&Dd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():tm(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||tm(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function sM(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function tm(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var oM={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Fr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Uj(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=Hj(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Mu(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Jy(s)&&Mu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Jy(r)||n.drawTime!=="beforeDatasetDraw"||Mu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const nm=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},aM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class rm extends qi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=yt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=nm(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:p,height:i},c[c.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:w}=lM(r,n,s,p,i);v>0&&h+w+2*a>u&&(d+=f+a,c.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:w},f=Math.max(f,b),h+=w+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=is(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=kt(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=kt(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=kt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=kt(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ic(t,this),this._draw(),Lc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=dt.color,l=is(t.rtl,this.left,this.width),c=yt(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=nm(o,d),v=function(O,C,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const k=De(_.lineWidth,1);if(i.fillStyle=De(_.fillStyle,a),i.lineCap=De(_.lineCap,"butt"),i.lineDashOffset=De(_.lineDashOffset,0),i.lineJoin=De(_.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=De(_.strokeStyle,a),i.setLineDash(De(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:k},j=l.xPlus(O,g/2),D=C+f;vb(i,E,j,D,o.pointStyleWidth&&g)}else{const E=C+Math.max((d-m)/2,0),j=l.leftForLtr(O,g),D=rs(_.borderRadius);i.beginPath(),Object.values(D).some(z=>z!==0)?ec(i,{x:j,y:E,w:g,h:m,radius:D}):i.rect(j,E,g,m),i.fill(),k!==0&&i.stroke()}i.restore()},b=function(O,C,_){Mi(i,_.text,O,C+p/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:kt(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:kt(s,this.top+S+u,this.bottom-n[0].height),line:0},kb(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((O,C)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const _=i.measureText(O.text).width,k=l.textAlign(O.textAlign||(O.textAlign=o.textAlign)),E=g+f+_;let j=h.x,D=h.y;l.setWidth(this.width),w?C>0&&j+E+u>this.right&&(D=h.y+=x,h.line++,j=h.x=kt(s,this.left+u,this.right-r[h.line])):C>0&&D+x>this.bottom&&(j=h.x=j+n[h.line].width+u,h.line++,D=h.y=kt(s,this.top+S+u,this.bottom-n[h.line].height));const z=l.x(j);if(v(z,D,O),j=rT(k,j+g+f,w?j+E:this.right,t.rtl),b(l.x(j),D,O),w)h.x+=E+u;else if(typeof O.text!="string"){const N=c.lineHeight;h.y+=Wb(O,N)+u}else h.y+=x}),Ob(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=yt(n.font),i=Tt(n.padding);if(!n.display)return;const s=is(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=kt(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+kt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=kt(a,d,d+f);o.textAlign=s.textAlign(Pf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Mi(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=yt(t.font),r=Tt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(ns(t,this.left,this.right)&&ns(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],ns(t,i.left,i.left+i.width)&&ns(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!dM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=aM(i,r);i&&!s&&tt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&tt(n.onHover,[t,r,this],this)}else r&&tt(n.onClick,[t,r,this],this)}}function lM(e,t,n,r,i){const s=cM(r,e,t,n),o=uM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function cM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function uM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Wb(t,n)),r}function Wb(e,t){const n=e.text?e.text.length:0;return t*n}function dM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var fM={id:"legend",_element:rm,start(e,t,n){const r=e.legend=new rm({ctx:e.ctx,options:n,chart:e});yn.configure(e,r,n),yn.addBox(e,r)},stop(e){yn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;yn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Tt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Vb extends qi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=lt(r.text)?r.text.length:1;this._padding=Tt(r.padding);const s=i*yt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=kt(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=kt(a,i,n),l=ht*-.5):(u=s-t,d=kt(a,n,i),l=ht*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=yt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Mi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Pf(n.align),textBaseline:"middle",translation:[o,a]})}}function hM(e,t){const n=new Vb({ctx:e.ctx,options:t,chart:e});yn.configure(e,n,t),yn.addBox(e,n),e.titleBlock=n}var gM={id:"title",_element:Vb,start(e,t,n){hM(e,n)},stop(e){const t=e.titleBlock;yn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;yn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Po={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Ad(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Nn(e,t){return t&&(lt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function er(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
65
|
+
*/class c5{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=yb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Zn=new c5;const Oy="transparent",u5={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=my(e||Oy),i=r.valid&&my(t||Oy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class d5{constructor(t,n,r,i){const s=n[r];i=al([t.to,i,s,t.from]);const o=al([t.from,s,i]);this._active=!0,this._fn=t.fn||u5[t.type||typeof o],this._easing=Bo[t.easing]||Bo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=al([t.to,n,i,t.from]),this._from=al([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class jb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Fe(t))return;const n=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Fe(s))return;const o={};for(const a of n)o[a]=s[a];(lt(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=h5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&f5(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new d5(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Zn.add(this._chart,r),!0}}function f5(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function h5(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Ey(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function g5(e,t,n){if(n===!1)return!1;const r=Ey(e,n),i=Ey(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function y5(e){let t,n,r,i;return Fe(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Mb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Ay(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],vt(c)&&(s||t===0||Ns(t)===Ns(c))&&(t+=c)}return!u&&!r.all?0:t}function m5(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function Ou(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function p5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function v5(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function b5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Py(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function Ty(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=p5(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:p}=g,v=g._stacks||(g._stacks={});f=v[c]=b5(i,u,m),f[a]=p,f._top=Py(f,o,!0,r.type),f._bottom=Py(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Eu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function x5(e,t){return Xr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function w5(e,t,n){return Xr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ho(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Au=e=>e==="reset"||e==="none",jy=(e,t)=>t?e:Object.assign({},e),S5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Mb(n,!0),values:null};class ss{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ou(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ho(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=De(r.xAxisID,Eu(t,"x")),o=n.yAxisID=De(r.yAxisID,Eu(t,"y")),a=n.rAxisID=De(r.rAxisID,Eu(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&hy(this._data,this),t._stacked&&ho(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Fe(n)){const i=this._cachedMeta;this._data=m5(n,i)}else if(r!==n){if(r){hy(r,this);const i=this._cachedMeta;ho(i),i._parsed=[]}n&&Object.isExtensible(n)&&eT(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Ou(n.vScale,n),n.stack!==r.stack&&(i=!0,ho(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Ty(this,n._parsed),n._stacked=Ou(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{lt(i[t])?f=this.parseArrayData(r,i,t,n):Fe(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&Ty(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(oa(h,a),f),y:o.parse(oa(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:Mb(i,!0),values:n._stacks[t.axis]._visualValues};return Ay(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Ay(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=S5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=v5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!vt(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],vt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=y5(De(this.options.clip,g5(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=w5(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=x5(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Jl(r);if(a)return jy(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(dt.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(jy(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new jb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Au(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Au(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Au(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ho(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(ss,"defaults",{}),me(ss,"datasetElementType",null),me(ss,"dataElementType",null);class Tl extends ss{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=iT(n,i,o);this._drawStart=a,this._drawCount=l,sT(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=aa(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,w=t.length;let S=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const O=t[x],C=v?O:{};if(x<n||x>=b){C.skip=!0;continue}const k=this.getParsed(x),_=Xe(k[h]),A=C[f]=o.getPixelForValue(k[f],x),D=C[h]=s||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[h],x);C.skip=isNaN(A)||isNaN(D)||_,C.stop=x>0&&Math.abs(k[f]-S[f])>p,m&&(C.parsed=k,C.raw=c.data[x]),d&&(C.options=u||this.resolveDataElementOptions(x,O.active?"active":i)),v||this.updateElement(O,x,C,i),S=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}me(Tl,"id","line"),me(Tl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(Tl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class jl extends ss{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return RT.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}me(jl,"id","radar"),me(jl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),me(jl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ni(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Nf{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Nf.prototype,t)}init(){}formats(){return ni()}parse(){return ni()}format(){return ni()}add(){return ni()}diff(){return ni()}startOf(){return ni()}endOf(){return ni()}}var C5={_date:Nf};function _5(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?JP:fi;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),h=c(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!Xe(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Xe(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Nc(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=_5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function k5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Pu(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Nc(e,n,t,function(a,l,c){!i&&!ar(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function O5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=QP(o,{x:t.x,y:t.y});hb(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Nc(e,n,t,s),i}function E5(e,t,n,r,i,s){let o=[];const a=k5(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:u,datasetIndex:d,index:f})}return Nc(e,n,t,c),o}function Tu(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?O5(e,t,n,i):E5(e,t,n,r,i,s)}function My(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Nc(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var A5={modes:{index(e,t,n,r){const i=oi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Pu(e,i,s,r,o):Tu(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Pu(e,i,s,r,o):Tu(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Pu(e,i,s,r,o)},nearest(e,t,n,r){const i=oi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Tu(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=oi(t,e);return My(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=oi(t,e);return My(e,i,"y",n.intersect,r)}}};const $b=["left","top","right","bottom"];function go(e,t){return e.filter(n=>n.pos===t)}function $y(e,t){return e.filter(n=>$b.indexOf(n.pos)===-1&&n.box.axis===t)}function yo(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function P5(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function T5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!$b.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function j5(e,t){const n=T5(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function M5(e){const t=P5(e),n=yo(t.filter(c=>c.box.fullSize),!0),r=yo(go(t,"left"),!0),i=yo(go(t,"right")),s=yo(go(t,"top"),!0),o=yo(go(t,"bottom")),a=$y(t,"x"),l=$y(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:go(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Dy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Db(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function $5(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Fe(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Db(o,s.getPadding());const a=Math.max(0,t.outerWidth-Dy(o,e,"left","right")),l=Math.max(0,t.outerHeight-Dy(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function D5(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function I5(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function Ao(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,I5(a.horizontal,t));const{same:d,other:f}=$5(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&Ao(i,t,n,r)||u}function dl(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Iy(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Jl(c.start)&&(o=c.start),l.fullSize?dl(l,i.left,o,n.outerWidth-i.right-i.left,f):dl(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Jl(c.start)&&(s=c.start),l.fullSize?dl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):dl(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var mn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Tt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=M5(e.boxes),l=a.vertical,c=a.horizontal;Ye(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Db(f,Tt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=j5(l.concat(c),d);Ao(a.fullSize,h,d,g),Ao(l,h,d,g),Ao(c,h,d,g)&&Ao(l,h,d,g),D5(h),Iy(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Iy(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ye(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Ib{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class L5 extends Ib{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ml="$chartjs",R5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ly=e=>e===null||e==="";function N5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Ml]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ly(i)){const s=Sy(e,"width");s!==void 0&&(e.width=s)}if(Ly(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Sy(e,"height");s!==void 0&&(e.height=s)}return e}const Lb=XT?{passive:!0}:!1;function F5(e,t,n){e&&e.addEventListener(t,n,Lb)}function B5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Lb)}function q5(e,t){const n=R5[e.type]||e.type,{x:r,y:i}=oi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function rc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function z5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||rc(a.addedNodes,r),o=o&&!rc(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function H5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||rc(a.removedNodes,r),o=o&&!rc(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const la=new Map;let Ry=0;function Rb(){const e=window.devicePixelRatio;e!==Ry&&(Ry=e,la.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function U5(e,t){la.size||window.addEventListener("resize",Rb),la.set(e,t)}function K5(e){la.delete(e),la.size||window.removeEventListener("resize",Rb)}function W5(e,t,n){const r=e.canvas,i=r&&Rf(r);if(!i)return;const s=mb((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),U5(e,s),o}function ju(e,t,n){n&&n.disconnect(),t==="resize"&&K5(e)}function V5(e,t,n){const r=e.canvas,i=mb(s=>{e.ctx!==null&&n(q5(s,e))},e);return F5(r,t,i),i}class G5 extends Ib{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(N5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Ml])return!1;const r=n[Ml].initial;["height","width"].forEach(s=>{const o=r[s];Xe(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Ml],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:z5,detach:H5,resize:W5}[n]||V5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:ju,detach:ju,resize:ju}[n]||B5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return YT(t,n,r,i)}isAttached(t){const n=t&&Rf(t);return!!(n&&n.isConnected)}}function Q5(e){return!Lf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?L5:G5}var Sl;let qi=(Sl=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return aa(this.x)&&aa(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},me(Sl,"defaults",{}),me(Sl,"defaultRoutes"),Sl);function Y5(e,t){const n=e.options.ticks,r=X5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?Z5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return ej(t,c,s,o/i),c;const u=J5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(fl(t,c,u,Xe(h)?0:a-h,a),d=0,f=o-1;d<f;d++)fl(t,c,u,s[d],s[d+1]);return fl(t,c,u,l,Xe(h)?t.length:l+h),c}return fl(t,c,u),c}function X5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function J5(e,t,n){const r=tj(e),i=t.length/n;if(!r)return Math.max(i,1);const s=KP(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function Z5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function ej(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function fl(e,t,n,r,i){const s=De(r,0),o=Math.min(De(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function tj(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const nj=e=>e==="left"?"right":e==="right"?"left":e,Ny=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Fy=(e,t)=>Math.min(t||e,e);function By(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function rj(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function ij(e,t){Ye(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function mo(e){return e.drawTicks?e.tickLength:0}function qy(e,t){if(!e.display)return 0;const n=yt(e.font,t),r=Tt(e.padding);return(lt(e.text)?e.text.length:1)*n.lineHeight+r.height}function sj(e,t){return Xr(e,{scale:t,type:"scale"})}function oj(e,t,n){return Xr(e,{tick:n,index:t,type:"tick"})}function aj(e,t,n){let r=Tf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=nj(r)),r}function lj(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=kt(r,s,a),Fe(n)){const v=Object.keys(n)[0],b=n[v];g=u[v].getPixelForValue(b)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=Ny(e,n,t);f=a-s}else{if(Fe(n)){const v=Object.keys(n)[0],b=n[v];h=u[v].getPixelForValue(b)-p+t}else n==="center"?h=(c.left+c.right)/2-p+t:h=Ny(e,n,t);g=kt(r,o,i),d=n==="left"?-rn:rn}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Ys extends qi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Ln(t,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),r=Ln(r,Number.POSITIVE_INFINITY),i=Ln(i,Number.NEGATIVE_INFINITY),{min:Ln(t,r),max:Ln(n,i),minDefined:vt(t),maxDefined:vt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Ln(n,Ln(r,n)),max:Ln(r,Ln(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ET(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?By(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Y5(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){tt(this.options.afterUpdate,[this])}beforeSetDimensions(){tt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=tt(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Fy(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=yn(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-mo(t.grid)-n.padding-qy(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Af(Math.min(Math.asin(yn((u.highest.height+6)/a,-1,1)),Math.asin(yn(l/c,-1,1))-Math.asin(yn(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=qy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=mo(s)+l):(t.height=this.maxHeight,t.width=mo(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Nr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,u,p,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Xe(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=By(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Fy(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,w,S,x;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,w=S=0,!Xe(g)&&!lt(g))w=ec(i,v.data,v.gc,w,g),S=b;else if(lt(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Xe(x)&&!lt(x)&&(w=ec(i,v.data,v.gc,w,x),S+=b);o.push(w),a.push(S),c=Math.max(w,c),u=Math.max(S,u)}ij(s,n);const O=o.indexOf(c),C=a.indexOf(u),k=_=>({width:o[_]||0,height:a[_]||0});return{first:k(0),last:k(n-1),widest:k(O),highest:k(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return XP(this._alignToPixels?ti(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=oj(this.getContext(),t,r))}return this.$context||(this.$context=sj(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Nr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=mo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function($){return ti(r,$,m)};let b,w,S,x,O,C,k,_,A,D,I,z;if(o==="top")b=v(this.bottom),C=this.bottom-f,_=b-p,D=v(t.top)+p,z=t.bottom;else if(o==="bottom")b=v(this.top),D=t.top,z=v(t.bottom)-p,C=b+p,_=this.top+f;else if(o==="left")b=v(this.right),O=this.right-f,k=b-p,A=v(t.left)+p,I=t.right;else if(o==="right")b=v(this.left),A=t.left,I=v(t.right)-p,O=b+p,k=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Fe(o)){const $=Object.keys(o)[0],L=o[$];b=v(this.chart.scales[$].getPixelForValue(L))}D=t.top,z=t.bottom,C=b+p,_=C+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Fe(o)){const $=Object.keys(o)[0],L=o[$];b=v(this.chart.scales[$].getPixelForValue(L))}O=b-p,k=O-f,A=t.left,I=t.right}const N=De(i.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/N));for(w=0;w<d;w+=T){const $=this.getContext(w),L=s.setContext($),Z=a.setContext($),ue=L.lineWidth,F=L.color,V=Z.dash||[],re=Z.dashOffset,se=L.tickWidth,R=L.tickColor,ae=L.tickBorderDash||[],ne=L.tickBorderDashOffset;S=rj(this,w,l),S!==void 0&&(x=ti(r,S,ue),c?O=k=A=I=x:C=_=D=z=x,h.push({tx1:O,ty1:C,tx2:k,ty2:_,x1:A,y1:D,x2:I,y2:z,width:ue,color:F,borderDash:V,borderDashOffset:re,tickWidth:se,tickColor:R,tickBorderDash:ae,tickBorderDashOffset:ne}))}return this._ticksLength=d,this._borderValue=b,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=mo(r.grid),h=f+u,g=d?-u:h,m=-Nr(this.labelRotation),p=[];let v,b,w,S,x,O,C,k,_,A,D,I,z="middle";if(i==="top")O=this.bottom-g,C=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+g,C=this._getXAxisLabelAlignment();else if(i==="left"){const T=this._getYAxisLabelAlignment(f);C=T.textAlign,x=T.x}else if(i==="right"){const T=this._getYAxisLabelAlignment(f);C=T.textAlign,x=T.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+h;else if(Fe(i)){const T=Object.keys(i)[0],$=i[T];O=this.chart.scales[T].getPixelForValue($)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Fe(i)){const T=Object.keys(i)[0],$=i[T];x=this.chart.scales[T].getPixelForValue($)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?z="top":l==="end"&&(z="bottom"));const N=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){w=a[v],S=w.label;const T=s.setContext(this.getContext(v));k=this.getPixelForTick(v)+s.labelOffset,_=this._resolveTickFontOptions(v),A=_.lineHeight,D=lt(S)?S.length:1;const $=D/2,L=T.color,Z=T.textStrokeColor,ue=T.textStrokeWidth;let F=C;o?(x=k,C==="inner"&&(v===b-1?F=this.options.reverse?"left":"right":v===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?c==="near"||m!==0?I=-D*A+A/2:c==="center"?I=-N.highest.height/2-$*A+A:I=-N.highest.height+A/2:c==="near"||m!==0?I=A/2:c==="center"?I=N.highest.height/2-$*A:I=N.highest.height-D*A,d&&(I*=-1),m!==0&&!T.showLabelBackdrop&&(x+=A/2*Math.sin(m))):(O=k,I=(1-D)*A/2);let V;if(T.showLabelBackdrop){const re=Tt(T.backdropPadding),se=N.heights[v],R=N.widths[v];let ae=I-re.top,ne=0-re.left;switch(z){case"middle":ae-=se/2;break;case"bottom":ae-=se;break}switch(C){case"center":ne-=R/2;break;case"right":ne-=R;break;case"inner":v===b-1?ne-=R:v>0&&(ne-=R/2);break}V={left:ne,top:ae,width:R+re.width,height:se+re.height,color:T.backdropColor}}p.push({label:S,font:_,textOffset:I,options:{rotation:m,color:L,strokeColor:Z,strokeWidth:ue,textAlign:F,textBaseline:z,translation:[x,O],backdrop:V}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Nr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=ti(t,this.left,o)-o/2,u=ti(t,this.right,a)+a/2,d=f=l):(d=ti(t,this.top,o)-o/2,f=ti(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ic(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Mi(r,c,0,u,l,a)}i&&Lc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=yt(r.font),o=Tt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Fe(n)?(l+=o.bottom,lt(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=lj(this,l,n,a);Mi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:aj(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=De(t.grid&&t.grid.z,-1),i=De(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ys.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return yt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class hl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;dj(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,cj(t,o,r),this.override&&dt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in dt[i]&&(delete dt[i][r],this.override&&delete ji[r])}}function cj(e,t,n){const r=sa(Object.create(null),[n?dt.get(n):{},dt.get(t),e.defaults]);dt.set(t,r),e.defaultRoutes&&uj(t,e.defaultRoutes),e.descriptors&&dt.describe(t,e.descriptors)}function uj(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");dt.route(s,i,l,a)})}function dj(e){return"id"in e&&"defaults"in e}class fj{constructor(){this.controllers=new hl(ss,"datasets",!0),this.elements=new hl(qi,"elements"),this.plugins=new hl(Object,"plugins"),this.scales=new hl(Ys,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Ye(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Ef(t);tt(r["before"+i],[],r),n[t](r),tt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Fn=new fj;class hj{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(tt(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Xe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=De(r.options&&r.options.plugins,{}),s=gj(r);return i===!1&&!n?[]:mj(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function gj(e){const t={},n=[],r=Object.keys(Fn.plugins.items);for(let s=0;s<r.length;s++)n.push(Fn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function yj(e,t){return!t&&e===!1?null:e===!0?{}:e}function mj(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=yj(r[l],i);c!==null&&s.push({plugin:a,options:pj(e.config,{plugin:a,local:n[l]},c,o)})}return s}function pj(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Md(e,t){const n=dt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function vj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function bj(e,t){return e===t?"_index_":"_value_"}function zy(e){if(e==="x"||e==="y"||e==="r")return e}function xj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function $d(e,...t){if(zy(e))return e;for(const n of t){const r=n.axis||xj(n.position)||e.length>1&&zy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Hy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function wj(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Hy(e,"x",n[0])||Hy(e,"y",n[0])}return{}}function Sj(e,t){const n=ji[e.type]||{scales:{}},r=t.scales||{},i=Md(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Fe(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=$d(o,a,wj(o,e),dt.scales[a.type]),c=bj(l,i),u=n.scales||{};s[o]=No(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Md(a,t),u=(ji[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=vj(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),No(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];No(a,[dt.scales[a.type],dt.scale])}),s}function Nb(e){const t=e.options||(e.options={});t.plugins=De(t.plugins,{}),t.scales=Sj(e,t)}function Fb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Cj(e){return e=e||{},e.data=Fb(e.data),Nb(e),e}const Uy=new Map,Bb=new Set;function gl(e,t){let n=Uy.get(e);return n||(n=t(),Uy.set(e,n),Bb.add(n)),n}const po=(e,t,n)=>{const r=oa(t,n);r!==void 0&&e.add(r)};class _j{constructor(t){this._config=Cj(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Fb(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Nb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return gl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return gl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return gl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return gl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>po(l,t,d))),u.forEach(d=>po(l,i,d)),u.forEach(d=>po(l,ji[s]||{},d)),u.forEach(d=>po(l,dt,d)),u.forEach(d=>po(l,Td,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Bb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ji[n]||{},dt.datasets[n]||{},{type:n},dt,Td]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Ky(this._resolverCache,t,i);let l=o;if(Oj(o,n)){s.$shared=!1,r=Wr(r)?r():r;const c=this.createResolver(t,r,a);l=Fs(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Ky(this._resolverCache,t,r);return Fe(n)?Fs(s,n,void 0,i):s}}function Ky(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:$f(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const kj=e=>Fe(e)&&Object.getOwnPropertyNames(e).some(t=>Wr(e[t]));function Oj(e,t){const{isScriptable:n,isIndexable:r}=xb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(Wr(a)||kj(a))||o&<(a))return!0}return!1}var Ej="4.5.0";const Aj=["top","bottom","left","right","chartArea"];function Wy(e,t){return e==="top"||e==="bottom"||Aj.indexOf(e)===-1&&t==="x"}function Vy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Gy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),tt(n&&n.onComplete,[e],t)}function Pj(e){const t=e.chart,n=t.options.animation;tt(n&&n.onProgress,[e],t)}function qb(e){return Lf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $l={},Qy=e=>{const t=qb(e);return Object.values($l).filter(n=>n.canvas===t).pop()};function Tj(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function jj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var kr;let Fc=(kr=class{static register(...t){Fn.add(...t),Yy()}static unregister(...t){Fn.remove(...t),Yy()}constructor(t,n){const r=this.config=new _j(n),i=qb(t),s=Qy(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Q5(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LP(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new hj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nT(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],$l[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Zn.listen(this,"complete",Gy),Zn.listen(this,"progress",Pj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Xe(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Fn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vy(this.canvas,this.ctx),this}stop(){return Zn.stop(this),this}resize(t,n){Zn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,wy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),tt(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ye(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=$d(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ye(s,o=>{const a=o.options,l=a.id,c=$d(l,a),u=De(a.type,o.dtype);(a.position===void 0||Wy(a.position,c)!==Wy(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Fn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ye(i,(o,a)=>{o||delete r[a]}),Ye(r,o=>{mn.configure(this,o,o.options),mn.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Vy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||Md(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Fn.getController(a),{datasetElementType:c,dataElementType:u}=dt.datasets[a];Object.assign(l,{dataElementType:Fn.getElement(u),datasetElementType:c&&Fn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Ye(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Ye(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Vy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ye(this.scales,t=>{mn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!cy(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;Tj(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!cy(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ye(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Wr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Zn.has(this)?this.attached&&!Zn.running(this)&&Zn.start(this):(this.draw(),Gy({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=Tb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ic(n,i),t.controller.draw(),i&&Lc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ar(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=A5.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Xr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Jl(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Zn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),vy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete $l[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};Ye(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ye(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ye(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Yl(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=zP(t),c=jj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,tt(s.onHover,[t,a,this],this),l&&tt(s.onClick,[t,a,this],this));const u=!Yl(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},me(kr,"defaults",dt),me(kr,"instances",$l),me(kr,"overrides",ji),me(kr,"registry",Fn),me(kr,"version",Ej),me(kr,"getChart",Qy),kr);function Yy(){return Ye(Fc.instances,e=>e._plugins.invalidate())}function zb(e,t,n=t){e.lineCap=De(n.borderCapStyle,t.borderCapStyle),e.setLineDash(De(n.borderDash,t.borderDash)),e.lineDashOffset=De(n.borderDashOffset,t.borderDashOffset),e.lineJoin=De(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=De(n.borderWidth,t.borderWidth),e.strokeStyle=De(n.borderColor,t.borderColor)}function Mj(e,t,n){e.lineTo(n.x,n.y)}function $j(e){return e.stepped?pT:e.tension||e.cubicInterpolationMode==="monotone"?vT:Mj}function Hb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Dj(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Hb(i,n,r),u=$j(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(a+(f?c-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function Ij(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Hb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=S=>(o+(c?a-S:S))%s,w=()=>{m!==p&&(e.lineTo(u,p),e.lineTo(u,m),e.lineTo(u,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const S=h.x,x=h.y,O=S|0;O===g?(x<m?m=x:x>p&&(p=x),u=(d*u+S)/++d):(w(),e.lineTo(S,x),g=O,d=0,m=p=x),v=x}w()}function Dd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Ij:Dj}function Lj(e){return e.stepped?JT:e.tension||e.cubicInterpolationMode==="monotone"?ZT:ai}function Rj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),zb(e,t.options),e.stroke(i)}function Nj(e,t,n,r){const{segments:i,options:s}=t,o=Dd(t);for(const a of i)zb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Fj=typeof Path2D=="function";function Bj(e,t,n,r){Fj&&!t.options.segment?Rj(e,t,n,r):Nj(e,t,n,r)}class Fr extends qi{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;UT(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=s5(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=Pb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Lj(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Dd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Dd(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),Bj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(Fr,"id","line"),me(Fr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(Fr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Dl extends qi{constructor(n){super();me(this,"parsed");me(this,"skip");me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Xy(this,n,"x",r)}inYRange(n,r){return Xy(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!ar(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,jd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}me(Dl,"id","point"),me(Dl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(Dl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function qj(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Bc(l,c,i);const u=Id(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=Pb(t,u);for(const f of d){const h=Id(n,s[f.start],s[f.end],f.loop),g=Ab(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Jy(u,h,"start",Math.max)},end:{[n]:Jy(u,h,"end",Math.min)}})}}return o}function Id(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=en(i),s=en(s)),{property:e,start:i,end:s}}function zj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Bc(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Bc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Jy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Ub(e,t){let n=[],r=!1;return lt(e)?(r=!0,n=e):n=zj(e,t),n.length?new Fr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Zy(e){return e&&e.fill!==!1}function Hj(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!vt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function Uj(e,t,n){const r=Gj(e);if(Fe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return vt(i)&&Math.floor(i)===i?Kj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Kj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Wj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Fe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Vj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Fe(e)?r=e.value:r=t.getBaseValue(),r}function Gj(e){const t=e.options,n=t.fill;let r=De(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Qj(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=Yj(t,n);a.push(Ub({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)Xj(i,o[u],a)}return new Fr({points:i,options:{}})}function Yj(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function Xj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=Jj(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Jj(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(ns(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class Kb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:sn},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function Zj(e){const{chart:t,fill:n,line:r}=e;if(vt(n))return eM(t,n);if(n==="stack")return Qj(e);if(n==="shape")return!0;const i=tM(e);return i instanceof Kb?i:Ub(i,r)}function eM(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function tM(e){return(e.scale||{}).getPointPositionForValue?rM(e):nM(e)}function nM(e){const{scale:t={},fill:n}=e,r=Wj(n,t);if(vt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function rM(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Vj(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Kb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Mu(e,t,n){const r=Zj(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:h=d}=u||{},g=i.getDatasetMeta(s),m=Tb(i,g);r&&o.points.length&&(Ic(e,n),iM(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Lc(e))}function iM(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(em(e,r,o.top),$u(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),em(e,r,o.bottom)):c==="y"&&(tm(e,r,o.left),$u(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),tm(e,r,o.right),u=i)),$u(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function em(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Bc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function tm(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Bc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function $u(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=qj(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=h,sM(e,o,a,g&&Id(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():nm(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||nm(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function sM(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function nm(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var oM={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Fr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Uj(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=Hj(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&Mu(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Zy(s)&&Mu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Zy(r)||n.drawTime!=="beforeDatasetDraw"||Mu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const rm=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},aM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class im extends qi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=yt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=rm(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:p,height:i},c[c.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:w}=lM(r,n,s,p,i);v>0&&h+w+2*a>u&&(d+=f+a,c.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:w},f=Math.max(f,b),h+=w+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=is(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=kt(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=kt(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=kt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=kt(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ic(t,this),this._draw(),Lc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=dt.color,l=is(t.rtl,this.left,this.width),c=yt(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=rm(o,d),v=function(O,C,k){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const _=De(k.lineWidth,1);if(i.fillStyle=De(k.fillStyle,a),i.lineCap=De(k.lineCap,"butt"),i.lineDashOffset=De(k.lineDashOffset,0),i.lineJoin=De(k.lineJoin,"miter"),i.lineWidth=_,i.strokeStyle=De(k.strokeStyle,a),i.setLineDash(De(k.lineDash,[])),o.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:_},D=l.xPlus(O,g/2),I=C+f;vb(i,A,D,I,o.pointStyleWidth&&g)}else{const A=C+Math.max((d-m)/2,0),D=l.leftForLtr(O,g),I=rs(k.borderRadius);i.beginPath(),Object.values(I).some(z=>z!==0)?tc(i,{x:D,y:A,w:g,h:m,radius:I}):i.rect(D,A,g,m),i.fill(),_!==0&&i.stroke()}i.restore()},b=function(O,C,k){Mi(i,k.text,O,C+p/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:kt(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:kt(s,this.top+S+u,this.bottom-n[0].height),line:0},kb(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((O,C)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const k=i.measureText(O.text).width,_=l.textAlign(O.textAlign||(O.textAlign=o.textAlign)),A=g+f+k;let D=h.x,I=h.y;l.setWidth(this.width),w?C>0&&D+A+u>this.right&&(I=h.y+=x,h.line++,D=h.x=kt(s,this.left+u,this.right-r[h.line])):C>0&&I+x>this.bottom&&(D=h.x=D+n[h.line].width+u,h.line++,I=h.y=kt(s,this.top+S+u,this.bottom-n[h.line].height));const z=l.x(D);if(v(z,I,O),D=rT(_,D+g+f,w?D+A:this.right,t.rtl),b(l.x(D),I,O),w)h.x+=A+u;else if(typeof O.text!="string"){const N=c.lineHeight;h.y+=Wb(O,N)+u}else h.y+=x}),Ob(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=yt(n.font),i=Tt(n.padding);if(!n.display)return;const s=is(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=kt(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+kt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=kt(a,d,d+f);o.textAlign=s.textAlign(Tf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Mi(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=yt(t.font),r=Tt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(ns(t,this.left,this.right)&&ns(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],ns(t,i.left,i.left+i.width)&&ns(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!dM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=aM(i,r);i&&!s&&tt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&tt(n.onHover,[t,r,this],this)}else r&&tt(n.onClick,[t,r,this],this)}}function lM(e,t,n,r,i){const s=cM(r,e,t,n),o=uM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function cM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function uM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Wb(t,n)),r}function Wb(e,t){const n=e.text?e.text.length:0;return t*n}function dM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var fM={id:"legend",_element:im,start(e,t,n){const r=e.legend=new im({ctx:e.ctx,options:n,chart:e});mn.configure(e,r,n),mn.addBox(e,r)},stop(e){mn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;mn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Tt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Vb extends qi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=lt(r.text)?r.text.length:1;this._padding=Tt(r.padding);const s=i*yt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=kt(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=kt(a,i,n),l=ht*-.5):(u=s-t,d=kt(a,n,i),l=ht*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=yt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Mi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Tf(n.align),textBaseline:"middle",translation:[o,a]})}}function hM(e,t){const n=new Vb({ctx:e.ctx,options:t,chart:e});mn.configure(e,n,t),mn.addBox(e,n),e.titleBlock=n}var gM={id:"title",_element:Vb,start(e,t,n){hM(e,n)},stop(e){const t=e.titleBlock;mn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;mn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Po={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Pd(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Nn(e,t){return t&&(lt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function er(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
66
66
|
`)>-1?e.split(`
|
|
67
|
-
`):e}function yM(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function im(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=yt(t.bodyFont),c=yt(t.titleFont),u=yt(t.footerFont),d=s.length,f=i.length,h=r.length,g=Tt(t.padding);let m=g.height,p=0,v=r.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*S+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const w=function(S){p=Math.max(p,n.measureText(S).width+b)};return n.save(),n.font=c.string,Ye(e.title,w),n.font=l.string,Ye(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?o+2+t.boxPadding:0,Ye(r,S=>{Ye(S.before,w),Ye(S.lines,w),Ye(S.after,w)}),b=0,n.font=u.string,Ye(e.footer,w),n.restore(),p+=g.width,{width:p,height:m}}function mM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function pM(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function vM(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),pM(c,e,t,n)&&(c="center"),c}function sm(e,t,n){const r=n.yAlign||t.yAlign||mM(e,n);return{xAlign:n.xAlign||t.xAlign||vM(e,t,n,r),yAlign:r}}function bM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function xM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function om(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=rs(o);let g=bM(t,a);const m=xM(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:gn(g,0,r.width-t.width),y:gn(m,0,r.height-t.height)}}function gl(e,t,n){const r=Tt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function am(e){return Nn([],er(e))}function wM(e,t,n){return Xr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function lm(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Gb={beforeTitle:Yn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Yn,beforeBody:Yn,beforeLabel:Yn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Xe(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Yn,afterBody:Yn,beforeFooter:Yn,footer:Yn,afterFooter:Yn};function Rt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Gb[t].call(n,r):i}class Id extends qi{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new jb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=wM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Rt(r,"beforeTitle",this,t),s=Rt(r,"title",this,t),o=Rt(r,"afterTitle",this,t);let a=[];return a=Nn(a,er(i)),a=Nn(a,er(s)),a=Nn(a,er(o)),a}getBeforeBody(t,n){return am(Rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ye(t,s=>{const o={before:[],lines:[],after:[]},a=lm(r,s);Nn(o.before,er(Rt(a,"beforeLabel",this,s))),Nn(o.lines,Rt(a,"label",this,s)),Nn(o.after,er(Rt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return am(Rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Rt(r,"beforeFooter",this,t),s=Rt(r,"footer",this,t),o=Rt(r,"afterFooter",this,t);let a=[];return a=Nn(a,er(i)),a=Nn(a,er(s)),a=Nn(a,er(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(yM(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ye(a,u=>{const d=lm(t.callbacks,u);i.push(Rt(d,"labelColor",this,u)),s.push(Rt(d,"labelPointStyle",this,u)),o.push(Rt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Po[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=im(this,r),c=Object.assign({},a,l),u=sm(this.chart,r,c),d=om(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=rs(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,w,S,x;return s==="center"?(S=h+m/2,i==="left"?(p=f,v=p-o,w=S+o,x=S-o):(p=f+g,v=p+o,w=S-o,x=S+o),b=p):(i==="left"?v=f+Math.max(l,u)+o:i==="right"?v=f+g-Math.max(c,d)-o:v=this.caretX,s==="top"?(w=h,S=w-o,p=v-o,b=v+o):(w=h+m,S=w+o,p=v+o,b=v-o),x=w),{x1:p,x2:v,x3:b,y1:w,y2:S,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=is(r.rtl,this.x,this.width);for(t.x=gl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=yt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=yt(s.bodyFont),d=gl(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Td(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Td(t,m,p,v)}else{t.lineWidth=Fe(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),v=rs(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,ec(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ec(t,{x:p,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=yt(r.bodyFont);let f=d.lineHeight,h=0;const g=is(r.rtl,this.x,this.width),m=function(_){n.fillText(_,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,w,S,x,O,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=gl(this,p,r),n.fillStyle=r.bodyColor,Ye(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,O=i.length;S<O;++S){for(v=i[S],b=this.labelTextColors[S],n.fillStyle=b,Ye(v.before,m),w=v.lines,a&&w.length&&(this._drawColorBox(n,t,S,g,r),f=Math.max(d.lineHeight,l)),x=0,C=w.length;x<C;++x)m(w[x]),f=d.lineHeight;Ye(v.after,m)}h=0,f=d.lineHeight,Ye(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=is(r.rtl,this.x,this.width);for(t.x=gl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=yt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=rs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Po[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=im(this,t),l=Object.assign({},o,this._size),c=sm(n,t,l),u=om(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Tt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),kb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Ob(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!Ql(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Ql(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Po[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Id,"positioners",Po);var SM={id:"tooltip",_element:Id,positioners:Po,afterInit(e,t,n){n&&(e.tooltip=new Id({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Gb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const CM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function _M(e,t,n,r){const i=e.indexOf(t);if(i===-1)return CM(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const kM=(e,t)=>e===null?null:gn(Math.round(e),0,t);function cm(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ld extends Ys{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Xe(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:_M(r,t,De(n,t),this._addedLabels),kM(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return cm.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(Ld,"id","category"),me(Ld,"defaults",{ticks:{callback:cm}});function OM(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,v=!Xe(o),b=!Xe(a),w=!Xe(c),S=(p-m)/(d+1);let x=uy((p-m)/g/h)*h,O,C,_,k;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];k=Math.ceil(p/x)-Math.floor(m/x),k>g&&(x=uy(k*x/g/h)*h),Xe(l)||(O=Math.pow(10,l),x=Math.ceil(x*O)/O),i==="ticks"?(C=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(C=m,_=p),v&&b&&s&&VP((a-o)/s,x/1e3)?(k=Math.round(Math.min((a-o)/x,u)),x=(a-o)/k,C=o,_=a):w?(C=v?o:C,_=b?a:_,k=c-1,x=(_-C)/k):(k=(_-C)/x,Fo(k,Math.round(k),x/1e3)?k=Math.round(k):k=Math.ceil(k));const E=Math.max(dy(x),dy(C));O=Math.pow(10,Xe(l)?E:l),C=Math.round(C*O)/O,_=Math.round(_*O)/O;let j=0;for(v&&(f&&C!==o?(n.push({value:o}),C<o&&j++,Fo(Math.round((C+j*x)*O)/O,o,um(o,S,e))&&j++):C<o&&j++);j<k;++j){const D=Math.round((C+j*x)*O)/O;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Fo(n[n.length-1].value,a,um(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function um(e,t,{horizontal:n,minRotation:r}){const i=Nr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Rd extends Ys{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Xe(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Ns(i),c=Ns(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=OM(i,s);return t.bounds==="ticks"&&GP(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return pb(t,this.chart.options.locale,this.options.ticks.format)}}class Nd extends Rd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=vt(t)?t:0,this.max=vt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Nr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(Nd,"id","linear"),me(Nd,"defaults",{ticks:{callback:jf.formatters.numeric}});function Fd(e){const t=e.ticks;if(t.display&&e.display){const n=Tt(t.backdropPadding);return De(t.font&&t.font.size,dt.font.size)+n.height}return 0}function EM(e,t,n){return n=lt(n)?n:[n],{w:mT(e,t.string,n),h:n.length*t.lineHeight}}function dm(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function AM(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ht/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=yt(c.font),f=EM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=en(e.getIndexAngle(l)+a),g=Math.round(Ef(h)),m=dm(g,u.x,f.w,0,180),p=dm(g,u.y,f.h,90,270);PM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=MM(e,r,i)}function PM(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function TM(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Ef(en(l.angle+rn))),u=IM(l.y,a.h,c),d=$M(c),f=DM(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function jM(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ar({x:n,y:r},t)||ar({x:n,y:s},t)||ar({x:i,y:r},t)||ar({x:i,y:s},t))}function MM(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Fd(s)/2,additionalAngle:o?ht/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=TM(e,u,l);r.push(d),a==="auto"&&(d.visible=jM(d,c),d.visible&&(c=d))}return r}function $M(e){return e===0||e===180?"center":e<180?"left":"right"}function DM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function IM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function LM(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Xe(a)){const l=rs(t.borderRadius),c=Tt(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),ec(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function RM(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));LM(n,o,s);const a=yt(o.font),{x:l,y:c,textAlign:u}=s;Mi(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Qb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,sn);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function NM(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Qb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function FM(e,t,n){return Xr(e,{label:n,index:t,type:"pointLabel"})}class To extends Rd{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Tt(Fd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=vt(t)&&!isNaN(t)?t:0,this.max=vt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Fd(this.options))}generateTickLabels(t){Rd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=tt(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?AM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return en(t*n+Nr(r))}getDistanceFromCenterForValue(t){if(Xe(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Xe(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return FM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-rn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Qb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&RM(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);NM(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=yt(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Tt(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Mi(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(To,"id","radialLinear"),me(To,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(To,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(To,"descriptors",{angleLines:{_fallback:"grid"}});const qc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qt=Object.keys(qc);function fm(e,t){return e-t}function hm(e,t){if(Xe(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),vt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(aa(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function gm(e,t,n,r){const i=qt.length;for(let s=qt.indexOf(e);s<i-1;++s){const o=qc[qt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return qt[s]}return qt[i-1]}function BM(e,t,n,r,i){for(let s=qt.length-1;s>=qt.indexOf(n);s--){const o=qt[s];if(qc[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return qt[n?qt.indexOf(n):0]}function qM(e){for(let t=qt.indexOf(e)+1,n=qt.length;t<n;++t)if(qc[qt[t]].common)return qt[t]}function ym(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Af(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function zM(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function mm(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:zM(e,r,i,n)}class rc extends Ys{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new C5._date(t.adapters.date);i.init(n),No(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:hm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=vt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=vt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=ZP(i,s,o);return this._unit=n.unit||(r.autoSkip?gm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):BM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:qM(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),mm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=gn(n,0,o),r=gn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||gm(s.minUnit,n,r,this._getLabelCapacity(n)),a=De(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=aa(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)ym(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&ym(u,f,g),Object.keys(u).sort(fm).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return tt(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Nr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,mm(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(hm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tT(t.sort(fm))}}me(rc,"id","time"),me(rc,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function yl(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=fi(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=fi(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class pm extends rc{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=yl(n,this.min),this._tableRange=yl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(yl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return yl(this._table,r*this._tableRange+this._minPos,!0)}}me(pm,"id","timeseries"),me(pm,"defaults",rc.defaults);const Yb="label";function vm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function HM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Xb(e,t){e.labels=t}function Jb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yb;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function UM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yb;const n={labels:[],datasets:[]};return Xb(n,e.labels),Jb(n,e.datasets,t),n}function KM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=q.useRef(null),g=q.useRef(null),m=()=>{h.current&&(g.current=new Fc(h.current,{type:o,data:UM(a,s),options:l&&{...l},plugins:c}),vm(t,g.current))},p=()=>{vm(t,null),g.current&&(g.current.destroy(),g.current=null)};return q.useEffect(()=>{!i&&g.current&&l&&HM(g.current,l)},[i,l]),q.useEffect(()=>{!i&&g.current&&Xb(g.current.config.data,a.labels)},[i,a.labels]),q.useEffect(()=>{!i&&g.current&&a.datasets&&Jb(g.current.config.data,a.datasets,s)},[i,a.datasets]),q.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),q.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),q.useEffect(()=>(m(),()=>p()),[]),q.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const WM=q.forwardRef(KM);function Zb(e,t){return Fc.register(t),q.forwardRef((n,r)=>q.createElement(WM,{...n,ref:r,type:e}))}const VM=Zb("line",Pl),GM=Zb("radar",Tl);Fc.register(Ld,Nd,To,Fr,$l,oM,gM,SM,fM);var Bd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},QM=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bm(Object(n),!0).forEach(function(r){YM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YM(e,t,n){return(t=XM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XM(e){var t=JM(e,"string");return qs(t)=="symbol"?t:t+""}function JM(e,t){if(qs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function ZM(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var e$=function(){var t,n,r,i,s=Bi(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null?void 0:o.mentions,u=c==null||(t=c.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=c==null?void 0:c.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&qs(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return ZM(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=xm(xm({},Bd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(La,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ia,{score:c==null||(n=c.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:u,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(A.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(VM,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function ml(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:_e("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:_e("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Zo(u)),children:[u>0?y.jsx(Gv,{}):u<0?y.jsx(Vv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(wf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function t$(e){var t=e.children,n=e.className;return y.jsx("div",{className:_e("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function n$(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function r$(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:_e("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",n$(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(Gv,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(Vv,{className:"yst-w-4 yst-h-4"}),a]})}function ca(e){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(e)}function i$(e,t){return l$(e)||a$(e,t)||o$(e,t)||s$()}function s$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o$(e,t){if(e){if(typeof e=="string")return wm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wm(e,t):void 0}}function wm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a$(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function l$(e){if(Array.isArray(e))return e}function Sm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sm(Object(n),!0).forEach(function(r){c$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function c$(e,t,n){return(t=u$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u$(e){var t=d$(e,"string");return ca(t)=="symbol"?t:t+""}function d$(e,t){if(ca(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ca(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function f$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,S,x,O,C,_=Gn(),k=_.brandId,E=_.analysisId,j=Ec(k,E,{query:{select:function(Le){var Y=Le.data;return Y},enabled:!!k&&!!E}}),D=j.data,z=j.isLoading,N=D==null||(e=D.analysis)===null||e===void 0?void 0:e.scans,M=Array.isArray(N)&&N.length>0?N.reduce(function(Ve,Le){if(!Ve)return Le;if(!(Le!=null&&Le.finishedAt)||!(Ve!=null&&Ve.finishedAt))return Ve;var Y=new Date(Le.finishedAt),je=new Date(Ve.finishedAt);return Y>je?Le:Ve},void 0):void 0,I=M==null||(t=M.scores)===null||t===void 0?void 0:t.standardized,L=(n=M==null||(r=M.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,J=M==null||(i=M.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,ce=(s=M==null||(o=M.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=M==null||(l=M.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,V=M==null||(c=M.citations)===null||c===void 0||(c=c.total)===null||c===void 0||(c=c.previous)===null||c===void 0?void 0:c.difference,ie=M==null||(u=M.rankings)===null||u===void 0||(u=u.list)===null||u===void 0?void 0:u.find(function(Ve){var Le;return((Le=Ve.brand)===null||Le===void 0?void 0:Le.isSelf)===!0}),ue=(d=ie==null||(f=ie.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",R=ie==null||(h=ie.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;R&&(R=R*-1);var oe=(g=I==null||(m=I.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,ne=I==null||(p=I.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,xe=(v=I==null||(b=I.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,ee=(w=I==null||(S=I.sentiment)===null||S===void 0?void 0:S.value)!==null&&w!==void 0?w:0,re=(x=I==null||(O=I.mentions)===null||O===void 0?void 0:O.value)!==null&&x!==void 0?x:0,Q={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[re,xe,ce,ee],backgroundColor:QM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},Ce=pl(pl({},Bd),{},{plugins:pl(pl({},Bd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Le){var Y=Le.label||"",je=Le.parsed.r||0;return"".concat(Y,": ").concat(je,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),H=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),Pe=i$(H,2),et=Pe[0],nt=Pe[1];return q.useEffect(function(){function Ve(){nt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ve),function(){return window.removeEventListener("resize",Ve)}},[]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{children:[y.jsx(A.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ia,{score:oe,total:100,isLoading:z}),y.jsx(r$,{current:oe,previous:ne,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(GM,{data:Q,options:Ce}),y.jsx(wf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(t$,{children:[y.jsx(ml,{value:L,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:J,tooltipPosition:et}),y.jsx(ml,{value:ue&&y.jsxs(y.Fragment,{children:[ue,ue===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:R}),y.jsx(ml,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:V,tooltipPosition:et}),y.jsx(ml,{value:ee?"".concat(ee,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:M==null||(C=M.scores)===null||C===void 0||(C=C.standardized)===null||C===void 0||(C=C.sentiment)===null||C===void 0||(C=C.previous)===null||C===void 0?void 0:C.difference})]})})]})]})})}var Du=function(){var t=Gn(),n=t.brandId,r=t.analysisId,i=Fi({query:{select:function(m){var p=m.data;return p==null?void 0:p.brands}}}),s=i.data,o=i.isLoading,a=Ec(n,r,{query:{enabled:!!n&&mE(r),select:function(m){var p=m.data;return p==null?void 0:p.analysis}}}),l=a.data,c=a.isLoading,u=l==null?void 0:l.status,d=o||c,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&u===ii.completed;return o?y.jsx(Tc,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(fP,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(A.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(A.Button,{as:Yr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:_e("yst-gap-1.5"),disabled:!n,children:[y.jsx(Uv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(f$,{}),y.jsx(hP,{}),y.jsx(e$,{}),y.jsx(SA,{}),y.jsx(mA,{}),y.jsx(tA,{}),y.jsx(CA,{})]})]})]}):y.jsx(FE,{})};function e1(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(A.Title,{className:_e({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var h$=function(){return y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(A.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(A.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"})]}),y.jsxs(A.Table,{children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Header,{children:"URL"}),y.jsx(A.Table.Header,{children:"Associated brand"})]})}),y.jsxs(A.Table.Body,{children:[y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand"})]}),y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},g$=function(){return y.jsxs(A.Card,{children:[y.jsx(e1,{title:"Query history"}),y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(A.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(h$,{},t)})]})})]})},y$=q.lazy(function(){return Promise.resolve().then(()=>_R)}),m$=q.lazy(function(){return Promise.resolve().then(()=>XR)}),p$=q.lazy(function(){return Promise.resolve().then(()=>eN)}),v$=q.lazy(function(){return Promise.resolve().then(()=>hN)}),b$=q.lazy(function(){return Promise.resolve().then(()=>PN)}),x$=q.lazy(function(){return Promise.resolve().then(()=>IN)}),w$=new D2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ri=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(A.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},S$=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(Bw,{children:y.jsxs(Ct,{element:y.jsx(fE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(Ct,{path:"/",element:y.jsx(Is,{}),children:[y.jsx(Ct,{index:!0,element:y.jsx(Du,{})}),y.jsxs(Ct,{path:"brands/:brandId",element:y.jsx(vg,{}),children:[y.jsx(Ct,{index:!0,element:y.jsx(Du,{})}),y.jsx(Ct,{path:"brand-list",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(y$,{})})}),y.jsx(Ct,{path:"analysis/:analysisId",element:y.jsx(hE,{}),children:y.jsx(Ct,{index:!0,element:y.jsx(Du,{})})})]}),y.jsxs(Ct,{path:"/setup",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(p$,{})}),children:[y.jsx(Ct,{index:!0,element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(v$,{})})}),y.jsxs(Ct,{path:":brandId",element:y.jsx(vg,{}),children:[y.jsx(Ct,{path:"queries",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(b$,{})})}),y.jsx(Ct,{path:"analysis",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(x$,{})})})]})]})]}),y.jsx(Ct,{path:"/settings",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(m$,{})})}),y.jsx(Ct,{path:"/query-history",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(g$,{})})})]})})},C$=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(F2,{client:w$,children:[y.jsx(mO,{hostAppProps:r,children:y.jsx(S$,{DebugInfo:n})}),y.jsx(OC,{initialIsOpen:!1})]})};function _$(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=xn(),s=Ut(),o=q.useRef(n),a=q.useRef(null),l=q.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=q.useCallback(r,[r]);return q.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),q.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function k$(e,t){return P$(e)||A$(e,t)||E$(e,t)||O$()}function O$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E$(e,t){if(e){if(typeof e=="string")return Cm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cm(e,t):void 0}}function Cm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A$(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function P$(e){if(Array.isArray(e))return e}var T$=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,c=t.DebugInfo,u=t.subpath,d=u===void 0?"/":u,f=t.onNavigate,h=f===void 0?function(){}:f,g=t.onLogout,m=g===void 0?function(){}:g,p=t.onAddSubscription,v=p===void 0?function(){}:p,b=q.useState(!!(a||l)),w=k$(b,2),S=w[0],x=w[1],O={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return q.useEffect(function(){l&&Iv(l),lk(typeof a!="function"?function(){return a}:a),x(!1)},[l,a]),S?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Nw,{initialEntries:[d||"/"],children:[y.jsx(_$,{subpath:d,onNavigate:h}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(C$,{DebugInfo:c,hostAppProps:O})})]})})},j$=e=>e!=null,M$=e=>e.filter(j$);function $$(e){return(...t)=>{for(const n of e)n&&n(...t)}}var G=e=>typeof e=="function"&&!e.length?e():e,qd=e=>Array.isArray(e)?e:e?[e]:[];function D$(e,...t){return typeof e=="function"?e(...t):e}var I$=Se;function L$(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function R$(e){const[t,n]=se(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=se(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(w){r(w,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},c=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),u=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&gr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),Se(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),Se(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:u,error:t,remove:c,toJSON:d}]}var t1=R$,N$=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),_m=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},cn=N$({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=cn._cookies[0][cn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=cn.getItem(e);cn._cookies[0][cn._cookies[1]]=`${e}=${t}${_m(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:cn});window.dispatchEvent(i)},removeItem:e=>{cn._cookies[0][cn._cookies[1]]=`${e}=deleted${_m({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return cn._cookies[0][cn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return cn._cookies[0][cn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),F$=1024,$i=796,Nf=700,B$="bottom-right",zd="bottom",n1="system",q$=!1,r1=500,z$=500,i1=500,H$=Object.keys(fd)[0],km=1,U$=Object.keys(hd)[0],Ff=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ge(){return St(Ff)}var s1=wt(void 0),o1=e=>{const[t,n]=se(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",AS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ge().shadowDOMTarget||document).styleSheets].forEach(c=>{try{const u=[...c.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=c.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=u,l.document.head.appendChild(d)}catch(u){const d=document.createElement("link");if(c.href==null)return;d.rel="stylesheet",d.type=c.type,d.media=c.media.toString(),d.href=c.href,l.document.head.appendChild(d)}}),vc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};be(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||z$))}),be(()=>{const o=(ge().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ge().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),Se(()=>{l.disconnect()})}});const s=U(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return T(s1.Provider,{value:s,get children(){return e.children}})},Bf=()=>U(()=>{const t=St(s1);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),qf=wt(()=>"dark");function xt(){return St(qf)}var a1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},K$=Object.keys(a1).join("|"),W$=new RegExp(K$,"g");function V$(e){return e.replace(W$,t=>a1[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Om(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=Em(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=X$(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Em(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=Bt.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Em(e,t,n){return e=Am(e,n),t=Am(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:G$(e).includes(t)?Bt.ACRONYM:Q$(e,t))}function G$(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function Q$(e,t){let n=0,r=0;function i(l,c,u){for(let d=u,f=c.length;d<f;d++)if(c[d]===l)return n+=1,d+1;return-1}function s(l){const c=1/l,u=n/t.length;return Bt.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(r=i(u,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function Am(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=V$(e)),e}function Y$(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function X$(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=J$(s),a=Y$(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Pm={maxRanking:1/0,minRanking:-1/0};function J$(e){return typeof e=="function"?Pm:{...Pm,...e}}var Z$={data:""},e4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Z$,t4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,n4=/\/\*[^]*?\*\/| +/g,Tm=/\n+/g,li=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?li(o,s):s+"{"+li(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=li(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=li.p?li.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Xn={},l1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+l1(e[n]);return t}return e},r4=(e,t,n,r,i)=>{let s=l1(e),o=Xn[s]||(Xn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Xn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=t4.exec(c.replace(n4,""));)u[4]?f.shift():u[3]?(d=u[3].replace(Tm," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(Tm," ").trim();return f[0]})(e);Xn[o]=li(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Xn.g?Xn.g:null;return n&&(Xn.g=Xn[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Xn[o],t,r,a),o},i4=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":li(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return r4(n.unshift?n.raw?i4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,e4(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function c1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=c1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function le(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c1(e))&&(r&&(r+=" "),r+=t);return r}function s4(e,t){const n=ct(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=se([],{equals:!1}),[l]=sS(),c=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},u=(d,f,h)=>d.splice(h,0,f);return U(d=>{const f=o(),h=e();if(h[yc],ct(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:c}),g}return ct(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const S of h)(i.has(S)?b:p).push(S);let w=!p.length;for(let S=0;S<d.length;S++){const x=d[S];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),u(m,x,S)),w&&x!==m[S]&&(w=!1)}return!v.length&&w?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:c}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return $$(e)}var jm=e=>e instanceof Element;function Hd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Hd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Hd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function o4(e,t=jm,n=jm){const r=U(e),i=U(()=>Hd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function a4(e){return U(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function u1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function l4(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),u1(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function c4(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),u1(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Mm=e=>{const t=a4(e);return s4(o4(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)l4(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:c,rect:u}of a)if(c.isConnected){const d=c.getBoundingClientRect(),f=u.left-d.left,h=u.top-d.top;(f||h)&&(c.style.transform=`translate(${f}px, ${h}px)`,c.style.transitionDuration="0s",l.push(c))}document.body.offsetHeight;for(const c of l){let u=function(d){(d.target===c||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",u),c.classList.remove(...o.move))};c.classList.add(...o.move),c.style.transform=c.style.transitionDuration="",c.addEventListener("transitionend",u)}});for(const l of r)c4(o,e,l,()=>i([l]))}})},Iu=Symbol("fallback");function $m(e){for(const t of e)t.dispose()}function u4(e,t,n,r={}){const i=new Map;return Se(()=>$m(i.values())),()=>{const o=e()||[];return o[yc],ct(()=>{var u,d;if(!o.length)return $m(i.values()),i.clear(),r.fallback?[ur(h=>(i.set(Iu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Iu);if(!i.size||l){l==null||l.dispose(),i.delete(Iu);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const c=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);c.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(u=m.setIndex)==null||u.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of c)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,c){ur(u=>{const[d,f]=se(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=se(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function ic(e){const{by:t}=e;return U(u4(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function d4(e,t,n,r){return e.addEventListener(t,n,r),I$(e.removeEventListener.bind(e,t,n,r))}function f4(e,t,n,r){const i=()=>{qd(G(e)).forEach(s=>{s&&qd(G(t)).forEach(o=>d4(s,o,n,r))})};typeof e=="function"?be(i):ve(i)}function h4(e,t){const n=new ResizeObserver(e);return Se(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function d1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=h4(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);be(o=>{const a=M$(qd(G(e)));return L$(a,o,i,s),a},[])}var g4=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Dm(e){const t={};let n;for(;n=g4.exec(e);)t[n[1]]=n[2];return t}function zc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Dm(e)}else typeof t=="string"&&(t=Dm(t));return{...e,...t}}function y4(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Ud(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function m4(e){return typeof e=="number"}function Ji(e){return Object.prototype.toString.call(e)==="[object String]"}function p4(e){return typeof e=="function"}function Ba(e){return t=>`${e()}-${t}`}function mn(e,t){return e?e===t||e.contains(t):!1}function jo(e,t=!1){const{activeElement:n}=Wn(e);if(!(n!=null&&n.nodeName))return null;if(f1(n)&&n.contentDocument)return jo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Wn(n).getElementById(r);if(i)return i}}return n}function v4(e){return Wn(e).defaultView||window}function Wn(e){return e?e.ownerDocument||e:document}function f1(e){return e.tagName==="IFRAME"}var zf=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(zf||{});function Hf(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Hc(){return Hf(/^Mac/i)}function b4(){return Hf(/^iPhone/i)}function x4(){return Hf(/^iPad/i)||Hc()&&navigator.maxTouchPoints>1}function w4(){return b4()||x4()}function S4(){return Hc()||w4()}function rt(e,t){return t&&(p4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function pt(e){return t=>{for(const n of e)rt(t,n)}}function C4(e){return Hc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Et(e){if(e)if(_4())e.focus({preventScroll:!0});else{const t=k4(e);e.focus(),O4(t)}}var vl=null;function _4(){if(vl==null){vl=!1;try{document.createElement("div").focus({get preventScroll(){return vl=!0,!0}})}catch(e){}}return vl}function k4(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function O4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var h1=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],E4=[...h1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Uf=h1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",A4=E4.join(':not([hidden]):not([tabindex="-1"]),');function g1(e,t){const r=Array.from(e.querySelectorAll(Uf)).filter(Im);return t&&Im(e)&&r.unshift(e),r.forEach((i,s)=>{if(f1(i)&&i.contentDocument){const o=i.contentDocument.body,a=g1(o,!1);r.splice(s,1,...a)}}),r}function Im(e){return y1(e)&&!P4(e)}function y1(e){return e.matches(Uf)&&Kf(e)}function P4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Kf(e,t){return e.nodeName!=="#comment"&&T4(e)&&j4(e,t)&&(!e.parentElement||Kf(e.parentElement,e))}function T4(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function j4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function M4(e,t,n){const r=t!=null&&t.tabbable?A4:Uf,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Kf(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Lm(e){for(;e&&!$4(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function $4(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function D4(){}function I4(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function Be(e,t){return Ee(e,t)}var vo=new Map,Rm=new Set;function Nm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=vo.get(n.target);r||(r=new Set,vo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=vo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),vo.delete(n.target)),vo.size===0)){for(const i of Rm)i();Rm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Nm():document.addEventListener("DOMContentLoaded",Nm));function Kd(e,t){const n=Fm(e,t,"left"),r=Fm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function Fm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function L4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Lm(e);for(;e&&o&&e!==i&&o!==i;)Kd(o,e),e=o,o=Lm(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var m1={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function pn(e){return t=>(e(t),()=>e(void 0))}function Uc(e,t){const[n,r]=se(Bm(t==null?void 0:t()));return be(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Bm(t==null?void 0:t()))}),n}function Bm(e){return Ji(e)?e:void 0}function ot(e){const[t,n]=We(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return T(FS,Ee(n,{get component(){return t.as}}))}var R4=["id","name","validationState","required","disabled","readOnly"];function N4(e){const t=`form-control-${wn()}`,n=Be({id:t},e),[r,i]=se(),[s,o]=se(),[a,l]=se(),[c,u]=se(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,h=U(()=>({"data-valid":G(n.validationState)==="valid"?"":void 0,"data-invalid":G(n.validationState)==="invalid"?"":void 0,"data-required":G(n.required)?"":void 0,"data-disabled":G(n.disabled)?"":void 0,"data-readonly":G(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=G(n.name))!=null?m:G(n.id)},dataset:h,validationState:()=>G(n.validationState),isRequired:()=>G(n.required),isDisabled:()=>G(n.disabled),isReadOnly:()=>G(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ba(()=>G(n.id)),registerLabel:pn(i),registerField:pn(o),registerDescription:pn(l),registerErrorMessage:pn(u)}}}var p1=wt();function qa(){const e=St(p1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function v1(e){const t=qa(),n=Be({id:t.generateId("description")},e);return be(()=>Se(t.registerDescription(n.id))),T(ot,Ee({as:"div"},()=>t.dataset(),n))}function b1(e){const t=qa(),n=Be({id:t.generateId("error-message")},e),[r,i]=We(n,["forceMount"]),s=()=>t.validationState()==="invalid";return be(()=>{s()&&Se(t.registerErrorMessage(i.id))}),T(pe,{get when(){return r.forceMount||s()},get children(){return T(ot,Ee({as:"div"},()=>t.dataset(),i))}})}function F4(e){let t;const n=qa(),r=Be({id:n.generateId("label")},e),[i,s]=We(r,["ref"]),o=Uc(()=>t,()=>"label");return be(()=>Se(n.registerLabel(s.id))),T(ot,Ee({as:"label",ref(a){const l=It(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return U(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function B4(e,t){be(hr(e,n=>{if(n==null)return;const r=q4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Se(()=>{r.removeEventListener("reset",t)}))}))}function q4(e){return z4(e)?e.form:e.closest("form")}function z4(e){return e.matches("textarea, input, select, button")}function za(e){var o;const[t,n]=se((o=e.defaultValue)==null?void 0:o.call(e)),r=U(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=U(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ct(()=>{var c;const l=D$(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function x1(e){const[t,n]=za(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function H4(e){const[t,n]=za(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function U4(e={}){const[t,n]=x1({value:()=>G(e.isSelected),defaultValue:()=>!!G(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!G(e.isReadOnly)&&!G(e.isDisabled)&&n(s)},toggle:()=>{!G(e.isReadOnly)&&!G(e.isDisabled)&&n(!t())}}}var K4=Object.defineProperty,Kc=(e,t)=>{for(var n in t)K4(e,n,{get:t[n],enumerable:!0})},w1=wt();function S1(){return St(w1)}function W4(){const e=S1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function C1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function V4(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&C1(s,n))return r+1}return 0}function G4(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:C1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function _1(e,t){const n=G4(e);e!==n&&t(n)}function Q4(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Wn(r).body}function Y4(e,t){be(()=>{const n=setTimeout(()=>{_1(e(),t)});Se(()=>clearTimeout(n))})}function X4(e,t){if(typeof IntersectionObserver!="function"){Y4(e,t);return}let n=[];be(()=>{const r=()=>{const o=!!n.length;n=e(),o&&_1(e(),t)},i=Q4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}Se(()=>s.disconnect())})}function J4(e={}){const[t,n]=H4({value:()=>G(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});X4(t,n);const r=s=>(n(o=>{const a=V4(o,s);return y4(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>T(w1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function Z4(e){const t=W4(),n=Be({shouldRegisterItem:!0},e);be(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Se(r)})}function k1(e){var l,c,u;let t=(l=e.startIndex)!=null?l:0;const n=(c=e.startLevel)!=null?c:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=Ji(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=Ji(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=Ji(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Ji(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Ji(d)||m4(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(u=a(d))!=null?u:[];if(f.length>0){const h=k1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function eD(e,t=[]){return U(()=>{const n=k1({dataSource:G(e.dataSource),getKey:G(e.getKey),getTextValue:G(e.getTextValue),getDisabled:G(e.getDisabled),getSectionChildren:G(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var tD=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),nD=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function rD(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return tD.has(r)}const t=e.split("-")[0];return nD.has(t)}function iD(e){return rD(e)?"rtl":"ltr"}function O1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:iD(e)}}var Wd=O1(),Mo=new Set;function qm(){Wd=O1();for(const e of Mo)e(Wd)}function sD(){const[e,t]=se(Wd),n=U(()=>e());return gr(()=>{Mo.size===0&&window.addEventListener("languagechange",qm),Mo.add(t),Se(()=>{Mo.delete(t),Mo.size===0&&window.removeEventListener("languagechange",qm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var oD=wt();function Jr(){const e=sD();return St(oD)||e}var Lu=new Map;function aD(e){const{locale:t}=Jr(),n=U(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return U(()=>{const r=n();let i;return Lu.has(r)&&(i=Lu.get(r)),i||(i=new Intl.Collator(t(),e),Lu.set(r,i)),i})}var nr=class E1 extends Set{constructor(n,r,i){super(n);me(this,"anchorKey");me(this,"currentKey");n instanceof E1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function lD(e){const[t,n]=za(e);return[()=>{var i;return(i=t())!=null?i:new nr},n]}function A1(e){return S4()?e.altKey:e.ctrlKey}function Zi(e){return Hc()?e.metaKey:e.ctrlKey}function zm(e){return new nr(e)}function cD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function uD(e){const t=Be({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=se(!1),[i,s]=se(),o=U(()=>{const m=G(t.selectedKeys);return m!=null?zm(m):m}),a=U(()=>{const m=G(t.defaultSelectedKeys);return m!=null?zm(m):new nr}),[l,c]=lD({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=se(G(t.selectionBehavior)),f=()=>G(t.selectionMode),h=()=>{var m;return(m=G(t.disallowEmptySelection))!=null?m:!1},g=m=>{(G(t.allowDuplicateSelectionEvents)||!cD(m,l()))&&c(m)};return be(()=>{const m=l();G(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),be(()=>{var m;d((m=G(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function dD(e){const[t,n]=se(""),[r,i]=se(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(G(e.isDisabled))return;const a=G(e.keyboardDelegate),l=G(e.selectionManager);if(!a.getKeyForSearch)return;const c=fD(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),d=(f=a.getKeyForSearch(u,l.focusedKey()))!=null?f:a.getKeyForSearch(u);d==null&&hD(u)&&(u=u[0],d=(h=a.getKeyForSearch(u,l.focusedKey()))!=null?h:a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function fD(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function hD(e){return e.split("").every(t=>t===e[0])}function gD(e,t,n){const i=Ee({selectOnFocus:()=>G(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Jr();let a={top:0,left:0};f4(()=>G(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=dD({isDisabled:()=>G(i.disallowTypeAhead),keyboardDelegate:()=>G(i.keyboardDelegate),selectionManager:()=>G(i.selectionManager)}),c=()=>{var p;return(p=G(i.orientation))!=null?p:"vertical"},u=p=>{var _,k,E,j,D,z,N,M;rt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=G(i.selectionManager),w=G(i.selectOnFocus),S=I=>{I!=null&&(b.setFocusedKey(I),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(I):w&&!A1(p)&&b.replaceSelection(I))},x=G(i.keyboardDelegate),O=G(i.shouldFocusWrap),C=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let I;C!=null?I=x.getKeyBelow(C):I=(_=x.getFirstKey)==null?void 0:_.call(x),I==null&&O&&(I=(k=x.getFirstKey)==null?void 0:k.call(x,C)),S(I)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let I;C!=null?I=x.getKeyAbove(C):I=(E=x.getLastKey)==null?void 0:E.call(x),I==null&&O&&(I=(j=x.getLastKey)==null?void 0:j.call(x,C)),S(I)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const I=o()==="rtl";let L;C!=null?L=x.getKeyLeftOf(C):L=I?(D=x.getFirstKey)==null?void 0:D.call(x):(z=x.getLastKey)==null?void 0:z.call(x),S(L)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const I=o()==="rtl";let L;C!=null?L=x.getKeyRightOf(C):L=I?(N=x.getLastKey)==null?void 0:N.call(x):(M=x.getFirstKey)==null?void 0:M.call(x),S(L)}break}case"Home":if(x.getFirstKey){p.preventDefault();const I=x.getFirstKey(C,Zi(p));I!=null&&(b.setFocusedKey(I),Zi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(I):w&&b.replaceSelection(I))}break;case"End":if(x.getLastKey){p.preventDefault();const I=x.getLastKey(C,Zi(p));I!=null&&(b.setFocusedKey(I),Zi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(I):w&&b.replaceSelection(I))}break;case"PageDown":if(x.getKeyPageBelow&&C!=null){p.preventDefault();const I=x.getKeyPageBelow(C);S(I)}break;case"PageUp":if(x.getKeyPageAbove&&C!=null){p.preventDefault();const I=x.getKeyPageAbove(C);S(I)}break;case"a":Zi(p)&&b.selectionMode()==="multiple"&&G(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),G(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!G(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const I=M4(v,{tabbable:!0});let L,J;do J=I.lastChild(),J&&(L=J);while(J);L&&!L.contains(document.activeElement)&&Et(L)}break}}},d=p=>{var S,x,O,C;const v=G(i.selectionManager),b=G(i.keyboardDelegate),w=G(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=E=>{E!=null&&(v.setFocusedKey(E),w&&v.replaceSelection(E))},k=p.relatedTarget;k&&p.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(S=b.getLastKey)==null?void 0:S.call(b)):_((C=v.firstSelectedKey())!=null?C:(O=b.getFirstKey)==null?void 0:O.call(b))}else if(!G(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const k=_.querySelector(`[data-key="${v.focusedKey()}"]`);k&&(Et(k),Kd(_,k))}}}},f=p=>{const v=G(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var O,C;const p=G(i.autoFocus);if(!p)return;const v=G(i.selectionManager),b=G(i.keyboardDelegate);let w;p==="first"&&(w=(O=b.getFirstKey)==null?void 0:O.call(b)),p==="last"&&(w=(C=b.getLastKey)==null?void 0:C.call(b));const S=v.selectedKeys();S.size&&(w=S.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const x=t();x&&w==null&&!G(i.shouldUseVirtualFocus)&&Et(x)};return gr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),be(hr([s,()=>G(i.isVirtualized),()=>G(i.selectionManager).focusedKey()],p=>{var S;const[v,b,w]=p;if(b)w&&((S=i.scrollToKey)==null||S.call(i,w));else if(w&&v){const x=v.querySelector(`[data-key="${w}"]`);x&&Kd(v,x)}})),{tabIndex:U(()=>{if(!G(i.shouldUseVirtualFocus))return G(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function P1(e,t){const n=()=>G(e.selectionManager),r=()=>G(e.key),i=()=>G(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Zi(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>G(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!G(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&G(e.shouldSelectOnPressUp)&&G(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(G(e.shouldSelectOnPressUp)&&!G(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(A1(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const w=t();i()||a()||!w||b.target===w&&n().setFocusedKey(r())},p=U(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=U(()=>G(e.virtualized)?void 0:r());return be(hr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,w,S,x,O])=>{b&&w===x&&O&&!S&&document.activeElement!==b&&(e.focus?e.focus():Et(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var yD=class{constructor(e,t){me(this,"collection");me(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new nr(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new nr(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new nr([t],t,t):new nr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new nr;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new nr)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Hm=class{constructor(e){me(this,"keyMap",new Map);me(this,"iterable");me(this,"firstKey");me(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function mD(e){const t=uD(e),r=eD({dataSource:()=>G(e.dataSource),getKey:()=>G(e.getKey),getTextValue:()=>G(e.getTextValue),getDisabled:()=>G(e.getDisabled),getSectionChildren:()=>G(e.getSectionChildren),factory:s=>e.filter?new Hm(e.filter(s)):new Hm(s)},[()=>e.filter]),i=new yD(r,t);return T0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Ot=e=>typeof e=="function"?e():e,pD=e=>{const t=U(()=>{const o=Ot(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=se(Ot(e.show)?"present":"hidden");let s="none";return be(o=>{const a=Ot(e.show);return ct(()=>{var u;if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),be(()=>{const o=Ot(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),Se(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},vD=pD,T1=vD,sc="data-kb-top-layer",j1,Vd=!1,yr=[];function ua(e){return yr.findIndex(t=>t.node===e)}function bD(e){return yr[ua(e)]}function xD(e){return yr[yr.length-1].node===e}function M1(){return yr.filter(e=>e.isPointerBlocking)}function wD(){return[...M1()].slice(-1)[0]}function Wf(){return M1().length>0}function $1(e){var n;const t=ua((n=wD())==null?void 0:n.node);return ua(e)<t}function SD(e){yr.push(e)}function CD(e){const t=ua(e);t<0||yr.splice(t,1)}function _D(){for(const{node:e}of yr)e.style.pointerEvents=$1(e)?"none":"auto"}function kD(e){if(Wf()&&!Vd){const t=Wn(e);j1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Vd=!0}}function OD(e){if(Wf())return;const t=Wn(e);t.body.style.pointerEvents=j1,t.body.style.length===0&&t.body.removeAttribute("style"),Vd=!1}var Qt={layers:yr,isTopMostLayer:xD,hasPointerBlockingLayer:Wf,isBelowPointerBlockingLayer:$1,addLayer:SD,removeLayer:CD,indexOf:ua,find:bD,assignPointerEventToLayers:_D,disableBodyPointerEvents:kD,restoreBodyPointerEvents:OD},ED={};Kc(ED,{Button:()=>TD,Root:()=>Vf});var AD=["button","color","file","image","reset","submit"];function PD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?AD.indexOf(e.type)!==-1:!1}function Vf(e){let t;const n=Be({type:"button"},e),[r,i]=We(n,["ref","type","disabled"]),s=Uc(()=>t,()=>"button"),o=U(()=>{const c=s();return c==null?!1:PD({tagName:c,type:r.type})}),a=U(()=>s()==="input"),l=U(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return T(ot,Ee({as:"button",ref(c){const u=It(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var TD=Vf,jD=["top","right","bottom","left"],Un=Math.min,nn=Math.max,oc=Math.round,bl=Math.floor,Vr=e=>({x:e,y:e}),MD={left:"right",right:"left",bottom:"top",top:"bottom"},$D={start:"end",end:"start"};function Gd(e,t,n){return nn(e,Un(t,n))}function zi(e,t){return typeof e=="function"?e(t):e}function Gr(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function D1(e){return e==="x"?"y":"x"}function Gf(e){return e==="y"?"height":"width"}function Di(e){return["top","bottom"].includes(Gr(e))?"y":"x"}function Qf(e){return D1(Di(e))}function DD(e,t,n){n===void 0&&(n=!1);const r=Xs(e),i=Qf(e),s=Gf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ac(o)),[o,ac(o)]}function ID(e){const t=ac(e);return[Qd(e),t,Qd(t)]}function Qd(e){return e.replace(/start|end/g,t=>$D[t])}function LD(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function RD(e,t,n,r){const i=Xs(e);let s=LD(Gr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Qd)))),s}function ac(e){return e.replace(/left|right|bottom|top/g,t=>MD[t])}function ND(e){return{top:0,right:0,bottom:0,left:0,...e}}function I1(e){return typeof e!="number"?ND(e):{top:e,right:e,bottom:e,left:e}}function lc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Um(e,t,n){let{reference:r,floating:i}=e;const s=Di(t),o=Qf(t),a=Gf(o),l=Gr(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Xs(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var FD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Um(c,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:w,data:S,reset:x}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=b!=null?b:u,d=w!=null?w:d,h={...h,[p]:{...h[p],...S}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Um(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function da(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=zi(t,e),g=I1(h),p=a[f?d==="floating"?"reference":"floating":d],v=lc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},x=lc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-x.top+g.top)/S.y,bottom:(x.bottom-v.bottom+g.bottom)/S.y,left:(v.left-x.left+g.left)/S.x,right:(x.right-v.right+g.right)/S.x}}var BD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=zi(e,t)||{};if(c==null)return{};const d=I1(u),f={x:n,y:r},h=Qf(i),g=Gf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",w=p?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=O?O[w]:0;(!C||!await(o.isElement==null?void 0:o.isElement(O)))&&(C=a.floating[w]||s.floating[g]);const _=S/2-x/2,k=C/2-m[g]/2-1,E=Un(d[v],k),j=Un(d[b],k),D=E,z=C-m[g]-j,N=C/2-m[g]/2+_,M=Gd(D,N,z),I=!l.arrow&&Xs(i)!=null&&N!==M&&s.reference[g]/2-(N<D?E:j)-m[g]/2<0,L=I?N<D?N-D:N-z:0;return{[h]:f[h]+L,data:{[h]:M,centerOffset:N-M-L,...I&&{alignmentOffset:L}},reset:I}}}),qD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=zi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Gr(i),b=Di(a),w=Gr(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[ac(a)]:ID(a)),O=g!=="none";!f&&O&&x.push(...RD(a,m,g,S));const C=[a,...x],_=await da(t,p),k=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&k.push(_[v]),d){const N=DD(i,o,S);k.push(_[N[0]],_[N[1]])}if(E=[...E,{placement:i,overflows:k}],!k.every(N=>N<=0)){var j,D;const N=(((j=s.flip)==null?void 0:j.index)||0)+1,M=C[N];if(M)return{data:{index:N,overflows:E},reset:{placement:M}};let I=(D=E.filter(L=>L.overflows[0]<=0).sort((L,J)=>L.overflows[1]-J.overflows[1])[0])==null?void 0:D.placement;if(!I)switch(h){case"bestFit":{var z;const L=(z=E.filter(J=>{if(O){const ce=Di(J.placement);return ce===b||ce==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(ce=>ce>0).reduce((ce,F)=>ce+F,0)]).sort((J,ce)=>J[1]-ce[1])[0])==null?void 0:z[0];L&&(I=L);break}case"initialPlacement":I=a;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Km(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wm(e){return jD.some(t=>e[t]>=0)}var zD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=zi(e,t);switch(r){case"referenceHidden":{const s=await da(t,{...i,elementContext:"reference"}),o=Km(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Wm(o)}}}case"escaped":{const s=await da(t,{...i,altBoundary:!0}),o=Km(s,n.floating);return{data:{escapedOffsets:o,escaped:Wm(o)}}}default:return{}}}}};async function HD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Gr(n),a=Xs(n),l=Di(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=zi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}var UD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await HD(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},KD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=zi(e,t),c={x:n,y:r},u=await da(t,l),d=Di(Gr(i)),f=D1(d);let h=c[f],g=c[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[p],w=h-u[v];h=Gd(b,h,w)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[p],w=g-u[v];g=Gd(b,g,w)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},WD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=zi(e,t),l=await da(t,a),c=Gr(n),u=Xs(n),d=Di(n)==="y",{width:f,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Un(h-l[g],p),w=Un(f-l[m],v),S=!t.middlewareData.shift;let x=b,O=w;if(d?O=u||S?Un(w,v):v:x=u||S?Un(b,p):p,S&&!u){const _=nn(l.left,0),k=nn(l.right,0),E=nn(l.top,0),j=nn(l.bottom,0);d?O=f-2*(_!==0||k!==0?_+k:nn(l.left,l.right)):x=h-2*(E!==0||j!==0?E+j:nn(l.top,l.bottom))}await o({...t,availableWidth:O,availableHeight:x});const C=await i.getDimensions(s.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function Js(e){return L1(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(L1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function L1(e){return e instanceof Node||e instanceof on(e).Node}function Pn(e){return e instanceof Element||e instanceof on(e).Element}function Vn(e){return e instanceof HTMLElement||e instanceof on(e).HTMLElement}function Vm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}function Ha(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Tn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function VD(e){return["table","td","th"].includes(Js(e))}function Wc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Yf(e){const t=Xf(),n=Pn(e)?Tn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GD(e){let t=Qr(e);for(;Vn(t)&&!zs(t);){if(Yf(t))return t;if(Wc(t))return null;t=Qr(t)}return null}function Xf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zs(e){return["html","body","#document"].includes(Js(e))}function Tn(e){return on(e).getComputedStyle(e)}function Vc(e){return Pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qr(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vm(e)&&e.host||br(e);return Vm(t)?t.host:t}function R1(e){const t=Qr(e);return zs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vn(t)&&Ha(t)?t:R1(t)}function fa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=R1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=on(i);return s?t.concat(o,o.visualViewport||[],Ha(i)?i:[],o.frameElement&&n?fa(o.frameElement):[]):t.concat(i,fa(i,[],n))}function N1(e){const t=Tn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=oc(n)!==s||oc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Jf(e){return Pn(e)?e:e.contextElement}function os(e){const t=Jf(e);if(!Vn(t))return Vr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=N1(t);let o=(s?oc(n.width):n.width)/r,a=(s?oc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var QD=Vr(0);function F1(e){const t=on(e);return!Xf()||!t.visualViewport?QD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==on(e)?!1:t}function Ii(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Jf(e);let o=Vr(1);t&&(r?Pn(r)&&(o=os(r)):o=os(e));const a=YD(s,n,r)?F1(s):Vr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=on(s),h=r&&Pn(r)?on(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=os(m),v=m.getBoundingClientRect(),b=Tn(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,S=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=w,c+=S,g=on(m),m=g.frameElement}}return lc({width:u,height:d,x:l,y:c})}function XD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=br(r),a=t?Wc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Vr(1);const u=Vr(0),d=Vn(r);if((d||!d&&!s)&&((Js(r)!=="body"||Ha(o))&&(l=Vc(r)),Vn(r))){const f=Ii(r);c=os(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function JD(e){return Array.from(e.getClientRects())}function B1(e){return Ii(br(e)).left+Vc(e).scrollLeft}function ZD(e){const t=br(e),n=Vc(e),r=e.ownerDocument.body,i=nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+B1(e);const a=-n.scrollTop;return Tn(r).direction==="rtl"&&(o+=nn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function e6(e,t){const n=on(e),r=br(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Xf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function t6(e,t){const n=Ii(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Vn(e)?os(e):Vr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Gm(e,t,n){let r;if(t==="viewport")r=e6(e,n);else if(t==="document")r=ZD(br(e));else if(Pn(t))r=t6(t,n);else{const i=F1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return lc(r)}function q1(e,t){const n=Qr(e);return n===t||!Pn(n)||zs(n)?!1:Tn(n).position==="fixed"||q1(n,t)}function n6(e,t){const n=t.get(e);if(n)return n;let r=fa(e,[],!1).filter(a=>Pn(a)&&Js(a)!=="body"),i=null;const s=Tn(e).position==="fixed";let o=s?Qr(e):e;for(;Pn(o)&&!zs(o);){const a=Tn(o),l=Yf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ha(o)&&!l&&q1(e,o))?r=r.filter(u=>u!==o):i=a,o=Qr(o)}return t.set(e,r),r}function r6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Wc(t)?[]:n6(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Gm(t,u,i);return c.top=nn(d.top,c.top),c.right=Un(d.right,c.right),c.bottom=Un(d.bottom,c.bottom),c.left=nn(d.left,c.left),c},Gm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function i6(e){const{width:t,height:n}=N1(e);return{width:t,height:n}}function s6(e,t,n){const r=Vn(t),i=br(t),s=n==="fixed",o=Ii(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vr(0);if(r||!r&&!s)if((Js(t)!=="body"||Ha(i))&&(a=Vc(t)),r){const d=Ii(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=B1(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function Ru(e){return Tn(e).position==="static"}function Qm(e,t){return!Vn(e)||Tn(e).position==="fixed"?null:t?t(e):e.offsetParent}function z1(e,t){const n=on(e);if(Wc(e))return n;if(!Vn(e)){let i=Qr(e);for(;i&&!zs(i);){if(Pn(i)&&!Ru(i))return i;i=Qr(i)}return n}let r=Qm(e,t);for(;r&&VD(r)&&Ru(r);)r=Qm(r,t);return r&&zs(r)&&Ru(r)&&!Yf(r)?n:r||GD(e)||n}var o6=async function(e){const t=this.getOffsetParent||z1,n=this.getDimensions,r=await n(e.floating);return{reference:s6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function a6(e){return Tn(e).direction==="rtl"}var H1={convertOffsetParentRelativeRectToViewportRelativeRect:XD,getDocumentElement:br,getClippingRect:r6,getOffsetParent:z1,getElementRects:o6,getClientRects:JD,getDimensions:i6,getScale:os,isElement:Pn,isRTL:a6};function l6(e,t){let n=null,r;const i=br(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=bl(u),g=bl(i.clientWidth-(c+d)),m=bl(i.clientHeight-(u+f)),p=bl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:nn(0,Un(1,l))||1};let w=!0;function S(x){const O=x[0].intersectionRatio;if(O!==l){if(!w)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(S,b)}n.observe(e)}return o(!0),s}function c6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Jf(e),u=i||s?[...c?fa(c):[],...fa(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?l6(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?Ii(e):null;l&&p();function p(){const v=Ii(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var u6=UD,d6=KD,f6=qD,h6=WD,g6=zD,y6=BD,m6=(e,t,n)=>{const r=new Map,i={platform:H1,...n},s={...i.platform,_c:r};return FD(e,t,{...i,platform:s})},Zf=wt();function eh(){const e=St(Zf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var p6=de('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),Yd=30,Ym=Yd/2,v6={top:180,right:-90,bottom:0,left:90};function th(e){const t=eh(),n=Be({size:Yd},e),[r,i]=We(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=b6(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},c=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Yd/r.size),d=()=>`rotate(${v6[s()]} ${Ym} ${Ym}) translate(0 2)`;return T(ot,Ee({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return zc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){const f=p6(),h=f.firstChild;return ve(()=>Z(h,"transform",d())),f}}))}function b6(e){const[t,n]=se();return be(()=>{const r=e();r&&n(v4(r).getComputedStyle(r))}),t}function x6(e){const t=eh(),[n,r]=We(e,["ref","style"]);return T(ot,Ee({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return zc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Xm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function w6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Xm(r):e?e.getBoundingClientRect():Xm()}}}function S6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var C6={top:"bottom",right:"left",bottom:"top",left:"right"};function _6(e,t){const[n,r]=e.split("-"),i=C6[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function k6(e){const t=Be({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=se(),[i,s]=se(),[o,a]=se(t.placement),l=()=>{var f;return w6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Jr();async function u(){var O,C,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(O=t.gutter)!=null?O:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[u6(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(S6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(f6({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&v.push(d6({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(h6({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:j}){const D=Math.round(j.reference.width);k=Math.floor(k),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${D}px`),h.style.setProperty("--kb-popper-content-available-width",`${k}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${D}px`),t.fitViewport&&(h.style.maxWidth=`${k}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(g6({padding:t.detachedPadding})),g&&v.push(y6({element:g,padding:t.arrowPadding}));const b=await m6(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...H1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(C=t.onCurrentPlacementChange)==null||C.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",_6(b.placement,c()));const w=Math.round(b.x),S=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${S}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:k,y:E}=b.middlewareData.arrow,j=b.placement.split("-")[0];Object.assign(g.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[j]:"100%"})}}be(()=>{const f=l(),h=n();if(!f||!h)return;const g=c6(f,h,u,{elementResize:typeof ResizeObserver=="function"});Se(g)}),be(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return T(Zf.Provider,{value:d,get children(){return t.children}})}var U1=Object.assign(k6,{Arrow:th,Context:Zf,usePopperContext:eh,Positioner:x6});function O6(e){const t=n=>{var r;n.key===zf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};be(()=>{var r,i;if(G(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Wn();n.addEventListener("keydown",t),Se(()=>{n.removeEventListener("keydown",t)})})}var Jm="interactOutside.pointerDownOutside",Zm="interactOutside.focusOutside";function E6(e,t){let n,r=D4;const i=()=>Wn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${sc}]`)||!mn(i(),f)||mn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=pt([s,a]);g.addEventListener(Jm,m,{once:!0});const p=new CustomEvent(Jm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||C4(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=pt([o,a]);h.addEventListener(Zm,g,{once:!0});const m=new CustomEvent(Zm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};be(()=>{G(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),Se(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var K1=wt();function A6(){return St(K1)}function P6(e){let t;const n=A6(),[r,i]=We(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};E6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>mn(h(),d)))||[...s].some(h=>mn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Qt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Qt.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),O6({ownerDocument:()=>Wn(t),onEscapeKeyDown:d=>{var f;!t||!Qt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),gr(()=>{if(!t)return;Qt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Qt.assignPointerEventToLayers(),Qt.disableBodyPointerEvents(t),Se(()=>{t&&(Qt.removeLayer(t),d==null||d(),Qt.assignPointerEventToLayers(),Qt.restoreBodyPointerEvents(t))})}),be(hr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Qt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Qt.assignPointerEventToLayers()),f&&Qt.disableBodyPointerEvents(d),Se(()=>{Qt.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return T(K1.Provider,{value:u,get children(){return T(ot,Ee({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function W1(e={}){const[t,n]=x1({value:()=>G(e.open),defaultValue:()=>!!G(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var dn={};Kc(dn,{Description:()=>v1,ErrorMessage:()=>b1,Item:()=>Y1,ItemControl:()=>X1,ItemDescription:()=>J1,ItemIndicator:()=>Z1,ItemInput:()=>ex,ItemLabel:()=>tx,Label:()=>nx,RadioGroup:()=>T6,Root:()=>rx});var V1=wt();function G1(){const e=St(V1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var Q1=wt();function Ua(){const e=St(Q1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function Y1(e){const t=qa(),n=G1(),r=`${t.generateId("item")}-${wn()}`,i=Be({id:r},e),[s,o]=We(i,["value","disabled","onPointerDown"]),[a,l]=se(),[c,u]=se(),[d,f]=se(),[h,g]=se(),[m,p]=se(!1),v=U(()=>n.isSelectedValue(s.value)),b=U(()=>s.disabled||t.isDisabled()||!1),w=O=>{rt(O,s.onPointerDown),m()&&O.preventDefault()},S=U(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:S,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ba(()=>o.id),registerInput:pn(l),registerLabel:pn(u),registerDescription:pn(f),setIsFocused:p,setInputRef:g};return T(Q1.Provider,{value:x,get children(){return T(ot,Ee({as:"div",role:"group",onPointerDown:w},S,o))}})}function X1(e){const t=Ua(),n=Be({id:t.generateId("control")},e),[r,i]=We(n,["onClick","onKeyDown"]);return T(ot,Ee({as:"div",onClick:a=>{var l;rt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;rt(a,r.onKeyDown),a.key===zf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function J1(e){const t=Ua(),n=Be({id:t.generateId("description")},e);return be(()=>Se(t.registerDescription(n.id))),T(ot,Ee({as:"div"},()=>t.dataset(),n))}function Z1(e){const t=Ua(),n=Be({id:t.generateId("indicator")},e),[r,i]=We(n,["ref","forceMount"]),[s,o]=se(),{present:a}=T1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return T(pe,{get when(){return a()},get children(){return T(ot,Ee({as:"div",ref(l){const c=It(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function ex(e){const t=qa(),n=G1(),r=Ua(),i=Be({id:r.generateId("input")},e),[s,o]=We(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,u]=se(!1),d=g=>{if(rt(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{rt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{rt(g,s.onBlur),r.setIsFocused(!1)};return be(hr([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;u(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),be(()=>Se(r.registerInput(o.id))),T(ot,Ee({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return zc({...m1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function tx(e){const t=Ua(),n=Be({id:t.generateId("label")},e);return be(()=>Se(t.registerLabel(n.id))),T(ot,Ee({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function nx(e){return T(F4,Ee({as:"span"},e))}function rx(e){let t;const n=`radiogroup-${wn()}`,r=Be({id:n,orientation:"vertical"},e),[i,s,o]=We(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],R4),[a,l]=za({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=N4(s);B4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(G(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>c.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(c.isReadOnly()||c.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return T(p1.Provider,{value:c,get children(){return T(V1.Provider,{value:h,get children(){return T(ot,Ee({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return G(s.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return u()},get"aria-describedby"(){return d()}},()=>c.dataset(),o))}})}})}var T6=Object.assign(rx,{Description:v1,ErrorMessage:b1,Item:Y1,ItemControl:X1,ItemDescription:J1,ItemIndicator:Z1,ItemInput:ex,ItemLabel:tx,Label:nx}),j6=class{constructor(e,t,n){me(this,"collection");me(this,"ref");me(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function M6(e,t,n){const r=aD({usage:"search",sensitivity:"base"}),i=U(()=>{const s=G(e.keyboardDelegate);return s||new j6(e.collection,t,r)});return gD({selectionManager:()=>G(e.selectionManager),keyboardDelegate:i,autoFocus:()=>G(e.autoFocus),deferAutoFocus:()=>G(e.deferAutoFocus),shouldFocusWrap:()=>G(e.shouldFocusWrap),disallowEmptySelection:()=>G(e.disallowEmptySelection),selectOnFocus:()=>G(e.selectOnFocus),disallowTypeAhead:()=>G(e.disallowTypeAhead),shouldUseVirtualFocus:()=>G(e.shouldUseVirtualFocus),allowsTabNavigation:()=>G(e.allowsTabNavigation),isVirtualized:()=>G(e.isVirtualized),scrollToKey:s=>{var o;return(o=G(e.scrollToKey))==null?void 0:o(s)},orientation:()=>G(e.orientation)},t)}var Nu="focusScope.autoFocusOnMount",Fu="focusScope.autoFocusOnUnmount",ep={bubbles:!1,cancelable:!0},tp={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Ud(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Ud(this.stack,e),(t=this.active())==null||t.resume()}};function $6(e,t){const[n,r]=se(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Wn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,m1),g},u=()=>{const g=t();return g?g1(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=jo(g);return!m||mn(g,m)?!1:y1(m)};be(()=>{const g=t();if(!g)return;tp.add(i);const m=jo(g);if(!mn(g,m)){const v=new CustomEvent(Nu,ep);g.addEventListener(Nu,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Et(d()),jo(g)===m&&Et(g)},0)}Se(()=>{g.removeEventListener(Nu,o),setTimeout(()=>{const v=new CustomEvent(Fu,ep);h()&&v.preventDefault(),g.addEventListener(Fu,a),g.dispatchEvent(v),v.defaultPrevented||Et(m!=null?m:l().body),g.removeEventListener(Fu,a),tp.remove(i)},0)})}),be(()=>{const g=t();if(!g||!G(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${sc}]`)||(mn(g,b)?s=b:Et(s))},p=v=>{const b=v.relatedTarget,w=b!=null?b:jo(g);w!=null&&w.closest(`[${sc}]`)||mn(g,w)||Et(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),Se(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),be(()=>{const g=t();if(!g||!G(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(w){const S=d(),x=f();w.relatedTarget===S?Et(x):Et(S)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const S of w)S.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),S.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),Se(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var D6="data-live-announcer";function I6(e){be(()=>{G(e.isDisabled)||Se(L6(G(e.targets),G(e.root)))})}var bo=new WeakMap,un=[];function L6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${D6}], [${sc}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{var u;const c=(u=bo.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),bo.set(l,c+1))};un.length&&un[un.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return un.push(a),()=>{o.disconnect();for(const l of r){const c=bo.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),bo.delete(l)):bo.set(l,c-1)}a===un[un.length-1]?(un.pop(),un.length&&un[un.length-1].observe()):un.splice(un.indexOf(a),1)}}var xl=new Map,R6=e=>{be(()=>{var s,o;const t=(s=Ot(e.style))!=null?s:{},n=(o=Ot(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=xl.get(e.key);i?i.activeCount++:xl.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);Se(()=>{var l;const a=xl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}xl.delete(e.key);for(const[c,u]of Object.entries(a.originalStyles))e.element.style[c]=u;for(const c of a.properties)e.element.style.removeProperty(c);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},np=R6,N6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},F6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},B6=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[c,u,d]=N6(i,t),f=d-c-r*u;(u!==0||f!==0)&&F6(i,t)&&(s+=f,o+=u),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[rp,ip]=se([]),q6=e=>rp().indexOf(e)===rp().length-1,z6=e=>{const t=Ee({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=wn();let r=[0,0],i=null,s=null;be(()=>{Ot(t.enabled)&&(ip(c=>[...c,n]),Se(()=>{ip(c=>c.filter(u=>u!==n))}))}),be(()=>{if(!Ot(t.enabled)||!Ot(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Ot(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Ot(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;np({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Ot(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else np({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),be(()=>{!q6(n)||!Ot(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Se(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=sp(c),i=null,s=null},a=c=>{const u=c.target,d=Ot(t.element),f=H6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=op(u,h,g,d);let p;d&&Xd(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=Ot(t.element),d=c.target;let f;if(c.touches.length===2)f=!Ot(t.allowPinchZoom);else{if(i==null||s===null){const h=sp(c).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=op(d,i,s,u);u&&Xd(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},H6=e=>[e.deltaX,e.deltaY],sp=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],op=(e,t,n,r)=>{const i=r!==null&&Xd(r,e),[s,o]=B6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Xd=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},U6=z6,K6=U6,ix=wt();function sx(){return St(ix)}function xr(){const e=sx();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ox=wt();function nh(){const e=St(ox);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var ax=wt();function Qn(){const e=St(ax);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function rh(e){let t;const n=Qn(),r=xr(),i=Be({id:n.generateId(`item-${wn()}`)},e),[s,o]=We(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=se(),[c,u]=se(),[d,f]=se(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var k;(k=s.onSelect)==null||k.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};Z4({getItem:()=>{var k,E,j,D,z;return{ref:()=>t,type:"item",key:g(),textValue:(D=(j=(E=s.textValue)!=null?E:(k=d())==null?void 0:k.textContent)!=null?j:t==null?void 0:t.textContent)!=null?D:"",disabled:(z=s.disabled)!=null?z:!1}}});const v=P1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=k=>{rt(k,s.onPointerMove),k.pointerType==="mouse"&&(s.disabled?r.onItemLeave(k):(r.onItemEnter(k),k.defaultPrevented||(Et(k.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=k=>{rt(k,s.onPointerLeave),k.pointerType==="mouse"&&r.onItemLeave(k)},S=k=>{rt(k,s.onPointerUp),!s.disabled&&k.button===0&&p()},x=k=>{if(rt(k,s.onKeyDown),!k.repeat&&!s.disabled)switch(k.key){case"Enter":case" ":p();break}},O=U(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),C=U(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:C,setLabelRef:f,generateId:Ba(()=>o.id),registerLabel:pn(l),registerDescription:pn(u)};return T(ox.Provider,{value:_,get children(){return T(ot,Ee({as:"div",ref(k){const E=It(j=>t=j,s.ref);typeof E=="function"&&E(k)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return pt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return pt([S,v.onPointerUp])},get onClick(){return pt([s.onClick,v.onClick])},get onKeyDown(){return pt([x,v.onKeyDown])},get onMouseDown(){return pt([s.onMouseDown,v.onMouseDown])},get onFocus(){return pt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},C,o))}})}function lx(e){const t=Be({closeOnSelect:!1},e),[n,r]=We(t,["checked","defaultChecked","onChange","onSelect"]),i=U4({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return T(rh,Ee({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var W6=wt();function Gc(){return St(W6)}var ha={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ha.next(e==="ltr"?"rtl":"ltr",t)},ap={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function cx(e){const t=Qn(),n=xr(),r=Gc(),{direction:i}=Jr(),s=Be({id:t.generateId("trigger")},e),[o,a]=We(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const c=Uc(()=>n.triggerRef(),()=>"button"),u=U(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});be(hr(()=>r==null?void 0:r.value(),v=>{var b;u()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{rt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{rt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(rt(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case ap.first(t.orientation()):v.stopPropagation(),v.preventDefault(),L4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case ap.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ha.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ha.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;rt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{rt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return be(()=>Se(n.registerTriggerId(o.id))),T(Vf,Ee({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var V6=wt();function ux(){return St(V6)}function dx(e){let t;const n=Qn(),r=xr(),i=Gc(),s=ux(),{direction:o}=Jr(),a=Be({id:n.generateId(`content-${wn()}`)},e),[l,c]=We(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=M6({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);$6({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{var S;i===void 0&&((S=l.onOpenAutoFocus)==null||S.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(mn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case ha.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ha.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=w=>{var S;(S=l.onEscapeKeyDown)==null||S.call(l,w),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=w=>{var S;(S=l.onFocusOutside)==null||S.call(l,w),n.isModal()&&w.preventDefault()},p=w=>{var S,x;rt(w,l.onPointerEnter),r.isOpen()&&((S=r.parentMenuContext())==null||S.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(rt(w,l.onPointerMove),w.pointerType!=="mouse")return;const S=w.target,x=u!==w.clientX;mn(w.currentTarget,S)&&x&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};be(()=>Se(r.registerContentId(l.id)));const b={ref:It(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:pt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:pt([l.onMouseDown,f.onMouseDown]),onFocusIn:pt([l.onFocusIn,f.onFocusIn]),onFocusOut:pt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return T(pe,{get when(){return r.contentPresent()},get children(){return T(pe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return T(ot,Ee({as:"div"},()=>r.dataset(),b,c))},get children(){return T(U1.Positioner,{get children(){return T(P6,Ee({get disableOutsidePointerEvents(){return U(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return zc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,c))}})}})}})}function G6(e){let t;const n=Qn(),r=xr(),[i,s]=We(e,["ref"]);return K6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),T(dx,Ee({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var fx=wt();function Q6(){const e=St(fx);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function ih(e){const t=Qn(),n=Be({id:t.generateId(`group-${wn()}`)},e),[r,i]=se(),s={generateId:Ba(()=>n.id),registerLabelId:pn(i)};return T(fx.Provider,{value:s,get children(){return T(ot,Ee({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function hx(e){const t=Q6(),n=Be({id:t.generateId("label")},e),[r,i]=We(n,["id"]);return be(()=>Se(t.registerLabelId(r.id))),T(ot,Ee({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function gx(e){const t=xr(),n=Be({children:"▼"},e);return T(ot,Ee({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function yx(e){return T(rh,Ee({role:"menuitem",closeOnSelect:!0},e))}function mx(e){const t=nh(),n=Be({id:t.generateId("description")},e),[r,i]=We(n,["id"]);return be(()=>Se(t.registerDescription(r.id))),T(ot,Ee({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function px(e){const t=nh(),n=Be({id:t.generateId("indicator")},e),[r,i]=We(n,["forceMount"]);return T(pe,{get when(){return r.forceMount||t.isChecked()},get children(){return T(ot,Ee({as:"div"},()=>t.dataset(),i))}})}function vx(e){const t=nh(),n=Be({id:t.generateId("label")},e),[r,i]=We(n,["ref","id"]);return be(()=>Se(t.registerLabel(r.id))),T(ot,Ee({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function bx(e){const t=xr();return T(pe,{get when(){return t.contentPresent()},get children(){return T(H0,e)}})}var xx=wt();function Y6(){const e=St(xx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function wx(e){const n=Qn().generateId(`radiogroup-${wn()}`),r=Be({id:n},e),[i,s]=We(r,["value","defaultValue","onChange","disabled"]),[o,a]=za({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>{var u;return(u=i.onChange)==null?void 0:u.call(i,c)}}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:a};return T(xx.Provider,{value:l,get children(){return T(ih,s)}})}function Sx(e){const t=Y6(),n=Be({closeOnSelect:!1},e),[r,i]=We(n,["value","onSelect"]);return T(rh,Ee({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function X6(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function J6(e,t){return t?I4([e.clientX,e.clientY],t):!1}function Cx(e){const t=Qn(),n=S1(),r=sx(),i=Gc(),s=ux(),o=Be({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=We(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=se(),[g,m]=se(),[p,v]=se(),[b,w]=se(),[S,x]=se(!0),[O,C]=se(l.placement),[_,k]=se([]),[E,j]=se([]),{DomCollectionProvider:D}=J4({items:E,onItemsChange:j}),z=W1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:ee=>{var re;return(re=a.onOpenChange)==null?void 0:re.call(a,ee)}}),{present:N}=T1({show:()=>t.forceMount()||z.isOpen(),element:()=>{var ee;return(ee=b())!=null?ee:null}}),M=mD({selectionMode:"none",dataSource:E}),I=ee=>{x(ee),z.open()},L=(ee=!1)=>{z.close(),ee&&r&&r.close(!0)},J=ee=>{x(ee),z.toggle()},ce=()=>{const ee=b();ee&&(Et(ee),M.selectionManager().setFocused(!0),M.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>ce()):ce()},V=ee=>{k(Q=>[...Q,ee]);const re=r==null?void 0:r.registerNestedMenu(ee);return()=>{k(Q=>Ud(Q,ee)),re==null||re()}},ie=ee=>d===(u==null?void 0:u.side)&&J6(ee,u==null?void 0:u.area),ue=ee=>{ie(ee)&&ee.preventDefault()},R=ee=>{ie(ee)||F()},oe=ee=>{ie(ee)&&ee.preventDefault()};I6({isDisabled:()=>!(r==null&&z.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),be(()=>{const ee=b();if(!ee||!r)return;const re=r.registerNestedMenu(ee);Se(()=>{re()})}),be(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),be(()=>{var ee;r!==void 0||i===void 0||(i.value()===t.value()?((ee=p())==null||ee.focus(),i.autoFocusMenu()&&I(!0)):L())}),be(()=>{r!==void 0||i===void 0||z.isOpen()&&i.setValue(t.value())}),Se(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const xe={dataset:U(()=>({"data-expanded":z.isOpen()?"":void 0,"data-closed":z.isOpen()?void 0:""})),isOpen:z.isOpen,contentPresent:N,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>c,autoFocus:S,listState:()=>M,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:w,open:I,close:L,toggle:J,focusContent:F,onItemEnter:ue,onItemLeave:R,onTriggerLeave:oe,setPointerDir:ee=>d=ee,setPointerGraceTimeoutId:ee=>c=ee,setPointerGraceIntent:ee=>u=ee,registerNestedMenu:V,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:pn(h),registerContentId:pn(m)};return T(D,{get children(){return T(ix.Provider,{value:xe,get children(){return T(pe,{when:s===void 0,get fallback(){return l.children},get children(){return T(U1,Ee({anchorRef:p,contentRef:b,onCurrentPlacementChange:C},l))}})}})}})}function _x(e){const{direction:t}=Jr();return T(Cx,Ee({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Z6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function kx(e){const t=xr(),n=Qn(),[r,i]=We(e,["onFocusOutside","onKeyDown"]),{direction:s}=Jr();return T(dx,Ee({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;mn(t.triggerRef(),d)||t.close()},onKeyDown:u=>{rt(u,r.onKeyDown);const d=mn(u.currentTarget,u.target),f=Z6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Et(t.triggerRef()))}},i))}var lp=["Enter"," "],eI={open:(e,t)=>e==="ltr"?[...lp,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...lp,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Ox(e){let t;const n=Qn(),r=xr(),i=Be({id:n.generateId(`sub-trigger-${wn()}`)},e),[s,o]=We(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Jr(),u=()=>s.id,d=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),g=P1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=w=>{rt(w,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=w=>{var x;if(rt(w,s.onPointerMove),w.pointerType!=="mouse")return;const S=r.parentMenuContext();if(S==null||S.onItemEnter(w),!w.defaultPrevented){if(s.disabled){S==null||S.onItemLeave(w);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),S==null||S.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Et(w.currentTarget),S==null||S.listState().selectionManager().setFocused(!0),S==null||S.listState().selectionManager().setFocusedKey(u()))}},v=w=>{if(rt(w,s.onPointerLeave),w.pointerType!=="mouse")return;l();const S=r.parentMenuContext(),x=r.contentRef();if(x){S==null||S.setPointerGraceIntent({area:X6(r.currentPlacement(),w,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(S==null?void 0:S.pointerGraceTimeoutId());const O=window.setTimeout(()=>{S==null||S.setPointerGraceIntent(null)},300);S==null||S.setPointerGraceTimeoutId(O)}else{if(S==null||S.onTriggerLeave(w),w.defaultPrevented)return;S==null||S.setPointerGraceIntent(null)}S==null||S.onItemLeave(w)},b=w=>{rt(w,s.onKeyDown),!w.repeat&&(s.disabled||eI.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return be(()=>{var S,x,O;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:(x=(S=s.textValue)!=null?S:t==null?void 0:t.textContent)!=null?x:"",disabled:(O=s.disabled)!=null?O:!1});Se(w)}),be(hr(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{Se(()=>{var S;window.clearTimeout(w),(S=r.parentMenuContext())==null||S.setPointerGraceIntent(null)})})),be(()=>Se(r.registerTriggerId(s.id))),Se(()=>{l()}),T(ot,Ee({as:"div",ref(w){const S=It(x=>{r.setTriggerRef(x),t=x},s.ref);typeof S=="function"&&S(w)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return pt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return pt([s.onPointerUp,g.onPointerUp])},get onClick(){return pt([m,g.onClick])},get onKeyDown(){return pt([b,g.onKeyDown])},get onMouseDown(){return pt([s.onMouseDown,g.onMouseDown])},get onFocus(){return pt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function tI(e){const t=Gc(),n=`menu-${wn()}`,r=Be({id:n,modal:!0},e),[i,s]=We(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=W1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var c;return(c=i.onOpenChange)==null?void 0:c.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Ba(()=>i.id),value:()=>i.value,orientation:()=>{var l,c;return(c=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?c:"horizontal"}};return T(ax.Provider,{value:a,get children(){return T(Cx,Ee({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var nI={};Kc(nI,{Root:()=>Qc,Separator:()=>rI});function Qc(e){let t;const n=Be({orientation:"horizontal"},e),[r,i]=We(n,["ref","orientation"]),s=Uc(()=>t,()=>"hr");return T(ot,Ee({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var rI=Qc,ft={};Kc(ft,{Arrow:()=>th,CheckboxItem:()=>lx,Content:()=>Ex,DropdownMenu:()=>iI,Group:()=>ih,GroupLabel:()=>hx,Icon:()=>gx,Item:()=>yx,ItemDescription:()=>mx,ItemIndicator:()=>px,ItemLabel:()=>vx,Portal:()=>bx,RadioGroup:()=>wx,RadioItem:()=>Sx,Root:()=>Ax,Separator:()=>Qc,Sub:()=>_x,SubContent:()=>kx,SubTrigger:()=>Ox,Trigger:()=>cx});function Ex(e){const t=Qn(),n=xr(),[r,i]=We(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return T(G6,Ee({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||Et(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var c;(c=r.onInteractOutside)==null||c.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function Ax(e){const t=`dropdownmenu-${wn()}`,n=Be({id:t},e);return T(tI,n)}var iI=Object.assign(Ax,{Arrow:th,CheckboxItem:lx,Content:Ex,Group:ih,GroupLabel:hx,Icon:gx,Item:yx,ItemDescription:mx,ItemIndicator:px,ItemLabel:vx,Portal:bx,RadioGroup:wx,RadioItem:Sx,Separator:Qc,Sub:_x,SubContent:kx,SubTrigger:Ox,Trigger:cx}),K={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},sI=de('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),oI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),aI=de('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),lI=de('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),sh=de('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),cI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),fI=de('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),hI=de('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),gI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),yI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),pI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Px=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),xI=de('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),wI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),SI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),CI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_I=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),kI=de('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function OI(){return sI()}function Tx(){return oI()}function zo(){return aI()}function cp(){return lI()}function up(){return sh()}function EI(){return(()=>{var e=sh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function AI(){return(()=>{var e=sh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function PI(){return cI()}function TI(){return uI()}function jI(){return dI()}function MI(){return fI()}function $I(){return hI()}function DI(){return gI()}function II(){return yI()}function LI(){return mI()}function RI(){return pI()}function NI(e){return(()=>{var t=Px(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function FI(){return vI()}function BI(){return bI()}function qI(e){return[T(pe,{get when(){return e.checked},get children(){var t=Px(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),T(pe,{get when(){return!e.checked},get children(){var t=xI(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function zI(){return wI()}function HI(){return SI()}function UI(){return CI()}function KI(){return _I()}function dp(){const e=wn();return(()=>{var t=kI(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,c=l.nextSibling,u=c.firstChild,d=c.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,w=b.nextSibling,S=w.firstChild,x=w.nextSibling,O=x.firstChild,C=x.nextSibling,_=C.nextSibling,k=_.firstChild,E=_.nextSibling,j=E.firstChild,D=E.nextSibling,z=D.nextSibling,N=z.firstChild,M=z.nextSibling,I=M.firstChild,L=M.nextSibling,J=L.nextSibling,ce=J.firstChild,F=J.nextSibling,V=F.firstChild,ie=F.nextSibling,ue=ie.firstChild,R=ue.nextSibling,oe=R.nextSibling,ne=oe.nextSibling,xe=ne.nextSibling,ee=ie.nextSibling,re=ee.firstChild,Q=ee.nextSibling,Ce=Q.firstChild,H=Q.nextSibling,Pe=H.firstChild,et=Pe.nextSibling,nt=et.nextSibling,Ve=nt.firstChild,Le=Ve.nextSibling,Y=Le.nextSibling,je=Y.nextSibling,at=je.nextSibling,Re=at.nextSibling,$e=Re.nextSibling,he=$e.nextSibling,ye=he.nextSibling,fe=ye.nextSibling,Ne=fe.nextSibling,ke=Ne.nextSibling,ze=H.nextSibling,Ge=ze.firstChild,Vt=ze.nextSibling,_n=Vt.firstChild,Gt=Vt.nextSibling,Lt=Gt.firstChild,wr=Lt.nextSibling,Zr=Gt.nextSibling,Hi=Zr.firstChild,Ui=Zr.nextSibling,Wa=Ui.firstChild,to=Ui.nextSibling,no=to.firstChild,ro=no.nextSibling,Ki=ro.nextSibling,ch=Ki.nextSibling,uh=ch.nextSibling,dh=uh.nextSibling,fh=dh.nextSibling,hh=fh.nextSibling,gh=hh.nextSibling,yh=gh.nextSibling,mh=yh.nextSibling,ph=mh.nextSibling,vh=ph.nextSibling,bh=vh.nextSibling,xh=bh.nextSibling,wh=xh.nextSibling,Sh=wh.nextSibling,Ux=Sh.nextSibling;return Z(n,"id",`a-${e}`),Z(r,"fill",`url(#a-${e})`),Z(s,"id",`am-${e}`),Z(o,"id",`b-${e}`),Z(a,"filter",`url(#am-${e})`),Z(l,"mask",`url(#b-${e})`),Z(u,"id",`ah-${e}`),Z(d,"id",`k-${e}`),Z(f,"filter",`url(#ah-${e})`),Z(h,"mask",`url(#k-${e})`),Z(m,"id",`ae-${e}`),Z(p,"id",`j-${e}`),Z(v,"filter",`url(#ae-${e})`),Z(b,"mask",`url(#j-${e})`),Z(S,"id",`ai-${e}`),Z(x,"id",`i-${e}`),Z(O,"filter",`url(#ai-${e})`),Z(C,"mask",`url(#i-${e})`),Z(k,"id",`aj-${e}`),Z(E,"id",`h-${e}`),Z(j,"filter",`url(#aj-${e})`),Z(D,"mask",`url(#h-${e})`),Z(N,"id",`ag-${e}`),Z(M,"id",`g-${e}`),Z(I,"filter",`url(#ag-${e})`),Z(L,"mask",`url(#g-${e})`),Z(ce,"id",`af-${e}`),Z(F,"id",`f-${e}`),Z(V,"filter",`url(#af-${e})`),Z(ie,"mask",`url(#f-${e})`),Z(ne,"id",`m-${e}`),Z(xe,"fill",`url(#m-${e})`),Z(re,"id",`ak-${e}`),Z(Q,"id",`e-${e}`),Z(Ce,"filter",`url(#ak-${e})`),Z(H,"mask",`url(#e-${e})`),Z(Pe,"id",`n-${e}`),Z(et,"fill",`url(#n-${e})`),Z(Ve,"id",`r-${e}`),Z(Le,"fill",`url(#r-${e})`),Z(Y,"id",`s-${e}`),Z(je,"fill",`url(#s-${e})`),Z(at,"id",`q-${e}`),Z(Re,"fill",`url(#q-${e})`),Z($e,"id",`p-${e}`),Z(he,"fill",`url(#p-${e})`),Z(ye,"id",`o-${e}`),Z(fe,"fill",`url(#o-${e})`),Z(Ne,"id",`l-${e}`),Z(ke,"fill",`url(#l-${e})`),Z(Ge,"id",`al-${e}`),Z(Vt,"id",`d-${e}`),Z(_n,"filter",`url(#al-${e})`),Z(Gt,"mask",`url(#d-${e})`),Z(Lt,"id",`u-${e}`),Z(wr,"fill",`url(#u-${e})`),Z(Hi,"id",`ad-${e}`),Z(Ui,"id",`c-${e}`),Z(Wa,"filter",`url(#ad-${e})`),Z(to,"mask",`url(#c-${e})`),Z(no,"id",`t-${e}`),Z(ro,"fill",`url(#t-${e})`),Z(Ki,"id",`v-${e}`),Z(ch,"stroke",`url(#v-${e})`),Z(uh,"id",`aa-${e}`),Z(dh,"stroke",`url(#aa-${e})`),Z(fh,"id",`w-${e}`),Z(hh,"stroke",`url(#w-${e})`),Z(gh,"id",`ac-${e}`),Z(yh,"stroke",`url(#ac-${e})`),Z(mh,"id",`ab-${e}`),Z(ph,"stroke",`url(#ab-${e})`),Z(vh,"id",`y-${e}`),Z(bh,"stroke",`url(#y-${e})`),Z(xh,"id",`x-${e}`),Z(wh,"stroke",`url(#x-${e})`),Z(Sh,"id",`z-${e}`),Z(Ux,"stroke",`url(#z-${e})`),t})()}var WI=de('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),VI=de('<button title="Copy object to clipboard">'),GI=de('<button title="Remove all items"aria-label="Remove all items">'),QI=de('<button title="Delete item"aria-label="Delete item">'),YI=de('<button title="Toggle value"aria-label="Toggle value">'),XI=de('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),xo=de("<div>"),JI=de("<div><button> <span></span> <span> "),ZI=de("<input>"),fp=de("<span>"),eL=de("<div><span>:"),tL=de("<div><div><button> [<!>...<!>]");function nL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var hp=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n));return(()=>{var i=WI();return ve(()=>te(i,le(r().expander,n`
|
|
67
|
+
`):e}function yM(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function sm(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=yt(t.bodyFont),c=yt(t.titleFont),u=yt(t.footerFont),d=s.length,f=i.length,h=r.length,g=Tt(t.padding);let m=g.height,p=0,v=r.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*S+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const w=function(S){p=Math.max(p,n.measureText(S).width+b)};return n.save(),n.font=c.string,Ye(e.title,w),n.font=l.string,Ye(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?o+2+t.boxPadding:0,Ye(r,S=>{Ye(S.before,w),Ye(S.lines,w),Ye(S.after,w)}),b=0,n.font=u.string,Ye(e.footer,w),n.restore(),p+=g.width,{width:p,height:m}}function mM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function pM(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function vM(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),pM(c,e,t,n)&&(c="center"),c}function om(e,t,n){const r=n.yAlign||t.yAlign||mM(e,n);return{xAlign:n.xAlign||t.xAlign||vM(e,t,n,r),yAlign:r}}function bM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function xM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function am(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=rs(o);let g=bM(t,a);const m=xM(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:yn(g,0,r.width-t.width),y:yn(m,0,r.height-t.height)}}function yl(e,t,n){const r=Tt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function lm(e){return Nn([],er(e))}function wM(e,t,n){return Xr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function cm(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Gb={beforeTitle:Yn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Yn,beforeBody:Yn,beforeLabel:Yn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Xe(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Yn,afterBody:Yn,beforeFooter:Yn,footer:Yn,afterFooter:Yn};function Rt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Gb[t].call(n,r):i}class Ld extends qi{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new jb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=wM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Rt(r,"beforeTitle",this,t),s=Rt(r,"title",this,t),o=Rt(r,"afterTitle",this,t);let a=[];return a=Nn(a,er(i)),a=Nn(a,er(s)),a=Nn(a,er(o)),a}getBeforeBody(t,n){return lm(Rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ye(t,s=>{const o={before:[],lines:[],after:[]},a=cm(r,s);Nn(o.before,er(Rt(a,"beforeLabel",this,s))),Nn(o.lines,Rt(a,"label",this,s)),Nn(o.after,er(Rt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return lm(Rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Rt(r,"beforeFooter",this,t),s=Rt(r,"footer",this,t),o=Rt(r,"afterFooter",this,t);let a=[];return a=Nn(a,er(i)),a=Nn(a,er(s)),a=Nn(a,er(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(yM(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ye(a,u=>{const d=cm(t.callbacks,u);i.push(Rt(d,"labelColor",this,u)),s.push(Rt(d,"labelPointStyle",this,u)),o.push(Rt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=Po[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=sm(this,r),c=Object.assign({},a,l),u=om(this.chart,r,c),d=am(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=rs(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,w,S,x;return s==="center"?(S=h+m/2,i==="left"?(p=f,v=p-o,w=S+o,x=S-o):(p=f+g,v=p+o,w=S-o,x=S+o),b=p):(i==="left"?v=f+Math.max(l,u)+o:i==="right"?v=f+g-Math.max(c,d)-o:v=this.caretX,s==="top"?(w=h,S=w-o,p=v-o,b=v+o):(w=h+m,S=w+o,p=v+o,b=v-o),x=w),{x1:p,x2:v,x3:b,y1:w,y2:S,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=is(r.rtl,this.x,this.width);for(t.x=yl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=yt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=yt(s.bodyFont),d=yl(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,jd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,jd(t,m,p,v)}else{t.lineWidth=Fe(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),v=rs(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,tc(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),tc(t,{x:p,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=yt(r.bodyFont);let f=d.lineHeight,h=0;const g=is(r.rtl,this.x,this.width),m=function(k){n.fillText(k,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,w,S,x,O,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=yl(this,p,r),n.fillStyle=r.bodyColor,Ye(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,O=i.length;S<O;++S){for(v=i[S],b=this.labelTextColors[S],n.fillStyle=b,Ye(v.before,m),w=v.lines,a&&w.length&&(this._drawColorBox(n,t,S,g,r),f=Math.max(d.lineHeight,l)),x=0,C=w.length;x<C;++x)m(w[x]),f=d.lineHeight;Ye(v.after,m)}h=0,f=d.lineHeight,Ye(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=is(r.rtl,this.x,this.width);for(t.x=yl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=yt(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=rs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=Po[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=sm(this,t),l=Object.assign({},o,this._size),c=om(n,t,l),u=am(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Tt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),kb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Ob(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!Yl(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Yl(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=Po[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Ld,"positioners",Po);var SM={id:"tooltip",_element:Ld,positioners:Po,afterInit(e,t,n){n&&(e.tooltip=new Ld({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Gb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const CM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function _M(e,t,n,r){const i=e.indexOf(t);if(i===-1)return CM(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const kM=(e,t)=>e===null?null:yn(Math.round(e),0,t);function um(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Rd extends Ys{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Xe(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:_M(r,t,De(n,t),this._addedLabels),kM(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return um.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(Rd,"id","category"),me(Rd,"defaults",{ticks:{callback:um}});function OM(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,v=!Xe(o),b=!Xe(a),w=!Xe(c),S=(p-m)/(d+1);let x=dy((p-m)/g/h)*h,O,C,k,_;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];_=Math.ceil(p/x)-Math.floor(m/x),_>g&&(x=dy(_*x/g/h)*h),Xe(l)||(O=Math.pow(10,l),x=Math.ceil(x*O)/O),i==="ticks"?(C=Math.floor(m/x)*x,k=Math.ceil(p/x)*x):(C=m,k=p),v&&b&&s&&VP((a-o)/s,x/1e3)?(_=Math.round(Math.min((a-o)/x,u)),x=(a-o)/_,C=o,k=a):w?(C=v?o:C,k=b?a:k,_=c-1,x=(k-C)/_):(_=(k-C)/x,Fo(_,Math.round(_),x/1e3)?_=Math.round(_):_=Math.ceil(_));const A=Math.max(fy(x),fy(C));O=Math.pow(10,Xe(l)?A:l),C=Math.round(C*O)/O,k=Math.round(k*O)/O;let D=0;for(v&&(f&&C!==o?(n.push({value:o}),C<o&&D++,Fo(Math.round((C+D*x)*O)/O,o,dm(o,S,e))&&D++):C<o&&D++);D<_;++D){const I=Math.round((C+D*x)*O)/O;if(b&&I>a)break;n.push({value:I})}return b&&f&&k!==a?n.length&&Fo(n[n.length-1].value,a,dm(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!b||k===a)&&n.push({value:k}),n}function dm(e,t,{horizontal:n,minRotation:r}){const i=Nr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Nd extends Ys{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Xe(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Ns(i),c=Ns(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=OM(i,s);return t.bounds==="ticks"&&GP(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return pb(t,this.chart.options.locale,this.options.ticks.format)}}class Fd extends Nd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=vt(t)?t:0,this.max=vt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Nr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(Fd,"id","linear"),me(Fd,"defaults",{ticks:{callback:Mf.formatters.numeric}});function Bd(e){const t=e.ticks;if(t.display&&e.display){const n=Tt(t.backdropPadding);return De(t.font&&t.font.size,dt.font.size)+n.height}return 0}function EM(e,t,n){return n=lt(n)?n:[n],{w:mT(e,t.string,n),h:n.length*t.lineHeight}}function fm(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function AM(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ht/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=yt(c.font),f=EM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=en(e.getIndexAngle(l)+a),g=Math.round(Af(h)),m=fm(g,u.x,f.w,0,180),p=fm(g,u.y,f.h,90,270);PM(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=MM(e,r,i)}function PM(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function TM(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Af(en(l.angle+rn))),u=IM(l.y,a.h,c),d=$M(c),f=DM(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function jM(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ar({x:n,y:r},t)||ar({x:n,y:s},t)||ar({x:i,y:r},t)||ar({x:i,y:s},t))}function MM(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Bd(s)/2,additionalAngle:o?ht/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=TM(e,u,l);r.push(d),a==="auto"&&(d.visible=jM(d,c),d.visible&&(c=d))}return r}function $M(e){return e===0||e===180?"center":e<180?"left":"right"}function DM(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function IM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function LM(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Xe(a)){const l=rs(t.borderRadius),c=Tt(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),tc(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function RM(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));LM(n,o,s);const a=yt(o.font),{x:l,y:c,textAlign:u}=s;Mi(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Qb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,sn);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function NM(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Qb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function FM(e,t,n){return Xr(e,{label:n,index:t,type:"pointLabel"})}class To extends Nd{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Tt(Bd(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=vt(t)&&!isNaN(t)?t:0,this.max=vt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Bd(this.options))}generateTickLabels(t){Nd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=tt(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?AM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return en(t*n+Nr(r))}getDistanceFromCenterForValue(t){if(Xe(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Xe(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return FM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-rn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Qb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&RM(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);NM(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=yt(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Tt(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Mi(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(To,"id","radialLinear"),me(To,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(To,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(To,"descriptors",{angleLines:{_fallback:"grid"}});const qc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qt=Object.keys(qc);function hm(e,t){return e-t}function gm(e,t){if(Xe(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),vt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(aa(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function ym(e,t,n,r){const i=qt.length;for(let s=qt.indexOf(e);s<i-1;++s){const o=qc[qt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return qt[s]}return qt[i-1]}function BM(e,t,n,r,i){for(let s=qt.length-1;s>=qt.indexOf(n);s--){const o=qt[s];if(qc[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return qt[n?qt.indexOf(n):0]}function qM(e){for(let t=qt.indexOf(e)+1,n=qt.length;t<n;++t)if(qc[qt[t]].common)return qt[t]}function mm(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Pf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function zM(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function pm(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:zM(e,r,i,n)}class ic extends Ys{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new C5._date(t.adapters.date);i.init(n),No(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:gm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=vt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=vt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=ZP(i,s,o);return this._unit=n.unit||(r.autoSkip?ym(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):BM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:qM(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),pm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=yn(n,0,o),r=yn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||ym(s.minUnit,n,r,this._getLabelCapacity(n)),a=De(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=aa(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)mm(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&mm(u,f,g),Object.keys(u).sort(hm).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return tt(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Nr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,pm(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(gm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tT(t.sort(hm))}}me(ic,"id","time"),me(ic,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ml(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=fi(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=fi(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class vm extends ic{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ml(n,this.min),this._tableRange=ml(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ml(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ml(this._table,r*this._tableRange+this._minPos,!0)}}me(vm,"id","timeseries"),me(vm,"defaults",ic.defaults);const Yb="label";function bm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function HM(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Xb(e,t){e.labels=t}function Jb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yb;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function UM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yb;const n={labels:[],datasets:[]};return Xb(n,e.labels),Jb(n,e.datasets,t),n}function KM(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=q.useRef(null),g=q.useRef(null),m=()=>{h.current&&(g.current=new Fc(h.current,{type:o,data:UM(a,s),options:l&&{...l},plugins:c}),bm(t,g.current))},p=()=>{bm(t,null),g.current&&(g.current.destroy(),g.current=null)};return q.useEffect(()=>{!i&&g.current&&l&&HM(g.current,l)},[i,l]),q.useEffect(()=>{!i&&g.current&&Xb(g.current.config.data,a.labels)},[i,a.labels]),q.useEffect(()=>{!i&&g.current&&a.datasets&&Jb(g.current.config.data,a.datasets,s)},[i,a.datasets]),q.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),q.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),q.useEffect(()=>(m(),()=>p()),[]),q.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const WM=q.forwardRef(KM);function Zb(e,t){return Fc.register(t),q.forwardRef((n,r)=>q.createElement(WM,{...n,ref:r,type:e}))}const VM=Zb("line",Tl),GM=Zb("radar",jl);Fc.register(Rd,Fd,To,Fr,Dl,oM,gM,SM,fM);var qd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},QM=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xm(Object(n),!0).forEach(function(r){YM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YM(e,t,n){return(t=XM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XM(e){var t=JM(e,"string");return qs(t)=="symbol"?t:t+""}function JM(e,t){if(qs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function ZM(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var e$=function(){var t,n,r,i,s=Bi(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null?void 0:o.mentions,u=c==null||(t=c.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=c==null?void 0:c.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&qs(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return ZM(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=wm(wm({},qd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ra,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(La,{score:c==null||(n=c.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:u,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(E.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(VM,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function pl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:_e("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:_e("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Zo(u)),children:[u>0?y.jsx(Qv,{}):u<0?y.jsx(Gv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(Sf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function t$(e){var t=e.children,n=e.className;return y.jsx("div",{className:_e("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function n$(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function r$(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:_e("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",n$(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(Qv,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(Gv,{className:"yst-w-4 yst-h-4"}),a]})}function ca(e){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(e)}function i$(e,t){return l$(e)||a$(e,t)||o$(e,t)||s$()}function s$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o$(e,t){if(e){if(typeof e=="string")return Sm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sm(e,t):void 0}}function Sm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a$(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function l$(e){if(Array.isArray(e))return e}function Cm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cm(Object(n),!0).forEach(function(r){c$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function c$(e,t,n){return(t=u$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u$(e){var t=d$(e,"string");return ca(t)=="symbol"?t:t+""}function d$(e,t){if(ca(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ca(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function f$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,S,x,O,C,k=Gn(),_=k.brandId,A=k.analysisId,D=Ac(_,A,{query:{select:function(Le){var Y=Le.data;return Y},enabled:!!_&&!!A}}),I=D.data,z=D.isLoading,N=I==null||(e=I.analysis)===null||e===void 0?void 0:e.scans,T=Array.isArray(N)&&N.length>0?N.reduce(function(Ve,Le){if(!Ve)return Le;if(!(Le!=null&&Le.finishedAt)||!(Ve!=null&&Ve.finishedAt))return Ve;var Y=new Date(Le.finishedAt),je=new Date(Ve.finishedAt);return Y>je?Le:Ve},void 0):void 0,$=T==null||(t=T.scores)===null||t===void 0?void 0:t.standardized,L=(n=T==null||(r=T.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,Z=T==null||(i=T.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,ue=(s=T==null||(o=T.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=T==null||(l=T.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,V=T==null||(c=T.citations)===null||c===void 0||(c=c.total)===null||c===void 0||(c=c.previous)===null||c===void 0?void 0:c.difference,re=T==null||(u=T.rankings)===null||u===void 0||(u=u.list)===null||u===void 0?void 0:u.find(function(Ve){var Le;return((Le=Ve.brand)===null||Le===void 0?void 0:Le.isSelf)===!0}),se=(d=re==null||(f=re.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",R=re==null||(h=re.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;R&&(R=R*-1);var ae=(g=$==null||(m=$.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,ne=$==null||(p=$.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,xe=(v=$==null||(b=$.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,ee=(w=$==null||(S=$.sentiment)===null||S===void 0?void 0:S.value)!==null&&w!==void 0?w:0,ie=(x=$==null||(O=$.mentions)===null||O===void 0?void 0:O.value)!==null&&x!==void 0?x:0,Q={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[ie,xe,ue,ee],backgroundColor:QM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},Ce=vl(vl({},qd),{},{plugins:vl(vl({},qd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Le){var Y=Le.label||"",je=Le.parsed.r||0;return"".concat(Y,": ").concat(je,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),H=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),Pe=i$(H,2),et=Pe[0],nt=Pe[1];return q.useEffect(function(){function Ve(){nt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ve),function(){return window.removeEventListener("resize",Ve)}},[]),y.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(E.Card.Content,{children:[y.jsx(E.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(La,{score:ae,total:100,isLoading:z}),y.jsx(r$,{current:ae,previous:ne,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(GM,{data:Q,options:Ce}),y.jsx(Sf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(t$,{children:[y.jsx(pl,{value:L,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:Z,tooltipPosition:et}),y.jsx(pl,{value:se&&y.jsxs(y.Fragment,{children:[se,se===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:R}),y.jsx(pl,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:V,tooltipPosition:et}),y.jsx(pl,{value:ee?"".concat(ee,"%"):"—",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:T==null||(C=T.scores)===null||C===void 0||(C=C.standardized)===null||C===void 0||(C=C.sentiment)===null||C===void 0||(C=C.previous)===null||C===void 0?void 0:C.difference})]})})]})]})})}var Du=function(){var t=Gn(),n=t.brandId,r=t.analysisId,i=Fi({query:{select:function(m){var p=m.data;return p==null?void 0:p.brands}}}),s=i.data,o=i.isLoading,a=Ac(n,r,{query:{enabled:!!n&&mE(r),select:function(m){var p=m.data;return p==null?void 0:p.analysis}}}),l=a.data,c=a.isLoading,u=l==null?void 0:l.status,d=o||c,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&u===ii.completed;return o?y.jsx(Tc,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(fP,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(E.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(E.Button,{as:Yr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:_e("yst-gap-1.5"),disabled:!n,children:[y.jsx(Kv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(f$,{}),y.jsx(hP,{}),y.jsx(e$,{}),y.jsx(SA,{}),y.jsx(mA,{}),y.jsx(tA,{}),y.jsx(CA,{})]})]})]}):y.jsx(FE,{})};function e1(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(E.Title,{className:_e({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var h$=function(){return y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(E.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(E.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"})]}),y.jsxs(E.Table,{children:[y.jsx(E.Table.Head,{children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Header,{children:"URL"}),y.jsx(E.Table.Header,{children:"Associated brand"})]})}),y.jsxs(E.Table.Body,{children:[y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand"})]}),y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},g$=function(){return y.jsxs(E.Card,{children:[y.jsx(e1,{title:"Query history"}),y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(E.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(h$,{},t)})]})})]})},y$=q.lazy(function(){return Promise.resolve().then(()=>_R)}),m$=q.lazy(function(){return Promise.resolve().then(()=>XR)}),p$=q.lazy(function(){return Promise.resolve().then(()=>eN)}),v$=q.lazy(function(){return Promise.resolve().then(()=>hN)}),b$=q.lazy(function(){return Promise.resolve().then(()=>PN)}),x$=q.lazy(function(){return Promise.resolve().then(()=>IN)}),w$=new D2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ri=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(E.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},S$=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx(Bw,{children:y.jsxs(Ct,{element:y.jsx(fE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(Ct,{path:"/",element:y.jsx(Is,{}),children:[y.jsx(Ct,{index:!0,element:y.jsx(Du,{})}),y.jsxs(Ct,{path:"brands/:brandId",element:y.jsx(bg,{}),children:[y.jsx(Ct,{index:!0,element:y.jsx(Du,{})}),y.jsx(Ct,{path:"brand-list",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(y$,{})})}),y.jsx(Ct,{path:"analysis/:analysisId",element:y.jsx(hE,{}),children:y.jsx(Ct,{index:!0,element:y.jsx(Du,{})})})]}),y.jsxs(Ct,{path:"/setup",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(p$,{})}),children:[y.jsx(Ct,{index:!0,element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(v$,{})})}),y.jsxs(Ct,{path:":brandId",element:y.jsx(bg,{}),children:[y.jsx(Ct,{path:"queries",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(b$,{})})}),y.jsx(Ct,{path:"analysis",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(x$,{})})})]})]})]}),y.jsx(Ct,{path:"/settings",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(m$,{})})}),y.jsx(Ct,{path:"/query-history",element:y.jsx(q.Suspense,{fallback:y.jsx(ri,{}),children:y.jsx(g$,{})})})]})})},C$=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(F2,{client:w$,children:[y.jsx(mO,{hostAppProps:r,children:y.jsx(S$,{DebugInfo:n})}),y.jsx(OC,{initialIsOpen:!1})]})};function _$(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=ln(),s=Ut(),o=q.useRef(n),a=q.useRef(null),l=q.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=q.useCallback(r,[r]);return q.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),q.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function k$(e,t){return P$(e)||A$(e,t)||E$(e,t)||O$()}function O$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E$(e,t){if(e){if(typeof e=="string")return _m(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_m(e,t):void 0}}function _m(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A$(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function P$(e){if(Array.isArray(e))return e}var T$=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,c=t.DebugInfo,u=t.subpath,d=u===void 0?"/":u,f=t.onNavigate,h=f===void 0?function(){}:f,g=t.onLogout,m=g===void 0?function(){}:g,p=t.onAddSubscription,v=p===void 0?function(){}:p,b=q.useState(!!(a||l)),w=k$(b,2),S=w[0],x=w[1],O={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return q.useEffect(function(){l&&Lv(l),lk(typeof a!="function"?function(){return a}:a),x(!1)},[l,a]),S?y.jsx("div",{className:i,style:s,children:y.jsx(E.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Nw,{initialEntries:[d||"/"],children:[y.jsx(_$,{subpath:d,onNavigate:h}),y.jsx(E.Root,{context:{isRtl:r},children:y.jsx(C$,{DebugInfo:c,hostAppProps:O})})]})})},j$=e=>e!=null,M$=e=>e.filter(j$);function $$(e){return(...t)=>{for(const n of e)n&&n(...t)}}var G=e=>typeof e=="function"&&!e.length?e():e,zd=e=>Array.isArray(e)?e:e?[e]:[];function D$(e,...t){return typeof e=="function"?e(...t):e}var I$=Se;function L$(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function R$(e){const[t,n]=oe(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=oe(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(w){r(w,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},c=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),u=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&gr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),Se(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),Se(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:u,error:t,remove:c,toJSON:d}]}var t1=R$,N$=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),km=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},un=N$({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=un._cookies[0][un._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=un.getItem(e);un._cookies[0][un._cookies[1]]=`${e}=${t}${km(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:un});window.dispatchEvent(i)},removeItem:e=>{un._cookies[0][un._cookies[1]]=`${e}=deleted${km({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return un._cookies[0][un._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return un._cookies[0][un._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),F$=1024,$i=796,Ff=700,B$="bottom-right",Hd="bottom",n1="system",q$=!1,r1=500,z$=500,i1=500,H$=Object.keys(fd)[0],Om=1,U$=Object.keys(hd)[0],Bf=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ge(){return St(Bf)}var s1=wt(void 0),o1=e=>{const[t,n]=oe(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",AS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ge().shadowDOMTarget||document).styleSheets].forEach(c=>{try{const u=[...c.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=c.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=u,l.document.head.appendChild(d)}catch(u){const d=document.createElement("link");if(c.href==null)return;d.rel="stylesheet",d.type=c.type,d.media=c.media.toString(),d.href=c.href,l.document.head.appendChild(d)}}),bc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};be(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||z$))}),be(()=>{const o=(ge().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ge().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),Se(()=>{l.disconnect()})}});const s=U(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return j(s1.Provider,{value:s,get children(){return e.children}})},qf=()=>U(()=>{const t=St(s1);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),zf=wt(()=>"dark");function xt(){return St(zf)}var a1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},K$=Object.keys(a1).join("|"),W$=new RegExp(K$,"g");function V$(e){return e.replace(W$,t=>a1[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Em(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=Am(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=X$(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Am(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=Bt.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function Am(e,t,n){return e=Pm(e,n),t=Pm(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:G$(e).includes(t)?Bt.ACRONYM:Q$(e,t))}function G$(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function Q$(e,t){let n=0,r=0;function i(l,c,u){for(let d=u,f=c.length;d<f;d++)if(c[d]===l)return n+=1,d+1;return-1}function s(l){const c=1/l,u=n/t.length;return Bt.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(r=i(u,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function Pm(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=V$(e)),e}function Y$(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function X$(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=J$(s),a=Y$(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Tm={maxRanking:1/0,minRanking:-1/0};function J$(e){return typeof e=="function"?Tm:{...Tm,...e}}var Z$={data:""},e4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Z$,t4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,n4=/\/\*[^]*?\*\/| +/g,jm=/\n+/g,li=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?li(o,s):s+"{"+li(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=li(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=li.p?li.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Xn={},l1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+l1(e[n]);return t}return e},r4=(e,t,n,r,i)=>{let s=l1(e),o=Xn[s]||(Xn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Xn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=t4.exec(c.replace(n4,""));)u[4]?f.shift():u[3]?(d=u[3].replace(jm," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(jm," ").trim();return f[0]})(e);Xn[o]=li(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Xn.g?Xn.g:null;return n&&(Xn.g=Xn[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Xn[o],t,r,a),o},i4=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":li(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return r4(n.unshift?n.raw?i4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,e4(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function c1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=c1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ce(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c1(e))&&(r&&(r+=" "),r+=t);return r}function s4(e,t){const n=ct(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=oe([],{equals:!1}),[l]=sS(),c=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},u=(d,f,h)=>d.splice(h,0,f);return U(d=>{const f=o(),h=e();if(h[mc],ct(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:c}),g}return ct(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const S of h)(i.has(S)?b:p).push(S);let w=!p.length;for(let S=0;S<d.length;S++){const x=d[S];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),u(m,x,S)),w&&x!==m[S]&&(w=!1)}return!v.length&&w?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:c}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return $$(e)}var Mm=e=>e instanceof Element;function Ud(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Ud(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Ud(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function o4(e,t=Mm,n=Mm){const r=U(e),i=U(()=>Ud(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function a4(e){return U(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function u1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function l4(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),u1(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function c4(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),u1(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var $m=e=>{const t=a4(e);return s4(o4(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)l4(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:c,rect:u}of a)if(c.isConnected){const d=c.getBoundingClientRect(),f=u.left-d.left,h=u.top-d.top;(f||h)&&(c.style.transform=`translate(${f}px, ${h}px)`,c.style.transitionDuration="0s",l.push(c))}document.body.offsetHeight;for(const c of l){let u=function(d){(d.target===c||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",u),c.classList.remove(...o.move))};c.classList.add(...o.move),c.style.transform=c.style.transitionDuration="",c.addEventListener("transitionend",u)}});for(const l of r)c4(o,e,l,()=>i([l]))}})},Iu=Symbol("fallback");function Dm(e){for(const t of e)t.dispose()}function u4(e,t,n,r={}){const i=new Map;return Se(()=>Dm(i.values())),()=>{const o=e()||[];return o[mc],ct(()=>{var u,d;if(!o.length)return Dm(i.values()),i.clear(),r.fallback?[ur(h=>(i.set(Iu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Iu);if(!i.size||l){l==null||l.dispose(),i.delete(Iu);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const c=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);c.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(u=m.setIndex)==null||u.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of c)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,c){ur(u=>{const[d,f]=oe(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=oe(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function sc(e){const{by:t}=e;return U(u4(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function d4(e,t,n,r){return e.addEventListener(t,n,r),I$(e.removeEventListener.bind(e,t,n,r))}function f4(e,t,n,r){const i=()=>{zd(G(e)).forEach(s=>{s&&zd(G(t)).forEach(o=>d4(s,o,n,r))})};typeof e=="function"?be(i):ve(i)}function h4(e,t){const n=new ResizeObserver(e);return Se(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function d1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=h4(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);be(o=>{const a=M$(zd(G(e)));return L$(a,o,i,s),a},[])}var g4=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Im(e){const t={};let n;for(;n=g4.exec(e);)t[n[1]]=n[2];return t}function zc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Im(e)}else typeof t=="string"&&(t=Im(t));return{...e,...t}}function y4(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Kd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function m4(e){return typeof e=="number"}function Ji(e){return Object.prototype.toString.call(e)==="[object String]"}function p4(e){return typeof e=="function"}function qa(e){return t=>`${e()}-${t}`}function pn(e,t){return e?e===t||e.contains(t):!1}function jo(e,t=!1){const{activeElement:n}=Wn(e);if(!(n!=null&&n.nodeName))return null;if(f1(n)&&n.contentDocument)return jo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Wn(n).getElementById(r);if(i)return i}}return n}function v4(e){return Wn(e).defaultView||window}function Wn(e){return e?e.ownerDocument||e:document}function f1(e){return e.tagName==="IFRAME"}var Hf=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(Hf||{});function Uf(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Hc(){return Uf(/^Mac/i)}function b4(){return Uf(/^iPhone/i)}function x4(){return Uf(/^iPad/i)||Hc()&&navigator.maxTouchPoints>1}function w4(){return b4()||x4()}function S4(){return Hc()||w4()}function rt(e,t){return t&&(p4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function pt(e){return t=>{for(const n of e)rt(t,n)}}function C4(e){return Hc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Et(e){if(e)if(_4())e.focus({preventScroll:!0});else{const t=k4(e);e.focus(),O4(t)}}var bl=null;function _4(){if(bl==null){bl=!1;try{document.createElement("div").focus({get preventScroll(){return bl=!0,!0}})}catch(e){}}return bl}function k4(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function O4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var h1=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],E4=[...h1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Kf=h1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",A4=E4.join(':not([hidden]):not([tabindex="-1"]),');function g1(e,t){const r=Array.from(e.querySelectorAll(Kf)).filter(Lm);return t&&Lm(e)&&r.unshift(e),r.forEach((i,s)=>{if(f1(i)&&i.contentDocument){const o=i.contentDocument.body,a=g1(o,!1);r.splice(s,1,...a)}}),r}function Lm(e){return y1(e)&&!P4(e)}function y1(e){return e.matches(Kf)&&Wf(e)}function P4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Wf(e,t){return e.nodeName!=="#comment"&&T4(e)&&j4(e,t)&&(!e.parentElement||Wf(e.parentElement,e))}function T4(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function j4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function M4(e,t,n){const r=t!=null&&t.tabbable?A4:Kf,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Wf(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Rm(e){for(;e&&!$4(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function $4(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function D4(){}function I4(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function Be(e,t){return Ee(e,t)}var vo=new Map,Nm=new Set;function Fm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=vo.get(n.target);r||(r=new Set,vo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=vo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),vo.delete(n.target)),vo.size===0)){for(const i of Nm)i();Nm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Fm():document.addEventListener("DOMContentLoaded",Fm));function Wd(e,t){const n=Bm(e,t,"left"),r=Bm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function Bm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function L4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Rm(e);for(;e&&o&&e!==i&&o!==i;)Wd(o,e),e=o,o=Rm(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var m1={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function vn(e){return t=>(e(t),()=>e(void 0))}function Uc(e,t){const[n,r]=oe(qm(t==null?void 0:t()));return be(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||qm(t==null?void 0:t()))}),n}function qm(e){return Ji(e)?e:void 0}function ot(e){const[t,n]=We(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return j(FS,Ee(n,{get component(){return t.as}}))}var R4=["id","name","validationState","required","disabled","readOnly"];function N4(e){const t=`form-control-${wn()}`,n=Be({id:t},e),[r,i]=oe(),[s,o]=oe(),[a,l]=oe(),[c,u]=oe(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,h=U(()=>({"data-valid":G(n.validationState)==="valid"?"":void 0,"data-invalid":G(n.validationState)==="invalid"?"":void 0,"data-required":G(n.required)?"":void 0,"data-disabled":G(n.disabled)?"":void 0,"data-readonly":G(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=G(n.name))!=null?m:G(n.id)},dataset:h,validationState:()=>G(n.validationState),isRequired:()=>G(n.required),isDisabled:()=>G(n.disabled),isReadOnly:()=>G(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:qa(()=>G(n.id)),registerLabel:vn(i),registerField:vn(o),registerDescription:vn(l),registerErrorMessage:vn(u)}}}var p1=wt();function za(){const e=St(p1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function v1(e){const t=za(),n=Be({id:t.generateId("description")},e);return be(()=>Se(t.registerDescription(n.id))),j(ot,Ee({as:"div"},()=>t.dataset(),n))}function b1(e){const t=za(),n=Be({id:t.generateId("error-message")},e),[r,i]=We(n,["forceMount"]),s=()=>t.validationState()==="invalid";return be(()=>{s()&&Se(t.registerErrorMessage(i.id))}),j(pe,{get when(){return r.forceMount||s()},get children(){return j(ot,Ee({as:"div"},()=>t.dataset(),i))}})}function F4(e){let t;const n=za(),r=Be({id:n.generateId("label")},e),[i,s]=We(r,["ref"]),o=Uc(()=>t,()=>"label");return be(()=>Se(n.registerLabel(s.id))),j(ot,Ee({as:"label",ref(a){const l=It(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return U(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function B4(e,t){be(hr(e,n=>{if(n==null)return;const r=q4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Se(()=>{r.removeEventListener("reset",t)}))}))}function q4(e){return z4(e)?e.form:e.closest("form")}function z4(e){return e.matches("textarea, input, select, button")}function Ha(e){var o;const[t,n]=oe((o=e.defaultValue)==null?void 0:o.call(e)),r=U(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=U(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ct(()=>{var c;const l=D$(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function x1(e){const[t,n]=Ha(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function H4(e){const[t,n]=Ha(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function U4(e={}){const[t,n]=x1({value:()=>G(e.isSelected),defaultValue:()=>!!G(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!G(e.isReadOnly)&&!G(e.isDisabled)&&n(s)},toggle:()=>{!G(e.isReadOnly)&&!G(e.isDisabled)&&n(!t())}}}var K4=Object.defineProperty,Kc=(e,t)=>{for(var n in t)K4(e,n,{get:t[n],enumerable:!0})},w1=wt();function S1(){return St(w1)}function W4(){const e=S1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function C1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function V4(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&C1(s,n))return r+1}return 0}function G4(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:C1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function _1(e,t){const n=G4(e);e!==n&&t(n)}function Q4(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Wn(r).body}function Y4(e,t){be(()=>{const n=setTimeout(()=>{_1(e(),t)});Se(()=>clearTimeout(n))})}function X4(e,t){if(typeof IntersectionObserver!="function"){Y4(e,t);return}let n=[];be(()=>{const r=()=>{const o=!!n.length;n=e(),o&&_1(e(),t)},i=Q4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}Se(()=>s.disconnect())})}function J4(e={}){const[t,n]=H4({value:()=>G(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});X4(t,n);const r=s=>(n(o=>{const a=V4(o,s);return y4(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>j(w1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function Z4(e){const t=W4(),n=Be({shouldRegisterItem:!0},e);be(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Se(r)})}function k1(e){var l,c,u;let t=(l=e.startIndex)!=null?l:0;const n=(c=e.startLevel)!=null?c:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=Ji(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=Ji(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=Ji(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Ji(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Ji(d)||m4(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(u=a(d))!=null?u:[];if(f.length>0){const h=k1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function eD(e,t=[]){return U(()=>{const n=k1({dataSource:G(e.dataSource),getKey:G(e.getKey),getTextValue:G(e.getTextValue),getDisabled:G(e.getDisabled),getSectionChildren:G(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var tD=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),nD=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function rD(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return tD.has(r)}const t=e.split("-")[0];return nD.has(t)}function iD(e){return rD(e)?"rtl":"ltr"}function O1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:iD(e)}}var Vd=O1(),Mo=new Set;function zm(){Vd=O1();for(const e of Mo)e(Vd)}function sD(){const[e,t]=oe(Vd),n=U(()=>e());return gr(()=>{Mo.size===0&&window.addEventListener("languagechange",zm),Mo.add(t),Se(()=>{Mo.delete(t),Mo.size===0&&window.removeEventListener("languagechange",zm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var oD=wt();function Jr(){const e=sD();return St(oD)||e}var Lu=new Map;function aD(e){const{locale:t}=Jr(),n=U(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return U(()=>{const r=n();let i;return Lu.has(r)&&(i=Lu.get(r)),i||(i=new Intl.Collator(t(),e),Lu.set(r,i)),i})}var nr=class E1 extends Set{constructor(n,r,i){super(n);me(this,"anchorKey");me(this,"currentKey");n instanceof E1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function lD(e){const[t,n]=Ha(e);return[()=>{var i;return(i=t())!=null?i:new nr},n]}function A1(e){return S4()?e.altKey:e.ctrlKey}function Zi(e){return Hc()?e.metaKey:e.ctrlKey}function Hm(e){return new nr(e)}function cD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function uD(e){const t=Be({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=oe(!1),[i,s]=oe(),o=U(()=>{const m=G(t.selectedKeys);return m!=null?Hm(m):m}),a=U(()=>{const m=G(t.defaultSelectedKeys);return m!=null?Hm(m):new nr}),[l,c]=lD({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=oe(G(t.selectionBehavior)),f=()=>G(t.selectionMode),h=()=>{var m;return(m=G(t.disallowEmptySelection))!=null?m:!1},g=m=>{(G(t.allowDuplicateSelectionEvents)||!cD(m,l()))&&c(m)};return be(()=>{const m=l();G(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),be(()=>{var m;d((m=G(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function dD(e){const[t,n]=oe(""),[r,i]=oe(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(G(e.isDisabled))return;const a=G(e.keyboardDelegate),l=G(e.selectionManager);if(!a.getKeyForSearch)return;const c=fD(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),d=(f=a.getKeyForSearch(u,l.focusedKey()))!=null?f:a.getKeyForSearch(u);d==null&&hD(u)&&(u=u[0],d=(h=a.getKeyForSearch(u,l.focusedKey()))!=null?h:a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function fD(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function hD(e){return e.split("").every(t=>t===e[0])}function gD(e,t,n){const i=Ee({selectOnFocus:()=>G(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Jr();let a={top:0,left:0};f4(()=>G(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=dD({isDisabled:()=>G(i.disallowTypeAhead),keyboardDelegate:()=>G(i.keyboardDelegate),selectionManager:()=>G(i.selectionManager)}),c=()=>{var p;return(p=G(i.orientation))!=null?p:"vertical"},u=p=>{var k,_,A,D,I,z,N,T;rt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=G(i.selectionManager),w=G(i.selectOnFocus),S=$=>{$!=null&&(b.setFocusedKey($),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&!A1(p)&&b.replaceSelection($))},x=G(i.keyboardDelegate),O=G(i.shouldFocusWrap),C=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let $;C!=null?$=x.getKeyBelow(C):$=(k=x.getFirstKey)==null?void 0:k.call(x),$==null&&O&&($=(_=x.getFirstKey)==null?void 0:_.call(x,C)),S($)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let $;C!=null?$=x.getKeyAbove(C):$=(A=x.getLastKey)==null?void 0:A.call(x),$==null&&O&&($=(D=x.getLastKey)==null?void 0:D.call(x,C)),S($)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const $=o()==="rtl";let L;C!=null?L=x.getKeyLeftOf(C):L=$?(I=x.getFirstKey)==null?void 0:I.call(x):(z=x.getLastKey)==null?void 0:z.call(x),S(L)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const $=o()==="rtl";let L;C!=null?L=x.getKeyRightOf(C):L=$?(N=x.getLastKey)==null?void 0:N.call(x):(T=x.getFirstKey)==null?void 0:T.call(x),S(L)}break}case"Home":if(x.getFirstKey){p.preventDefault();const $=x.getFirstKey(C,Zi(p));$!=null&&(b.setFocusedKey($),Zi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&b.replaceSelection($))}break;case"End":if(x.getLastKey){p.preventDefault();const $=x.getLastKey(C,Zi(p));$!=null&&(b.setFocusedKey($),Zi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&b.replaceSelection($))}break;case"PageDown":if(x.getKeyPageBelow&&C!=null){p.preventDefault();const $=x.getKeyPageBelow(C);S($)}break;case"PageUp":if(x.getKeyPageAbove&&C!=null){p.preventDefault();const $=x.getKeyPageAbove(C);S($)}break;case"a":Zi(p)&&b.selectionMode()==="multiple"&&G(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),G(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!G(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const $=M4(v,{tabbable:!0});let L,Z;do Z=$.lastChild(),Z&&(L=Z);while(Z);L&&!L.contains(document.activeElement)&&Et(L)}break}}},d=p=>{var S,x,O,C;const v=G(i.selectionManager),b=G(i.keyboardDelegate),w=G(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const k=A=>{A!=null&&(v.setFocusedKey(A),w&&v.replaceSelection(A))},_=p.relatedTarget;_&&p.currentTarget.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?k((x=v.lastSelectedKey())!=null?x:(S=b.getLastKey)==null?void 0:S.call(b)):k((C=v.firstSelectedKey())!=null?C:(O=b.getFirstKey)==null?void 0:O.call(b))}else if(!G(i.isVirtualized)){const k=s();if(k){k.scrollTop=a.top,k.scrollLeft=a.left;const _=k.querySelector(`[data-key="${v.focusedKey()}"]`);_&&(Et(_),Wd(k,_))}}}},f=p=>{const v=G(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var O,C;const p=G(i.autoFocus);if(!p)return;const v=G(i.selectionManager),b=G(i.keyboardDelegate);let w;p==="first"&&(w=(O=b.getFirstKey)==null?void 0:O.call(b)),p==="last"&&(w=(C=b.getLastKey)==null?void 0:C.call(b));const S=v.selectedKeys();S.size&&(w=S.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const x=t();x&&w==null&&!G(i.shouldUseVirtualFocus)&&Et(x)};return gr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),be(hr([s,()=>G(i.isVirtualized),()=>G(i.selectionManager).focusedKey()],p=>{var S;const[v,b,w]=p;if(b)w&&((S=i.scrollToKey)==null||S.call(i,w));else if(w&&v){const x=v.querySelector(`[data-key="${w}"]`);x&&Wd(v,x)}})),{tabIndex:U(()=>{if(!G(i.shouldUseVirtualFocus))return G(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function P1(e,t){const n=()=>G(e.selectionManager),r=()=>G(e.key),i=()=>G(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Zi(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>G(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!G(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&G(e.shouldSelectOnPressUp)&&G(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(G(e.shouldSelectOnPressUp)&&!G(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(A1(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const w=t();i()||a()||!w||b.target===w&&n().setFocusedKey(r())},p=U(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=U(()=>G(e.virtualized)?void 0:r());return be(hr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,w,S,x,O])=>{b&&w===x&&O&&!S&&document.activeElement!==b&&(e.focus?e.focus():Et(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var yD=class{constructor(e,t){me(this,"collection");me(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new nr(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new nr(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new nr([t],t,t):new nr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new nr;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new nr)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Um=class{constructor(e){me(this,"keyMap",new Map);me(this,"iterable");me(this,"firstKey");me(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function mD(e){const t=uD(e),r=eD({dataSource:()=>G(e.dataSource),getKey:()=>G(e.getKey),getTextValue:()=>G(e.getTextValue),getDisabled:()=>G(e.getDisabled),getSectionChildren:()=>G(e.getSectionChildren),factory:s=>e.filter?new Um(e.filter(s)):new Um(s)},[()=>e.filter]),i=new yD(r,t);return j0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Ot=e=>typeof e=="function"?e():e,pD=e=>{const t=U(()=>{const o=Ot(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=oe(Ot(e.show)?"present":"hidden");let s="none";return be(o=>{const a=Ot(e.show);return ct(()=>{var u;if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),be(()=>{const o=Ot(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),Se(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},vD=pD,T1=vD,oc="data-kb-top-layer",j1,Gd=!1,yr=[];function ua(e){return yr.findIndex(t=>t.node===e)}function bD(e){return yr[ua(e)]}function xD(e){return yr[yr.length-1].node===e}function M1(){return yr.filter(e=>e.isPointerBlocking)}function wD(){return[...M1()].slice(-1)[0]}function Vf(){return M1().length>0}function $1(e){var n;const t=ua((n=wD())==null?void 0:n.node);return ua(e)<t}function SD(e){yr.push(e)}function CD(e){const t=ua(e);t<0||yr.splice(t,1)}function _D(){for(const{node:e}of yr)e.style.pointerEvents=$1(e)?"none":"auto"}function kD(e){if(Vf()&&!Gd){const t=Wn(e);j1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Gd=!0}}function OD(e){if(Vf())return;const t=Wn(e);t.body.style.pointerEvents=j1,t.body.style.length===0&&t.body.removeAttribute("style"),Gd=!1}var Qt={layers:yr,isTopMostLayer:xD,hasPointerBlockingLayer:Vf,isBelowPointerBlockingLayer:$1,addLayer:SD,removeLayer:CD,indexOf:ua,find:bD,assignPointerEventToLayers:_D,disableBodyPointerEvents:kD,restoreBodyPointerEvents:OD},ED={};Kc(ED,{Button:()=>TD,Root:()=>Gf});var AD=["button","color","file","image","reset","submit"];function PD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?AD.indexOf(e.type)!==-1:!1}function Gf(e){let t;const n=Be({type:"button"},e),[r,i]=We(n,["ref","type","disabled"]),s=Uc(()=>t,()=>"button"),o=U(()=>{const c=s();return c==null?!1:PD({tagName:c,type:r.type})}),a=U(()=>s()==="input"),l=U(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return j(ot,Ee({as:"button",ref(c){const u=It(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var TD=Gf,jD=["top","right","bottom","left"],Un=Math.min,nn=Math.max,ac=Math.round,xl=Math.floor,Vr=e=>({x:e,y:e}),MD={left:"right",right:"left",bottom:"top",top:"bottom"},$D={start:"end",end:"start"};function Qd(e,t,n){return nn(e,Un(t,n))}function zi(e,t){return typeof e=="function"?e(t):e}function Gr(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function D1(e){return e==="x"?"y":"x"}function Qf(e){return e==="y"?"height":"width"}function Di(e){return["top","bottom"].includes(Gr(e))?"y":"x"}function Yf(e){return D1(Di(e))}function DD(e,t,n){n===void 0&&(n=!1);const r=Xs(e),i=Yf(e),s=Qf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=lc(o)),[o,lc(o)]}function ID(e){const t=lc(e);return[Yd(e),t,Yd(t)]}function Yd(e){return e.replace(/start|end/g,t=>$D[t])}function LD(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function RD(e,t,n,r){const i=Xs(e);let s=LD(Gr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Yd)))),s}function lc(e){return e.replace(/left|right|bottom|top/g,t=>MD[t])}function ND(e){return{top:0,right:0,bottom:0,left:0,...e}}function I1(e){return typeof e!="number"?ND(e):{top:e,right:e,bottom:e,left:e}}function cc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Km(e,t,n){let{reference:r,floating:i}=e;const s=Di(t),o=Yf(t),a=Qf(o),l=Gr(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Xs(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var FD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Km(c,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:w,data:S,reset:x}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=b!=null?b:u,d=w!=null?w:d,h={...h,[p]:{...h[p],...S}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Km(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function da(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=zi(t,e),g=I1(h),p=a[f?d==="floating"?"reference":"floating":d],v=cc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},x=cc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-x.top+g.top)/S.y,bottom:(x.bottom-v.bottom+g.bottom)/S.y,left:(v.left-x.left+g.left)/S.x,right:(x.right-v.right+g.right)/S.x}}var BD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=zi(e,t)||{};if(c==null)return{};const d=I1(u),f={x:n,y:r},h=Yf(i),g=Qf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",w=p?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=O?O[w]:0;(!C||!await(o.isElement==null?void 0:o.isElement(O)))&&(C=a.floating[w]||s.floating[g]);const k=S/2-x/2,_=C/2-m[g]/2-1,A=Un(d[v],_),D=Un(d[b],_),I=A,z=C-m[g]-D,N=C/2-m[g]/2+k,T=Qd(I,N,z),$=!l.arrow&&Xs(i)!=null&&N!==T&&s.reference[g]/2-(N<I?A:D)-m[g]/2<0,L=$?N<I?N-I:N-z:0;return{[h]:f[h]+L,data:{[h]:T,centerOffset:N-T-L,...$&&{alignmentOffset:L}},reset:$}}}),qD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=zi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Gr(i),b=Di(a),w=Gr(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[lc(a)]:ID(a)),O=g!=="none";!f&&O&&x.push(...RD(a,m,g,S));const C=[a,...x],k=await da(t,p),_=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(k[v]),d){const N=DD(i,o,S);_.push(k[N[0]],k[N[1]])}if(A=[...A,{placement:i,overflows:_}],!_.every(N=>N<=0)){var D,I;const N=(((D=s.flip)==null?void 0:D.index)||0)+1,T=C[N];if(T)return{data:{index:N,overflows:A},reset:{placement:T}};let $=(I=A.filter(L=>L.overflows[0]<=0).sort((L,Z)=>L.overflows[1]-Z.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(h){case"bestFit":{var z;const L=(z=A.filter(Z=>{if(O){const ue=Di(Z.placement);return ue===b||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,F)=>ue+F,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:z[0];L&&($=L);break}case"initialPlacement":$=a;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function Wm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vm(e){return jD.some(t=>e[t]>=0)}var zD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=zi(e,t);switch(r){case"referenceHidden":{const s=await da(t,{...i,elementContext:"reference"}),o=Wm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Vm(o)}}}case"escaped":{const s=await da(t,{...i,altBoundary:!0}),o=Wm(s,n.floating);return{data:{escapedOffsets:o,escaped:Vm(o)}}}default:return{}}}}};async function HD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Gr(n),a=Xs(n),l=Di(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=zi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}var UD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await HD(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},KD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=zi(e,t),c={x:n,y:r},u=await da(t,l),d=Di(Gr(i)),f=D1(d);let h=c[f],g=c[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[p],w=h-u[v];h=Qd(b,h,w)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[p],w=g-u[v];g=Qd(b,g,w)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},WD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=zi(e,t),l=await da(t,a),c=Gr(n),u=Xs(n),d=Di(n)==="y",{width:f,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Un(h-l[g],p),w=Un(f-l[m],v),S=!t.middlewareData.shift;let x=b,O=w;if(d?O=u||S?Un(w,v):v:x=u||S?Un(b,p):p,S&&!u){const k=nn(l.left,0),_=nn(l.right,0),A=nn(l.top,0),D=nn(l.bottom,0);d?O=f-2*(k!==0||_!==0?k+_:nn(l.left,l.right)):x=h-2*(A!==0||D!==0?A+D:nn(l.top,l.bottom))}await o({...t,availableWidth:O,availableHeight:x});const C=await i.getDimensions(s.floating);return f!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function Js(e){return L1(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(L1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function L1(e){return e instanceof Node||e instanceof on(e).Node}function Pn(e){return e instanceof Element||e instanceof on(e).Element}function Vn(e){return e instanceof HTMLElement||e instanceof on(e).HTMLElement}function Gm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}function Ua(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Tn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function VD(e){return["table","td","th"].includes(Js(e))}function Wc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Xf(e){const t=Jf(),n=Pn(e)?Tn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GD(e){let t=Qr(e);for(;Vn(t)&&!zs(t);){if(Xf(t))return t;if(Wc(t))return null;t=Qr(t)}return null}function Jf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zs(e){return["html","body","#document"].includes(Js(e))}function Tn(e){return on(e).getComputedStyle(e)}function Vc(e){return Pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qr(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gm(e)&&e.host||br(e);return Gm(t)?t.host:t}function R1(e){const t=Qr(e);return zs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vn(t)&&Ua(t)?t:R1(t)}function fa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=R1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=on(i);return s?t.concat(o,o.visualViewport||[],Ua(i)?i:[],o.frameElement&&n?fa(o.frameElement):[]):t.concat(i,fa(i,[],n))}function N1(e){const t=Tn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=ac(n)!==s||ac(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Zf(e){return Pn(e)?e:e.contextElement}function os(e){const t=Zf(e);if(!Vn(t))return Vr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=N1(t);let o=(s?ac(n.width):n.width)/r,a=(s?ac(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var QD=Vr(0);function F1(e){const t=on(e);return!Jf()||!t.visualViewport?QD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==on(e)?!1:t}function Ii(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Zf(e);let o=Vr(1);t&&(r?Pn(r)&&(o=os(r)):o=os(e));const a=YD(s,n,r)?F1(s):Vr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=on(s),h=r&&Pn(r)?on(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=os(m),v=m.getBoundingClientRect(),b=Tn(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,S=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=w,c+=S,g=on(m),m=g.frameElement}}return cc({width:u,height:d,x:l,y:c})}function XD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=br(r),a=t?Wc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Vr(1);const u=Vr(0),d=Vn(r);if((d||!d&&!s)&&((Js(r)!=="body"||Ua(o))&&(l=Vc(r)),Vn(r))){const f=Ii(r);c=os(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function JD(e){return Array.from(e.getClientRects())}function B1(e){return Ii(br(e)).left+Vc(e).scrollLeft}function ZD(e){const t=br(e),n=Vc(e),r=e.ownerDocument.body,i=nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+B1(e);const a=-n.scrollTop;return Tn(r).direction==="rtl"&&(o+=nn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function e6(e,t){const n=on(e),r=br(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Jf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function t6(e,t){const n=Ii(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Vn(e)?os(e):Vr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Qm(e,t,n){let r;if(t==="viewport")r=e6(e,n);else if(t==="document")r=ZD(br(e));else if(Pn(t))r=t6(t,n);else{const i=F1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return cc(r)}function q1(e,t){const n=Qr(e);return n===t||!Pn(n)||zs(n)?!1:Tn(n).position==="fixed"||q1(n,t)}function n6(e,t){const n=t.get(e);if(n)return n;let r=fa(e,[],!1).filter(a=>Pn(a)&&Js(a)!=="body"),i=null;const s=Tn(e).position==="fixed";let o=s?Qr(e):e;for(;Pn(o)&&!zs(o);){const a=Tn(o),l=Xf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ua(o)&&!l&&q1(e,o))?r=r.filter(u=>u!==o):i=a,o=Qr(o)}return t.set(e,r),r}function r6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Wc(t)?[]:n6(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Qm(t,u,i);return c.top=nn(d.top,c.top),c.right=Un(d.right,c.right),c.bottom=Un(d.bottom,c.bottom),c.left=nn(d.left,c.left),c},Qm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function i6(e){const{width:t,height:n}=N1(e);return{width:t,height:n}}function s6(e,t,n){const r=Vn(t),i=br(t),s=n==="fixed",o=Ii(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vr(0);if(r||!r&&!s)if((Js(t)!=="body"||Ua(i))&&(a=Vc(t)),r){const d=Ii(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=B1(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function Ru(e){return Tn(e).position==="static"}function Ym(e,t){return!Vn(e)||Tn(e).position==="fixed"?null:t?t(e):e.offsetParent}function z1(e,t){const n=on(e);if(Wc(e))return n;if(!Vn(e)){let i=Qr(e);for(;i&&!zs(i);){if(Pn(i)&&!Ru(i))return i;i=Qr(i)}return n}let r=Ym(e,t);for(;r&&VD(r)&&Ru(r);)r=Ym(r,t);return r&&zs(r)&&Ru(r)&&!Xf(r)?n:r||GD(e)||n}var o6=async function(e){const t=this.getOffsetParent||z1,n=this.getDimensions,r=await n(e.floating);return{reference:s6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function a6(e){return Tn(e).direction==="rtl"}var H1={convertOffsetParentRelativeRectToViewportRelativeRect:XD,getDocumentElement:br,getClippingRect:r6,getOffsetParent:z1,getElementRects:o6,getClientRects:JD,getDimensions:i6,getScale:os,isElement:Pn,isRTL:a6};function l6(e,t){let n=null,r;const i=br(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=xl(u),g=xl(i.clientWidth-(c+d)),m=xl(i.clientHeight-(u+f)),p=xl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:nn(0,Un(1,l))||1};let w=!0;function S(x){const O=x[0].intersectionRatio;if(O!==l){if(!w)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(S,b)}n.observe(e)}return o(!0),s}function c6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Zf(e),u=i||s?[...c?fa(c):[],...fa(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?l6(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?Ii(e):null;l&&p();function p(){const v=Ii(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var u6=UD,d6=KD,f6=qD,h6=WD,g6=zD,y6=BD,m6=(e,t,n)=>{const r=new Map,i={platform:H1,...n},s={...i.platform,_c:r};return FD(e,t,{...i,platform:s})},eh=wt();function th(){const e=St(eh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var p6=de('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),Xd=30,Xm=Xd/2,v6={top:180,right:-90,bottom:0,left:90};function nh(e){const t=th(),n=Be({size:Xd},e),[r,i]=We(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=b6(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},c=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Xd/r.size),d=()=>`rotate(${v6[s()]} ${Xm} ${Xm}) translate(0 2)`;return j(ot,Ee({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return zc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){const f=p6(),h=f.firstChild;return ve(()=>J(h,"transform",d())),f}}))}function b6(e){const[t,n]=oe();return be(()=>{const r=e();r&&n(v4(r).getComputedStyle(r))}),t}function x6(e){const t=th(),[n,r]=We(e,["ref","style"]);return j(ot,Ee({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return zc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Jm(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function w6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Jm(r):e?e.getBoundingClientRect():Jm()}}}function S6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var C6={top:"bottom",right:"left",bottom:"top",left:"right"};function _6(e,t){const[n,r]=e.split("-"),i=C6[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function k6(e){const t=Be({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=oe(),[i,s]=oe(),[o,a]=oe(t.placement),l=()=>{var f;return w6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Jr();async function u(){var O,C,k;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(O=t.gutter)!=null?O:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[u6(({placement:_})=>{const A=!!_.split("-")[1];return{mainAxis:p,crossAxis:A?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const _=typeof t.flip=="string"?t.flip.split(" "):void 0;if(_!==void 0&&!_.every(S6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(f6({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&v.push(d6({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(h6({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:A,rects:D}){const I=Math.round(D.reference.width);_=Math.floor(_),A=Math.floor(A),h.style.setProperty("--kb-popper-anchor-width",`${I}px`),h.style.setProperty("--kb-popper-content-available-width",`${_}px`),h.style.setProperty("--kb-popper-content-available-height",`${A}px`),t.sameWidth&&(h.style.width=`${I}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${A}px`)}})),t.hideWhenDetached&&v.push(g6({padding:t.detachedPadding})),g&&v.push(y6({element:g,padding:t.arrowPadding}));const b=await m6(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...H1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(C=t.onCurrentPlacementChange)==null||C.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",_6(b.placement,c()));const w=Math.round(b.x),S=Math.round(b.y);let x;if(t.hideWhenDetached&&(x=(k=b.middlewareData.hide)!=null&&k.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${S}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:_,y:A}=b.middlewareData.arrow,D=b.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:A!=null?`${A}px`:"",[D]:"100%"})}}be(()=>{const f=l(),h=n();if(!f||!h)return;const g=c6(f,h,u,{elementResize:typeof ResizeObserver=="function"});Se(g)}),be(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return j(eh.Provider,{value:d,get children(){return t.children}})}var U1=Object.assign(k6,{Arrow:nh,Context:eh,usePopperContext:th,Positioner:x6});function O6(e){const t=n=>{var r;n.key===Hf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};be(()=>{var r,i;if(G(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Wn();n.addEventListener("keydown",t),Se(()=>{n.removeEventListener("keydown",t)})})}var Zm="interactOutside.pointerDownOutside",ep="interactOutside.focusOutside";function E6(e,t){let n,r=D4;const i=()=>Wn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${oc}]`)||!pn(i(),f)||pn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=pt([s,a]);g.addEventListener(Zm,m,{once:!0});const p=new CustomEvent(Zm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||C4(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=pt([o,a]);h.addEventListener(ep,g,{once:!0});const m=new CustomEvent(ep,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};be(()=>{G(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),Se(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var K1=wt();function A6(){return St(K1)}function P6(e){let t;const n=A6(),[r,i]=We(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};E6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>pn(h(),d)))||[...s].some(h=>pn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Qt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Qt.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),O6({ownerDocument:()=>Wn(t),onEscapeKeyDown:d=>{var f;!t||!Qt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),gr(()=>{if(!t)return;Qt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Qt.assignPointerEventToLayers(),Qt.disableBodyPointerEvents(t),Se(()=>{t&&(Qt.removeLayer(t),d==null||d(),Qt.assignPointerEventToLayers(),Qt.restoreBodyPointerEvents(t))})}),be(hr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Qt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Qt.assignPointerEventToLayers()),f&&Qt.disableBodyPointerEvents(d),Se(()=>{Qt.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return j(K1.Provider,{value:u,get children(){return j(ot,Ee({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function W1(e={}){const[t,n]=x1({value:()=>G(e.open),defaultValue:()=>!!G(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var fn={};Kc(fn,{Description:()=>v1,ErrorMessage:()=>b1,Item:()=>Y1,ItemControl:()=>X1,ItemDescription:()=>J1,ItemIndicator:()=>Z1,ItemInput:()=>ex,ItemLabel:()=>tx,Label:()=>nx,RadioGroup:()=>T6,Root:()=>rx});var V1=wt();function G1(){const e=St(V1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var Q1=wt();function Ka(){const e=St(Q1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function Y1(e){const t=za(),n=G1(),r=`${t.generateId("item")}-${wn()}`,i=Be({id:r},e),[s,o]=We(i,["value","disabled","onPointerDown"]),[a,l]=oe(),[c,u]=oe(),[d,f]=oe(),[h,g]=oe(),[m,p]=oe(!1),v=U(()=>n.isSelectedValue(s.value)),b=U(()=>s.disabled||t.isDisabled()||!1),w=O=>{rt(O,s.onPointerDown),m()&&O.preventDefault()},S=U(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:S,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:qa(()=>o.id),registerInput:vn(l),registerLabel:vn(u),registerDescription:vn(f),setIsFocused:p,setInputRef:g};return j(Q1.Provider,{value:x,get children(){return j(ot,Ee({as:"div",role:"group",onPointerDown:w},S,o))}})}function X1(e){const t=Ka(),n=Be({id:t.generateId("control")},e),[r,i]=We(n,["onClick","onKeyDown"]);return j(ot,Ee({as:"div",onClick:a=>{var l;rt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;rt(a,r.onKeyDown),a.key===Hf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function J1(e){const t=Ka(),n=Be({id:t.generateId("description")},e);return be(()=>Se(t.registerDescription(n.id))),j(ot,Ee({as:"div"},()=>t.dataset(),n))}function Z1(e){const t=Ka(),n=Be({id:t.generateId("indicator")},e),[r,i]=We(n,["ref","forceMount"]),[s,o]=oe(),{present:a}=T1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return j(pe,{get when(){return a()},get children(){return j(ot,Ee({as:"div",ref(l){const c=It(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function ex(e){const t=za(),n=G1(),r=Ka(),i=Be({id:r.generateId("input")},e),[s,o]=We(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,u]=oe(!1),d=g=>{if(rt(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{rt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{rt(g,s.onBlur),r.setIsFocused(!1)};return be(hr([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;u(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),be(()=>Se(r.registerInput(o.id))),j(ot,Ee({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return zc({...m1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function tx(e){const t=Ka(),n=Be({id:t.generateId("label")},e);return be(()=>Se(t.registerLabel(n.id))),j(ot,Ee({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function nx(e){return j(F4,Ee({as:"span"},e))}function rx(e){let t;const n=`radiogroup-${wn()}`,r=Be({id:n,orientation:"vertical"},e),[i,s,o]=We(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],R4),[a,l]=Ha({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=N4(s);B4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(G(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>c.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(c.isReadOnly()||c.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return j(p1.Provider,{value:c,get children(){return j(V1.Provider,{value:h,get children(){return j(ot,Ee({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return G(s.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return u()},get"aria-describedby"(){return d()}},()=>c.dataset(),o))}})}})}var T6=Object.assign(rx,{Description:v1,ErrorMessage:b1,Item:Y1,ItemControl:X1,ItemDescription:J1,ItemIndicator:Z1,ItemInput:ex,ItemLabel:tx,Label:nx}),j6=class{constructor(e,t,n){me(this,"collection");me(this,"ref");me(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function M6(e,t,n){const r=aD({usage:"search",sensitivity:"base"}),i=U(()=>{const s=G(e.keyboardDelegate);return s||new j6(e.collection,t,r)});return gD({selectionManager:()=>G(e.selectionManager),keyboardDelegate:i,autoFocus:()=>G(e.autoFocus),deferAutoFocus:()=>G(e.deferAutoFocus),shouldFocusWrap:()=>G(e.shouldFocusWrap),disallowEmptySelection:()=>G(e.disallowEmptySelection),selectOnFocus:()=>G(e.selectOnFocus),disallowTypeAhead:()=>G(e.disallowTypeAhead),shouldUseVirtualFocus:()=>G(e.shouldUseVirtualFocus),allowsTabNavigation:()=>G(e.allowsTabNavigation),isVirtualized:()=>G(e.isVirtualized),scrollToKey:s=>{var o;return(o=G(e.scrollToKey))==null?void 0:o(s)},orientation:()=>G(e.orientation)},t)}var Nu="focusScope.autoFocusOnMount",Fu="focusScope.autoFocusOnUnmount",tp={bubbles:!1,cancelable:!0},np={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Kd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Kd(this.stack,e),(t=this.active())==null||t.resume()}};function $6(e,t){const[n,r]=oe(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Wn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,m1),g},u=()=>{const g=t();return g?g1(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=jo(g);return!m||pn(g,m)?!1:y1(m)};be(()=>{const g=t();if(!g)return;np.add(i);const m=jo(g);if(!pn(g,m)){const v=new CustomEvent(Nu,tp);g.addEventListener(Nu,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Et(d()),jo(g)===m&&Et(g)},0)}Se(()=>{g.removeEventListener(Nu,o),setTimeout(()=>{const v=new CustomEvent(Fu,tp);h()&&v.preventDefault(),g.addEventListener(Fu,a),g.dispatchEvent(v),v.defaultPrevented||Et(m!=null?m:l().body),g.removeEventListener(Fu,a),np.remove(i)},0)})}),be(()=>{const g=t();if(!g||!G(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${oc}]`)||(pn(g,b)?s=b:Et(s))},p=v=>{const b=v.relatedTarget,w=b!=null?b:jo(g);w!=null&&w.closest(`[${oc}]`)||pn(g,w)||Et(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),Se(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),be(()=>{const g=t();if(!g||!G(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(w){const S=d(),x=f();w.relatedTarget===S?Et(x):Et(S)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const S of w)S.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),S.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),Se(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var D6="data-live-announcer";function I6(e){be(()=>{G(e.isDisabled)||Se(L6(G(e.targets),G(e.root)))})}var bo=new WeakMap,dn=[];function L6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${D6}], [${oc}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{var u;const c=(u=bo.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),bo.set(l,c+1))};dn.length&&dn[dn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return dn.push(a),()=>{o.disconnect();for(const l of r){const c=bo.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),bo.delete(l)):bo.set(l,c-1)}a===dn[dn.length-1]?(dn.pop(),dn.length&&dn[dn.length-1].observe()):dn.splice(dn.indexOf(a),1)}}var wl=new Map,R6=e=>{be(()=>{var s,o;const t=(s=Ot(e.style))!=null?s:{},n=(o=Ot(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=wl.get(e.key);i?i.activeCount++:wl.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);Se(()=>{var l;const a=wl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}wl.delete(e.key);for(const[c,u]of Object.entries(a.originalStyles))e.element.style[c]=u;for(const c of a.properties)e.element.style.removeProperty(c);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},rp=R6,N6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},F6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},B6=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[c,u,d]=N6(i,t),f=d-c-r*u;(u!==0||f!==0)&&F6(i,t)&&(s+=f,o+=u),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[ip,sp]=oe([]),q6=e=>ip().indexOf(e)===ip().length-1,z6=e=>{const t=Ee({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=wn();let r=[0,0],i=null,s=null;be(()=>{Ot(t.enabled)&&(sp(c=>[...c,n]),Se(()=>{sp(c=>c.filter(u=>u!==n))}))}),be(()=>{if(!Ot(t.enabled)||!Ot(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Ot(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Ot(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;rp({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Ot(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else rp({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),be(()=>{!q6(n)||!Ot(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Se(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=op(c),i=null,s=null},a=c=>{const u=c.target,d=Ot(t.element),f=H6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=ap(u,h,g,d);let p;d&&Jd(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=Ot(t.element),d=c.target;let f;if(c.touches.length===2)f=!Ot(t.allowPinchZoom);else{if(i==null||s===null){const h=op(c).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=ap(d,i,s,u);u&&Jd(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},H6=e=>[e.deltaX,e.deltaY],op=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ap=(e,t,n,r)=>{const i=r!==null&&Jd(r,e),[s,o]=B6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Jd=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},U6=z6,K6=U6,ix=wt();function sx(){return St(ix)}function xr(){const e=sx();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ox=wt();function rh(){const e=St(ox);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var ax=wt();function Qn(){const e=St(ax);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function ih(e){let t;const n=Qn(),r=xr(),i=Be({id:n.generateId(`item-${wn()}`)},e),[s,o]=We(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=oe(),[c,u]=oe(),[d,f]=oe(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var _;(_=s.onSelect)==null||_.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};Z4({getItem:()=>{var _,A,D,I,z;return{ref:()=>t,type:"item",key:g(),textValue:(I=(D=(A=s.textValue)!=null?A:(_=d())==null?void 0:_.textContent)!=null?D:t==null?void 0:t.textContent)!=null?I:"",disabled:(z=s.disabled)!=null?z:!1}}});const v=P1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=_=>{rt(_,s.onPointerMove),_.pointerType==="mouse"&&(s.disabled?r.onItemLeave(_):(r.onItemEnter(_),_.defaultPrevented||(Et(_.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=_=>{rt(_,s.onPointerLeave),_.pointerType==="mouse"&&r.onItemLeave(_)},S=_=>{rt(_,s.onPointerUp),!s.disabled&&_.button===0&&p()},x=_=>{if(rt(_,s.onKeyDown),!_.repeat&&!s.disabled)switch(_.key){case"Enter":case" ":p();break}},O=U(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),C=U(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),k={isChecked:()=>s.checked,dataset:C,setLabelRef:f,generateId:qa(()=>o.id),registerLabel:vn(l),registerDescription:vn(u)};return j(ox.Provider,{value:k,get children(){return j(ot,Ee({as:"div",ref(_){const A=It(D=>t=D,s.ref);typeof A=="function"&&A(_)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return pt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return pt([S,v.onPointerUp])},get onClick(){return pt([s.onClick,v.onClick])},get onKeyDown(){return pt([x,v.onKeyDown])},get onMouseDown(){return pt([s.onMouseDown,v.onMouseDown])},get onFocus(){return pt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},C,o))}})}function lx(e){const t=Be({closeOnSelect:!1},e),[n,r]=We(t,["checked","defaultChecked","onChange","onSelect"]),i=U4({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return j(ih,Ee({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var W6=wt();function Gc(){return St(W6)}var ha={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ha.next(e==="ltr"?"rtl":"ltr",t)},lp={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function cx(e){const t=Qn(),n=xr(),r=Gc(),{direction:i}=Jr(),s=Be({id:t.generateId("trigger")},e),[o,a]=We(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const c=Uc(()=>n.triggerRef(),()=>"button"),u=U(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});be(hr(()=>r==null?void 0:r.value(),v=>{var b;u()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{rt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{rt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(rt(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case lp.first(t.orientation()):v.stopPropagation(),v.preventDefault(),L4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case lp.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ha.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ha.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;rt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{rt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return be(()=>Se(n.registerTriggerId(o.id))),j(Gf,Ee({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var V6=wt();function ux(){return St(V6)}function dx(e){let t;const n=Qn(),r=xr(),i=Gc(),s=ux(),{direction:o}=Jr(),a=Be({id:n.generateId(`content-${wn()}`)},e),[l,c]=We(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=M6({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);$6({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{var S;i===void 0&&((S=l.onOpenAutoFocus)==null||S.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(pn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case ha.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ha.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=w=>{var S;(S=l.onEscapeKeyDown)==null||S.call(l,w),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=w=>{var S;(S=l.onFocusOutside)==null||S.call(l,w),n.isModal()&&w.preventDefault()},p=w=>{var S,x;rt(w,l.onPointerEnter),r.isOpen()&&((S=r.parentMenuContext())==null||S.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(rt(w,l.onPointerMove),w.pointerType!=="mouse")return;const S=w.target,x=u!==w.clientX;pn(w.currentTarget,S)&&x&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};be(()=>Se(r.registerContentId(l.id)));const b={ref:It(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:pt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:pt([l.onMouseDown,f.onMouseDown]),onFocusIn:pt([l.onFocusIn,f.onFocusIn]),onFocusOut:pt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return j(pe,{get when(){return r.contentPresent()},get children(){return j(pe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return j(ot,Ee({as:"div"},()=>r.dataset(),b,c))},get children(){return j(U1.Positioner,{get children(){return j(P6,Ee({get disableOutsidePointerEvents(){return U(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return zc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,c))}})}})}})}function G6(e){let t;const n=Qn(),r=xr(),[i,s]=We(e,["ref"]);return K6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),j(dx,Ee({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var fx=wt();function Q6(){const e=St(fx);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function sh(e){const t=Qn(),n=Be({id:t.generateId(`group-${wn()}`)},e),[r,i]=oe(),s={generateId:qa(()=>n.id),registerLabelId:vn(i)};return j(fx.Provider,{value:s,get children(){return j(ot,Ee({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function hx(e){const t=Q6(),n=Be({id:t.generateId("label")},e),[r,i]=We(n,["id"]);return be(()=>Se(t.registerLabelId(r.id))),j(ot,Ee({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function gx(e){const t=xr(),n=Be({children:"▼"},e);return j(ot,Ee({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function yx(e){return j(ih,Ee({role:"menuitem",closeOnSelect:!0},e))}function mx(e){const t=rh(),n=Be({id:t.generateId("description")},e),[r,i]=We(n,["id"]);return be(()=>Se(t.registerDescription(r.id))),j(ot,Ee({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function px(e){const t=rh(),n=Be({id:t.generateId("indicator")},e),[r,i]=We(n,["forceMount"]);return j(pe,{get when(){return r.forceMount||t.isChecked()},get children(){return j(ot,Ee({as:"div"},()=>t.dataset(),i))}})}function vx(e){const t=rh(),n=Be({id:t.generateId("label")},e),[r,i]=We(n,["ref","id"]);return be(()=>Se(t.registerLabel(r.id))),j(ot,Ee({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function bx(e){const t=xr();return j(pe,{get when(){return t.contentPresent()},get children(){return j(U0,e)}})}var xx=wt();function Y6(){const e=St(xx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function wx(e){const n=Qn().generateId(`radiogroup-${wn()}`),r=Be({id:n},e),[i,s]=We(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ha({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>{var u;return(u=i.onChange)==null?void 0:u.call(i,c)}}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:a};return j(xx.Provider,{value:l,get children(){return j(sh,s)}})}function Sx(e){const t=Y6(),n=Be({closeOnSelect:!1},e),[r,i]=We(n,["value","onSelect"]);return j(ih,Ee({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function X6(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function J6(e,t){return t?I4([e.clientX,e.clientY],t):!1}function Cx(e){const t=Qn(),n=S1(),r=sx(),i=Gc(),s=ux(),o=Be({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=We(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=oe(),[g,m]=oe(),[p,v]=oe(),[b,w]=oe(),[S,x]=oe(!0),[O,C]=oe(l.placement),[k,_]=oe([]),[A,D]=oe([]),{DomCollectionProvider:I}=J4({items:A,onItemsChange:D}),z=W1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:ee=>{var ie;return(ie=a.onOpenChange)==null?void 0:ie.call(a,ee)}}),{present:N}=T1({show:()=>t.forceMount()||z.isOpen(),element:()=>{var ee;return(ee=b())!=null?ee:null}}),T=mD({selectionMode:"none",dataSource:A}),$=ee=>{x(ee),z.open()},L=(ee=!1)=>{z.close(),ee&&r&&r.close(!0)},Z=ee=>{x(ee),z.toggle()},ue=()=>{const ee=b();ee&&(Et(ee),T.selectionManager().setFocused(!0),T.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>ue()):ue()},V=ee=>{_(Q=>[...Q,ee]);const ie=r==null?void 0:r.registerNestedMenu(ee);return()=>{_(Q=>Kd(Q,ee)),ie==null||ie()}},re=ee=>d===(u==null?void 0:u.side)&&J6(ee,u==null?void 0:u.area),se=ee=>{re(ee)&&ee.preventDefault()},R=ee=>{re(ee)||F()},ae=ee=>{re(ee)&&ee.preventDefault()};I6({isDisabled:()=>!(r==null&&z.isOpen()&&t.isModal()),targets:()=>[b(),...k()].filter(Boolean)}),be(()=>{const ee=b();if(!ee||!r)return;const ie=r.registerNestedMenu(ee);Se(()=>{ie()})}),be(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),...k()]))}),be(()=>{var ee;r!==void 0||i===void 0||(i.value()===t.value()?((ee=p())==null||ee.focus(),i.autoFocusMenu()&&$(!0)):L())}),be(()=>{r!==void 0||i===void 0||z.isOpen()&&i.setValue(t.value())}),Se(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const xe={dataset:U(()=>({"data-expanded":z.isOpen()?"":void 0,"data-closed":z.isOpen()?void 0:""})),isOpen:z.isOpen,contentPresent:N,nestedMenus:k,currentPlacement:O,pointerGraceTimeoutId:()=>c,autoFocus:S,listState:()=>T,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:w,open:$,close:L,toggle:Z,focusContent:F,onItemEnter:se,onItemLeave:R,onTriggerLeave:ae,setPointerDir:ee=>d=ee,setPointerGraceTimeoutId:ee=>c=ee,setPointerGraceIntent:ee=>u=ee,registerNestedMenu:V,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:vn(h),registerContentId:vn(m)};return j(I,{get children(){return j(ix.Provider,{value:xe,get children(){return j(pe,{when:s===void 0,get fallback(){return l.children},get children(){return j(U1,Ee({anchorRef:p,contentRef:b,onCurrentPlacementChange:C},l))}})}})}})}function _x(e){const{direction:t}=Jr();return j(Cx,Ee({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Z6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function kx(e){const t=xr(),n=Qn(),[r,i]=We(e,["onFocusOutside","onKeyDown"]),{direction:s}=Jr();return j(dx,Ee({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;pn(t.triggerRef(),d)||t.close()},onKeyDown:u=>{rt(u,r.onKeyDown);const d=pn(u.currentTarget,u.target),f=Z6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Et(t.triggerRef()))}},i))}var cp=["Enter"," "],eI={open:(e,t)=>e==="ltr"?[...cp,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...cp,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Ox(e){let t;const n=Qn(),r=xr(),i=Be({id:n.generateId(`sub-trigger-${wn()}`)},e),[s,o]=We(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Jr(),u=()=>s.id,d=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),g=P1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=w=>{rt(w,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=w=>{var x;if(rt(w,s.onPointerMove),w.pointerType!=="mouse")return;const S=r.parentMenuContext();if(S==null||S.onItemEnter(w),!w.defaultPrevented){if(s.disabled){S==null||S.onItemLeave(w);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),S==null||S.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Et(w.currentTarget),S==null||S.listState().selectionManager().setFocused(!0),S==null||S.listState().selectionManager().setFocusedKey(u()))}},v=w=>{if(rt(w,s.onPointerLeave),w.pointerType!=="mouse")return;l();const S=r.parentMenuContext(),x=r.contentRef();if(x){S==null||S.setPointerGraceIntent({area:X6(r.currentPlacement(),w,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(S==null?void 0:S.pointerGraceTimeoutId());const O=window.setTimeout(()=>{S==null||S.setPointerGraceIntent(null)},300);S==null||S.setPointerGraceTimeoutId(O)}else{if(S==null||S.onTriggerLeave(w),w.defaultPrevented)return;S==null||S.setPointerGraceIntent(null)}S==null||S.onItemLeave(w)},b=w=>{rt(w,s.onKeyDown),!w.repeat&&(s.disabled||eI.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return be(()=>{var S,x,O;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:(x=(S=s.textValue)!=null?S:t==null?void 0:t.textContent)!=null?x:"",disabled:(O=s.disabled)!=null?O:!1});Se(w)}),be(hr(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{Se(()=>{var S;window.clearTimeout(w),(S=r.parentMenuContext())==null||S.setPointerGraceIntent(null)})})),be(()=>Se(r.registerTriggerId(s.id))),Se(()=>{l()}),j(ot,Ee({as:"div",ref(w){const S=It(x=>{r.setTriggerRef(x),t=x},s.ref);typeof S=="function"&&S(w)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return pt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return pt([s.onPointerUp,g.onPointerUp])},get onClick(){return pt([m,g.onClick])},get onKeyDown(){return pt([b,g.onKeyDown])},get onMouseDown(){return pt([s.onMouseDown,g.onMouseDown])},get onFocus(){return pt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function tI(e){const t=Gc(),n=`menu-${wn()}`,r=Be({id:n,modal:!0},e),[i,s]=We(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=W1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var c;return(c=i.onOpenChange)==null?void 0:c.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:qa(()=>i.id),value:()=>i.value,orientation:()=>{var l,c;return(c=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?c:"horizontal"}};return j(ax.Provider,{value:a,get children(){return j(Cx,Ee({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var nI={};Kc(nI,{Root:()=>Qc,Separator:()=>rI});function Qc(e){let t;const n=Be({orientation:"horizontal"},e),[r,i]=We(n,["ref","orientation"]),s=Uc(()=>t,()=>"hr");return j(ot,Ee({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var rI=Qc,ft={};Kc(ft,{Arrow:()=>nh,CheckboxItem:()=>lx,Content:()=>Ex,DropdownMenu:()=>iI,Group:()=>sh,GroupLabel:()=>hx,Icon:()=>gx,Item:()=>yx,ItemDescription:()=>mx,ItemIndicator:()=>px,ItemLabel:()=>vx,Portal:()=>bx,RadioGroup:()=>wx,RadioItem:()=>Sx,Root:()=>Ax,Separator:()=>Qc,Sub:()=>_x,SubContent:()=>kx,SubTrigger:()=>Ox,Trigger:()=>cx});function Ex(e){const t=Qn(),n=xr(),[r,i]=We(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return j(G6,Ee({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||Et(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var c;(c=r.onInteractOutside)==null||c.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function Ax(e){const t=`dropdownmenu-${wn()}`,n=Be({id:t},e);return j(tI,n)}var iI=Object.assign(Ax,{Arrow:nh,CheckboxItem:lx,Content:Ex,Group:sh,GroupLabel:hx,Icon:gx,Item:yx,ItemDescription:mx,ItemIndicator:px,ItemLabel:vx,Portal:bx,RadioGroup:wx,RadioItem:Sx,Separator:Qc,Sub:_x,SubContent:kx,SubTrigger:Ox,Trigger:cx}),K={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},sI=de('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),oI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),aI=de('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),lI=de('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),oh=de('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),cI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dI=de('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),fI=de('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),hI=de('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),gI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),yI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),pI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Px=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bI=de('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),xI=de('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),wI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),SI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),CI=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_I=de('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),kI=de('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function OI(){return sI()}function Tx(){return oI()}function zo(){return aI()}function up(){return lI()}function dp(){return oh()}function EI(){return(()=>{var e=oh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function AI(){return(()=>{var e=oh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function PI(){return cI()}function TI(){return uI()}function jI(){return dI()}function MI(){return fI()}function $I(){return hI()}function DI(){return gI()}function II(){return yI()}function LI(){return mI()}function RI(){return pI()}function NI(e){return(()=>{var t=Px(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function FI(){return vI()}function BI(){return bI()}function qI(e){return[j(pe,{get when(){return e.checked},get children(){var t=Px(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),j(pe,{get when(){return!e.checked},get children(){var t=xI(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function zI(){return wI()}function HI(){return SI()}function UI(){return CI()}function KI(){return _I()}function fp(){const e=wn();return(()=>{var t=kI(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,c=l.nextSibling,u=c.firstChild,d=c.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,w=b.nextSibling,S=w.firstChild,x=w.nextSibling,O=x.firstChild,C=x.nextSibling,k=C.nextSibling,_=k.firstChild,A=k.nextSibling,D=A.firstChild,I=A.nextSibling,z=I.nextSibling,N=z.firstChild,T=z.nextSibling,$=T.firstChild,L=T.nextSibling,Z=L.nextSibling,ue=Z.firstChild,F=Z.nextSibling,V=F.firstChild,re=F.nextSibling,se=re.firstChild,R=se.nextSibling,ae=R.nextSibling,ne=ae.nextSibling,xe=ne.nextSibling,ee=re.nextSibling,ie=ee.firstChild,Q=ee.nextSibling,Ce=Q.firstChild,H=Q.nextSibling,Pe=H.firstChild,et=Pe.nextSibling,nt=et.nextSibling,Ve=nt.firstChild,Le=Ve.nextSibling,Y=Le.nextSibling,je=Y.nextSibling,at=je.nextSibling,Re=at.nextSibling,$e=Re.nextSibling,he=$e.nextSibling,ye=he.nextSibling,fe=ye.nextSibling,Ne=fe.nextSibling,ke=Ne.nextSibling,ze=H.nextSibling,Ge=ze.firstChild,Vt=ze.nextSibling,_n=Vt.firstChild,Gt=Vt.nextSibling,Lt=Gt.firstChild,wr=Lt.nextSibling,Zr=Gt.nextSibling,Hi=Zr.firstChild,Ui=Zr.nextSibling,Va=Ui.firstChild,to=Ui.nextSibling,no=to.firstChild,ro=no.nextSibling,Ki=ro.nextSibling,uh=Ki.nextSibling,dh=uh.nextSibling,fh=dh.nextSibling,hh=fh.nextSibling,gh=hh.nextSibling,yh=gh.nextSibling,mh=yh.nextSibling,ph=mh.nextSibling,vh=ph.nextSibling,bh=vh.nextSibling,xh=bh.nextSibling,wh=xh.nextSibling,Sh=wh.nextSibling,Ch=Sh.nextSibling,Ux=Ch.nextSibling;return J(n,"id",`a-${e}`),J(r,"fill",`url(#a-${e})`),J(s,"id",`am-${e}`),J(o,"id",`b-${e}`),J(a,"filter",`url(#am-${e})`),J(l,"mask",`url(#b-${e})`),J(u,"id",`ah-${e}`),J(d,"id",`k-${e}`),J(f,"filter",`url(#ah-${e})`),J(h,"mask",`url(#k-${e})`),J(m,"id",`ae-${e}`),J(p,"id",`j-${e}`),J(v,"filter",`url(#ae-${e})`),J(b,"mask",`url(#j-${e})`),J(S,"id",`ai-${e}`),J(x,"id",`i-${e}`),J(O,"filter",`url(#ai-${e})`),J(C,"mask",`url(#i-${e})`),J(_,"id",`aj-${e}`),J(A,"id",`h-${e}`),J(D,"filter",`url(#aj-${e})`),J(I,"mask",`url(#h-${e})`),J(N,"id",`ag-${e}`),J(T,"id",`g-${e}`),J($,"filter",`url(#ag-${e})`),J(L,"mask",`url(#g-${e})`),J(ue,"id",`af-${e}`),J(F,"id",`f-${e}`),J(V,"filter",`url(#af-${e})`),J(re,"mask",`url(#f-${e})`),J(ne,"id",`m-${e}`),J(xe,"fill",`url(#m-${e})`),J(ie,"id",`ak-${e}`),J(Q,"id",`e-${e}`),J(Ce,"filter",`url(#ak-${e})`),J(H,"mask",`url(#e-${e})`),J(Pe,"id",`n-${e}`),J(et,"fill",`url(#n-${e})`),J(Ve,"id",`r-${e}`),J(Le,"fill",`url(#r-${e})`),J(Y,"id",`s-${e}`),J(je,"fill",`url(#s-${e})`),J(at,"id",`q-${e}`),J(Re,"fill",`url(#q-${e})`),J($e,"id",`p-${e}`),J(he,"fill",`url(#p-${e})`),J(ye,"id",`o-${e}`),J(fe,"fill",`url(#o-${e})`),J(Ne,"id",`l-${e}`),J(ke,"fill",`url(#l-${e})`),J(Ge,"id",`al-${e}`),J(Vt,"id",`d-${e}`),J(_n,"filter",`url(#al-${e})`),J(Gt,"mask",`url(#d-${e})`),J(Lt,"id",`u-${e}`),J(wr,"fill",`url(#u-${e})`),J(Hi,"id",`ad-${e}`),J(Ui,"id",`c-${e}`),J(Va,"filter",`url(#ad-${e})`),J(to,"mask",`url(#c-${e})`),J(no,"id",`t-${e}`),J(ro,"fill",`url(#t-${e})`),J(Ki,"id",`v-${e}`),J(uh,"stroke",`url(#v-${e})`),J(dh,"id",`aa-${e}`),J(fh,"stroke",`url(#aa-${e})`),J(hh,"id",`w-${e}`),J(gh,"stroke",`url(#w-${e})`),J(yh,"id",`ac-${e}`),J(mh,"stroke",`url(#ac-${e})`),J(ph,"id",`ab-${e}`),J(vh,"stroke",`url(#ab-${e})`),J(bh,"id",`y-${e}`),J(xh,"stroke",`url(#y-${e})`),J(wh,"id",`x-${e}`),J(Sh,"stroke",`url(#x-${e})`),J(Ch,"id",`z-${e}`),J(Ux,"stroke",`url(#z-${e})`),t})()}var WI=de('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),VI=de('<button title="Copy object to clipboard">'),GI=de('<button title="Remove all items"aria-label="Remove all items">'),QI=de('<button title="Delete item"aria-label="Delete item">'),YI=de('<button title="Toggle value"aria-label="Toggle value">'),XI=de('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),xo=de("<div>"),JI=de("<div><button> <span></span> <span> "),ZI=de("<input>"),hp=de("<span>"),eL=de("<div><span>:"),tL=de("<div><div><button> [<!>...<!>]");function nL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var gp=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n));return(()=>{var i=WI();return ve(()=>te(i,ce(r().expander,n`
|
|
70
70
|
transform: rotate(${e.expanded?90:0}deg);
|
|
71
71
|
`,e.expanded&&n`
|
|
72
72
|
& svg {
|
|
73
73
|
top: -1px;
|
|
74
74
|
}
|
|
75
|
-
`))),i})()},rL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),[i,s]=
|
|
75
|
+
`))),i})()},rL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),[i,s]=oe("NoCopy");return(()=>{var o=VI();return B0(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(yC(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),W(o,j(pS,{get children(){return[j(iu,{get when(){return i()==="NoCopy"},get children(){return j(LI,{})}}),j(iu,{get when(){return i()==="SuccessCopy"},get children(){return j(NI,{get theme(){return t()}})}}),j(iu,{get when(){return i()==="ErrorCopy"},get children(){return j(FI,{})}})]}})),ve(a=>{var l=r().actionButton,c=`${i()==="NoCopy"?"Copy object to clipboard":i()==="SuccessCopy"?"Object copied to clipboard":"Error copying object to clipboard"}`;return l!==a.e&&te(o,a.e=l),c!==a.t&&J(o,"aria-label",a.t=c),a},{e:void 0,t:void 0}),o})()},iL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),i=ge().client;return(()=>{var s=GI();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ui(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},W(s,j(BI,{})),ve(()=>te(s,r().actionButton)),s})()},yp=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),i=ge().client;return(()=>{var s=QI();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ko(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},W(s,j(Tx,{})),ve(()=>te(s,ce(r().actionButton))),s})()},sL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),i=ge().client;return(()=>{var s=YI();return s.$$click=()=>{const o=e.activeQuery.state.data,a=ui(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},W(s,j(qI,{get theme(){return t()},get checked(){return e.value}})),ve(()=>te(s,ce(r().actionButton,n`
|
|
76
76
|
width: ${K.size[3.5]};
|
|
77
77
|
height: ${K.size[3.5]};
|
|
78
|
-
`))),s})()};function
|
|
78
|
+
`))),s})()};function mp(e){return Symbol.iterator in e}function Br(e){var g;const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?eo(n):Zs(n)),i=ge().client,[s,o]=oe((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,c]=oe([]),u=U(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&mp(e.value)&&typeof e.value[Symbol.iterator]=="function"?e.value instanceof Map?Array.from(e.value,([m,p])=>({label:m,value:p})):Array.from(e.value,(m,p)=>({label:p.toString(),value:m})):typeof e.value=="object"&&e.value!==null?Object.entries(e.value).map(([m,p])=>({label:m,value:p})):[]),d=U(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&mp(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=U(()=>nL(u(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=xo();return W(m,j(pe,{get when(){return f().length},get children(){return[(()=>{var p=JI(),v=p.firstChild,b=v.firstChild,w=b.nextSibling,S=w.nextSibling,x=S.nextSibling,O=x.firstChild;return v.$$click=()=>a(),W(v,j(gp,{get expanded(){return s()}}),b),W(w,()=>e.label),W(x,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",O),W(x,()=>u().length,O),W(x,()=>u().length>1?"items":"item",null),W(p,j(pe,{get when(){return e.editable},get children(){var C=xo();return W(C,j(rL,{get value(){return e.value}}),null),W(C,j(pe,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(yp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),W(C,j(pe,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return j(iL,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),W(C,j(pe,{get when(){return U(()=>!!e.onEdit)()&&!sv(e.value).meta},get children(){var k=XI();return k.$$click=()=>{var _;(_=e.onEdit)==null||_.call(e)},W(k,j(RI,{})),ve(()=>te(k,r().actionButton)),k}}),null),ve(()=>te(C,r().actions)),C}}),null),ve(C=>{var k=r().expanderButtonContainer,_=r().expanderButton,A=r().info;return k!==C.e&&te(p,C.e=k),_!==C.t&&te(v,C.t=_),A!==C.a&&te(x,C.a=A),C},{e:void 0,t:void 0,a:void 0}),p})(),j(pe,{get when(){return s()},get children(){return[j(pe,{get when(){return f().length===1},get children(){var p=xo();return W(p,j(sc,{get each(){return u()},by:v=>v.label,children:v=>j(Br,{get defaultExpanded(){return e.defaultExpanded},get label(){return v().label},get value(){return v().value},get editable(){return e.editable},get dataPath(){return[...h,v().label]},get activeQuery(){return e.activeQuery},get itemsDeletable(){return d()==="array"||d()==="Iterable"||d()==="object"}})})),ve(()=>te(p,r().subEntry)),p}}),j(pe,{get when(){return f().length>1},get children(){var p=xo();return W(p,j(mS,{get each(){return f()},children:(v,b)=>(()=>{var w=tL(),S=w.firstChild,x=S.firstChild,O=x.firstChild,C=O.nextSibling,k=C.nextSibling,_=k.nextSibling;return _.nextSibling,x.$$click=()=>c(A=>A.includes(b)?A.filter(D=>D!==b):[...A,b]),W(x,j(gp,{get expanded(){return l().includes(b)}}),O),W(x,b*100,C),W(x,b*100+100-1,_),W(S,j(pe,{get when(){return l().includes(b)},get children(){var A=xo();return W(A,j(sc,{get each(){return v()},by:D=>D.label,children:D=>j(Br,{get defaultExpanded(){return e.defaultExpanded},get label(){return D().label},get value(){return D().value},get editable(){return e.editable},get dataPath(){return[...h,D().label]},get activeQuery(){return e.activeQuery}})})),ve(()=>te(A,r().subEntry)),A}}),null),ve(A=>{var D=r().entry,I=r().expanderButton;return D!==A.e&&te(S,A.e=D),I!==A.t&&te(x,A.t=I),A},{e:void 0,t:void 0}),w})()})),ve(()=>te(p,r().subEntry)),p}})]}})]}}),null),W(m,j(pe,{get when(){return f().length===0},get children(){var p=eL(),v=p.firstChild,b=v.firstChild;return W(v,()=>e.label,b),W(p,j(pe,{get when(){return U(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var w=hp();return W(w,()=>Ul(e.value)),ve(()=>te(w,r().value)),w})()},get children(){return[j(pe,{get when(){return U(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var w=ZI();return w.addEventListener("change",S=>{const x=e.activeQuery.state.data,O=ui(x,h,d()==="number"?S.target.valueAsNumber:S.target.value);i.setQueryData(e.activeQuery.queryKey,O)}),ve(S=>{var x=d()==="number"?"number":"text",O=ce(r().value,r().editableInput);return x!==S.e&&J(w,"type",S.e=x),O!==S.t&&te(w,S.t=O),S},{e:void 0,t:void 0}),ve(()=>w.value=e.value),w}}),j(pe,{get when(){return d()==="boolean"},get children(){var w=hp();return W(w,j(sL,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),W(w,()=>Ul(e.value),null),ve(()=>te(w,ce(r().value,r().actions,r().editableInput))),w}})]}}),null),W(p,j(pe,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(yp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),ve(w=>{var S=r().row,x=r().label;return S!==w.e&&te(p,w.e=S),x!==w.t&&te(v,w.t=x),w},{e:void 0,t:void 0}),p}}),null),ve(()=>te(m,r().entry)),m})()}var jx=(e,t)=>{const{colors:n,font:r,size:i,border:s}=K,o=(a,l)=>e==="light"?a:l;return{entry:t`
|
|
79
79
|
& * {
|
|
80
80
|
font-size: ${r.size.xs};
|
|
81
81
|
font-family:
|
|
@@ -187,7 +187,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
187
187
|
outline: 2px solid ${n.blue[800]};
|
|
188
188
|
outline-offset: 2px;
|
|
189
189
|
}
|
|
190
|
-
`}},Zs=e=>jx("light",e),eo=e=>jx("dark",e);
|
|
190
|
+
`}},Zs=e=>jx("light",e),eo=e=>jx("dark",e);bc(["click"]);var oL=de('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),Wa=de("<div>"),aL=de('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),lL=de("<select name=tsqd-queries-filter-sort>"),cL=de("<select name=tsqd-mutations-filter-sort>"),uL=de("<span>Asc"),dL=de("<span>Desc"),fL=de('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),hL=de("<div>Settings"),gL=de("<span>Position"),yL=de("<span>Top"),mL=de("<span>Bottom"),pL=de("<span>Left"),vL=de("<span>Right"),bL=de("<span>Theme"),xL=de("<span>Light"),wL=de("<span>Dark"),SL=de("<span>System"),CL=de("<div><div class=tsqd-queries-container>"),_L=de("<div><div class=tsqd-mutations-container>"),kL=de('<div><div><div><button aria-label="Close Tanstack query devtools"><span>TANSTACK</span><span> v</span></button></div></div><div><div><div><input aria-label="Filter queries by query key"type=text placeholder=Filter name=tsqd-query-filter-input></div><div></div><button class=tsqd-query-filter-sort-order-btn></button></div><div><button aria-label="Clear query cache"></button><button>'),pp=de("<option>Sort by "),OL=de("<div class=tsqd-query-disabled-indicator>disabled"),EL=de("<div class=tsqd-query-static-indicator>static"),Mx=de("<button><div></div><code class=tsqd-query-hash>"),AL=de("<div role=tooltip id=tsqd-status-tooltip>"),PL=de("<span>"),TL=de("<button><span></span><span>"),jL=de("<button><span></span> Error"),ML=de('<div><span></span>Trigger Error<select><option value=""disabled selected>'),$L=de('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),DL=de("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),IL=de('<div><div>Query Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-observers-count><span>Observers:</span><span></span></div><div class=tsqd-query-details-last-updated><span>Last Updated:</span><span></span></div></div><div>Actions</div><div><button><span></span>Refetch</button><button><span></span>Invalidate</button><button><span></span>Reset</button><button><span></span>Remove</button><button><span></span> Loading</button></div><div>Data </div><div>Query Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),LL=de("<option>"),RL=de('<div><div>Mutation Details</div><div><div class=tsqd-query-details-summary><pre><code></code></pre><span></span></div><div class=tsqd-query-details-last-updated><span>Submitted At:</span><span></span></div></div><div>Variables Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Context Details</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Data Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"></div><div>Mutations Explorer</div><div class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer">'),[tn,Yc]=oe(null),[Hr,$x]=oe(null),[An,ah]=oe(0),[wo,NL]=oe(!1),FL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n)),i=U(()=>ge().onlineManager);gr(()=>{const d=i().subscribe(f=>{NL(!f)});Se(()=>{d()})});const s=qf(),o=U(()=>ge().buttonPosition||B$),a=U(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:ge().initialIsOpen||q$),l=U(()=>e.localStore.position||ge().position||Hd);let c;be(()=>{const d=c.parentElement,f=e.localStore.height||r1,h=e.localStore.width||i1,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),gr(()=>{const d=()=>{const f=c.parentElement,h=getComputedStyle(f).fontSize;f.style.setProperty("--tsqd-font-size",h)};d(),window.addEventListener("focus",d),Se(()=>{window.removeEventListener("focus",d)})});const u=U(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[j(pe,{get when(){return U(()=>!!s().pipWindow)()&&u()=="true"},get children(){return j(U0,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return j(BL,{get children(){return j(lh,e)}})}})}}),(()=>{var d=Wa(),f=c;return typeof f=="function"?Ws(f,d):c=d,W(d,j($m,{name:"tsqd-panel-transition",get children(){return j(pe,{get when(){return U(()=>!!(a()&&!s().pipWindow))()&&u()=="false"},get children(){return j(zL,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),W(d,j($m,{name:"tsqd-button-transition",get children(){return j(pe,{get when(){return!a()},get children(){var h=oL(),g=h.firstChild,m=g.nextSibling;return W(g,j(fp,{})),m.$$click=()=>e.setLocalStore("open","true"),W(m,j(fp,{})),ve(()=>te(h,ce(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),ve(()=>te(d,ce(n`
|
|
191
191
|
& .tsqd-panel-transition-exit-active,
|
|
192
192
|
& .tsqd-panel-transition-enter-active {
|
|
193
193
|
transition:
|
|
@@ -213,62 +213,62 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
213
213
|
transform: ${o()==="relative"?"none;":o()==="top-left"?"translateX(-72px);":o()==="top-right"?"translateX(72px);":"translateY(72px);"};
|
|
214
214
|
opacity: 0;
|
|
215
215
|
}
|
|
216
|
-
`,"tsqd-transitions-container"))),d})()]},BL=e=>{const t=
|
|
216
|
+
`,"tsqd-transitions-container"))),d})()]},BL=e=>{const t=qf(),n=xt(),r=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,i=U(()=>n()==="dark"?Cn(r):Sn(r)),s=()=>{const{colors:o}=K,a=(l,c)=>n()==="dark"?c:l;return An()<$i?r`
|
|
217
217
|
flex-direction: column;
|
|
218
218
|
background-color: ${a(o.gray[300],o.gray[600])};
|
|
219
219
|
`:r`
|
|
220
220
|
flex-direction: row;
|
|
221
221
|
background-color: ${a(o.gray[200],o.darkGray[900])};
|
|
222
|
-
`};return be(()=>{const o=t().pipWindow,a=()=>{o&&
|
|
222
|
+
`};return be(()=>{const o=t().pipWindow,a=()=>{o&&ah(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),Se(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=Wa();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),W(o,()=>e.children),ve(()=>te(o,ce(i().panel,s(),{[r`
|
|
223
223
|
min-width: min-content;
|
|
224
|
-
`]:An()<
|
|
224
|
+
`]:An()<Ff},"tsqd-main-panel"))),o})()},qL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n));let i;gr(()=>{d1(i,({width:o},a)=>{a===i&&ah(o)})});const s=()=>{const{colors:o}=K,a=(l,c)=>t()==="dark"?c:l;return An()<$i?n`
|
|
225
225
|
flex-direction: column;
|
|
226
226
|
background-color: ${a(o.gray[300],o.gray[600])};
|
|
227
227
|
`:n`
|
|
228
228
|
flex-direction: row;
|
|
229
229
|
background-color: ${a(o.gray[200],o.darkGray[900])};
|
|
230
|
-
`};return(()=>{var o=
|
|
230
|
+
`};return(()=>{var o=Wa(),a=i;return typeof a=="function"?Ws(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),W(o,()=>e.children),ve(()=>te(o,ce(r().parentPanel,s(),{[n`
|
|
231
231
|
min-width: min-content;
|
|
232
|
-
`]:An()<
|
|
232
|
+
`]:An()<Ff},"tsqd-main-panel"))),o})()},zL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n)),[i,s]=oe(!1),o=U(()=>e.localStore.position||ge().position||Hd),a=u=>{const d=u.currentTarget.parentElement;if(!d)return;s(!0);const{height:f,width:h}=d.getBoundingClientRect(),g=u.clientX,m=u.clientY;let p=0;const v=Vh(3.5),b=Vh(12),w=x=>{if(x.preventDefault(),o()==="left"||o()==="right"){const O=o()==="right"?g-x.clientX:x.clientX-g;p=Math.round(h+O),p<b&&(p=b),e.setLocalStore("width",String(Math.round(p)));const C=d.getBoundingClientRect().width;Number(e.localStore.width)<C&&e.setLocalStore("width",String(C))}else{const O=o()==="bottom"?m-x.clientY:x.clientY-m;p=Math.round(f+O),p<v&&(p=v,Yc(null)),e.setLocalStore("height",String(Math.round(p)))}},S=()=>{i()&&s(!1),document.removeEventListener("mousemove",w,!1),document.removeEventListener("mouseUp",S,!1)};document.addEventListener("mousemove",w,!1),document.addEventListener("mouseup",S,!1)};let l;gr(()=>{d1(l,({width:u},d)=>{d===l&&ah(u)})}),be(()=>{var m,p;const u=(p=(m=l.parentElement)==null?void 0:m.parentElement)==null?void 0:p.parentElement;if(!u)return;const d=e.localStore.position||Hd,f=mC("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:S,paddingRight:x})=>({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:S,paddingRight:x}))(u.style);u.style[f]=`${h?e.localStore.width:e.localStore.height}px`,Se(()=>{Object.entries(g).forEach(([v,b])=>{u.style[v]=b})})});const c=()=>{const{colors:u}=K,d=(f,h)=>t()==="dark"?h:f;return An()<$i?n`
|
|
233
233
|
flex-direction: column;
|
|
234
234
|
background-color: ${d(u.gray[300],u.gray[600])};
|
|
235
235
|
`:n`
|
|
236
236
|
flex-direction: row;
|
|
237
237
|
background-color: ${d(u.gray[200],u.darkGray[900])};
|
|
238
|
-
`};return(()=>{var u=aL(),d=u.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?Ws(h,u):l=u,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),W(f,
|
|
238
|
+
`};return(()=>{var u=aL(),d=u.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?Ws(h,u):l=u,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),W(f,j(zo,{})),W(u,j(lh,e),null),ve(g=>{var m=ce(r().panel,r()[`panel-position-${o()}`],c(),{[n`
|
|
239
239
|
min-width: min-content;
|
|
240
|
-
`]:An()<
|
|
240
|
+
`]:An()<Ff&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||r1}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||i1}px`:"auto",b=ce(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),w=ce(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&te(u,g.e=m),p!==g.t&&((g.t=p)!=null?u.style.setProperty("height",p):u.style.removeProperty("height")),v!==g.a&&((g.a=v)!=null?u.style.setProperty("width",v):u.style.removeProperty("width")),b!==g.o&&te(d,g.o=b),w!==g.i&&te(f,g.i=w),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u})()},lh=e=>{QL(),YL();let t;const n=xt(),r=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,i=U(()=>n()==="dark"?Cn(r):Sn(r)),s=qf(),[o,a]=oe("queries"),l=U(()=>e.localStore.sort||H$),c=U(()=>Number(e.localStore.sortOrder)||Om),u=U(()=>e.localStore.mutationSort||U$),d=U(()=>Number(e.localStore.mutationSortOrder)||Om),f=U(()=>fd[l()]),h=U(()=>hd[u()]),g=U(()=>ge().onlineManager),m=U(()=>ge().client.getQueryCache()),p=U(()=>ge().client.getMutationCache()),v=mt(C=>C().getAll().length,!1),b=U(hr(()=>[v(),e.localStore.filter,l(),c()],()=>{const C=m().getAll(),k=e.localStore.filter?C.filter(A=>Em(A.queryHash,e.localStore.filter||"").passed):[...C];return f()?k.sort((A,D)=>f()(A,D)*c()):k})),w=En(C=>C().getAll().length,!1),S=U(hr(()=>[w(),e.localStore.mutationFilter,u(),d()],()=>{const C=p().getAll(),k=e.localStore.mutationFilter?C.filter(A=>{const D=`${A.options.mutationKey?JSON.stringify(A.options.mutationKey)+" - ":""}${new Date(A.state.submittedAt).toLocaleString()}`;return Em(D,e.localStore.mutationFilter||"").passed}):[...C];return h()?k.sort((A,D)=>h()(A,D)*d()):k})),x=C=>{e.setLocalStore("position",C)},O=C=>{const _=getComputedStyle(t).getPropertyValue("--tsqd-font-size");C.style.setProperty("--tsqd-font-size",_)};return[(()=>{var C=kL(),k=C.firstChild,_=k.firstChild,A=_.firstChild,D=A.firstChild,I=D.nextSibling,z=I.firstChild,N=k.nextSibling,T=N.firstChild,$=T.firstChild,L=$.firstChild,Z=$.nextSibling,ue=Z.nextSibling,F=T.nextSibling,V=F.firstChild,re=V.nextSibling,se=t;return typeof se=="function"?Ws(se,C):t=C,A.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},W(I,()=>ge().queryFlavor,z),W(I,()=>ge().version,null),W(_,j(fn.Root,{get class(){return ce(i().viewToggle)},get value(){return o()},onChange:R=>{a(R),Yc(null),$x(null)},get children(){return[j(fn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[j(fn.ItemInput,{}),j(fn.ItemControl,{get children(){return j(fn.ItemIndicator,{})}}),j(fn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),j(fn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[j(fn.ItemInput,{}),j(fn.ItemControl,{get children(){return j(fn.ItemIndicator,{})}}),j(fn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),W(k,j(pe,{get when(){return o()==="queries"},get children(){return j(KL,{})}}),null),W(k,j(pe,{get when(){return o()==="mutations"},get children(){return j(WL,{})}}),null),W($,j(OI,{}),L),L.$$input=R=>{o()==="queries"?e.setLocalStore("filter",R.currentTarget.value):e.setLocalStore("mutationFilter",R.currentTarget.value)},W(Z,j(pe,{get when(){return o()==="queries"},get children(){var R=lL();return R.addEventListener("change",ae=>{e.setLocalStore("sort",ae.currentTarget.value)}),W(R,()=>Object.keys(fd).map(ae=>(()=>{var ne=pp();return ne.firstChild,ne.value=ae,W(ne,ae,null),ne})())),ve(()=>R.value=l()),R}}),null),W(Z,j(pe,{get when(){return o()==="mutations"},get children(){var R=cL();return R.addEventListener("change",ae=>{e.setLocalStore("mutationSort",ae.currentTarget.value)}),W(R,()=>Object.keys(hd).map(ae=>(()=>{var ne=pp();return ne.firstChild,ne.value=ae,W(ne,ae,null),ne})())),ve(()=>R.value=u()),R}}),null),W(Z,j(zo,{}),null),ue.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(c()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},W(ue,j(pe,{get when(){return(o()==="queries"?c():d())===1},get children(){return[uL(),j(up,{})]}}),null),W(ue,j(pe,{get when(){return(o()==="queries"?c():d())===-1},get children(){return[dL(),j(dp,{})]}}),null),V.$$click=()=>{o()==="queries"?(Bn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Bn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},W(V,j(Tx,{})),re.$$click=()=>{g().setOnline(!g().isOnline())},W(re,(()=>{var R=U(()=>!!wo());return()=>R()?j($I,{}):j(MI,{})})()),W(F,j(pe,{get when(){return U(()=>!s().pipWindow)()&&!s().disabled},get children(){var R=fL();return R.$$click=()=>{var ae;s().requestPipWindow(Number(window.innerWidth),Number((ae=e.localStore.height)!=null?ae:500))},W(R,j(II,{})),ve(()=>te(R,ce(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),R}}),null),W(F,j(ft.Root,{gutter:4,get children(){return[j(ft.Trigger,{get class(){return ce(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return j(DI,{})}}),j(ft.Portal,{ref:R=>O(R),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ft.Content,{get class(){return ce(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var R=hL();return ve(()=>te(R,ce(i().settingsMenuHeader,"tsqd-settings-menu-header"))),R})(),j(pe,{get when(){return!e.showPanelViewOnly},get children(){return j(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(ft.SubTrigger,{get class(){return ce(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[gL(),j(zo,{})]}}),j(ft.Portal,{ref:R=>O(R),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ft.SubContent,{get class(){return ce(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(ft.Item,{onSelect:()=>{x("top")},as:"button",get class(){return ce(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[yL(),j(up,{})]}}),j(ft.Item,{onSelect:()=>{x("bottom")},as:"button",get class(){return ce(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[mL(),j(dp,{})]}}),j(ft.Item,{onSelect:()=>{x("left")},as:"button",get class(){return ce(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[pL(),j(EI,{})]}}),j(ft.Item,{onSelect:()=>{x("right")},as:"button",get class(){return ce(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[vL(),j(AI,{})]}})]}})}})]}})}}),j(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(ft.SubTrigger,{get class(){return ce(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[bL(),j(zo,{})]}}),j(ft.Portal,{ref:R=>O(R),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ft.SubContent,{get class(){return ce(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return ce(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[xL(),j(PI,{})]}}),j(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return ce(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[wL(),j(TI,{})]}}),j(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return ce(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[SL(),j(jI,{})]}})]}})}})]}})]}})}})]}}),null),W(C,j(pe,{get when(){return o()==="queries"},get children(){var R=CL(),ae=R.firstChild;return W(ae,j(sc,{by:ne=>ne.queryHash,get each(){return b()},children:ne=>j(HL,{get query(){return ne()}})})),ve(()=>te(R,ce(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),R}}),null),W(C,j(pe,{get when(){return o()==="mutations"},get children(){var R=_L(),ae=R.firstChild;return W(ae,j(sc,{by:ne=>ne.mutationId,get each(){return S()},children:ne=>j(UL,{get mutation(){return ne()}})})),ve(()=>te(R,ce(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),R}}),null),ve(R=>{var ae=ce(i().queriesContainer,An()<$i&&(tn()||Hr())&&r`
|
|
241
241
|
height: 50%;
|
|
242
242
|
max-height: 50%;
|
|
243
243
|
`,An()<$i&&!(tn()||Hr())&&r`
|
|
244
244
|
height: 100%;
|
|
245
245
|
max-height: 100%;
|
|
246
|
-
`,"tsqd-queries-container"),ne=
|
|
246
|
+
`,"tsqd-queries-container"),ne=ce(i().row,"tsqd-header"),xe=i().logoAndToggleContainer,ee=ce(i().logo,"tsqd-text-logo-container"),ie=ce(i().tanstackLogo,"tsqd-text-logo-tanstack"),Q=ce(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),Ce=ce(i().row,"tsqd-filters-actions-container"),H=ce(i().filtersContainer,"tsqd-filters-container"),Pe=ce(i().filterInput,"tsqd-query-filter-textfield-container"),et=ce("tsqd-query-filter-textfield"),nt=ce(i().filterSelect,"tsqd-query-filter-sort-container"),Ve=`Sort order ${(o()==="queries"?c():d())===-1?"descending":"ascending"}`,Le=(o()==="queries"?c():d())===-1,Y=ce(i().actionsContainer,"tsqd-actions-container"),je=ce(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),at=`Clear ${o()} cache`,Re=ce(i().actionsBtn,wo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),$e=`${wo()?"Unset offline mocking behavior":"Mock offline behavior"}`,he=wo(),ye=`${wo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return ae!==R.e&&te(C,R.e=ae),ne!==R.t&&te(k,R.t=ne),xe!==R.a&&te(_,R.a=xe),ee!==R.o&&te(A,R.o=ee),ie!==R.i&&te(D,R.i=ie),Q!==R.n&&te(I,R.n=Q),Ce!==R.s&&te(N,R.s=Ce),H!==R.h&&te(T,R.h=H),Pe!==R.r&&te($,R.r=Pe),et!==R.d&&te(L,R.d=et),nt!==R.l&&te(Z,R.l=nt),Ve!==R.u&&J(ue,"aria-label",R.u=Ve),Le!==R.c&&J(ue,"aria-pressed",R.c=Le),Y!==R.w&&te(F,R.w=Y),je!==R.m&&te(V,R.m=je),at!==R.f&&J(V,"title",R.f=at),Re!==R.y&&te(re,R.y=Re),$e!==R.g&&J(re,"aria-label",R.g=$e),he!==R.p&&J(re,"aria-pressed",R.p=he),ye!==R.b&&J(re,"title",R.b=ye),R},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),ve(()=>L.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),C})(),j(pe,{get when(){return U(()=>o()==="queries")()&&tn()},get children(){return j(VL,{})}}),j(pe,{get when(){return U(()=>o()==="mutations")()&&Hr()},get children(){return j(GL,{})}})]},HL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n)),{colors:i,alpha:s}=K,o=(g,m)=>t()==="dark"?m:g,a=mt(g=>{var m;return(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.state},!0,g=>g.query.queryHash===e.query.queryHash),l=mt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isDisabled())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),c=mt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStatic())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),u=mt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.isStale())!=null?p:!1},!0,g=>g.query.queryHash===e.query.queryHash),d=mt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.getObserversCount())!=null?p:0},!0,g=>g.query.queryHash===e.query.queryHash),f=U(()=>pC({queryState:a(),observerCount:d(),isStale:u()})),h=()=>f()==="gray"?n`
|
|
247
247
|
background-color: ${o(i[f()][200],i[f()][700])};
|
|
248
248
|
color: ${o(i[f()][700],i[f()][300])};
|
|
249
249
|
`:n`
|
|
250
250
|
background-color: ${o(i[f()][200]+s[80],i[f()][900])};
|
|
251
251
|
color: ${o(i[f()][800],i[f()][300])};
|
|
252
|
-
`;return
|
|
252
|
+
`;return j(pe,{get when(){return a()},get children(){var g=Mx(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>Yc(e.query.queryHash===tn()?null:e.query.queryHash),W(m,d),W(p,()=>e.query.queryHash),W(g,j(pe,{get when(){return l()},get children(){return OL()}}),null),W(g,j(pe,{get when(){return c()},get children(){return EL()}}),null),ve(v=>{var b=ce(r().queryRow,tn()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),w=`Query key ${e.query.queryHash}`,S=ce(h(),"tsqd-query-observer-count");return b!==v.e&&te(g,v.e=b),w!==v.t&&J(g,"aria-label",v.t=w),S!==v.a&&te(m,v.a=S),v},{e:void 0,t:void 0,a:void 0}),g}})},UL=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n)),{colors:i,alpha:s}=K,o=(f,h)=>t()==="dark"?h:f,a=En(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=En(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),c=En(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),u=U(()=>ts({isPaused:l(),status:c()})),d=()=>u()==="gray"?n`
|
|
253
253
|
background-color: ${o(i[u()][200],i[u()][700])};
|
|
254
254
|
color: ${o(i[u()][700],i[u()][300])};
|
|
255
255
|
`:n`
|
|
256
256
|
background-color: ${o(i[u()][200]+s[80],i[u()][900])};
|
|
257
257
|
color: ${o(i[u()][800],i[u()][300])};
|
|
258
|
-
`;return
|
|
258
|
+
`;return j(pe,{get when(){return a()},get children(){var f=Mx(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{$x(e.mutation.mutationId===Hr()?null:e.mutation.mutationId)},W(h,j(pe,{get when(){return u()==="purple"},get children(){return j(KI,{})}}),null),W(h,j(pe,{get when(){return u()==="green"},get children(){return j(zI,{})}}),null),W(h,j(pe,{get when(){return u()==="red"},get children(){return j(UI,{})}}),null),W(h,j(pe,{get when(){return u()==="yellow"},get children(){return j(HI,{})}}),null),W(g,j(pe,{get when(){return e.mutation.options.mutationKey},get children(){return[U(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),W(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),ve(m=>{var p=ce(r().queryRow,Hr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),v=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,b=ce(d(),"tsqd-query-observer-count");return p!==m.e&&te(f,m.e=p),v!==m.t&&J(f,"aria-label",m.t=v),b!==m.a&&te(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},KL=()=>{const e=mt(l=>l().getAll().filter(c=>Xi(c)==="stale").length),t=mt(l=>l().getAll().filter(c=>Xi(c)==="fresh").length),n=mt(l=>l().getAll().filter(c=>Xi(c)==="fetching").length),r=mt(l=>l().getAll().filter(c=>Xi(c)==="paused").length),i=mt(l=>l().getAll().filter(c=>Xi(c)==="inactive").length),s=xt(),o=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,a=U(()=>s()==="dark"?Cn(o):Sn(o));return(()=>{var l=Wa();return W(l,j(or,{label:"Fresh",color:"green",get count(){return t()}}),null),W(l,j(or,{label:"Fetching",color:"blue",get count(){return n()}}),null),W(l,j(or,{label:"Paused",color:"purple",get count(){return r()}}),null),W(l,j(or,{label:"Stale",color:"yellow",get count(){return e()}}),null),W(l,j(or,{label:"Inactive",color:"gray",get count(){return i()}}),null),ve(()=>te(l,ce(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},WL=()=>{const e=En(a=>a().getAll().filter(l=>ts({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=En(a=>a().getAll().filter(l=>ts({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=En(a=>a().getAll().filter(l=>ts({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=En(a=>a().getAll().filter(l=>ts({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=xt(),s=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,o=U(()=>i()==="dark"?Cn(s):Sn(s));return(()=>{var a=Wa();return W(a,j(or,{label:"Paused",color:"purple",get count(){return n()}}),null),W(a,j(or,{label:"Pending",color:"yellow",get count(){return t()}}),null),W(a,j(or,{label:"Success",color:"green",get count(){return e()}}),null),W(a,j(or,{label:"Error",color:"red",get count(){return r()}}),null),ve(()=>te(a,ce(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},or=e=>{const t=xt(),n=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?Cn(n):Sn(n)),{colors:i,alpha:s}=K,o=(h,g)=>t()==="dark"?g:h;let a;const[l,c]=oe(!1),[u,d]=oe(!1),f=U(()=>!(tn()&&An()<F$&&An()>$i||An()<$i));return(()=>{var h=TL(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?Ws(p,h):a=h,h.addEventListener("mouseleave",()=>{c(!1),d(!1)}),h.addEventListener("mouseenter",()=>c(!0)),h.addEventListener("blur",()=>d(!1)),h.addEventListener("focus",()=>d(!0)),q0(h,Ee({get disabled(){return f()},get class(){return ce(r().queryStatusTag,!f()&&n`
|
|
259
259
|
cursor: pointer;
|
|
260
260
|
&:hover {
|
|
261
261
|
background: ${o(i.gray[200],i.darkGray[400])}${s[80]};
|
|
262
262
|
}
|
|
263
|
-
`,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),W(h,
|
|
263
|
+
`,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),W(h,j(pe,{get when(){return U(()=>!f())()&&(l()||u())},get children(){var v=AL();return W(v,()=>e.label),ve(()=>te(v,ce(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),W(h,j(pe,{get when(){return f()},get children(){var v=PL();return W(v,()=>e.label),ve(()=>te(v,ce(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),W(m,()=>e.count),ve(v=>{var b=ce(n`
|
|
264
264
|
width: ${K.size[1.5]};
|
|
265
265
|
height: ${K.size[1.5]};
|
|
266
266
|
border-radius: ${K.border.radius.full};
|
|
267
267
|
background-color: ${K.colors[e.color][500]};
|
|
268
|
-
`,"tsqd-query-status-tag-dot"),w=
|
|
268
|
+
`,"tsqd-query-status-tag-dot"),w=ce(r().queryStatusCount,e.count>0&&e.color!=="gray"&&n`
|
|
269
269
|
background-color: ${o(i[e.color][100],i[e.color][900])};
|
|
270
270
|
color: ${o(i[e.color][700],i[e.color][300])};
|
|
271
|
-
`,"tsqd-query-status-tag-count");return b!==v.e&&te(g,v.e=b),w!==v.t&&te(m,v.t=w),v},{e:void 0,t:void 0}),h})()},VL=()=>{const e=xt(),t=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,n=U(()=>e()==="dark"?Cn(t):Sn(t)),{colors:r}=K,i=(
|
|
271
|
+
`,"tsqd-query-status-tag-count");return b!==v.e&&te(g,v.e=b),w!==v.t&&te(m,v.t=w),v},{e:void 0,t:void 0}),h})()},VL=()=>{const e=xt(),t=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,n=U(()=>e()==="dark"?Cn(t):Sn(t)),{colors:r}=K,i=(_,A)=>e()==="dark"?A:_,s=ge().client,[o,a]=oe(!1),[l,c]=oe("view"),[u,d]=oe(!1),f=U(()=>ge().errorTypes||[]),h=mt(_=>_().getAll().find(A=>A.queryHash===tn()),!1),g=mt(_=>_().getAll().find(A=>A.queryHash===tn()),!1),m=mt(_=>{var A;return(A=_().getAll().find(D=>D.queryHash===tn()))==null?void 0:A.state},!1),p=mt(_=>{var A;return(A=_().getAll().find(D=>D.queryHash===tn()))==null?void 0:A.state.data},!1),v=mt(_=>{const A=_().getAll().find(D=>D.queryHash===tn());return A?Xi(A):"inactive"}),b=mt(_=>{const A=_().getAll().find(D=>D.queryHash===tn());return A?A.state.status:"pending"}),w=mt(_=>{var A,D;return(D=(A=_().getAll().find(I=>I.queryHash===tn()))==null?void 0:A.getObserversCount())!=null?D:0}),S=U(()=>vC(v())),x=()=>{var A,D;Bn({type:"REFETCH",queryHash:(A=h())==null?void 0:A.queryHash});const _=(D=h())==null?void 0:D.fetch();_==null||_.catch(()=>{})},O=_=>{var z;const A=h();if(!A)return;Bn({type:"TRIGGER_ERROR",queryHash:A.queryHash,metadata:{error:_==null?void 0:_.name}});const D=(z=_==null?void 0:_.initializer(A))!=null?z:new Error("Unknown error from devtools"),I=A.options;A.setState({status:"error",error:D,fetchMeta:{...A.state.fetchMeta,__previousQueryOptions:I}})},C=()=>{const _=h();if(!_)return;Bn({type:"RESTORE_LOADING",queryHash:_.queryHash});const A=_.state,D=_.state.fetchMeta?_.state.fetchMeta.__previousQueryOptions:null;_.cancel({silent:!0}),_.setState({...A,fetchStatus:"idle",fetchMeta:null}),D&&_.fetch(D)};be(()=>{v()!=="fetching"&&a(!1)});const k=()=>S()==="gray"?t`
|
|
272
272
|
background-color: ${i(r[S()][200],r[S()][700])};
|
|
273
273
|
color: ${i(r[S()][700],r[S()][300])};
|
|
274
274
|
border-color: ${i(r[S()][400],r[S()][600])};
|
|
@@ -276,37 +276,37 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
276
276
|
background-color: ${i(r[S()][100],r[S()][900])};
|
|
277
277
|
color: ${i(r[S()][700],r[S()][300])};
|
|
278
278
|
border-color: ${i(r[S()][400],r[S()][600])};
|
|
279
|
-
`;return
|
|
279
|
+
`;return j(pe,{get when(){return U(()=>!!h())()&&m()},get children(){var _=IL(),A=_.firstChild,D=A.nextSibling,I=D.firstChild,z=I.firstChild,N=z.firstChild,T=z.nextSibling,$=I.nextSibling,L=$.firstChild,Z=L.nextSibling,ue=$.nextSibling,F=ue.firstChild,V=F.nextSibling,re=D.nextSibling,se=re.nextSibling,R=se.firstChild,ae=R.firstChild,ne=R.nextSibling,xe=ne.firstChild,ee=ne.nextSibling,ie=ee.firstChild,Q=ee.nextSibling,Ce=Q.firstChild,H=Q.nextSibling,Pe=H.firstChild,et=Pe.nextSibling,nt=se.nextSibling;nt.firstChild;var Ve=nt.nextSibling,Le=Ve.nextSibling;return W(N,()=>Ul(h().queryKey,!0)),W(T,v),W(Z,w),W(V,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),R.$$click=x,ne.$$click=()=>{var Y;Bn({type:"INVALIDATE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.invalidateQueries(h())},ee.$$click=()=>{var Y;Bn({type:"RESET",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.resetQueries(h())},Q.$$click=()=>{var Y;Bn({type:"REMOVE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.removeQueries(h()),Yc(null)},H.$$click=()=>{var Y;if(((Y=h())==null?void 0:Y.state.data)===void 0)a(!0),C();else{const je=h();if(!je)return;Bn({type:"TRIGGER_LOADING",queryHash:je.queryHash});const at=je.options;je.fetch({...at,queryFn:()=>new Promise(()=>{}),gcTime:-1}),je.setState({data:void 0,status:"pending",fetchMeta:{...je.state.fetchMeta,__previousQueryOptions:at}})}},W(H,()=>b()==="pending"?"Restore":"Trigger",et),W(se,j(pe,{get when(){return f().length===0||b()==="error"},get children(){var Y=jL(),je=Y.firstChild,at=je.nextSibling;return Y.$$click=()=>{var Re;h().state.error?(Bn({type:"RESTORE_ERROR",queryHash:(Re=h())==null?void 0:Re.queryHash}),s.resetQueries(h())):O()},W(Y,()=>b()==="error"?"Restore":"Trigger",at),ve(Re=>{var $e=ce(t`
|
|
280
280
|
color: ${i(r.red[500],r.red[400])};
|
|
281
281
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),he=b()==="pending",ye=t`
|
|
282
282
|
background-color: ${i(r.red[500],r.red[400])};
|
|
283
|
-
`;return $e!==Re.e&&te(Y,Re.e=$e),he!==Re.t&&(Y.disabled=Re.t=he),ye!==Re.a&&te(je,Re.a=ye),Re},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(
|
|
283
|
+
`;return $e!==Re.e&&te(Y,Re.e=$e),he!==Re.t&&(Y.disabled=Re.t=he),ye!==Re.a&&te(je,Re.a=ye),Re},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(se,j(pe,{get when(){return!(f().length===0||b()==="error")},get children(){var Y=ML(),je=Y.firstChild,at=je.nextSibling,Re=at.nextSibling;return Re.firstChild,Re.addEventListener("change",$e=>{const he=f().find(ye=>ye.name===$e.currentTarget.value);O(he)}),W(Re,j(yS,{get each(){return f()},children:$e=>(()=>{var he=LL();return W(he,()=>$e.name),ve(()=>he.value=$e.name),he})()}),null),W(Y,j(zo,{}),null),ve($e=>{var he=ce(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),ye=t`
|
|
284
284
|
background-color: ${K.colors.red[400]};
|
|
285
|
-
`,fe=b()==="pending";return he!==$e.e&&te(Y,$e.e=he),ye!==$e.t&&te(je,$e.t=ye),fe!==$e.a&&(Re.disabled=$e.a=fe),$e},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(nt,()=>l()==="view"?"Explorer":"Editor",null),W(
|
|
285
|
+
`,fe=b()==="pending";return he!==$e.e&&te(Y,$e.e=he),ye!==$e.t&&te(je,$e.t=ye),fe!==$e.a&&(Re.disabled=$e.a=fe),$e},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(nt,()=>l()==="view"?"Explorer":"Editor",null),W(_,j(pe,{get when(){return l()==="view"},get children(){var Y=$L();return W(Y,j(Br,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return h()}})),ve(je=>(je=K.size[2])!=null?Y.style.setProperty("padding",je):Y.style.removeProperty("padding")),Y}}),Ve),W(_,j(pe,{get when(){return l()==="edit"},get children(){var Y=DL(),je=Y.firstChild,at=je.nextSibling,Re=at.firstChild,$e=Re.nextSibling,he=$e.firstChild,ye=he.nextSibling;return Y.addEventListener("submit",fe=>{fe.preventDefault();const ke=new FormData(fe.currentTarget).get("data");try{const ze=JSON.parse(ke);h().setState({...h().state,data:ze}),c("view")}catch(ze){d(!0)}}),je.addEventListener("focus",()=>d(!1)),W(Re,()=>u()?"Invalid Value":""),he.$$click=()=>c("view"),ve(fe=>{var Ne=ce(n().devtoolsEditForm,"tsqd-query-details-data-editor"),ke=n().devtoolsEditTextarea,ze=u(),Ge=n().devtoolsEditFormActions,Vt=n().devtoolsEditFormError,_n=n().devtoolsEditFormActionContainer,Gt=ce(n().devtoolsEditFormAction,t`
|
|
286
286
|
color: ${i(r.gray[600],r.gray[300])};
|
|
287
|
-
`),Lt=
|
|
287
|
+
`),Lt=ce(n().devtoolsEditFormAction,t`
|
|
288
288
|
color: ${i(r.blue[600],r.blue[400])};
|
|
289
|
-
`);return Ne!==fe.e&&te(Y,fe.e=Ne),ke!==fe.t&&te(je,fe.t=ke),ze!==fe.a&&
|
|
289
|
+
`);return Ne!==fe.e&&te(Y,fe.e=Ne),ke!==fe.t&&te(je,fe.t=ke),ze!==fe.a&&J(je,"data-error",fe.a=ze),Ge!==fe.o&&te(at,fe.o=Ge),Vt!==fe.i&&te(Re,fe.i=Vt),_n!==fe.n&&te($e,fe.n=_n),Gt!==fe.s&&te(he,fe.s=Gt),Lt!==fe.h&&te(ye,fe.h=Lt),fe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),ve(()=>je.value=JSON.stringify(p(),null,2)),Y}}),Ve),W(Le,j(Br,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),ve(Y=>{var je=ce(n().detailsContainer,"tsqd-query-details-container"),at=ce(n().detailsHeader,"tsqd-query-details-header"),Re=ce(n().detailsBody,"tsqd-query-details-summary-container"),$e=ce(n().queryDetailsStatus,k()),he=ce(n().detailsHeader,"tsqd-query-details-header"),ye=ce(n().actionsBody,"tsqd-query-details-actions-container"),fe=ce(t`
|
|
290
290
|
color: ${i(r.blue[600],r.blue[400])};
|
|
291
291
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),Ne=v()==="fetching",ke=t`
|
|
292
292
|
background-color: ${i(r.blue[600],r.blue[400])};
|
|
293
|
-
`,ze=
|
|
293
|
+
`,ze=ce(t`
|
|
294
294
|
color: ${i(r.yellow[600],r.yellow[400])};
|
|
295
295
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),Ge=b()==="pending",Vt=t`
|
|
296
296
|
background-color: ${i(r.yellow[600],r.yellow[400])};
|
|
297
|
-
`,_n=
|
|
297
|
+
`,_n=ce(t`
|
|
298
298
|
color: ${i(r.gray[600],r.gray[300])};
|
|
299
299
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Gt=b()==="pending",Lt=t`
|
|
300
300
|
background-color: ${i(r.gray[600],r.gray[400])};
|
|
301
|
-
`,wr=
|
|
301
|
+
`,wr=ce(t`
|
|
302
302
|
color: ${i(r.pink[500],r.pink[400])};
|
|
303
303
|
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),Zr=v()==="fetching",Hi=t`
|
|
304
304
|
background-color: ${i(r.pink[500],r.pink[400])};
|
|
305
|
-
`,Ui=
|
|
305
|
+
`,Ui=ce(t`
|
|
306
306
|
color: ${i(r.cyan[500],r.cyan[400])};
|
|
307
|
-
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),
|
|
307
|
+
`,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Va=o(),to=t`
|
|
308
308
|
background-color: ${i(r.cyan[500],r.cyan[400])};
|
|
309
|
-
`,no=
|
|
309
|
+
`,no=ce(n().detailsHeader,"tsqd-query-details-header"),ro=ce(n().detailsHeader,"tsqd-query-details-header"),Ki=K.size[2];return je!==Y.e&&te(_,Y.e=je),at!==Y.t&&te(A,Y.t=at),Re!==Y.a&&te(D,Y.a=Re),$e!==Y.o&&te(T,Y.o=$e),he!==Y.i&&te(re,Y.i=he),ye!==Y.n&&te(se,Y.n=ye),fe!==Y.s&&te(R,Y.s=fe),Ne!==Y.h&&(R.disabled=Y.h=Ne),ke!==Y.r&&te(ae,Y.r=ke),ze!==Y.d&&te(ne,Y.d=ze),Ge!==Y.l&&(ne.disabled=Y.l=Ge),Vt!==Y.u&&te(xe,Y.u=Vt),_n!==Y.c&&te(ee,Y.c=_n),Gt!==Y.w&&(ee.disabled=Y.w=Gt),Lt!==Y.m&&te(ie,Y.m=Lt),wr!==Y.f&&te(Q,Y.f=wr),Zr!==Y.y&&(Q.disabled=Y.y=Zr),Hi!==Y.g&&te(Ce,Y.g=Hi),Ui!==Y.p&&te(H,Y.p=Ui),Va!==Y.b&&(H.disabled=Y.b=Va),to!==Y.T&&te(Pe,Y.T=to),no!==Y.A&&te(nt,Y.A=no),ro!==Y.O&&te(Ve,Y.O=ro),Ki!==Y.I&&((Y.I=Ki)!=null?Le.style.setProperty("padding",Ki):Le.style.removeProperty("padding")),Y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),_}})},GL=()=>{const e=xt(),t=ge().shadowDOMTarget?Me.bind({target:ge().shadowDOMTarget}):Me,n=U(()=>e()==="dark"?Cn(t):Sn(t)),{colors:r}=K,i=(u,d)=>e()==="dark"?d:u,s=En(u=>{const f=u().getAll().find(h=>h.mutationId===Hr());return f?f.state.isPaused:!1}),o=En(u=>{const f=u().getAll().find(h=>h.mutationId===Hr());return f?f.state.status:"idle"}),a=U(()=>ts({isPaused:s(),status:o()})),l=En(u=>u().getAll().find(d=>d.mutationId===Hr()),!1),c=()=>a()==="gray"?t`
|
|
310
310
|
background-color: ${i(r[a()][200],r[a()][700])};
|
|
311
311
|
color: ${i(r[a()][700],r[a()][300])};
|
|
312
312
|
border-color: ${i(r[a()][400],r[a()][600])};
|
|
@@ -314,7 +314,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
314
314
|
background-color: ${i(r[a()][100],r[a()][900])};
|
|
315
315
|
color: ${i(r[a()][700],r[a()][300])};
|
|
316
316
|
border-color: ${i(r[a()][400],r[a()][600])};
|
|
317
|
-
`;return
|
|
317
|
+
`;return j(pe,{get when(){return l()},get children(){var u=RL(),d=u.firstChild,f=d.nextSibling,h=f.firstChild,g=h.firstChild,m=g.firstChild,p=g.nextSibling,v=h.nextSibling,b=v.firstChild,w=b.nextSibling,S=f.nextSibling,x=S.nextSibling,O=x.nextSibling,C=O.nextSibling,k=C.nextSibling,_=k.nextSibling,A=_.nextSibling,D=A.nextSibling;return W(m,j(pe,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Ul(l().options.mutationKey,!0)}})),W(p,j(pe,{get when(){return a()==="purple"},children:"pending"}),null),W(p,j(pe,{get when(){return a()!=="purple"},get children(){return o()}}),null),W(w,()=>new Date(l().state.submittedAt).toLocaleTimeString()),W(x,j(Br,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),W(C,j(Br,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),W(_,j(Br,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),W(D,j(Br,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),ve(I=>{var z=ce(n().detailsContainer,"tsqd-query-details-container"),N=ce(n().detailsHeader,"tsqd-query-details-header"),T=ce(n().detailsBody,"tsqd-query-details-summary-container"),$=ce(n().queryDetailsStatus,c()),L=ce(n().detailsHeader,"tsqd-query-details-header"),Z=K.size[2],ue=ce(n().detailsHeader,"tsqd-query-details-header"),F=K.size[2],V=ce(n().detailsHeader,"tsqd-query-details-header"),re=K.size[2],se=ce(n().detailsHeader,"tsqd-query-details-header"),R=K.size[2];return z!==I.e&&te(u,I.e=z),N!==I.t&&te(d,I.t=N),T!==I.a&&te(f,I.a=T),$!==I.o&&te(p,I.o=$),L!==I.i&&te(S,I.i=L),Z!==I.n&&((I.n=Z)!=null?x.style.setProperty("padding",Z):x.style.removeProperty("padding")),ue!==I.s&&te(O,I.s=ue),F!==I.h&&((I.h=F)!=null?C.style.setProperty("padding",F):C.style.removeProperty("padding")),V!==I.r&&te(k,I.r=V),re!==I.d&&((I.d=re)!=null?_.style.setProperty("padding",re):_.style.removeProperty("padding")),se!==I.l&&te(A,I.l=se),R!==I.u&&((I.u=R)!=null?D.style.setProperty("padding",R):D.style.removeProperty("padding")),I},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),u}})},uc=new Map,QL=()=>{const e=U(()=>ge().client.getQueryCache()),t=e().subscribe(n=>{tS(()=>{for(const[r,i]of uc.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return Se(()=>{uc.clear(),t()}),t},mt=(e,t=!0,n=()=>!0)=>{const r=U(()=>ge().client.getQueryCache()),[i,s]=oe(e(r),t?void 0:{equals:!1});return be(()=>{s(e(r))}),uc.set(e,{setter:s,shouldUpdate:n}),Se(()=>{uc.delete(e)}),i},dc=new Map,YL=()=>{const e=U(()=>ge().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of dc.entries())queueMicrotask(()=>{r(n(e))})});return Se(()=>{dc.clear(),t()}),t},En=(e,t=!0)=>{const n=U(()=>ge().client.getMutationCache()),[r,i]=oe(e(n),t?void 0:{equals:!1});return be(()=>{i(e(n))}),dc.set(e,i),Se(()=>{dc.delete(e)}),r},XL="@tanstack/query-devtools-event",Bn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(XL,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},Dx=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=K,l=(c,u)=>e==="light"?c:u;return{devtoolsBtn:t`
|
|
318
318
|
z-index: 100000;
|
|
319
319
|
position: fixed;
|
|
320
320
|
padding: 4px;
|
|
@@ -1279,17 +1279,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1279
1279
|
opacity: 0.6;
|
|
1280
1280
|
cursor: not-allowed;
|
|
1281
1281
|
}
|
|
1282
|
-
`}},Sn=e=>Dx("light",e),Cn=e=>Dx("dark",e);
|
|
1283
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sR(e,t){if(e){if(typeof e=="string")return
|
|
1284
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uR(e,t){if(e){if(typeof e=="string")return
|
|
1285
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bR(e){if(Array.isArray(e))return
|
|
1286
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rx(e,t){if(e){if(typeof e=="string")return
|
|
1287
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ER(e,t){if(e){if(typeof e=="string")return
|
|
1288
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e,t){if(e){if(typeof e=="string")return
|
|
1289
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zR(e,t){if(e){if(typeof e=="string")return
|
|
1290
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VR(e,t){if(e){if(typeof e=="string")return
|
|
1291
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cN(e,t){if(e){if(typeof e=="string")return
|
|
1292
|
-
example: California, Bavaria, or Paris.`})]}),y.jsx(Fx,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:C||!!a||d,isLoading:C||!!a})]})};const hN=Object.freeze(Object.defineProperty({__proto__:null,default:fN},Symbol.toStringTag,{value:"Module"})),gN=e
|
|
1293
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vN(e){if(Array.isArray(e))return
|
|
1294
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qx(e,t){if(e){if(typeof e=="string")return ef(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ef(e,t):void 0}}function ef(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function CN(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function _N(e){if(Array.isArray(e))return e}var Do=5,Io="Generating...",kN="Re-generating...",ON=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],EN=Array.from({length:Do},function(e,t){return{id:"query-".concat(t),text:Io,isRegenerating:!0}}),AN=function(){var t=hc(),n=t.brandId,r="/setup/".concat(n,"/analysis"),i=xn(),s=Kt(),o=q.useState(EN),a=Qi(o,2),l=a[0],c=a[1],u=q.useState(!1),d=Qi(u,2),f=d[0],h=d[1],g=q.useState([]),m=Qi(g,2),p=m[0],v=m[1],b=q.useState([]),w=Qi(b,2),S=w[0],x=w[1],O=q.useState(!1),C=Qi(O,2),_=C[0],k=C[1],E=q.useState(null),j=Qi(E,2),D=j[0],z=j[1],N=iO(n||"",{query:{enabled:!!n}}),M=N.data,I=N.isRefetching,L=N.refetch,J=eO({mutation:{onSuccess:function(Q){z(null),Q!=null&&Q.status&&Q.status>=200&&Q.status<300&&(s.invalidateQueries({queryKey:[mf(n||"")]}),i(r))},onError:function(Q){var Ce,H;if((Q==null||(Ce=Q.response)===null||Ce===void 0||(Ce=Ce.data)===null||Ce===void 0?void 0:Ce.message)==="Cannot update queries for a brand that has existing analyses."){i(r,{replace:!0});return}var Pe=(Q==null||(H=Q.response)===null||H===void 0||(H=H.data)===null||H===void 0?void 0:H.message)||(Q==null?void 0:Q.message)||"An unexpected error occurred.";z(Pe)}}}),ce=J.mutate,F=J.isPending;q.useEffect(function(){n||i("/setup",{replace:!0})},[n,i]),q.useEffect(function(){var re;if(M!=null&&(re=M.data)!==null&&re!==void 0&&re.queries&&Array.isArray(M.data.queries)){var Q=M.data.queries.slice(0,Do);c(Q.map(function(Ce,H){return{id:"query-".concat(H),text:Ce,isRegenerating:!1}})),x(M.data.queries.slice(Do))}},[M]),q.useEffect(function(){var re;if(_&&M!==null&&M!==void 0&&(re=M.data)!==null&&re!==void 0&&re.queries&&Array.isArray(M.data.queries)&&!I){var Q=M.data.queries.slice(0,Do),Ce=p.map(Number);c(function(H){return H.map(function(Pe,et){var nt=Ce.indexOf(et);return _r(_r({},Pe),{},{text:nt>=0&&Q[nt]?Q[nt]:Pe.text,isRegenerating:!1})})}),k(!1),v([])}},[M,I,_,p]);var V=q.useCallback(function(re,Q){var Ce=new Set(Q);return S.filter(function(H){return!Ce.has(H)}).slice(0,re)},[S]),ie=q.useMemo(function(){return I||l.length===0||l.some(function(re){return re.isRegenerating||re.text===Io})||f},[I,l,f]),ue=I||l.some(function(re){return re.text===Io}),R=q.useCallback(function(re){var Q=re.toString();v(function(Ce){return Ce.includes(Q)?Ce.filter(function(H){return H!==Q}):[].concat(yN(Ce),[Q])})},[]),oe=q.useCallback(function(re,Q){c(function(Ce){return Ce.map(function(H,Pe){return Pe===re?_r(_r({},H),{},{text:Q}):H})})},[]),ne=function(){h(!f),v([])},xe=q.useCallback(function(){if(!(I||p.length===0)){c(function(H){return H.map(function(Pe,et){return _r(_r({},Pe),{},{isRegenerating:p.includes(et.toString())})})});var re=l.map(function(H){return H.text}),Q=p.length,Ce=V(Q,re);Ce.length===Q?(c(function(H){return H.map(function(Pe,et){var nt=p.indexOf(et.toString());return nt>=0?_r(_r({},Pe),{},{text:Ce[nt],isRegenerating:!1}):Pe})}),x(function(H){var Pe=new Set(Ce);return H.filter(function(et){return!Pe.has(et)})}),v([])):(k(!0),L())}},[I,p,L,l,V]),ee=q.useCallback(function(re){re.preventDefault(),n&&ce({brandId:n,data:{queries:l.map(function(Q){return Q.text})}})},[n,l,ce]);return y.jsxs("div",{children:[D&&y.jsx(A.Alert,{className:"yst-mb-4",variant:"error",children:D}),y.jsxs("form",{onSubmit:ee,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(A.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:_e("yst-flex yst-gap-2",f?"yst-justify-end":"yst-justify-start"),children:f?y.jsxs(y.Fragment,{children:[y.jsx(A.Button,{size:"small",variant:"secondary",onClick:ne,children:"Done"}),y.jsxs(A.Button,{variant:"secondary",size:"small",onClick:xe,className:"yst-gap-1",isLoading:I,disabled:I||p.length===0,children:[y.jsx(gN,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(A.Button,{size:"small",variant:"secondary",onClick:ne,className:"yst-gap-1.5",disabled:ue,children:[y.jsx(jO,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:l.length===0?ON.map(function(re,Q){return y.jsx("div",{className:_e("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(A.SkeletonLoader,{children:re||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(Q))}):l.slice(0,Do).map(function(re,Q){var Ce=re.isRegenerating?re.text===Io?Io:kN:re.text;return y.jsx("div",{className:_e("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[f&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(A.Checkbox,{id:"query-regenerate-".concat(Q),name:"query-regenerate-".concat(Q),value:Q.toString(),checked:p.includes(Q.toString()),onChange:function(){return R(Q)},disabled:I})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Label,{htmlFor:"query-text-".concat(Q),className:"yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700",children:"Query ".concat(Q+1)}),y.jsx(A.TextInput,{id:"query-text-".concat(Q),type:"text",value:Ce,onChange:function(H){re.isRegenerating||oe(Q,H.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:re.isRegenerating,required:!0,maxLength:255})]})]})},re.id)})}),y.jsx(Fx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:ie,isLoading:F})]})]})};const PN=Object.freeze(Object.defineProperty({__proto__:null,default:AN},Symbol.toStringTag,{value:"Module"}));var TN=["min","max","progress","className"];function jN(e,t){if(e==null)return{};var n,r,i=MN(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function MN(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var zx=q.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=jN(e,TN),a=q.useMemo(function(){var c=Math.max(0,r-n);if(c===0)return 0;var u=(i-n)/c*100;return Math.max(0,Math.min(100,u))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:_e(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});zx.displayName="ProgressBarGradient";var Yi=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],Hx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var c=0;c<Yi.length;c++)if(r<=Yi[c].threshold)return Yi[c];return Yi[Yi.length-1]},a=o();return y.jsxs("div",{className:_e("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(A.Spinner,{}):y.jsx(Qv,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(zx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:Yi.map(function(l){return y.jsx("span",{children:y.jsx(jc,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};Hx.propTypes={progress:kd.number,className:kd.string};var $N=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},DN=function(){var t,n,r,i=xn(),s=Kt(),o=hc(),a=Gn(),l=a.brandId,c=o.brandId||l,u=pf(c,{query:{enabled:!!c,select:function(S){var x=S.data;return x}}}),d=u.data,f=_k(c,"latest",{query:{enabled:!!c,select:function(S){var x=S.data;return x},refetchInterval:function(S){var x,O=S==null||(x=S.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return $N(O==null?void 0:O.status)}}}),h=f.data;q.useEffect(function(){var w=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&iP(d.nextScheduledAnalysis,5)&&!w&&i("/brands/".concat(c),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,c,i,h==null?void 0:h.status]),q.useEffect(function(){d!=null&&d.firstNextAnalysisOpportunity&&!ob(d.firstNextAnalysisOpportunity,2)&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,m,i]);var g=h==null?void 0:h.id,m=g?"/brands/".concat(c,"/analysis/").concat(g):"/brands/".concat(c),p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var w=80/p,S=v*w;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(S,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(Hx,{progress:b}),y.jsx(Na,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(w){var S,x=w.id,O=w.query,C=x&&(h==null||(S=h.completedQueries)===null||S===void 0?void 0:S.includes(x));return y.jsxs("div",{className:_e("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[C===!0?y.jsx(Qv,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(A.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:O})]},"result-item-".concat(O))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(A.Button,{as:Yr,to:m,onClick:function(){return s.clear()},children:b===100?"Continue →":"Skip for now"})})]})};const IN=Object.freeze(Object.defineProperty({__proto__:null,default:DN},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=T$;exports.setApiBaseUrl=Iv;
|
|
1282
|
+
`}},Sn=e=>Dx("light",e),Cn=e=>Dx("dark",e);bc(["click","mousedown","input"]);var JL=e=>{const[t,n]=t1({prefix:"TanstackQueryDevtools"}),r=lv(),i=U(()=>{const s=t.theme_preference||n1;return s!=="system"?s:r()});return j(Bf.Provider,{value:e,get children(){return j(o1,{localStore:t,setLocalStore:n,get children(){return j(zf.Provider,{value:i,get children(){return j(FL,{localStore:t,setLocalStore:n})}})}})}})},ZL=JL;const eR=Object.freeze(Object.defineProperty({__proto__:null,default:ZL},Symbol.toStringTag,{value:"Module"}));var tR=e=>{const[t,n]=t1({prefix:"TanstackQueryDevtools"}),r=lv(),i=U(()=>{const s=t.theme_preference||n1;return s!=="system"?s:r()});return j(Bf.Provider,{value:e,get children(){return j(o1,{disabled:!0,localStore:t,setLocalStore:n,get children(){return j(zf.Provider,{value:i,get children(){return j(qL,{get children(){return j(lh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},nR=tR;const rR=Object.freeze(Object.defineProperty({__proto__:null,default:nR},Symbol.toStringTag,{value:"Module"}));function Ix(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Paper.Header,{children:[r&&y.jsx(E.Title,{className:_e({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}function Bu(e,t){return aR(e)||oR(e,t)||sR(e,t)||iR()}function iR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1283
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sR(e,t){if(e){if(typeof e=="string")return vp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vp(e,t):void 0}}function vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function aR(e){if(Array.isArray(e))return e}var lR=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Gn(),a=o.brandId,l=q.useState(""),c=Bu(l,2),u=c[0],d=c[1],f=q.useState([]),h=Bu(f,2),g=h[0],m=h[1],p=q.useState(!1),v=Bu(p,2),b=v[0],w=v[1],S=Kt();q.useEffect(function(){if(n&&i&&i.type==="group"){var L;d(String(i.name||""));var Z=((L=i.groupedBrands)===null||L===void 0?void 0:L.map(function(ue){return String(ue.id||"")}))||[];m(Z)}},[n,i]);var x=qv({mutation:{onSuccess:function(){S.invalidateQueries({queryKey:Vl(a)}),I()},onError:function(Z){console.error("Error creating brand group:",Z)}}}),O=x.mutate,C=x.isPending,k=Ik({mutation:{onSuccess:function(){S.invalidateQueries({queryKey:Vl(a)}),I(),T()},onError:function(Z){console.error("Error deleting brand group:",Z),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),_=k.mutate,A=k.isPending,D=function(){!u.trim()||!(i!=null&&i.id)||O({brandId:a,data:{groupName:u.trim(),brandIds:g.map(function(Z){return Number(Z)})}})},I=function(){d(""),m([]),r()},z=function(){return g.map(function(Z){if(i&&i.type==="group"){var ue,F=(ue=i.groupedBrands)===null||ue===void 0?void 0:ue.find(function(re){return String(re.id)===Z});if(F)return F.name||""}var V=s.find(function(re){return String(re.id)===Z});return V?V.type==="group"?"Group: ".concat(V.name):V.name||"":""}).filter(Boolean)},N=function(){w(!0)},T=function(){return w(!1)},$=function(){typeof(i==null?void 0:i.id)=="number"&&_({brandGroupId:i.id})};return!i||i.type!=="group"?null:y.jsxs(y.Fragment,{children:[y.jsx(E.Modal,{isOpen:n,onClose:b?function(){}:I,as:"div",children:y.jsx(E.Modal.Panel,{children:y.jsxs(E.Modal.Container,{children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(E.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-4",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"Update the group name or ungroup brands by removing their tags."}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"editGroupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(E.TextInput,{id:"editGroupName",value:u,onChange:function(L){return d(L.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(E.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:z(),onRemoveTag:function(L){if(g.length<2)return w(!0);m(function(Z){return Z.filter(function(ue,F){return F!==L})})},onAddTag:function(){}}),g.length===0?y.jsx("p",{className:"yst-mt-2 yst-text-sm",children:'Click "Ungroup brands" to remove this group.'}):y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]})]}),y.jsx(E.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-w-full yst-items-center yst-justify-between",children:[y.jsx("div",{className:"yst-flex yst-justify-start",children:y.jsx(E.Button,{variant:"tertiary",onClick:N,disabled:C,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:I,children:"Cancel"}),y.jsx(E.Button,{variant:"primary",onClick:D,disabled:!u.trim()||C,isLoading:C,children:C?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(Mc,{isOpen:b,onClose:T,onConfirm:$,title:"Ungroup this brand group?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"The group will be removed, but the brands inside will remain in your brand list."}),y.jsx("p",{children:"This action cannot be undone. To create a new group with these brands, simply select them and create a new group."})]}),confirmText:"Yes, ungroup",isLoading:A})]})};function bp(e,t){return fR(e)||dR(e,t)||uR(e,t)||cR()}function cR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1284
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uR(e,t){if(e){if(typeof e=="string")return xp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xp(e,t):void 0}}function xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function fR(e){if(Array.isArray(e))return e}var hR=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=Kt(),l=q.useState(""),c=bp(l,2),u=c[0],d=c[1],f=q.useState([]),h=bp(f,2),g=h[0],m=h[1];q.useEffect(function(){if(n&&s.length>0){var O,C=(O=s[0])===null||O===void 0?void 0:O.name;d(String(C||"New Group")),m(s.map(function(k){var _;return String((_=k.id)!==null&&_!==void 0?_:"")}))}},[n,s]);var p=qv({mutation:{onSuccess:function(){a.invalidateQueries({queryKey:Vl(i)}),o==null||o(),w()},onError:function(C){console.error("Error creating group:",C)}}}),v=p.mutate,b=p.isPending,w=function(){d(""),m([]),r()},S=function(){if(!(!u.trim()||g.length===0)){var C=g.flatMap(function(k){var _=s.find(function(A){return String(A.id)===k});return _&&_.type==="group"&&Array.isArray(_.groupedBrands)?_.groupedBrands.map(function(A){return String(A.id)}):k});v({brandId:i,data:{groupName:u.trim(),brandIds:C.filter(function(k){return k!==""}).map(function(k){return Number(k)})}})}},x=function(C){m(function(k){return k.filter(function(_){return _!==C})})};return y.jsx(E.Modal,{isOpen:n,onClose:w,children:y.jsx(E.Modal.Panel,{children:y.jsxs(E.Modal.Container,{children:[y.jsx(E.Modal.Container.Header,{children:y.jsx(E.Modal.Title,{children:"Edit brand group"})}),y.jsxs(E.Modal.Container.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"groupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(E.TextInput,{id:"groupName",value:u,onChange:function(O){return d(O.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(E.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(g.length,")"),tags:g.map(function(O){var C=s.find(function(k){return String(k.id)===O});return C?C.type==="group"?"Group: ".concat(C.name):C.name||"":""}).filter(Boolean),onRemoveTag:function(O){var C=g.find(function(k){var _=s.find(function(D){return String(D.id)===k});if(!_)return!1;var A=_.type==="group"?"Group: ".concat(_.name):_.name||"";return A===O});C&&x(C)},onAddTag:function(){}}),g.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]}),y.jsx("p",{children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]}),y.jsx(E.Modal.Container.Footer,{className:"yst-pt-4",children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:w,disabled:b,children:"Cancel"}),y.jsx(E.Button,{variant:"primary",onClick:S,disabled:!u.trim()||g.length===0||b,children:b?"Saving...":"Save group"})]})})]})})})};function ga(e){"@babel/helpers - typeof";return ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(e)}function wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wp(Object(n),!0).forEach(function(r){Lx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lx(e,t,n){return(t=gR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gR(e){var t=yR(e,"string");return ga(t)=="symbol"?t:t+""}function yR(e,t){if(ga(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ga(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mR(e){return bR(e)||vR(e)||Rx(e)||pR()}function pR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1285
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bR(e){if(Array.isArray(e))return Zd(e)}function Rn(e,t){return SR(e)||wR(e,t)||Rx(e,t)||xR()}function xR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1286
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rx(e,t){if(e){if(typeof e=="string")return Zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}function Zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function SR(e){if(Array.isArray(e))return e}var CR=function(){var t,n=ln(),r=q.useState(!1),i=Rn(r,2),s=i[0],o=i[1],a=q.useState({}),l=Rn(a,2),c=l[0],u=l[1],d=q.useState(""),f=Rn(d,2),h=f[0],g=f[1],m=q.useState(1),p=Rn(m,2),v=p[0],b=p[1],w=q.useState({}),S=Rn(w,2),x=S[0],O=S[1],C=q.useState(!1),k=Rn(C,2),_=k[0],A=k[1],D=q.useState(!1),I=Rn(D,2),z=I[0],N=I[1],T=q.useState(null),$=Rn(T,2),L=$[0],Z=$[1],ue=Gn(),F=ue.brandId;function V(he){return String(he.id)}var re=Tk(F,{query:{enabled:!!F}}),se=re.data,R=re.isLoading,ae=10,ne=(se==null||(t=se.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(he){var ye,fe;return h?((ye=(fe=he.name)===null||fe===void 0?void 0:fe.toLowerCase())!==null&&ye!==void 0?ye:"").includes(h.toLowerCase()):!0}))||[],xe=Math.ceil(ne.length/ae),ee=(v-1)*ae,ie=mR(ne).sort(function(he,ye){return he.type==="group"&&ye.type!=="group"?-1:he.type!=="group"&&ye.type==="group"?1:0}),Q=ie.slice(ee,ee+ae),Ce=function(ye){var fe=ne.find(function(Ne){return V(Ne)===ye});fe&&fe.type==="group"?(Z(fe),N(!0)):console.log("Individual brand edit not implemented yet")},H=Object.entries(x).filter(function(he){var ye=Rn(he,2),fe=ye[1];return fe}).map(function(he){var ye=Rn(he,1),fe=ye[0];return fe}),Pe=function(){console.log("Group brands:",H),A(!0)},et=function(ye){g(ye.target.value),b(1)},nt=function(ye){O(function(fe){return Sp(Sp({},fe),{},Lx({},ye,!fe[ye]))})},Ve=function(){n("/")},Le=function(){O({}),u({}),o(!1)},Y=function(){A(!1)},je=function(){O({}),b(1),g("")},at=function(){N(!1),Z(null)},Re=function(ye,fe){return ye in c?!!c[ye]:!fe.isHidden},$e=[{Header:"Brand name",accessor:"name",Cell:function(ye){var fe=ye.value,Ne=ye.row;return y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsx(E.Checkbox,{id:"brand-checkbox-".concat(Ne.id),checked:!!x[V(Ne)],onChange:function(){return nt(V(Ne))},value:V(Ne),label:Ne.isSelf?y.jsx(jc,{children:fe}):fe,name:"brand-checkbox-".concat(Ne.id),disabled:!Re(V(Ne),Ne)}),Ne.type==="group"&&y.jsx(TE,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(ye){var fe=ye.id,Ne=fe===void 0?"":fe;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(E.Checkbox,{id:"loading-row-checkbox-".concat(Ne),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ne)})," ",y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ne)})]})}},{Header:"Actions",accessor:"id",Cell:function(ye){var fe=ye.value,Ne=ye.row;return y.jsx(y.Fragment,{children:Ne.type==="group"?y.jsxs(E.Button,{variant:"tertiary",size:"small",onClick:function(){return Ce(String(fe!=null?fe:""))},className:"yst-gap-1.5 yst-px-0",disabled:!Re(V(Ne),Ne),children:[y.jsx(Kv,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(E.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(Ix,{title:"Brand list ".concat(""),children:y.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),y.jsxs(E.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(E.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:et})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(E.Table,{columns:$e,className:"yst-w-full",variant:"minimal",children:[y.jsx(E.Table.Head,{children:y.jsx(E.Table.Row,{children:$e.map(function(he){return y.jsx(E.Table.Header,{children:he.Header},he.accessor)})})}),y.jsx(E.Table.Body,{children:R?[1,2,3].map(function(he,ye){return y.jsx(E.Table.Row,{children:$e.map(function(fe,Ne){return y.jsx(E.Table.Cell,{children:y.jsx(fe.LoadingComponent,{id:"skeleton-".concat(ye,"-").concat(Ne)},fe.accessor)},"cell-".concat(Ne))})},ye)}):Q.length===0?y.jsx(E.Table.Row,{children:y.jsx(E.Table.Cell,{colSpan:$e.length,children:y.jsxs("div",{className:"yst-py-12 yst-text-center",children:[y.jsx("h3",{className:"yst-mt-4 yst-text-lg yst-font-medium yst-text-slate-900",children:"No brands found"}),y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:h?'No brands match "'.concat(h,'". Try a different search term.'):"No brands have been found yet. Run an analysis to discover brands."}),h&&y.jsx(E.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):Q.map(function(he){return y.jsx(E.Table.Row,{children:$e.map(function(ye){return y.jsx(E.Table.Cell,{children:ye.Cell?ye.Cell({value:he[ye.accessor],row:he}):he[ye.accessor]},ye.accessor)})},he.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(E.Button,{variant:"secondary",onClick:Pe,className:"yst-mb-0 yst-gap-2",disabled:H.length<2,children:[y.jsx(HO,{})," Group brands"]}),y.jsx(E.Pagination,{variant:"text",current:v,total:xe,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(wf,{children:y.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?y.jsxs(y.Fragment,{children:[y.jsx(E.Button,{variant:"secondary",className:"yst-mb-0",onClick:Le,children:"Discard changes"}),y.jsx(E.Button,{variant:"primary",className:"yst-mb-0",onClick:Ve,children:"Save changes"})]}):y.jsx(E.Button,{as:Yr,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(hR,{isOpen:_,onClose:Y,brandId:F,brandsToGroup:ne.filter(function(he){return H.includes(V(he))}),onGroupCreated:je}),y.jsx(lR,{isOpen:z,onClose:at,groupToEdit:L,allBrands:ne})]})};const _R=Object.freeze(Object.defineProperty({__proto__:null,default:CR},Symbol.toStringTag,{value:"Module"}));function kR(e,t){return PR(e)||AR(e,t)||ER(e,t)||OR()}function OR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1287
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ER(e,t){if(e){if(typeof e=="string")return Cp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cp(e,t):void 0}}function Cp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function PR(e){if(Array.isArray(e))return e}var TR=function(t){var n=t.isOpen,r=t.onClose,i=Kt(),s=q.useState(""),o=kR(s,2),a=o[0],l=o[1],c=cO({mutation:{onSuccess:function(){i.clear(),r()}}}),u=c.mutate,d=c.isPending;return q.useEffect(function(){n&&l("")},[n]),y.jsx(Mc,{isOpen:n,onClose:r,onConfirm:function(){u()},isLoading:d,disabled:a!=="DELETE ALL",title:"Delete all data?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently erase all brands, analysis results, and queries from your account."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(E.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:a,onChange:function(f){return l(f.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function jR(e,t){return IR(e)||DR(e,t)||$R(e,t)||MR()}function MR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1288
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e,t){if(e){if(typeof e=="string")return _p(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}function _p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function DR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function IR(e){if(Array.isArray(e))return e}var LR=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Kt(),a=q.useState(""),l=jR(a,2),c=l[0],u=l[1],d=Kk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:sr()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return q.useEffect(function(){n&&u("")},[n]),y.jsx(Mc,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:c.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(E.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:c,onChange:function(g){return u(g.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})};function ya(e){"@babel/helpers - typeof";return ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ya(e)}function $o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Zt(b,"_invoke",function(w,S,x){var O,C,k,_=0,A=x||[],D=!1,I={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(T,$){return O=T,C=0,k=e,I.n=$,o}};function z(N,T){for(C=N,k=T,t=0;!D&&_&&!$&&t<A.length;t++){var $,L=A[t],Z=I.p,ue=L[2];N>3?($=ue===T)&&(k=L[(C=L[4])?5:(C=3,3)],L[4]=L[5]=e):L[0]<=Z&&(($=N<2&&Z<L[1])?(C=0,I.v=T,I.n=L[1]):Z<ue&&($=N<3||L[0]>T||T>ue)&&(L[4]=N,L[5]=T,I.n=ue,C=0))}if($||N>1)return o;throw D=!0,T}return function(N,T,$){if(_>1)throw TypeError("Generator is already running");for(D&&T===1&&z(T,$),C=T,k=$;(t=C<2?e:k)||!D;){O||(C?C<3?(C>1&&(I.n=-1),z(C,k)):I.n=k:I.v=k);try{if(_=2,O){if(C||(N="next"),t=O[N]){if(!(t=t.call(O,k)))throw TypeError("iterator result is not an object");if(!t.done)return t;k=t.value,C<2&&(C=0)}else C===1&&(t=O.return)&&t.call(O),C<2&&(k=TypeError("The iterator does not provide a '"+N+"' method"),C=1);O=e}else if((t=(D=I.n<0)?k:w.call(S,I))!==o)break}catch(L){O=e,C=1,k=L}finally{_=1}}return{value:t,done:D}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Zt(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Zt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Zt(d,"constructor",c),Zt(c,"constructor",l),l.displayName="GeneratorFunction",Zt(c,i,"GeneratorFunction"),Zt(d),Zt(d,i,"Generator"),Zt(d,r,function(){return this}),Zt(d,"toString",function(){return"[object Generator]"}),($o=function(){return{w:s,m:f}})()}function Zt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Zt=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Zt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Zt(e,t,n,r)}function kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kp(Object(n),!0).forEach(function(r){RR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RR(e,t,n){return(t=NR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NR(e){var t=FR(e,"string");return ya(t)=="symbol"?t:t+""}function FR(e,t){if(ya(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ya(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Op(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ep(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Op(s,r,i,o,a,"next",l)}function a(l){Op(s,r,i,o,a,"throw",l)}o(void 0)})}}function BR(e,t){return UR(e)||HR(e,t)||zR(e,t)||qR()}function qR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1289
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zR(e,t){if(e){if(typeof e=="string")return Ap(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ap(e,t):void 0}}function Ap(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function UR(e){if(Array.isArray(e))return e}var KR=function(t){var n,r=t.brand,i=t.isLast,s=t.onDelete,o=r.id,a=Gn(),l=a.hostAppProps,c=l.onAddSubscription,u=ln(),d=Ia(),f=d.setBrandId,h=q.useState(!1),g=BR(h,2),m=g[0],p=g[1],v=Kt(),b=Pc({query:{select:function(N){var T=N.data;return T}}}),w=b.data,S=vf(o,{query:{select:function(N){var T=N.data;return T}}}),x=S.data,O=zv({mutation:{onMutate:function(){var z=Ep($o().m(function T($){var L,Z,ue;return $o().w(function(F){for(;;)switch(F.n){case 0:return L=$.brandId,Z=$.data,F.n=1,v.cancelQueries({queryKey:sr()});case 1:return ue=v.getQueryData(sr()),v.setQueryData(sr(),function(V){var re,se;return V&&Cr(Cr({},V),{},{data:Cr(Cr({},V.data),{},{brands:((re=(se=V.data)===null||se===void 0?void 0:se.brands)!==null&&re!==void 0?re:[]).map(function(R){return R.id===L?Cr(Cr({},R),{},{settings:Cr(Cr({},R.settings),{},{enableAutomaticAnalysis:Z.enableAutomaticAnalysis})}):R})})})}),F.a(2,{previous:ue})}},T)}));function N(T){return z.apply(this,arguments)}return N}(),onSuccess:function(){if(r.settings.enableAutomaticAnalysis===!1)return p(!1);p(!I)},onError:function(N,T,$){$!=null&&$.previous&&v.setQueryData(sr(),$.previous)},onSettled:function(){var z=Ep($o().m(function T(){return $o().w(function($){for(;;)switch($.n){case 0:return $.n=1,Promise.all([v.invalidateQueries({queryKey:sr()}),v.invalidateQueries({queryKey:bf()})]);case 1:return $.a(2)}},T)}));function N(){return z.apply(this,arguments)}return N}()}}),C=O.mutate,k=O.isPending,_=function(N){C({brandId:o,data:{enableAutomaticAnalysis:N}})},A=function(N){if(N){if(!D)return p(!0);if(!I)return _(!0);p(!0)}else _(!1)},D=Number(w==null?void 0:w.maxNumberOfActiveBrands)-Number(w==null?void 0:w.numberOfActiveBrands)>0||r.settings.enableAutomaticAnalysis===!0,I=ab(x==null?void 0:x.firstNextAnalysisOpportunity);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:_e("yst-flex yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-4 yst-py-4 yst-text-slate-800",{"yst-border-b-[1px] yst-border-b-slate-200":!i}),children:[y.jsx(E.Toggle,{id:"toggle-brand-".concat(r==null?void 0:r.id),checked:r==null||(n=r.settings)===null||n===void 0?void 0:n.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:A,disabled:(r==null?void 0:r.id)==="loading"||k}),y.jsxs("div",{className:"yst-font-medium",children:[(r==null?void 0:r.id)==="loading"?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):r==null?void 0:r.name,(r==null?void 0:r.setupStatus)==="pendingQuerySelection"&&y.jsx("div",{children:y.jsx(E.Link,{onClick:function(){r.id?(f(r.id),u("/setup/".concat(r.id,"/queries"))):console.error("Brand ID is missing.")},children:"Finish setup"})}),(r==null?void 0:r.nextScheduledAnalysis)&&y.jsxs("div",{className:"yst-text-slate-500 yst-italic",children:["Next analysis: ",Od(r.nextScheduledAnalysis)]})]}),y.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(r==null?void 0:r.id)==="loading"?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(E.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){r!=null&&r.id&&s(r.id)},disabled:(r==null?void 0:r.id)==="loading",children:[y.jsx(xf,{})," Delete brand"]})})]}),y.jsx(E.Modal,{isOpen:m,onClose:function(){return p(!1)},position:"center",as:"div",className:_e({"yst-mx-auto yst-max-w-xl":D}),children:D?y.jsx(E.Modal.Panel,{children:I?y.jsxs(y.Fragment,{children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),y.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),y.jsxs(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:function(){return p(!1)},children:"Cancel"}),y.jsx(E.Button,{variant:"primary",onClick:function(){_(!0)},isLoading:k,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),y.jsxs("p",{children:["The next analysis will run on"," ",y.jsx("span",{className:"yst-font-medium",children:Od(r==null?void 0:r.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(E.Button,{variant:"primary",onClick:function(){return p(!1)},children:"Got it"})})]})}):y.jsxs(E.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(E.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(E.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(E.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(Wv,{}),"Add a subscription"]}),y.jsx(E.Button,{variant:"tertiary",className:"",onClick:function(){return p(!1)},children:"Manage active brands"})]})})]})})]})},Pp,Tp,jp;function qu(e,t){return QR(e)||GR(e,t)||VR(e,t)||WR()}function WR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1290
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VR(e,t){if(e){if(typeof e=="string")return Mp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mp(e,t):void 0}}function Mp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function QR(e){if(Array.isArray(e))return e}function ch(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $p=Na(Pp||(Pp=ch(["xl:yst-w-1/3"]))),Dp=Na(Tp||(Tp=ch(["xl:yst-w-2/3"]))),Ip=Na(jp||(jp=ch(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),YR=function(){var t,n,r,i,s=q.useState(!1),o=qu(s,2),a=o[0],l=o[1],c=q.useState(!1),u=qu(c,2),d=u[0],f=u[1],h=q.useState(null),g=qu(h,2),m=g[0],p=g[1],v=Pc({query:{select:function(C){var k=C.data;return k}}}),b=v.data,w=Fi({query:{select:function(C){var k=C.data;return k==null?void 0:k.brands}}}),S=w.data,x=S==null?void 0:S.find(function(O){return O.id===m});return y.jsxs("form",{children:[y.jsxs(E.Card,{children:[y.jsx(e1,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(E.Card.Content,{children:[y.jsxs(Ip,{children:[y.jsxs($p,{className:"yst-space-y-2",children:[y.jsx(E.Title,{size:"4",children:"Brands"}),y.jsxs("p",{children:["You have"," ",y.jsxs("b",{children:[(t=b==null?void 0:b.activeSubscriptions)!==null&&t!==void 0?t:"—"," active subscriptions"]}),". This gives you up to"," ",y.jsxs("b",{children:[(n=b==null?void 0:b.activeSubscriptions)!==null&&n!==void 0?n:"—"," active brands"]}),", for which we’ll automatically run a weekly analysis."]}),y.jsx("p",{children:"You can activate or deactivate brands anytime, or permanently delete a brand and all its data."})]}),y.jsxs(Dp,{children:[S&&y.jsxs("p",{className:"yst-flex yst-w-full yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-2 yst-border-b-[1px] yst-border-b-slate-200 yst-py-4 yst-font-medium yst-text-slate-800",children:["Active brands: ",(r=b==null?void 0:b.numberOfActiveBrands)!==null&&r!==void 0?r:"—"," of"," ",(i=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&i!==void 0?i:"—"]}),S&&S.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(E.Link,{as:Yr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(S!=null?S:[{id:"loading",name:"Loading..."}]).map(function(O,C,k){return y.jsx(KR,{brand:O,isLast:C===k.length-1,onDelete:function(_){p(_),l(!0)}},O.id)})]})]}),y.jsx(Fa,{}),y.jsxs(Ip,{children:[y.jsxs($p,{className:"yst-space-y-2",children:[y.jsx(E.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs(Dp,{className:"yst-space-y-4",children:[y.jsxs(E.Button,{variant:"error",onClick:function(){f(!0)},disabled:(S==null?void 0:S.length)===0,children:[y.jsx(xf,{})," Delete all data"]}),y.jsx("p",{children:y.jsxs("i",{children:[y.jsx("b",{children:"Note:"})," This will erase everything and cannot be reversed."]})})]})]})]})]}),y.jsx(LR,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:x==null?void 0:x.name}),y.jsx(TR,{isOpen:d,onClose:function(){f(!1)}})]})};const XR=Object.freeze(Object.defineProperty({__proto__:null,default:YR},Symbol.toStringTag,{value:"Module"}));function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}var ef=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT. This helps us analyze how visible your brand is in their responses."},{path:"/setup/:brandId/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/:brandId/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT. This process should take around 5 minutes."}],JR=function(t){return ef.find(function(n){return!!Ds(n.path,t)})||ef[0]};function ZR(){var e=Ut(),t=JR(e.pathname);return y.jsxs(E.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(Ix,{title:y.jsx(Nx,{currentStep:t,steps:ef}),description:t.description}),y.jsx(E.Paper.Content,{children:y.jsx(Is,{})})]})}var Nx=function(t){var n=t.title,r=t.currentStep,i=t.steps;return y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:fc(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:fc(r)==="object"?r.title:n||"Step ".concat(r)})]})};const eN=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:Nx,default:ZR},Symbol.toStringTag,{value:"Module"}));var Fx=function(t){var n=t.onBack,r=t.variant,i=r===void 0?"ai":r,s=t.buttonText,o=t.onButtonClick,a=t.isButtonDisabled,l=a===void 0?!1:a,c=t.isLoading,u=c===void 0?!1:c;return y.jsx(wf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:_e({"yst-flex yst-flex-1 yst-flex-col yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-between":n}),children:[n&&y.jsx(E.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:_e("yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-end"),children:y.jsxs(E.Button,{onClick:o,variant:i==="ai"?"primary":i,className:"yst-gap-1.5",style:i==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:l,type:"submit",isLoading:u,children:[i==="ai"&&y.jsx(KO,{}),s]})})]})})},tN=[{value:"US",label:"United States"},{value:"GB",label:"United Kingdom"},{value:"CA",label:"Canada"},{value:"AU",label:"Australia"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"NL",label:"Netherlands"}],nN=[{value:"AR",label:"Argentina"},{value:"BE",label:"Belgium"},{value:"BR",label:"Brazil"},{value:"CN",label:"China"},{value:"EG",label:"Egypt"},{value:"ID",label:"Indonesia"},{value:"IE",label:"Ireland"},{value:"IL",label:"Israel"},{value:"IN",label:"India"},{value:"IT",label:"Italy"},{value:"JP",label:"Japan"},{value:"KR",label:"South Korea"},{value:"MX",label:"Mexico"},{value:"NG",label:"Nigeria"},{value:"PL",label:"Poland"},{value:"RU",label:"Russia"},{value:"SA",label:"Saudi Arabia"},{value:"SE",label:"Sweden"},{value:"ES",label:"Spain"},{value:"TH",label:"Thailand"},{value:"TR",label:"Turkey"},{value:"TW",label:"Taiwan"},{value:"ZA",label:"South Africa"}],Lp=[].concat(tN,nN,[{value:"OTHER",label:"Other"}]),rN=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"zh",label:"Chinese (Mandarin)"},{value:"ja",label:"Japanese"}],iN=[{value:"ar",label:"Arabic"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"fi",label:"Finnish"},{value:"hi",label:"Hindi"},{value:"it",label:"Italian"},{value:"ko",label:"Korean"},{value:"no",label:"Norwegian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"ru",label:"Russian"},{value:"sv",label:"Swedish"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"}],sN=[].concat(rN,iN);function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Np(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rp(Object(n),!0).forEach(function(r){Bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bx(e,t,n){return(t=oN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oN(e){var t=aN(e,"string");return Ur(t)=="symbol"?t:t+""}function aN(e,t){if(Ur(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ur(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function So(e,t){return dN(e)||uN(e,t)||cN(e,t)||lN()}function lN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1291
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cN(e,t){if(e){if(typeof e=="string")return Fp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fp(e,t):void 0}}function Fp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uN(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function dN(e){if(Array.isArray(e))return e}var fN=function(){var t,n=ln(),r=Ia(),i=Kt(),s=q.useState(),o=So(s,2),a=o[0],l=o[1],c=q.useState(!1),u=So(c,2),d=u[0],f=u[1],h=q.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=So(h,2),m=g[0],p=g[1],v=q.useState(null),b=So(v,2),w=b[0],S=b[1],x=Bk({mutation:{onSuccess:function($){var L=$.data.id;i.invalidateQueries({queryKey:[bf(),sr()]}),L&&r.setBrandId(L),$!=null&&$.status&&$.status>=200&&$.status<300&&L&&(r.setBrandId(L),l(L))},onError:function(){f(!1)}}}),O=x.mutate,C=x.isPending,k=x.error,_=Fi({query:{enabled:!!a,select:function($){var L=$.data;return L==null?void 0:L.brands},refetchInterval:function($){var L;return(($==null||(L=$.state)===null||L===void 0||(L=L.data)===null||L===void 0||(L=L.data)===null||L===void 0?void 0:L.brands)||[]).find(function(Z){return Z.id===a})?!1:2*1e3}}}),A=_.data;q.useEffect(function(){a&&A!==null&&A!==void 0&&A.find(function(T){return T.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,A,n]);var D=function($,L){p(function(Z){return Np(Np({},Z),{},Bx({},$,L))})},I=function($){if($.preventDefault(),S(null),m.description.length>250){S("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var L=m.url;L&&!/^https?:\/\//i.test(L)&&(L="https://".concat(L)),O({data:{name:m.name,url:L,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function z(T){return Ur(T)==="object"&&T!==null&&"response"in T&&Ur(T.response)==="object"&&T.response!==void 0&&"data"in T.response}var N=z(k)?k.response.data.errors:void 0;return y.jsxs("form",{onSubmit:I,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(E.Title,{size:"2",children:"Brand info"}),!!k&&y.jsx(E.Alert,{variant:"error",title:"Error",isVisible:!!k,children:y.jsx("ul",{children:N&&Ur(N)==="object"?Object.entries(N).flatMap(function(T){var $=So(T,2),L=$[0],Z=$[1];return Array.isArray(Z)?Z.map(function(ue,F){return y.jsx("li",{children:ue},"".concat(L,"-").concat(F))}):null}):"There was an error creating the brand."})}),w&&y.jsx(E.Alert,{variant:"error",title:"Error",isVisible:!!w,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(E.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(T){return D("name",T.target.value)}}),y.jsx(E.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(T){return D("url",T.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(E.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(T){var $=T.target.value;D("description",$)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:_e("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(E.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(T){return D("language",T)},options:sN.map(function(T){return{label:T.label,value:T.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Fa,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(E.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(E.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(T){return D("country",T)},onQueryChange:function(){},selectedLabel:((t=Lp.find(function(T){return T.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Lp.map(function(T){return y.jsx(E.Autocomplete.Option,{value:T.value,children:T.label},T.value)})}),m.country&&y.jsx(E.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(T){return D("region",T.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
|
|
1292
|
+
example: California, Bavaria, or Paris.`})]}),y.jsx(Fx,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:C||!!a||d,isLoading:C||!!a})]})};const hN=Object.freeze(Object.defineProperty({__proto__:null,default:fN},Symbol.toStringTag,{value:"Module"})),gN=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z",stroke:"url(#paint0_linear_3891_2757)",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("defs",null,M.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},M.createElement("stop",{stopColor:"#A61E69"}),M.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function ma(e){"@babel/helpers - typeof";return ma=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(e)}function yN(e){return vN(e)||pN(e)||qx(e)||mN()}function mN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1293
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vN(e){if(Array.isArray(e))return tf(e)}function Bp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bp(Object(n),!0).forEach(function(r){bN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bN(e,t,n){return(t=xN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xN(e){var t=wN(e,"string");return ma(t)=="symbol"?t:t+""}function wN(e,t){if(ma(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ma(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qi(e,t){return _N(e)||CN(e,t)||qx(e,t)||SN()}function SN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1294
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qx(e,t){if(e){if(typeof e=="string")return tf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tf(e,t):void 0}}function tf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function CN(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function _N(e){if(Array.isArray(e))return e}var Do=5,Io="Generating...",kN="Re-generating...",ON=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],EN=Array.from({length:Do},function(e,t){return{id:"query-".concat(t),text:Io,isRegenerating:!0}}),AN=function(){var t=gc(),n=t.brandId,r="/setup/".concat(n,"/analysis"),i=ln(),s=Kt(),o=q.useState(EN),a=Qi(o,2),l=a[0],c=a[1],u=q.useState(!1),d=Qi(u,2),f=d[0],h=d[1],g=q.useState([]),m=Qi(g,2),p=m[0],v=m[1],b=q.useState([]),w=Qi(b,2),S=w[0],x=w[1],O=q.useState(!1),C=Qi(O,2),k=C[0],_=C[1],A=q.useState(null),D=Qi(A,2),I=D[0],z=D[1],N=iO(n||"",{query:{enabled:!!n}}),T=N.data,$=N.isRefetching,L=N.refetch,Z=eO({mutation:{onSuccess:function(Q){z(null),Q!=null&&Q.status&&Q.status>=200&&Q.status<300&&(s.invalidateQueries({queryKey:[pf(n||"")]}),i(r))},onError:function(Q){var Ce,H;if((Q==null||(Ce=Q.response)===null||Ce===void 0||(Ce=Ce.data)===null||Ce===void 0?void 0:Ce.message)==="Cannot update queries for a brand that has existing analyses."){i(r,{replace:!0});return}var Pe=(Q==null||(H=Q.response)===null||H===void 0||(H=H.data)===null||H===void 0?void 0:H.message)||(Q==null?void 0:Q.message)||"An unexpected error occurred.";z(Pe)}}}),ue=Z.mutate,F=Z.isPending;q.useEffect(function(){n||i("/setup",{replace:!0})},[n,i]),q.useEffect(function(){var ie;if(T!=null&&(ie=T.data)!==null&&ie!==void 0&&ie.queries&&Array.isArray(T.data.queries)){var Q=T.data.queries.slice(0,Do);c(Q.map(function(Ce,H){return{id:"query-".concat(H),text:Ce,isRegenerating:!1}})),x(T.data.queries.slice(Do))}},[T]),q.useEffect(function(){var ie;if(k&&T!==null&&T!==void 0&&(ie=T.data)!==null&&ie!==void 0&&ie.queries&&Array.isArray(T.data.queries)&&!$){var Q=T.data.queries.slice(0,Do),Ce=p.map(Number);c(function(H){return H.map(function(Pe,et){var nt=Ce.indexOf(et);return _r(_r({},Pe),{},{text:nt>=0&&Q[nt]?Q[nt]:Pe.text,isRegenerating:!1})})}),_(!1),v([])}},[T,$,k,p]);var V=q.useCallback(function(ie,Q){var Ce=new Set(Q);return S.filter(function(H){return!Ce.has(H)}).slice(0,ie)},[S]),re=q.useMemo(function(){return $||l.length===0||l.some(function(ie){return ie.isRegenerating||ie.text===Io})||f},[$,l,f]),se=$||l.some(function(ie){return ie.text===Io}),R=q.useCallback(function(ie){var Q=ie.toString();v(function(Ce){return Ce.includes(Q)?Ce.filter(function(H){return H!==Q}):[].concat(yN(Ce),[Q])})},[]),ae=q.useCallback(function(ie,Q){c(function(Ce){return Ce.map(function(H,Pe){return Pe===ie?_r(_r({},H),{},{text:Q}):H})})},[]),ne=function(){h(!f),v([])},xe=q.useCallback(function(){if(!($||p.length===0)){c(function(H){return H.map(function(Pe,et){return _r(_r({},Pe),{},{isRegenerating:p.includes(et.toString())})})});var ie=l.map(function(H){return H.text}),Q=p.length,Ce=V(Q,ie);Ce.length===Q?(c(function(H){return H.map(function(Pe,et){var nt=p.indexOf(et.toString());return nt>=0?_r(_r({},Pe),{},{text:Ce[nt],isRegenerating:!1}):Pe})}),x(function(H){var Pe=new Set(Ce);return H.filter(function(et){return!Pe.has(et)})}),v([])):(_(!0),L())}},[$,p,L,l,V]),ee=q.useCallback(function(ie){ie.preventDefault(),n&&ue({brandId:n,data:{queries:l.map(function(Q){return Q.text})}})},[n,l,ue]);return y.jsxs("div",{children:[I&&y.jsx(E.Alert,{className:"yst-mb-4",variant:"error",children:I}),y.jsxs("form",{onSubmit:ee,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(E.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:_e("yst-flex yst-gap-2",f?"yst-justify-end":"yst-justify-start"),children:f?y.jsxs(y.Fragment,{children:[y.jsx(E.Button,{size:"small",variant:"secondary",onClick:ne,children:"Done"}),y.jsxs(E.Button,{variant:"secondary",size:"small",onClick:xe,className:"yst-gap-1",isLoading:$,disabled:$||p.length===0,children:[y.jsx(gN,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(E.Button,{size:"small",variant:"secondary",onClick:ne,className:"yst-gap-1.5",disabled:se,children:[y.jsx(jO,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:l.length===0?ON.map(function(ie,Q){return y.jsx("div",{className:_e("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(E.SkeletonLoader,{children:ie||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(Q))}):l.slice(0,Do).map(function(ie,Q){var Ce=ie.isRegenerating?ie.text===Io?Io:kN:ie.text;return y.jsx("div",{className:_e("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[f&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(E.Checkbox,{id:"query-regenerate-".concat(Q),name:"query-regenerate-".concat(Q),value:Q.toString(),checked:p.includes(Q.toString()),onChange:function(){return R(Q)},disabled:$})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(E.Label,{htmlFor:"query-text-".concat(Q),className:"yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700",children:"Query ".concat(Q+1)}),y.jsx(E.TextInput,{id:"query-text-".concat(Q),type:"text",value:Ce,onChange:function(H){ie.isRegenerating||ae(Q,H.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ie.isRegenerating,required:!0,maxLength:255})]})]})},ie.id)})}),y.jsx(Fx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:re,isLoading:F})]})]})};const PN=Object.freeze(Object.defineProperty({__proto__:null,default:AN},Symbol.toStringTag,{value:"Module"}));var TN=["min","max","progress","className"];function jN(e,t){if(e==null)return{};var n,r,i=MN(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function MN(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var zx=q.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=jN(e,TN),a=q.useMemo(function(){var c=Math.max(0,r-n);if(c===0)return 0;var u=(i-n)/c*100;return Math.max(0,Math.min(100,u))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:_e(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});zx.displayName="ProgressBarGradient";var Yi=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],Hx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var c=0;c<Yi.length;c++)if(r<=Yi[c].threshold)return Yi[c];return Yi[Yi.length-1]},a=o();return y.jsxs("div",{className:_e("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(E.Spinner,{}):y.jsx(Yv,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(zx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:Yi.map(function(l){return y.jsx("span",{children:y.jsx(jc,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};Hx.propTypes={progress:kd.number,className:kd.string};var $N=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},DN=function(){var t,n,r,i=ln(),s=Kt(),o=gc(),a=Gn(),l=a.brandId,c=o.brandId||l,u=vf(c,{query:{enabled:!!c,select:function(S){var x=S.data;return x}}}),d=u.data,f=_k(c,"latest",{query:{enabled:!!c,select:function(S){var x=S.data;return x},refetchInterval:function(S){var x,O=S==null||(x=S.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return $N(O==null?void 0:O.status)}}}),h=f.data;q.useEffect(function(){var w=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&iP(d.nextScheduledAnalysis,5)&&!w&&i("/brands/".concat(c),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,c,i,h==null?void 0:h.status]),q.useEffect(function(){d!=null&&d.firstNextAnalysisOpportunity&&!ab(d.firstNextAnalysisOpportunity,2)&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,m,i]);var g=h==null?void 0:h.id,m=g?"/brands/".concat(c,"/analysis/").concat(g):"/brands/".concat(c),p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var w=80/p,S=v*w;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(S,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(Hx,{progress:b}),y.jsx(Fa,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(w){var S,x=w.id,O=w.query,C=x&&(h==null||(S=h.completedQueries)===null||S===void 0?void 0:S.includes(x));return y.jsxs("div",{className:_e("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[C===!0?y.jsx(Yv,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(E.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:O})]},"result-item-".concat(O))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(E.Button,{as:Yr,to:m,onClick:function(){return s.clear()},children:b===100?"Continue →":"Skip for now"})})]})};const IN=Object.freeze(Object.defineProperty({__proto__:null,default:DN},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=T$;exports.setApiBaseUrl=Lv;
|
|
1295
1295
|
//# sourceMappingURL=ai-insights-client.cjs.js.map
|